Forráskód Böngészése

Some settings default values update

Ivan Arkhipov 5 éve
szülő
commit
f815c36dad

+ 0 - 115
src/Legacy/models/internallogicmanager.cpp

@@ -1,115 +0,0 @@
-#include "internallogicmanager.h"
-#include "widgets/mainwindow.h"
-
-
-InternalLogicManager::InternalLogicManager(MainWindow *gui_, QSettings *settings_, QObject *parent)
-{
-    qDebug() << "Creating patch downloader instance & thread";
-    patch_downloader_thread = new QThread();
-    patch_downloader = new PatchDownloader(settings);
-
-    lotro_manager_thread = new QThread();
-    lotro_manager = new LotroDatManager(settings);
-
-    connect(lotro_manager_thread, &QThread::finished, lotro_manager, &QObject::deleteLater, Qt::QueuedConnection);
-    connect(patch_downloader_thread, &QThread::finished, patch_downloader, &QObject::deleteLater, Qt::QueuedConnection);
-
-    patch_downloader->moveToThread(patch_downloader_thread);
-    lotro_manager->moveToThread(lotro_manager_thread);
-    lotro_manager_thread->start();
-    patch_downloader_thread->start();
-}
-
-InternalLogicManager::~InternalLogicManager()
-{
-    stopThreads();
-}
-
-void InternalLogicManager::startInitPipeline()
-{
-
-}
-
-void InternalLogicManager::startGame(QString locale)
-{
-
-}
-
-void InternalLogicManager::lotroSettingsUpdated()
-{
-
-}
-
-void InternalLogicManager::createLotroFilesBackup()
-{
-
-}
-
-void InternalLogicManager::removeLotroFilesBackup()
-{
-
-}
-
-void InternalLogicManager::applySelectedPatches()
-{
-
-}
-
-void InternalLogicManager::updateSettingsChanged()
-{
-
-}
-
-void InternalLogicManager::terminateThreads()
-{
-
-}
-
-void InternalLogicManager::stopThreads()
-{
-    lotro_manager_thread->quit();
-    patch_downloader_thread->quit();
-
-    lotro_manager_thread->wait();
-    patch_downloader_thread->wait();
-}
-
-void InternalLogicManager::checkFirstTimeOpening()
-{
-
-}
-
-void InternalLogicManager::checkGameFolderCorrectness()
-{
-
-}
-
-void InternalLogicManager::checkDatFilesExist()
-{
-
-}
-
-void InternalLogicManager::processLotroManagerInit()
-{
-
-}
-
-void InternalLogicManager::processPatchDownloaderInit()
-{
-
-}
-
-void InternalLogicManager::checkBackupExist()
-{
-
-}
-
-void InternalLogicManager::checkUserHasEnteredPatchOptions()
-{
-
-}
-
-void InternalLogicManager::checkDatFileWasPatched()
-{
-
-}

+ 0 - 108
src/Legacy/models/internallogicmanager.h

@@ -1,108 +0,0 @@
-#ifndef INTERNALLOGICMANAGER_H
-#define INTERNALLOGICMANAGER_H
-
-#include <QObject>
-#include <QSettings>
-#include <QThread>
-
-#include "models/patchdownloader.h"
-#include "models/lotrodatmanager.h"
-#include "models/filesystem.h"
-
-/*
-Stage 1 - check if user opened application for the first time - then we need to show
-          hello messages.
-
-Stage 2 - check if lotro folder is correct (there's file LotroLauncher.exe in it).
-          If no - then show him settings (ask to find lotro folder) where user can set it.
-
-Stage 3 - check if there are client_local_English.dat and client_general.dat files.
-          If no - then remove file and show message that we need to download them.
-
-Stage 4 - try to open client_local_English.dat and client_general.dat. If at least one of them
-          fails to open at all - show that there may be other processes taken ownage.
-
-Stage 5 - if .dat files are opened, but there was an error telling that file has incorrect version -
-          remove file and show message that we need to download them.
-
---- After this assuming that .dat files are correct and opened.
-
-Stage 6 - if user runs for the first time, then ask to create backup
-
-Stage 7 - check that user has chosen patches options. Otherwise move user to settings with enabled
-          position of choosing (this skips stage 8 and goes to st.9)
-
-Stage 8 - if user runs app for the first time - ask to download micropatches
-
-Stage 9 - if there are flags that patches already applied but this is not true with .dat - ask to
-          apply them once more
-
-Stage 10 - All settings are checked and set. If user is for the first time - show message "ready to begin"
-          Start check for updates. Start check for updates timer.
-*/
-
-class MainWindow;
-
-enum class APP_STATE {
-    NO_PROCESS,
-    SEMI_CRITICAL_PROCESS,
-    CRITICAL_PROCESS
-};
-
-class InternalLogicManager : public QObject
-{
-    Q_OBJECT
-public:
-    explicit InternalLogicManager(MainWindow *gui_, QSettings *settings_, QObject *parent = nullptr);
-    ~InternalLogicManager();
-
-signals:
-    void stateChanged(APP_STATE state);
-
-public slots:
-    void startInitPipeline();
-
-    // Actions from UI -> general window
-    void startGame(QString locale = "Original"); // Original/RU
-
-    // Actions from UI -> settings window
-    void lotroSettingsUpdated();
-    void createLotroFilesBackup();
-    void removeLotroFilesBackup();
-    void applySelectedPatches();
-    void updateSettingsChanged();
-    void terminateThreads();
-    void stopThreads();
-
-private slots:
-    void onLotroManagerStarted(QString, QVector<QVariant>);
-    void onLotroManagerFinished(QString, QVector<QVariant>);
-    void onLotroManagerErrorOccured(QString, QVector<QVariant>);
-    void onLotroManagerProgressChanged();
-
-private slots:
-    void checkFirstTimeOpening();
-    void checkGameFolderCorrectness();
-    void checkDatFilesExist();
-    void processLotroManagerInit();
-    void processPatchDownloaderInit(); // There begins also checkForUpdates cycle;
-    void checkBackupExist();
-    void checkUserHasEnteredPatchOptions();
-    void checkDatFileWasPatched();
-
-private:
-    PatchDownloader *patch_downloader;
-    QThread *patch_downloader_thread;
-
-    LotroDatManager *lotro_manager;
-    QThread *lotro_manager_thread;
-
-    QSettings *settings;
-    MainWindow *gui;
-
-    APP_STATE state;
-    size_t active_critical_process_count;
-    size_t active_non_critical_process_count;
-};
-
-#endif // INTERNALLOGICMANAGER_H

+ 3 - 29
src/Legacy/models/settings.h

@@ -11,6 +11,7 @@ static QMap<QString, QVariant> defaults = {
     {"General/UI_scale", "100"},
     {"General/CurrentInitStage", "0"},
     {"General/MicroUpdates", "Disabled"},
+    {"General/PatchDownloadDir", "data"},
 
     // Lotro Manager
     {"Lotro/game_path", "none"},
@@ -27,33 +28,6 @@ static QMap<QString, QVariant> defaults = {
     {"DatabaseDownload/font", "Disabled"},
     {"DatabaseDownload/video", "Disabled"},
 
-    // Databases applied status
-    {"DatabaseApplied/sound", "False"},
-    {"DatabaseApplied/text", "False"},
-    {"DatabaseApplied/image", "False"},
-    {"DatabaseApplied/loadscreen", "False"},
-    {"DatabaseApplied/texture", "False"},
-    {"DatabaseApplied/font", "False"},
-    {"DatabaseApplied/video", "False"},
-
-    // Databases downloaded paths
-    {"DatabasePath/sound", "none"},
-    {"DatabasePath/text", "none"},
-    {"DatabasePath/image", "none"},
-    {"DatabasePath/loadscreen", "none"},
-    {"DatabasePath/texture", "none"},
-    {"DatabasePath/font", "none"},
-    {"DatabasePath/video", "none"},
-
-    // Databases download date
-    {"DatabaseDownloadDate/sound", "none"},
-    {"DatabaseDownloadDate/text", "none"},
-    {"DatabaseDownloadDate/image", "none"},
-    {"DatabaseDownloadDate/loadscreen", "none"},
-    {"DatabaseDownloadDate/texture", "none"},
-    {"DatabaseDownloadDate/font", "none"},
-    {"DatabaseDownloadDate/video", "none"},
-
     // Localisation components
     {"Components/fonts", "Disabled"},
     {"Components/texts_main", "Disabled"},
@@ -73,7 +47,8 @@ static QMap<QString, QVariant> defaults = {
     {"Network/game_servers_status", "http://translate.lotros.ru/servers.txt"},
     {"Network/game_servers_message", "http://translate.lotros.ru/profmessage.txt"},
     {"Network/weekly_code_url", "http://translate.lotros.ru/coupon.txt"},
-    {"Network/news_list_url", "http://translate.lotros.ru/groupware/launcher_news/30/1"}
+    {"Network/news_list_url", "http://translate.lotros.ru/groupware/launcher_news/30/1"},
+    {"Network/patch_updates_url", "http://translate.lotros.ru/groupware/check_updates"}
 };
 
 static void setDefaultSettings()
@@ -85,7 +60,6 @@ static void setDefaultSettings()
 }
 
 static QVariant getValue(QString key) {
-    Q_ASSERT(defaults.contains(key)); // any required key should be pre-defined in defaults
     QSettings settings;
     return settings.value(key, defaults[key]);
 }