diff options
author | Tomaz Canabrava <tomaz.canabrava@intel.com> | 2015-02-09 16:23:30 -0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-02-10 10:45:44 -0800 |
commit | 7d48c1fc267d44a5dede4bfdcf4e295e1fcf3227 (patch) | |
tree | 21bd66b6fb062b7491a87a7f8d3b839ec06e008c /qt-ui | |
parent | 9e3bff6b7c140023606445f04e20aec9cb613381 (diff) | |
download | subsurface-7d48c1fc267d44a5dede4bfdcf4e295e1fcf3227.tar.gz |
Add the first call to registerApplicationState
This will be used to set the 'default' state. The other
two possible states right now are plan and add; those will
be created right next.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui')
-rw-r--r-- | qt-ui/globe.h | 2 | ||||
-rw-r--r-- | qt-ui/maintab.h | 2 | ||||
-rw-r--r-- | qt-ui/mainwindow.cpp | 13 | ||||
-rw-r--r-- | qt-ui/mainwindow.h | 2 |
4 files changed, 15 insertions, 4 deletions
diff --git a/qt-ui/globe.h b/qt-ui/globe.h index b6a33bbbe..4f9d7c611 100644 --- a/qt-ui/globe.h +++ b/qt-ui/globe.h @@ -19,7 +19,7 @@ class GlobeGPS : public MarbleWidget { Q_OBJECT public: using MarbleWidget::centerOn; - GlobeGPS(QWidget *parent); + GlobeGPS(QWidget *parent = 0); void reload(); void repopulateLabels(); void centerOnCurrentDive(); diff --git a/qt-ui/maintab.h b/qt-ui/maintab.h index 71703e3f1..a279baf7a 100644 --- a/qt-ui/maintab.h +++ b/qt-ui/maintab.h @@ -40,7 +40,7 @@ public: IGNORE }; - MainTab(QWidget *parent); + MainTab(QWidget *parent = 0); ~MainTab(); void clearStats(); void clearInfo(); diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp index 59dad9b01..a6779150b 100644 --- a/qt-ui/mainwindow.cpp +++ b/qt-ui/mainwindow.cpp @@ -45,6 +45,17 @@ MainWindow::MainWindow() : QMainWindow(), Q_ASSERT_X(m_Instance == NULL, "MainWindow", "MainWindow recreated!"); m_Instance = this; ui.setupUi(this); + // Define the States of the Application Here, Currently the states are situations where the different + // widgets will change on the mainwindow. + + // for the "default" mode + MainTab *mainTab = new MainTab(); + DiveListView *diveListView = new DiveListView(); + ProfileWidget2 *profileWidget = new ProfileWidget2(); + GlobeGPS *globe = new GlobeGPS(); + + registerApplicationState("Default", mainTab, diveListView, profileWidget, globe ); + ui.multiFilter->hide(); // what is a sane order for those icons? we should have the ones the user is // most likely to want towards the top so they are always visible @@ -1484,7 +1495,7 @@ void MainWindow::checkForUndoAndRedo() ui.action_Redo->setEnabled(undoBuffer->canRedo()); } -void registerApplicationState(const QByteArray& state, QWidget *topLeft, QWidget *bottomLeft, QWidget *topRight, QWidget *bottomRight) +void MainWindow::registerApplicationState(const QByteArray& state, QWidget *topLeft, QWidget *bottomLeft, QWidget *topRight, QWidget *bottomRight) { applicationState[state] = WidgetForBorder(topLeft, bottomLeft, topRight, bottomRight); } diff --git a/qt-ui/mainwindow.h b/qt-ui/mainwindow.h index 07e444683..bf75bf9d9 100644 --- a/qt-ui/mainwindow.h +++ b/qt-ui/mainwindow.h @@ -202,7 +202,7 @@ private: QList<QAction *> profileToolbarActions; struct WidgetForBorder { - WidgetForBorder(QWidget *tl, QWidget *bl, QWidget *tr, QWidget *br) : + WidgetForBorder(QWidget *tl = 0, QWidget *bl = 0, QWidget *tr = 0, QWidget *br = 0) : topLeft(tl), bottomLeft(bl), topRight(tr), bottomRight(br) {} QWidget *topLeft; QWidget *bottomLeft; |