mainwindow.h 3.8 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. // TODO ??? What is this.
  27. Q_OBJECT
  28. public:
  29. /**
  30. * Constructor.
  31. *
  32. * @param parent[in] Widget to be made parent of the window.
  33. */
  34. explicit MainWindow(QWidget *parent = 0);
  35. /**
  36. * Destructor.
  37. */
  38. ~MainWindow();
  39. private slots:
  40. /**
  41. * Triggered when the configuration directory has done being edited.
  42. *
  43. * Sets the selected directory.
  44. */
  45. void on_lineConfigDir_editingFinished();
  46. /**
  47. * Triggered when the configuration directory button is clicked.
  48. *
  49. * Opens a file manager for directory selection.
  50. */
  51. void on_btnConfigDir_clicked();
  52. /**
  53. * Triggered when the executable directory has done being edited.
  54. *
  55. * Sets the selected directory.
  56. */
  57. void on_lineVGearsExe_editingFinished();
  58. /**
  59. * Triggered when the executable directory button is clicked.
  60. *
  61. * Opens a file manager for file selection.
  62. */
  63. void on_btnVGearsExe_clicked();
  64. /**
  65. * Triggered when the launch button is clicked.
  66. *
  67. * Launches V-Gears.
  68. */
  69. void on_btnLaunch_clicked();
  70. /**
  71. * Triggered when the input data directory button is clicked.
  72. *
  73. * Opens a file manager for directory selection.
  74. */
  75. void on_btnInput_clicked();
  76. /**
  77. * Triggered when the output data directory has done being edited.
  78. *
  79. * Sets the selected directory.
  80. */
  81. void on_lineDataDir_editingFinished();
  82. /**
  83. * Triggered when the output data directory button is clicked.
  84. *
  85. * Opens a file manager for directory selection.
  86. */
  87. void on_btnDataDir_clicked();
  88. /**
  89. * Triggered when the install button is clicked.
  90. *
  91. * Launches the installation.
  92. */
  93. void on_btnGO_clicked();
  94. //private slots:
  95. /**
  96. * Makes the installation progress advance.
  97. */
  98. void DoProgress();
  99. private:
  100. /**
  101. * Enables or disables the UI.
  102. *
  103. * @param enable[in] True to enable the UI, false to disable it.
  104. */
  105. void EnableUi(bool enable);
  106. /**
  107. * Triggered when the installation starts.
  108. *
  109. * Disables the UI.
  110. */
  111. void OnInstallStarted();
  112. /**
  113. * Triggered when the installation stops.
  114. *
  115. * Enables the UI.
  116. */
  117. void OnInstallStopped();
  118. /**
  119. * Initializes the installer settings.
  120. */
  121. void InitSettings(void);
  122. private:
  123. /**
  124. * The installer window.
  125. */
  126. Ui::MainWindow* main_window_;
  127. /**
  128. * A timer.
  129. */
  130. QTimer* timer_;
  131. /**
  132. * The installer settings.
  133. */
  134. QSettings *settings_;
  135. /**
  136. * The installer.
  137. */
  138. std::unique_ptr<class FF7DataInstaller> installer_;
  139. };