mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
9e3bff6b7c
commit
7d48c1fc26
4 changed files with 15 additions and 4 deletions
|
@ -19,7 +19,7 @@ class GlobeGPS : public MarbleWidget {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
using MarbleWidget::centerOn;
|
using MarbleWidget::centerOn;
|
||||||
GlobeGPS(QWidget *parent);
|
GlobeGPS(QWidget *parent = 0);
|
||||||
void reload();
|
void reload();
|
||||||
void repopulateLabels();
|
void repopulateLabels();
|
||||||
void centerOnCurrentDive();
|
void centerOnCurrentDive();
|
||||||
|
|
|
@ -40,7 +40,7 @@ public:
|
||||||
IGNORE
|
IGNORE
|
||||||
};
|
};
|
||||||
|
|
||||||
MainTab(QWidget *parent);
|
MainTab(QWidget *parent = 0);
|
||||||
~MainTab();
|
~MainTab();
|
||||||
void clearStats();
|
void clearStats();
|
||||||
void clearInfo();
|
void clearInfo();
|
||||||
|
|
|
@ -45,6 +45,17 @@ MainWindow::MainWindow() : QMainWindow(),
|
||||||
Q_ASSERT_X(m_Instance == NULL, "MainWindow", "MainWindow recreated!");
|
Q_ASSERT_X(m_Instance == NULL, "MainWindow", "MainWindow recreated!");
|
||||||
m_Instance = this;
|
m_Instance = this;
|
||||||
ui.setupUi(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();
|
ui.multiFilter->hide();
|
||||||
// what is a sane order for those icons? we should have the ones the user is
|
// 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
|
// 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());
|
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);
|
applicationState[state] = WidgetForBorder(topLeft, bottomLeft, topRight, bottomRight);
|
||||||
}
|
}
|
||||||
|
|
|
@ -202,7 +202,7 @@ private:
|
||||||
QList<QAction *> profileToolbarActions;
|
QList<QAction *> profileToolbarActions;
|
||||||
|
|
||||||
struct WidgetForBorder {
|
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) {}
|
topLeft(tl), bottomLeft(bl), topRight(tr), bottomRight(br) {}
|
||||||
QWidget *topLeft;
|
QWidget *topLeft;
|
||||||
QWidget *bottomLeft;
|
QWidget *bottomLeft;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue