CMakeSetupDialog.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  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 doInstallForCommandLine();
  38. void doHelp();
  39. void doAbout();
  40. void doInterrupt();
  41. void finishConfigure(int error);
  42. void finishGenerate(int error);
  43. void error(const QString& message);
  44. void message(const QString& message);
  45. void doSourceBrowse();
  46. void doBinaryBrowse();
  47. void doReloadCache();
  48. void doDeleteCache();
  49. void updateSourceDirectory(const QString& dir);
  50. void updateBinaryDirectory(const QString& dir);
  51. void showProgress(const QString& msg, float percent);
  52. void setEnabledState(bool);
  53. bool setupFirstConfigure();
  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. void setViewType(int);
  68. void showUserChanges();
  69. protected:
  70. enum State { Interrupting, ReadyConfigure, ReadyGenerate, Configuring, Generating };
  71. void enterState(State s);
  72. void closeEvent(QCloseEvent*);
  73. void dragEnterEvent(QDragEnterEvent*);
  74. void dropEvent(QDropEvent*);
  75. QCMakeThread* CMakeThread;
  76. bool ExitAfterGenerate;
  77. bool CacheModified;
  78. QAction* ReloadCacheAction;
  79. QAction* DeleteCacheAction;
  80. QAction* ExitAction;
  81. QAction* ConfigureAction;
  82. QAction* GenerateAction;
  83. QAction* SuppressDevWarningsAction;
  84. QAction* InstallForCommandLineAction;
  85. State CurrentState;
  86. QTextCharFormat ErrorFormat;
  87. QTextCharFormat MessageFormat;
  88. };
  89. // QCMake instance on a thread
  90. class QCMakeThread : public QThread
  91. {
  92. Q_OBJECT
  93. public:
  94. QCMakeThread(QObject* p);
  95. QCMake* cmakeInstance() const;
  96. signals:
  97. void cmakeInitialized();
  98. protected:
  99. virtual void run();
  100. QCMake* CMakeInstance;
  101. };
  102. #endif // CMakeSetupDialog_h