Summary: | Up/Down arrows in Plot Contents don't enable Apply button | ||
---|---|---|---|
Product: | [Applications] kst | Reporter: | D. V. Wiebe <dvw> |
Component: | general | Assignee: | kst |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | NOR | ||
Version: | 1.x | ||
Target Milestone: | --- | ||
Platform: | Compiled Sources | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
D. V. Wiebe
2007-06-25 21:39:26 UTC
SVN commit 680290 by arwalker: CCBUG:147217 Add functionality to draggablelistbox to report whether a move was actually made M +21 -4 draggablelistbox.cpp M +3 -3 draggablelistbox.h --- branches/work/kst/1.5/kst/src/widgets/draggablelistbox.cpp #680289:680290 @@ -94,9 +94,12 @@ } } -void DraggableListBox::up() { +bool DraggableListBox::up() { + bool bRetVal = false; + if (count() > 1) { QString C; + for (unsigned i=1; i<count(); i++) { if (isSelected(i)) { C = text(i); @@ -104,13 +107,21 @@ --i; insertItem(C, i); setSelected(i, true); - while (isSelected(i) && (i<count())) ++i; + while (isSelected(i) && (i < count())) { + ++i; + } + + bRetVal = true; } } } + + return bRetVal; } -void DraggableListBox::down() { +bool DraggableListBox::down() { + bool bRetVal = false; + if (count() > 1) { QString C; for (int i=int(count())-2; i>=0; i--) { @@ -120,10 +131,16 @@ ++i; insertItem(C, i); setSelected(i, true); - while (isSelected(i) && (i>0)) --i; + while (isSelected(i) && (i > 0)) { + --i; + } + + bRetVal = true; } } } + + return bRetVal; } #include "draggablelistbox.moc" --- branches/work/kst/1.5/kst/src/widgets/draggablelistbox.h #680289:680290 @@ -35,9 +35,9 @@ virtual void setDragEnabled(bool enabled); public slots: - virtual void up(); - virtual void down(); - + virtual bool up(); + virtual bool down(); + protected: virtual void startDrag(); virtual void mousePressEvent(QMouseEvent *e); SVN commit 680291 by arwalker: BUG:147217 Enable Apply button after moving curves up or down in the displayed objects list M +2 -2 kst2dplot.cpp M +18 -3 kst2dplotwidget_i.cpp M +2 -0 kst2dplotwidget_i.h M +1 -1 labelrenderer.cpp --- branches/work/kst/1.5/kst/src/libkstapp/kst2dplot.cpp #680290:680291 @@ -1953,7 +1953,7 @@ tp.labels.clear(); tp.oppLabels.clear(); tp.delta = false; - + if (isLog && isInterpreted) { setTicks(tp.tick, tp.org, Max + log10(range) + log10(scale), Min + log10(range) + log10(scale), isLog, logBase, isX, base); tp.org -= log10(range) + log10(scale); @@ -1962,7 +1962,7 @@ tp.tick /= range*scale; tp.org /= range*scale; } - + tp.iLo = int((Min-tp.org)/tp.tick); tp.iHi = int((Max-tp.org)/tp.tick)+1; iShort = tp.iLo; --- branches/work/kst/1.5/kst/src/libkstapp/kst2dplotwidget_i.cpp #680290:680291 @@ -94,8 +94,8 @@ connect(AvailableCurveList, SIGNAL(selectionChanged()), this, SLOT(updateButtons())); connect(_remove, SIGNAL(clicked()), this, SLOT(removeDisplayedCurve())); connect(_add, SIGNAL(clicked()), this, SLOT(addDisplayedCurve())); - connect(_up, SIGNAL(clicked()), DisplayedCurveList, SLOT(up())); - connect(_down, SIGNAL(clicked()), DisplayedCurveList, SLOT(down())); + connect(_up, SIGNAL(clicked()), this, SLOT(upDisplayedCurve())); + connect(_down, SIGNAL(clicked()), this, SLOT(downDisplayedCurve())); connect(AutoLabel, SIGNAL(clicked()), this, SLOT(generateDefaultLabels())); @@ -315,8 +315,8 @@ if (DisplayedCurveList->isSelected(i)) { AvailableCurveList->insertItem(DisplayedCurveList->text(i)); DisplayedCurveList->removeItem(i); + } } - } updateButtons(); emit changed(); } @@ -324,7 +324,22 @@ } +void Kst2dPlotWidget::upDisplayedCurve() +{ + if (DisplayedCurveList->up()) { + emit changed(); + } +} + +void Kst2dPlotWidget::downDisplayedCurve() +{ + if (DisplayedCurveList->down()) { + emit changed(); + } +} + + void Kst2dPlotWidget::fillMarkerLineCombo() { QRect rect = _comboMarkerLineStyle->style().querySubControlMetrics(QStyle::CC_ComboBox, _comboMarkerLineStyle, QStyle::SC_ComboBoxEditField); rect.setLeft(rect.left() + 2); --- branches/work/kst/1.5/kst/src/libkstapp/kst2dplotwidget_i.h #680290:680291 @@ -35,6 +35,8 @@ public slots: void generateDefaultLabels(); void updateButtons(); + void upDisplayedCurve(); + void downDisplayedCurve(); void addDisplayedCurve(); void removeDisplayedCurve(); void fillMarkerLineCombo(); --- branches/work/kst/1.5/kst/src/libkstapp/labelrenderer.cpp #680290:680291 @@ -63,7 +63,7 @@ // not an object reference continue; } - + // kstdWarning() << "Label references unknown object [" << fi->text << "]." << endl; return false; } |