1 /*=========================================================================
3 Program: CMake - Cross-Platform Makefile Generator
4 Module: $RCSfile: CMakeSetupDialog.h,v $
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
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
);
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();
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();
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
;
88 QAction
* ReloadCacheAction
;
89 QAction
* DeleteCacheAction
;
91 QAction
* ConfigureAction
;
92 QAction
* GenerateAction
;
97 // QCMake instance on a thread
98 class QCMakeThread
: public QThread
102 QCMakeThread(QObject
* p
);
103 QCMake
* cmakeInstance() const;
106 void cmakeInitialized();
110 QCMake
* CMakeInstance
;
113 #endif // CMakeSetupDialog_h