Commit 935a54c1 authored by dt's avatar dt
Browse files

Always show the wizard even if we already have a recent enough cbp file.

That case is a corner case, it can happen if the user has run the codeblocks generator on the command line or if the user deleted the .user file. We mostly ask to get the user a chance to check that we set the correct generator. Or let him select the correct one if there are multiple msvc versions.
parent b2df9bdd
......@@ -82,7 +82,6 @@ CMakeOpenProjectWizard::CMakeOpenProjectWizard(CMakeManager *cmakeManager, const
setPage(InSourcePageId, new InSourceBuildPage(this));
setPage(ShadowBuildPageId, new ShadowBuildPage(this));
setPage(XmlFileUpToDatePageId, new XmlFileUpToDatePage(this));
setPage(CMakeRunPageId, new CMakeRunPage(this));
setStartId(startid);
......@@ -137,15 +136,9 @@ int CMakeOpenProjectWizard::nextId() const
return QWizard::nextId();
int cid = currentId();
if (cid == InSourcePageId) {
if (existsUpToDateXmlFile())
return XmlFileUpToDatePageId;
else
return CMakeRunPageId;
return CMakeRunPageId;
} else if (cid == ShadowBuildPageId) {
if (existsUpToDateXmlFile())
return XmlFileUpToDatePageId;
else
return CMakeRunPageId;
return CMakeRunPageId;
}
return -1;
}
......@@ -227,18 +220,6 @@ InSourceBuildPage::InSourceBuildPage(CMakeOpenProjectWizard *cmakeWizard)
}
XmlFileUpToDatePage::XmlFileUpToDatePage(CMakeOpenProjectWizard *cmakeWizard)
: QWizardPage(cmakeWizard), m_cmakeWizard(cmakeWizard)
{
setLayout(new QVBoxLayout);
QLabel *label = new QLabel(this);
label->setWordWrap(true);
label->setText(tr("Qt Creator has found a recent cbp file, which Qt Creator will parse to gather information about the project. "
"You can change the command line arguments used to create this file in the project mode. "
"Click finish to load the project."));
layout()->addWidget(label);
}
ShadowBuildPage::ShadowBuildPage(CMakeOpenProjectWizard *cmakeWizard, bool change)
: QWizardPage(cmakeWizard), m_cmakeWizard(cmakeWizard)
{
......@@ -313,10 +294,19 @@ void CMakeRunPage::initWidgets()
void CMakeRunPage::initializePage()
{
if (m_mode == Initial) {
m_complete = m_cmakeWizard->existsUpToDateXmlFile();
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));
if (m_cmakeWizard->existsUpToDateXmlFile()) {
m_descriptionLabel->setText(
tr("The directoyr %1 already contains a cbp file, which is recent enough. "
"You can pass special arguments or change the used toolchain here and rerun cmake. "
"Or simply finish the wizard directly").arg(m_buildDirectory));
} else {
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 if (m_mode == CMakeRunPage::Update) {
m_descriptionLabel->setText(tr("The directory %1 contains an outdated .cbp file. Qt "
"Creator needs to update this file by running cmake. "
......
......@@ -58,7 +58,6 @@ public:
enum PageId {
InSourcePageId,
ShadowBuildPageId,
XmlFileUpToDatePageId,
CMakeRunPageId
};
......@@ -85,9 +84,9 @@ public:
ProjectExplorer::Environment environment() const;
QString msvcVersion() const;
void setMsvcVersion(const QString &version);
bool existsUpToDateXmlFile() const;
private:
void init();
bool existsUpToDateXmlFile() const;
bool hasInSourceBuild() const;
CMakeManager *m_cmakeManager;
QString m_buildDirectory;
......@@ -107,17 +106,6 @@ private:
CMakeOpenProjectWizard *m_cmakeWizard;
};
class XmlFileUpToDatePage : public QWizardPage
{
Q_OBJECT
public:
XmlFileUpToDatePage(CMakeOpenProjectWizard *cmakeWizard);
private:
CMakeOpenProjectWizard *m_cmakeWizard;
};
class ShadowBuildPage : public QWizardPage
{
Q_OBJECT
......
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