mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-31 22:53:23 +00:00
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:
parent
aa56797b0b
commit
38aab70555
2 changed files with 8 additions and 0 deletions
|
@ -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);
|
||||||
|
}
|
||||||
|
|
|
@ -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;
|
||||||
|
|
Loading…
Add table
Reference in a new issue