2016-09-27 22:01:08 +03:00
|
|
|
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
|
|
|
file Copyright.txt or https://cmake.org/licensing for details. */
|
2007-11-05 21:20:54 +03:00
|
|
|
#ifndef CMakeSetupDialog_h
|
|
|
|
#define CMakeSetupDialog_h
|
|
|
|
|
2007-11-03 19:50:02 +03:00
|
|
|
#include "QCMake.h"
|
2016-04-29 16:40:20 +03:00
|
|
|
|
2016-04-29 17:53:13 +03:00
|
|
|
#include "ui_CMakeSetupDialog.h"
|
|
|
|
#include <QEventLoop>
|
2007-11-02 18:50:17 +03:00
|
|
|
#include <QMainWindow>
|
2007-11-05 21:20:54 +03:00
|
|
|
#include <QThread>
|
2007-11-02 18:50:17 +03:00
|
|
|
|
|
|
|
class QCMakeThread;
|
|
|
|
class CMakeCacheModel;
|
|
|
|
class QProgressBar;
|
2007-11-03 17:30:52 +03:00
|
|
|
class QToolButton;
|
2007-11-02 18:50:17 +03:00
|
|
|
|
|
|
|
/// Qt user interface for CMake
|
|
|
|
class CMakeSetupDialog : public QMainWindow, public Ui::CMakeSetupDialog
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
CMakeSetupDialog();
|
|
|
|
~CMakeSetupDialog();
|
|
|
|
|
2007-11-07 05:27:45 +03:00
|
|
|
public slots:
|
|
|
|
void setBinaryDirectory(const QString& dir);
|
|
|
|
void setSourceDirectory(const QString& dir);
|
|
|
|
|
2011-11-20 01:19:48 +04:00
|
|
|
protected slots:
|
2007-11-02 18:50:17 +03:00
|
|
|
void initialize();
|
|
|
|
void doConfigure();
|
2007-11-06 09:16:11 +03:00
|
|
|
void doGenerate();
|
2016-01-22 18:11:03 +03:00
|
|
|
QString getProjectFilename();
|
|
|
|
void doOpenProject();
|
2008-04-04 00:18:37 +04:00
|
|
|
void doInstallForCommandLine();
|
2007-11-02 18:50:17 +03:00
|
|
|
void doHelp();
|
2007-11-06 09:16:11 +03:00
|
|
|
void doAbout();
|
2007-11-03 17:30:52 +03:00
|
|
|
void doInterrupt();
|
2007-11-09 23:18:49 +03:00
|
|
|
void error(const QString& message);
|
2008-02-14 23:06:05 +03:00
|
|
|
void message(const QString& message);
|
2011-11-20 01:19:48 +04:00
|
|
|
|
2007-11-02 18:50:17 +03:00
|
|
|
void doSourceBrowse();
|
|
|
|
void doBinaryBrowse();
|
2007-11-06 09:16:11 +03:00
|
|
|
void doReloadCache();
|
|
|
|
void doDeleteCache();
|
2007-11-02 18:50:17 +03:00
|
|
|
void updateSourceDirectory(const QString& dir);
|
2008-04-08 03:19:50 +04:00
|
|
|
void updateBinaryDirectory(const QString& dir);
|
2007-11-02 18:50:17 +03:00
|
|
|
void showProgress(const QString& msg, float percent);
|
2007-11-03 17:30:52 +03:00
|
|
|
void setEnabledState(bool);
|
2008-05-16 03:21:01 +04:00
|
|
|
bool setupFirstConfigure();
|
2007-11-06 08:02:08 +03:00
|
|
|
void updateGeneratorLabel(const QString& gen);
|
2007-11-06 09:16:11 +03:00
|
|
|
void setExitAfterGenerate(bool);
|
2007-11-07 03:25:43 +03:00
|
|
|
void addBinaryPath(const QString&);
|
2007-11-07 05:27:45 +03:00
|
|
|
QStringList loadBuildPaths();
|
|
|
|
void saveBuildPaths(const QStringList&);
|
2007-11-07 18:09:02 +03:00
|
|
|
void onBinaryDirectoryChanged(const QString& dir);
|
|
|
|
void onSourceDirectoryChanged(const QString& dir);
|
2007-11-09 23:18:49 +03:00
|
|
|
void setCacheModified();
|
2007-11-10 19:36:09 +03:00
|
|
|
void removeSelectedCacheEntries();
|
|
|
|
void selectionChanged();
|
2007-11-13 07:54:49 +03:00
|
|
|
void addCacheEntry();
|
2008-02-15 02:18:10 +03:00
|
|
|
void startSearch();
|
2008-04-03 01:41:24 +04:00
|
|
|
void setDebugOutput(bool);
|
2010-04-27 02:06:21 +04:00
|
|
|
void setAdvancedView(bool);
|
|
|
|
void setGroupedView(bool);
|
2009-07-17 22:38:36 +04:00
|
|
|
void showUserChanges();
|
2009-09-05 00:43:07 +04:00
|
|
|
void setSearchFilter(const QString& str);
|
2010-12-18 05:04:57 +03:00
|
|
|
bool prepareConfigure();
|
|
|
|
bool doConfigureInternal();
|
|
|
|
bool doGenerateInternal();
|
|
|
|
void exitLoop(int);
|
2016-05-16 17:34:04 +03:00
|
|
|
void doOutputContextMenu(const QPoint&);
|
2013-04-18 03:01:10 +04:00
|
|
|
void doOutputFindDialog();
|
|
|
|
void doOutputFindNext(bool directionForward = true);
|
|
|
|
void doOutputFindPrev();
|
2013-04-18 03:06:00 +04:00
|
|
|
void doOutputErrorNext();
|
2015-11-19 00:40:59 +03:00
|
|
|
void doRegexExplorerDialog();
|
2015-12-06 15:33:13 +03:00
|
|
|
/// display the modal warning messages dialog window
|
|
|
|
void doWarningMessagesDialog();
|
2007-11-02 18:50:17 +03:00
|
|
|
|
|
|
|
protected:
|
2016-05-16 17:34:04 +03:00
|
|
|
enum State
|
|
|
|
{
|
|
|
|
Interrupting,
|
|
|
|
ReadyConfigure,
|
|
|
|
ReadyGenerate,
|
|
|
|
Configuring,
|
|
|
|
Generating
|
|
|
|
};
|
2007-11-13 01:41:15 +03:00
|
|
|
void enterState(State s);
|
|
|
|
|
2007-11-04 02:48:59 +03:00
|
|
|
void closeEvent(QCloseEvent*);
|
2007-11-07 03:25:43 +03:00
|
|
|
void dragEnterEvent(QDragEnterEvent*);
|
|
|
|
void dropEvent(QDropEvent*);
|
2007-11-02 18:50:17 +03:00
|
|
|
|
|
|
|
QCMakeThread* CMakeThread;
|
2007-11-07 03:25:43 +03:00
|
|
|
bool ExitAfterGenerate;
|
2007-11-09 23:18:49 +03:00
|
|
|
bool CacheModified;
|
2010-12-18 05:04:57 +03:00
|
|
|
bool ConfigureNeeded;
|
2007-11-07 03:25:43 +03:00
|
|
|
QAction* ReloadCacheAction;
|
|
|
|
QAction* DeleteCacheAction;
|
|
|
|
QAction* ExitAction;
|
|
|
|
QAction* ConfigureAction;
|
|
|
|
QAction* GenerateAction;
|
2010-08-25 20:35:40 +04:00
|
|
|
QAction* WarnUninitializedAction;
|
2010-08-25 20:43:02 +04:00
|
|
|
QAction* WarnUnusedAction;
|
2008-04-04 00:18:37 +04:00
|
|
|
QAction* InstallForCommandLineAction;
|
2007-11-13 01:41:15 +03:00
|
|
|
State CurrentState;
|
|
|
|
|
2008-04-15 00:15:28 +04:00
|
|
|
QTextCharFormat ErrorFormat;
|
|
|
|
QTextCharFormat MessageFormat;
|
|
|
|
|
2014-01-13 14:28:16 +04:00
|
|
|
QStringList AddVariableNames;
|
|
|
|
QStringList AddVariableTypes;
|
2013-04-18 03:01:10 +04:00
|
|
|
QStringList FindHistory;
|
2011-11-20 01:21:41 +04:00
|
|
|
|
2010-12-18 05:04:57 +03:00
|
|
|
QEventLoop LocalLoop;
|
|
|
|
|
|
|
|
float ProgressOffset;
|
|
|
|
float ProgressFactor;
|
2007-11-02 18:50:17 +03:00
|
|
|
};
|
|
|
|
|
2007-11-05 21:20:54 +03:00
|
|
|
// QCMake instance on a thread
|
|
|
|
class QCMakeThread : public QThread
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
QCMakeThread(QObject* p);
|
|
|
|
QCMake* cmakeInstance() const;
|
2011-11-20 01:19:48 +04:00
|
|
|
|
|
|
|
signals:
|
2007-11-05 21:20:54 +03:00
|
|
|
void cmakeInitialized();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual void run();
|
|
|
|
QCMake* CMakeInstance;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // CMakeSetupDialog_h
|