From 2b9316e16ab94b1a8ef7a0c5abbce2f80abf5053 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Thu, 5 Nov 2015 13:11:26 -0800 Subject: Untangle Profile from MainWindow: update main tab via signal Signed-off-by: Dirk Hohndel --- profile-widget/profilewidget2.cpp | 2 +- profile-widget/profilewidget2.h | 1 + subsurface-desktop-main.cpp | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) 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) -- cgit v1.2.3-70-g09d2