From e40fc849149dd97c248866a4a1d026dda5e57b62 Mon Sep 17 00:00:00 2001 From: Robert Jonsson Date: Mon, 7 Mar 2011 19:01:11 +0000 Subject: clean3 --- .../midiplugins/drumglue/drumgluegui.cpp | 68 ++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 attic/muse_qt4_evolution/midiplugins/drumglue/drumgluegui.cpp (limited to 'attic/muse_qt4_evolution/midiplugins/drumglue/drumgluegui.cpp') diff --git a/attic/muse_qt4_evolution/midiplugins/drumglue/drumgluegui.cpp b/attic/muse_qt4_evolution/midiplugins/drumglue/drumgluegui.cpp new file mode 100644 index 00000000..562adf2c --- /dev/null +++ b/attic/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()); + } -- cgit v1.2.3