1 /*=========================================================================
3 Program: CMake - Cross-Platform Makefile Generator
4 Module: $RCSfile: CMakeSetupDialog.h,v $
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
22 #include <QMainWindow>
24 #include "ui_CMakeSetupDialog.h"
27 class CMakeCacheModel
;
31 /// Qt user interface for CMake
32 class CMakeSetupDialog
: public QMainWindow
, public Ui::CMakeSetupDialog
40 void setBinaryDirectory(const QString
& dir
);
41 void setSourceDirectory(const QString
& dir
);
48 void doInstallForCommandLine();
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();
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();
77 void setDebugOutput(bool);
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
;
91 bool SuppressDevWarnings
;
92 QAction
* ReloadCacheAction
;
93 QAction
* DeleteCacheAction
;
95 QAction
* ConfigureAction
;
96 QAction
* GenerateAction
;
97 QAction
* SuppressDevWarningsAction
;
98 QAction
* InstallForCommandLineAction
;
103 // QCMake instance on a thread
104 class QCMakeThread
: public QThread
108 QCMakeThread(QObject
* p
);
109 QCMake
* cmakeInstance() const;
112 void cmakeInitialized();
116 QCMake
* CMakeInstance
;
119 #endif // CMakeSetupDialog_h