CMakeSetupDialog.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  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 doHelp();
  38. void doAbout();
  39. void doInterrupt();
  40. void finishConfigure(int error);
  41. void finishGenerate(int error);
  42. void error(const QString& title, const QString& message, bool* cancel);
  43. void doSourceBrowse();
  44. void doBinaryBrowse();
  45. void doReloadCache();
  46. void doDeleteCache();
  47. void updateSourceDirectory(const QString& dir);
  48. void showProgress(const QString& msg, float percent);
  49. void setEnabledState(bool);
  50. void promptForGenerator();
  51. void updateGeneratorLabel(const QString& gen);
  52. void setExitAfterGenerate(bool);
  53. void cacheModelDirty();
  54. void setGenerateEnabled(bool);
  55. void addBinaryPath(const QString&);
  56. QStringList loadBuildPaths();
  57. void saveBuildPaths(const QStringList&);
  58. void onBinaryDirectoryChanged(const QString& dir);
  59. void onSourceDirectoryChanged(const QString& dir);
  60. protected:
  61. void closeEvent(QCloseEvent*);
  62. void dragEnterEvent(QDragEnterEvent*);
  63. void dropEvent(QDropEvent*);
  64. QCMakeThread* CMakeThread;
  65. QProgressBar* ProgressBar;
  66. QToolButton* InterruptButton;
  67. bool ExitAfterGenerate;
  68. QAction* ReloadCacheAction;
  69. QAction* DeleteCacheAction;
  70. QAction* ExitAction;
  71. QAction* ConfigureAction;
  72. QAction* GenerateAction;
  73. };
  74. // QCMake instance on a thread
  75. class QCMakeThread : public QThread
  76. {
  77. Q_OBJECT
  78. public:
  79. QCMakeThread(QObject* p);
  80. QCMake* cmakeInstance() const;
  81. signals:
  82. void cmakeInitialized();
  83. protected slots:
  84. void processEvents();
  85. protected:
  86. virtual void run();
  87. QCMake* CMakeInstance;
  88. };
  89. #endif // CMakeSetupDialog_h