12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- #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);
- public slots:
- void TryToInitFunctionalModules();
- private:
- ErrorStatus CheckErrorStatus();
- private:
- LotroDatManager *lotro_dat_manager = nullptr;
- QThread *lotro_dat_manager_thread = nullptr;
- PatchList *patch_list = nullptr;
- MainWindow *gui = nullptr;
- QTimer try_to_init_functional_modules_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
|