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

Peter Kümmel syntheticpp at gmx.net
Sat Sep 4 20:14:20 CEST 2010


SVN commit 1171628 by kuemmel:

Annotations into sub menu
sync layout mode button

 M  +27 -11    mainwindow.cpp  
 M  +5 -1      mainwindow.h  
 M  +3 -0      tabwidget.h  


--- branches/work/kst/portto4/kst/src/libkstapp/mainwindow.cpp #1171627:1171628
@@ -87,6 +87,7 @@
 
   setCentralWidget(_tabWidget);
   connect(_tabWidget, SIGNAL(currentChanged(int)), this, SLOT(currentViewChanged()));
+  connect(_tabWidget, SIGNAL(currentViewModeChanged()), this, SLOT(currentViewModeChanged()));
   connect(PlotItemManager::self(), SIGNAL(tiedZoomRemoved()), this, SLOT(tiedZoomRemoved()));
   connect(PlotItemManager::self(), SIGNAL(allPlotsTiedZoom()), this, SLOT(allPlotsTiedZoom()));
 
@@ -138,6 +139,8 @@
   _dataMode = dataMode;
 }
 
+void MainWindow::setXZoomMode() {
+}
 
 void MainWindow::toggleTiedZoom() {
   PlotItemManager::self()->toggleAllTiedZoom(tabWidget()->currentView());
@@ -451,10 +454,16 @@
   if(!_tabWidget->currentView())
     return;
   _undoGroup->setActiveStack(_tabWidget->currentView()->undoStack());
+  currentViewModeChanged();
+}
+
+
+void MainWindow::currentViewModeChanged() {
+  if(!_tabWidget->currentView())
+    return;
   _layoutModeAct->setChecked(_tabWidget->currentView()->viewMode() == View::Layout);
 }
 
-
 void MainWindow::aboutToQuit() {
   writeSettings();
 }
@@ -858,6 +867,12 @@
   _dataModeAct->setCheckable(true);
   connect(_dataModeAct, SIGNAL(toggled(bool)), this, SLOT(setDataMode(bool)));
 
+  _dataXZoomAct = new QAction(tr("&X only Zoom"), this);
+  _dataXZoomAct->setStatusTip(tr("Zoom only in X direction"));
+  //_dataModeAct->setIcon(QPixmap(":kst_datamode.png"));
+  //_dataModeAct->setCheckable(true);
+  connect(_dataXZoomAct, SIGNAL(triggered()), this, SLOT(setXZoomMode()));
+
   _newTabAct = new QAction(tr("&New tab"), this);
   _newTabAct->setStatusTip(tr("Create a new tab"));
   _newTabAct->setIcon(QPixmap(":kst_newtab.png"));
@@ -926,16 +941,17 @@
   _createMenu->addAction(_newImageAct);
   _createMenu->addAction(_newSpectrogramAct);
   _createMenu->addSeparator();
-  _createMenu->addAction(_createLabelAct);
-  _createMenu->addAction(_createBoxAct);
-  _createMenu->addAction(_createCircleAct);
-  _createMenu->addAction(_createEllipseAct);
-  _createMenu->addAction(_createLineAct);
-  _createMenu->addAction(_createArrowAct);
-  _createMenu->addAction(_createPictureAct);
-  _createMenu->addAction(_createPlotAct);
-  _createMenu->addAction(_createSvgAct);
-  _createMenu->addAction(_createSharedAxisBoxAct);
+  QMenu* annotations = _createMenu->addMenu("Annotation");
+  annotations->addAction(_createLabelAct);
+  annotations->addAction(_createBoxAct);
+  annotations->addAction(_createCircleAct);
+  annotations->addAction(_createEllipseAct);
+  annotations->addAction(_createLineAct);
+  annotations->addAction(_createArrowAct);
+  annotations->addAction(_createPictureAct);
+  annotations->addAction(_createPlotAct);
+  annotations->addAction(_createSvgAct);
+  annotations->addAction(_createSharedAxisBoxAct);
 
   _modeMenu = menuBar()->addMenu(tr("&Mode"));
   _modeMenu->addAction(_tiedZoomAct);
--- branches/work/kst/portto4/kst/src/libkstapp/mainwindow.h #1171627:1171628
@@ -99,6 +99,7 @@
     void aboutToQuit();
     void about();
     void currentViewChanged();
+    void currentViewModeChanged();
 
     void createBox();
     void createEllipse();
@@ -125,6 +126,7 @@
     void toggleTiedZoom();
 
     void setDataMode(bool dataMode);
+    void setXZoomMode();
 
   protected:
     void closeEvent(QCloseEvent *e);
@@ -192,7 +194,6 @@
     QAction *_closeTabAct;
     QAction *_dataManagerAct;
     QAction *_debugDialogAct;
-    QAction *_dataModeAct;
     QAction *_exitAct;
     QAction *_exportGraphicsAct;
     QAction *_newTabAct;
@@ -208,6 +209,9 @@
 
     QAction *_layoutModeAct;
     QAction *_tiedZoomAct;
+    QAction *_dataModeAct;
+    QAction *_dataXZoomAct;
+    QAction *_dataYZoomAct;
 
     QAction *_settingsDialogAct;
 
--- branches/work/kst/portto4/kst/src/libkstapp/tabwidget.h #1171627:1171628
@@ -33,6 +33,9 @@
     void deleteView(View* view);
     void clear();
 
+  Q_SIGNALS:
+        void currentViewModeChanged();
+
   public Q_SLOTS:
     View *createView();
     void renameCurrentView();


More information about the Kst mailing list