diff --git a/src/plugins/cmakeprojectmanager/cmakeopenprojectwizard.cpp b/src/plugins/cmakeprojectmanager/cmakeopenprojectwizard.cpp index 6907864e62d8c39719f1467d18c57dd00c435b26..842536f3ccde31d94dc7ca3be831b0d6c3ed4457 100644 --- a/src/plugins/cmakeprojectmanager/cmakeopenprojectwizard.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeopenprojectwizard.cpp @@ -214,8 +214,7 @@ void ShadowBuildPage::buildDirectoryChanged() CMakeRunPage::CMakeRunPage(CMakeOpenProjectWizard *cmakeWizard) : QWizardPage(cmakeWizard), m_cmakeWizard(cmakeWizard), - m_complete(false), - m_buildDirectory(m_cmakeWizard->buildDirectory()) + m_complete(false) { initWidgets(); } @@ -224,21 +223,10 @@ CMakeRunPage::CMakeRunPage(CMakeOpenProjectWizard *cmakeWizard, const QString &b : QWizardPage(cmakeWizard), m_cmakeWizard(cmakeWizard), m_complete(false), - m_buildDirectory(buildDirectory) + m_update(update), + m_presetBuildDirectory(buildDirectory) { initWidgets(); - // TODO tell the user more? - if (update) - m_descriptionLabel->setText(tr("The directory %1 contains an outdated .cbp file. Qt " - "Creator needs to update this file by running cmake. " - "If you want to add additional command line arguments, " - "add them in the below.").arg(m_buildDirectory)); - else - m_descriptionLabel->setText(tr("The directory %1, specified in a buildconfiguration, " - "does not contain a cbp file. Qt Creator needs to " - "recreate this file, by running cmake. " - "Some projects require command line arguments to " - "the initial cmake call.").arg(m_buildDirectory)); } void CMakeRunPage::initWidgets() @@ -247,8 +235,6 @@ void CMakeRunPage::initWidgets() setLayout(fl); m_descriptionLabel = new QLabel(this); m_descriptionLabel->setWordWrap(true); - m_descriptionLabel->setText(tr("The directory %1 does not contain a cbp file. Qt Creator needs to create this file, by running cmake. " - "Some projects require command line arguments to the initial cmake call.").arg(m_buildDirectory)); fl->addRow(m_descriptionLabel); @@ -265,6 +251,30 @@ void CMakeRunPage::initWidgets() fl->addRow(m_output); } +void CMakeRunPage::initializePage() +{ + if (m_presetBuildDirectory.isEmpty()) { + m_buildDirectory = m_cmakeWizard->buildDirectory(); + m_descriptionLabel->setText( + tr("The directory %1 does not contain a cbp file. Qt Creator needs to create this file, by running cmake. " + "Some projects require command line arguments to the initial cmake call.").arg(m_buildDirectory)); + } else { + m_buildDirectory = m_presetBuildDirectory; + // TODO tell the user more? + if (m_update) + m_descriptionLabel->setText(tr("The directory %1 contains an outdated .cbp file. Qt " + "Creator needs to update this file by running cmake. " + "If you want to add additional command line arguments, " + "add them in the below.").arg(m_buildDirectory)); + else + m_descriptionLabel->setText(tr("The directory %1, specified in a buildconfiguration, " + "does not contain a cbp file. Qt Creator needs to " + "recreate this file, by running cmake. " + "Some projects require command line arguments to " + "the initial cmake call.").arg(m_buildDirectory)); + } +} + void CMakeRunPage::runCMake() { m_runCMake->setEnabled(false); diff --git a/src/plugins/cmakeprojectmanager/cmakeopenprojectwizard.h b/src/plugins/cmakeprojectmanager/cmakeopenprojectwizard.h index 4f8c4a726b0671ec4933639bffb2451385eaebff..27277151d131baf2e65b8c0d7208118e2d2e9a30 100644 --- a/src/plugins/cmakeprojectmanager/cmakeopenprojectwizard.h +++ b/src/plugins/cmakeprojectmanager/cmakeopenprojectwizard.h @@ -115,6 +115,7 @@ class CMakeRunPage : public QWizardPage public: CMakeRunPage(CMakeOpenProjectWizard *cmakeWizard); CMakeRunPage(CMakeOpenProjectWizard *cmakeWizard, const QString &buildDirectory, bool update); + virtual void initializePage(); virtual void cleanupPage(); virtual bool isComplete() const; private slots: @@ -130,7 +131,9 @@ private: QLineEdit *m_argumentsLineEdit; QLabel *m_descriptionLabel; bool m_complete; + bool m_update; QString m_buildDirectory; + QString m_presetBuildDirectory; }; }