Commit ab6ce48b authored by Eicke Herbertz's avatar Eicke Herbertz
Browse files

cmake-gui: Store last used generator platform and generator toolset

parent 85421526
Pipeline #135268 passed with stage
cmake-gui-store-platform-toolset
--------------------------------
* The generator setup in :manual:`cmake-gui(1)` remembers the last used
platform and toolset additionally to the generator
......@@ -135,6 +135,19 @@ void StartCompilerSetup::setCurrentGenerator(const QString& gen)
}
}
void StartCompilerSetup::setCurrentPlatform(const QString& platform)
{
int idx = this->PlatformOptions->findText(platform);
if (idx != -1) {
this->PlatformOptions->setCurrentIndex(idx);
}
}
void StartCompilerSetup::setCurrentToolset(const QString& toolset)
{
this->GeneratorOptions->setCurrentText(toolset);
}
QString StartCompilerSetup::getGenerator() const
{
return this->GeneratorOptions->currentText();
......@@ -467,6 +480,10 @@ void FirstConfigure::loadFromSettings()
settings.beginGroup("Settings/StartPath");
QString lastGen = settings.value("LastGenerator").toString();
this->mStartCompilerSetupPage->setCurrentGenerator(lastGen);
QString lastPlatform = settings.value("LastGeneratorPlatform").toString();
this->mStartCompilerSetupPage->setCurrentPlatform(lastPlatform);
QString lastToolset = settings.value("LastGeneratorToolset").toString();
this->mStartCompilerSetupPage->setCurrentToolset(lastToolset);
settings.endGroup();
// restore compiler setup
......@@ -514,6 +531,10 @@ void FirstConfigure::saveToSettings()
settings.beginGroup("Settings/StartPath");
QString lastGen = this->mStartCompilerSetupPage->getGenerator();
settings.setValue("LastGenerator", lastGen);
QString lastPlatform = this->mStartCompilerSetupPage->getPlatform();
settings.setValue("LastPlatform", lastPlatform);
QString lastToolset = this->mStartCompilerSetupPage->getToolset();
settings.setValue("LastToolset", lastToolset);
settings.endGroup();
// save compiler setup
......
......@@ -33,6 +33,8 @@ public:
~StartCompilerSetup();
void setGenerators(std::vector<cmake::GeneratorInfo> const& gens);
void setCurrentGenerator(const QString& gen);
void setCurrentPlatform(const QString& platform);
void setCurrentToolset(const QString& toolset);
QString getGenerator() const;
QString getToolset() const;
QString getPlatform() const;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment