From bde31d8572b32f4919a9d60b24f4d26186a8cf35 Mon Sep 17 00:00:00 2001 From: Orcan Ogetbil Date: Sat, 27 Nov 2010 03:25:18 +0000 Subject: ported edit instrument. added includes on comboQuant --- muse2/ChangeLog | 3 + muse2/muse/icons.cpp | 6 + muse2/muse/icons.h | 2 + muse2/muse/instruments/CMakeLists.txt | 3 +- muse2/muse/instruments/editinstrument.cpp | 371 +-- muse2/muse/instruments/editinstrument.h | 25 +- muse2/muse/instruments/editinstrumentbase.ui | 3369 ++++++++++++-------------- muse2/muse/widgets/CMakeLists.txt | 1 - muse2/muse/widgets/comboQuant.cpp | 2 + muse2/muse/widgets/listitem.h | 85 - muse2/xpm/filesaveas.xpm | 90 + 11 files changed, 1908 insertions(+), 2049 deletions(-) delete mode 100644 muse2/muse/widgets/listitem.h create mode 100644 muse2/xpm/filesaveas.xpm (limited to 'muse2') diff --git a/muse2/ChangeLog b/muse2/ChangeLog index 2790e03f..82e4c711 100644 --- a/muse2/ChangeLog +++ b/muse2/ChangeLog @@ -7,6 +7,9 @@ - Fixed transform and input transform ui files and dialogs - using the corrected SpinBoxFP. (Tim) - Converted comboQuant widget to Qt4 (found in miditransform dialog). TODO: Doesn't actually open - why? (Tim) + - Finished porting edit instrument dialog to Qt4. listitem.h is removed as it is no longer + needed. (Orcan) + - Added missing includes on comboQuant. The compilation was failing here. (Orcan) 25.11.2010 - Fixed column widths, alignments, device renaming and jack device creation issues in synthconfigbase. Somehow the last changelog entry about this didn't get committed. That's added too. (Orcan) diff --git a/muse2/muse/icons.cpp b/muse2/muse/icons.cpp index 926659ad..f2260b55 100644 --- a/muse2/muse/icons.cpp +++ b/muse2/muse/icons.cpp @@ -79,9 +79,11 @@ #include "xpm/quant.xpm" #include "xpm/fileprint.xpm" #include "xpm/filesave.xpm" +#include "xpm/filesaveas.xpm" #include "xpm/fileopen.xpm" #include "xpm/fileprintS.xpm" #include "xpm/filesaveS.xpm" +#include "xpm/filesaveasS.xpm" #include "xpm/fileopenS.xpm" #include "xpm/master.xpm" #include "xpm/filenew.xpm" @@ -294,8 +296,10 @@ QPixmap* printIcon; QPixmap* printIconS; QPixmap* openIcon; QPixmap* saveIcon; +QPixmap* saveasIcon; QPixmap* openIconS; QPixmap* saveIconS; +QPixmap* saveasIconS; QPixmap* masterIcon; QPixmap* filenewIcon; QPixmap* filenewIconS; @@ -480,9 +484,11 @@ void initIcons() drawIcon = new MPIXMAP(draw_xpm, NULL); quantIcon = new MPIXMAP(quant_xpm, NULL); saveIcon = new MPIXMAP(filesave_xpm, "document-save"); + saveasIcon = new MPIXMAP(filesaveas_xpm, "document-save-as"); printIcon = new MPIXMAP(fileprint_xpm, "document-print"); openIcon = new MPIXMAP(fileopen_xpm, "document-open"); saveIconS = new MPIXMAP(filesaveS_xpm, "document-save"); + saveasIconS = new MPIXMAP(filesaveasS_xpm, "document-save-as"); printIconS = new MPIXMAP(fileprintS_xpm, "document-print"); openIconS = new MPIXMAP(fileopenS_xpm, "document-open"); masterIcon = new MPIXMAP(master_xpm, "mixer-master"); diff --git a/muse2/muse/icons.h b/muse2/muse/icons.h index 17fa7d6f..f0fd89c2 100644 --- a/muse2/muse/icons.h +++ b/muse2/muse/icons.h @@ -57,8 +57,10 @@ extern QPixmap* printIcon; extern QPixmap* printIconS; extern QPixmap* openIcon; extern QPixmap* saveIcon; +extern QPixmap* saveasIcon; extern QPixmap* openIconS; extern QPixmap* saveIconS; +extern QPixmap* saveasIconS; extern QPixmap* archiveIcon; extern QPixmap* findIcon; extern QPixmap* masterIcon; diff --git a/muse2/muse/instruments/CMakeLists.txt b/muse2/muse/instruments/CMakeLists.txt index e4108bb8..9e658928 100644 --- a/muse2/muse/instruments/CMakeLists.txt +++ b/muse2/muse/instruments/CMakeLists.txt @@ -23,8 +23,7 @@ QT4_WRAP_CPP ( instruments_mocs editinstrument.h ) -# QT4_WRAP_UI ( instruments_ui_headers -QT4_WRAP_UI3 ( instruments_ui_headers +QT4_WRAP_UI ( instruments_ui_headers editinstrumentbase.ui ) diff --git a/muse2/muse/instruments/editinstrument.cpp b/muse2/muse/instruments/editinstrument.cpp index 9e85356a..d210b528 100644 --- a/muse2/muse/instruments/editinstrument.cpp +++ b/muse2/muse/instruments/editinstrument.cpp @@ -6,33 +6,25 @@ // (C) Copyright 2003 Werner Schweer (ws@seh.de) //========================================================= -#include -//Added by qt3to4: -#include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include + +#include +#include +#include +#include +#include +#include #include "editinstrument.h" #include "minstrument.h" #include "globals.h" -#include "listitem.h" #include "song.h" #include "xml.h" #include "midictrl.h" #include "gconfig.h" +#include "icons.h" + enum { COL_NAME = 0, COL_TYPE, @@ -43,17 +35,29 @@ enum { // EditInstrument //--------------------------------------------------------- -EditInstrument::EditInstrument(QWidget* parent, const char* name, Qt::WFlags fl) - : EditInstrumentBase(parent, name, fl) +EditInstrument::EditInstrument(QWidget* parent, Qt::WFlags fl) + : QMainWindow(parent, fl) { - patchpopup = new Q3PopupMenu(patchButton); + setupUi(this); + fileNewAction->setIcon(QIcon(*filenewIcon)); + fileOpenAction->setIcon(QIcon(*openIcon)); + fileSaveAction->setIcon(QIcon(*saveIcon)); + fileSaveAsAction->setIcon(QIcon(*saveasIcon)); + fileExitAction->setIcon(QIcon(*exitIcon)); + viewController->setSelectionMode(QAbstractItemView::SingleSelection); + toolBar->addAction(QWhatsThis::createAction(this)); + Help->addAction(QWhatsThis::createAction(this)); + + patchpopup = new QMenu(patchButton); patchpopup->setCheckable(false); // populate instrument list // Populate common controller list. for(int i = 0; i < 128; ++i) - listController->insertItem(midiCtrlName(i)); - + { + QListWidgetItem *lci = new QListWidgetItem(midiCtrlName(i)); + listController->addItem(lci); + } oldMidiInstrument = 0; oldPatchItem = 0; for (iMidiInstrument i = midiInstruments.begin(); i != midiInstruments.end(); ++i) { @@ -65,12 +69,14 @@ EditInstrument::EditInstrument(QWidget* parent, const char* name, Qt::WFlags fl) if((*i)->filePath().isEmpty()) continue; - ListBoxData* item = new ListBoxData((*i)->iname()); - item->setData((void*)*i); - instrumentList->insertItem(item); + QListWidgetItem* item = new QListWidgetItem((*i)->iname()); + QVariant v = qVariantFromValue((void*)(*i)); + item->setData(Qt::UserRole, v); + instrumentList->addItem(item); } + instrumentList->setSelectionMode(QAbstractItemView::SingleSelection); if(instrumentList->item(0)) - instrumentList->setSelected(instrumentList->item(0), true); + instrumentList->setCurrentItem(instrumentList->item(0)); //oldMidiInstrument = (MidiInstrument*)((ListBoxData*)instrumentList->item(0))->data(); //oldMidiInstrument = (ListBoxData*)instrumentList->item(0); //oldMidiInstrument = (ListBoxData*)instrumentList->selectedItem(); @@ -81,14 +87,14 @@ EditInstrument::EditInstrument(QWidget* parent, const char* name, Qt::WFlags fl) // workingInstrument.assign( *wip ); - connect(instrumentList, SIGNAL(selectionChanged()), SLOT(instrumentChanged())); - connect(patchView, SIGNAL(selectionChanged()), SLOT(patchChanged())); + connect(instrumentList, SIGNAL(itemSelectionChanged()), SLOT(instrumentChanged())); + connect(patchView, SIGNAL(itemSelectionChanged()), SLOT(patchChanged())); //instrumentChanged(); changeInstrument(); //connect(listController, SIGNAL(selectionChanged()), SLOT(controllerChanged())); - connect(viewController, SIGNAL(selectionChanged()), SLOT(controllerChanged())); + connect(viewController, SIGNAL(itemSelectionChanged()), SLOT(controllerChanged())); //connect(instrumentName, SIGNAL(textChanged(const QString&)), SLOT(instrumentNameChanged(const QString&))); connect(instrumentName, SIGNAL(returnPressed()), SLOT(instrumentNameReturn())); @@ -108,7 +114,7 @@ EditInstrument::EditInstrument(QWidget* parent, const char* name, Qt::WFlags fl) connect(deleteController, SIGNAL(clicked()), SLOT(deleteControllerClicked())); connect(newController, SIGNAL(clicked()), SLOT(newControllerClicked())); connect(addController, SIGNAL(clicked()), SLOT(addControllerClicked())); - connect(listController, SIGNAL(doubleClicked(Q3ListBoxItem*)), SLOT(addControllerClicked())); + connect(listController, SIGNAL(itemDoubleClicked(QListWidgetItem*)), SLOT(addControllerClicked())); connect(ctrlType,SIGNAL(activated(int)), SLOT(ctrlTypeChanged(int))); connect(ctrlName, SIGNAL(returnPressed()), SLOT(ctrlNameReturn())); connect(ctrlName, SIGNAL(lostFocus()), SLOT(ctrlNameReturn())); @@ -159,10 +165,9 @@ void EditInstrument::fileNew() if (!found) { //if(oldMidiInstrument) //{ - //MidiInstrument* oi = (MidiInstrument*)old->data(Qt::UserRole).value(); MidiInstrument* oi = 0; if(oldMidiInstrument) - oi = (MidiInstrument*)oldMidiInstrument->data(); + oi = (MidiInstrument*)oldMidiInstrument->data(Qt::UserRole).value(); MidiInstrument* wip = &workingInstrument; //checkDirty(oi); //if(checkDirty(oi)) @@ -179,7 +184,6 @@ void EditInstrument::fileNew() // Delete the list item and the instrument. deleteInstrument(oldMidiInstrument); - instrumentList->triggerUpdate(true); } } //else @@ -198,18 +202,16 @@ void EditInstrument::fileNew() midiInstruments.push_back(ni); //QListWidgetItem* item = new QListWidgetItem(ni->iname()); //InstrumentListItem* item = new InstrumentListItem(ni->iname()); - ListBoxData* item = new ListBoxData(ni->iname()); + QListWidgetItem* item = new QListWidgetItem(ni->iname()); //oldMidiInstrument = item; workingInstrument.assign( *ni ); //workingInstrument.setDirty(false); //item->setText(ni->iname()); - item->setData((void*)ni); - //QVariant v = qVariantFromValue((void*)(ni)); - //item->setData(Qt::UserRole, v); - //instrumentList->addItem(item); - instrumentList->insertItem(item); + QVariant v = qVariantFromValue((void*)(ni)); + item->setData(Qt::UserRole, v); + instrumentList->addItem(item); oldMidiInstrument = 0; @@ -337,7 +339,7 @@ bool EditInstrument::fileSave(MidiInstrument* instrument, const QString& name) // Assign the working instrument values to the actual current selected instrument... if(oldMidiInstrument) { - MidiInstrument* oi = (MidiInstrument*)oldMidiInstrument->data(); + MidiInstrument* oi = (MidiInstrument*)oldMidiInstrument->data(Qt::UserRole).value(); if(oi) { oi->assign(workingInstrument); @@ -420,7 +422,7 @@ void EditInstrument::saveAs() // Prompt for a new instrument name if the name has not been changed, to avoid duplicates. if(oldMidiInstrument) { - MidiInstrument* oi = (MidiInstrument*)oldMidiInstrument->data(); + MidiInstrument* oi = (MidiInstrument*)oldMidiInstrument->data(Qt::UserRole).value(); if(oi) { if(oi->iname() == workingInstrument.iname()) @@ -448,7 +450,7 @@ void EditInstrument::saveAs() // path, // tr("Instrument Definition (*.idf)")); - QString s = Q3FileDialog::getSaveFileName(path, tr("Instrument Definition (*.idf)"), this, + QString s = QFileDialog::getSaveFileName(path, tr("Instrument Definition (*.idf)"), this, tr("MusE: Save Instrument Definition").latin1()); if (s.isEmpty()) return; @@ -481,7 +483,7 @@ void EditInstrument::fileSaveAs() MidiInstrument* oi = 0; if(oldMidiInstrument) - oi = (MidiInstrument*)oldMidiInstrument->data(); + oi = (MidiInstrument*)oldMidiInstrument->data(Qt::UserRole).value(); int res = checkDirty(&workingInstrument, true); switch(res) @@ -509,7 +511,6 @@ void EditInstrument::fileSaveAs() changeInstrument(); - instrumentList->triggerUpdate(true); } return; break; @@ -614,7 +615,7 @@ void EditInstrument::fileSaveAs() workingInstrument.setIName(s); // Find the instrument in the list and set the old instrument to the item. - oldMidiInstrument = (ListBoxData*)instrumentList->findItem(s, Q3ListBox::ExactMatch); + oldMidiInstrument = instrumentList->findItems(s, Qt::MatchExactly)[0]; // Mark as a built-in instrument. builtin = true; @@ -645,18 +646,18 @@ void EditInstrument::fileSaveAs() //QListWidgetItem* item = new QListWidgetItem(ni->iname()); //InstrumentListItem* item = new InstrumentListItem(ni->iname()); //ListBoxData* item = new ListBoxData(ni->iname()); - ListBoxData* item = new ListBoxData(so); + QListWidgetItem* item = new QListWidgetItem(so); //oldMidiInstrument = item; workingInstrument.assign( *ni ); //workingInstrument.setDirty(false); //item->setText(ni->iname()); - item->setData((void*)ni); - //QVariant v = qVariantFromValue((void*)(ni)); - //item->setData(Qt::UserRole, v); + //item->setData((void*)ni); + QVariant v = qVariantFromValue((void*)(ni)); + item->setData(Qt::UserRole, v); //instrumentList->addItem(item); - instrumentList->insertItem(item); + instrumentList->addItem(item); oldMidiInstrument = 0; @@ -715,7 +716,7 @@ void EditInstrument::fileSaveAs() sfn = path; else { - sfn = Q3FileDialog::getSaveFileName(path, tr("Instrument Definition (*.idf)"), this, + sfn = QFileDialog::getSaveFileName(path, tr("Instrument Definition (*.idf)"), this, tr("MusE: Save Instrument Definition").latin1()); if (sfn.isEmpty()) return; @@ -760,7 +761,7 @@ void EditInstrument::closeEvent(QCloseEvent* ev) // int res = checkDirty(instrument, true); MidiInstrument* oi = 0; if(oldMidiInstrument) - oi = (MidiInstrument*)oldMidiInstrument->data(); + oi = (MidiInstrument*)oldMidiInstrument->data(Qt::UserRole).value(); int res = checkDirty(&workingInstrument, true); switch(res) @@ -788,7 +789,6 @@ void EditInstrument::closeEvent(QCloseEvent* ev) changeInstrument(); - instrumentList->triggerUpdate(true); } break; @@ -809,7 +809,7 @@ void EditInstrument::closeEvent(QCloseEvent* ev) // } - Q3MainWindow::closeEvent(ev); + QMainWindow::closeEvent(ev); } //--------------------------------------------------------- @@ -818,7 +818,8 @@ void EditInstrument::closeEvent(QCloseEvent* ev) void EditInstrument::changeInstrument() { - ListBoxData* sel = (ListBoxData*)instrumentList->selectedItem(); + QListWidgetItem* sel = instrumentList->currentItem(); + if(!sel) return; @@ -828,15 +829,24 @@ void EditInstrument::changeInstrument() //workingInstrument = *((MidiInstrument*)sel->data()); // Assign will 'delete' any existing patches, groups, or controllers. - workingInstrument.assign( *((MidiInstrument*)sel->data()) ); + workingInstrument.assign( *((MidiInstrument*)sel->data(Qt::UserRole).value()) ); workingInstrument.setDirty(false); // populate patch list - + patchView->blockSignals(true); + for (int i = 0; i < patchView->topLevelItemCount(); ++i) + qDeleteAll(patchView->topLevelItem(i)->takeChildren()); patchView->clear(); - //listController->clear(); + patchView->blockSignals(false); + + //viewController->blockSignals(true); + for (int i = 0; i < viewController->topLevelItemCount(); ++i) + qDeleteAll(viewController->topLevelItem(i)->takeChildren()); viewController->clear(); + //viewController->blockSignals(false); + + //listController->clear(); //category->clear(); //sysexList->clear(); @@ -883,17 +893,18 @@ void EditInstrument::changeInstrument() if(pgp) { //QTreeWidgetItem* item = new QTreeWidgetItem; - ListViewData* item = new ListViewData(patchView); + QTreeWidgetItem* item = new QTreeWidgetItem(patchView); //item->setText(0, g->name); item->setText(0, pgp->name); - //QVariant v = QVariant::fromValue((void*)0); //item->setData(0, Qt::UserRole, v); //item->setData((void*)*g); //item->setData((void*)0); //item->setData((void*)&*g); - item->setData((void*)pgp); + //item->setData((void*)pgp); + QVariant v = qVariantFromValue((void*)(pgp)); + item->setData(0, Qt::UserRole, v); //patchView->addTopLevelItem(item); //for (ciPatch p = g->patches.begin(); p != g->patches.end(); ++p) @@ -904,14 +915,18 @@ void EditInstrument::changeInstrument() if(patch) { //QTreeWidgetItem* sitem = new QTreeWidgetItem; - ListViewData* sitem = new ListViewData(item); + QTreeWidgetItem* sitem = new QTreeWidgetItem(item); + //printf("%s \n", qPrintable(patch->name)); + //sitem->setText(0, patch.name); //sitem->setText(0, p->name); sitem->setText(0, patch->name); //QVariant v = QVariant::fromValue((void*)patch); //sitem->setData(0, Qt::UserRole, v); //sitem->setData((void*)&*p); - sitem->setData((void*)patch); + //sitem->setData((void*)patch); + QVariant v = QVariant::fromValue((void*)patch); + sitem->setData(0, Qt::UserRole, v); //item->addChild(sitem); } } @@ -921,17 +936,17 @@ void EditInstrument::changeInstrument() oldPatchItem = 0; - ListViewData* fc = (ListViewData*)patchView->firstChild(); + QTreeWidgetItem* fc = patchView->topLevelItem(0); if(fc) { // This may cause a patchChanged call. //if(patchView->selectedItem() != fc) patchView->blockSignals(true); - patchView->setSelected(fc, true); + fc->setSelected(true); patchView->blockSignals(false); //else // patchChanged(); - + //patchView->firstChild()->setSelected(true); //patchView->triggerUpdate(true); } @@ -968,8 +983,9 @@ void EditInstrument::changeInstrument() // oldController = 0; //ListBoxData* ci = (ListBoxData*)listController->item(0); - ListViewData* ci = (ListViewData*)viewController->firstChild(); - + + QTreeWidgetItem *ci = viewController->topLevelItem(0); + if(ci) { // This may cause a controllerChanged call. @@ -981,7 +997,7 @@ void EditInstrument::changeInstrument() // controllerChanged(); viewController->blockSignals(true); - viewController->setSelected(ci, true); + ci->setSelected(true); viewController->blockSignals(false); } @@ -1021,7 +1037,8 @@ void EditInstrument::changeInstrument() void EditInstrument::instrumentChanged() { - ListBoxData* sel = (ListBoxData*)instrumentList->selectedItem(); + QListWidgetItem* sel = instrumentList->currentItem(); + if(!sel) return; @@ -1030,10 +1047,9 @@ void EditInstrument::instrumentChanged() //if (old) { //if(oldMidiInstrument) //{ - //MidiInstrument* oi = (MidiInstrument*)old->data(Qt::UserRole).value(); MidiInstrument* oi = 0; if(oldMidiInstrument) - oi = (MidiInstrument*)oldMidiInstrument->data(); + oi = (MidiInstrument*)oldMidiInstrument->data(Qt::UserRole).value(); MidiInstrument* wip = &workingInstrument; // Returns true if aborted. //checkDirty(oi); @@ -1054,7 +1070,6 @@ void EditInstrument::instrumentChanged() oldMidiInstrument = 0; } - instrumentList->triggerUpdate(true); } } //else @@ -1081,7 +1096,8 @@ void EditInstrument::instrumentNameReturn() //void EditInstrument::instrumentNameChanged(const QString& s) { //instrumentNameChanged(instrumentName->text()); - ListBoxData* item = (ListBoxData*)instrumentList->selectedItem(); + QListWidgetItem* item = instrumentList->currentItem(); + if (item == 0) return; QString s = instrumentName->text(); @@ -1089,7 +1105,7 @@ void EditInstrument::instrumentNameReturn() if(s == item->text()) return; - MidiInstrument* curins = (MidiInstrument*)item->data(); + MidiInstrument* curins = (MidiInstrument*)item->data(Qt::UserRole).value(); for(iMidiInstrument i = midiInstruments.begin(); i != midiInstruments.end(); ++i) { @@ -1120,7 +1136,6 @@ void EditInstrument::instrumentNameReturn() workingInstrument.setIName(s); workingInstrument.setDirty(true); //instrumentList->updateItem(item); - instrumentList->triggerUpdate(true); //instrumentList->update(); // } } @@ -1129,14 +1144,14 @@ void EditInstrument::instrumentNameReturn() // deleteInstrument //--------------------------------------------------------- -void EditInstrument::deleteInstrument(ListBoxData* item) +void EditInstrument::deleteInstrument(QListWidgetItem* item) { if(!item) return; //ListBoxData* curritem = (ListBoxData*)instrumentList->selectedItem(); - MidiInstrument* ins = (MidiInstrument*)item->data(); + MidiInstrument* ins = (MidiInstrument*)item->data(Qt::UserRole).value(); // Be kind to the list item, just in case we install a delete handler or something. //item->setData(0); @@ -1179,10 +1194,10 @@ void EditInstrument::tabChanged(QWidget* w) if(oldPatchItem) { // Don't bother calling patchChanged, just update the patch or group. - if(oldPatchItem->parent()) - updatePatch(&workingInstrument, (Patch*)oldPatchItem->data()); + if(oldPatchItem->QTreeWidgetItem::parent()) + updatePatch(&workingInstrument, (Patch*)oldPatchItem->data(0, Qt::UserRole).value()); else - updatePatchGroup(&workingInstrument, (PatchGroup*)oldPatchItem->data()); + updatePatchGroup(&workingInstrument, (PatchGroup*)oldPatchItem->data(0, Qt::UserRole).value()); } // We're still on the same item. No need to set oldPatchItem as in patchChanged... @@ -1190,12 +1205,12 @@ void EditInstrument::tabChanged(QWidget* w) // If we're switching to the Controller tab, update the default patch button text in case a patch changed... if(QString(w->name()) == QString("controllerTab")) { - ListViewData* sel = (ListViewData*)viewController->selectedItem(); + QTreeWidgetItem* sel = viewController->currentItem(); - if(!sel || !sel->data()) + if(!sel || !sel->data(0, Qt::UserRole).value()) return; - MidiController* c = (MidiController*)sel->data(); + MidiController* c = (MidiController*)sel->data(0, Qt::UserRole).value(); MidiController::ControllerType type = midiControllerType(c->num()); // Grab the controller number from the actual values showing @@ -1211,7 +1226,8 @@ void EditInstrument::tabChanged(QWidget* w) void EditInstrument::patchNameReturn() { - ListViewData* item = (ListViewData*)patchView->selectedItem(); + QTreeWidgetItem* item = patchView->currentItem(); + if (item == 0) return; @@ -1225,9 +1241,9 @@ void EditInstrument::patchNameReturn() { PatchGroup* pgp = *g; // If the item has a parent, it's a patch item. - if(item->parent()) + if(item->QTreeWidgetItem::parent()) { - Patch* curp = (Patch*)item->data(); + Patch* curp = (Patch*)item->data(0, Qt::UserRole).value(); for(iPatch p = pgp->patches.begin(); p != pgp->patches.end(); ++p) { if((*p) != curp && (*p)->name == s) @@ -1252,7 +1268,7 @@ void EditInstrument::patchNameReturn() else // The item has no parent. It's a patch group item. { - PatchGroup* curpg = (PatchGroup*)item->data(); + PatchGroup* curpg = (PatchGroup*)item->data(0, Qt::UserRole).value(); if(pgp != curpg && pgp->name == s) { patchNameEdit->blockSignals(true); @@ -1309,7 +1325,6 @@ void EditInstrument::patchNameReturn() //--------------------------------------------------------- // patchChanged //--------------------------------------------------------- - void EditInstrument::patchChanged() { //if (old && old->data(0, Qt::UserRole).value()) { @@ -1322,16 +1337,15 @@ void EditInstrument::patchChanged() //Patch* p = (Patch*)old->data(0, Qt::UserRole).value(); //updatePatch(instrument, p); if(oldPatchItem->parent()) - updatePatch(&workingInstrument, (Patch*)oldPatchItem->data()); + updatePatch(&workingInstrument, (Patch*)oldPatchItem->data(0, Qt::UserRole).value()); else - updatePatchGroup(&workingInstrument, (PatchGroup*)oldPatchItem->data()); + updatePatchGroup(&workingInstrument, (PatchGroup*)oldPatchItem->data(0, Qt::UserRole).value()); } - - ListViewData* sel = (ListViewData*)patchView->selectedItem(); + QTreeWidgetItem* sel = patchView->selectedItems().size() ? patchView->selectedItems()[0] : 0; oldPatchItem = sel; - if(!sel || !sel->data()) + if(!sel || !sel->data(0, Qt::UserRole).value()) { patchNameEdit->setText(""); spinBoxHBank->setEnabled(false); @@ -1347,7 +1361,7 @@ void EditInstrument::patchChanged() // If the item has a parent, it's a patch item. if(sel->parent()) { - Patch* p = (Patch*)sel->data(); + Patch* p = (Patch*)sel->data(0, Qt::UserRole).value(); patchNameEdit->setText(p->name); spinBoxHBank->setEnabled(true); spinBoxLBank->setEnabled(true); @@ -1373,7 +1387,7 @@ void EditInstrument::patchChanged() else // The item is a patch group item. { - patchNameEdit->setText( ((PatchGroup*)sel->data())->name ); + patchNameEdit->setText( ((PatchGroup*)sel->data(0, Qt::UserRole).value())->name ); spinBoxHBank->setEnabled(false); spinBoxLBank->setEnabled(false); spinBoxProgram->setEnabled(false); @@ -1390,11 +1404,12 @@ void EditInstrument::patchChanged() void EditInstrument::defPatchChanged(int) { - ListViewData* item = (ListViewData*)viewController->selectedItem(); + QTreeWidgetItem* item = viewController->currentItem(); + if (!item) return; - MidiController* c = (MidiController*)item->data(); + MidiController* c = (MidiController*)item->data(0, Qt::UserRole).value(); int val = getDefaultPatchNumber(); @@ -1427,7 +1442,7 @@ void EditInstrument::patchButtonClicked() if (pg->size() > 1) { for (ciPatchGroup i = pg->begin(); i != pg->end(); ++i) { PatchGroup* pgp = *i; - Q3PopupMenu* pm = new Q3PopupMenu(patchpopup); + QMenu* pm = new QMenu(pgp->name); pm->setCheckable(false); pm->setFont(config.fonts[0]); const PatchList& pl = pgp->patches; @@ -1440,11 +1455,12 @@ void EditInstrument::patchButtonClicked() // { int id = ((mp->hbank & 0xff) << 16) + ((mp->lbank & 0xff) << 8) + (mp->prog & 0xff); - pm->insertItem(mp->name, id); + QAction *ac1 = pm->addAction(mp->name); + ac1->setData(id); // } } - patchpopup->insertItem(pgp->name, pm); + patchpopup->addMenu(pm); } } else if (pg->size() == 1 ){ @@ -1455,26 +1471,29 @@ void EditInstrument::patchButtonClicked() //if (mp->typ & mask) { int id = ((mp->hbank & 0xff) << 16) + ((mp->lbank & 0xff) << 8) + (mp->prog & 0xff); - patchpopup->insertItem(mp->name, id); + QAction *ac2 = patchpopup->addAction(mp->name); + ac2->setData(id); // } } } if(patchpopup->count() == 0) return; - - int rv = patchpopup->exec(patchButton->mapToGlobal(QPoint(10,5))); - + + QAction* act = patchpopup->exec(patchButton->mapToGlobal(QPoint(10,5))); + int rv = act->data().toInt(); + if (rv != -1) { //if(rv != workingInstrument. setDefaultPatchControls(rv); - ListViewData* item = (ListViewData*)viewController->selectedItem(); + QTreeWidgetItem* item = viewController->currentItem(); + if(item) { - MidiController* c = (MidiController*)item->data(); + MidiController* c = (MidiController*)item->data(0, Qt::UserRole).value(); c->setInitVal(rv); item->setText(COL_DEF, getPatchItemText(rv)); @@ -1488,7 +1507,7 @@ void EditInstrument::patchButtonClicked() // addControllerToView //--------------------------------------------------------- -ListViewData* EditInstrument::addControllerToView(MidiController* mctrl) +QTreeWidgetItem* EditInstrument::addControllerToView(MidiController* mctrl) { QString hnum; QString lnum; @@ -1566,10 +1585,13 @@ ListViewData* EditInstrument::addControllerToView(MidiController* mctrl) def = "---"; break; } - - ListViewData* ci = new ListViewData(viewController, mctrl->name(), int2ctrlType(t), - hnum, lnum, min, max, def); - ci->setData((void*)mctrl); + + QTreeWidgetItem* ci = new QTreeWidgetItem(viewController, QStringList() << mctrl->name() << int2ctrlType(t) << hnum << lnum << min << max << def); + //ListViewData* ci = new ListViewData(viewController, mctrl->name(), int2ctrlType(t), + // hnum, lnum, min, max, def); + //ci->setData((void*)mctrl); + QVariant v = qVariantFromValue((void*)(mctrl)); + ci->setData(0, Qt::UserRole, v); //setModified(true); return ci; @@ -1594,10 +1616,11 @@ void EditInstrument::controllerChanged() // } // ListBoxData* sel = (ListBoxData*)listController->selectedItem(); - ListViewData* sel = (ListViewData*)viewController->selectedItem(); + + QTreeWidgetItem* sel = viewController->selectedItems().size() ? viewController->selectedItems()[0] : 0; // oldController = sel; - if(!sel || !sel->data()) + if(!sel || !sel->data(0, Qt::UserRole).value()) { ctrlName->blockSignals(true); ctrlName->setText(""); @@ -1606,8 +1629,7 @@ void EditInstrument::controllerChanged() return; } - //MidiController* c = (MidiController*)sel->data(Qt::UserRole).value(); - MidiController* c = (MidiController*)sel->data(); + MidiController* c = (MidiController*)sel->data(0, Qt::UserRole).value(); ctrlName->blockSignals(true); ctrlName->setText(c->name()); @@ -1749,10 +1771,11 @@ void EditInstrument::controllerChanged() void EditInstrument::ctrlNameReturn() //void EditInstrument::ctrlNameChanged(const QString& s) { - ListViewData* item = (ListViewData*)viewController->selectedItem(); + QTreeWidgetItem* item = viewController->currentItem(); + if (item == 0) return; - MidiController* c = (MidiController*)item->data(); + MidiController* c = (MidiController*)item->data(0, Qt::UserRole).value(); QString cName = ctrlName->text(); @@ -1794,12 +1817,13 @@ void EditInstrument::ctrlNameReturn() void EditInstrument::ctrlTypeChanged(int idx) { - ListViewData* item = (ListViewData*)viewController->selectedItem(); + QTreeWidgetItem* item = viewController->currentItem(); + if (item == 0) return; MidiController::ControllerType t = (MidiController::ControllerType)idx; - MidiController* c = (MidiController*)item->data(); + MidiController* c = (MidiController*)item->data(0, Qt::UserRole).value(); if(t == midiControllerType(c->num())) return; @@ -2089,12 +2113,13 @@ void EditInstrument::ctrlTypeChanged(int idx) void EditInstrument::ctrlHNumChanged(int val) { - ListViewData* item = (ListViewData*)viewController->selectedItem(); + QTreeWidgetItem* item = viewController->currentItem(); + if (item == 0) return; QString s; s.setNum(val); - MidiController* c = (MidiController*)item->data(); + MidiController* c = (MidiController*)item->data(0, Qt::UserRole).value(); //int n = c->num() & 0xff; int n = c->num() & 0x7fff00ff; c->setNum(n | ((val & 0xff) << 8)); @@ -2108,10 +2133,11 @@ void EditInstrument::ctrlHNumChanged(int val) void EditInstrument::ctrlLNumChanged(int val) { - ListViewData* item = (ListViewData*)viewController->selectedItem(); + QTreeWidgetItem* item = viewController->currentItem(); + if (item == 0) return; - MidiController* c = (MidiController*)item->data(); + MidiController* c = (MidiController*)item->data(0, Qt::UserRole).value(); //int n = c->num() & 0xff00; int n = c->num() & ~0xff; c->setNum(n | (val & 0xff)); @@ -2132,7 +2158,8 @@ void EditInstrument::ctrlLNumChanged(int val) void EditInstrument::ctrlMinChanged(int val) { - ListViewData* item = (ListViewData*)viewController->selectedItem(); + QTreeWidgetItem* item = viewController->currentItem(); + if (item == 0) return; @@ -2140,7 +2167,7 @@ void EditInstrument::ctrlMinChanged(int val) s.setNum(val); item->setText(COL_MIN, s); - MidiController* c = (MidiController*)item->data(); + MidiController* c = (MidiController*)item->data(0, Qt::UserRole).value(); c->setMinVal(val); int rng = 0; @@ -2217,7 +2244,8 @@ void EditInstrument::ctrlMinChanged(int val) void EditInstrument::ctrlMaxChanged(int val) { - ListViewData* item = (ListViewData*)viewController->selectedItem(); + QTreeWidgetItem* item = viewController->currentItem(); + if (item == 0) return; @@ -2225,7 +2253,7 @@ void EditInstrument::ctrlMaxChanged(int val) s.setNum(val); item->setText(COL_MAX, s); - MidiController* c = (MidiController*)item->data(); + MidiController* c = (MidiController*)item->data(0, Qt::UserRole).value(); c->setMaxVal(val); int rng = 0; @@ -2302,11 +2330,12 @@ void EditInstrument::ctrlMaxChanged(int val) void EditInstrument::ctrlDefaultChanged(int val) { - ListViewData* item = (ListViewData*)viewController->selectedItem(); + QTreeWidgetItem* item = viewController->currentItem(); + if (item == 0) return; - MidiController* c = (MidiController*)item->data(); + MidiController* c = (MidiController*)item->data(0, Qt::UserRole).value(); if(val == c->minVal() - 1) { @@ -2396,7 +2425,8 @@ void EditInstrument::deletePatchClicked() //MidiInstrument* instrument = (MidiInstrument*)item->data(Qt::UserRole).value(); // MidiInstrument* instrument = (MidiInstrument*)item->data(); //QTreeWidgetItem* pi = patchView->currentItem(); - ListViewData* pi = (ListViewData*)patchView->selectedItem(); + QTreeWidgetItem* pi = patchView->currentItem(); + if (pi == 0) return; @@ -2409,11 +2439,11 @@ void EditInstrument::deletePatchClicked() // If the item has a parent item, it's a patch item... if(pi->parent()) { - PatchGroup* group = (PatchGroup*)((ListViewData*)pi->parent())->data(); + PatchGroup* group = (PatchGroup*)(pi->parent())->data(0, Qt::UserRole).value(); // If there is an allocated patch in the data, delete it. //Patch* patch = (Patch*)pi->auxData(); - Patch* patch = (Patch*)pi->data(); + Patch* patch = (Patch*)pi->data(0, Qt::UserRole).value(); if(patch) { if(group) @@ -2439,7 +2469,7 @@ void EditInstrument::deletePatchClicked() { // Is there an allocated patch group in the data? //PatchGroup* group = (PatchGroup*)pi->auxData(); - PatchGroup* group = (PatchGroup*)pi->data(); + PatchGroup* group = (PatchGroup*)pi->data(0, Qt::UserRole).value(); if(group) { @@ -2500,7 +2530,7 @@ void EditInstrument::deletePatchClicked() patchView->blockSignals(true); delete pi; if(patchView->currentItem()) - patchView->setSelected(patchView->currentItem(), true); + patchView->currentItem()->setSelected(true); patchView->blockSignals(false); oldPatchItem = 0; @@ -2541,9 +2571,9 @@ void EditInstrument::newPatchClicked() if(oldPatchItem) { if(oldPatchItem->parent()) - updatePatch(&workingInstrument, (Patch*)oldPatchItem->data()); + updatePatch(&workingInstrument, (Patch*)oldPatchItem->data(0, Qt::UserRole).value()); else - updatePatchGroup(&workingInstrument, (PatchGroup*)oldPatchItem->data()); + updatePatchGroup(&workingInstrument, (PatchGroup*)oldPatchItem->data(0, Qt::UserRole).value()); } //MidiInstrument* instrument = (MidiInstrument*)item->data(Qt::UserRole).value(); @@ -2579,7 +2609,8 @@ void EditInstrument::newPatchClicked() // //PatchGroup* pGroup = 0; //QTreeWidgetItem* pi = patchView->currentItem(); - ListViewData* pi = (ListViewData*)patchView->selectedItem(); + QTreeWidgetItem* pi = patchView->currentItem(); + if (pi == 0) return; @@ -2593,12 +2624,12 @@ void EditInstrument::newPatchClicked() if(pi->parent()) { // Remember the current selected patch. - selpatch = (Patch*)pi->data(); + selpatch = (Patch*)pi->data(0, Qt::UserRole).value(); - pi = (ListViewData*)pi->parent(); + pi = pi->parent(); } - PatchGroup* group = (PatchGroup*)pi->data(); + PatchGroup* group = (PatchGroup*)pi->data(0, Qt::UserRole).value(); if(!group) return; @@ -2699,7 +2730,7 @@ void EditInstrument::newPatchClicked() //Patch* pp = &(group->patches.back()); //QTreeWidgetItem* sitem = new QTreeWidgetItem; - ListViewData* sitem = new ListViewData(pi); + QTreeWidgetItem* sitem = new QTreeWidgetItem(pi); //sitem->setText(0, patch->name); sitem->setText(0, patchName); @@ -2709,7 +2740,9 @@ void EditInstrument::newPatchClicked() //sitem->setData(0, Qt::UserRole, v); // Set the list view item's data. - sitem->setData((void*)patch); + //sitem->setData((void*)patch); + QVariant v = qVariantFromValue((void*)(patch)); + sitem->setData(0, Qt::UserRole, v); //sitem->setAuxData((void*)patch); //sitem->setData((void*)pp); @@ -2725,8 +2758,8 @@ void EditInstrument::newPatchClicked() // May cause patchChanged call. patchView->blockSignals(true); - patchView->setSelected(sitem, true); - patchView->ensureItemVisible(sitem); + sitem->setSelected(true); + patchView->scrollToItem((QTreeWidgetItem*)sitem, QAbstractItemView::EnsureVisible); patchView->blockSignals(false); //oldPatchItem = (ListViewData*)patchView->selectedItem(); @@ -2762,9 +2795,9 @@ void EditInstrument::newGroupClicked() if(oldPatchItem) { if(oldPatchItem->parent()) - updatePatch(&workingInstrument, (Patch*)oldPatchItem->data()); + updatePatch(&workingInstrument, (Patch*)oldPatchItem->data(0, Qt::UserRole).value()); else - updatePatchGroup(&workingInstrument, (PatchGroup*)oldPatchItem->data()); + updatePatchGroup(&workingInstrument, (PatchGroup*)oldPatchItem->data(0, Qt::UserRole).value()); } //MidiInstrument* instrument = (MidiInstrument*)item->data(Qt::UserRole).value(); @@ -2799,8 +2832,7 @@ void EditInstrument::newGroupClicked() pg->push_back(group); //PatchGroup* pgp = &(pg->back()); - //QTreeWidgetItem* sitem = new QTreeWidgetItem; - ListViewData* sitem = new ListViewData(patchView); + QTreeWidgetItem* sitem = new QTreeWidgetItem(patchView); sitem->setText(0, groupName); patchNameEdit->setText(groupName); @@ -2810,7 +2842,8 @@ void EditInstrument::newGroupClicked() //sitem->setData((void*)0); // Set the list view item's data. - sitem->setData((void*)group); + QVariant v = qVariantFromValue((void*)(group)); + sitem->setData(0, Qt::UserRole, v); //sitem->setAuxData((void*)pgp); //patchView->addTopLevelItem(sitem); @@ -2820,7 +2853,7 @@ void EditInstrument::newGroupClicked() // May cause patchChanged call. patchView->blockSignals(true); - patchView->setSelected(sitem, true); + sitem->setSelected(true); patchView->blockSignals(false); //oldPatchItem = (ListViewData*)patchView->selectedItem(); @@ -2850,7 +2883,7 @@ void EditInstrument::deleteControllerClicked() //ListBoxData* item = (ListBoxData*)instrumentList->selectedItem(); //QListWidgetItem* item2 = listController->currentItem(); // ListBoxData* item = (ListBoxData*)listController->selectedItem(); - ListViewData* item = (ListViewData*)viewController->selectedItem(); + QTreeWidgetItem* item = viewController->currentItem(); //if (item == 0 || item2 == 0) if(!item) @@ -2862,7 +2895,7 @@ void EditInstrument::deleteControllerClicked() //MidiControllerList* cl = instrument->controller(); //cl->removeAll(ctrl); - MidiController* ctrl = (MidiController*)item->data(); + MidiController* ctrl = (MidiController*)item->data(0, Qt::UserRole).value(); if(!ctrl) return; @@ -2876,7 +2909,7 @@ void EditInstrument::deleteControllerClicked() viewController->blockSignals(true); delete item; if(viewController->currentItem()) - viewController->setSelected(viewController->currentItem(), true); + viewController->currentItem()->setSelected(true); // listController->blockSignals(false); viewController->blockSignals(false); @@ -2926,15 +2959,15 @@ void EditInstrument::newControllerClicked() ctrl->setMinVal(0); ctrl->setMaxVal(127); ctrl->setInitVal(CTRL_VAL_UNKNOWN); - - ListViewData* ci = (ListViewData*)viewController->selectedItem(); + + QTreeWidgetItem* ci = viewController->currentItem(); // To allow for quick multiple successive controller creation. // If there's a current controller item selected, copy initial values from it. bool found = false; if(ci) { - MidiController* selctl = (MidiController*)ci->data(); + MidiController* selctl = (MidiController*)ci->data(0, Qt::UserRole).value(); // Assign. // *ctrl = *selctl; @@ -2988,13 +3021,13 @@ void EditInstrument::newControllerClicked() //listController->setCurrentItem(item); workingInstrument.controller()->add(ctrl); - ListViewData* item = addControllerToView(ctrl); + QTreeWidgetItem* item = addControllerToView(ctrl); // listController->blockSignals(true); // listController->setSelected(item, true); // listController->blockSignals(false); viewController->blockSignals(true); - viewController->setSelected(item, true); + item->setSelected(true); viewController->blockSignals(false); //oldController = (ListBoxData*)listController->selectedItem(); @@ -3020,12 +3053,12 @@ void EditInstrument::addControllerClicked() //QString name = midiCtrlName(lnum); - int idx = listController->currentItem(); - if(idx == -1) + QListWidgetItem* idx = listController->currentItem(); + if(idx == 0) return; int lnum = -1; - QString name = listController->currentText(); + QString name = listController->currentItem()->text(); for(int i = 0; i < 128; i++) { if(midiCtrlName(i) == name) @@ -3080,10 +3113,10 @@ void EditInstrument::addControllerClicked() workingInstrument.controller()->add(ctrl); - ListViewData* item = addControllerToView(ctrl); + QTreeWidgetItem* item = addControllerToView(ctrl); viewController->blockSignals(true); - viewController->setSelected(item, true); + item->setSelected(true); viewController->blockSignals(false); controllerChanged(); @@ -3129,6 +3162,8 @@ void EditInstrument::deleteSysexClicked() void EditInstrument::updatePatchGroup(MidiInstrument* instrument, PatchGroup* pg) { + QString a = pg->name; + QString b = patchNameEdit->text(); if (pg->name != patchNameEdit->text()) { pg->name = patchNameEdit->text(); instrument->setDirty(true); @@ -3315,17 +3350,17 @@ void EditInstrument::updateInstrument(MidiInstrument* instrument) // printf("updateInstrument: B\n"); - //QTreeWidgetItem* patchItem = patchView->currentItem(); - ListViewData* patchItem = (ListViewData*)patchView->selectedItem(); + QTreeWidgetItem* patchItem = patchView->currentItem(); + if (patchItem) { //Patch* p = (Patch*)patchItem->data(0, Qt::UserRole).value(); // If the item has a parent, it's a patch item. if(patchItem->parent()) - updatePatch(instrument, (Patch*)patchItem->data()); + updatePatch(instrument, (Patch*)patchItem->data(0, Qt::UserRole).value()); else - updatePatchGroup(instrument, (PatchGroup*)patchItem->data()); + updatePatchGroup(instrument, (PatchGroup*)patchItem->data(0, Qt::UserRole).value()); } } diff --git a/muse2/muse/instruments/editinstrument.h b/muse2/muse/instruments/editinstrument.h index 25a5993f..b200e326 100644 --- a/muse2/muse/instruments/editinstrument.h +++ b/muse2/muse/instruments/editinstrument.h @@ -9,25 +9,24 @@ #ifndef __EDITINSTRUMENT_H__ #define __EDITINSTRUMENT_H__ -#include "editinstrumentbase.h" +#include "ui_editinstrumentbase.h" #include "minstrument.h" #include "midictrl.h" -//Added by qt3to4: -#include -#include -class ListBoxData; -class ListViewData; + +class QDialog; +class QMenu; +class QCloseEvent; //--------------------------------------------------------- // EditInstrument //--------------------------------------------------------- -class EditInstrument : public EditInstrumentBase { +class EditInstrument : public QMainWindow, public Ui::EditInstrumentBase { Q_OBJECT MidiInstrument workingInstrument; - ListBoxData* oldMidiInstrument; - ListViewData* oldPatchItem; + QListWidgetItem* oldMidiInstrument; + QTreeWidgetItem* oldPatchItem; void closeEvent(QCloseEvent*); int checkDirty(MidiInstrument*, bool isClose = false); bool fileSave(MidiInstrument*, const QString&); @@ -36,7 +35,7 @@ class EditInstrument : public EditInstrumentBase { void updatePatch(MidiInstrument*, Patch*); void updatePatchGroup(MidiInstrument*, PatchGroup*); void changeInstrument(); - ListViewData* addControllerToView(MidiController* mctrl); + QTreeWidgetItem* addControllerToView(MidiController* mctrl); QString getPatchItemText(int); void enableDefaultControls(bool, bool); void setDefaultPatchName(int); @@ -44,8 +43,8 @@ class EditInstrument : public EditInstrumentBase { void setDefaultPatchNumbers(int); void setDefaultPatchControls(int); const char* getPatchName(int); - void deleteInstrument(ListBoxData*); - Q3PopupMenu* patchpopup; + void deleteInstrument(QListWidgetItem*); + QMenu* patchpopup; private slots: virtual void fileNew(); @@ -85,7 +84,7 @@ class EditInstrument : public EditInstrumentBase { void ctrlNullParamLChanged(int); public: - EditInstrument(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); + EditInstrument(QWidget* parent = 0, Qt::WFlags fl = Qt::Window); }; #endif diff --git a/muse2/muse/instruments/editinstrumentbase.ui b/muse2/muse/instruments/editinstrumentbase.ui index 8f5ecc7b..3337cfc0 100644 --- a/muse2/muse/instruments/editinstrumentbase.ui +++ b/muse2/muse/instruments/editinstrumentbase.ui @@ -1,926 +1,741 @@ - -EditInstrumentBase - - - Form1 - - - - 0 - 0 - 802 - 505 - - - - - 802 - 464 - - - - MusE: Instrument Editor - - - - unnamed - - - - splitter4 + + + EditInstrumentBase + + + + 0 + 0 + 802 + 505 + + + + + 802 + 464 + + + + MusE: Instrument Editor + + + + + + + + 780 + 365 + + + + Qt::Horizontal + + + + + + + Instrument Name: + + + false + + + + + + + + + + Selected instrument name. + + + + + + + List of defined instruments. + + + + + + + + true + + + 0 + + + + Pa&tches + + + + + + Qt::Horizontal + + + + + 0 + 0 + - - - 780 - 365 - + + - - Horizontal + + List of groups and patches. - - - layout26 - - - - unnamed - - - - textLabel2 - - - Instrument Name: - - - - - instrumentName - - - - - - Selected instrument name. - - - - - instrumentList - - - List of defined instruments. - - - - - - - tabWidget3 - - - true - - - - patchesTab - - - Pa&tches - - - - unnamed - - - - splitter5 - - - Horizontal - - - - - Group/Patch - - - true - - - true - - - - patchView - - - - 7 - 7 - 0 - 0 - - - - true - - - true - - - - - - List of groups and patches. - - - - - layout26 - - - - unnamed - - - - groupBox2 - - - Properties - - - - unnamed - - - - textLabelPatchName - - - Name: - - - - - patchNameEdit - - - Group or patch name - - - Group or patch name - - - - - textLabel2_2 - - - High Bank: - - - - - layout22 - - - - unnamed - - - - spinBoxHBank - - - --- - dont care - - - 128 - - - 0 - - - 0 - - - Patch high bank number - - - Patch high bank number. --- means don't care. - - - - - spacer8 - - - Horizontal - - - Expanding - - - - 373 - 20 - - - - - - - - textLabel3_2 - - - Low Bank: - - - - - layout23 - - - - unnamed - - - - spinBoxLBank - - - --- - - - 128 - - - 0 - - - 0 - - - Patch low bank number - - - Patch low bank number. --- means don't care. - - - - - spacer9 - - - Horizontal - - - Expanding - - - - 373 - 20 - - - - - - - - textLabel4_3 - - - Program: - - - - - layout24 - - - - unnamed - - - - spinBoxProgram - - - 128 - - - 1 - - - 1 - - - Patch program number - - - Patch program number - - - - - spacer10 - - - Horizontal - - - Expanding - - - - 373 - 20 - - - - - - - - layout6 - - - - unnamed - - - - checkBoxDrum - - - Drum - - - - - - Drum patch - - - If set, the patch is available only for drum channels. - - - - - checkBoxGM - - - GM - - - - - - GM patch - - - If set, the patch is available in a 'GM' or 'NO' midi song type. - - - - - checkBoxGS - - - GS - - - GS patch - - - If set, the patch is available in a 'GS' or 'NO' midi song type. - - - - - checkBoxXG - - - XG - - - XG patch - - - If set, the patch is available in an 'XG' or 'NO' midi song type. - - - - - - - - - spacer7 - - - Vertical - - - Expanding - - - - 20 - 90 - - - - - - layout5 - - - - unnamed - - - - patchDelete - - - - 5 - 0 - 0 - 0 - - - - &Delete - - - Alt+D - - - Delete group or patch - - - - - patchNew - - - - 5 - 1 - 0 - 0 - - - - New &Patch - - - Alt+P - - - New patch - - - - - patchNewGroup - - - New &Group - - - Alt+G - - - New group - - - - - spacer11 - - - Horizontal - - - Expanding - - - - 240 - 20 - - - - - - - - - + + true + + + true + + + + Group/Patch + + + + + + + + + Properties + + + + + + Name: + + + false + + + + + + + Group or patch name + + + Group or patch name + + + + + + + High Bank: + + + false + + + + + + + + + Patch high bank number + + + Patch high bank number. --- means don't care. + + + --- + + + 0 + + + 128 + + + 0 + + + + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 373 + 20 + + + + + + + + + + Low Bank: + + + false + + + + + + + + + Patch low bank number + + + Patch low bank number. --- means don't care. + + + --- + + + 0 + + + 128 + + + 0 + + + + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 373 + 20 + + + + + + + + + + Program: + + + false + + + + + + + + + Patch program number + + + Patch program number + + + 1 + + + 128 + + + 1 + + + + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 373 + 20 + + + + + + + + + + + + Drum patch + + + If set, the patch is available only for drum channels. + + + Drum + + + + + + + + + + GM patch + + + If set, the patch is available in a 'GM' or 'NO' midi song type. + + + GM + + + + + + + + + + GS patch + + + If set, the patch is available in a 'GS' or 'NO' midi song type. + + + GS + + + + + + + XG patch + + + If set, the patch is available in an 'XG' or 'NO' midi song type. + + + XG + + + + + + + + + + + + Qt::Vertical + + + QSizePolicy::Expanding + + + + 20 + 90 + + + + + + + + + + + 0 + 0 + + + + Delete group or patch + + + &Delete + + + Alt+D + + + + + + + + 0 + 0 + + + + New patch + + + New &Patch + + + Alt+P + - - - controllerTab - - - Contro&ller - - - - unnamed - - - - splitter4 - - - Horizontal - - - - layout13 - - - - unnamed - - - - textLabel1 - - - - 5 - 0 - 0 - 0 - - - - Common: - - - - - listController - - - false - - - - - - This is a list of commonly used midi controllers. + + + + + New group + + + New &Group + + + Alt+G + + + + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 240 + 20 + + + + + + + + + + + + + + + Contro&ller + + + + + + Qt::Horizontal + + + + + + + + 0 + 0 + + + + Common: + + + false + + + + + + + + + + This is a list of commonly used midi controllers. Note that in MusE pitch and program changes are handled like normal controllers. - - - - - - - layout17 - - - - unnamed - - - - - Name - - - true - - - true - - - - - Type - - - true - - - true - - - - - H-Ctrl - - - true - - - false - - - - - L-Ctrl - - - true - - - false - - - - - Min - - - true - - - false - - - - - Max - - - true - - - false - - - - - Def - - - true - - - false - - - - viewController - - - StyledPanel - - - Sunken - - - true - - - List of defined controllers - - - List of defined controllers. - - - - - GroupBox1 - - - - 1 - 5 - 0 - 0 - - - - Properties - - - - unnamed - - - - layout33 - - - - unnamed - - - - TextLabel1_3 - - - Name: - - - - - ctrlName - - - - - - Midi controller name - - - - - - - layout37 - - - - unnamed - - - - TextLabel2_4 - - - Type: - - - - - - Control7 - - - - - Control14 - - - - - RPN - - - - - NRPN - - - - - RPN14 - - - - - NRPN14 - - - - - Pitch - - - - - Program - - - - ctrlType - - - Midi controller type - - - Midi controller type - - - - - spacer15 - - - Horizontal - - - Expanding - - - - 40 - 20 - - - - - - TextLabel3_2 - - - H-Ctrl - - - 10 - - - - - spinBoxHCtrlNo - - - - 7 - 0 - 0 - 0 - - - - 127 - - - 0 - - - 0 - - - Midi controller number high byte - - - Midi controller number high byte - - - - - spacer16 - - - Horizontal - - - Expanding - - - - 40 - 20 - - - - - - TextLabel2_3_2 - - - L-Ctrl - - - 10 - - - - - spinBoxLCtrlNo - - - - 7 - 0 - 0 - 0 - - - - * - wild card - - - 127 - - - -1 - - - 0 - - - Midi controller number low byte (* means drum controller) - - - Midi controller number low byte. + + + + + + + + + + + List of defined controllers + + + List of defined controllers. + + + QFrame::StyledPanel + + + QFrame::Sunken + + + true + + + + Name + + + + + Type + + + + + H-Ctrl + + + + + L-Ctrl + + + + + Min + + + + + Max + + + + + Def + + + + + + + + + 0 + 0 + + + + Properties + + + + + + + + Name: + + + false + + + + + + + + + + Midi controller name + + + + + + + + + + + Type: + + + false + + + + + + + Midi controller type + + + Midi controller type + + + + Control7 + + + + + Control14 + + + + + RPN + + + + + NRPN + + + + + RPN14 + + + + + NRPN14 + + + + + Pitch + + + + + Program + + + + + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 40 + 20 + + + + + + + + H-Ctrl + + + false + + + 10 + + + + + + + + 0 + 0 + + + + Midi controller number high byte + + + Midi controller number high byte + + + 0 + + + 127 + + + 0 + + + + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 40 + 20 + + + + + + + + L-Ctrl + + + false + + + 10 + + + + + + + + 0 + 0 + + + + Midi controller number low byte (* means drum controller) + + + Midi controller number low byte. If low byte is * then the controller is a 'drum controller'. For drum tracks and GS/XG type songs and instruments. @@ -929,80 +744,80 @@ Allows controllers for each instrument in replaced by the 'ANote' in the drum map. Examples: The GS and XG instruments' Drum controllers. - - - - - - - layout38 - - - - unnamed - - - - textLabel4_2 - - - Range: - - - - - spacer17 - - - Horizontal - - - Expanding - - - - 40 - 20 - - - - - - TextLabel1_2_2 - - - Min - - - AlignVCenter|AlignRight - - - 10 - - - - - spinBoxMin - - - - 7 - 0 - 0 - 0 - - - - 16383 - - - -16384 - - - Minimum value. If negative, auto-translate. - - - Minimum value. If the minimum value + + + * + + + -1 + + + 127 + + + 0 + + + + + + + + + + + Range: + + + false + + + + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 40 + 20 + + + + + + + + Min + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + false + + + 10 + + + + + + + + 0 + 0 + + + + Minimum value. If negative, auto-translate. + + + Minimum value. If the minimum value is negative, the range will automatically be translated to a positive range. @@ -1021,259 +836,243 @@ Type 'Pitch' is the exception. It is biased at zero, even with a negative minimum: 'Pitch': Min: -8192 Max: 8191 True range: Min: -8192 Max: 8191 (bias 0) - - - - - spacer18 - - - Horizontal - - - Expanding - - - - 40 - 20 - - - - - - TextLabel2_2_2 - - - Max - - - AlignVCenter|AlignRight - - - 10 - - - - - spinBoxMax - - - - 7 - 0 - 0 - 0 - - - - 16383 - - - -16384 - - - 127 - - - Maximum value - - - Maximum value - - - - - - - layout16 - - - - unnamed - - - - spacer13_2 - - - Horizontal - - - Expanding - - - - 40 - 20 - - - - - - textLabel1_3 - - - Default: - - - AlignVCenter - - - - - textLabel2_4 - - - L-Bank - - - - - defPatchH - - - off - - - 128 - - - 0 - - - 0 - - - - - defPatchL - - - off - - - 128 - - - 0 - - - 0 - - - - - textLabel3 - - - Progr. - - - - - defPatchProg - - - off - - - 128 - - - 0 - - - 0 - - - - - patchButton - - - true - - - - 210 - 0 - - - - ??? - - - - - - - - textLabel1_5 - - - H-Bank - - - - - spacer12_2 - - - Horizontal - - - Expanding - - - - 40 - 20 - - - - - - spinBoxDefault - - - - 7 - 0 - 0 - 0 - - - - - 0 - 0 - - - - - 85 - 32767 - - - - off - dont care - - - 16383 - - - -1 - - - -1 - - - Default value. Off: No default. - - - Default (initial) value. Off means no default. + + + -16384 + + + 16383 + + + + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 40 + 20 + + + + + + + + Max + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + false + + + 10 + + + + + + + + 0 + 0 + + + + Maximum value + + + Maximum value + + + -16384 + + + 16383 + + + 127 + + + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 40 + 20 + + + + + + + + Default: + + + Qt::AlignVCenter + + + false + + + + + + + L-Bank + + + false + + + + + + + off + + + 0 + + + 128 + + + 0 + + + + + + + off + + + 0 + + + 128 + + + 0 + + + + + + + Progr. + + + false + + + + + + + off + + + 0 + + + 128 + + + 0 + + + + + + + true + + + + 210 + 0 + + + + ??? + + + + + + + + + + H-Bank + + + false + + + + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 85 + 32767 + + + + Default value. Off: No default. + + + Default (initial) value. Off means no default. If a default value is chosen, the value will be sent to the controller when the controller is added to @@ -1288,553 +1087,563 @@ Caution! Watch out for controllers such as values. You should probably turn 'off' their default (in piano roll or drum edit, and instrument editor). - - - - - - - - - layout10 - - - - unnamed - - - - addController - - - &Add - - - Alt+A - - - Add common controller - - - - - deleteController - - - &Delete - - - Alt+D - - - Delete controller - - - - - newController - - - New &Controller - - - Alt+C - - - Create a new controller - - - - - spacer13 - - - Horizontal - - - Expanding - - - - 200 - 20 - - - - - - nullValLabelH - - - Null Param Hi: - - - - - nullParamSpinBoxH - - - off - - - 127 - - - -1 - - - 127 - - - Null parameter number High byte - - - If set, these 'null' parameter numbers will + + + off + + + -1 + + + 16383 + + + -1 + + + + + + + + + + + + + + Add common controller + + + &Add + + + Alt+A + + + + + + + Delete controller + + + &Delete + + + Alt+D + + + + + + + Create a new controller + + + New &Controller + + + Alt+C + + + + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 200 + 20 + + + + + + + + Null Param Hi: + + + false + + + + + + + Null parameter number High byte + + + If set, these 'null' parameter numbers will be sent after each RPN/NRPN event. This prevents subsequent 'data' events from corrupting the RPN/NRPN controller. Typically, set to 127/127, or an unused RPN/NRPN controller number. - - - - - spacer13_3 - - - Horizontal - - - Expanding - - - - 200 - 20 - - - - - - nullValLabelL - - - Lo: - - - - - nullParamSpinBoxL - - - off - - - 127 - - - -1 - - - 127 - - - Null parameter number Low byte - - - If set, these 'null' parameter numbers will + + + off + + + -1 + + + 127 + + + 127 + + + + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 200 + 20 + + + + + + + + Lo: + + + false + + + + + + + Null parameter number Low byte + + + If set, these 'null' parameter numbers will be sent after each RPN/NRPN event. This prevents subsequent 'data' events from corrupting the RPN/NRPN controller. Typically, set to 127/127, or an unused RPN/NRPN controller number. - - - - - - - - + + + off + + + -1 + + + 127 + + + 127 + + + + + + + + + + + + + + S&ysEx + + + + + + Qt::Horizontal + + + + + + + SysEx List: + + + false + + + + + + + + 0 + 0 + + + + + + + + + + + + Name: + + + false + + + + + + + + + + Hex Entry: + + + false + + + + + + + + + + + + &Delete + + + Alt+D + - - - sysExTab - - - S&ysEx - - - - unnamed - - - - splitter2 - - - Horizontal - - - - layout12 - - - - unnamed - - - - textLabel2_3 - - - SysEx List: - - - - - sysexList - - - - 7 - 7 - 0 - 0 - - - - - - - - layout11 - - - - unnamed - - - - textLabel1_4 - - - Name: - - - - - sysexName - - - - - textLabel1_2 - - - Hex Entry: - - - - - sysexData - - - - - layout10 - - - - unnamed - - - - deleteSysex - - - &Delete - - - Alt+D - - - - - newSysex - - - New SysE&x - - - Alt+X - - - - - spacer12 - - - Horizontal - - - Expanding - - - - 60 - 20 - - - - - - - - - + + + + + New SysE&x + + + Alt+X + - - - - - - - MenuBar + + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 60 + 20 + + + + + + + + + + + + + + + + + + + + Tools + + + TopToolBarArea + + + false + + + + + + + + + + 0 + 0 + 802 + 21 + + + + false + + + + &File - - false + + + + + + + + + + &Help - - - - - - - - - - - - - - - - toolBar - - - Tools - - - - - - - - - - - - fileNewAction - - - image0 - - - New - - - &New - - - Ctrl+N - - - - - fileOpenAction - - - false - - - image1 - - - Open - - - &Open... - - - Ctrl+O - - - false - - - - - fileSaveAction - - - image2 - - - Save - - - &Save - - - Ctrl+S - - - - - fileSaveAsAction - - - image3 - - - Save As - - - Save &As... - - - - - - - - fileExitAction - - - Exit - - - E&xit - - - - - - - - filenew_itemAction - - - new item - - - new item - - - - - whatsThisAction - - - image4 - - - What's this? - - - What's this? - - - - - - 89504e470d0a1a0a0000000d4948445200000016000000160806000000c4b46c3b0000008249444154388ded95310ac0200c4593d2c334d0c535e0d2c3e75ae9d442353521e0e60741233ee5f355141198a1bd2d30b346168a088ee637aba8aabf0d00804e720f60823d95525c7867454474d0db6766b56c4981af7a7dc6163c05e6ca7dad81a7c088c340e4c04f32bccd52a98868811778810732af74e42df084b3febc6956dc1a2d33a3204eed990000000049454e44ae426082 - - - 89504e470d0a1a0a0000000d4948445200000016000000160806000000c4b46c3b000000ad49444154388db594510ec3200c436db45371b7699a76375f8b7d8caa11cd18d1827f225af1621908256187ca16ea4ef02dbaa1d6daec5a12c7ff9218021f9bbc4692689b32ebf02c541253321ee3017ac6bf728b420180005a6b00d08e25c835eecc403fbc130ab077e2e57ba47931c68375aee2395eab73b91947b3f6e4666ca1af670c787f7caa9bf1bf50f34072a117c7595003ce859e56bbb2a08019f4995060f5b67fd16c56a4cde3516f027970cd357a563f0000000049454e44ae426082 - - - 89504e470d0a1a0a0000000d4948445200000016000000160806000000c4b46c3b000000ad49444154388dd595c10a85201045af0f172e5af83d0afd5944f4670f9aef69e1a25d2d62c2b230c302cf460c3b5ca7310511e10d24001863e69c52221292277db78e4d0b0cff2149646bbbbd636b0b00f8650a1920e34bce514e63aac66dce49996862e53494d3c1735f0aaca5e472de123f255a8a63b2bbbc96b83c7150e3be0b5b2786df0d97e2ab85a97cdb6e4d9b2e3aeef2f191f67f5467dfa4bc762b4f2cf8cecb753d1191d88973b300c3df2bac2a2aaca70000000049454e44ae426082 - - - 89504e470d0a1a0a0000000d49484452000000100000001008060000001ff3ff61000000cf49444154388da593410ec2300c0467090f4a8f3df421fd425f013f834b7af5872273a0a952a010c0926545ceaed6eb4480f3471c00628c009c3801978fb5c60870774712ee6d62246d15745df7b5f4a2e0f0d838eb8c74ddadafc2638cbe8cd21435a65981a43501ccac5d41e9d577b8afdf8fb529b5bb9b19df6ce7581f8ab37598d92ef113c1e36c2d0a36269a19ee4e4a49a5ee225f1100ccf3ac699a7c1c4772ce1f9fe6d3087ddfafa01082007fe781587e638c113323a5a49cb3871036b500866158cd36334829b190fc94376721c8f72ecfaff50000000049454e44ae426082 - - - 89504e470d0a1a0a0000000d4948445200000016000000160806000000c4b46c3b000000ba49444154388dd594db0980300c451371aa0c90b93a5707b86be957306dd387423fbc206221a7370fc30068878e2dd45f824fff212217001e0588e4ab3e4b8948558bb8c6b18834813514500694537ac039971786a588e006351851e9d29f77c133e72b1a36cfc37dda269f7eed98fd0fd273d96ba82f4fddbc330a6801edb4f8464631cb73ecb3891a596bea7836d7afc000783415bdf4bd9a5298437bf766da9e25f0d7b423f16c1f9be3b7976edb6e53c75ff5bf45bf0d7c034d505e874a59314b0000000049454e44ae426082 - - - - - fileNewAction - activated() - Form1 - fileNew() - - - fileOpenAction - activated() - Form1 - fileOpen() - - - fileSaveAction - activated() - Form1 - fileSave() - - - fileSaveAsAction - activated() - Form1 - fileSaveAs() - - - fileExitAction - activated() - Form1 - fileExit() - - - whatsThisAction - activated() - Form1 - helpWhatsThis() - - - - instrumentName - instrumentList - tabWidget3 - patchView - patchNameEdit - spinBoxHBank - spinBoxLBank - spinBoxProgram - checkBoxDrum - checkBoxGM - checkBoxGS - checkBoxXG - listController - viewController - ctrlName - ctrlType - spinBoxHCtrlNo - spinBoxLCtrlNo - spinBoxMin - spinBoxMax - spinBoxDefault - sysexList - sysexName - sysexData - - - fileNew() - fileOpen() - fileSave() - fileSaveAs() - fileExit() - helpWhatsThis() - - - + + + + + + + &New + + + New + + + Ctrl+N + + + fileNewAction + + + + + false + + + &Open... + + + Open + + + Ctrl+O + + + false + + + fileOpenAction + + + + + &Save + + + Save + + + Ctrl+S + + + fileSaveAction + + + + + Save &As... + + + Save As + + + + + + fileSaveAsAction + + + + + E&xit + + + Exit + + + + + + fileExitAction + + + + + new item + + + new item + + + filenew_itemAction + + + + + What's this? + + + What's this? + + + whatsThisAction + + + + + + instrumentName + instrumentList + tabWidget3 + patchView + patchNameEdit + spinBoxHBank + spinBoxLBank + spinBoxProgram + checkBoxDrum + checkBoxGM + checkBoxGS + checkBoxXG + listController + viewController + ctrlName + ctrlType + spinBoxHCtrlNo + spinBoxLCtrlNo + spinBoxMin + spinBoxMax + spinBoxDefault + sysexList + sysexName + sysexData + + + + + fileNewAction + activated() + EditInstrumentBase + fileNew() + + + -1 + -1 + + + 20 + 20 + + + + + fileOpenAction + activated() + EditInstrumentBase + fileOpen() + + + -1 + -1 + + + 20 + 20 + + + + + fileSaveAction + activated() + EditInstrumentBase + fileSave() + + + -1 + -1 + + + 20 + 20 + + + + + fileSaveAsAction + activated() + EditInstrumentBase + fileSaveAs() + + + -1 + -1 + + + 20 + 20 + + + + + fileExitAction + activated() + EditInstrumentBase + fileExit() + + + -1 + -1 + + + 20 + 20 + + + + + whatsThisAction + activated() + EditInstrumentBase + helpWhatsThis() + + + -1 + -1 + + + 20 + 20 + + + + + diff --git a/muse2/muse/widgets/CMakeLists.txt b/muse2/muse/widgets/CMakeLists.txt index 9ae2d02e..0a92ba5a 100644 --- a/muse2/muse/widgets/CMakeLists.txt +++ b/muse2/muse/widgets/CMakeLists.txt @@ -236,7 +236,6 @@ add_library ( widgets STATIC checkbox.cpp aboutbox_impl.cpp popupmenu.cpp - listitem.h menutitleitem.h ) diff --git a/muse2/muse/widgets/comboQuant.cpp b/muse2/muse/widgets/comboQuant.cpp index ec3a4f4a..3eb4e9e0 100644 --- a/muse2/muse/widgets/comboQuant.cpp +++ b/muse2/muse/widgets/comboQuant.cpp @@ -5,6 +5,8 @@ // (C) Copyright 2001 Werner Schweer (ws@seh.de) //========================================================= +#include + #include #include #include diff --git a/muse2/muse/widgets/listitem.h b/muse2/muse/widgets/listitem.h deleted file mode 100644 index 56b0f3d4..00000000 --- a/muse2/muse/widgets/listitem.h +++ /dev/null @@ -1,85 +0,0 @@ -//========================================================= -// MusE -// Linux Music Editor -// $Id: listitem.h,v 1.1.2.1 2008/08/18 00:15:26 terminator356 Exp $ -// -// (C) Copyright 1999/2000 Werner Schweer (ws@seh.de) -//========================================================= - -#ifndef __LISTITEM_H__ -#define __LISTITEM_H__ - -//#include -//#include -#include - -class QString; -class Q3ListBox; -class Q3ListBoxText; -//class QListView; -//class QListViewItem; -class ListBoxData; -class ListViewData; - -//--------------------------------------------------------- -// ListBoxData -//--------------------------------------------------------- - -class ListBoxData : public Q3ListBoxText -{ - void* _data; - - public: - ListBoxData(Q3ListBox* listbox, const QString& text = QString::null) - : Q3ListBoxText(listbox, text) { _data = 0; } - ListBoxData(const QString& text = QString::null) : Q3ListBoxText(text) { _data = 0; } - ListBoxData(Q3ListBox* listbox, const QString& text, ListBoxData* after) - : Q3ListBoxText(listbox, text, (Q3ListBoxText*)after) { _data = 0; } - ~ListBoxData() { } - - virtual void setText(const QString& text) { Q3ListBoxText::setText(text); } - void* data() { return _data; } - void setData(void* dat) { _data = dat; } -}; - -//--------------------------------------------------------- -// ListViewData -//--------------------------------------------------------- - -class ListViewData : public Q3ListViewItem -{ - void* _data; - - public: - ListViewData(Q3ListView* parent) : Q3ListViewItem(parent) { _data = 0; } - //ListViewData(ListViewData* parent) : QListViewItem((QListViewItem*)parent) { _data = 0; } - ListViewData(ListViewData* parent) : Q3ListViewItem(parent) { _data = 0; } - //ListViewData(QListView* parent, ListViewData* after) : QListViewItem(parent, (QListViewItem*)after) { _data = 0; } - ListViewData(Q3ListView* parent, ListViewData* after) : Q3ListViewItem(parent, after) { _data = 0; } - //ListViewData(ListViewData* parent, ListViewData* after) : QListViewItem((QListViewItem*)parent, (QListViewItem*)after) { _data = 0; } - ListViewData(ListViewData* parent, ListViewData* after) : Q3ListViewItem(parent, after) { _data = 0; } - ListViewData(Q3ListView* parent, QString label1, QString label2 = QString::null, QString label3 = QString::null, QString label4 = QString::null, - QString label5 = QString::null, QString label6 = QString::null, QString label7 = QString::null, QString label8 = QString::null) - : Q3ListViewItem(parent, label1, label2, label3, label4, label5, label6, label7, label8) { _data = 0; } - ListViewData(ListViewData* parent, QString label1, QString label2 = QString::null, QString label3 = QString::null, QString label4 = QString::null, - QString label5 = QString::null, QString label6 = QString::null, QString label7 = QString::null, QString label8 = QString::null) - //: QListViewItem((QListViewItem*)parent, label1, label2, label3, label4, label5, label6, label7, label8) { _data = 0; } - : Q3ListViewItem(parent, label1, label2, label3, label4, label5, label6, label7, label8) { _data = 0; } - ListViewData(Q3ListView* parent, ListViewData* after, QString label1, QString label2 = QString::null, QString label3 = QString::null, QString label4 = QString::null, - QString label5 = QString::null, QString label6 = QString::null, QString label7 = QString::null, QString label8 = QString::null) - //: QListViewItem(parent, (QListViewItem*)after, label1, label2, label3, label4, label5, label6, label7, label8) { _data = 0; } - : Q3ListViewItem(parent, after, label1, label2, label3, label4, label5, label6, label7, label8) { _data = 0; } - ListViewData(ListViewData* parent, ListViewData* after, QString label1, QString label2 = QString::null, QString label3 = QString::null, QString label4 = QString::null, - QString label5 = QString::null, QString label6 = QString::null, QString label7 = QString::null, QString label8 = QString::null) - //: QListViewItem((QListViewItem*)parent, (QListViewItem*)after, label1, label2, label3, label4, label5, label6, label7, label8) { _data = 0; } - : Q3ListViewItem(parent, after, label1, label2, label3, label4, label5, label6, label7, label8) { _data = 0; } - ~ListViewData() { } - - void* data() { return _data; } - void setData(void* dat) { _data = dat; } -}; - - - -#endif - diff --git a/muse2/xpm/filesaveas.xpm b/muse2/xpm/filesaveas.xpm new file mode 100644 index 00000000..bbd1711c --- /dev/null +++ b/muse2/xpm/filesaveas.xpm @@ -0,0 +1,90 @@ +/* XPM */ +static const char * filesaveas_xpm[] = { +"22 22 65 1", +" c None", +". c #000000", +"+ c #0A0A0A", +"@ c #090C09", +"# c #010001", +"$ c #800080", +"% c #0000C0", +"& c #000002", +"* c #303030", +"= c #020001", +"- c #000105", +"; c #010101", +"> c #FFFFFF", +", c #060606", +"' c #040404", +") c #050505", +"! c #171717", +"~ c #131313", +"{ c #FEFDFE", +"] c #FDFDFE", +"^ c #FEFDFF", +"/ c #FFFDFF", +"( c #FDFDFF", +"_ c #020202", +": c #030303", +"< c #50504D", +"[ c #5C5C5C", +"} c #646464", +"| c #191919", +"1 c #090909", +"2 c #EEF4ED", +"3 c #F3F3E9", +"4 c #EEF3EC", +"5 c #EFF3EC", +"6 c #F5F5EB", +"7 c #F8FFF8", +"8 c #585858", +"9 c #757575", +"0 c #4A4A4A", +"a c #141514", +"b c #161716", +"c c #171715", +"d c #151514", +"e c #0D0E0D", +"f c #9D9D9C", +"g c #6F6F6F", +"h c #474747", +"i c #333333", +"j c #4D4D4D", +"k c #707070", +"l c #1E1E1E", +"m c #9F9F9F", +"n c #DCDCDC", +"o c #979797", +"p c #C3C3C3", +"q c #9B9B9B", +"r c #4B4B4B", +"s c #727272", +"t c #CDCDCD", +"u c #CFCFCF", +"v c #393939", +"w c #313131", +"x c #B8B8B8", +"y c #0F0F0F", +"z c #CECECE", +"......................", +".+@#$%%$%%$%%$%%$%&**.", +".**=$%%$%%$%%$%%$%-**.", +".**;>>>>>>>>>>>>>>,...", +".**'>>>>>>>>>>>>>>)**.", +".!~)>>$%$$%$$%$$>>)**.", +".**)>>$%$$%$$%$$>>)**.", +".**)>>{]{]]{]^/(>>)**.", +".**)>>$%$$%$$%$$>>._+.", +".**:>>$%$$%$$%<.![}|..", +".**1>>234567>8>89>>0..", +".***|abcbbdef>>8g>>h..", +".**********.i}j*k>>h..", +".**********.l888>>>h..", +".*****;.:);.m>>>>>>h..", +".***;>n>nnn;o>>>>>>h..", +".***.n**88p)q>>>>>>r..", +".***.>**88n)stttuttv..", +".***.n*w88xy.:__',)...", +"..**.>**88zpppppp.***.", +"**.*.npnpnppppppp.***.", +"**...................."}; -- cgit v1.2.3