[Kst] branches/work/kst/portto4/kst

Barth Netterfield netterfield at astro.utoronto.ca
Thu Jan 7 16:33:41 CET 2010


SVN commit 1071118 by netterfield:

Remove size settings from legend dialog.
BUG: 219844
Tied Zoom button becomes a push button.  Plots vote on whether to get set or not.
BUG: 218811

Fix a crash when grouped plots are tied.



 M  +0 -11     devel-docs/Kst2Specs/Wishlist  
 M  +1 -0      src/libkstapp/legenditem.cpp  
 M  +4 -4      src/libkstapp/mainwindow.cpp  
 M  +1 -1      src/libkstapp/mainwindow.h  
 M  +20 -5     src/libkstapp/plotitemmanager.cpp  
 M  +1 -1      src/libkstapp/plotitemmanager.h  
 M  +4 -0      src/libkstapp/sharedaxisboxitem.cpp  


--- branches/work/kst/portto4/kst/devel-docs/Kst2Specs/Wishlist #1071117:1071118
@@ -18,7 +18,6 @@
 Fixup line/arrow dimensions tab:
   x,y instead of length/angle
 
-
 ----------
 
 Tooltips/whats this where helpful.
@@ -60,20 +59,10 @@
 
 ---------
 
-Change Data Sample Ranges doesn't have an icon on the menu bar (that I
-found); it was very convienient there.
-
---------------------
-
 The data manager doesn't have a purge button.
 
 --------------------
 
-New Equation (or new pretty much anything) is harder to find as they
-seem to be only available through the data manager.  
-
---------------------
-
 Perhaps unrelated to kst, but the new symbolic link name in defile
 (replacing the defile.cur indirect file) is retarded.  It slows me down
 and the double extension is pointless.  
--- branches/work/kst/portto4/kst/src/libkstapp/legenditem.cpp #1071117:1071118
@@ -41,6 +41,7 @@
 
   _initializeShortName();
 
+  setFixedSize(true);
   setAllowedGripModes(Move /*| Resize*/ /*| Rotate*/ /*| Scale*/);
 
   setViewRect(0.0, 0.0, 0.0, 0.0);
--- branches/work/kst/portto4/kst/src/libkstapp/mainwindow.cpp #1071117:1071118
@@ -145,8 +145,8 @@
 }
 
 
-void MainWindow::setTiedZoom(bool tiedZoom) {
-  PlotItemManager::self()->setAllTiedZoom(tabWidget()->currentView(), tiedZoom);
+void MainWindow::toggleTiedZoom() {
+  PlotItemManager::self()->toggleAllTiedZoom(tabWidget()->currentView());
 }
 
 
@@ -838,8 +838,8 @@
   _tiedZoomAct = new QAction(tr("&Tied Zoom"), this);
   _tiedZoomAct->setStatusTip(tr("Toggle the current view's tied zoom"));
   _tiedZoomAct->setIcon(QPixmap(":kst_zoomtie.png"));
-  _tiedZoomAct->setCheckable(true);
-  connect(_tiedZoomAct, SIGNAL(triggered(bool)), this, SLOT(setTiedZoom(bool)));
+  //_tiedZoomAct->setCheckable(true);
+  connect(_tiedZoomAct, SIGNAL(triggered()), this, SLOT(toggleTiedZoom()));
 
   _dataModeAct = new QAction(tr("&Data Mode"), this);
   _dataModeAct->setStatusTip(tr("Toggle the current view's data mode"));
--- branches/work/kst/portto4/kst/src/libkstapp/mainwindow.h #1071117:1071118
@@ -120,7 +120,7 @@
     void cleanup();
 
     void setLayoutMode(bool layoutMode);
-    void setTiedZoom(bool tiedZoom);
+    void toggleTiedZoom();
 
     void setDataMode(bool dataMode);
 
--- branches/work/kst/portto4/kst/src/libkstapp/plotitemmanager.cpp #1071117:1071118
@@ -121,14 +121,29 @@
 }
 
 
-void PlotItemManager::setAllTiedZoom(View *view, bool tiedZoom) {
-  if (_plotLists.contains(view)) {
-    foreach(PlotItem* plot, _plotLists[view]) {
-      if (plot->supportsTiedZoom()) {
-        plot->setTiedZoom(tiedZoom, tiedZoom, false);
+void PlotItemManager::toggleAllTiedZoom(View *view) {
+
+  bool tiedZoom;
+
+  // vote on if we should tie all, or untie all
+  int n_plots=0, n_tied=0;
+  if (_viewItemLists.contains(view)) {
+    foreach(ViewItem* viewItem, _viewItemLists[view]) {
+      if (viewItem->supportsTiedZoom()) {
+        ++n_plots;
+        if (viewItem->isTiedZoom()) {
+          ++n_tied;
+        }
       }
     }
   }
+
+  if (double(n_tied) > (double)n_plots*0.5) {
+    tiedZoom = false;
+  } else {
+    tiedZoom = true;
+  }
+
   if (_viewItemLists.contains(view)) {
     foreach(ViewItem* viewItem, _viewItemLists[view]) {
       if (viewItem->supportsTiedZoom()) {
--- branches/work/kst/portto4/kst/src/libkstapp/plotitemmanager.h #1071117:1071118
@@ -35,7 +35,7 @@
     static QList<ViewItem*> tiedZoomViewItems(PlotItem* plotItem);
     static PlotItemManager *self();
 
-    void setAllTiedZoom(View *view, bool tiedZoom);
+    void toggleAllTiedZoom(View *view);
 
   Q_SIGNALS:
     void tiedZoomRemoved();
--- branches/work/kst/portto4/kst/src/libkstapp/sharedaxisboxitem.cpp #1071117:1071118
@@ -467,6 +467,10 @@
 #if DEBUG_ZOOM
   qDebug() << "zoomMaximum" << endl;
 #endif
+  if (!originPlotItem) {
+    originPlotItem = keyPlot();
+  }
+
   _xAxisZoomMode = PlotAxis::Auto;
   _yAxisZoomMode = PlotAxis::AutoBorder;
   originPlotItem->zoomMaximum(true);


More information about the Kst mailing list