Resync
[CMakeLuaTailorHgBridge.git] / CMakeLua / Source / QtDialog / CMakeSetupDialog.h
blobc45ce22b56092497adebf8a3cb9dc31782525438
1 /*=========================================================================
3 Program: CMake - Cross-Platform Makefile Generator
4 Module: $RCSfile: CMakeSetupDialog.h,v $
5 Language: C++
6 Date: $Date: 2008-04-03 20:18:37 $
7 Version: $Revision: 1.24 $
9 Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
10 See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
12 This software is distributed WITHOUT ANY WARRANTY; without even
13 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 PURPOSE. See the above copyright notices for more information.
16 =========================================================================*/
18 #ifndef CMakeSetupDialog_h
19 #define CMakeSetupDialog_h
21 #include "QCMake.h"
22 #include <QMainWindow>
23 #include <QThread>
24 #include "ui_CMakeSetupDialog.h"
26 class QCMakeThread;
27 class CMakeCacheModel;
28 class QProgressBar;
29 class QToolButton;
31 /// Qt user interface for CMake
32 class CMakeSetupDialog : public QMainWindow, public Ui::CMakeSetupDialog
34 Q_OBJECT
35 public:
36 CMakeSetupDialog();
37 ~CMakeSetupDialog();
39 public slots:
40 void setBinaryDirectory(const QString& dir);
41 void setSourceDirectory(const QString& dir);
43 protected slots:
44 void initialize();
45 void doConfigure();
46 void doGenerate();
47 void doSuppressDev();
48 void doInstallForCommandLine();
49 void doHelp();
50 void doAbout();
51 void doInterrupt();
52 void finishConfigure(int error);
53 void finishGenerate(int error);
54 void error(const QString& message);
55 void message(const QString& message);
57 void doSourceBrowse();
58 void doBinaryBrowse();
59 void doReloadCache();
60 void doDeleteCache();
61 void updateSourceDirectory(const QString& dir);
62 void showProgress(const QString& msg, float percent);
63 void setEnabledState(bool);
64 bool promptForGenerator();
65 void updateGeneratorLabel(const QString& gen);
66 void setExitAfterGenerate(bool);
67 void addBinaryPath(const QString&);
68 QStringList loadBuildPaths();
69 void saveBuildPaths(const QStringList&);
70 void onBinaryDirectoryChanged(const QString& dir);
71 void onSourceDirectoryChanged(const QString& dir);
72 void setCacheModified();
73 void removeSelectedCacheEntries();
74 void selectionChanged();
75 void addCacheEntry();
76 void startSearch();
77 void setDebugOutput(bool);
79 protected:
81 enum State { Interrupting, ReadyConfigure, ReadyGenerate, Configuring, Generating };
82 void enterState(State s);
84 void closeEvent(QCloseEvent*);
85 void dragEnterEvent(QDragEnterEvent*);
86 void dropEvent(QDropEvent*);
88 QCMakeThread* CMakeThread;
89 bool ExitAfterGenerate;
90 bool CacheModified;
91 bool SuppressDevWarnings;
92 QAction* ReloadCacheAction;
93 QAction* DeleteCacheAction;
94 QAction* ExitAction;
95 QAction* ConfigureAction;
96 QAction* GenerateAction;
97 QAction* SuppressDevWarningsAction;
98 QAction* InstallForCommandLineAction;
99 State CurrentState;
103 // QCMake instance on a thread
104 class QCMakeThread : public QThread
106 Q_OBJECT
107 public:
108 QCMakeThread(QObject* p);
109 QCMake* cmakeInstance() const;
111 signals:
112 void cmakeInitialized();
114 protected:
115 virtual void run();
116 QCMake* CMakeInstance;
119 #endif // CMakeSetupDialog_h