forked from qt-creator/qt-creator
make changing the build dir of a shadow build work
This commit is contained in:
@@ -214,8 +214,7 @@ void ShadowBuildPage::buildDirectoryChanged()
|
|||||||
CMakeRunPage::CMakeRunPage(CMakeOpenProjectWizard *cmakeWizard)
|
CMakeRunPage::CMakeRunPage(CMakeOpenProjectWizard *cmakeWizard)
|
||||||
: QWizardPage(cmakeWizard),
|
: QWizardPage(cmakeWizard),
|
||||||
m_cmakeWizard(cmakeWizard),
|
m_cmakeWizard(cmakeWizard),
|
||||||
m_complete(false),
|
m_complete(false)
|
||||||
m_buildDirectory(m_cmakeWizard->buildDirectory())
|
|
||||||
{
|
{
|
||||||
initWidgets();
|
initWidgets();
|
||||||
}
|
}
|
||||||
@@ -224,21 +223,10 @@ CMakeRunPage::CMakeRunPage(CMakeOpenProjectWizard *cmakeWizard, const QString &b
|
|||||||
: QWizardPage(cmakeWizard),
|
: QWizardPage(cmakeWizard),
|
||||||
m_cmakeWizard(cmakeWizard),
|
m_cmakeWizard(cmakeWizard),
|
||||||
m_complete(false),
|
m_complete(false),
|
||||||
m_buildDirectory(buildDirectory)
|
m_update(update),
|
||||||
|
m_presetBuildDirectory(buildDirectory)
|
||||||
{
|
{
|
||||||
initWidgets();
|
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()
|
void CMakeRunPage::initWidgets()
|
||||||
@@ -247,8 +235,6 @@ void CMakeRunPage::initWidgets()
|
|||||||
setLayout(fl);
|
setLayout(fl);
|
||||||
m_descriptionLabel = new QLabel(this);
|
m_descriptionLabel = new QLabel(this);
|
||||||
m_descriptionLabel->setWordWrap(true);
|
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);
|
fl->addRow(m_descriptionLabel);
|
||||||
|
|
||||||
@@ -265,6 +251,30 @@ void CMakeRunPage::initWidgets()
|
|||||||
fl->addRow(m_output);
|
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()
|
void CMakeRunPage::runCMake()
|
||||||
{
|
{
|
||||||
m_runCMake->setEnabled(false);
|
m_runCMake->setEnabled(false);
|
||||||
|
|||||||
@@ -115,6 +115,7 @@ class CMakeRunPage : public QWizardPage
|
|||||||
public:
|
public:
|
||||||
CMakeRunPage(CMakeOpenProjectWizard *cmakeWizard);
|
CMakeRunPage(CMakeOpenProjectWizard *cmakeWizard);
|
||||||
CMakeRunPage(CMakeOpenProjectWizard *cmakeWizard, const QString &buildDirectory, bool update);
|
CMakeRunPage(CMakeOpenProjectWizard *cmakeWizard, const QString &buildDirectory, bool update);
|
||||||
|
virtual void initializePage();
|
||||||
virtual void cleanupPage();
|
virtual void cleanupPage();
|
||||||
virtual bool isComplete() const;
|
virtual bool isComplete() const;
|
||||||
private slots:
|
private slots:
|
||||||
@@ -130,7 +131,9 @@ private:
|
|||||||
QLineEdit *m_argumentsLineEdit;
|
QLineEdit *m_argumentsLineEdit;
|
||||||
QLabel *m_descriptionLabel;
|
QLabel *m_descriptionLabel;
|
||||||
bool m_complete;
|
bool m_complete;
|
||||||
|
bool m_update;
|
||||||
QString m_buildDirectory;
|
QString m_buildDirectory;
|
||||||
|
QString m_presetBuildDirectory;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user