ENH: Add cross compiling support in the GUI in the same dialog that prompts for
[cmake.git] / Source / QtDialog / CMakeSetupDialog.h
blob4af1b53188ef8566253f1241579efdd2da100514
1 /*=========================================================================
3 Program: CMake - Cross-Platform Makefile Generator
4 Module: $RCSfile: CMakeSetupDialog.h,v $
5 Language: C++
6 Date: $Date: 2008-05-15 23:21:01 $
7 Version: $Revision: 1.27 $
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);
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 QAction* ReloadCacheAction;
92 QAction* DeleteCacheAction;
93 QAction* ExitAction;
94 QAction* ConfigureAction;
95 QAction* GenerateAction;
96 QAction* SuppressDevWarningsAction;
97 QAction* InstallForCommandLineAction;
98 State CurrentState;
100 QTextCharFormat ErrorFormat;
101 QTextCharFormat MessageFormat;
105 // QCMake instance on a thread
106 class QCMakeThread : public QThread
108 Q_OBJECT
109 public:
110 QCMakeThread(QObject* p);
111 QCMake* cmakeInstance() const;
113 signals:
114 void cmakeInitialized();
116 protected:
117 virtual void run();
118 QCMake* CMakeInstance;
121 #endif // CMakeSetupDialog_h