diff options
author | Werner Schweer <ws.seh.de> | 2006-10-03 18:07:51 +0000 |
---|---|---|
committer | Werner Schweer <ws.seh.de> | 2006-10-03 18:07:51 +0000 |
commit | 06f0887d07f666ee8ae62d9270ce9c645587ee72 (patch) | |
tree | 1587ecbe960d2422de43f77356d4cc319485b9eb | |
parent | 377876ecec5bc495e4a1bcdbaed01450faafd3c4 (diff) |
fix some weird selection behaviour
-rw-r--r-- | muse/muse/marker/markerview.cpp | 14 | ||||
-rw-r--r-- | muse/muse/marker/markerview.h | 2 |
2 files changed, 11 insertions, 5 deletions
diff --git a/muse/muse/marker/markerview.cpp b/muse/muse/marker/markerview.cpp index ae1f871a..a237b90b 100644 --- a/muse/muse/marker/markerview.cpp +++ b/muse/muse/marker/markerview.cpp @@ -121,6 +121,7 @@ void MarkerItem::setTick(unsigned v) MarkerView::MarkerView() : TopWin() { + lockChange = false; setWindowTitle(tr("MusE: Marker")); //---------Actions---------------------------- @@ -280,7 +281,6 @@ void MarkerView::updateList() void MarkerView::currentChanged(QTreeWidgetItem* i) { -printf("current changed\n"); MarkerItem* item = (MarkerItem*)i; if (item == 0) { // never triggered editTick->setValue(0); @@ -310,7 +310,10 @@ printf("current changed\n"); void MarkerView::selectionChanged() { -printf("selection changed\n"); + QList<QTreeWidgetItem*> sel = table->selectedItems(); + if (!sel.empty()) { + MarkerItem* item = (MarkerItem*)(sel[0]); + } } //--------------------------------------------------------- @@ -319,7 +322,6 @@ printf("selection changed\n"); void MarkerView::clicked(QTreeWidgetItem* i) { -printf("clicked\n"); MarkerItem* item = (MarkerItem*)i; if (item == 0) { table->clearSelection(); @@ -348,10 +350,11 @@ void MarkerView::tickChanged(const Pos& pos) { MarkerItem* item = (MarkerItem*)table->currentItem(); if (item) { + lockChange = true; item->setTick(pos.tick()); Pos p(pos.tick(), AL::TICKS); song->setPos(0, p, true, true, false); -// table->sort(); + lockChange = false; } } @@ -375,6 +378,8 @@ void MarkerView::lockChanged(bool lck) void MarkerView::markerChanged(int val) { + if (lockChange) + return; switch (val) { case Song::MARKER_ADD: case Song::MARKER_REMOVE: @@ -389,7 +394,6 @@ void MarkerView::markerChanged(int val) for (int k = 0; k < n; ++k) { MarkerItem* item = (MarkerItem*)(table->topLevelItem(k)); if (item->marker() == &i->second) { -// ((QTreeWidgetItem*)item)->setSelected(true); table->setCurrentItem(item); return; } diff --git a/muse/muse/marker/markerview.h b/muse/muse/marker/markerview.h index 12337efa..53205e3d 100644 --- a/muse/muse/marker/markerview.h +++ b/muse/muse/marker/markerview.h @@ -61,6 +61,8 @@ class MarkerItem : public QTreeWidgetItem { class MarkerView : public TopWin { Q_OBJECT + bool lockChange; + QTreeWidget* table; QLineEdit* editName; Awl::PosEdit* editSMPTE; |