aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui/mainwindow.cpp
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@intel.com>2015-02-09 18:43:41 -0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-02-10 10:45:45 -0800
commitc30aee1ae5463cd5708c809aaa1f36b6e419ec8f (patch)
tree6e5fa175de6fd19a5bb7d23c1016bd88176931bc /qt-ui/mainwindow.cpp
parentcf4d55c4702ded9d57fa7d6aeeebd0bfb2476a29 (diff)
downloadsubsurface-c30aee1ae5463cd5708c809aaa1f36b6e419ec8f.tar.gz
Remove the Globe from the mainwindow.ui
Now it's started from mainwindo.cpp and it's part of the new states Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/mainwindow.cpp')
-rw-r--r--qt-ui/mainwindow.cpp19
1 files changed, 10 insertions, 9 deletions
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 <QPrintDialog>
#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<GlobeGPS*>(applicationState["Default"].bottomRight);
}
MainTab *MainWindow::information()