Diffstat (limited to 'noncore/multimedia/tonleiter/editinst.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/multimedia/tonleiter/editinst.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/noncore/multimedia/tonleiter/editinst.cpp b/noncore/multimedia/tonleiter/editinst.cpp index ccb4560..a8c20c8 100644 --- a/noncore/multimedia/tonleiter/editinst.cpp +++ b/noncore/multimedia/tonleiter/editinst.cpp | |||
@@ -1,29 +1,34 @@ | |||
1 | #include "editinst.h" | 1 | #include "editinst.h" |
2 | 2 | ||
3 | #include <qpushbutton.h> | 3 | /* OPIE */ |
4 | 4 | #include <opie2/odebug.h> | |
5 | #include <qpe/config.h> | ||
5 | #include <qpe/qpeapplication.h> | 6 | #include <qpe/qpeapplication.h> |
7 | using namespace Opie::Core; | ||
8 | |||
9 | /* QT */ | ||
10 | #include <qpushbutton.h> | ||
6 | 11 | ||
7 | Menu::InstEditDialog::InstEditDialog(TonleiterData* data,QWidget* parent,const char* name) | 12 | Menu::InstEditDialog::InstEditDialog(TonleiterData* data,QWidget* parent,const char* name) |
8 | :QDialog(parent,name,true,0),data(data) | 13 | :QDialog(parent,name,true,0),data(data) |
9 | { | 14 | { |
10 | setCaption("Tonleiter::"+tr("Instrument")); | 15 | setCaption("Tonleiter::"+tr("Instrument")); |
11 | QBoxLayout* masterlayout=new QBoxLayout(this,QBoxLayout::TopToBottom); | 16 | QBoxLayout* masterlayout=new QBoxLayout(this,QBoxLayout::TopToBottom); |
12 | instid=data->getCurrentInstrumentID(); | 17 | instid=data->getCurrentInstrumentID(); |
13 | stringlist.setAutoDelete(true); | 18 | stringlist.setAutoDelete(true); |
14 | 19 | ||
15 | QBoxLayout* toplayout=new QBoxLayout(masterlayout,QBoxLayout::LeftToRight); | 20 | QBoxLayout* toplayout=new QBoxLayout(masterlayout,QBoxLayout::LeftToRight); |
16 | 21 | ||
17 | //Name combo + Add + Delete | 22 | //Name combo + Add + Delete |
18 | boxInst=new QComboBox(this,"boxInst"); | 23 | boxInst=new QComboBox(this,"boxInst"); |
19 | boxInst->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding,QSizePolicy::Maximum)); | 24 | boxInst->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding,QSizePolicy::Maximum)); |
20 | connect(boxInst,SIGNAL(activated(int)),this,SLOT(setCurrentInstrumetID(int))); | 25 | connect(boxInst,SIGNAL(activated(int)),this,SLOT(setCurrentInstrumetID(int))); |
21 | for(int i=0;i<data->noOfInstruments();i++) | 26 | for(int i=0;i<data->noOfInstruments();i++) |
22 | { | 27 | { |
23 | Instrument inst=data->getInstrument(i); | 28 | Instrument inst=data->getInstrument(i); |
24 | QString name=inst.instName(); | 29 | QString name=inst.instName(); |
25 | if(name.isNull()) continue; | 30 | if(name.isNull()) continue; |
26 | boxInst->insertItem(name,i); | 31 | boxInst->insertItem(name,i); |
27 | } | 32 | } |
28 | boxInst->setCurrentItem(instid); | 33 | boxInst->setCurrentItem(instid); |
29 | toplayout->addWidget(boxInst); | 34 | toplayout->addWidget(boxInst); |
@@ -79,32 +84,32 @@ void Menu::InstEditDialog::deleteInstrument() | |||
79 | } | 84 | } |
80 | //**************************************************************************** | 85 | //**************************************************************************** |
81 | void Menu::InstEditDialog::addLowString() | 86 | void Menu::InstEditDialog::addLowString() |
82 | { | 87 | { |
83 | } | 88 | } |
84 | //**************************************************************************** | 89 | //**************************************************************************** |
85 | void Menu::InstEditDialog::addHighString() | 90 | void Menu::InstEditDialog::addHighString() |
86 | { | 91 | { |
87 | } | 92 | } |
88 | //**************************************************************************** | 93 | //**************************************************************************** |
89 | void Menu::InstEditDialog::deleteString(int id) | 94 | void Menu::InstEditDialog::deleteString(int id) |
90 | { | 95 | { |
91 | } | 96 | } |
92 | //**************************************************************************** | 97 | //**************************************************************************** |
93 | void Menu::InstEditDialog::saveInstrument() | 98 | void Menu::InstEditDialog::saveInstrument() |
94 | { | 99 | { |
95 | //auto delete is set to true so widgets _should_ be deleted | 100 | //auto delete is set to true so widgets _should_ be deleted |
96 | stringlist.clear(); | 101 | stringlist.clear(); |
97 | } | 102 | } |
98 | //**************************************************************************** | 103 | //**************************************************************************** |
99 | void Menu::InstEditDialog::loadInstrument() | 104 | void Menu::InstEditDialog::loadInstrument() |
100 | { | 105 | { |
101 | stringlist.clear(); | 106 | stringlist.clear(); |
102 | Instrument inst=data->getInstrument(instid); | 107 | Instrument inst=data->getInstrument(instid); |
103 | qDebug("load Instrument : %d strings",inst.noOfStrings()); | 108 | odebug << "load Instrument : " << inst.noOfStrings() << " strings" << oendl; |
104 | for(uint s=0;s<inst.noOfStrings();s++) | 109 | for(uint s=0;s<inst.noOfStrings();s++) |
105 | { | 110 | { |
106 | stringlist.append(new EditStringWidget(inst.string(s),stringwidget)); | 111 | stringlist.append(new EditStringWidget(inst.string(s),stringwidget)); |
107 | } | 112 | } |
108 | } | 113 | } |
109 | //**************************************************************************** | 114 | //**************************************************************************** |
110 | //**************************************************************************** | 115 | //**************************************************************************** |