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/MidiProgramsEditor.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/MidiProgramsEditor.cpp')
-rw-r--r-- | src/gui/studio/MidiProgramsEditor.cpp | 136 |
1 files changed, 68 insertions, 68 deletions
diff --git a/src/gui/studio/MidiProgramsEditor.cpp b/src/gui/studio/MidiProgramsEditor.cpp index 8f81a04..e69b1a9 100644 --- a/src/gui/studio/MidiProgramsEditor.cpp +++ b/src/gui/studio/MidiProgramsEditor.cpp @@ -38,29 +38,29 @@ #include <klineedit.h> #include <klocale.h> #include <kstddirs.h> -#include <qcheckbox.h> -#include <qcursor.h> -#include <qfile.h> -#include <qframe.h> -#include <qlabel.h> -#include <qlayout.h> -#include <qobjectlist.h> -#include <qpixmap.h> -#include <qpoint.h> -#include <qpopupmenu.h> -#include <qpushbutton.h> -#include <qspinbox.h> -#include <qstring.h> -#include <qtooltip.h> -#include <qvgroupbox.h> -#include <qwidget.h> +#include <tqcheckbox.h> +#include <tqcursor.h> +#include <tqfile.h> +#include <tqframe.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqobjectlist.h> +#include <tqpixmap.h> +#include <tqpoint.h> +#include <tqpopupmenu.h> +#include <tqpushbutton.h> +#include <tqspinbox.h> +#include <tqstring.h> +#include <tqtooltip.h> +#include <tqvgroupbox.h> +#include <tqwidget.h> #include <algorithm> namespace Rosegarden { MidiProgramsEditor::MidiProgramsEditor(BankEditorDialog* bankEditor, - QWidget* parent, + TQWidget* parent, const char* name) : NameSetEditor(bankEditor, i18n("Bank and Program details"), @@ -70,57 +70,57 @@ MidiProgramsEditor::MidiProgramsEditor(BankEditorDialog* bankEditor, m_programList(bankEditor->getProgramList()), m_oldBank(false, 0, 0) { - QWidget *additionalWidget = makeAdditionalWidget(m_mainFrame); + TQWidget *additionalWidget = makeAdditionalWidget(m_mainFrame); if (additionalWidget) { m_mainLayout->addMultiCellWidget(additionalWidget, 0, 2, 0, 2); } } -QWidget * -MidiProgramsEditor::makeAdditionalWidget(QWidget *parent) +TQWidget * +MidiProgramsEditor::makeAdditionalWidget(TQWidget *parent) { - QFrame *frame = new QFrame(parent); + TQFrame *frame = new TQFrame(parent); - m_percussion = new QCheckBox(frame); - m_msb = new QSpinBox(frame); - m_lsb = new QSpinBox(frame); + m_percussion = new TQCheckBox(frame); + m_msb = new TQSpinBox(frame); + m_lsb = new TQSpinBox(frame); - QGridLayout *gridLayout = new QGridLayout(frame, + TQGridLayout *gridLayout = new TQGridLayout(frame, 3, // rows 2, // cols 2); // margin - gridLayout->addWidget(new QLabel(i18n("Percussion"), frame), + gridLayout->addWidget(new TQLabel(i18n("Percussion"), frame), 0, 0, AlignLeft); gridLayout->addWidget(m_percussion, 0, 1, AlignLeft); - connect(m_percussion, SIGNAL(clicked()), - this, SLOT(slotNewPercussion())); + connect(m_percussion, TQT_SIGNAL(clicked()), + this, TQT_SLOT(slotNewPercussion())); - gridLayout->addWidget(new QLabel(i18n("MSB Value"), frame), + gridLayout->addWidget(new TQLabel(i18n("MSB Value"), frame), 1, 0, AlignLeft); m_msb->setMinValue(0); m_msb->setMaxValue(127); gridLayout->addWidget(m_msb, 1, 1, AlignLeft); - QToolTip::add + TQToolTip::add (m_msb, i18n("Selects a MSB controller Bank number (MSB/LSB pairs are always unique for any Device)")); - QToolTip::add + TQToolTip::add (m_lsb, i18n("Selects a LSB controller Bank number (MSB/LSB pairs are always unique for any Device)")); - connect(m_msb, SIGNAL(valueChanged(int)), - this, SLOT(slotNewMSB(int))); + connect(m_msb, TQT_SIGNAL(valueChanged(int)), + this, TQT_SLOT(slotNewMSB(int))); - gridLayout->addWidget(new QLabel(i18n("LSB Value"), frame), + gridLayout->addWidget(new TQLabel(i18n("LSB Value"), frame), 2, 0, AlignLeft); m_lsb->setMinValue(0); m_lsb->setMaxValue(127); gridLayout->addWidget(m_lsb, 2, 1, AlignLeft); - connect(m_lsb, SIGNAL(valueChanged(int)), - this, SLOT(slotNewLSB(int))); + connect(m_lsb, TQT_SIGNAL(valueChanged(int)), + this, TQT_SLOT(slotNewLSB(int))); return frame; } @@ -180,7 +180,7 @@ MidiProgramsEditor::clearAll() } void -MidiProgramsEditor::populate(QListViewItem* item) +MidiProgramsEditor::populate(TQListViewItem* item) { RG_DEBUG << "MidiProgramsEditor::populate\n"; @@ -221,14 +221,14 @@ MidiProgramsEditor::populate(QListViewItem* item) ProgramList programSubset = getBankSubset(*m_currentBank); ProgramList::iterator it; - QPixmap noKeyPixmap, keyPixmap; - QString pixmapDir = KGlobal::dirs()->findResource("appdata", "pixmaps/"); - QString file = pixmapDir + "/toolbar/key-white.png"; - if (QFile(file).exists()) - noKeyPixmap = QPixmap(file); + TQPixmap noKeyPixmap, keyPixmap; + TQString pixmapDir = KGlobal::dirs()->findResource("appdata", "pixmaps/"); + TQString file = pixmapDir + "/toolbar/key-white.png"; + if (TQFile(file).exists()) + noKeyPixmap = TQPixmap(file); file = pixmapDir + "/toolbar/key-green.png"; - if (QFile(file).exists()) - keyPixmap = QPixmap(file); + if (TQFile(file).exists()) + keyPixmap = TQPixmap(file); bool haveKeyMappings = m_currentBank->isPercussion() && (m_device->getKeyMappings().size() > 0); @@ -237,19 +237,19 @@ MidiProgramsEditor::populate(QListViewItem* item) m_names[i]->clear(); getEntryButton(i)->setEnabled(haveKeyMappings); getEntryButton(i)->setPixmap(noKeyPixmap); - QToolTip::remove + TQToolTip::remove ( getEntryButton(i) ); for (it = programSubset.begin(); it != programSubset.end(); it++) { if (it->getProgram() == i) { - QString programName = strtoqstr(it->getName()); + TQString programName = strtoqstr(it->getName()); m_completion.addItem(programName); m_names[i]->setText(programName); if (m_device->getKeyMappingForProgram(*it)) { getEntryButton(i)->setPixmap(keyPixmap); - QToolTip::add + TQToolTip::add (getEntryButton(i), i18n("Key Mapping: %1").arg( strtoqstr(m_device->getKeyMappingForProgram(*it)->getName()))); @@ -383,7 +383,7 @@ struct ProgramCmp }; void -MidiProgramsEditor::slotNameChanged(const QString& programName) +MidiProgramsEditor::slotNameChanged(const TQString& programName) { const KLineEdit* lineEdit = dynamic_cast<const KLineEdit*>(sender()); if (!lineEdit) { @@ -391,7 +391,7 @@ MidiProgramsEditor::slotNameChanged(const QString& programName) return ; } - QString senderName = sender()->name(); + TQString senderName = sender()->name(); // Adjust value back to zero rated // @@ -444,13 +444,13 @@ MidiProgramsEditor::slotNameChanged(const QString& programName) void MidiProgramsEditor::slotEntryButtonPressed() { - QPushButton* button = dynamic_cast<QPushButton*>(const_cast<QObject *>(sender())); + TQPushButton* button = dynamic_cast<TQPushButton*>(const_cast<TQObject *>(sender())); if (!button) { RG_DEBUG << "MidiProgramsEditor::slotEntryButtonPressed() : %%% ERROR - signal sender is not a QPushButton\n"; return ; } - QString senderName = button->name(); + TQString senderName = button->name(); if (!m_device) return ; @@ -474,12 +474,12 @@ MidiProgramsEditor::slotEntryButtonPressed() int currentEntry = 0; menu->insertItem(i18n("<no key mapping>"), this, - SLOT(slotEntryMenuItemSelected(int)), 0, 0); + TQT_SLOT(slotEntryMenuItemSelected(int)), 0, 0); menu->setItemParameter(0, 0); for (int i = 0; i < kml.size(); ++i) { menu->insertItem(strtoqstr(kml[i].getName()), - this, SLOT(slotEntryMenuItemSelected(int)), + this, TQT_SLOT(slotEntryMenuItemSelected(int)), 0, i + 1); menu->setItemParameter(i + 1, i + 1); if (currentMapping && (kml[i] == *currentMapping)) @@ -487,7 +487,7 @@ MidiProgramsEditor::slotEntryButtonPressed() } int itemHeight = menu->itemHeight(0) + 2; - QPoint pos = QCursor::pos(); + TQPoint pos = TQCursor::pos(); pos.rx() -= 10; pos.ry() -= (itemHeight / 2 + currentEntry * itemHeight); @@ -521,23 +521,23 @@ MidiProgramsEditor::slotEntryMenuItemSelected(int i) } m_device->setKeyMappingForProgram(*program, newMapping); - QString pixmapDir = KGlobal::dirs()->findResource("appdata", "pixmaps/"); + TQString pixmapDir = KGlobal::dirs()->findResource("appdata", "pixmaps/"); bool haveKeyMappings = (m_device->getKeyMappings().size() > 0); - QPushButton *btn = getEntryButton(m_currentMenuProgram); + TQPushButton *btn = getEntryButton(m_currentMenuProgram); if (newMapping.empty()) { - QString file = pixmapDir + "/toolbar/key-white.png"; - if (QFile(file).exists()) { - btn->setPixmap(QPixmap(file)); + TQString file = pixmapDir + "/toolbar/key-white.png"; + if (TQFile(file).exists()) { + btn->setPixmap(TQPixmap(file)); } - QToolTip::remove + TQToolTip::remove (btn); } else { - QString file = pixmapDir + "/toolbar/key-green.png"; - if (QFile(file).exists()) { - btn->setPixmap(QPixmap(file)); + TQString file = pixmapDir + "/toolbar/key-green.png"; + if (TQFile(file).exists()) { + btn->setPixmap(TQPixmap(file)); } - QToolTip::add + TQToolTip::add (btn, i18n("Key Mapping: %1").arg(strtoqstr(newMapping))); } btn->setEnabled(haveKeyMappings); @@ -607,16 +607,16 @@ MidiProgramsEditor::getProgram(const MidiBank &bank, int programNo) } void -MidiProgramsEditor::setBankName(const QString& s) +MidiProgramsEditor::setBankName(const TQString& s) { setTitle(s); } void MidiProgramsEditor::blockAllSignals(bool block) { - const QObjectList* allChildren = queryList("KLineEdit", "[0-9]+"); - QObjectListIt it(*allChildren); - QObject *obj; + const TQObjectList* allChildren = queryList("KLineEdit", "[0-9]+"); + TQObjectListIt it(*allChildren); + TQObject *obj; while ( (obj = it.current()) != 0 ) { obj->blockSignals(block); |