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 <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Tomaz Canabrava 2014-07-10 13:50:49 -03:00 committed by Dirk Hohndel
parent 8940f29ead
commit 503a150af0
6 changed files with 38 additions and 7 deletions

1
pref.h
View file

@ -63,6 +63,7 @@ struct preferences {
char *proxy_pass; char *proxy_pass;
bool doo2breaks; bool doo2breaks;
bool drop_stone_mode; bool drop_stone_mode;
bool show_pictures_in_profile;
}; };
enum unit_system_values { enum unit_system_values {
METRIC, METRIC,

View file

@ -93,6 +93,7 @@ MainWindow::MainWindow() : QMainWindow(),
#endif #endif
ui.mainErrorMessage->hide(); ui.mainErrorMessage->hide();
ui.newProfile->setEmptyState();
initialUiSetup(); initialUiSetup();
readSettings(); readSettings();
ui.ListWidget->reload(DiveTripModel::TREE); ui.ListWidget->reload(DiveTripModel::TREE);
@ -1334,6 +1335,12 @@ void MainWindow::on_profScaled_clicked(bool triggered)
TOOLBOX_PREF_PROFILE(zoomed_plot); 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 #undef TOOLBOX_PREF_PROFILE
void MainWindow::on_actionExport_triggered() void MainWindow::on_actionExport_triggered()

View file

@ -142,7 +142,7 @@ slots:
void on_profRuler_clicked(bool triggered); void on_profRuler_clicked(bool triggered);
void on_profSAC_clicked(bool triggered); void on_profSAC_clicked(bool triggered);
void on_profScaled_clicked(bool triggered); void on_profScaled_clicked(bool triggered);
void on_profTogglePicture_clicked(bool triggered);
void on_actionExport_triggered(); void on_actionExport_triggered();
protected: protected:

View file

@ -109,7 +109,7 @@
<property name="spacing"> <property name="spacing">
<number>0</number> <number>0</number>
</property> </property>
<item row="14" column="0"> <item row="15" column="0">
<spacer name="verticalSpacer"> <spacer name="verticalSpacer">
<property name="orientation"> <property name="orientation">
<enum>Qt::Vertical</enum> <enum>Qt::Vertical</enum>
@ -466,6 +466,9 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="1" rowspan="16">
<widget class="ProfileWidget2" name="newProfile"/>
</item>
<item row="1" column="0"> <item row="1" column="0">
<widget class="QToolButton" name="profPn2"> <widget class="QToolButton" name="profPn2">
<property name="toolTip"> <property name="toolTip">
@ -492,8 +495,28 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="1" rowspan="15"> <item row="14" column="0">
<widget class="ProfileWidget2" name="newProfile"/> <widget class="QToolButton" name="profTogglePicture">
<property name="text">
<string>...</string>
</property>
<property name="icon">
<iconset resource="../subsurface.qrc">
<normaloff>:/pictures</normaloff>:/pictures</iconset>
</property>
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item> </item>
</layout> </layout>
</widget> </widget>
@ -638,7 +661,7 @@ p, li { white-space: pre-wrap; }
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>1682</width> <width>1682</width>
<height>19</height> <height>27</height>
</rect> </rect>
</property> </property>
<widget class="QMenu" name="menuFile"> <widget class="QMenu" name="menuFile">

View file

@ -100,7 +100,6 @@ ProfileWidget2::ProfileWidget2(QWidget *parent) : QGraphicsView(parent),
setupItemOnScene(); setupItemOnScene();
addItemsToScene(); addItemsToScene();
scene()->installEventFilter(this); scene()->installEventFilter(this);
setEmptyState();
connect(PreferencesDialog::instance(), SIGNAL(settingsChanged()), this, SLOT(settingsChanged())); connect(PreferencesDialog::instance(), SIGNAL(settingsChanged()), this, SLOT(settingsChanged()));
QAction *action = NULL; QAction *action = NULL;

View file

@ -41,7 +41,8 @@ struct preferences default_prefs = {
.bottompo2 = 1400, .bottompo2 = 1400,
.decopo2 = 1600, .decopo2 = 1600,
.doo2breaks = false, .doo2breaks = false,
.drop_stone_mode = false .drop_stone_mode = false,
.show_pictures_in_profile = true
}; };
int run_survey; int run_survey;