diff options
author | Tomaz Canabrava <tomaz.canabrava@intel.com> | 2015-02-09 15:42:32 -0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-02-10 10:45:44 -0800 |
commit | 38aab705558b44cfa08a3671d40803071eb523e1 (patch) | |
tree | 14befc156ee23b75df38a7f15738725b6fb382d5 /qt-ui | |
parent | aa56797b0ba9c193f7921dd35718d09569edcb5f (diff) | |
download | subsurface-38aab705558b44cfa08a3671d40803071eb523e1.tar.gz |
Implement the registerApplicationState function
This function registers the different widget layouts
that we will have in subsurface. Currently we have three layouts
(default, plan, add) and a few more are comming (for instance
location) and the code is scattered around. It was making me
unconfortable.
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/mainwindow.cpp | 5 | ||||
-rw-r--r-- | qt-ui/mainwindow.h | 3 |
2 files changed, 8 insertions, 0 deletions
diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp index 57af5e091..4b883c4f9 100644 --- a/qt-ui/mainwindow.cpp +++ b/qt-ui/mainwindow.cpp @@ -1485,3 +1485,8 @@ void MainWindow::checkForUndoAndRedo() ui.action_Undo->setEnabled(undoBuffer->canUndo()); ui.action_Redo->setEnabled(undoBuffer->canRedo()); } + +void 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 90e819707..07e444683 100644 --- a/qt-ui/mainwindow.h +++ b/qt-ui/mainwindow.h @@ -190,6 +190,7 @@ private: void saveSplitterSizes(); QString lastUsedDir(); void updateLastUsedDir(const QString &s); + void registerApplicationState(const QByteArray& state, QWidget *topLeft, QWidget *bottomLeft, QWidget *topRight, QWidget *bottomRight); bool filesAsArguments; UpdateManager *updateManager; @@ -201,6 +202,8 @@ private: QList<QAction *> profileToolbarActions; struct WidgetForBorder { + WidgetForBorder(QWidget *tl, QWidget *bl, QWidget *tr, QWidget *br) : + topLeft(tl), bottomLeft(bl), topRight(tr), bottomRight(br) {} QWidget *topLeft; QWidget *bottomLeft; QWidget *topRight; |