CMakeSetupDialog.h 2.5 KB

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