forked from qt-creator/qt-creator
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.
This commit is contained in:
@@ -82,7 +82,6 @@ CMakeOpenProjectWizard::CMakeOpenProjectWizard(CMakeManager *cmakeManager, const
|
|||||||
|
|
||||||
setPage(InSourcePageId, new InSourceBuildPage(this));
|
setPage(InSourcePageId, new InSourceBuildPage(this));
|
||||||
setPage(ShadowBuildPageId, new ShadowBuildPage(this));
|
setPage(ShadowBuildPageId, new ShadowBuildPage(this));
|
||||||
setPage(XmlFileUpToDatePageId, new XmlFileUpToDatePage(this));
|
|
||||||
setPage(CMakeRunPageId, new CMakeRunPage(this));
|
setPage(CMakeRunPageId, new CMakeRunPage(this));
|
||||||
|
|
||||||
setStartId(startid);
|
setStartId(startid);
|
||||||
@@ -137,15 +136,9 @@ int CMakeOpenProjectWizard::nextId() const
|
|||||||
return QWizard::nextId();
|
return QWizard::nextId();
|
||||||
int cid = currentId();
|
int cid = currentId();
|
||||||
if (cid == InSourcePageId) {
|
if (cid == InSourcePageId) {
|
||||||
if (existsUpToDateXmlFile())
|
return CMakeRunPageId;
|
||||||
return XmlFileUpToDatePageId;
|
|
||||||
else
|
|
||||||
return CMakeRunPageId;
|
|
||||||
} else if (cid == ShadowBuildPageId) {
|
} else if (cid == ShadowBuildPageId) {
|
||||||
if (existsUpToDateXmlFile())
|
return CMakeRunPageId;
|
||||||
return XmlFileUpToDatePageId;
|
|
||||||
else
|
|
||||||
return CMakeRunPageId;
|
|
||||||
}
|
}
|
||||||
return -1;
|
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)
|
ShadowBuildPage::ShadowBuildPage(CMakeOpenProjectWizard *cmakeWizard, bool change)
|
||||||
: QWizardPage(cmakeWizard), m_cmakeWizard(cmakeWizard)
|
: QWizardPage(cmakeWizard), m_cmakeWizard(cmakeWizard)
|
||||||
{
|
{
|
||||||
@@ -313,10 +294,19 @@ void CMakeRunPage::initWidgets()
|
|||||||
void CMakeRunPage::initializePage()
|
void CMakeRunPage::initializePage()
|
||||||
{
|
{
|
||||||
if (m_mode == Initial) {
|
if (m_mode == Initial) {
|
||||||
|
m_complete = m_cmakeWizard->existsUpToDateXmlFile();
|
||||||
m_buildDirectory = m_cmakeWizard->buildDirectory();
|
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. "
|
if (m_cmakeWizard->existsUpToDateXmlFile()) {
|
||||||
"Some projects require command line arguments to the initial cmake call.").arg(m_buildDirectory));
|
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) {
|
} else if (m_mode == CMakeRunPage::Update) {
|
||||||
m_descriptionLabel->setText(tr("The directory %1 contains an outdated .cbp file. Qt "
|
m_descriptionLabel->setText(tr("The directory %1 contains an outdated .cbp file. Qt "
|
||||||
"Creator needs to update this file by running cmake. "
|
"Creator needs to update this file by running cmake. "
|
||||||
|
|||||||
@@ -58,7 +58,6 @@ public:
|
|||||||
enum PageId {
|
enum PageId {
|
||||||
InSourcePageId,
|
InSourcePageId,
|
||||||
ShadowBuildPageId,
|
ShadowBuildPageId,
|
||||||
XmlFileUpToDatePageId,
|
|
||||||
CMakeRunPageId
|
CMakeRunPageId
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -85,9 +84,9 @@ public:
|
|||||||
ProjectExplorer::Environment environment() const;
|
ProjectExplorer::Environment environment() const;
|
||||||
QString msvcVersion() const;
|
QString msvcVersion() const;
|
||||||
void setMsvcVersion(const QString &version);
|
void setMsvcVersion(const QString &version);
|
||||||
|
bool existsUpToDateXmlFile() const;
|
||||||
private:
|
private:
|
||||||
void init();
|
void init();
|
||||||
bool existsUpToDateXmlFile() const;
|
|
||||||
bool hasInSourceBuild() const;
|
bool hasInSourceBuild() const;
|
||||||
CMakeManager *m_cmakeManager;
|
CMakeManager *m_cmakeManager;
|
||||||
QString m_buildDirectory;
|
QString m_buildDirectory;
|
||||||
@@ -107,17 +106,6 @@ private:
|
|||||||
CMakeOpenProjectWizard *m_cmakeWizard;
|
CMakeOpenProjectWizard *m_cmakeWizard;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class XmlFileUpToDatePage : public QWizardPage
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
public:
|
|
||||||
XmlFileUpToDatePage(CMakeOpenProjectWizard *cmakeWizard);
|
|
||||||
private:
|
|
||||||
CMakeOpenProjectWizard *m_cmakeWizard;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
class ShadowBuildPage : public QWizardPage
|
class ShadowBuildPage : public QWizardPage
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|||||||
Reference in New Issue
Block a user