aboutsummaryrefslogtreecommitdiffstats
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
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>
-rw-r--r--qt-ui/maintab.cpp1
-rw-r--r--qt-ui/mainwindow.cpp19
-rw-r--r--qt-ui/mainwindow.ui14
-rw-r--r--qt-ui/subsurfacewebservices.cpp2
4 files changed, 15 insertions, 21 deletions
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 <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()
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 @@
</property>
<widget class="QStackedWidget" name="diveListPane">
<property name="currentIndex">
- <number>0</number>
+ <number>1</number>
</property>
<widget class="QWidget" name="page_3">
<layout class="QVBoxLayout" name="diveListLayout"/>
@@ -88,11 +88,7 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
- <layout class="QVBoxLayout" name="globeLayout">
- <item>
- <widget class="GlobeGPS" name="globe" native="true"/>
- </item>
- </layout>
+ <layout class="QVBoxLayout" name="globeLayout"/>
</widget>
<widget class="QWidget" name="page_5">
<property name="sizePolicy">
@@ -844,12 +840,6 @@ p, li { white-space: pre-wrap; }
<container>1</container>
</customwidget>
<customwidget>
- <class>GlobeGPS</class>
- <extends>QWidget</extends>
- <header>globe.h</header>
- <container>1</container>
- </customwidget>
- <customwidget>
<class>DivePlannerWidget</class>
<extends>QWidget</extends>
<header>diveplanner.h</header>
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 <errno.h>
#include <QDir>