diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp index 263ea9a4b..78e68ec2d 100644 --- a/qt-ui/maintab.cpp +++ b/qt-ui/maintab.cpp @@ -6,6 +6,7 @@ */ #include "maintab.h" #include "mainwindow.h" +#include "globe.h" #include "helpers.h" #include "statistics.h" #include "modeldelegates.h" diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp index 64f31ccf8..34ec20fe4 100644 --- a/qt-ui/mainwindow.cpp +++ b/qt-ui/mainwindow.cpp @@ -21,6 +21,7 @@ #include "updatemanager.h" #include "planner.h" #include "filtermodels.h" +#include "globe.h" #ifndef NO_PRINTING #include #include "printdialog.h" @@ -53,14 +54,14 @@ MainWindow::MainWindow() : QMainWindow(), MainTab *mainTab = new MainTab(); DiveListView *diveListView = new DiveListView(); ProfileWidget2 *profileWidget = new ProfileWidget2(); - GlobeGPS *globe = new GlobeGPS(); + GlobeGPS *globeGps = new GlobeGPS(); PlannerSettingsWidget *plannerSettings = new PlannerSettingsWidget(); DivePlannerWidget *plannerWidget = new DivePlannerWidget(); PlannerDetails *plannerDetails = new PlannerDetails(); - registerApplicationState("Default", mainTab, diveListView, profileWidget, globe ); - registerApplicationState("AddDive", mainTab, diveListView, profileWidget, globe ); + registerApplicationState("Default", mainTab, diveListView, profileWidget, globeGps ); + registerApplicationState("AddDive", mainTab, diveListView, profileWidget, globeGps ); registerApplicationState("PlanDive", plannerWidget, plannerSettings, profileWidget, plannerDetails ); ui.multiFilter->hide(); @@ -109,7 +110,7 @@ MainWindow::MainWindow() : QMainWindow(), diveListView->reload(DiveTripModel::TREE); diveListView->reloadHeaderActions(); diveListView->setFocus(); - ui.globe->reload(); + globe()->reload(); diveListView->expand(dive_list()->model()->index(0, 0)); diveListView->scrollTo(dive_list()->model()->index(0, 0), QAbstractItemView::PositionAtCenter); ui.divePlannerWidget->settingsChanged(); @@ -118,7 +119,7 @@ MainWindow::MainWindow() : QMainWindow(), ui.globePane->hide(); ui.menuView->removeAction(ui.actionViewGlobe); #else - connect(ui.globe, SIGNAL(coordinatesChanged()), ui.InfoWidget, SLOT(updateGpsCoordinates())); + connect(globe(), SIGNAL(coordinatesChanged()), ui.InfoWidget, SLOT(updateGpsCoordinates())); #endif #ifdef NO_USERMANUAL ui.menuHelp->removeAction(ui.actionUserManual); @@ -200,7 +201,7 @@ void MainWindow::refreshDisplay(bool doRecreateDiveList) showError(get_error_string()); ui.InfoWidget->reload(); TankInfoModel::instance()->update(); - ui.globe->reload(); + globe()->reload(); if (doRecreateDiveList) recreateDiveList(); ui.diveListPane->setCurrentIndex(0); // switch to the dive list @@ -228,7 +229,7 @@ void MainWindow::current_dive_changed(int divenr) { if (divenr >= 0) { select_dive(divenr); - ui.globe->centerOnCurrentDive(); + globe()->centerOnCurrentDive(); } ui.newProfile->plotDive(); ui.InfoWidget->updateDiveInfo(); @@ -285,7 +286,7 @@ void MainWindow::cleanUpEmpty() ui.InfoWidget->updateDiveInfo(true); ui.newProfile->setEmptyState(); dive_list()->reload(DiveTripModel::TREE); - ui.globe->reload(); + globe()->reload(); if (!existing_filename) setTitle(MWTF_DEFAULT); disableShortcuts(); @@ -1019,7 +1020,7 @@ DiveListView *MainWindow::dive_list() GlobeGPS *MainWindow::globe() { - return ui.globe; + return qobject_cast(applicationState["Default"].bottomRight); } MainTab *MainWindow::information() diff --git a/qt-ui/mainwindow.ui b/qt-ui/mainwindow.ui index c43b9af87..44b9a0b06 100644 --- a/qt-ui/mainwindow.ui +++ b/qt-ui/mainwindow.ui @@ -70,7 +70,7 @@ - 0 + 1 @@ -88,11 +88,7 @@ 0 - - - - - + @@ -843,12 +839,6 @@ p, li { white-space: pre-wrap; }
qt-ui/maintab.h
1 - - GlobeGPS - QWidget -
globe.h
- 1 -
DivePlannerWidget QWidget diff --git a/qt-ui/subsurfacewebservices.cpp b/qt-ui/subsurfacewebservices.cpp index 6498f432a..de1925374 100644 --- a/qt-ui/subsurfacewebservices.cpp +++ b/qt-ui/subsurfacewebservices.cpp @@ -3,6 +3,8 @@ #include "mainwindow.h" #include "usersurvey.h" #include "divelist.h" +#include "globe.h" + #include #include