-rw-r--r-- | noncore/multimedia/tonleiter/editinst.cpp | 4 | ||||
-rw-r--r-- | noncore/multimedia/tonleiter/editscale.cpp | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/noncore/multimedia/tonleiter/editinst.cpp b/noncore/multimedia/tonleiter/editinst.cpp index f172ef8..5616569 100644 --- a/noncore/multimedia/tonleiter/editinst.cpp +++ b/noncore/multimedia/tonleiter/editinst.cpp | |||
@@ -1,29 +1,31 @@ | |||
1 | #include "editinst.h" | 1 | #include "editinst.h" |
2 | 2 | ||
3 | #include <qlabel.h> | 3 | #include <qlabel.h> |
4 | #include <qpushbutton.h> | 4 | #include <qpushbutton.h> |
5 | 5 | ||
6 | #include <qpe/qpeapplication.h> | ||
7 | |||
6 | Menu::InstEditDialog::InstEditDialog(TonleiterData* data,QWidget* parent,const char* name) | 8 | Menu::InstEditDialog::InstEditDialog(TonleiterData* data,QWidget* parent,const char* name) |
7 | :QDialog(parent,name,true,0),data(data) | 9 | :QDialog(parent,name,true,0),data(data) |
8 | { | 10 | { |
9 | setCaption("Tonleiter::"+tr("Instrument")); | 11 | setCaption("Tonleiter::"+tr("Instrument")); |
10 | QBoxLayout* masterlayout=new QBoxLayout(this,QBoxLayout::TopToBottom); | 12 | QBoxLayout* masterlayout=new QBoxLayout(this,QBoxLayout::TopToBottom); |
11 | instid=data->getCurrentInstrumentID(); | 13 | instid=data->getCurrentInstrumentID(); |
12 | stringlist.setAutoDelete(true); | 14 | stringlist.setAutoDelete(true); |
13 | 15 | ||
14 | QBoxLayout* toplayout=new QBoxLayout(masterlayout,QBoxLayout::LeftToRight); | 16 | QBoxLayout* toplayout=new QBoxLayout(masterlayout,QBoxLayout::LeftToRight); |
15 | 17 | ||
16 | //Name combo + Add + Delete | 18 | //Name combo + Add + Delete |
17 | boxInst=new QComboBox(this,"boxInst"); | 19 | boxInst=new QComboBox(this,"boxInst"); |
18 | boxInst->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding,QSizePolicy::Maximum)); | 20 | boxInst->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding,QSizePolicy::Maximum)); |
19 | connect(boxInst,SIGNAL(activated(int)),this,SLOT(setCurrentInstrumetID(int))); | 21 | connect(boxInst,SIGNAL(activated(int)),this,SLOT(setCurrentInstrumetID(int))); |
20 | for(int i=0;i<data->noOfInstruments();i++) | 22 | for(int i=0;i<data->noOfInstruments();i++) |
21 | { | 23 | { |
22 | Instrument inst=data->getInstrument(i); | 24 | Instrument inst=data->getInstrument(i); |
23 | QString name=inst.instName(); | 25 | QString name=inst.instName(); |
24 | if(name.isNull()) continue; | 26 | if(name.isNull()) continue; |
25 | boxInst->insertItem(name,i); | 27 | boxInst->insertItem(name,i); |
26 | } | 28 | } |
27 | boxInst->setCurrentItem(instid); | 29 | boxInst->setCurrentItem(instid); |
28 | toplayout->addWidget(boxInst); | 30 | toplayout->addWidget(boxInst); |
29 | 31 | ||
@@ -33,49 +35,49 @@ Menu::InstEditDialog::InstEditDialog(TonleiterData* data,QWidget* parent,const c | |||
33 | 35 | ||
34 | QPushButton* delButton=new QPushButton(tr("Delete"),this,"delButton"); | 36 | QPushButton* delButton=new QPushButton(tr("Delete"),this,"delButton"); |
35 | connect(delButton,SIGNAL(pressed()),this,SLOT(deleteInstrument())); | 37 | connect(delButton,SIGNAL(pressed()),this,SLOT(deleteInstrument())); |
36 | toplayout->addWidget(delButton); | 38 | toplayout->addWidget(delButton); |
37 | 39 | ||
38 | QPushButton* addhighButton=new QPushButton(tr("Add High String"),this,"addhighButton"); | 40 | QPushButton* addhighButton=new QPushButton(tr("Add High String"),this,"addhighButton"); |
39 | masterlayout->addWidget(addhighButton); | 41 | masterlayout->addWidget(addhighButton); |
40 | 42 | ||
41 | scrollview=new QScrollView(this); | 43 | scrollview=new QScrollView(this); |
42 | scrollview->setVScrollBarMode(QScrollView::AlwaysOn); | 44 | scrollview->setVScrollBarMode(QScrollView::AlwaysOn); |
43 | scrollview->setHScrollBarMode(QScrollView::AlwaysOff); | 45 | scrollview->setHScrollBarMode(QScrollView::AlwaysOff); |
44 | stringwidget=new QVBox(scrollview->viewport()); | 46 | stringwidget=new QVBox(scrollview->viewport()); |
45 | stringwidget->setSizePolicy(QSizePolicy(QSizePolicy::Minimum,QSizePolicy::Minimum)); | 47 | stringwidget->setSizePolicy(QSizePolicy(QSizePolicy::Minimum,QSizePolicy::Minimum)); |
46 | stringwidget->setSpacing(10); | 48 | stringwidget->setSpacing(10); |
47 | scrollview->addChild(stringwidget); | 49 | scrollview->addChild(stringwidget); |
48 | scrollview->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding,QSizePolicy::Maximum)); | 50 | scrollview->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding,QSizePolicy::Maximum)); |
49 | masterlayout->addWidget(scrollview); | 51 | masterlayout->addWidget(scrollview); |
50 | 52 | ||
51 | loadInstrument(); | 53 | loadInstrument(); |
52 | 54 | ||
53 | QPushButton* addlowButton=new QPushButton(tr("Add Low String"),this,"addlowButton"); | 55 | QPushButton* addlowButton=new QPushButton(tr("Add Low String"),this,"addlowButton"); |
54 | masterlayout->addWidget(addlowButton); | 56 | masterlayout->addWidget(addlowButton); |
55 | 57 | ||
56 | //make dialog fit the screen | 58 | //make dialog fit the screen |
57 | showMaximized(); | 59 | QPEApplication::showDialog( this ); |
58 | } | 60 | } |
59 | //**************************************************************************** | 61 | //**************************************************************************** |
60 | Menu::InstEditDialog::~InstEditDialog() | 62 | Menu::InstEditDialog::~InstEditDialog() |
61 | { | 63 | { |
62 | } | 64 | } |
63 | //**************************************************************************** | 65 | //**************************************************************************** |
64 | void Menu::InstEditDialog::setCurrentInstrumetID(int id) | 66 | void Menu::InstEditDialog::setCurrentInstrumetID(int id) |
65 | { | 67 | { |
66 | saveInstrument(); | 68 | saveInstrument(); |
67 | instid=id; | 69 | instid=id; |
68 | data->setCurrentInstrumetID(id); | 70 | data->setCurrentInstrumetID(id); |
69 | loadInstrument(); | 71 | loadInstrument(); |
70 | } | 72 | } |
71 | //**************************************************************************** | 73 | //**************************************************************************** |
72 | void Menu::InstEditDialog::addInstrument() | 74 | void Menu::InstEditDialog::addInstrument() |
73 | { | 75 | { |
74 | } | 76 | } |
75 | //**************************************************************************** | 77 | //**************************************************************************** |
76 | void Menu::InstEditDialog::deleteInstrument() | 78 | void Menu::InstEditDialog::deleteInstrument() |
77 | { | 79 | { |
78 | } | 80 | } |
79 | //**************************************************************************** | 81 | //**************************************************************************** |
80 | void Menu::InstEditDialog::addLowString() | 82 | void Menu::InstEditDialog::addLowString() |
81 | { | 83 | { |
diff --git a/noncore/multimedia/tonleiter/editscale.cpp b/noncore/multimedia/tonleiter/editscale.cpp index 0be0058..28bd579 100644 --- a/noncore/multimedia/tonleiter/editscale.cpp +++ b/noncore/multimedia/tonleiter/editscale.cpp | |||
@@ -1,46 +1,48 @@ | |||
1 | #include "editscale.h" | 1 | #include "editscale.h" |
2 | 2 | ||
3 | #include <qlayout.h> | 3 | #include <qlayout.h> |
4 | #include <qpushbutton.h> | 4 | #include <qpushbutton.h> |
5 | 5 | ||
6 | #include <qpe/qpeapplication.h> | ||
7 | |||
6 | Menu::ScaleEditDialog::ScaleEditDialog(TonleiterData* data,QWidget* parent,const char* name) | 8 | Menu::ScaleEditDialog::ScaleEditDialog(TonleiterData* data,QWidget* parent,const char* name) |
7 | :QDialog(parent,name,true,0),data(data) | 9 | :QDialog(parent,name,true,0),data(data) |
8 | { | 10 | { |
9 | setCaption("Tonleiter::"+tr("Scale")); | 11 | setCaption("Tonleiter::"+tr("Scale")); |
10 | QBoxLayout* masterlayout=new QBoxLayout(this,QBoxLayout::TopToBottom); | 12 | QBoxLayout* masterlayout=new QBoxLayout(this,QBoxLayout::TopToBottom); |
11 | 13 | ||
12 | QBoxLayout* toplayout=new QBoxLayout(masterlayout,QBoxLayout::LeftToRight); | 14 | QBoxLayout* toplayout=new QBoxLayout(masterlayout,QBoxLayout::LeftToRight); |
13 | 15 | ||
14 | boxScale=new QComboBox(this,"boxScale"); | 16 | boxScale=new QComboBox(this,"boxScale"); |
15 | for(int s=0;s<data->noOfScales();s++) | 17 | for(int s=0;s<data->noOfScales();s++) |
16 | { | 18 | { |
17 | Scale scale=data->getScale(s); | 19 | Scale scale=data->getScale(s); |
18 | QString name=scale.scaleName(); | 20 | QString name=scale.scaleName(); |
19 | if(name.isNull()) continue; | 21 | if(name.isNull()) continue; |
20 | //boxScale->insertItem(name,s); | 22 | //boxScale->insertItem(name,s); |
21 | } | 23 | } |
22 | boxScale->setCurrentItem(data->getCurrentScaleID()); | 24 | boxScale->setCurrentItem(data->getCurrentScaleID()); |
23 | boxScale->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding,QSizePolicy::Maximum)); | 25 | boxScale->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding,QSizePolicy::Maximum)); |
24 | connect(boxScale,SIGNAL(activated(int)),data,SLOT(setCurrentScaleID(int))); | 26 | connect(boxScale,SIGNAL(activated(int)),data,SLOT(setCurrentScaleID(int))); |
25 | toplayout->addWidget(boxScale); | 27 | toplayout->addWidget(boxScale); |
26 | 28 | ||
27 | QPushButton* addButton=new QPushButton(tr("Add"),this,"addButton"); | 29 | QPushButton* addButton=new QPushButton(tr("Add"),this,"addButton"); |
28 | connect(addButton,SIGNAL(pressed()),this,SLOT(addInstrument())); | 30 | connect(addButton,SIGNAL(pressed()),this,SLOT(addInstrument())); |
29 | toplayout->addWidget(addButton); | 31 | toplayout->addWidget(addButton); |
30 | 32 | ||
31 | QPushButton* delButton=new QPushButton(tr("Delete"),this,"delButton"); | 33 | QPushButton* delButton=new QPushButton(tr("Delete"),this,"delButton"); |
32 | connect(delButton,SIGNAL(pressed()),this,SLOT(deleteInstrument())); | 34 | connect(delButton,SIGNAL(pressed()),this,SLOT(deleteInstrument())); |
33 | toplayout->addWidget(delButton); | 35 | toplayout->addWidget(delButton); |
34 | 36 | ||
35 | pianoscale=new PianoScale(this); | 37 | pianoscale=new PianoScale(this); |
36 | masterlayout->addWidget(pianoscale); | 38 | masterlayout->addWidget(pianoscale); |
37 | 39 | ||
38 | //make dialog fit the screen | 40 | //make dialog fit the screen |
39 | showMaximized(); | 41 | QPEApplication::showDialog( this ); |
40 | } | 42 | } |
41 | //**************************************************************************** | 43 | //**************************************************************************** |
42 | Menu::ScaleEditDialog::~ScaleEditDialog() | 44 | Menu::ScaleEditDialog::~ScaleEditDialog() |
43 | { | 45 | { |
44 | } | 46 | } |
45 | //**************************************************************************** | 47 | //**************************************************************************** |
46 | //**************************************************************************** | 48 | //**************************************************************************** |