[Kst] branches/work/kst/portto4/kst/src/libkstapp
Peter Kümmel
syntheticpp at gmx.net
Mon Sep 27 09:32:17 CEST 2010
SVN commit 1180144 by kuemmel:
layout and data mode are exclusive: disable data mode action
M +15 -9 mainwindow.cpp
M +1 -0 view.h
--- branches/work/kst/portto4/kst/src/libkstapp/mainwindow.cpp #1180143:1180144
@@ -126,21 +126,25 @@
View *v = tabWidget()->currentView();
Q_ASSERT(v);
- if (layoutMode)
+ if (layoutMode) {
v->setViewMode(View::Layout);
- else
+ } else {
v->setViewMode(View::Data);
-
-/* _layoutToolBar->setVisible(layoutMode);
- _zoomToolBar->setVisible(!layoutMode);*/
}
+ setDataMode(!layoutMode);
+}
-
+// TODO cleanup _dataMode & Co.: there's also a datamode in View!
void MainWindow::setDataMode(bool dataMode) {
_dataMode = dataMode;
}
void MainWindow::changeZoomOnlyMode(QAction* act) {
+ if (act == _layoutModeAct && act->isChecked()) {
+ setLayoutMode(true);
+ } else {
+ setLayoutMode(false);
+ }
tabWidget()->currentView()->setZoomOnly((View::ZoomOnlyMode)act->data().toInt());
}
@@ -856,11 +860,14 @@
_tiedZoomAct->setShortcut(QString("t"));
connect(_tiedZoomAct, SIGNAL(triggered()), this, SLOT(toggleTiedZoom()));
+ /*
+ TODO CLEANUP
_dataModeAct = new QAction(tr("&Data Mode"), this);
_dataModeAct->setStatusTip(tr("Toggle the current view's data mode"));
_dataModeAct->setIcon(QPixmap(":kst_datamode.png"));
_dataModeAct->setCheckable(true);
connect(_dataModeAct, SIGNAL(toggled(bool)), this, SLOT(setDataMode(bool)));
+ */
// Then, exclusive interaction modes
QActionGroup* _interactionModeGroup = new QActionGroup(this);
@@ -894,7 +901,6 @@
connect(_layoutModeAct, SIGNAL(toggled(bool)), this, SLOT(setLayoutMode(bool)));
_interactionModeGroup->setExclusive(true);
- _standardZoomAct->setChecked(true);
connect(_interactionModeGroup, SIGNAL(triggered(QAction*)), this, SLOT(changeZoomOnlyMode(QAction*)));
// *********************** Tools actions ************************************** //
@@ -1049,7 +1055,7 @@
_modeMenu->addSeparator();
// Options
_modeMenu->addAction(_tiedZoomAct);
- _modeMenu->addAction(_dataModeAct);
+ // TODO _modeMenu->addAction(_dataModeAct);
_toolsMenu = menuBar()->addMenu(tr("&Tools"));
_toolsMenu->addAction(_dataManagerAct);
@@ -1104,7 +1110,7 @@
_modeToolBar = addToolBar(tr("Mode"));
_modeToolBar->setObjectName("Mode Toolbar");
_modeToolBar->addAction(_tiedZoomAct);
- _modeToolBar->addAction(_dataModeAct);
+ // TODO _modeToolBar->addAction(_dataModeAct);
_modeToolBar->addSeparator();
_modeToolBar->addAction(_standardZoomAct);
_modeToolBar->addAction(_xOnlyZoomAct);
--- branches/work/kst/portto4/kst/src/libkstapp/view.h #1180143:1180144
@@ -97,6 +97,7 @@
void setPrinting(bool printing) { _printing = printing; }
bool isPrinting() { return _printing; }
+ //TODO cleanup/remove
void setDataMode(bool dataMode) { _dataMode = dataMode; }
bool isDataMode() { return _dataMode; }
More information about the Kst
mailing list