cmake-gui: save and restore the geometry and window state between sessions.

This commit is contained in:
Clinton Stimpson 2013-09-10 14:35:11 -06:00
parent b2ce2f5e48
commit 81ea3637b4
1 changed files with 4 additions and 5 deletions

View File

@ -66,9 +66,8 @@ CMakeSetupDialog::CMakeSetupDialog()
// create the GUI // create the GUI
QSettings settings; QSettings settings;
settings.beginGroup("Settings/StartPath"); settings.beginGroup("Settings/StartPath");
int h = settings.value("Height", 500).toInt(); restoreGeometry(settings.value("geometry").toByteArray());
int w = settings.value("Width", 700).toInt(); restoreState(settings.value("windowState").toByteArray());
this->resize(w, h);
this->AddVariableCompletions = settings.value("AddVariableCompletionEntries", this->AddVariableCompletions = settings.value("AddVariableCompletionEntries",
QStringList("CMAKE_INSTALL_PREFIX")).toStringList(); QStringList("CMAKE_INSTALL_PREFIX")).toStringList();
@ -299,8 +298,8 @@ CMakeSetupDialog::~CMakeSetupDialog()
{ {
QSettings settings; QSettings settings;
settings.beginGroup("Settings/StartPath"); settings.beginGroup("Settings/StartPath");
settings.setValue("Height", this->height()); settings.setValue("windowState", QVariant(saveState()));
settings.setValue("Width", this->width()); settings.setValue("geometry", QVariant(saveGeometry()));
settings.setValue("SplitterSizes", this->Splitter->saveState()); settings.setValue("SplitterSizes", this->Splitter->saveState());
// wait for thread to stop // wait for thread to stop