summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulien Jomier <julien.jomier@kitware.com>2019-01-21 12:18:26 (GMT)
committerJulien Jomier <julien.jomier@kitware.com>2019-01-21 12:18:26 (GMT)
commit67bced8a26348e1cc05d8c04ed90633c642bf3a3 (patch)
tree1dda0c6f4b1016c0ed2eae3e09bb2fe2b61bc6e6
parent48ec0bc1401b99e5a2d07392fb98f96d5fec9e50 (diff)
downloadCMake-67bced8a26348e1cc05d8c04ed90633c642bf3a3.zip
CMake-67bced8a26348e1cc05d8c04ed90633c642bf3a3.tar.gz
CMake-67bced8a26348e1cc05d8c04ed90633c642bf3a3.tar.bz2
cmake-gui: Improve label for default platform
Specify the default platform to be used when the platform field is empty
-rw-r--r--Source/QtDialog/FirstConfigure.cxx14
-rw-r--r--Source/QtDialog/FirstConfigure.h1
2 files changed, 13 insertions, 2 deletions
diff --git a/Source/QtDialog/FirstConfigure.cxx b/Source/QtDialog/FirstConfigure.cxx
index 66707d6..ae5179c 100644
--- a/Source/QtDialog/FirstConfigure.cxx
+++ b/Source/QtDialog/FirstConfigure.cxx
@@ -75,8 +75,7 @@ QFrame* StartCompilerSetup::CreatePlatformWidgets()
QVBoxLayout* l = new QVBoxLayout(frame);
l->setContentsMargins(0, 0, 0, 0);
- this->PlatformLabel =
- new QLabel(tr("Specify the platform for this generator"));
+ this->PlatformLabel = new QLabel(tr("Optional platform for generator"));
l->addWidget(this->PlatformLabel);
this->PlatformOptions = new QComboBox(frame);
@@ -106,6 +105,10 @@ void StartCompilerSetup::setGenerators(
this->GeneratorsSupportingPlatform.append(
QString::fromLocal8Bit(it->name.c_str()));
+ this
+ ->GeneratorDefaultPlatform[QString::fromLocal8Bit(it->name.c_str())] =
+ QString::fromLocal8Bit(it->defaultPlatform.c_str());
+
std::vector<std::string>::const_iterator platformIt =
it->supportedPlatforms.cbegin();
while (platformIt != it->supportedPlatforms.cend()) {
@@ -182,6 +185,13 @@ void StartCompilerSetup::onGeneratorChanged(QString const& name)
// Display the generator platform for the generators supporting it
if (GeneratorsSupportingPlatform.contains(name)) {
+ // Change the label title to include the default platform
+ std::string label = "Optional platform for generator";
+ label += "(if empty, generator uses: ";
+ label += this->GeneratorDefaultPlatform[name].toStdString();
+ label += ")";
+ this->PlatformLabel->setText(tr(label.c_str()));
+
// Regenerate the list of supported platform
this->PlatformOptions->clear();
QStringList platform_list;
diff --git a/Source/QtDialog/FirstConfigure.h b/Source/QtDialog/FirstConfigure.h
index 133f422..d1db5bf 100644
--- a/Source/QtDialog/FirstConfigure.h
+++ b/Source/QtDialog/FirstConfigure.h
@@ -63,6 +63,7 @@ protected:
QStringList GeneratorsSupportingToolset;
QStringList GeneratorsSupportingPlatform;
QMultiMap<QString, QString> GeneratorSupportedPlatforms;
+ QMap<QString, QString> GeneratorDefaultPlatform;
private:
QFrame* CreateToolsetWidgets();