legacyapplication.h 930 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #ifndef LEGACYAPPLICATION_H
  2. #define LEGACYAPPLICATION_H
  3. #include <QThread>
  4. #include <QTimer>
  5. #include "utils.h"
  6. class LotroDatManager;
  7. class MainWindow;
  8. class LegacyApplication : public QObject
  9. {
  10. Q_OBJECT
  11. public:
  12. static LegacyApplication& instance() {
  13. static LegacyApplication instance;
  14. return instance;
  15. }
  16. ~LegacyApplication();
  17. private:
  18. LegacyApplication();
  19. public:
  20. bool init();
  21. signals:
  22. void ErrorStatusChanged(AppErrorStatus status);
  23. void SecondsToNextTryToInitChanged(size_t seconds_elapsed);
  24. private slots:
  25. void InitModules();
  26. private:
  27. MainWindow *gui = nullptr;
  28. QThread* patch_downloader_thread_;
  29. QThread* patch_installer_thread_;
  30. QTimer modules_init_timer_;
  31. size_t seconds_after_previous_try_to_init_ = 10; // init value should be equal to try_to_init_timeout_
  32. const size_t try_to_init_timeout_ = 10;
  33. };
  34. #endif // LEGACYAPPLICATION_H