forked from qt-creator/qt-creator
If no cmake executable is specified or a invalid path, ask the user.
Directly in the wizard and save that to the settings. Also give feedback if a wrong path was entered.
This commit is contained in:
@@ -39,12 +39,12 @@
|
||||
#include <QtCore/QDir>
|
||||
|
||||
QT_FORWARD_DECLARE_CLASS(QProcess)
|
||||
QT_FORWARD_DECLARE_CLASS(QLabel)
|
||||
|
||||
namespace CMakeProjectManager {
|
||||
namespace Internal {
|
||||
|
||||
class CMakeSettingsPage;
|
||||
class CMakeRunner;
|
||||
|
||||
class CMakeManager : public ProjectExplorer::IProjectManager
|
||||
{
|
||||
@@ -57,7 +57,11 @@ public:
|
||||
|
||||
virtual ProjectExplorer::Project *openProject(const QString &fileName);
|
||||
virtual QString mimeType() const;
|
||||
|
||||
QString cmakeExecutable() const;
|
||||
bool isCMakeExecutableValid() const;
|
||||
|
||||
void setCMakeExecutable(const QString &executable);
|
||||
|
||||
QProcess* createXmlFile(const QStringList &arguments,
|
||||
const QString &sourceDirectory,
|
||||
@@ -76,28 +80,6 @@ private:
|
||||
CMakeSettingsPage *m_settingsPage;
|
||||
};
|
||||
|
||||
class CMakeRunner
|
||||
{
|
||||
public:
|
||||
CMakeRunner();
|
||||
void setExecutable(const QString &executable);
|
||||
QString executable() const;
|
||||
QString version() const;
|
||||
bool supportsQtCreator() const;
|
||||
bool hasCodeBlocksMsvcGenerator() const;
|
||||
|
||||
private:
|
||||
void run(QFutureInterface<void> &fi);
|
||||
void waitForUpToDate() const;
|
||||
QString m_executable;
|
||||
QString m_version;
|
||||
bool m_supportsQtCreator;
|
||||
bool m_hasCodeBlocksMsvcGenerator;
|
||||
bool m_cacheUpToDate;
|
||||
mutable QFuture<void> m_future;
|
||||
mutable QMutex m_mutex;
|
||||
};
|
||||
|
||||
class CMakeSettingsPage : public Core::IOptionsPage
|
||||
{
|
||||
Q_OBJECT
|
||||
@@ -114,15 +96,23 @@ public:
|
||||
virtual void finish();
|
||||
|
||||
QString cmakeExecutable() const;
|
||||
void askUserForCMakeExecutable();
|
||||
void setCMakeExecutable(const QString &executable);
|
||||
bool isCMakeExecutableValid();
|
||||
bool hasCodeBlocksMsvcGenerator() const;
|
||||
private slots:
|
||||
void cmakeFinished();
|
||||
private:
|
||||
void updateCachedInformation() const;
|
||||
void saveSettings() const;
|
||||
void startProcess();
|
||||
QString findCmakeExecutable() const;
|
||||
void updateInfo();
|
||||
|
||||
mutable CMakeRunner m_cmakeRunner;
|
||||
Core::Utils::PathChooser *m_pathchooser;
|
||||
QString m_cmakeExecutable;
|
||||
enum STATE { VALID, INVALID, RUNNING } m_state;
|
||||
QProcess *m_process;
|
||||
QString m_version;
|
||||
bool m_hasCodeBlocksMsvcGenerator;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
Reference in New Issue
Block a user