CMakeSetupDialog.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  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 setViewType(int);
  65. void showUserChanges();
  66. void setSearchFilter(const QString& str);
  67. protected:
  68. enum State { Interrupting, ReadyConfigure, ReadyGenerate, Configuring, Generating };
  69. void enterState(State s);
  70. void closeEvent(QCloseEvent*);
  71. void dragEnterEvent(QDragEnterEvent*);
  72. void dropEvent(QDropEvent*);
  73. QCMakeThread* CMakeThread;
  74. bool ExitAfterGenerate;
  75. bool CacheModified;
  76. QAction* ReloadCacheAction;
  77. QAction* DeleteCacheAction;
  78. QAction* ExitAction;
  79. QAction* ConfigureAction;
  80. QAction* GenerateAction;
  81. QAction* SuppressDevWarningsAction;
  82. QAction* InstallForCommandLineAction;
  83. State CurrentState;
  84. QTextCharFormat ErrorFormat;
  85. QTextCharFormat MessageFormat;
  86. };
  87. // QCMake instance on a thread
  88. class QCMakeThread : public QThread
  89. {
  90. Q_OBJECT
  91. public:
  92. QCMakeThread(QObject* p);
  93. QCMake* cmakeInstance() const;
  94. signals:
  95. void cmakeInitialized();
  96. protected:
  97. virtual void run();
  98. QCMake* CMakeInstance;
  99. };
  100. #endif // CMakeSetupDialog_h