MainWindow.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. /*
  2. * Copyright (C) 2022 The V-Gears Team
  3. *
  4. * This file is part of V-Gears
  5. *
  6. * V-Gears is free software: you can redistribute it and/or modify it under
  7. * terms of the GNU General Public License as published by the Free Software
  8. * Foundation, version 3.0 (GPLv3) of the License.
  9. *
  10. * V-Gears is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. */
  15. #pragma once
  16. #include <QtWidgets/QMainWindow> // IVV fix path #include <QMainWindow>
  17. #include <QtCore/QSettings>
  18. #include <memory>
  19. namespace Ui {
  20. class MainWindow;
  21. }
  22. /**
  23. * The installer main window.
  24. */
  25. class MainWindow : public QMainWindow{
  26. public:
  27. /**
  28. * Constructor.
  29. *
  30. * @param[in] parent Widget to be made parent of the window.
  31. */
  32. explicit MainWindow(QWidget *parent = 0);
  33. /**
  34. * Destructor.
  35. */
  36. ~MainWindow();
  37. private slots:
  38. /**
  39. * Triggered when the configuration directory has done being edited.
  40. *
  41. * Sets the selected directory.
  42. */
  43. void on_line_vgears_config_editingFinished();
  44. /**
  45. * Triggered when the configuration directory button is clicked.
  46. *
  47. * Opens a file manager for directory selection.
  48. */
  49. void on_btn_vgears_config_clicked();
  50. /**
  51. * Triggered when the executable directory has done being edited.
  52. *
  53. * Sets the selected directory.
  54. */
  55. void on_line_vgears_exe_editingFinished();
  56. /**
  57. * Triggered when the executable directory button is clicked.
  58. *
  59. * Opens a file manager for file selection.
  60. */
  61. void on_btn_vgears_exe_clicked();
  62. /**
  63. * Triggered when the launch button is clicked.
  64. *
  65. * Launches V-Gears.
  66. */
  67. void on_btn_vgears_run_clicked();
  68. /**
  69. * Triggered when the input data directory button is clicked.
  70. *
  71. * Opens a file manager for directory selection.
  72. */
  73. void on_btn_data_src_clicked();
  74. /**
  75. * Triggered when the output data directory has done being edited.
  76. *
  77. * Sets the selected directory.
  78. */
  79. void on_line_data_dst_editingFinished();
  80. /**
  81. * Triggered when the output data directory button is clicked.
  82. *
  83. * Opens a file manager for directory selection.
  84. */
  85. void on_btn_data_dst_clicked();
  86. /**
  87. * Triggered when the install button is clicked.
  88. *
  89. * Launches the installation.
  90. */
  91. void on_btn_data_run_clicked();
  92. //private slots:
  93. /**
  94. * Makes the installation progress advance.
  95. */
  96. void DoProgress();
  97. private:
  98. /**
  99. * Enables or disables the UI.
  100. *
  101. * @param[in] enable True to enable the UI, false to disable it.
  102. */
  103. void EnableUi(bool enable);
  104. /**
  105. * Triggered when the installation starts.
  106. *
  107. * Disables the UI.
  108. */
  109. void OnInstallStarted();
  110. /**
  111. * Triggered when the installation stops.
  112. *
  113. * Enables the UI.
  114. */
  115. void OnInstallStopped();
  116. /**
  117. * Initializes the installer settings.
  118. */
  119. void InitSettings(void);
  120. // The Q_OBJECT macro must appear in the private section of a class definition
  121. //that declares its own signals and slots or that uses other services provided
  122. // by Qt's meta-object system.
  123. Q_OBJECT
  124. /**
  125. * The installer window.
  126. */
  127. Ui::MainWindow* main_window_;
  128. /**
  129. * A timer.
  130. */
  131. QTimer* timer_;
  132. /**
  133. * The installer settings.
  134. */
  135. QSettings *settings_;
  136. /**
  137. * The installer.
  138. */
  139. std::unique_ptr<class DataInstaller> installer_;
  140. };