mainwindow_moc.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. /*
  2. * mainwindow_moc.h, part of VCMI engine
  3. *
  4. * Authors: listed in file AUTHORS in main folder
  5. *
  6. * License: GNU General Public License v2.0 or later
  7. * Full text of license available in license.txt file, in main folder
  8. *
  9. */
  10. #pragma once
  11. #include <QMainWindow>
  12. #include <QStringList>
  13. #include <QTranslator>
  14. namespace Ui
  15. {
  16. class MainWindow;
  17. const QString teamName = "vcmi";
  18. const QString appName = "launcher";
  19. }
  20. class QTableWidgetItem;
  21. class CModList;
  22. class CModListView;
  23. enum class ETranslationStatus : int8_t
  24. {
  25. NOT_AVAILABLE, // translation for this language was not found in mod list. Could also happen if player is offline or disabled repository checkout
  26. NOT_INSTALLLED, // translation mod found, but it is not installed
  27. DISABLED, // translation mod found, and installed, but toggled off
  28. ACTIVE // translation mod active OR game is already in specified language (e.g. English H3 for players with English language)
  29. };
  30. class MainWindow : public QMainWindow
  31. {
  32. Q_OBJECT
  33. #ifdef ENABLE_QT_TRANSLATIONS
  34. QTranslator translator;
  35. #endif
  36. Ui::MainWindow * ui;
  37. void load();
  38. enum TabRows
  39. {
  40. MODS = 0,
  41. SETTINGS = 1,
  42. SETUP = 2,
  43. ABOUT = 3,
  44. START = 4,
  45. };
  46. public:
  47. explicit MainWindow(QWidget * parent = nullptr);
  48. ~MainWindow() override;
  49. CModListView * getModView();
  50. void updateTranslation();
  51. void computeSidePanelSizes();
  52. void detectPreferredLanguage();
  53. void enterSetup();
  54. void exitSetup(bool goToMods);
  55. void switchToModsTab();
  56. void switchToStartTab();
  57. void dragEnterEvent(QDragEnterEvent* event) override;
  58. void dropEvent(QDropEvent *event) override;
  59. void manualInstallFile(QString filePath);
  60. ETranslationStatus getTranslationStatus();
  61. protected:
  62. void changeEvent(QEvent * event) override;
  63. public slots:
  64. void on_startGameButton_clicked();
  65. private slots:
  66. void on_modslistButton_clicked();
  67. void on_settingsButton_clicked();
  68. void on_aboutButton_clicked();
  69. };