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>
This commit is contained in:
Tomaz Canabrava 2015-02-09 15:42:32 -02:00 committed by Dirk Hohndel
parent aa56797b0b
commit 38aab70555
2 changed files with 8 additions and 0 deletions

View file

@ -1485,3 +1485,8 @@ void MainWindow::checkForUndoAndRedo()
ui.action_Undo->setEnabled(undoBuffer->canUndo()); ui.action_Undo->setEnabled(undoBuffer->canUndo());
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)
{
applicationState[state] = WidgetForBorder(topLeft, bottomLeft, topRight, bottomRight);
}

View file

@ -190,6 +190,7 @@ private:
void saveSplitterSizes(); void saveSplitterSizes();
QString lastUsedDir(); QString lastUsedDir();
void updateLastUsedDir(const QString &s); void updateLastUsedDir(const QString &s);
void registerApplicationState(const QByteArray& state, QWidget *topLeft, QWidget *bottomLeft, QWidget *topRight, QWidget *bottomRight);
bool filesAsArguments; bool filesAsArguments;
UpdateManager *updateManager; UpdateManager *updateManager;
@ -201,6 +202,8 @@ private:
QList<QAction *> profileToolbarActions; QList<QAction *> profileToolbarActions;
struct WidgetForBorder { struct WidgetForBorder {
WidgetForBorder(QWidget *tl, QWidget *bl, QWidget *tr, QWidget *br) :
topLeft(tl), bottomLeft(bl), topRight(tr), bottomRight(br) {}
QWidget *topLeft; QWidget *topLeft;
QWidget *bottomLeft; QWidget *bottomLeft;
QWidget *topRight; QWidget *topRight;