2007-11-02 18:55:57 +03:00
|
|
|
/*=========================================================================
|
|
|
|
|
|
|
|
Program: CMake - Cross-Platform Makefile Generator
|
|
|
|
Module: $RCSfile$
|
|
|
|
Language: C++
|
|
|
|
Date: $Date$
|
|
|
|
Version: $Revision$
|
|
|
|
|
|
|
|
Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
|
|
|
|
See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
|
|
|
|
|
|
|
|
This software is distributed WITHOUT ANY WARRANTY; without even
|
|
|
|
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
|
|
|
PURPOSE. See the above copyright notices for more information.
|
|
|
|
|
|
|
|
=========================================================================*/
|
2007-11-02 18:50:17 +03:00
|
|
|
|
2007-11-05 21:20:54 +03:00
|
|
|
#ifndef CMakeSetupDialog_h
|
|
|
|
#define CMakeSetupDialog_h
|
|
|
|
|
2007-11-03 19:50:02 +03:00
|
|
|
#include "QCMake.h"
|
2007-11-02 18:50:17 +03:00
|
|
|
#include <QMainWindow>
|
2007-11-05 21:20:54 +03:00
|
|
|
#include <QThread>
|
2007-11-02 18:50:17 +03:00
|
|
|
#include "ui_CMakeSetupDialog.h"
|
|
|
|
|
|
|
|
class QCMakeThread;
|
|
|
|
class CMakeCacheModel;
|
|
|
|
class QProgressBar;
|
2007-11-03 17:30:52 +03:00
|
|
|
class QToolButton;
|
2007-11-02 18:50:17 +03:00
|
|
|
|
|
|
|
/// Qt user interface for CMake
|
|
|
|
class CMakeSetupDialog : public QMainWindow, public Ui::CMakeSetupDialog
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
CMakeSetupDialog();
|
|
|
|
~CMakeSetupDialog();
|
|
|
|
|
2007-11-07 05:27:45 +03:00
|
|
|
public slots:
|
|
|
|
void setBinaryDirectory(const QString& dir);
|
|
|
|
void setSourceDirectory(const QString& dir);
|
|
|
|
|
2007-11-02 18:50:17 +03:00
|
|
|
protected slots:
|
|
|
|
void initialize();
|
|
|
|
void doConfigure();
|
2007-11-06 09:16:11 +03:00
|
|
|
void doGenerate();
|
2008-04-04 00:18:37 +04:00
|
|
|
void doInstallForCommandLine();
|
2007-11-02 18:50:17 +03:00
|
|
|
void doHelp();
|
2007-11-06 09:16:11 +03:00
|
|
|
void doAbout();
|
2007-11-03 17:30:52 +03:00
|
|
|
void doInterrupt();
|
2007-11-02 18:50:17 +03:00
|
|
|
void finishConfigure(int error);
|
|
|
|
void finishGenerate(int error);
|
2007-11-09 23:18:49 +03:00
|
|
|
void error(const QString& message);
|
2008-02-14 23:06:05 +03:00
|
|
|
void message(const QString& message);
|
2007-11-02 18:50:17 +03:00
|
|
|
|
|
|
|
void doSourceBrowse();
|
|
|
|
void doBinaryBrowse();
|
2007-11-06 09:16:11 +03:00
|
|
|
void doReloadCache();
|
|
|
|
void doDeleteCache();
|
2007-11-02 18:50:17 +03:00
|
|
|
void updateSourceDirectory(const QString& dir);
|
2008-04-08 03:19:50 +04:00
|
|
|
void updateBinaryDirectory(const QString& dir);
|
2007-11-02 18:50:17 +03:00
|
|
|
void showProgress(const QString& msg, float percent);
|
2007-11-03 17:30:52 +03:00
|
|
|
void setEnabledState(bool);
|
2008-05-16 03:21:01 +04:00
|
|
|
bool setupFirstConfigure();
|
2007-11-06 08:02:08 +03:00
|
|
|
void updateGeneratorLabel(const QString& gen);
|
2007-11-06 09:16:11 +03:00
|
|
|
void setExitAfterGenerate(bool);
|
2007-11-07 03:25:43 +03:00
|
|
|
void addBinaryPath(const QString&);
|
2007-11-07 05:27:45 +03:00
|
|
|
QStringList loadBuildPaths();
|
|
|
|
void saveBuildPaths(const QStringList&);
|
2007-11-07 18:09:02 +03:00
|
|
|
void onBinaryDirectoryChanged(const QString& dir);
|
|
|
|
void onSourceDirectoryChanged(const QString& dir);
|
2007-11-09 23:18:49 +03:00
|
|
|
void setCacheModified();
|
2007-11-10 19:36:09 +03:00
|
|
|
void removeSelectedCacheEntries();
|
|
|
|
void selectionChanged();
|
2007-11-13 07:54:49 +03:00
|
|
|
void addCacheEntry();
|
2008-02-15 02:18:10 +03:00
|
|
|
void startSearch();
|
2008-04-03 01:41:24 +04:00
|
|
|
void setDebugOutput(bool);
|
2008-06-13 19:19:53 +04:00
|
|
|
void toggleGroupView(bool);
|
2007-11-02 18:50:17 +03:00
|
|
|
|
|
|
|
protected:
|
2007-11-13 01:41:15 +03:00
|
|
|
|
|
|
|
enum State { Interrupting, ReadyConfigure, ReadyGenerate, Configuring, Generating };
|
|
|
|
void enterState(State s);
|
|
|
|
|
2007-11-04 02:48:59 +03:00
|
|
|
void closeEvent(QCloseEvent*);
|
2007-11-07 03:25:43 +03:00
|
|
|
void dragEnterEvent(QDragEnterEvent*);
|
|
|
|
void dropEvent(QDropEvent*);
|
2007-11-02 18:50:17 +03:00
|
|
|
|
|
|
|
QCMakeThread* CMakeThread;
|
2007-11-07 03:25:43 +03:00
|
|
|
bool ExitAfterGenerate;
|
2007-11-09 23:18:49 +03:00
|
|
|
bool CacheModified;
|
2007-11-07 03:25:43 +03:00
|
|
|
QAction* ReloadCacheAction;
|
|
|
|
QAction* DeleteCacheAction;
|
|
|
|
QAction* ExitAction;
|
|
|
|
QAction* ConfigureAction;
|
|
|
|
QAction* GenerateAction;
|
2008-03-12 05:51:56 +03:00
|
|
|
QAction* SuppressDevWarningsAction;
|
2008-04-04 00:18:37 +04:00
|
|
|
QAction* InstallForCommandLineAction;
|
2007-11-13 01:41:15 +03:00
|
|
|
State CurrentState;
|
|
|
|
|
2008-04-15 00:15:28 +04:00
|
|
|
QTextCharFormat ErrorFormat;
|
|
|
|
QTextCharFormat MessageFormat;
|
|
|
|
|
2007-11-02 18:50:17 +03:00
|
|
|
};
|
|
|
|
|
2007-11-05 21:20:54 +03:00
|
|
|
// QCMake instance on a thread
|
|
|
|
class QCMakeThread : public QThread
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
QCMakeThread(QObject* p);
|
|
|
|
QCMake* cmakeInstance() const;
|
|
|
|
|
|
|
|
signals:
|
|
|
|
void cmakeInitialized();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual void run();
|
|
|
|
QCMake* CMakeInstance;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // CMakeSetupDialog_h
|