MainWindow.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  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 ff7.exe file button is clicked.
  76. *
  77. * Opens a file manager for file selection.
  78. */
  79. void on_btn_exe_src_clicked();
  80. /**
  81. * Triggered when the output data directory has done being edited.
  82. *
  83. * Sets the selected directory.
  84. */
  85. void on_line_data_dst_editingFinished();
  86. /**
  87. * Triggered when the output data directory button is clicked.
  88. *
  89. * Opens a file manager for directory selection.
  90. */
  91. void on_btn_data_dst_clicked();
  92. /**
  93. * Triggered when the install button is clicked.
  94. *
  95. * Launches the installation.
  96. */
  97. void on_btn_data_run_clicked();
  98. //private slots:
  99. /**
  100. * Makes the installation progress advance.
  101. */
  102. void DoProgress();
  103. private:
  104. /**
  105. * Enables or disables the UI.
  106. *
  107. * @param[in] enable True to enable the UI, false to disable it.
  108. */
  109. void EnableUi(bool enable);
  110. /**
  111. * Triggered when the installation starts.
  112. *
  113. * Disables the UI.
  114. */
  115. void OnInstallStarted();
  116. /**
  117. * Triggered when the installation stops.
  118. *
  119. * Enables the UI.
  120. */
  121. void OnInstallStopped();
  122. /**
  123. * Initializes the installer settings.
  124. */
  125. void InitSettings(void);
  126. // The Q_OBJECT macro must appear in the private section of a class definition
  127. //that declares its own signals and slots or that uses other services provided
  128. // by Qt's meta-object system.
  129. Q_OBJECT
  130. /**
  131. * The installer window.
  132. */
  133. Ui::MainWindow* main_window_;
  134. /**
  135. * A timer.
  136. */
  137. QTimer* timer_;
  138. /**
  139. * The installer settings.
  140. */
  141. QSettings *settings_;
  142. /**
  143. * The installer.
  144. */
  145. std::unique_ptr<class DataInstaller> installer_;
  146. };