summaryrefslogtreecommitdiff
path: root/muse2/muse/liste
diff options
context:
space:
mode:
authorFlorian Jung <flo@windfisch.org>2011-05-23 18:25:40 +0000
committerFlorian Jung <flo@windfisch.org>2011-05-23 18:25:40 +0000
commita16b4e2746309724086f55d7df8b15da40939b20 (patch)
tree0380e5724d80c6ac91bd448868525d372de60e2b /muse2/muse/liste
parent7caa48f2561ae838049abb64adffe8ce43185b34 (diff)
parentb5bdb59699abd38a3aa90dfb4d9882b2be7f5be0 (diff)
merged with trunk
Diffstat (limited to 'muse2/muse/liste')
-rw-r--r--muse2/muse/liste/editevent.cpp32
1 files changed, 22 insertions, 10 deletions
diff --git a/muse2/muse/liste/editevent.cpp b/muse2/muse/liste/editevent.cpp
index b162a3e6..fd74d5d3 100644
--- a/muse2/muse/liste/editevent.cpp
+++ b/muse2/muse/liste/editevent.cpp
@@ -12,7 +12,7 @@
#include <QGridLayout>
#include <QLabel>
#include <QListWidget>
-#include <QMenu>
+//#include <QMenu>
#include <QMessageBox>
#include <QPushButton>
#include <QRadioButton>
@@ -36,6 +36,7 @@
#include "midiedit/drummap.h"
#include "instruments/minstrument.h"
#include "midi.h"
+#include "popupmenu.h"
//---------------------------------------------------------
// string2qhex
@@ -679,7 +680,8 @@ EditCtrlDialog::EditCtrlDialog(int tick, const Event& event,
void EditCtrlDialog::newController()
{
- QMenu* pup = new QMenu(this);
+ //QMenu* pup = new QMenu(this);
+ PopupMenu* pup = new PopupMenu(this);
//pup->setCheckable(this);//not necessary in Qt4
//
// populate popup with all controllers available for
@@ -715,7 +717,9 @@ void EditCtrlDialog::newController()
cll->add(channel, vl);
//song->update(SC_MIDI_CONTROLLER_ADD);
}
- for (int idx = 0; ;++idx) {
+ //for (int idx = 0; ;++idx) {
+ int idx = 0;
+ for (; idx < ctrlList->count() ;++idx) { // p4.0.25 Fix segfault
QString str = ctrlList->item(idx)->text();
if (s == str)
{
@@ -723,13 +727,20 @@ void EditCtrlDialog::newController()
ctrlListClicked(ctrlList->item(idx));
break;
}
- if (str.isNull()) {
- ctrlList->addItem(s);
- ctrlList->item(idx)->setSelected(true);
- ctrlListClicked(ctrlList->item(idx));
- break;
- }
+ //if (str.isNull()) {
+ // ctrlList->addItem(s);
+ // ctrlList->item(idx)->setSelected(true);
+ // ctrlListClicked(ctrlList->item(idx));
+ // break;
+ // }
}
+ if (idx >= ctrlList->count()) { // p4.0.25 Fix segfault
+ ctrlList->addItem(s);
+ ctrlList->item(idx)->setSelected(true);
+ ctrlListClicked(ctrlList->item(idx));
+ break;
+ }
+
break;
}
@@ -844,7 +855,8 @@ void EditCtrlDialog::instrPopup()
MidiInstrument* instr = midiPorts[port].instrument();
///instr->populatePatchPopup(pop, channel, song->mtype(), track->type() == Track::DRUM);
- QMenu* pup = new QMenu(this);
+ //QMenu* pup = new QMenu(this);
+ PopupMenu* pup = new PopupMenu(this);
instr->populatePatchPopup(pup, channel, song->mtype(), track->type() == Track::DRUM);
///if(pop->actions().count() == 0)