CMakeSetupDialog.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. /*============================================================================
  2. CMake - Cross Platform Makefile Generator
  3. Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
  4. Distributed under the OSI-approved BSD License (the "License");
  5. see accompanying file Copyright.txt for details.
  6. This software is distributed WITHOUT ANY WARRANTY; without even the
  7. implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  8. See the License for more information.
  9. ============================================================================*/
  10. #ifndef CMakeSetupDialog_h
  11. #define CMakeSetupDialog_h
  12. #include "QCMake.h"
  13. #include <QMainWindow>
  14. #include <QThread>
  15. #include "ui_CMakeSetupDialog.h"
  16. class QCMakeThread;
  17. class CMakeCacheModel;
  18. class QProgressBar;
  19. class QToolButton;
  20. /// Qt user interface for CMake
  21. class CMakeSetupDialog : public QMainWindow, public Ui::CMakeSetupDialog
  22. {
  23. Q_OBJECT
  24. public:
  25. CMakeSetupDialog();
  26. ~CMakeSetupDialog();
  27. public slots:
  28. void setBinaryDirectory(const QString& dir);
  29. void setSourceDirectory(const QString& dir);
  30. protected slots:
  31. void initialize();
  32. void doConfigure();
  33. void doGenerate();
  34. void doInstallForCommandLine();
  35. void doHelp();
  36. void doAbout();
  37. void doInterrupt();
  38. void finishConfigure(int error);
  39. void finishGenerate(int error);
  40. void error(const QString& message);
  41. void message(const QString& message);
  42. void doSourceBrowse();
  43. void doBinaryBrowse();
  44. void doReloadCache();
  45. void doDeleteCache();
  46. void updateSourceDirectory(const QString& dir);
  47. void updateBinaryDirectory(const QString& dir);
  48. void showProgress(const QString& msg, float percent);
  49. void setEnabledState(bool);
  50. bool setupFirstConfigure();
  51. void updateGeneratorLabel(const QString& gen);
  52. void setExitAfterGenerate(bool);
  53. void addBinaryPath(const QString&);
  54. QStringList loadBuildPaths();
  55. void saveBuildPaths(const QStringList&);
  56. void onBinaryDirectoryChanged(const QString& dir);
  57. void onSourceDirectoryChanged(const QString& dir);
  58. void setCacheModified();
  59. void removeSelectedCacheEntries();
  60. void selectionChanged();
  61. void addCacheEntry();
  62. void startSearch();
  63. void setDebugOutput(bool);
  64. void setAdvancedView(bool);
  65. void setGroupedView(bool);
  66. void showUserChanges();
  67. void setSearchFilter(const QString& str);
  68. protected:
  69. enum State { Interrupting, ReadyConfigure, ReadyGenerate, Configuring, Generating };
  70. void enterState(State s);
  71. void closeEvent(QCloseEvent*);
  72. void dragEnterEvent(QDragEnterEvent*);
  73. void dropEvent(QDropEvent*);
  74. QCMakeThread* CMakeThread;
  75. bool ExitAfterGenerate;
  76. bool CacheModified;
  77. QAction* ReloadCacheAction;
  78. QAction* DeleteCacheAction;
  79. QAction* ExitAction;
  80. QAction* ConfigureAction;
  81. QAction* GenerateAction;
  82. QAction* SuppressDevWarningsAction;
  83. QAction* WarnUninitializedAction;
  84. QAction* WarnUnusedAction;
  85. QAction* InstallForCommandLineAction;
  86. State CurrentState;
  87. QTextCharFormat ErrorFormat;
  88. QTextCharFormat MessageFormat;
  89. };
  90. // QCMake instance on a thread
  91. class QCMakeThread : public QThread
  92. {
  93. Q_OBJECT
  94. public:
  95. QCMakeThread(QObject* p);
  96. QCMake* cmakeInstance() const;
  97. signals:
  98. void cmakeInitialized();
  99. protected:
  100. virtual void run();
  101. QCMake* CMakeInstance;
  102. };
  103. #endif // CMakeSetupDialog_h