Merge commit 'origin/master'

This commit is contained in:
dt
2009-03-31 12:21:23 +02:00
52 changed files with 1583 additions and 853 deletions

View File

@@ -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);

View File

@@ -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;
};
}

View File

@@ -116,10 +116,11 @@ QProcess *CMakeManager::createXmlFile(const QStringList &arguments, const QStrin
#ifdef Q_OS_WIN
QString generator = "-GCodeBlocks - MinGW Makefiles";
#else // Q_OS_WIN
QString generator = "-GCodeBlocks - Unix Makefiles";
QString generator = "-GCodeBlocks - Unix Makefiles";
#endif // Q_OS_WIN
qDebug()<<cmakeExecutable()<<sourceDirectory << arguments<<generator;
cmake->start(cmakeExecutable(), QStringList() << sourceDirectory << arguments << generator);
QString srcdir = buildDirectory.exists("CMakeCache.txt") ? QString(".") : sourceDirectory;
qDebug()<<cmakeExecutable()<<srcdir<<arguments<<generator;
cmake->start(cmakeExecutable(), QStringList() << srcdir << arguments << generator);
return cmake;
}