author | waspe <waspe> | 2003-12-02 19:03:50 (UTC) |
---|---|---|
committer | waspe <waspe> | 2003-12-02 19:03:50 (UTC) |
commit | 64304e555fc3e06aa69fa2f4a514ee55b7aa98bc (patch) (unidiff) | |
tree | 3ce47189f43f18cccd42d326cf52977b339c744d /noncore/multimedia/tonleiter/editinst.cpp | |
parent | 7b74f202db22d458c43b2063ae128bf79b0e9777 (diff) | |
download | opie-64304e555fc3e06aa69fa2f4a514ee55b7aa98bc.zip opie-64304e555fc3e06aa69fa2f4a514ee55b7aa98bc.tar.gz opie-64304e555fc3e06aa69fa2f4a514ee55b7aa98bc.tar.bz2 |
*** empty log message ***
Diffstat (limited to 'noncore/multimedia/tonleiter/editinst.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/multimedia/tonleiter/editinst.cpp | 93 |
1 files changed, 93 insertions, 0 deletions
diff --git a/noncore/multimedia/tonleiter/editinst.cpp b/noncore/multimedia/tonleiter/editinst.cpp index 1eba4dc..120c3ac 100644 --- a/noncore/multimedia/tonleiter/editinst.cpp +++ b/noncore/multimedia/tonleiter/editinst.cpp | |||
@@ -1,9 +1,60 @@ | |||
1 | #include "editinst.h" | 1 | #include "editinst.h" |
2 | 2 | ||
3 | #include <qlabel.h> | ||
4 | #include <qpushbutton.h> | ||
5 | |||
3 | Menu::InstEditDialog::InstEditDialog(TonleiterData* data,QWidget* parent,const char* name) | 6 | Menu::InstEditDialog::InstEditDialog(TonleiterData* data,QWidget* parent,const char* name) |
4 | :QDialog(parent,name,true,0),data(data) | 7 | :QDialog(parent,name,true,0),data(data) |
5 | { | 8 | { |
6 | setCaption("Tonleiter::"+tr("Instrument")); | 9 | setCaption("Tonleiter::"+tr("Instrument")); |
10 | QBoxLayout* masterlayout=new QBoxLayout(this,QBoxLayout::TopToBottom); | ||
11 | instid=data->getCurrentInstrumentID(); | ||
12 | stringlist.setAutoDelete(true); | ||
13 | |||
14 | QBoxLayout* toplayout=new QBoxLayout(masterlayout,QBoxLayout::LeftToRight); | ||
15 | |||
16 | //Name combo + Add + Delete | ||
17 | boxInst=new QComboBox(this,"boxInst"); | ||
18 | boxInst->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding,QSizePolicy::Maximum)); | ||
19 | connect(boxInst,SIGNAL(activated(int)),this,SLOT(setCurrentInstrumetID(int))); | ||
20 | for(int i=0;i<data->noOfInstruments();i++) | ||
21 | { | ||
22 | Instrument inst=data->getInstrument(i); | ||
23 | QString name=inst.instName(); | ||
24 | if(name.isNull()) continue; | ||
25 | boxInst->insertItem(name,i); | ||
26 | } | ||
27 | boxInst->setCurrentItem(instid); | ||
28 | toplayout->addWidget(boxInst); | ||
29 | |||
30 | QPushButton* addButton=new QPushButton(tr("Add"),this,"addButton"); | ||
31 | connect(addButton,SIGNAL(pressed()),this,SLOT(addInstrument())); | ||
32 | toplayout->addWidget(addButton); | ||
33 | |||
34 | QPushButton* delButton=new QPushButton(tr("Delete"),this,"delButton"); | ||
35 | connect(delButton,SIGNAL(pressed()),this,SLOT(deleteInstrument())); | ||
36 | toplayout->addWidget(delButton); | ||
37 | |||
38 | QPushButton* addhighButton=new QPushButton(tr("Add High String"),this,"addhighButton"); | ||
39 | masterlayout->addWidget(addhighButton); | ||
40 | |||
41 | QScrollView* scrollview=new QScrollView(this); | ||
42 | scrollview->setVScrollBarMode(QScrollView::AlwaysOn); | ||
43 | scrollview->setHScrollBarMode(QScrollView::AlwaysOff); | ||
44 | stringwidget=new QVBox(scrollview->viewport()); | ||
45 | stringwidget->setSizePolicy(QSizePolicy(QSizePolicy::Minimum,QSizePolicy::Minimum)); | ||
46 | stringwidget->setSpacing(10); | ||
47 | scrollview->addChild(stringwidget); | ||
48 | scrollview->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding,QSizePolicy::Maximum)); | ||
49 | //scrollview->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding,QSizePolicy::MinimumExpanding)); | ||
50 | masterlayout->addWidget(scrollview); | ||
51 | |||
52 | loadInstrument(); | ||
53 | |||
54 | QPushButton* addlowButton=new QPushButton(tr("Add Low String"),this,"addlowButton"); | ||
55 | masterlayout->addWidget(addlowButton); | ||
56 | |||
57 | //make dialog fit the screen | ||
7 | showMaximized(); | 58 | showMaximized(); |
8 | } | 59 | } |
9 | //**************************************************************************** | 60 | //**************************************************************************** |
@@ -11,4 +62,46 @@ Menu::InstEditDialog::~InstEditDialog() | |||
11 | { | 62 | { |
12 | } | 63 | } |
13 | //**************************************************************************** | 64 | //**************************************************************************** |
65 | void Menu::InstEditDialog::setCurrentInstrumetID(int id) | ||
66 | { | ||
67 | saveInstrument(); | ||
68 | instid=id; | ||
69 | data->setCurrentInstrumetID(id); | ||
70 | loadInstrument(); | ||
71 | } | ||
72 | //**************************************************************************** | ||
73 | void Menu::InstEditDialog::addInstrument() | ||
74 | { | ||
75 | } | ||
76 | //**************************************************************************** | ||
77 | void Menu::InstEditDialog::deleteInstrument() | ||
78 | { | ||
79 | } | ||
80 | //**************************************************************************** | ||
81 | void Menu::InstEditDialog::addLowString() | ||
82 | { | ||
83 | } | ||
84 | //**************************************************************************** | ||
85 | void Menu::InstEditDialog::addHighString() | ||
86 | { | ||
87 | } | ||
88 | //**************************************************************************** | ||
89 | void Menu::InstEditDialog::deleteString(int id) | ||
90 | { | ||
91 | } | ||
92 | //**************************************************************************** | ||
93 | void Menu::InstEditDialog::saveInstrument() | ||
94 | { | ||
95 | stringlist.clear(); | ||
96 | } | ||
97 | //**************************************************************************** | ||
98 | void Menu::InstEditDialog::loadInstrument() | ||
99 | { | ||
100 | Instrument inst=data->getInstrument(instid); | ||
101 | for(uint s=0;s<inst.noOfStrings();s++) | ||
102 | { | ||
103 | stringlist.append(new EditStringWidget(inst.string(s),stringwidget)); | ||
104 | } | ||
105 | } | ||
106 | //**************************************************************************** | ||
14 | //**************************************************************************** | 107 | //**************************************************************************** |