diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-09-06 20:59:29 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-09-06 20:59:29 +0000 |
commit | 11f31c37e5fa4889d9989f10272f44845449cb7b (patch) | |
tree | 4383da04a76c497950d957fc6120b0fd0d9082c2 /src/gui/studio/DeviceManagerDialog.cpp | |
parent | 832eb69d571e8e518db45d0c0e6fbc0f00690209 (diff) | |
download | rosegarden-11f31c37e5fa4889d9989f10272f44845449cb7b.tar.gz rosegarden-11f31c37e5fa4889d9989f10272f44845449cb7b.zip |
Initial TQt conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/rosegarden@1172292 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/gui/studio/DeviceManagerDialog.cpp')
-rw-r--r-- | src/gui/studio/DeviceManagerDialog.cpp | 228 |
1 files changed, 114 insertions, 114 deletions
diff --git a/src/gui/studio/DeviceManagerDialog.cpp b/src/gui/studio/DeviceManagerDialog.cpp index 8f2fa6b..eb40c77 100644 --- a/src/gui/studio/DeviceManagerDialog.cpp +++ b/src/gui/studio/DeviceManagerDialog.cpp @@ -54,22 +54,22 @@ #include <kmessagebox.h> #include <kstdaccel.h> #include <kstdaction.h> -#include <qcstring.h> -#include <qdatastream.h> -#include <qdialog.h> -#include <qdir.h> -#include <qfileinfo.h> -#include <qframe.h> -#include <qgrid.h> -#include <qgroupbox.h> -#include <qlayout.h> -#include <qpushbutton.h> -#include <qsizepolicy.h> -#include <qstring.h> -#include <qstringlist.h> -#include <qtable.h> -#include <qtooltip.h> -#include <qwidget.h> +#include <tqcstring.h> +#include <tqdatastream.h> +#include <tqdialog.h> +#include <tqdir.h> +#include <tqfileinfo.h> +#include <tqframe.h> +#include <tqgrid.h> +#include <tqgroupbox.h> +#include <tqlayout.h> +#include <tqpushbutton.h> +#include <tqsizepolicy.h> +#include <tqstring.h> +#include <tqstringlist.h> +#include <tqtable.h> +#include <tqtooltip.h> +#include <tqwidget.h> namespace Rosegarden @@ -83,21 +83,21 @@ static const int RECORD_CURRENT_COL = 1; static const int RECORD_CONNECTION_COL = 2; -DeviceManagerDialog::DeviceManagerDialog(QWidget *parent, +DeviceManagerDialog::DeviceManagerDialog(TQWidget *parent, RosegardenGUIDoc *document) : KMainWindow(parent, "deviceeditordialog"), m_document(document), m_studio(&document->getStudio()) { - QFrame * mainBox = new QFrame(this); + TQFrame * mainBox = new TQFrame(this); setCentralWidget(mainBox); - QVBoxLayout *mainLayout = new QVBoxLayout(mainBox, 10, 10); + TQVBoxLayout *mainLayout = new TQVBoxLayout(mainBox, 10, 10); setCaption(i18n("Manage MIDI Devices")); - QGroupBox *groupBox = new QGroupBox(2, Horizontal, i18n("Play devices"), mainBox); + TQGroupBox *groupBox = new TQGroupBox(2, Horizontal, i18n("Play devices"), mainBox); - m_playTable = new QTable(0, 2, groupBox); + m_playTable = new TQTable(0, 2, groupBox); m_playTable->setSorting(false); m_playTable->setRowMovingEnabled(false); m_playTable->setColumnMovingEnabled(false); @@ -107,55 +107,55 @@ DeviceManagerDialog::DeviceManagerDialog(QWidget *parent, m_playTable->horizontalHeader()->show(); m_playTable->verticalHeader()->hide(); m_playTable->setLeftMargin(0); - m_playTable->setSelectionMode(QTable::SingleRow); - - QFrame *frame = new QFrame(groupBox); - QVBoxLayout *vlayout = new QVBoxLayout(frame); - QGrid *buttons = new QGrid(2, Horizontal, frame); - QPushButton *addButton = new QPushButton(i18n("New"), buttons); - m_deletePlayButton = new QPushButton(i18n("Delete"), buttons); - m_importButton = new QPushButton(i18n("Import..."), buttons); - m_exportButton = new QPushButton(i18n("Export..."), buttons); - m_banksButton = new QPushButton(i18n("Banks..."), buttons); - m_controllersButton = new QPushButton(i18n("Control Events..."), buttons); + m_playTable->setSelectionMode(TQTable::SingleRow); + + TQFrame *frame = new TQFrame(groupBox); + TQVBoxLayout *vlayout = new TQVBoxLayout(frame); + TQGrid *buttons = new TQGrid(2, Horizontal, frame); + TQPushButton *addButton = new TQPushButton(i18n("New"), buttons); + m_deletePlayButton = new TQPushButton(i18n("Delete"), buttons); + m_importButton = new TQPushButton(i18n("Import..."), buttons); + m_exportButton = new TQPushButton(i18n("Export..."), buttons); + m_banksButton = new TQPushButton(i18n("Banks..."), buttons); + m_controllersButton = new TQPushButton(i18n("Control Events..."), buttons); vlayout->addWidget(buttons); vlayout->addStretch(10); - QToolTip::add + TQToolTip::add (addButton, i18n("Create a new Play device")); - QToolTip::add + TQToolTip::add (m_deletePlayButton, i18n("Delete the selected device")); - QToolTip::add + TQToolTip::add (m_importButton, i18n("Import Bank, Program and Controller data from a Rosegarden file to the selected device")); - QToolTip::add + TQToolTip::add (m_exportButton, i18n("Export Bank and Controller data to a Rosegarden interchange file")); - QToolTip::add + TQToolTip::add (m_banksButton, i18n("View and edit Banks and Programs for the selected device")); - QToolTip::add + TQToolTip::add (m_controllersButton, i18n("View and edit Control Events for the selected device - these are special Event types that you can define against your device and control through Control Rulers or the Instrument Parameter Box ")); - connect(addButton, SIGNAL(clicked()), this, SLOT(slotAddPlayDevice())); - connect(m_deletePlayButton, SIGNAL(clicked()), this, SLOT(slotDeletePlayDevice())); - connect(m_importButton, SIGNAL(clicked()), this, SLOT(slotImport())); - connect(m_exportButton, SIGNAL(clicked()), this, SLOT(slotExport())); - connect(m_banksButton, SIGNAL(clicked()), this, SLOT(slotSetBanks())); - connect(m_controllersButton, SIGNAL(clicked()), this, SLOT(slotSetControllers())); + connect(addButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotAddPlayDevice())); + connect(m_deletePlayButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotDeletePlayDevice())); + connect(m_importButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotImport())); + connect(m_exportButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotExport())); + connect(m_banksButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotSetBanks())); + connect(m_controllersButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotSetControllers())); - connect(m_playTable, SIGNAL(valueChanged(int, int)), - this, SLOT(slotPlayValueChanged (int, int))); - connect(m_playTable, SIGNAL(currentChanged(int, int)), - this, SLOT(slotPlayDeviceSelected (int, int))); + connect(m_playTable, TQT_SIGNAL(valueChanged(int, int)), + this, TQT_SLOT(slotPlayValueChanged (int, int))); + connect(m_playTable, TQT_SIGNAL(currentChanged(int, int)), + this, TQT_SLOT(slotPlayDeviceSelected (int, int))); mainLayout->addWidget(groupBox); - groupBox = new QGroupBox(2, Horizontal, i18n("Record devices"), mainBox); + groupBox = new TQGroupBox(2, Horizontal, i18n("Record devices"), mainBox); - m_recordTable = new QTable(0, 3, groupBox); + m_recordTable = new TQTable(0, 3, groupBox); m_recordTable->setSorting(false); m_recordTable->setRowMovingEnabled(false); m_recordTable->setColumnMovingEnabled(false); @@ -166,32 +166,32 @@ DeviceManagerDialog::DeviceManagerDialog(QWidget *parent, m_recordTable->horizontalHeader()->show(); m_recordTable->verticalHeader()->hide(); m_recordTable->setLeftMargin(0); - m_recordTable->setSelectionMode(QTable::SingleRow); + m_recordTable->setSelectionMode(TQTable::SingleRow); - frame = new QFrame(groupBox); - vlayout = new QVBoxLayout(frame); - buttons = new QGrid(2, Horizontal, frame); - addButton = new QPushButton(i18n("New"), buttons); - m_deleteRecordButton = new QPushButton(i18n("Delete"), buttons); + frame = new TQFrame(groupBox); + vlayout = new TQVBoxLayout(frame); + buttons = new TQGrid(2, Horizontal, frame); + addButton = new TQPushButton(i18n("New"), buttons); + m_deleteRecordButton = new TQPushButton(i18n("Delete"), buttons); vlayout->addWidget(buttons); vlayout->addStretch(10); - QToolTip::add + TQToolTip::add (addButton, i18n("Create a new Record device")); - QToolTip::add + TQToolTip::add (m_deleteRecordButton, i18n("Delete the selected device")); - connect(addButton, SIGNAL(clicked()), this, SLOT(slotAddRecordDevice())); - connect(m_deleteRecordButton, SIGNAL(clicked()), this, SLOT(slotDeleteRecordDevice())); + connect(addButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotAddRecordDevice())); + connect(m_deleteRecordButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotDeleteRecordDevice())); - connect(m_recordTable, SIGNAL(currentChanged(int, int)), - this, SLOT(slotRecordDeviceSelected (int, int))); - connect(m_recordTable, SIGNAL(valueChanged(int, int)), - this, SLOT(slotRecordValueChanged (int, int))); + connect(m_recordTable, TQT_SIGNAL(currentChanged(int, int)), + this, TQT_SLOT(slotRecordDeviceSelected (int, int))); + connect(m_recordTable, TQT_SIGNAL(valueChanged(int, int)), + this, TQT_SLOT(slotRecordValueChanged (int, int))); - connect(document, SIGNAL(devicesResyncd()), this, SLOT(slotDevicesResyncd())); + connect(document, TQT_SIGNAL(devicesResyncd()), this, TQT_SLOT(slotDevicesResyncd())); m_noConnectionString = i18n("No connection"); @@ -202,24 +202,24 @@ DeviceManagerDialog::DeviceManagerDialog(QWidget *parent, mainLayout->addWidget(groupBox); - QFrame* btnBox = new QFrame(mainBox); + TQFrame* btnBox = new TQFrame(mainBox); btnBox->setSizePolicy( - QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed)); + TQSizePolicy(TQSizePolicy::Minimum, TQSizePolicy::Fixed)); - QPushButton *closeButton = new QPushButton(i18n("Close"), btnBox); + TQPushButton *closeButton = new TQPushButton(i18n("Close"), btnBox); - QHBoxLayout* layout = new QHBoxLayout(btnBox, 0, 10); + TQHBoxLayout* layout = new TQHBoxLayout(btnBox, 0, 10); layout->addStretch(10); layout->addWidget(closeButton); layout->addSpacing(5); KAction* close = KStdAction::close(this, - SLOT(slotClose()), + TQT_SLOT(slotClose()), actionCollection()); closeButton->setText(close->text()); - connect(closeButton, SIGNAL(clicked()), this, SLOT(slotClose())); + connect(closeButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotClose())); mainLayout->addWidget(btnBox); @@ -239,8 +239,8 @@ DeviceManagerDialog::DeviceManagerDialog(QWidget *parent, createGUI("devicemanager.rc"); m_document->getCommandHistory()->attachView(actionCollection()); - connect(m_document->getCommandHistory(), SIGNAL(commandExecuted()), - this, SLOT(populate())); + connect(m_document->getCommandHistory(), TQT_SIGNAL(commandExecuted()), + this, TQT_SLOT(populate())); m_playTable->setCurrentCell( -1, 0); m_recordTable->setCurrentCell( -1, 0); @@ -326,8 +326,8 @@ DeviceManagerDialog::DeviceManagerDialog(QWidget *parent, m_playTable->insertRows(deviceCount, 1); - QString deviceName = i18n("%1").arg(deviceCount + 1); - QString connectionName = strtoqstr((*it)->getConnection()); + TQString deviceName = i18n("%1").arg(deviceCount + 1); + TQString connectionName = strtoqstr((*it)->getConnection()); m_playTable->setText(deviceCount, PLAY_NAME_COL, strtoqstr((*it)->getName())); @@ -338,7 +338,7 @@ DeviceManagerDialog::DeviceManagerDialog(QWidget *parent, currentConnectionIndex = i; } - QComboTableItem *item = new QComboTableItem(m_playTable, m_playConnections, false); + TQComboTableItem *item = new TQComboTableItem(m_playTable, m_playConnections, false); item->setCurrentItem(currentConnectionIndex); m_playTable->setItem(deviceCount, PLAY_CONNECTION_COL, item); @@ -360,8 +360,8 @@ DeviceManagerDialog::DeviceManagerDialog(QWidget *parent, m_recordTable->insertRows(deviceCount, 1); - QString deviceName = i18n("%1").arg(deviceCount + 1); - QString connectionName = strtoqstr((*it)->getConnection()); + TQString deviceName = i18n("%1").arg(deviceCount + 1); + TQString connectionName = strtoqstr((*it)->getConnection()); m_recordTable->setText(deviceCount, RECORD_NAME_COL, strtoqstr((*it)->getName())); @@ -372,11 +372,11 @@ DeviceManagerDialog::DeviceManagerDialog(QWidget *parent, currentConnectionIndex = i; } - QComboTableItem *item = new QComboTableItem(m_recordTable, m_recordConnections, false); + TQComboTableItem *item = new TQComboTableItem(m_recordTable, m_recordConnections, false); item->setCurrentItem(currentConnectionIndex); m_recordTable->setItem(deviceCount, RECORD_CONNECTION_COL, item); - QCheckTableItem *check = new QCheckTableItem(m_recordTable, QString()); + TQCheckTableItem *check = new TQCheckTableItem(m_recordTable, TQString()); //check->setChecked((*it)->getId() == recordDevice); //check->setText(((*it)->getId() == recordDevice) ? // i18n("Yes") : i18n("No")); @@ -401,14 +401,14 @@ DeviceManagerDialog::DeviceManagerDialog(QWidget *parent, void DeviceManagerDialog::makeConnectionList(unsigned int direction, - QStringList &list) + TQStringList &list) { list.clear(); - QByteArray data; - QByteArray replyData; - QCString replyType; - QDataStream arg(data, IO_WriteOnly); + TQByteArray data; + TQByteArray replyData; + TQCString replyType; + TQDataStream arg(data, IO_WriteOnly); arg << (int)Device::Midi; arg << direction; @@ -418,17 +418,17 @@ DeviceManagerDialog::DeviceManagerDialog(QWidget *parent, return ; } - QDataStream reply(replyData, IO_ReadOnly); + TQDataStream reply(replyData, IO_ReadOnly); unsigned int connections = 0; if (replyType == "unsigned int") reply >> connections; for (unsigned int i = 0; i < connections; ++i) { - QByteArray data; - QByteArray replyData; - QCString replyType; - QDataStream arg(data, IO_WriteOnly); + TQByteArray data; + TQByteArray replyData; + TQCString replyType; + TQDataStream arg(data, IO_WriteOnly); arg << (int)Device::Midi; arg << direction; arg << i; @@ -441,9 +441,9 @@ DeviceManagerDialog::DeviceManagerDialog(QWidget *parent, return ; } - QDataStream reply(replyData, IO_ReadOnly); - QString connection; - if (replyType == "QString") { + TQDataStream reply(replyData, IO_ReadOnly); + TQString connection; + if (replyType == "TQString") { reply >> connection; list.append(connection); } @@ -453,7 +453,7 @@ DeviceManagerDialog::DeviceManagerDialog(QWidget *parent, } void - DeviceManagerDialog::closeEvent(QCloseEvent *e) + DeviceManagerDialog::closeEvent(TQCloseEvent *e) { emit closing(); KMainWindow::closeEvent(e); @@ -478,7 +478,7 @@ DeviceManagerDialog::DeviceManagerDialog(QWidget *parent, void DeviceManagerDialog::slotAddPlayDevice() { - QString connection = ""; + TQString connection = ""; if (m_playConnections.size() > 0) connection = m_playConnections[m_playConnections.size() - 1]; CreateOrDeleteDeviceCommand *command = new CreateOrDeleteDeviceCommand @@ -493,7 +493,7 @@ DeviceManagerDialog::DeviceManagerDialog(QWidget *parent, void DeviceManagerDialog::slotAddRecordDevice() { - QString connection = ""; + TQString connection = ""; if (m_recordConnections.size() > 0) connection = m_recordConnections[m_recordConnections.size() - 1]; CreateOrDeleteDeviceCommand *command = new CreateOrDeleteDeviceCommand @@ -516,8 +516,8 @@ DeviceManagerDialog::DeviceManagerDialog(QWidget *parent, (m_studio, id); m_document->getCommandHistory()->addCommand(command); - QByteArray data; - QDataStream arg(data, IO_WriteOnly); + TQByteArray data; + TQDataStream arg(data, IO_WriteOnly); arg << (unsigned int)id; rgapp->sequencerSend("removeDevice(unsigned int)", data); } @@ -560,13 +560,13 @@ DeviceManagerDialog::DeviceManagerDialog(QWidget *parent, (new RenameDeviceCommand(m_studio, id, name)); emit deviceNamesChanged(); - QByteArray data; - QDataStream arg(data, IO_WriteOnly); + TQByteArray data; + TQDataStream arg(data, IO_WriteOnly); arg << (unsigned int)id; arg << m_playTable->text(row, col); - rgapp->sequencerSend("renameDevice(unsigned int, QString)", data); + rgapp->sequencerSend("renameDevice(unsigned int, TQString)", data); } } break; @@ -611,13 +611,13 @@ DeviceManagerDialog::DeviceManagerDialog(QWidget *parent, (new RenameDeviceCommand(m_studio, id, name)); emit deviceNamesChanged(); - QByteArray data; - QDataStream arg(data, IO_WriteOnly); + TQByteArray data; + TQDataStream arg(data, IO_WriteOnly); arg << (unsigned int)id; arg << m_recordTable->text(row, col); - rgapp->sequencerSend("renameDevice(unsigned int, QString)", data); + rgapp->sequencerSend("renameDevice(unsigned int, TQString)", data); } } break; @@ -634,8 +634,8 @@ DeviceManagerDialog::DeviceManagerDialog(QWidget *parent, case RECORD_CURRENT_COL: { m_recordTable->blockSignals(true); - QCheckTableItem *check = - dynamic_cast<QCheckTableItem *>(m_recordTable->item(row, col)); + TQCheckTableItem *check = + dynamic_cast<TQCheckTableItem *>(m_recordTable->item(row, col)); if (!check) return ; @@ -689,8 +689,8 @@ DeviceManagerDialog::DeviceManagerDialog(QWidget *parent, if (id == Device::NO_DEVICE) return ; - QString deviceDir = KGlobal::dirs()->findResource("appdata", "library/"); - QDir dir(deviceDir); + TQString deviceDir = KGlobal::dirs()->findResource("appdata", "library/"); + TQDir dir(deviceDir); if (!dir.exists()) { deviceDir = ":ROSEGARDENDEVICE"; } else { @@ -706,7 +706,7 @@ DeviceManagerDialog::DeviceManagerDialog(QWidget *parent, return ; ImportDeviceDialog *dialog = new ImportDeviceDialog(this, url); - if (dialog->doImport() && dialog->exec() == QDialog::Accepted) { + if (dialog->doImport() && dialog->exec() == TQDialog::Accepted) { ModifyDeviceCommand *command = 0; @@ -761,11 +761,11 @@ DeviceManagerDialog::DeviceManagerDialog(QWidget *parent, void DeviceManagerDialog::slotExport() { - QString extension = "rgd"; + TQString extension = "rgd"; - QString name = + TQString name = KFileDialog::getSaveFileName(":ROSEGARDEN", - (extension.isEmpty() ? QString("*") : ("*." + extension)), + (extension.isEmpty() ? TQString("*") : ("*." + extension)), this, i18n("Export Device as...")); @@ -781,7 +781,7 @@ DeviceManagerDialog::DeviceManagerDialog(QWidget *parent, } } - QFileInfo info(name); + TQFileInfo info(name); if (info.isDir()) { KMessageBox::sorry(this, i18n("You have specified a directory")); @@ -805,7 +805,7 @@ DeviceManagerDialog::DeviceManagerDialog(QWidget *parent, } if (md) { ExportDeviceDialog ed(this, strtoqstr(md->getName())); - if (ed.exec() != QDialog::Accepted) + if (ed.exec() != TQDialog::Accepted) return ; if (ed.getExportType() == ExportDeviceDialog::ExportOne) { devices.push_back(id); |