ENH: check in almost building VMS stuff with VMSBuild directory since the bootstrap...
[cmake.git] / Source / QtDialog / CMakeSetupDialog.h
blobaf4223c29a1075fa04d180006b5af0433a382d8b
1 /*=========================================================================
3 Program: CMake - Cross-Platform Makefile Generator
4 Module: $RCSfile: CMakeSetupDialog.h,v $
5 Language: C++
6 Date: $Date: 2008-07-05 17:25:04 $
7 Version: $Revision: 1.29 $
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 doInstallForCommandLine();
48 void doHelp();
49 void doAbout();
50 void doInterrupt();
51 void finishConfigure(int error);
52 void finishGenerate(int error);
53 void error(const QString& message);
54 void message(const QString& message);
56 void doSourceBrowse();
57 void doBinaryBrowse();
58 void doReloadCache();
59 void doDeleteCache();
60 void updateSourceDirectory(const QString& dir);
61 void updateBinaryDirectory(const QString& dir);
62 void showProgress(const QString& msg, float percent);
63 void setEnabledState(bool);
64 bool setupFirstConfigure();
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);
78 void setViewType(int);
80 protected:
82 enum State { Interrupting, ReadyConfigure, ReadyGenerate, Configuring, Generating };
83 void enterState(State s);
85 void closeEvent(QCloseEvent*);
86 void dragEnterEvent(QDragEnterEvent*);
87 void dropEvent(QDropEvent*);
89 QCMakeThread* CMakeThread;
90 bool ExitAfterGenerate;
91 bool CacheModified;
92 QAction* ReloadCacheAction;
93 QAction* DeleteCacheAction;
94 QAction* ExitAction;
95 QAction* ConfigureAction;
96 QAction* GenerateAction;
97 QAction* SuppressDevWarningsAction;
98 QAction* InstallForCommandLineAction;
99 State CurrentState;
101 QTextCharFormat ErrorFormat;
102 QTextCharFormat MessageFormat;
106 // QCMake instance on a thread
107 class QCMakeThread : public QThread
109 Q_OBJECT
110 public:
111 QCMakeThread(QObject* p);
112 QCMake* cmakeInstance() const;
114 signals:
115 void cmakeInitialized();
117 protected:
118 virtual void run();
119 QCMake* CMakeInstance;
122 #endif // CMakeSetupDialog_h