2009-09-28 19:43:28 +04:00
|
|
|
/*============================================================================
|
|
|
|
CMake - Cross Platform Makefile Generator
|
|
|
|
Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
|
2007-11-02 18:55:57 +03:00
|
|
|
|
2009-09-28 19:43:28 +04:00
|
|
|
Distributed under the OSI-approved BSD License (the "License");
|
|
|
|
see accompanying file Copyright.txt for details.
|
2007-11-02 18:55:57 +03:00
|
|
|
|
2009-09-28 19:43:28 +04:00
|
|
|
This software is distributed WITHOUT ANY WARRANTY; without even the
|
|
|
|
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
See the License for more information.
|
|
|
|
============================================================================*/
|
2007-11-02 18:50:17 +03:00
|
|
|
|
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"
|
2007-11-02 18:50:17 +03:00
|
|
|
#include <QMainWindow>
|
2007-11-05 21:20:54 +03:00
|
|
|
#include <QThread>
|
2010-12-18 05:04:57 +03:00
|
|
|
#include <QEventLoop>
|
2007-11-02 18:50:17 +03:00
|
|
|
#include "ui_CMakeSetupDialog.h"
|
|
|
|
|
|
|
|
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();
|
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);
|
2013-04-18 02:53:12 +04: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();
|
2007-11-02 18:50:17 +03:00
|
|
|
|
|
|
|
protected:
|
2007-11-13 01:41:15 +03:00
|
|
|
|
|
|
|
enum State { Interrupting, ReadyConfigure, ReadyGenerate, Configuring, Generating };
|
|
|
|
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;
|
2008-03-12 05:51:56 +03:00
|
|
|
QAction* SuppressDevWarningsAction;
|
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
|