summaryrefslogtreecommitdiffstats
path: root/qt-ui
diff options
context:
space:
mode:
authorGravatar Robert C. Helling <helling@atdotde.de>2015-08-18 10:03:51 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-08-18 06:42:01 -0700
commit72806e42bc23ab7c7f2a639a1efee017388b53bc (patch)
treef367ec161dec60ad7247322cd8a603fc4a3a91d1 /qt-ui
parent4e89a6020ec02fdc7a7af9b59ef918cb610f5a76 (diff)
downloadsubsurface-72806e42bc23ab7c7f2a639a1efee017388b53bc.tar.gz
Replace global in_planner variable by helper function
as promised earlier Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui')
-rw-r--r--qt-ui/mainwindow.cpp6
-rw-r--r--qt-ui/mainwindow.h1
2 files changed, 6 insertions, 1 deletions
diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp
index f22884a84..1a12305d9 100644
--- a/qt-ui/mainwindow.cpp
+++ b/qt-ui/mainwindow.cpp
@@ -1716,7 +1716,6 @@ void MainWindow::setApplicationState(const QByteArray& state) {
return;
currentApplicationState = state;
- in_planner = (state == "PlanDive" || state == "EditPlannedDive");
#define SET_CURRENT_INDEX( X ) \
if (applicationState[state].X) { \
@@ -1732,3 +1731,8 @@ void MainWindow::setApplicationState(const QByteArray& state) {
SET_CURRENT_INDEX( bottomRight )
#undef SET_CURRENT_INDEX
}
+
+bool MainWindow::inPlanner()
+{
+ return (currentApplicationState == "PlanDive" || currentApplicationState == "EditPlannedDive");
+}
diff --git a/qt-ui/mainwindow.h b/qt-ui/mainwindow.h
index 583dc591a..4df1d1238 100644
--- a/qt-ui/mainwindow.h
+++ b/qt-ui/mainwindow.h
@@ -89,6 +89,7 @@ public:
void printPlan();
void checkSurvey(QSettings *s);
void setApplicationState(const QByteArray& state);
+ bool inPlanner();
QUndoStack *undoStack;
NotificationWidget *getNotificationWidget();
void enableDisableCloudActions();