author | waspe <waspe> | 2003-11-20 19:34:08 (UTC) |
---|---|---|
committer | waspe <waspe> | 2003-11-20 19:34:08 (UTC) |
commit | e6a5ed6de7e821a070d571045ff063f8c41b0b79 (patch) (side-by-side diff) | |
tree | 8455d7bf537cf804337b6c03b28f891ee3f286ce /noncore/multimedia/tonleiter/menuwidget.cpp | |
parent | f43e28fe8f226039d96ebda4e6c4d26e4f3320ba (diff) | |
download | opie-e6a5ed6de7e821a070d571045ff063f8c41b0b79.zip opie-e6a5ed6de7e821a070d571045ff063f8c41b0b79.tar.gz opie-e6a5ed6de7e821a070d571045ff063f8c41b0b79.tar.bz2 |
added preliminary edit dialogs
default config added
Diffstat (limited to 'noncore/multimedia/tonleiter/menuwidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/multimedia/tonleiter/menuwidget.cpp | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/noncore/multimedia/tonleiter/menuwidget.cpp b/noncore/multimedia/tonleiter/menuwidget.cpp index 3dfa09d..1e3742c 100644 --- a/noncore/multimedia/tonleiter/menuwidget.cpp +++ b/noncore/multimedia/tonleiter/menuwidget.cpp @@ -1,60 +1,77 @@ #include "menuwidget.h" #include <qlabel.h> #include <qlayout.h> -MenuWidget::MenuWidget(TonleiterData* data,QWidget* parent,const char* name,WFlags f) +#include "editinst.h" +#include "editscale.h" + +Menu::MenuWidget::MenuWidget(TonleiterData* data,QWidget* parent,const char* name,WFlags f) :QWidget(parent,name,f),data(data) { QGridLayout* layout=new QGridLayout(this,3,3,10,-1,"menulayout"); QLabel* instLabel=new QLabel(tr("Instr."),this,"instLabel"); layout->addWidget(instLabel,0,0); boxInst=new QComboBox(this,"boxInst"); connect(boxInst,SIGNAL(activated(int)),data,SLOT(setCurrentInstrumetID(int))); layout->addWidget(boxInst,0,1); editInst=new QPushButton(tr("Edit"),this,"editInst"); + connect(editInst,SIGNAL(pressed()),this,SLOT(editInstPressed())); layout->addWidget(editInst,0,2); QLabel* noteLabel=new QLabel(tr("Note"),this,"noteLabel"); layout->addWidget(noteLabel,1,0); boxNote=new QComboBox(this,"boxNote"); connect(boxNote,SIGNAL(activated(int)),data,SLOT(setCurrentNote(int))); layout->addWidget(boxNote,1,1); for(int a=0;a<12;a++) boxNote->insertItem(Note::notenames[a],a); boxNote->setCurrentItem(data->getCurrentBaseNote()); noteCheck=new QCheckBox(tr("show"),this,"noteCheck"); noteCheck->setChecked(data->isDrawNames()); connect(noteCheck,SIGNAL(toggled(bool)),data,SLOT(setDrawNames(bool))); layout->addWidget(noteCheck,1,2); QLabel* scaleLabel=new QLabel(tr("Scale"),this,"scaleLabel"); layout->addWidget(scaleLabel,2,0); boxScale=new QComboBox(this,"boxScale"); connect(boxScale,SIGNAL(activated(int)),data,SLOT(setCurrentScaleID(int))); layout->addWidget(boxScale,2,1); editScale=new QPushButton(tr("Edit"),this,"editScale"); + connect(editScale,SIGNAL(pressed()),this,SLOT(editScalePressed())); layout->addWidget(editScale,2,2); updateBoxes(); } //**************************************************************************** -MenuWidget::~MenuWidget() +Menu::MenuWidget::~MenuWidget() +{ +} +//**************************************************************************** +void Menu::MenuWidget::editInstPressed() +{ + InstEditDialog* instdialog=new InstEditDialog(data,this); + instdialog->exec(); +} +//**************************************************************************** +void Menu::MenuWidget::editScalePressed() { + ScaleEditDialog* scaledialog=new ScaleEditDialog(data,this); + scaledialog->exec(); } //**************************************************************************** -void MenuWidget::updateBoxes() +void Menu::MenuWidget::updateBoxes() { boxInst->clear(); for(int i=0;i<data->noOfInstruments();i++) { Instrument inst=data->getInstrument(i); QString name=inst.instName(); if(name.isNull()) continue; boxInst->insertItem(name,i); } boxInst->setCurrentItem(data->getCurrentInstrumentID()); |