summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2015-11-05 13:11:26 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-11-05 13:45:51 -0800
commit2b9316e16ab94b1a8ef7a0c5abbce2f80abf5053 (patch)
tree03cc0b62eb754c7e543f43f1aa96e7ab2012da42
parent4ec5ce4c7a69acc682a9ed03b0170bf0f43c88af (diff)
downloadsubsurface-2b9316e16ab94b1a8ef7a0c5abbce2f80abf5053.tar.gz
Untangle Profile from MainWindow: update main tab via signal
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--profile-widget/profilewidget2.cpp2
-rw-r--r--profile-widget/profilewidget2.h1
-rw-r--r--subsurface-desktop-main.cpp2
3 files changed, 4 insertions, 1 deletions
diff --git a/profile-widget/profilewidget2.cpp b/profile-widget/profilewidget2.cpp
index d7da0b7e3..c72f2e95b 100644
--- a/profile-widget/profilewidget2.cpp
+++ b/profile-widget/profilewidget2.cpp
@@ -1476,7 +1476,7 @@ void ProfileWidget2::changeGas()
// FIXME - this no longer gets written to the dive list - so we need to enableEdition() here
- MainWindow::instance()->information()->updateDiveInfo();
+ emit updateDiveInfo(false);
mark_divelist_changed(true);
replot();
}
diff --git a/profile-widget/profilewidget2.h b/profile-widget/profilewidget2.h
index 5fc6e8d4b..f5977eb22 100644
--- a/profile-widget/profilewidget2.h
+++ b/profile-widget/profilewidget2.h
@@ -93,6 +93,7 @@ signals:
void enableShortcuts();
void disableShortcuts(bool paste);
void refreshDisplay(bool recreateDivelist);
+ void updateDiveInfo(bool clear);
public
slots: // Necessary to call from QAction's signals.
diff --git a/subsurface-desktop-main.cpp b/subsurface-desktop-main.cpp
index fed774303..d5caf64d3 100644
--- a/subsurface-desktop-main.cpp
+++ b/subsurface-desktop-main.cpp
@@ -9,6 +9,7 @@
#include "qt-gui.h"
#include "subsurfacestartup.h"
#include "desktop-widgets/mainwindow.h"
+#include "desktop-widgets/maintab.h"
#include "profile-widget/profilewidget2.h"
#include "desktop-widgets/diveplanner.h"
#include "subsurface-core/color.h"
@@ -91,6 +92,7 @@ int main(int argc, char **argv)
QObject::connect(m->graphics(), &ProfileWidget2::disableShortcuts, m, &MainWindow::disableShortcuts, Qt::AutoConnection);
QObject::connect(m->graphics(), &ProfileWidget2::enableShortcuts, m, &MainWindow::enableShortcuts, Qt::AutoConnection);
QObject::connect(m->graphics(), &ProfileWidget2::refreshDisplay, m, &MainWindow::refreshDisplay, Qt::AutoConnection);
+ QObject::connect(m->graphics(), &ProfileWidget2::updateDiveInfo, m->information(), &MainTab::updateDiveInfo, Qt::AutoConnection);
if (verbose > 0)
print_files();
if (!quit)