1 /*=========================================================================
3 Program: CMake - Cross-Platform Makefile Generator
4 Module: $RCSfile: CMakeSetupDialog.h,v $
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
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
);
47 void doInstallForCommandLine();
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();
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();
77 void setDebugOutput(bool);
78 void setViewType(int);
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
;
92 QAction
* ReloadCacheAction
;
93 QAction
* DeleteCacheAction
;
95 QAction
* ConfigureAction
;
96 QAction
* GenerateAction
;
97 QAction
* SuppressDevWarningsAction
;
98 QAction
* InstallForCommandLineAction
;
101 QTextCharFormat ErrorFormat
;
102 QTextCharFormat MessageFormat
;
106 // QCMake instance on a thread
107 class QCMakeThread
: public QThread
111 QCMakeThread(QObject
* p
);
112 QCMake
* cmakeInstance() const;
115 void cmakeInitialized();
119 QCMake
* CMakeInstance
;
122 #endif // CMakeSetupDialog_h