From 503a150af0c8662ed2b16a276b4ec26887af5288 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Thu, 10 Jul 2014 13:50:49 -0300 Subject: Added the toggle picture button and hoocked it up This patch adds the toggle picture button and hoocks it up with the rest of the code. I'v also changed a call from ProfileWidget because it caused errors on the ui generated code, where it would try to call an still-to-be instantiated object. Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- pref.h | 1 + qt-ui/mainwindow.cpp | 7 +++++++ qt-ui/mainwindow.h | 2 +- qt-ui/mainwindow.ui | 31 +++++++++++++++++++++++++++---- qt-ui/profile/profilewidget2.cpp | 1 - subsurfacestartup.c | 3 ++- 6 files changed, 38 insertions(+), 7 deletions(-) diff --git a/pref.h b/pref.h index a22206de6..fea5061e6 100644 --- a/pref.h +++ b/pref.h @@ -63,6 +63,7 @@ struct preferences { char *proxy_pass; bool doo2breaks; bool drop_stone_mode; + bool show_pictures_in_profile; }; enum unit_system_values { METRIC, diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp index c5c0d20b9..bb5e2a458 100644 --- a/qt-ui/mainwindow.cpp +++ b/qt-ui/mainwindow.cpp @@ -93,6 +93,7 @@ MainWindow::MainWindow() : QMainWindow(), #endif ui.mainErrorMessage->hide(); + ui.newProfile->setEmptyState(); initialUiSetup(); readSettings(); ui.ListWidget->reload(DiveTripModel::TREE); @@ -1334,6 +1335,12 @@ void MainWindow::on_profScaled_clicked(bool triggered) TOOLBOX_PREF_PROFILE(zoomed_plot); } +void MainWindow::on_profTogglePicture_clicked(bool triggered) +{ + prefs.show_pictures_in_profile = triggered; + TOOLBOX_PREF_PROFILE(show_pictures_in_planner); +} + #undef TOOLBOX_PREF_PROFILE void MainWindow::on_actionExport_triggered() diff --git a/qt-ui/mainwindow.h b/qt-ui/mainwindow.h index 014fbb488..3e7cad667 100644 --- a/qt-ui/mainwindow.h +++ b/qt-ui/mainwindow.h @@ -142,7 +142,7 @@ slots: void on_profRuler_clicked(bool triggered); void on_profSAC_clicked(bool triggered); void on_profScaled_clicked(bool triggered); - + void on_profTogglePicture_clicked(bool triggered); void on_actionExport_triggered(); protected: diff --git a/qt-ui/mainwindow.ui b/qt-ui/mainwindow.ui index cdabc8ea6..ff687ac42 100644 --- a/qt-ui/mainwindow.ui +++ b/qt-ui/mainwindow.ui @@ -109,7 +109,7 @@ 0 - + Qt::Vertical @@ -466,6 +466,9 @@ + + + @@ -492,8 +495,28 @@ - - + + + + ... + + + + :/pictures:/pictures + + + + 24 + 24 + + + + true + + + true + + @@ -638,7 +661,7 @@ p, li { white-space: pre-wrap; } 0 0 1682 - 19 + 27 diff --git a/qt-ui/profile/profilewidget2.cpp b/qt-ui/profile/profilewidget2.cpp index ee80d59bd..fe19c7b21 100644 --- a/qt-ui/profile/profilewidget2.cpp +++ b/qt-ui/profile/profilewidget2.cpp @@ -100,7 +100,6 @@ ProfileWidget2::ProfileWidget2(QWidget *parent) : QGraphicsView(parent), setupItemOnScene(); addItemsToScene(); scene()->installEventFilter(this); - setEmptyState(); connect(PreferencesDialog::instance(), SIGNAL(settingsChanged()), this, SLOT(settingsChanged())); QAction *action = NULL; diff --git a/subsurfacestartup.c b/subsurfacestartup.c index 58291d272..1af68510e 100644 --- a/subsurfacestartup.c +++ b/subsurfacestartup.c @@ -41,7 +41,8 @@ struct preferences default_prefs = { .bottompo2 = 1400, .decopo2 = 1600, .doo2breaks = false, - .drop_stone_mode = false + .drop_stone_mode = false, + .show_pictures_in_profile = true }; int run_survey; -- cgit v1.2.3-70-g09d2