123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- #ifndef LEGACYAPPLICATION_H
- #define LEGACYAPPLICATION_H
- #include <QApplication>
- #include <QThread>
- #include <QTimer>
- class LotroDatManager;
- class PatchList;
- class MainWindow;
- class LegacyApplication : public QApplication
- {
- Q_OBJECT
- public:
- enum ErrorStatus : int {
- E_WRONG_GAME_FOLDER = 32,
- E_DAT_FILES_MISSING = 16,
- E_WRONG_FILE_PERMISSIONS = 8,
- E_CANNOT_ACCESS_DAT_FILES = 4,
- E_DAT_FILE_INCORRECT = 2,
- E_NO_SERVER_CONNECTION = 1,
- E_NO_ERRORS = 0
- };
- LegacyApplication(int &argc, char** argv);
- bool init();
- signals:
- void ErrorStatusChanged(ErrorStatus status);
- void SecondsToNextTryToInitChanged(size_t seconds_elapsed);
- private:
- void InitModules();
- ErrorStatus CheckErrorStatus();
- private slots:
- void HandleModulesInitTimer();
- private:
- LotroDatManager *lotro_dat_manager = nullptr;
- QThread *lotro_dat_manager_thread = nullptr;
- PatchList *patch_list = nullptr;
- MainWindow *gui = nullptr;
- QTimer modules_init_timer_;
- size_t seconds_after_previous_try_to_init_ = 10; // init value should be equal to try_to_init_timeout_
- const size_t try_to_init_timeout_ = 10;
- };
- QDebug operator<<(QDebug dbg, const LegacyApplication::ErrorStatus &status);
- #endif // LEGACYAPPLICATION_H
|