Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
einsteinathome
pulsatingscience
Commits
b5c71b20
Commit
b5c71b20
authored
Jul 30, 2010
by
Oliver Bock
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Save/restore window state and layout (on quit/startup)
parent
5d8927f0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
0 deletions
+18
-0
src/pulsatingscience.cpp
src/pulsatingscience.cpp
+18
-0
No files found.
src/pulsatingscience.cpp
View file @
b5c71b20
...
...
@@ -19,6 +19,8 @@
******************************************************************************/
#include "pulsatingscience.h"
#include <QSettings>
#ifdef __APPLE__
#include "/System/Library/Frameworks/Carbon.framework/Versions/A/Headers/Carbon.h"
...
...
@@ -110,6 +112,16 @@ PulsatingScience::PulsatingScience(QWidget *parent) : QMainWindow(parent)
connect
(
m_hiddenShortcut
,
SIGNAL
(
activated
()),
this
,
SLOT
(
toggleHiddenDemoMode
()));
// restore previously saved window and splitter layout
QCoreApplication
::
setOrganizationName
(
"Max-Planck-Insitut für Gravitationsphysik"
);
QCoreApplication
::
setOrganizationDomain
(
"aei.mpg.de"
);
QCoreApplication
::
setApplicationName
(
"Pulsating Science"
);
QSettings
settings
;
restoreGeometry
(
settings
.
value
(
"windowGeometry"
).
toByteArray
());
restoreState
(
settings
.
value
(
"windowState"
).
toByteArray
());
ui
.
splitter
->
restoreState
(
settings
.
value
(
"splitterSizes"
).
toByteArray
());
}
PulsatingScience
::~
PulsatingScience
()
...
...
@@ -161,6 +173,12 @@ void PulsatingScience::closeEvent(QCloseEvent *event)
event
->
ignore
();
}
else
{
// save splitter layout
QSettings
settings
;
settings
.
setValue
(
"windowGeometry"
,
saveGeometry
());
settings
.
setValue
(
"windowState"
,
saveState
());
settings
.
setValue
(
"splitterSizes"
,
ui
.
splitter
->
saveState
());
event
->
accept
();
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment