Resync
[CMakeLuaTailorHgBridge.git] / CMakeLua / Source / QtDialog / CMakeSetupDialog.h
blob7a6cf85d8016698b699a13264ea477591b1f7c72
1 /*=========================================================================
3 Program: CMake - Cross-Platform Makefile Generator
4 Module: $RCSfile: CMakeSetupDialog.h,v $
5 Language: C++
6 Date: $Date: 2008/02/14 23:18:10 $
7 Version: $Revision: 1.20 $
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 doHelp();
48 void doAbout();
49 void doInterrupt();
50 void finishConfigure(int error);
51 void finishGenerate(int error);
52 void error(const QString& message);
53 void message(const QString& message);
55 void doSourceBrowse();
56 void doBinaryBrowse();
57 void doReloadCache();
58 void doDeleteCache();
59 void updateSourceDirectory(const QString& dir);
60 void showProgress(const QString& msg, float percent);
61 void setEnabledState(bool);
62 void promptForGenerator();
63 void updateGeneratorLabel(const QString& gen);
64 void setExitAfterGenerate(bool);
65 void addBinaryPath(const QString&);
66 QStringList loadBuildPaths();
67 void saveBuildPaths(const QStringList&);
68 void onBinaryDirectoryChanged(const QString& dir);
69 void onSourceDirectoryChanged(const QString& dir);
70 void setCacheModified();
71 void removeSelectedCacheEntries();
72 void selectionChanged();
73 void addCacheEntry();
74 void startSearch();
76 protected:
78 enum State { Interrupting, ReadyConfigure, ReadyGenerate, Configuring, Generating };
79 void enterState(State s);
81 void closeEvent(QCloseEvent*);
82 void dragEnterEvent(QDragEnterEvent*);
83 void dropEvent(QDropEvent*);
85 QCMakeThread* CMakeThread;
86 bool ExitAfterGenerate;
87 bool CacheModified;
88 QAction* ReloadCacheAction;
89 QAction* DeleteCacheAction;
90 QAction* ExitAction;
91 QAction* ConfigureAction;
92 QAction* GenerateAction;
93 State CurrentState;
97 // QCMake instance on a thread
98 class QCMakeThread : public QThread
100 Q_OBJECT
101 public:
102 QCMakeThread(QObject* p);
103 QCMake* cmakeInstance() const;
105 signals:
106 void cmakeInitialized();
108 protected:
109 virtual void run();
110 QCMake* CMakeInstance;
113 #endif // CMakeSetupDialog_h