Allow subsurface to show the dive planning in case a compiling flag is
given.

qmake CONFIG+=planner

From 53fd92e7ee590e608b61225fb81497b7e6a25eca Mon Sep 17 00:00:00 2001
From: Danilo Cesar Lemes de Paula <[email protected]>
Date: Fri, 7 Feb 2014 00:10:49 -0200
Subject: [PATCH] protecting the dive planning under a compiling flag

Allow subsurface to show the dive planning in case a compiling flag is
given.

qmake CONFIG+=planner

Signed-off-by: Danilo Cesar Lemes de Paula <[email protected]>
---
 qt-ui/mainwindow.cpp | 6 +++++-
 qt-ui/mainwindow.ui  | 1 +
 subsurface.pro       | 5 +++++
 3 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp
index a44247a..b710147 100644
--- a/qt-ui/mainwindow.cpp
+++ b/qt-ui/mainwindow.cpp
@@ -69,6 +69,10 @@ MainWindow::MainWindow() : helpView(0)
 	ui.ListWidget->scrollTo(ui.ListWidget->model()->index(0,0), QAbstractItemView::PositionAtCenter);
 	ui.divePlanner->settingsChanged();
 	ui.divePlannerWidget->settingsChanged();
+
+#ifndef ENABLE_PLANNER
+	ui.menuLog->removeAction(ui.actionDivePlanner);
+#endif
 }
 
 // this gets called after we download dives from a divecomputer
@@ -884,4 +888,4 @@ void MainWindow::on_profSAC_clicked(bool triggered)
 	TOOLBOX_PREF_PROFILE(show_sac);
 }
 
-#undef TOOLBOX_PREF_PROFILE
\ No newline at end of file
+#undef TOOLBOX_PREF_PROFILE
diff --git a/qt-ui/mainwindow.ui b/qt-ui/mainwindow.ui
index 5b1280c..c04fc20 100644
--- a/qt-ui/mainwindow.ui
+++ b/qt-ui/mainwindow.ui
@@ -614,6 +614,7 @@
      <string>&amp;Log</string>
     </property>
     <addaction name="actionAddDive"/>
+    <addaction name="actionDivePlanner"/>
     <addaction name="separator"/>
     <addaction name="actionRenumber"/>
     <addaction name="actionAutoGroup"/>
diff --git a/subsurface.pro b/subsurface.pro
index 148b400..2c78751 100644
--- a/subsurface.pro
+++ b/subsurface.pro
@@ -233,5 +233,10 @@ QMAKE_INFO_PLIST = packaging/macosx/Info.plist.in
 OTHER_FILES += $$DESKTOPFILE $$ICON $$MANPAGE $$XSLT_FILES $$DOC_FILES $$MARBLEDIR \
         $$QMAKE_INFO_PLIST
 
+# enable or disable the dive planner
+planner {
+	DEFINES += ENABLE_PLANNER
+}
+
 include(subsurface-gen-version.pri)
 include(subsurface-install.pri)
-- 
1.8.5.3

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
subsurface mailing list
[email protected]
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface

Reply via email to