diff options
author | Florian Jung <flo@windfisch.org> | 2011-12-21 17:39:57 +0000 |
---|---|---|
committer | Florian Jung <flo@windfisch.org> | 2011-12-21 17:39:57 +0000 |
commit | 1057d7190242cdf9248671b316a398db805f5f56 (patch) | |
tree | ab50268a7db2f80cfb45a7ad6578fe735ab84ce5 /muse2/muse/liste | |
parent | 9977c7114089b8708d310268833b83343caa0fd1 (diff) | |
parent | c36a5508aa42e596b005425208054af9a60734b4 (diff) |
merged with trunk (that is, pulled the fixes from release_2_0)
only quickly tested, seems okay on the first glance
Diffstat (limited to 'muse2/muse/liste')
-rw-r--r-- | muse2/muse/liste/editevent.cpp | 7 | ||||
-rw-r--r-- | muse2/muse/liste/listedit.cpp | 14 | ||||
-rw-r--r-- | muse2/muse/liste/listedit.h | 2 |
3 files changed, 15 insertions, 8 deletions
diff --git a/muse2/muse/liste/editevent.cpp b/muse2/muse/liste/editevent.cpp index 32a328a8..cc52d26e 100644 --- a/muse2/muse/liste/editevent.cpp +++ b/muse2/muse/liste/editevent.cpp @@ -871,20 +871,17 @@ void EditCtrlDialog::instrPopup() int port = track->outPort(); MusECore::MidiInstrument* instr = MusEGlobal::midiPorts[port].instrument(); - ///instr->populatePatchPopup(pop, channel, MusEGlobal::song->mtype(), track->type() == MusECore::Track::DRUM); //QMenu* pup = new QMenu(this); MusEGui::PopupMenu* pup = new MusEGui::PopupMenu(this); - populatePatchPopup(instr, pup, channel, MusEGlobal::song->mtype(), track->isDrumTrack()); + //populatePatchPopup(instr, pup, channel, MusEGlobal::song->mtype(), track->isDrumTrack()); + instr->populatePatchPopup(pup, channel, MusEGlobal::song->mtype(), track->isDrumTrack()); - ///if(pop->actions().count() == 0) - /// return; if(pup->actions().count() == 0) { delete pup; return; } - ///QAction* rv = pop->exec(patchName->mapToGlobal(QPoint(10,5))); QAction* rv = pup->exec(patchName->mapToGlobal(QPoint(10,5))); if (rv) { val = rv->data().toInt(); diff --git a/muse2/muse/liste/listedit.cpp b/muse2/muse/liste/listedit.cpp index eadfa68c..6795cedb 100644 --- a/muse2/muse/liste/listedit.cpp +++ b/muse2/muse/liste/listedit.cpp @@ -45,6 +45,7 @@ #include "event.h" #include "midiport.h" #include "midictrl.h" +#include "app.h" namespace MusEGui { @@ -183,7 +184,8 @@ static QString midiMetaComment(const MusECore::Event& ev) void ListEdit::closeEvent(QCloseEvent* e) { - emit deleted(static_cast<TopWin*>(this)); + _isDeleting = true; // Set flag so certain signals like songChanged, which may cause crash during delete, can be ignored. + emit isDeleting(static_cast<TopWin*>(this)); e->accept(); } @@ -193,6 +195,9 @@ void ListEdit::closeEvent(QCloseEvent* e) void ListEdit::songChanged(int type) { + if(_isDeleting) // Ignore while while deleting to prevent crash. + return; + if (type == 0) return; if (type & (SC_PART_REMOVED | SC_PART_MODIFIED @@ -465,6 +470,8 @@ QString EventListItem::text(int col) const ListEdit::ListEdit(MusECore::PartList* pl) : MidiEditor(TopWin::LISTE, 0, pl) { + selectedTick=0; + insertItems = new QActionGroup(this); insertItems->setExclusive(false); insertNote = new QAction(QIcon(*note1Icon), tr("insert Note"), insertItems); @@ -587,7 +594,6 @@ ListEdit::ListEdit(MusECore::PartList* pl) mainGrid->setColumnStretch(0, 100); mainGrid->addWidget(liste, 1, 0, 2, 1); connect(MusEGlobal::song, SIGNAL(songChanged(int)), SLOT(songChanged(int))); - songChanged(-1); if(pl->empty()) { @@ -605,10 +611,14 @@ ListEdit::ListEdit(MusECore::PartList* pl) curPartId = -1; } } + + songChanged(-1); initShortcuts(); setWindowTitle("MusE: List Editor"); + + MusEGlobal::muse->topwinMenuInited(this); } //--------------------------------------------------------- diff --git a/muse2/muse/liste/listedit.h b/muse2/muse/liste/listedit.h index 7548fc86..1c0c1bd9 100644 --- a/muse2/muse/liste/listedit.h +++ b/muse2/muse/liste/listedit.h @@ -86,7 +86,7 @@ class ListEdit : public MidiEditor { void songChanged(int); signals: - void deleted(MusEGui::TopWin*); + void isDeleting(MusEGui::TopWin*); public: ListEdit(MusECore::PartList*); |