summaryrefslogtreecommitdiffstats
path: root/qt-ui/profile
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@intel.com>2014-05-21 20:34:06 -0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-05-22 09:12:32 +0900
commitfe1df6b1cc171a6b9a08de20a1eacf4b02c89191 (patch)
treee1e9643ffa679ffae506e99c7f57d5095c6c6687 /qt-ui/profile
parent3661f291a4d88448c3339bdd3c2d3ad8c6090256 (diff)
downloadsubsurface-fe1df6b1cc171a6b9a08de20a1eacf4b02c89191.tar.gz
Back to profile or empty state when finishing addition.
This patch adds a signal to MainTab, that should be removed from there when we finish the rework on the edit part, to go to the edit classes, but in the meantime, let's keep it there. The signal is connected to the ProfileWidget in a way that the end of the edit will also trigger the profile to go back to ProfileState (show the dive, if there's any) or empty Profile (if there's none). Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/profile')
-rw-r--r--qt-ui/profile/profilewidget2.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/qt-ui/profile/profilewidget2.cpp b/qt-ui/profile/profilewidget2.cpp
index f0b7bc380..919db5c38 100644
--- a/qt-ui/profile/profilewidget2.cpp
+++ b/qt-ui/profile/profilewidget2.cpp
@@ -606,6 +606,7 @@ void ProfileWidget2::setEmptyState()
if (currentState == EMPTY)
return;
+ setBackgroundBrush(getColor(::BACKGROUND, isGrayscale));
dataModel->clear();
currentState = EMPTY;
MainWindow::instance()->setToolButtonsEnabled(false);
@@ -642,6 +643,11 @@ void ProfileWidget2::setProfileState()
if (currentState == PROFILE)
return;
+ if (dive_table.nr == 0) { // oops, called to plot something with zero dives. bail out.
+ setEmptyState();
+ return;
+ }
+
currentState = PROFILE;
MainWindow::instance()->setToolButtonsEnabled(true);
toolTipItem->readPos();