CMakeSetupDialog.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. /*=========================================================================
  2. Program: CMake - Cross-Platform Makefile Generator
  3. Module: $RCSfile$
  4. Language: C++
  5. Date: $Date$
  6. Version: $Revision$
  7. Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
  8. See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
  9. This software is distributed WITHOUT ANY WARRANTY; without even
  10. the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  11. PURPOSE. See the above copyright notices for more information.
  12. =========================================================================*/
  13. #ifndef CMakeSetupDialog_h
  14. #define CMakeSetupDialog_h
  15. #include "QCMake.h"
  16. #include <QMainWindow>
  17. #include <QThread>
  18. #include "ui_CMakeSetupDialog.h"
  19. class QCMakeThread;
  20. class CMakeCacheModel;
  21. class QProgressBar;
  22. class QToolButton;
  23. /// Qt user interface for CMake
  24. class CMakeSetupDialog : public QMainWindow, public Ui::CMakeSetupDialog
  25. {
  26. Q_OBJECT
  27. public:
  28. CMakeSetupDialog();
  29. ~CMakeSetupDialog();
  30. public slots:
  31. void setBinaryDirectory(const QString& dir);
  32. void setSourceDirectory(const QString& dir);
  33. protected slots:
  34. void initialize();
  35. void doConfigure();
  36. void doGenerate();
  37. void doSuppressDev();
  38. void doInstallForCommandLine();
  39. void doHelp();
  40. void doAbout();
  41. void doInterrupt();
  42. void finishConfigure(int error);
  43. void finishGenerate(int error);
  44. void error(const QString& message);
  45. void message(const QString& message);
  46. void doSourceBrowse();
  47. void doBinaryBrowse();
  48. void doReloadCache();
  49. void doDeleteCache();
  50. void updateSourceDirectory(const QString& dir);
  51. void showProgress(const QString& msg, float percent);
  52. void setEnabledState(bool);
  53. bool promptForGenerator();
  54. void updateGeneratorLabel(const QString& gen);
  55. void setExitAfterGenerate(bool);
  56. void addBinaryPath(const QString&);
  57. QStringList loadBuildPaths();
  58. void saveBuildPaths(const QStringList&);
  59. void onBinaryDirectoryChanged(const QString& dir);
  60. void onSourceDirectoryChanged(const QString& dir);
  61. void setCacheModified();
  62. void removeSelectedCacheEntries();
  63. void selectionChanged();
  64. void addCacheEntry();
  65. void startSearch();
  66. void setDebugOutput(bool);
  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. bool SuppressDevWarnings;
  77. QAction* ReloadCacheAction;
  78. QAction* DeleteCacheAction;
  79. QAction* ExitAction;
  80. QAction* ConfigureAction;
  81. QAction* GenerateAction;
  82. QAction* SuppressDevWarningsAction;
  83. QAction* InstallForCommandLineAction;
  84. State CurrentState;
  85. };
  86. // QCMake instance on a thread
  87. class QCMakeThread : public QThread
  88. {
  89. Q_OBJECT
  90. public:
  91. QCMakeThread(QObject* p);
  92. QCMake* cmakeInstance() const;
  93. signals:
  94. void cmakeInitialized();
  95. protected:
  96. virtual void run();
  97. QCMake* CMakeInstance;
  98. };
  99. #endif // CMakeSetupDialog_h