summaryrefslogtreecommitdiff
path: root/muse_qt4_evolution/midiplugins/drumglue/drumgluegui.cpp
diff options
context:
space:
mode:
authorRobert Jonsson <spamatica@gmail.com>2009-12-27 11:30:35 +0000
committerRobert Jonsson <spamatica@gmail.com>2009-12-27 11:30:35 +0000
commitb703eab295330e6f81564fbb39a10a1a2fdd2f54 (patch)
treee46b5c9a6bc22fd661c15d1d2123f5bf631cef80 /muse_qt4_evolution/midiplugins/drumglue/drumgluegui.cpp
parent5d5fa0fdf913907edbc3d2d29a7548f0cb658c94 (diff)
moved old qt4 branch
Diffstat (limited to 'muse_qt4_evolution/midiplugins/drumglue/drumgluegui.cpp')
-rw-r--r--muse_qt4_evolution/midiplugins/drumglue/drumgluegui.cpp68
1 files changed, 68 insertions, 0 deletions
diff --git a/muse_qt4_evolution/midiplugins/drumglue/drumgluegui.cpp b/muse_qt4_evolution/midiplugins/drumglue/drumgluegui.cpp
new file mode 100644
index 00000000..562adf2c
--- /dev/null
+++ b/muse_qt4_evolution/midiplugins/drumglue/drumgluegui.cpp
@@ -0,0 +1,68 @@
+//=========================================================
+// MusE
+// Linux Music Editor
+//
+// (C) Copyright 2008 Robert Jonsson (rj@spamatica.se)
+// (C) Copyright 2005- Werner Schweer (ws@seh.de)
+// Copyright: See COPYING file that comes with this distribution
+//=========================================================
+
+#include "drumgluegui.h"
+#include "drumglue.h"
+#include "globalinstrumentview.h"
+
+//---------------------------------------------------------
+// DrumGlueGui
+//---------------------------------------------------------
+
+DrumGlueGui::DrumGlueGui(DrumGlue* f, QWidget* parent)
+ : QDialog(parent)
+ {
+ drumGlue = f;
+ setupUi(this);
+ instrumentsTabWidget->clear();
+
+ connect (addInstrumentButton, SIGNAL(clicked()), this, SLOT(addInstrument()));
+ }
+
+//---------------------------------------------------------
+// init
+//---------------------------------------------------------
+void DrumGlueGui::init()
+ {
+ foreach(DrumInstrument *di, drumGlue->drumInstruments) {
+ GlobalInstrumentView *giView = new GlobalInstrumentView(drumGlue,this, di->name);
+ instrumentsTabWidget->addTab(giView, di->name);
+ }
+ }
+
+//---------------------------------------------------------
+// addInstrument
+//---------------------------------------------------------
+void DrumGlueGui::addInstrument()
+ {
+ bool ok;
+ QString text = QInputDialog::getText(this, tr("Instrument name"),
+ tr("Name of instrument:"), QLineEdit::Normal,
+ "", &ok);
+ if (ok && !text.isEmpty()) {
+ DrumInstrument *di = new DrumInstrument();
+ di->name = text;
+ drumGlue->drumInstruments.append(di);
+ GlobalInstrumentView *giView = new GlobalInstrumentView(drumGlue,this, text);
+ instrumentsTabWidget->addTab(giView, text);
+ }
+ }
+
+//---------------------------------------------------------
+// removeInstrument
+//---------------------------------------------------------
+void DrumGlueGui::removeInstrument()
+ {
+ int ret = QMessageBox::warning(this, tr("Remove instrument"),
+ tr("Are you sure you want to remove current instrument?"),
+ QMessageBox::No,
+ QMessageBox::Yes);
+ if (ret == QMessageBox::Yes)
+ instrumentsTabWidget->removeTab(instrumentsTabWidget->currentIndex());
+ }