Browse Source

Legacy-advanced pre-release ver

Ivan Arkhipov 5 years ago
parent
commit
9b8db8540f
42 changed files with 1521 additions and 933 deletions
  1. 4 0
      .gitignore
  2. 4 3
      import/LotroDat/DatSubsystems/DatFileSystem.h
  3. 2 1
      import/LotroDat/DatSubsystems/DatIO.h
  4. 3 0
      import/LotroDat/DatSubsystems/DatLocaleManager.h
  5. 3 3
      import/LotroDat/Subfiles/TextSubFile.h
  6. 3 0
      src/Launcher/launcher_qml_plugin_import.cpp
  7. 3 3
      src/Legacy-advanced/Legacy-advanced.pro
  8. 1 1
      src/Legacy-advanced/Legacy-advanced_resource.rc
  9. 14 0
      src/Legacy-advanced/legacy-advanced_plugin_import.cpp
  10. 1 0
      src/Legacy-advanced/models/downloader.cpp
  11. 64 24
      src/Legacy-advanced/models/lotromanager.cpp
  12. 6 2
      src/Legacy-advanced/models/lotromanager.h
  13. 5 6
      src/Legacy-advanced/object_script.Legacy-advanced.Debug
  14. 5 6
      src/Legacy-advanced/object_script.Legacy-advanced.Release
  15. 108 3
      src/Legacy-advanced/widgets/browsewidget.cpp
  16. 12 5
      src/Legacy-advanced/widgets/browsewidget.h
  17. 300 46
      src/Legacy-advanced/widgets/browsewidget.ui
  18. 118 21
      src/Legacy-advanced/widgets/exportwidget.cpp
  19. 11 5
      src/Legacy-advanced/widgets/exportwidget.h
  20. 64 87
      src/Legacy-advanced/widgets/exportwidget.ui
  21. 90 7
      src/Legacy-advanced/widgets/importwidget.cpp
  22. 16 5
      src/Legacy-advanced/widgets/importwidget.h
  23. 233 323
      src/Legacy-advanced/widgets/importwidget.ui
  24. 0 114
      src/Legacy-advanced/widgets/lotroprocessdialog.cpp
  25. 0 38
      src/Legacy-advanced/widgets/lotroprocessdialog.h
  26. 70 0
      src/Legacy-advanced/widgets/lotroprogresswidget.cpp
  27. 31 0
      src/Legacy-advanced/widgets/lotroprogresswidget.h
  28. 141 0
      src/Legacy-advanced/widgets/lotroprogresswidget.ui
  29. 71 10
      src/Legacy-advanced/widgets/mainwindow.cpp
  30. 15 7
      src/Legacy-advanced/widgets/mainwindow.h
  31. 1 1
      src/Legacy-advanced/widgets/mainwindow.ui
  32. 75 25
      src/Legacy-advanced/widgets/managewidget.cpp
  33. 15 3
      src/Legacy-advanced/widgets/managewidget.h
  34. 22 13
      src/Legacy-advanced/widgets/managewidget.ui
  35. 4 76
      src/Legacy-advanced/widgets/messagedialog.cpp
  36. 1 5
      src/Legacy-advanced/widgets/messagedialog.h
  37. 0 89
      src/Legacy-advanced/widgets/processdialog.ui
  38. 1 1
      src/Legacy/Legacy_resource.rc
  39. 1 0
      src/Legacy/gui/rusificationwidget.cpp
  40. 1 0
      src/Legacy/object_script.Legacy.Debug
  41. 1 0
      src/Legacy/object_script.Legacy.Release
  42. 1 0
      src/Legacy/src/networkdownloader.cpp

+ 4 - 0
.gitignore

@@ -66,8 +66,12 @@ Makefile*
 build/*
 bin/*
 
+*resource*
+
 !*README*
 
+
+
 # QtCreator
 
 *.autosave

+ 4 - 3
import/LotroDat/DatSubsystems/DatFileSystem.h

@@ -64,14 +64,13 @@ namespace LOTRO_DAT {
 
         DatOperationResult<> PerformOperationOnAllFiles(const std::function<void (std::shared_ptr<SubFile>&)>& function);
 
-    private:
+        DatOperationResult<> CommitDirectories();
 
+    private:
         DatOperationResult<> InitSubFile(long long file_id);
 
         DatOperationResult<> InitSubDirectory(SubDirectory dir);
 
-        DatOperationResult<> CommitDirectories();
-
     private:
         DatFile *dat;
         std::set<long long> subfile_pending_update;
@@ -84,6 +83,8 @@ namespace LOTRO_DAT {
         std::set<SubDirectory, SubDirectory::SubDirectoryOffsetComparator> subdir_init_queue_;
         std::unordered_map<long long, SubFile> subfile_init_map_;
         std::set<SubFile, SubFile::SubFileOffsetComparator> subfile_init_queue_;
+    public:
+        long long patched_file_end;
     };
 }
 };

+ 2 - 1
import/LotroDat/DatSubsystems/DatIO.h

@@ -50,6 +50,7 @@ namespace LOTRO_DAT {
 
         DatOperationResult<> DeInit();
 
+        unsigned int getHeaderHash();
     private:
 
         //------------------------------------------------//
@@ -80,6 +81,7 @@ namespace LOTRO_DAT {
         std::string filename_;
 
     public:
+        /// Header values
         long long constant1;
         long long constant2;
         long long file_size;
@@ -93,7 +95,6 @@ namespace LOTRO_DAT {
 
     private:
         long long actual_dat_size_;
-        long long elapsed_eof_buffer_;
         const unsigned MAX_EOF_BUFFER = 15 * 1024 * 1024; /// Maximal size of buffer, which is written to the end of dat file to improve write speed of small fragments
     };
 }

+ 3 - 0
import/LotroDat/DatSubsystems/DatLocaleManager.h

@@ -51,6 +51,8 @@ namespace LOTRO_DAT {
 
         DatOperationResult<> DeInit();
 
+        DatOperationResult<> CommitLocales();
+
         LOCALE GetCurrentLocale();
 
         bool CheckLocaleCorrect();
@@ -66,6 +68,7 @@ namespace LOTRO_DAT {
         void UpdateCategory(long long file_id, long long category);
 
         const std::set<long long>& GetInactiveCategories();
+
     private:
         std::map<long long, SubFile> &GetLocaleDictReference(LOCALE locale);
 

+ 3 - 3
import/LotroDat/Subfiles/TextSubFile.h

@@ -5,9 +5,9 @@
 #ifndef LOTRO_DAT_LIBRARY_TEXTSUBFILE_H
 #define LOTRO_DAT_LIBRARY_TEXTSUBFILE_H
 
-#include "SubFile.h"
-#include "SubfileData.h"
-#include "BinaryData.h"
+#include "../SubFile.h"
+#include "../SubfileData.h"
+#include "../BinaryData.h"
 
 #include <vector>
 #include <unordered_map>

+ 3 - 0
src/Launcher/launcher_qml_plugin_import.cpp

@@ -3,3 +3,6 @@
 #include <QtPlugin>
 Q_IMPORT_PLUGIN(QtQuick2Plugin)
 Q_IMPORT_PLUGIN(QtQuick2WindowPlugin)
+Q_IMPORT_PLUGIN(QtQuickControls1Plugin)
+Q_IMPORT_PLUGIN(QtQuickExtrasPlugin)
+Q_IMPORT_PLUGIN(QtQuickLayoutsPlugin)

+ 3 - 3
src/Legacy-advanced/Legacy-advanced.pro

@@ -37,7 +37,7 @@ SOURCES += \
     widgets\managewidget.cpp \
     widgets\menuentry.cpp \
     widgets\messagedialog.cpp \
-    widgets\lotroprocessdialog.cpp
+    widgets\lotroprogresswidget.cpp
 
 HEADERS += \
     models\downloader.h \
@@ -50,7 +50,7 @@ HEADERS += \
     widgets\managewidget.h \
     widgets\menuentry.h \
     widgets\messagedialog.h \
-    widgets\lotroprocessdialog.h
+    widgets\lotroprogresswidget.h
 
 FORMS += \
     widgets\browsewidget.ui \
@@ -59,7 +59,7 @@ FORMS += \
     widgets\mainwindow.ui \
     widgets\managewidget.ui \
     widgets\messagedialog.ui \
-    widgets\lotroprocessdialog.ui
+    widgets\lotroprogresswidget.ui
 
 RESOURCES += \
     resources\backgrounds.qrc \

+ 1 - 1
src/Legacy-advanced/Legacy-advanced_resource.rc

@@ -12,7 +12,7 @@ VS_VERSION_INFO VERSIONINFO
 	FILEFLAGS 0x0L
 #endif
 	FILEOS VOS__WINDOWS32
-	FILETYPE VFT_DLL
+	FILETYPE VFT_APP
 	FILESUBTYPE 0x0L
 	BEGIN
 		BLOCK "StringFileInfo"

+ 14 - 0
src/Legacy-advanced/legacy-advanced_plugin_import.cpp

@@ -0,0 +1,14 @@
+// This file is autogenerated by qmake. It imports static plugin classes for
+// static plugins specified using QTPLUGIN and QT_PLUGIN_CLASS.<plugin> variables.
+#include <QtPlugin>
+Q_IMPORT_PLUGIN(QWindowsVistaStylePlugin)
+Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin)
+Q_IMPORT_PLUGIN(QGifPlugin)
+Q_IMPORT_PLUGIN(QICNSPlugin)
+Q_IMPORT_PLUGIN(QICOPlugin)
+Q_IMPORT_PLUGIN(QJpegPlugin)
+Q_IMPORT_PLUGIN(QTgaPlugin)
+Q_IMPORT_PLUGIN(QTiffPlugin)
+Q_IMPORT_PLUGIN(QWbmpPlugin)
+Q_IMPORT_PLUGIN(QWebpPlugin)
+Q_IMPORT_PLUGIN(QGenericEnginePlugin)

+ 1 - 0
src/Legacy-advanced/models/downloader.cpp

@@ -1,6 +1,7 @@
 #include "downloader.h"
 #include <QEventLoop>
 #include <QApplication>
+#include <QDebug>
 
 Downloader::Downloader(QObject *parent) :QObject(parent), busy(false)
 {

+ 64 - 24
src/Legacy-advanced/models/lotromanager.cpp

@@ -1,5 +1,6 @@
 #include "lotromanager.h"
 #include "filesystem.h"
+#include "LotroDat/Subfiles/TextSubFile.h"
 
 #include <QtConcurrent/QtConcurrent>
 #include <QFontDatabase>
@@ -9,8 +10,14 @@
 #include <iostream>
 #include <fstream>
 
+Q_DECLARE_METATYPE(LOTRO_DAT::FILE_TYPE)
+Q_DECLARE_METATYPE(LOTRO_DAT::SubfileData)
+
 LotroManager::LotroManager(QSettings* app_settings_, QObject *parent) :
     QObject(parent), app_settings(app_settings_) {
+
+    qRegisterMetaType<LOTRO_DAT::FILE_TYPE>();
+    qRegisterMetaType<LOTRO_DAT::SubfileData>();
 }
 
 void LotroManager::initialiseDatFile(QString file_path) {
@@ -20,11 +27,20 @@ void LotroManager::initialiseDatFile(QString file_path) {
 
     if (!FileSystem::fileExists(file_path)) {
         emit caughtError(QString("initialiseDatFile"), {QString("Ошибка инициализации"), QString("Файл " + file_path + " несуществует! Невозможно инициализировать файл ресурсов.")});
+        emit processFinished("initialiseDatFile", {QString("Error"), file_path});
         return;
     }
 
     file.Initialise((file_path).toStdString(), 0);
-    emit processFinished("initialiseDatFile", {QString("Success")});
+    emit processFinished("initialiseDatFile", {QString("Success"), file_path});
+}
+
+void LotroManager::deinitialiseDatFile()
+{
+    emit processStarted("deintialiseDatFile", {});
+    qDebug() << "Deinitialising file...";
+    file.Deinitialize();
+    emit processFinished("deinitialiseDatFile", {});
 }
 
 void LotroManager::changeLocale() {
@@ -54,28 +70,43 @@ void LotroManager::changeLocale() {
 }
 
 void LotroManager::getLocaleFileContents(long long file_id, int locale) {
-    emit processStarted("getFileContents", {file_id, locale});
+    emit processStarted("getLocaleFileContents", {file_id, locale});
 
     auto getfile_op = file.GetLocaleManager().GetLocaleFile(file_id, (LOTRO_DAT::DatLocaleManager::LOCALE)locale);
     if (!getfile_op.result) {
-        emit caughtError("getFileContents", {"Файл не найден!", QString("Не удаётся найти файл с id ") + QString::number(file_id)});
-        emit processFinished("getFileContents", {"Error"});
+        emit caughtError("getLocaleFileContents", {"Файл не найден!", QString("Не удаётся найти файл с id ") + QString::number(file_id)});
+        emit processFinished("getLocaleFileContents", {"Error"});
         return;
     }
 
     LOTRO_DAT::SubFile subfile = getfile_op.value;
 
+    auto getrealfile_op = file.GetFileSystem().GetFile(file_id);
+    if (!getfile_op.result) {
+        emit caughtError("getLocaleFileContents", {"Файл не найден!", QString("Не удаётся найти в словаре файл с id ") + QString::number(file_id)});
+        emit processFinished("getLocaleFileContents", {"Error"});
+        return;
+    }
+
+    if (getrealfile_op.value->FileType() != LOTRO_DAT::TEXT) {
+        emit caughtError("getLocaleFileContents", {"Некорректный формат!", QString("Получение данных локали доступно только для текстовых файлов!")});
+        emit processFinished("getLocaleFileContents", {"Error"});
+        return;
+    }
+
+    LOTRO_DAT::TextSubFile text_subfile(subfile);
+
     auto getfiledata_op = file.GetFileSystem().GetFileData(subfile, 8);
 
     if (getfile_op.result == LOTRO_DAT::ERROR) {
-        emit caughtError("getFileContents", {"Ошибка извлечения!", QString("Обнаружены некорректные данные файла в словаре! Файл ресурсов мог быть повреждён!\nid = ") + QString::number(file_id) + ", locale_id = " + QString::number(locale)});
-        emit processFinished("getFileContents", {"Error"});
+        emit caughtError("getLocaleFileContents", {"Ошибка извлечения!", QString("Обнаружены некорректные данные файла в словаре! Файл ресурсов мог быть повреждён!\nid = ") + QString::number(file_id) + ", locale_id = " + QString::number(locale)});
+        emit processFinished("getLocaleFileContents", {"Error"});
         return;
     }
 
-    LOTRO_DAT::SubfileData result = subfile.PrepareForExport(getfiledata_op.value);
+    LOTRO_DAT::SubfileData result = text_subfile.PrepareForExport(getfiledata_op.value);
     emit localeFileContentsReceived(locale, result);
-    emit processFinished("getFileContents", {"Success", file_id, locale});
+    emit processFinished("getLocaleFileContents", {"Success", file_id, locale});
 }
 
 void LotroManager::importFilesFromDatabase(QString database_path) {
@@ -97,6 +128,8 @@ void LotroManager::importFilesFromDatabase(QString database_path) {
     auto patch_operation = file.GetPatcher().PatchAllDatabase(&db);
 
     if (patch_operation.result == LOTRO_DAT::SUCCESS) {
+        file.GetFileSystem().CommitDirectories();
+        file.GetLocaleManager().CommitLocales();
         emit processFinished("importFilesFromDatabase", {QString("Success"), patch_operation.value});
     } else {
         emit processFinished("importFilesFromDatabase", {QString("Error"), 0});
@@ -158,6 +191,8 @@ void LotroManager::importFile(long long file_id, QString file_path) {
     auto patchfile_op = file.GetPatcher().PatchFile(data);
 
     if (patchfile_op.result == LOTRO_DAT::SUCCESS) {
+        file.GetFileSystem().CommitDirectories();
+        file.GetLocaleManager().CommitLocales();
         emit processFinished("importFile", {QString("Success")});
     } else {
         emit caughtError("importFile", {QString("Ошибка импорта!"), QString("Возникла внутренняя ошибка применения патча. Импорт завершился с ошибкой")});
@@ -170,8 +205,8 @@ void LotroManager::importTextFragment(long long file_id, long long fragment_id,
                                QString fragment_contents, QString arguments) {
     emit processStarted("importTextFragment", {file_id, fragment_id});
 
-    if (fragment_contents.contains("DO_NOT_TOUCH")) {
-        emit caughtError("importTextFragment", {"Ошибка формата!", QString("Текстовые данные содержат указатели на аргументы DO_NOT_TOUCH! Такого быть не должно! Пользуйтесь порядком перечисления аргументов внизу")});
+    if (fragment_contents.contains("DO_NOT_TOUCH-1!")) {
+        emit caughtError("importTextFragment", {"Ошибка формата!", QString("Текстовые данные содержат указатели на аргументы DO_NOT_TOUCH! с встроенным указанием порядка аргументов (как на сайте) Такого быть не должно! Пользуйтесь порядком перечисления аргументов внизу")});
         emit processFinished("importTextFragment", {"Error"});
         return;
     }
@@ -183,9 +218,9 @@ void LotroManager::importTextFragment(long long file_id, long long fragment_id,
         return;
     }
 
-    LOTRO_DAT::SubFile subfile = *getfile_op.value;
+    auto subfile = getfile_op.value;
 
-    auto getfiledata_op = file.GetFileSystem().GetFileData(subfile, 8);
+    auto getfiledata_op = file.GetFileSystem().GetFileData(*subfile, 8);
 
     if (getfile_op.result == LOTRO_DAT::ERROR) {
         emit caughtError("importTextFragment", {"Ошибка импорта!", QString("Обнаружены некорректные данные файла в словаре! Файл ресурсов мог быть повреждён!\nid = ") + QString::number(file_id)});
@@ -193,7 +228,7 @@ void LotroManager::importTextFragment(long long file_id, long long fragment_id,
         return;
     }
 
-    LOTRO_DAT::SubfileData data = subfile.PrepareForExport(getfiledata_op.value);
+    LOTRO_DAT::SubfileData data = subfile->PrepareForExport(getfiledata_op.value);
     if (data.Empty()) {
         emit caughtError("importTextFragment", {"Ошибка импорта!", QString("Не удалось подготовить файл к изменению фрагмента!\nid = ") + QString::number(file_id)});
         emit processFinished("importTextFragment", {"Error"});
@@ -216,6 +251,8 @@ void LotroManager::importTextFragment(long long file_id, long long fragment_id,
     auto patchfile_op = file.GetPatcher().PatchFile(data);
 
     if (patchfile_op.result == LOTRO_DAT::SUCCESS) {
+        file.GetFileSystem().CommitDirectories();
+        file.GetLocaleManager().CommitLocales();
         emit processFinished("importTextFragment", {QString("Success")});
     } else {
         emit caughtError("importTextFragment", {QString("Ошибка импорта!"), QString("Возникла внутренняя ошибка применения патча. Импорт завершился с ошибкой")});
@@ -233,9 +270,9 @@ void LotroManager::getTextFragment(long long file_id, long long fragment_id) {
         return;
     }
 
-    LOTRO_DAT::SubFile subfile = *getfile_op.value;
+    auto subfile = getfile_op.value;
 
-    auto getfiledata_op = file.GetFileSystem().GetFileData(subfile, 8);
+    auto getfiledata_op = file.GetFileSystem().GetFileData(*subfile, 8);
 
     if (getfile_op.result == LOTRO_DAT::ERROR) {
         emit caughtError("getTextFragment", {"Ошибка импорта!", QString("Обнаружены некорректные данные файла в словаре! Файл ресурсов мог быть повреждён!\nid = ") + QString::number(file_id)});
@@ -243,7 +280,7 @@ void LotroManager::getTextFragment(long long file_id, long long fragment_id) {
         return;
     }
 
-    LOTRO_DAT::SubfileData data = subfile.PrepareForExport(getfiledata_op.value);
+    LOTRO_DAT::SubfileData data = subfile->PrepareForExport(getfiledata_op.value);
     if (data.Empty()) {
         emit caughtError("getTextFragment", {"Ошибка импорта!", QString("Не удалось подготовить файл к изменению фрагмента!\nid = ") + QString::number(file_id)});
         emit processFinished("getTextFragment", {"Error"});
@@ -252,8 +289,8 @@ void LotroManager::getTextFragment(long long file_id, long long fragment_id) {
 
     unsigned beginning = data.text_data.find(QString::number(fragment_id).toStdU16String(), 0);
     if (beginning == std::u16string::npos) {
-        emit caughtError("importTextFragment", {"Ошибка импорта!", QString("Не удалось найти фрагмент в файле!\nid = ") + QString::number(file_id) + "\nfragment_id = " + QString::number(fragment_id)});
-        emit processFinished("importTextFragment", {"Error"});
+        emit caughtError("getTextFragment", {"Ошибка импорта!", QString("Не удалось найти фрагмент в файле!\nid = ") + QString::number(file_id) + "\nfragment_id = " + QString::number(fragment_id)});
+        emit processFinished("getTextFragment", {"Error"});
         return;
     }
 
@@ -268,13 +305,13 @@ void LotroManager::getTextFragment(long long file_id, long long fragment_id) {
 
     QStringList splitted_fragment = QString::fromStdU16String(str).split(":::");
     if (splitted_fragment.size() != 3) {
-        emit caughtError("importTextFragment", {"Ошибка импорта!", QString("Получены некорректные данные фрагмента!\nДанные:") + QString::fromStdU16String(str)});
-        emit processFinished("importTextFragment", {"Error"});
+        emit caughtError("getTextFragment", {"Ошибка импорта!", QString("Получены некорректные данные фрагмента!\nДанные:") + QString::fromStdU16String(str)});
+        emit processFinished("getTextFragment", {"Error"});
         return;
     }
 
     emit textFragmentReceived(splitted_fragment.at(1), splitted_fragment.at(2));
-    emit processFinished("importTextFragment", {"Success"});
+    emit processFinished("getTextFragment", {"Success"});
 }
 
 void LotroManager::createCoreStatusFile(QString output_filename) {
@@ -397,7 +434,6 @@ void LotroManager::startGame() {
     }
 }
 
-
 void LotroManager::getLocaleFileInfo(long long file_id, int locale) {
     emit processStarted("getLocaleFileInfo", {file_id, locale});
 
@@ -422,7 +458,7 @@ void LotroManager::getLocaleFileInfo(long long file_id, int locale) {
                      "unknown2: " + QString::number(subfile.file_id()) + "\n"
                      "category: " + QString::number(subfile.category) + "\n";
 
-    emit localeFileInfoReceived(result);
+    emit localeFileInfoReceived(locale, result);
     emit processFinished("getLocaleFileInfo", {"Success"});
 }
 
@@ -449,10 +485,14 @@ void LotroManager::getFileInfo(long long file_id) {
                      "block_size: " + QString::number(subfile.block_size()) + "\n"
                      "unknown2: " + QString::number(subfile.file_id()) + "\n";
 
-    emit localeFileInfoReceived(result);
+    emit fileInfoReceived(result);
     emit processFinished("getFileInfo", {"Success"});
 }
 
+LOTRO_DAT::DatStatus *LotroManager::getStatusModule()
+{
+    return &file.GetStatusModule();
+}
 
 bool LotroManager::initialised() {
     return file.Initialized();

+ 6 - 2
src/Legacy-advanced/models/lotromanager.h

@@ -23,6 +23,8 @@ public:
 public slots:
     void initialiseDatFile(QString file_path);
 
+    void deinitialiseDatFile();
+
     void changeLocale();
 
     void getLocaleFileContents(long long file_id, int locale);
@@ -53,6 +55,8 @@ public slots:
 
     void getFileInfo(long long file_id);
 
+    LOTRO_DAT::DatStatus *getStatusModule();
+
 signals:
     // general signals. First argument is process_name, second - processed values
     void processStarted(QString, QVector<QVariant>);
@@ -63,8 +67,8 @@ signals:
     void textFragmentReceived(QString, QString);
     void unactiveCategoriesReceived(QStringList);
     void localeFileContentsReceived(int, LOTRO_DAT::SubfileData); // extention, contents
-    void localeFileInfoReceived(QString);
-
+    void localeFileInfoReceived(int, QString);
+    void fileInfoReceived(QString);
 private:
     LOTRO_DAT::DatFile file;
     QSettings* app_settings;

+ 5 - 6
src/Legacy-advanced/object_script.Legacy-advanced.Debug

@@ -4,7 +4,7 @@ INPUT(
 ./..\..\build\debug\Legacy-advanced\obj\main.o
 ./..\..\build\debug\Legacy-advanced\obj\downloader.o
 ./..\..\build\debug\Legacy-advanced\obj\filesystem.o
-./..\..\build\debug\Legacy-advanced\obj\lotro.o
+./..\..\build\debug\Legacy-advanced\obj\lotromanager.o
 ./..\..\build\debug\Legacy-advanced\obj\browsewidget.o
 ./..\..\build\debug\Legacy-advanced\obj\exportwidget.o
 ./..\..\build\debug\Legacy-advanced\obj\importwidget.o
@@ -12,11 +12,11 @@ INPUT(
 ./..\..\build\debug\Legacy-advanced\obj\managewidget.o
 ./..\..\build\debug\Legacy-advanced\obj\menuentry.o
 ./..\..\build\debug\Legacy-advanced\obj\messagedialog.o
-./..\..\build\debug\Legacy-advanced\obj\processdialog.o
-./..\..\build\debug\Legacy-advanced\obj\statuswidget.o
+./..\..\build\debug\Legacy-advanced\obj\lotroprogresswidget.o
+./..\..\build\debug\Legacy-advanced\obj\legacy-advanced_plugin_import.o
 ./..\..\build\debug\Legacy-advanced\obj\moc_downloader.o
 ./..\..\build\debug\Legacy-advanced\obj\moc_filesystem.o
-./..\..\build\debug\Legacy-advanced\obj\moc_lotro.o
+./..\..\build\debug\Legacy-advanced\obj\moc_lotromanager.o
 ./..\..\build\debug\Legacy-advanced\obj\moc_browsewidget.o
 ./..\..\build\debug\Legacy-advanced\obj\moc_exportwidget.o
 ./..\..\build\debug\Legacy-advanced\obj\moc_importwidget.o
@@ -24,6 +24,5 @@ INPUT(
 ./..\..\build\debug\Legacy-advanced\obj\moc_managewidget.o
 ./..\..\build\debug\Legacy-advanced\obj\moc_menuentry.o
 ./..\..\build\debug\Legacy-advanced\obj\moc_messagedialog.o
-./..\..\build\debug\Legacy-advanced\obj\moc_processdialog.o
-./..\..\build\debug\Legacy-advanced\obj\moc_statuswidget.o
+./..\..\build\debug\Legacy-advanced\obj\moc_lotroprogresswidget.o
 );

+ 5 - 6
src/Legacy-advanced/object_script.Legacy-advanced.Release

@@ -4,7 +4,7 @@ INPUT(
 ./..\..\build\release\Legacy-advanced\obj\main.o
 ./..\..\build\release\Legacy-advanced\obj\downloader.o
 ./..\..\build\release\Legacy-advanced\obj\filesystem.o
-./..\..\build\release\Legacy-advanced\obj\lotro.o
+./..\..\build\release\Legacy-advanced\obj\lotromanager.o
 ./..\..\build\release\Legacy-advanced\obj\browsewidget.o
 ./..\..\build\release\Legacy-advanced\obj\exportwidget.o
 ./..\..\build\release\Legacy-advanced\obj\importwidget.o
@@ -12,11 +12,11 @@ INPUT(
 ./..\..\build\release\Legacy-advanced\obj\managewidget.o
 ./..\..\build\release\Legacy-advanced\obj\menuentry.o
 ./..\..\build\release\Legacy-advanced\obj\messagedialog.o
-./..\..\build\release\Legacy-advanced\obj\processdialog.o
-./..\..\build\release\Legacy-advanced\obj\statuswidget.o
+./..\..\build\release\Legacy-advanced\obj\lotroprogresswidget.o
+./..\..\build\release\Legacy-advanced\obj\legacy-advanced_plugin_import.o
 ./..\..\build\release\Legacy-advanced\obj\moc_downloader.o
 ./..\..\build\release\Legacy-advanced\obj\moc_filesystem.o
-./..\..\build\release\Legacy-advanced\obj\moc_lotro.o
+./..\..\build\release\Legacy-advanced\obj\moc_lotromanager.o
 ./..\..\build\release\Legacy-advanced\obj\moc_browsewidget.o
 ./..\..\build\release\Legacy-advanced\obj\moc_exportwidget.o
 ./..\..\build\release\Legacy-advanced\obj\moc_importwidget.o
@@ -24,6 +24,5 @@ INPUT(
 ./..\..\build\release\Legacy-advanced\obj\moc_managewidget.o
 ./..\..\build\release\Legacy-advanced\obj\moc_menuentry.o
 ./..\..\build\release\Legacy-advanced\obj\moc_messagedialog.o
-./..\..\build\release\Legacy-advanced\obj\moc_processdialog.o
-./..\..\build\release\Legacy-advanced\obj\moc_statuswidget.o
+./..\..\build\release\Legacy-advanced\obj\moc_lotroprogresswidget.o
 );

+ 108 - 3
src/Legacy-advanced/widgets/browsewidget.cpp

@@ -1,15 +1,120 @@
 #include "browsewidget.h"
 #include "ui_browsewidget.h"
-#include "legacyapp.h"
+#include "models/lotromanager.h"
+#include <QMessageBox>
 
-BrowseWidget::BrowseWidget(LegacyApp *_app, QWidget *parent) :
-    QWidget(parent), app(_app),
+BrowseWidget::BrowseWidget(LotroManager* mgr, QSettings* settings, QWidget *parent) :
+    QWidget(parent), lotro_manager(mgr), settings(settings),
     ui(new Ui::BrowseWidget)
 {
     ui->setupUi(this);
+    //void localeFileInfoReceived(QString);
+    connect(lotro_manager, &LotroManager::localeFileContentsReceived, this, &BrowseWidget::onLotroLocaleFileContentsReceived);
+    connect(lotro_manager, &LotroManager::localeFileInfoReceived, this, &BrowseWidget::onLotroLocaleFileInfoReceived);
+    resize(parent->size());
 }
 
 BrowseWidget::~BrowseWidget()
 {
     delete ui;
 }
+
+void BrowseWidget::on_find_button_common_clicked()
+{
+    if (ui->file_id_common->text().toLongLong() == 0) {
+        QMessageBox::warning(this->parentWidget(), "Не указан ID файла!", "Укажите, пожалуйста, корректный (числовой) ID текстового файла!");
+        return;
+    }
+
+
+    QMetaObject::invokeMethod(lotro_manager, "getLocaleFileContents", Qt::QueuedConnection,
+                              Q_ARG(long long, ui->file_id_common->text().toLongLong()),
+                              Q_ARG(int, LOTRO_DAT::DatLocaleManager::PATCHED)
+                              );
+
+
+    QMetaObject::invokeMethod(lotro_manager, "getLocaleFileContents", Qt::QueuedConnection,
+                              Q_ARG(long long, ui->file_id_common->text().toLongLong()),
+                              Q_ARG(int, LOTRO_DAT::DatLocaleManager::ORIGINAL)
+                              );
+}
+
+void BrowseWidget::onLotroLocaleFileContentsReceived(int locale, LOTRO_DAT::SubfileData data)
+{
+    //void localeFileContentsReceived(int, LOTRO_DAT::SubfileData); // extention, contents
+    //void localeFileInfoReceived(QString);
+
+    QLabel* target_contents;
+    QLineEdit* target_args;
+    if (locale == LOTRO_DAT::DatLocaleManager::PATCHED) {
+        target_args = ui->patched_args_common;
+        target_contents = ui->patched_content_common;
+    } else {
+        target_args = ui->original_args_common;
+        target_contents = ui->original_content_common;
+    }
+
+    if (ui->fragment_id_common->text().toLongLong() == 0) {
+        target_contents->setText(QString::fromStdU16String(data.text_data));
+        target_args->clear();
+        return;
+    }
+
+    long long fragment_id = ui->fragment_id_common->text().toLongLong();
+
+    unsigned beginning = data.text_data.find(QString::number(fragment_id).toStdU16String(), 0);
+    if (beginning == std::u16string::npos) {
+        QMessageBox::warning(this->parentWidget(), "Фрагмент не найден!", "Не удалось найти в файле фрагмент с заданным ID!");
+        return;
+    }
+
+    unsigned ending = data.text_data.find(QString("|||").toStdU16String(), beginning);
+
+    unsigned size = std::u16string::npos;
+
+    if (ending != std::u16string::npos)
+        size = ending - beginning;
+
+    std::u16string str = data.text_data.substr(beginning, size);
+
+    QStringList splitted_fragment = QString::fromStdU16String(str).split(":::");
+    if (splitted_fragment.size() != 3) {
+        QMessageBox::warning(this->parentWidget(), "Ошибка импорта!", QString("Получены некорректные данные фрагмента! Будет выведен весь файл!"));
+        target_contents->setText(QString::fromStdU16String(str));
+        target_args->clear();
+        return;
+    }
+
+    target_args->setText(splitted_fragment.at(1));
+    target_contents->setText(splitted_fragment.at(2));
+    return;
+}
+
+void BrowseWidget::onLotroLocaleFileInfoReceived(int locale, QString info)
+{
+    QLabel* target_contents;
+    QLineEdit* target_args;
+    if (locale == LOTRO_DAT::DatLocaleManager::PATCHED) {
+        target_args = ui->patched_args_common;
+        target_contents = ui->patched_content_common;
+    } else {
+        target_args = ui->original_args_common;
+        target_contents = ui->original_content_common;
+    }
+
+    target_args->clear();
+    target_contents->setText(info);
+}
+
+void BrowseWidget::on_getFileInfoButton_common_clicked()
+{
+    QMetaObject::invokeMethod(lotro_manager, "getLocaleFileInfo", Qt::QueuedConnection,
+                              Q_ARG(long long, ui->file_id_common->text().toLongLong()),
+                              Q_ARG(int, LOTRO_DAT::DatLocaleManager::ORIGINAL)
+                              );
+
+    QMetaObject::invokeMethod(lotro_manager, "getLocaleFileInfo", Qt::QueuedConnection,
+                              Q_ARG(long long, ui->file_id_common->text().toLongLong()),
+                              Q_ARG(int, LOTRO_DAT::DatLocaleManager::PATCHED)
+                              );
+}

+ 12 - 5
src/Legacy-advanced/widgets/browsewidget.h

@@ -2,25 +2,32 @@
 #define BROWSEWIDGET_H
 
 #include <QWidget>
+#include <QSettings>
+#include <models/lotromanager.h>
 
 namespace Ui {
 class BrowseWidget;
 }
 
-class LegacyApp;
-
 class BrowseWidget : public QWidget
 {
     Q_OBJECT
 
 public:
-    explicit BrowseWidget(LegacyApp *_app, QWidget *parent = 0);
+    explicit BrowseWidget(LotroManager* mgr, QSettings* settings, QWidget *parent = 0);
     ~BrowseWidget();
 
+private slots:
+    void on_find_button_common_clicked();
+    void on_getFileInfoButton_common_clicked();
+
+    void onLotroLocaleFileContentsReceived(int, LOTRO_DAT::SubfileData);
+    void onLotroLocaleFileInfoReceived(int, QString);
+
 private:
-    LegacyApp *app;
+    LotroManager* lotro_manager;
+    QSettings* settings;
     Ui::BrowseWidget *ui;
-
 };
 
 #endif // BROWSEWIDGET_H

+ 300 - 46
src/Legacy-advanced/widgets/browsewidget.ui

@@ -6,8 +6,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>1000</width>
-    <height>564</height>
+    <width>597</width>
+    <height>506</height>
    </rect>
   </property>
   <property name="windowTitle">
@@ -19,20 +19,275 @@
 }</string>
   </property>
   <layout class="QGridLayout" name="gridLayout">
-   <item row="0" column="0" colspan="2">
-    <widget class="QWidget" name="file_info_widget" native="true">
+   <item row="3" column="0">
+    <widget class="QWidget" name="original_contents_widget" native="true">
      <property name="sizePolicy">
-      <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+      <sizepolicy hsizetype="Preferred" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="styleSheet">
+      <string notr="true">QWidget#original_contents_widget{
+border-radius: 20px;
+background-color: rgba(30, 0, 0, 100);
+}</string>
+     </property>
+     <layout class="QVBoxLayout" name="verticalLayout_8">
+      <item>
+       <widget class="QLabel" name="original_label_title">
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
+        <property name="text">
+         <string>Оригинальная версия</string>
+        </property>
+        <property name="alignment">
+         <set>Qt::AlignCenter</set>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <widget class="QWidget" name="original_contents_widget_2" native="true">
+        <property name="styleSheet">
+         <string notr="true"/>
+        </property>
+        <layout class="QVBoxLayout" name="verticalLayout_2">
+         <item>
+          <widget class="QLabel" name="label_26_common">
+           <property name="sizePolicy">
+            <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+           </property>
+           <property name="text">
+            <string>Текст:</string>
+           </property>
+           <property name="alignment">
+            <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QLabel" name="original_content_common">
+           <property name="minimumSize">
+            <size>
+             <width>0</width>
+             <height>0</height>
+            </size>
+           </property>
+           <property name="text">
+            <string>...</string>
+           </property>
+           <property name="alignment">
+            <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
+           </property>
+           <property name="wordWrap">
+            <bool>true</bool>
+           </property>
+           <property name="textInteractionFlags">
+            <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
+           </property>
+          </widget>
+         </item>
+        </layout>
+       </widget>
+      </item>
+      <item>
+       <widget class="QWidget" name="original_contents_widget_3" native="true">
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
+        <property name="styleSheet">
+         <string notr="true"/>
+        </property>
+        <layout class="QHBoxLayout" name="horizontalLayout_2">
+         <item>
+          <widget class="QLabel" name="label_27_common">
+           <property name="sizePolicy">
+            <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+           </property>
+           <property name="text">
+            <string>Аргументы:</string>
+           </property>
+           <property name="alignment">
+            <set>Qt::AlignCenter</set>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QLineEdit" name="original_args_common">
+           <property name="styleSheet">
+            <string notr="true">QLineEdit {
+	background: transparent;
+	border: 0;
+	color: white;
+}</string>
+           </property>
+           <property name="readOnly">
+            <bool>true</bool>
+           </property>
+          </widget>
+         </item>
+        </layout>
+       </widget>
+      </item>
+     </layout>
+    </widget>
+   </item>
+   <item row="3" column="1">
+    <widget class="QWidget" name="patched_contents_widget" native="true">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Preferred" vsizetype="Expanding">
        <horstretch>0</horstretch>
        <verstretch>0</verstretch>
       </sizepolicy>
      </property>
      <property name="styleSheet">
-      <string notr="true">QWidget#file_info_widget{
+      <string notr="true">QWidget#patched_contents_widget{
 border-radius: 20px;
 background-color: rgba(30, 0, 0, 100);
 }</string>
      </property>
+     <layout class="QVBoxLayout" name="verticalLayout_6">
+      <item>
+       <widget class="QLabel" name="patched_title">
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
+        <property name="text">
+         <string>Русифицированная версия</string>
+        </property>
+        <property name="alignment">
+         <set>Qt::AlignCenter</set>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <widget class="QWidget" name="patched_contents_widget_3" native="true">
+        <property name="styleSheet">
+         <string notr="true">QWidget#original_contents_widget{
+border-radius: 20px;
+background-color: rgba(30, 0, 0, 100);
+}</string>
+        </property>
+        <layout class="QVBoxLayout" name="verticalLayout">
+         <item>
+          <widget class="QLabel" name="label_6_common">
+           <property name="sizePolicy">
+            <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+           </property>
+           <property name="text">
+            <string>Текст:</string>
+           </property>
+           <property name="alignment">
+            <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QLabel" name="patched_content_common">
+           <property name="minimumSize">
+            <size>
+             <width>0</width>
+             <height>0</height>
+            </size>
+           </property>
+           <property name="text">
+            <string>...</string>
+           </property>
+           <property name="alignment">
+            <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
+           </property>
+           <property name="wordWrap">
+            <bool>true</bool>
+           </property>
+           <property name="textInteractionFlags">
+            <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
+           </property>
+          </widget>
+         </item>
+        </layout>
+       </widget>
+      </item>
+      <item>
+       <widget class="QWidget" name="patched_contents_widget_2" native="true">
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
+        <property name="styleSheet">
+         <string notr="true">QWidget#original_contents_widget{
+border-radius: 20px;
+background-color: rgba(30, 0, 0, 100);
+}</string>
+        </property>
+        <layout class="QHBoxLayout" name="horizontalLayout">
+         <item>
+          <widget class="QLabel" name="label_21_common">
+           <property name="sizePolicy">
+            <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+           </property>
+           <property name="text">
+            <string>Аргументы:</string>
+           </property>
+           <property name="alignment">
+            <set>Qt::AlignCenter</set>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QLineEdit" name="patched_args_common">
+           <property name="styleSheet">
+            <string notr="true">QLineEdit {
+	background: transparent;
+	border: 0;
+	color: white;
+}</string>
+           </property>
+           <property name="readOnly">
+            <bool>true</bool>
+           </property>
+          </widget>
+         </item>
+        </layout>
+       </widget>
+      </item>
+     </layout>
+    </widget>
+   </item>
+   <item row="2" column="0" colspan="2">
+    <widget class="QWidget" name="file_info_widget" native="true">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="styleSheet">
+      <string notr="true"/>
+     </property>
      <layout class="QVBoxLayout" name="verticalLayout_7">
       <property name="topMargin">
        <number>11</number>
@@ -53,14 +308,14 @@ background-color: rgba(30, 0, 0, 100);
           <number>0</number>
          </property>
          <item>
-          <widget class="QLabel" name="label_20">
+          <widget class="QLabel" name="label_20_common">
            <property name="text">
             <string>ID файла:</string>
            </property>
           </widget>
          </item>
          <item>
-          <widget class="QLineEdit" name="lineEdit_7">
+          <widget class="QLineEdit" name="file_id_common">
            <property name="sizePolicy">
             <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
              <horstretch>0</horstretch>
@@ -104,14 +359,14 @@ background-color: rgba(30, 0, 0, 100);
           <number>0</number>
          </property>
          <item>
-          <widget class="QLabel" name="label_19">
+          <widget class="QLabel" name="label_19_common">
            <property name="text">
             <string>ID фрагмента (необязательно):</string>
            </property>
           </widget>
          </item>
          <item>
-          <widget class="QLineEdit" name="lineEdit_6">
+          <widget class="QLineEdit" name="fragment_id_common">
            <property name="sizePolicy">
             <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
              <horstretch>0</horstretch>
@@ -168,12 +423,19 @@ background-color: rgba(30, 0, 0, 100);
           </spacer>
          </item>
          <item>
-          <widget class="QPushButton" name="pushButton_9">
+          <widget class="QPushButton" name="find_button_common">
            <property name="text">
             <string>Найти</string>
            </property>
           </widget>
          </item>
+         <item>
+          <widget class="QPushButton" name="getFileInfoButton_common">
+           <property name="text">
+            <string>Отобразить информацию</string>
+           </property>
+          </widget>
+         </item>
         </layout>
        </widget>
       </item>
@@ -183,56 +445,48 @@ background-color: rgba(30, 0, 0, 100);
      <zorder>widget_18</zorder>
     </widget>
    </item>
-   <item row="1" column="0">
-    <widget class="QWidget" name="original_contents_widget" native="true">
+   <item row="0" column="0" colspan="2">
+    <widget class="QWidget" name="info_widget" native="true">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
      <property name="styleSheet">
-      <string notr="true">QWidget#original_contents_widget{
-border-radius: 20px;
-background-color: rgba(30, 0, 0, 100);
-}</string>
+      <string notr="true"/>
      </property>
-     <layout class="QVBoxLayout" name="verticalLayout_6">
+     <layout class="QVBoxLayout" name="verticalLayout_3">
+      <property name="topMargin">
+       <number>0</number>
+      </property>
       <item>
-       <widget class="QLabel" name="label_17">
+       <widget class="QLabel" name="info_common">
         <property name="sizePolicy">
          <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
           <horstretch>0</horstretch>
           <verstretch>0</verstretch>
          </sizepolicy>
         </property>
-        <property name="text">
-         <string>Оригинальная версия</string>
+        <property name="font">
+         <font>
+          <family>Trajan Pro 3</family>
+         </font>
         </property>
-        <property name="alignment">
-         <set>Qt::AlignCenter</set>
+        <property name="mouseTracking">
+         <bool>true</bool>
         </property>
-       </widget>
-      </item>
-     </layout>
-    </widget>
-   </item>
-   <item row="1" column="1">
-    <widget class="QWidget" name="patched_contents_widget" native="true">
-     <property name="styleSheet">
-      <string notr="true">QWidget#patched_contents_widget{
-border-radius: 20px;
-background-color: rgba(30, 0, 0, 100);
-}</string>
-     </property>
-     <layout class="QVBoxLayout" name="verticalLayout_5">
-      <item>
-       <widget class="QLabel" name="label_18">
-        <property name="sizePolicy">
-         <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
-          <horstretch>0</horstretch>
-          <verstretch>0</verstretch>
-         </sizepolicy>
+        <property name="styleSheet">
+         <string notr="true"/>
         </property>
         <property name="text">
-         <string>Русифицированная версия</string>
+         <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Используйте &lt;span style=&quot; color:#dfe830;&quot;&gt;поиск&lt;/span&gt; по ID нужных &lt;span style=&quot; color:#e0e239;&quot;&gt;текстовых&lt;/span&gt; файлов и фрагментов, чтобы увидеть их текущее представление или получайте &lt;span style=&quot; color:#33e1d6;&quot;&gt;информацию&lt;/span&gt; о &lt;span style=&quot; color:#26cabd;&quot;&gt;любом файле&lt;/span&gt; по его ID.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
         </property>
         <property name="alignment">
-         <set>Qt::AlignCenter</set>
+         <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
+        </property>
+        <property name="wordWrap">
+         <bool>true</bool>
         </property>
        </widget>
       </item>

+ 118 - 21
src/Legacy-advanced/widgets/exportwidget.cpp

@@ -1,17 +1,16 @@
-#include "gui/exportwidget.h"
+#include "exportwidget.h"
 #include "ui_exportwidget.h"
-#include "legacyapp.h"
+#include "models/lotromanager.h"
 
 #include <QFileDialog>
+#include <QDebug>
 
-ExportWidget::ExportWidget(LegacyApp *_app, QWidget *parent) :
-    QWidget(parent), app(_app),
+ExportWidget::ExportWidget(LotroManager* mgr, QSettings* settings, QWidget *parent) :
+    QWidget(parent), lotro_manager(mgr), settings(settings),
     ui(new Ui::ExportWidget)
 {
     ui->setupUi(this);
     ui->singlefile_radio_common->click();
-    ui->folder_value_common->setText(app->properties.value("advanced/export_folder", "(не выбрана)").toString());
-    ui->folder_value_common->setToolTip(app->properties.value("advanced/export_folder", "Выберите папку, куда будут помещены извлечённые файлы").toString());
 }
 
 ExportWidget::~ExportWidget()
@@ -19,6 +18,52 @@ ExportWidget::~ExportWidget()
     delete ui;
 }
 
+void ExportWidget::addConnections()
+{
+    connect(lotro_manager, &LotroManager::processStarted, this, &ExportWidget::on_lotromanager_process_started, Qt::BlockingQueuedConnection);
+    connect(lotro_manager, &LotroManager::processFinished, this, &ExportWidget::on_lotromanager_process_finished, Qt::BlockingQueuedConnection);
+}
+
+void ExportWidget::on_lotromanager_process_started(QString, QVector<QVariant>)
+{
+    ui->extract_button_common->setEnabled(false);
+    ui->filesbytype_radio_common->setEnabled(false);
+    ui->filetype_dds_common->setEnabled(false);
+    ui->filetype_fontbin_common->setEnabled(false);
+    ui->filetype_jpg_common->setEnabled(false);
+    ui->filetype_ogg_common->setEnabled(false);
+    ui->filetype_txt_common->setEnabled(false);
+    ui->filetype_unknown_common->setEnabled(false);
+    ui->filetype_wav_common->setEnabled(false);
+    ui->singlefile_radio_common->setEnabled(false);
+    ui->single_file_id_common->setEnabled(false);
+    ui->target_database_radio_common->setEnabled(false);
+    ui->target_files_radio_common->setEnabled(false);
+}
+
+void ExportWidget::on_lotromanager_process_finished(QString, QVector<QVariant>)
+{
+    ui->extract_button_common->setEnabled(true);
+    ui->filesbytype_radio_common->setEnabled(true);
+    ui->filetype_dds_common->setEnabled(true);
+    ui->filetype_fontbin_common->setEnabled(true);
+    ui->filetype_jpg_common->setEnabled(true);
+    ui->filetype_ogg_common->setEnabled(true);
+    ui->filetype_txt_common->setEnabled(true);
+    ui->filetype_unknown_common->setEnabled(true);
+    ui->filetype_wav_common->setEnabled(true);
+    ui->singlefile_radio_common->setEnabled(true);
+    ui->single_file_id_common->setEnabled(true);
+    ui->target_database_radio_common->setEnabled(true);
+    ui->target_files_radio_common->setEnabled(true);
+
+    if (ui->singlefile_radio_common->isChecked())
+        emit ui->singlefile_radio_common->click();
+    if (ui->filesbytype_radio_common->isChecked())
+        emit ui->filesbytype_radio_common->click();
+
+}
+
 void ExportWidget::on_singlefile_radio_common_clicked()
 {
     ui->single_file_id_common->setEnabled(true);
@@ -43,21 +88,8 @@ void ExportWidget::on_filesbytype_radio_common_clicked()
     ui->filetype_wav_common->setEnabled(true);
 }
 
-void ExportWidget::on_change_folder_button_clicked()
-{
-    QString path = QFileDialog::getExistingDirectory(0, ("Select Output Folder"), QDir::currentPath());
-    if (path.length() == 0)
-        return;
-
-    app->properties.setValue("advanced/export_folder", path);
-    app->properties.sync();
-    ui->folder_value_common->setText(path);
-    ui->folder_value_common->setToolTip(path);
-}
-
 void ExportWidget::on_extract_button_common_clicked()
 {
-    QString folder = ui->folder_value_common->text();
     bool to_database = ui->target_database_radio_common->isChecked();
     bool is_single_file = ui->singlefile_radio_common->isChecked();
 
@@ -77,7 +109,72 @@ void ExportWidget::on_extract_button_common_clicked()
     if (ui->filetype_wav_common->isChecked())
         file_type = LOTRO_DAT::FILE_TYPE(file_type | LOTRO_DAT::WAV);
 
-    int file_id = ui->single_file_id_common->text().toInt();
+    long long file_id = ui->single_file_id_common->text().toLongLong();
+
+
+
+    if (is_single_file && !to_database) {
+        QString fileName = QFileDialog::getSaveFileName(this->parentWidget(), "Сохранение файла",
+                                   settings->value("advanced/export_path", "").toString(), "Все файлы (*)");
+        if (fileName.isEmpty())
+                return;
+
+        settings->setValue("advanced/export_path", fileName.left(std::max(fileName.lastIndexOf('/'), fileName.lastIndexOf('\\'))));
+        settings->sync();
+
+        qDebug() << "Saving export path to " << settings->value("advanced/export_path", "").toString();
+
+        QMetaObject::invokeMethod(lotro_manager, "extractSingleFile",
+                                  Qt::QueuedConnection, Q_ARG(QString, fileName),
+                                  Q_ARG(long long, file_id));
+    }
+
+    if (is_single_file && to_database) {
+        QString fileName = QFileDialog::getSaveFileName(this->parentWidget(), "Сохранение файла",
+                                   settings->value("advanced/export_path", "").toString(), "База данных (*.db);;Все файлы (*)");
+        if (fileName.isEmpty())
+                return;
+
+        settings->setValue("advanced/export_path", fileName.left(std::max(fileName.lastIndexOf('/'), fileName.lastIndexOf('\\'))));
+        settings->sync();
+
+        qDebug() << "Saving export path to " << settings->value("advanced/export_path", "").toString();
+
+        QMetaObject::invokeMethod(lotro_manager, "extractSingleFileToDatabase",
+                                  Qt::QueuedConnection, Q_ARG(QString, fileName),
+                                  Q_ARG(long long, file_id));
+    }
+
+    if (!is_single_file && !to_database) {
+        QString folderName = QFileDialog::getExistingDirectory(this->parentWidget(), "Выбор папки для экспорта",
+                                   settings->value("advanced/export_path", "").toString(), QFileDialog::ShowDirsOnly) + "/";
+        if (folderName.isEmpty())
+                return;
+
+        settings->setValue("advanced/export_path", folderName);
+        settings->sync();
+
+        qDebug() << "Saving export path to " << settings->value("advanced/export_path", "").toString();
+
+
+        QMetaObject::invokeMethod(lotro_manager, "extractGrouppedFiles",
+                                  Qt::QueuedConnection, Q_ARG(QString, folderName),
+                                  Q_ARG(LOTRO_DAT::FILE_TYPE, file_type));
+    }
+
+    if (!is_single_file && to_database) {
+        QString fileName = QFileDialog::getSaveFileName(this->parentWidget(), "Сохранение файла",
+                                   settings->value("advanced/export_path", "").toString(), "База данных (*.db);;Все файлы (*)");
+        if (fileName.isEmpty())
+                return;
+
+        settings->setValue("advanced/export_path", fileName.left(std::max(fileName.lastIndexOf('/'), fileName.lastIndexOf('\\'))));
+        settings->sync();
+
+        qDebug() << "Saving export path to " << settings->value("advanced/export_path", "").toString();
 
-    app->ExtractFiles(folder, to_database, is_single_file, file_id, file_type);
+        QMetaObject::invokeMethod(lotro_manager, "extractGrouppedFilesToDatabase",
+                                  Qt::QueuedConnection, Q_ARG(QString, fileName),
+                                  Q_ARG(LOTRO_DAT::FILE_TYPE, file_type));
+    }
 }

+ 11 - 5
src/Legacy-advanced/widgets/exportwidget.h

@@ -2,33 +2,39 @@
 #define EXPORTWIDGET_H
 
 #include <QWidget>
+#include <QSettings>
 
 namespace Ui {
 class ExportWidget;
 }
 
-class LegacyApp;
+class LotroManager;
 
 class ExportWidget : public QWidget
 {
     Q_OBJECT
 
 public:
-    explicit ExportWidget(LegacyApp *_app, QWidget *parent = 0);
+    explicit ExportWidget(LotroManager* mgr, QSettings* settings, QWidget *parent = 0);
     ~ExportWidget();
 
+private:
+    void addConnections();
+
 private slots:
+    void on_lotromanager_process_started(QString, QVector<QVariant>);
+
+    void on_lotromanager_process_finished(QString, QVector<QVariant>);
 
     void on_singlefile_radio_common_clicked();
 
     void on_filesbytype_radio_common_clicked();
 
-    void on_change_folder_button_clicked();
-
     void on_extract_button_common_clicked();
 
 private:
-    LegacyApp *app;
+    LotroManager* lotro_manager;
+    QSettings* settings;
     Ui::ExportWidget *ui;
 
 };

+ 64 - 87
src/Legacy-advanced/widgets/exportwidget.ui

@@ -6,10 +6,16 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>640</width>
-    <height>480</height>
+    <width>630</width>
+    <height>561</height>
    </rect>
   </property>
+  <property name="sizePolicy">
+   <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+    <horstretch>0</horstretch>
+    <verstretch>0</verstretch>
+   </sizepolicy>
+  </property>
   <property name="windowTitle">
    <string>Form</string>
   </property>
@@ -18,8 +24,56 @@
 	color: white;
 }</string>
   </property>
-  <layout class="QGridLayout" name="gridLayout">
-   <item row="1" column="0">
+  <layout class="QVBoxLayout" name="verticalLayout">
+   <item>
+    <widget class="QWidget" name="info_widget" native="true">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="styleSheet">
+      <string notr="true"/>
+     </property>
+     <layout class="QVBoxLayout" name="verticalLayout_3">
+      <property name="topMargin">
+       <number>0</number>
+      </property>
+      <item>
+       <widget class="QLabel" name="info_common">
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
+        <property name="font">
+         <font>
+          <family>Trajan Pro 3</family>
+         </font>
+        </property>
+        <property name="mouseTracking">
+         <bool>false</bool>
+        </property>
+        <property name="styleSheet">
+         <string notr="true"/>
+        </property>
+        <property name="text">
+         <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;Распаковывайте ресурсы игры в файлы или формируйте из них базу данных Наследия, которую можно выгрузить на сайт или применить в качестве патча.&lt;br&gt;&lt;br&gt;&lt;span style=&quot; color:#ffff00;&quot;&gt;&lt;b&gt;Внимание!&lt;/b&gt;&lt;/span&gt;&lt;br&gt;Проверьте статус русификации в окне &amp;quot;Статус&amp;quot;! Если активна русифицированная версия данных, то и извлечены будут русифицированные данные! Чтобы извлекать оригинальные данные - смените локаль на &amp;quot;Оригинальную&amp;quot;&lt;/body&gt;&lt;/html&gt;</string>
+        </property>
+        <property name="alignment">
+         <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
+        </property>
+        <property name="wordWrap">
+         <bool>true</bool>
+        </property>
+       </widget>
+      </item>
+     </layout>
+    </widget>
+   </item>
+   <item>
     <widget class="QWidget" name="output_type_widget" native="true">
      <property name="sizePolicy">
       <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
@@ -28,10 +82,7 @@
       </sizepolicy>
      </property>
      <property name="styleSheet">
-      <string notr="true">QWidget#output_type_widget{
-border-radius: 20px;
-background-color: rgba(30, 0, 0, 100);
-}</string>
+      <string notr="true"/>
      </property>
      <layout class="QVBoxLayout" name="verticalLayout_2">
       <item>
@@ -54,7 +105,7 @@ background-color: rgba(30, 0, 0, 100);
      </layout>
     </widget>
    </item>
-   <item row="2" column="0">
+   <item>
     <widget class="QWidget" name="export_type_widget" native="true">
      <property name="sizePolicy">
       <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
@@ -63,10 +114,7 @@ background-color: rgba(30, 0, 0, 100);
       </sizepolicy>
      </property>
      <property name="styleSheet">
-      <string notr="true">QWidget#export_type_widget{
-border-radius: 20px;
-background-color: rgba(30, 0, 0, 100);
-}</string>
+      <string notr="true"/>
      </property>
      <layout class="QGridLayout" name="gridLayout_8">
       <property name="horizontalSpacing">
@@ -254,10 +302,10 @@ background-color: rgba(30, 0, 0, 100);
      </layout>
     </widget>
    </item>
-   <item row="4" column="0">
+   <item>
     <widget class="QWidget" name="widget_7" native="true">
      <property name="sizePolicy">
-      <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+      <sizepolicy hsizetype="Preferred" vsizetype="Expanding">
        <horstretch>0</horstretch>
        <verstretch>0</verstretch>
       </sizepolicy>
@@ -279,78 +327,7 @@ background-color: rgba(30, 0, 0, 100);
       <item>
        <widget class="QPushButton" name="extract_button_common">
         <property name="text">
-         <string>Извлечь</string>
-        </property>
-       </widget>
-      </item>
-     </layout>
-    </widget>
-   </item>
-   <item row="0" column="0">
-    <widget class="QWidget" name="export_folder_widget" native="true">
-     <property name="sizePolicy">
-      <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
-       <horstretch>0</horstretch>
-       <verstretch>0</verstretch>
-      </sizepolicy>
-     </property>
-     <property name="styleSheet">
-      <string notr="true">border-radius: 20px;
-background-color: rgba(30, 0, 0, 100);</string>
-     </property>
-     <layout class="QHBoxLayout" name="horizontalLayout_11">
-      <item>
-       <widget class="QLabel" name="folder_label_common">
-        <property name="styleSheet">
-         <string notr="true">
-background-color: none;</string>
-        </property>
-        <property name="text">
-         <string>Папка для извлечённых файлов:</string>
-        </property>
-       </widget>
-      </item>
-      <item>
-       <widget class="QLabel" name="folder_value_common">
-        <property name="sizePolicy">
-         <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
-          <horstretch>0</horstretch>
-          <verstretch>0</verstretch>
-         </sizepolicy>
-        </property>
-        <property name="styleSheet">
-         <string notr="true">
-background-color: none;</string>
-        </property>
-        <property name="text">
-         <string>D:\Programming\SourceRepos\Legacy_v2</string>
-        </property>
-       </widget>
-      </item>
-      <item>
-       <widget class="QPushButton" name="change_folder_button">
-        <property name="sizePolicy">
-         <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
-          <horstretch>0</horstretch>
-          <verstretch>0</verstretch>
-         </sizepolicy>
-        </property>
-        <property name="minimumSize">
-         <size>
-          <width>36</width>
-          <height>32</height>
-         </size>
-        </property>
-        <property name="cursor">
-         <cursorShape>PointingHandCursor</cursorShape>
-        </property>
-        <property name="styleSheet">
-         <string notr="true">border-image: url(:/assets/buttons/folder.png);
-
-background-color: none;</string>
-        </property>
-        <property name="text">
-         <string/>
+         <string>Экспортировать!</string>
         </property>
        </widget>
       </item>

+ 90 - 7
src/Legacy-advanced/widgets/importwidget.cpp

@@ -1,14 +1,18 @@
-#include "gui/importwidget.h"
+#include "importwidget.h"
 #include "ui_importwidget.h"
-#include "legacyapp.h"
+#include "models/lotromanager.h"
+#include <QFileDialog>
+#include <QMessageBox>
+#include <QTextEdit>
+#include <QDebug>
 
-ImportWidget::ImportWidget(LegacyApp *_app, QWidget *parent) :
-    QWidget(parent), app(_app),
+ImportWidget::ImportWidget(LotroManager* mgr, QSettings* settings, QWidget *parent) :
+    QWidget(parent), lotro_manager(mgr), settings(settings),
     ui(new Ui::ImportWidget)
 {
     ui->setupUi(this);
-    hideAllImportOptions();
-    ui->database_import_widget->show();
+    ui->database_import_radiobutton_common->click();
+    connect(lotro_manager, &LotroManager::textFragmentReceived, this, &ImportWidget::onTextFragmentContentsReceived, Qt::QueuedConnection);
 }
 
 ImportWidget::~ImportWidget()
@@ -18,11 +22,16 @@ ImportWidget::~ImportWidget()
 
 void ImportWidget::hideAllImportOptions()
 {
-    ui->database_import_widget->hide();
     ui->file_import_widget->hide();
     ui->textfragment_import_widget->hide();
+    ui->database_import_widget->hide();
 }
 
+void ImportWidget::onTextFragmentContentsReceived(QString args, QString content)
+{
+    ui->fragment_args_common->setText(args);
+    ui->fragment_content_common->setText(content);
+}
 
 void ImportWidget::on_database_import_radiobutton_common_clicked()
 {
@@ -40,4 +49,78 @@ void ImportWidget::on_textfragment_import_radiobutton_common_clicked()
 {
     hideAllImportOptions();
     ui->textfragment_import_widget->show();
+
+}
+
+void ImportWidget::on_database_import_button_common_clicked()
+{
+    QString fileName = QFileDialog::getOpenFileName(this->parentWidget(), "Открытие файла",
+                               settings->value("advanced/import_path", "").toString(), "База данных (*.db);;Все файлы (*)");
+    if (fileName.isEmpty())
+            return;
+
+    settings->setValue("advanced/import_path", fileName.left(std::max(fileName.lastIndexOf('/'), fileName.lastIndexOf('\\'))));
+    settings->sync();
+
+    QMetaObject::invokeMethod(lotro_manager, "importFilesFromDatabase",
+                              Qt::QueuedConnection, Q_ARG(QString, fileName));
+}
+
+void ImportWidget::on_file_import_button_common_clicked()
+{
+    if (ui->import_file_id_common->text().toLongLong() == 0) {
+        QMessageBox::warning(this->parentWidget(), "Не указан ID импортируемого файла!", "Укажите, пожалуйста, корректный (числовой) ID импортируемого файла");
+        return;
+    }
+
+    QString fileName = QFileDialog::getOpenFileName(this->parentWidget(), "Открытие файла",
+                               settings->value("advanced/import_path", "").toString(), "Все файлы (*)");
+    if (fileName.isEmpty())
+            return;
+
+    settings->setValue("advanced/import_path", fileName.left(std::max(fileName.lastIndexOf('/'), fileName.lastIndexOf('\\'))));
+    settings->sync();
+
+    QMetaObject::invokeMethod(lotro_manager, "importFile", Qt::QueuedConnection,
+                              Q_ARG(long long, ui->import_file_id_common->text().toLongLong()),
+                              Q_ARG(QString, fileName)
+                              );
+}
+
+void ImportWidget::on_get_file_fragments_button_common_clicked()
+{
+    if (ui->file_id_input_common->text().toLongLong() == 0) {
+        QMessageBox::warning(this->parentWidget(), "Не указан ID импортируемого файла!", "Укажите, пожалуйста, корректный (числовой) ID импортируемого текстового файла!");
+        return;
+    }
+    if (ui->fragment_id_input_common->text().toLongLong() == 0) {
+        QMessageBox::warning(this->parentWidget(), "Не указан ID фрагмента!", "Укажите, пожалуйста, корректный (числовой) ID фрагмента!");
+        return;
+    }
+
+    QMetaObject::invokeMethod(lotro_manager, "getTextFragment", Qt::QueuedConnection,
+                              Q_ARG(long long, ui->file_id_input_common->text().toLongLong()),
+                              Q_ARG(long long, ui->fragment_id_input_common->text().toLongLong())
+                              );
+}
+
+
+
+void ImportWidget::on_textfragment_import_common_clicked()
+{
+    if (ui->file_id_input_common->text().toLongLong() == 0) {
+        QMessageBox::warning(this->parentWidget(), "Не указан ID импортируемого файла!", "Укажите, пожалуйста, корректный (числовой) ID импортируемого текстового файла!");
+        return;
+    }
+    if (ui->fragment_id_input_common->text().toLongLong() == 0) {
+        QMessageBox::warning(this->parentWidget(), "Не указан ID фрагмента!", "Укажите, пожалуйста, корректный (числовой) ID фрагмента!");
+        return;
+    }
+
+    QMetaObject::invokeMethod(lotro_manager, "importTextFragment", Qt::QueuedConnection,
+                              Q_ARG(long long, ui->file_id_input_common->text().toLongLong()),
+                              Q_ARG(long long, ui->fragment_id_input_common->text().toLongLong()),
+                              Q_ARG(QString, ui->fragment_content_common->toPlainText()),
+                              Q_ARG(QString, ui->fragment_args_common->text())
+                              );
 }

+ 16 - 5
src/Legacy-advanced/widgets/importwidget.h

@@ -2,34 +2,45 @@
 #define IMPORTWIDGET_H
 
 #include <QWidget>
+#include <QSettings>
 
 namespace Ui {
 class ImportWidget;
 }
 
-class LegacyApp;
+class LotroManager;
 
 class ImportWidget : public QWidget
 {
     Q_OBJECT
 
 public:
-    explicit ImportWidget(LegacyApp *_app, QWidget *parent = 0);
+    explicit ImportWidget(LotroManager* mgr, QSettings* settings, QWidget *parent = 0);
     ~ImportWidget();
 
     void hideAllImportOptions();
 
 private slots:
+    void onTextFragmentContentsReceived(QString, QString);
+
     void on_database_import_radiobutton_common_clicked();
 
     void on_file_import_radiobutton_common_clicked();
 
     void on_textfragment_import_radiobutton_common_clicked();
 
-private:
-    LegacyApp *app;
-    Ui::ImportWidget *ui;
+    void on_database_import_button_common_clicked();
+
+    void on_file_import_button_common_clicked();
 
+    void on_get_file_fragments_button_common_clicked();
+
+    void on_textfragment_import_common_clicked();
+
+private:
+    LotroManager* lotro_manager;
+    QSettings* settings;
+    Ui::ImportWidget* ui;
 };
 
 #endif // IMPORTWIDGET_H

+ 233 - 323
src/Legacy-advanced/widgets/importwidget.ui

@@ -6,8 +6,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>928</width>
-    <height>533</height>
+    <width>1037</width>
+    <height>985</height>
    </rect>
   </property>
   <property name="windowTitle">
@@ -20,14 +20,17 @@
   </property>
   <layout class="QGridLayout" name="gridLayout">
    <item row="0" column="0">
-    <widget class="QWidget" name="widget_3" native="true">
+    <widget class="QWidget" name="import_widget" native="true">
      <property name="sizePolicy">
-      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+      <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
        <horstretch>0</horstretch>
        <verstretch>0</verstretch>
       </sizepolicy>
      </property>
-     <layout class="QGridLayout" name="gridLayout_5">
+     <property name="styleSheet">
+      <string notr="true"/>
+     </property>
+     <layout class="QGridLayout" name="gridLayout_6">
       <property name="leftMargin">
        <number>0</number>
       </property>
@@ -40,134 +43,63 @@
       <property name="bottomMargin">
        <number>0</number>
       </property>
-      <item row="3" column="0">
+      <property name="spacing">
+       <number>0</number>
+      </property>
+      <item row="1" column="1">
        <widget class="QWidget" name="file_import_widget" native="true">
         <property name="sizePolicy">
-         <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+         <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
           <horstretch>0</horstretch>
           <verstretch>0</verstretch>
          </sizepolicy>
         </property>
+        <property name="minimumSize">
+         <size>
+          <width>0</width>
+          <height>0</height>
+         </size>
+        </property>
         <property name="styleSheet">
-         <string notr="true">QWidget#file_import_widget {
-border-radius: 20px;
-background-color: rgba(30, 0, 0, 100);
-}</string>
+         <string notr="true"/>
         </property>
-        <layout class="QGridLayout" name="gridLayout_6">
-         <item row="1" column="0">
-          <widget class="QLabel" name="label_8_common">
-           <property name="sizePolicy">
-            <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
-             <horstretch>0</horstretch>
-             <verstretch>0</verstretch>
-            </sizepolicy>
+        <layout class="QGridLayout" name="gridLayout_2">
+         <property name="verticalSpacing">
+          <number>0</number>
+         </property>
+         <item row="0" column="0" colspan="2">
+          <widget class="QLabel" name="info_common">
+           <property name="font">
+            <font>
+             <family>Trajan Pro 3</family>
+            </font>
            </property>
-           <property name="text">
-            <string>Путь к файлу:</string>
+           <property name="mouseTracking">
+            <bool>true</bool>
            </property>
-          </widget>
-         </item>
-         <item row="1" column="1">
-          <widget class="QLabel" name="file_path_common">
            <property name="text">
-            <string>(не указан)</string>
+            <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Импортируйте в игру отдельные файлы данных, заменяя ими текущие версии &lt;span style=&quot; color:#ff7700;&quot;&gt;(требуется указание ID файла)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;О формате файлов, используемых в игре можно узнать в гайде на сайте русификации.&lt;br/&gt;&lt;br/&gt;&lt;span style=&quot; font-weight:600; color:#ffff00;&quot;&gt;Внимание!&lt;/span&gt;&lt;br/&gt;После установки файлов версия данных автоматически сменится на &amp;quot;русифицированную&amp;quot;!&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
            </property>
-          </widget>
-         </item>
-         <item row="1" column="2">
-          <widget class="QPushButton" name="change_file_path_common">
-           <property name="sizePolicy">
-            <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
-             <horstretch>0</horstretch>
-             <verstretch>0</verstretch>
-            </sizepolicy>
+           <property name="textFormat">
+            <enum>Qt::RichText</enum>
            </property>
-           <property name="minimumSize">
-            <size>
-             <width>0</width>
-             <height>25</height>
-            </size>
-           </property>
-           <property name="maximumSize">
-            <size>
-             <width>30</width>
-             <height>25</height>
-            </size>
+           <property name="wordWrap">
+            <bool>true</bool>
            </property>
-           <property name="text">
-            <string>...</string>
+           <property name="openExternalLinks">
+            <bool>true</bool>
            </property>
           </widget>
          </item>
-         <item row="3" column="0" colspan="3">
-          <widget class="QWidget" name="widget_4" native="true">
-           <property name="sizePolicy">
-            <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
-             <horstretch>0</horstretch>
-             <verstretch>0</verstretch>
-            </sizepolicy>
-           </property>
+         <item row="1" column="0" colspan="2">
+          <widget class="QWidget" name="widget" native="true">
            <property name="minimumSize">
             <size>
              <width>0</width>
-             <height>0</height>
+             <height>50</height>
             </size>
            </property>
-           <layout class="QHBoxLayout" name="horizontalLayout_7">
-            <property name="spacing">
-             <number>0</number>
-            </property>
-            <property name="leftMargin">
-             <number>0</number>
-            </property>
-            <property name="topMargin">
-             <number>0</number>
-            </property>
-            <property name="rightMargin">
-             <number>0</number>
-            </property>
-            <property name="bottomMargin">
-             <number>0</number>
-            </property>
-            <item>
-             <spacer name="horizontalSpacer_6">
-              <property name="orientation">
-               <enum>Qt::Horizontal</enum>
-              </property>
-              <property name="sizeHint" stdset="0">
-               <size>
-                <width>561</width>
-                <height>20</height>
-               </size>
-              </property>
-             </spacer>
-            </item>
-            <item>
-             <widget class="QPushButton" name="apply_file_common">
-              <property name="text">
-               <string>Применить</string>
-              </property>
-             </widget>
-            </item>
-           </layout>
-          </widget>
-         </item>
-         <item row="2" column="0" colspan="3">
-          <widget class="QWidget" name="widget_5" native="true">
-           <property name="sizePolicy">
-            <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
-             <horstretch>0</horstretch>
-             <verstretch>0</verstretch>
-            </sizepolicy>
-           </property>
-           <property name="minimumSize">
-            <size>
-             <width>0</width>
-             <height>0</height>
-            </size>
-           </property>
-           <layout class="QHBoxLayout" name="horizontalLayout_5">
+           <layout class="QHBoxLayout" name="horizontalLayout">
             <item>
              <widget class="QLabel" name="label_4_common">
               <property name="sizePolicy">
@@ -191,64 +123,6 @@ background-color: rgba(30, 0, 0, 100);
               </property>
              </widget>
             </item>
-            <item>
-             <widget class="QLabel" name="label_7_common">
-              <property name="sizePolicy">
-               <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
-                <horstretch>0</horstretch>
-                <verstretch>0</verstretch>
-               </sizepolicy>
-              </property>
-              <property name="text">
-               <string>Тип файла:</string>
-              </property>
-             </widget>
-            </item>
-            <item>
-             <widget class="QComboBox" name="comboBox_common">
-              <property name="sizePolicy">
-               <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
-                <horstretch>0</horstretch>
-                <verstretch>0</verstretch>
-               </sizepolicy>
-              </property>
-              <item>
-               <property name="text">
-                <string>TXT</string>
-               </property>
-              </item>
-              <item>
-               <property name="text">
-                <string>JPG</string>
-               </property>
-              </item>
-              <item>
-               <property name="text">
-                <string>DDS</string>
-               </property>
-              </item>
-              <item>
-               <property name="text">
-                <string>OGG</string>
-               </property>
-              </item>
-              <item>
-               <property name="text">
-                <string>WAV</string>
-               </property>
-              </item>
-              <item>
-               <property name="text">
-                <string>FONTBIN</string>
-               </property>
-              </item>
-              <item>
-               <property name="text">
-                <string>UNKNOWN</string>
-               </property>
-              </item>
-             </widget>
-            </item>
             <item>
              <spacer name="horizontalSpacer_2">
               <property name="orientation">
@@ -265,122 +139,32 @@ background-color: rgba(30, 0, 0, 100);
            </layout>
           </widget>
          </item>
-        </layout>
-       </widget>
-      </item>
-      <item row="1" column="0">
-       <widget class="QWidget" name="database_import_widget" native="true">
-        <property name="sizePolicy">
-         <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
-          <horstretch>0</horstretch>
-          <verstretch>0</verstretch>
-         </sizepolicy>
-        </property>
-        <property name="styleSheet">
-         <string notr="true">QWidget#database_import_widget {
-border-radius: 20px;
-background-color: rgba(30, 0, 0, 100);
-}</string>
-        </property>
-        <layout class="QGridLayout" name="gridLayout_7">
-         <item row="0" column="1">
-          <widget class="QLabel" name="database_path_common">
-           <property name="styleSheet">
-            <string notr="true"/>
-           </property>
-           <property name="text">
-            <string>(не указан)</string>
-           </property>
-          </widget>
-         </item>
-         <item row="0" column="2">
-          <widget class="QPushButton" name="change_database_path_common">
-           <property name="sizePolicy">
-            <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
-             <horstretch>0</horstretch>
-             <verstretch>0</verstretch>
-            </sizepolicy>
-           </property>
-           <property name="minimumSize">
-            <size>
-             <width>0</width>
-             <height>25</height>
-            </size>
-           </property>
-           <property name="maximumSize">
-            <size>
-             <width>30</width>
-             <height>25</height>
-            </size>
-           </property>
-           <property name="text">
-            <string>...</string>
-           </property>
-          </widget>
-         </item>
-         <item row="0" column="0">
-          <widget class="QLabel" name="label_5_common">
-           <property name="sizePolicy">
-            <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
-             <horstretch>0</horstretch>
-             <verstretch>0</verstretch>
-            </sizepolicy>
-           </property>
-           <property name="styleSheet">
-            <string notr="true"/>
-           </property>
-           <property name="text">
-            <string>Путь к базе данных:</string>
-           </property>
-          </widget>
-         </item>
-         <item row="1" column="0" colspan="3">
-          <widget class="QWidget" name="widget_6" native="true">
+         <item row="2" column="0" colspan="2">
+          <widget class="QWidget" name="apply_widget_2" native="true">
            <property name="sizePolicy">
             <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
              <horstretch>0</horstretch>
              <verstretch>0</verstretch>
             </sizepolicy>
            </property>
-           <property name="minimumSize">
-            <size>
-             <width>0</width>
-             <height>0</height>
-            </size>
-           </property>
-           <layout class="QHBoxLayout" name="horizontalLayout_9">
-            <property name="spacing">
-             <number>0</number>
-            </property>
-            <property name="leftMargin">
-             <number>0</number>
-            </property>
-            <property name="topMargin">
-             <number>0</number>
-            </property>
-            <property name="rightMargin">
-             <number>0</number>
-            </property>
-            <property name="bottomMargin">
-             <number>0</number>
-            </property>
+           <layout class="QHBoxLayout" name="horizontalLayout_6">
             <item>
-             <spacer name="horizontalSpacer_8">
+             <spacer name="horizontalSpacer_7">
               <property name="orientation">
                <enum>Qt::Horizontal</enum>
               </property>
               <property name="sizeHint" stdset="0">
                <size>
-                <width>559</width>
-                <height>20</height>
+                <width>554</width>
+                <height>14</height>
                </size>
               </property>
              </spacer>
             </item>
             <item>
-             <widget class="QPushButton" name="apply_database_common">
+             <widget class="QPushButton" name="file_import_button_common">
               <property name="text">
-               <string>Применить</string>
+               <string>Импортировать</string>
               </property>
              </widget>
             </item>
@@ -390,31 +174,7 @@ background-color: rgba(30, 0, 0, 100);
         </layout>
        </widget>
       </item>
-      <item row="4" column="0">
-       <widget class="QRadioButton" name="textfragment_import_radiobutton_common">
-        <property name="text">
-         <string>Импорт текстового фрагмента</string>
-        </property>
-       </widget>
-      </item>
-      <item row="0" column="0" colspan="2">
-       <widget class="QRadioButton" name="database_import_radiobutton_common">
-        <property name="text">
-         <string>Импорт файлов из базы данных</string>
-        </property>
-        <property name="checked">
-         <bool>true</bool>
-        </property>
-       </widget>
-      </item>
-      <item row="2" column="0">
-       <widget class="QRadioButton" name="file_import_radiobutton_common">
-        <property name="text">
-         <string>Импорт произвольного файла</string>
-        </property>
-       </widget>
-      </item>
-      <item row="5" column="0">
+      <item row="2" column="1">
        <widget class="QWidget" name="textfragment_import_widget" native="true">
         <property name="sizePolicy">
          <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
@@ -429,27 +189,39 @@ background-color: rgba(30, 0, 0, 100);
          </size>
         </property>
         <property name="styleSheet">
-         <string notr="true">QWidget#textfragment_import_widget {
-border-radius: 20px;
-background-color: rgba(30, 0, 0, 100);
-}</string>
+         <string notr="true"/>
         </property>
         <layout class="QVBoxLayout" name="verticalLayout_3">
-         <property name="spacing">
-          <number>0</number>
-         </property>
-         <property name="leftMargin">
-          <number>0</number>
-         </property>
-         <property name="topMargin">
-          <number>0</number>
-         </property>
-         <property name="rightMargin">
-          <number>0</number>
-         </property>
-         <property name="bottomMargin">
-          <number>0</number>
-         </property>
+         <item>
+          <widget class="QLabel" name="info_common_2">
+           <property name="sizePolicy">
+            <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+           </property>
+           <property name="font">
+            <font>
+             <family>Trajan Pro 3</family>
+            </font>
+           </property>
+           <property name="mouseTracking">
+            <bool>false</bool>
+           </property>
+           <property name="text">
+            <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Используйте форму для быстрой замены текстового фрагмента в игре. Чтобы получить текущие данные введите id файла и id фрагмента и нажмите кнопку &amp;quot;Найти&amp;quot;&lt;/p&gt;&lt;p&gt;О формате текстовых фрагментов можно узнать в соответствующем гайде на сайте русификации.&lt;br/&gt;&lt;br/&gt;&lt;span style=&quot; font-weight:600; color:#ffff00;&quot;&gt;Внимание!&lt;/span&gt;&lt;br/&gt;После установки файлов версия данных автоматически сменится на &amp;quot;русифицированную&amp;quot;!&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+           </property>
+           <property name="textFormat">
+            <enum>Qt::RichText</enum>
+           </property>
+           <property name="wordWrap">
+            <bool>true</bool>
+           </property>
+           <property name="openExternalLinks">
+            <bool>true</bool>
+           </property>
+          </widget>
+         </item>
          <item>
           <widget class="QWidget" name="widget_10" native="true">
            <property name="sizePolicy">
@@ -467,7 +239,7 @@ background-color: rgba(30, 0, 0, 100);
              </widget>
             </item>
             <item>
-             <widget class="QLineEdit" name="lineEdit_2_common">
+             <widget class="QLineEdit" name="file_id_input_common">
               <property name="clearButtonEnabled">
                <bool>true</bool>
               </property>
@@ -481,14 +253,14 @@ background-color: rgba(30, 0, 0, 100);
              </widget>
             </item>
             <item>
-             <widget class="QLineEdit" name="lineEdit_3_common">
+             <widget class="QLineEdit" name="fragment_id_input_common">
               <property name="clearButtonEnabled">
                <bool>true</bool>
               </property>
              </widget>
             </item>
             <item>
-             <widget class="QPushButton" name="pushButton_4_common">
+             <widget class="QPushButton" name="get_file_fragments_button_common">
               <property name="text">
                <string>Найти</string>
               </property>
@@ -524,10 +296,20 @@ background-color: rgba(30, 0, 0, 100);
              </widget>
             </item>
             <item row="1" column="1">
-             <widget class="QTextEdit" name="textEdit">
+             <widget class="QTextEdit" name="fragment_content_common">
               <property name="sizeAdjustPolicy">
                <enum>QAbstractScrollArea::AdjustToContentsOnFirstShow</enum>
               </property>
+              <property name="html">
+               <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
+&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
+p, li { white-space: pre-wrap; }
+&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:7.8pt; font-weight:400; font-style:normal;&quot;&gt;
+&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+              </property>
+              <property name="acceptRichText">
+               <bool>false</bool>
+              </property>
              </widget>
             </item>
            </layout>
@@ -566,13 +348,13 @@ background-color: rgba(30, 0, 0, 100);
              </spacer>
             </item>
             <item row="1" column="1">
-             <widget class="QLineEdit" name="lineEdit_4_common"/>
+             <widget class="QLineEdit" name="fragment_args_common"/>
             </item>
            </layout>
           </widget>
          </item>
          <item>
-          <widget class="QWidget" name="widget_11" native="true">
+          <widget class="QWidget" name="apply_widget" native="true">
            <property name="sizePolicy">
             <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
              <horstretch>0</horstretch>
@@ -594,9 +376,9 @@ background-color: rgba(30, 0, 0, 100);
              </spacer>
             </item>
             <item>
-             <widget class="QPushButton" name="pushButton_5_common">
+             <widget class="QPushButton" name="textfragment_import_common">
               <property name="text">
-               <string>Изменить</string>
+               <string>Импортировать</string>
               </property>
              </widget>
             </item>
@@ -604,10 +386,138 @@ background-color: rgba(30, 0, 0, 100);
           </widget>
          </item>
         </layout>
-        <zorder>widget_11</zorder>
-        <zorder>widget_10</zorder>
-        <zorder>widget_9</zorder>
-        <zorder>widget_8</zorder>
+       </widget>
+      </item>
+      <item row="0" column="1">
+       <widget class="QWidget" name="database_import_widget" native="true">
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
+        <property name="minimumSize">
+         <size>
+          <width>0</width>
+          <height>0</height>
+         </size>
+        </property>
+        <property name="styleSheet">
+         <string notr="true"/>
+        </property>
+        <layout class="QVBoxLayout" name="verticalLayout_2">
+         <item>
+          <widget class="QLabel" name="info_common_4">
+           <property name="font">
+            <font>
+             <family>Trajan Pro 3</family>
+            </font>
+           </property>
+           <property name="mouseTracking">
+            <bool>false</bool>
+           </property>
+           <property name="text">
+            <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Импортируйте в игру ресурсы из заранее подготовенной базы данных Наследия &lt;/p&gt;&lt;p&gt;О формате базы данных Наследия можно узнать в гайде на сайте русификации.&lt;br/&gt;&lt;br/&gt;&lt;span style=&quot; font-weight:600; color:#ffff00;&quot;&gt;Внимание!&lt;/span&gt;&lt;br/&gt;После установки файлов версия данных автоматически сменится на &amp;quot;русифицированную&amp;quot;!&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+           </property>
+           <property name="textFormat">
+            <enum>Qt::RichText</enum>
+           </property>
+           <property name="wordWrap">
+            <bool>true</bool>
+           </property>
+           <property name="openExternalLinks">
+            <bool>true</bool>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QWidget" name="apply_widget_3" native="true">
+           <property name="sizePolicy">
+            <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+           </property>
+           <layout class="QHBoxLayout" name="horizontalLayout_7">
+            <item>
+             <spacer name="horizontalSpacer_8">
+              <property name="orientation">
+               <enum>Qt::Horizontal</enum>
+              </property>
+              <property name="sizeHint" stdset="0">
+               <size>
+                <width>554</width>
+                <height>14</height>
+               </size>
+              </property>
+             </spacer>
+            </item>
+            <item>
+             <widget class="QPushButton" name="database_import_button_common">
+              <property name="text">
+               <string>Импортировать</string>
+              </property>
+             </widget>
+            </item>
+           </layout>
+          </widget>
+         </item>
+        </layout>
+       </widget>
+      </item>
+      <item row="0" column="0" rowspan="3">
+       <widget class="QWidget" name="radio_import_widget" native="true">
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
+        <property name="minimumSize">
+         <size>
+          <width>0</width>
+          <height>50</height>
+         </size>
+        </property>
+        <layout class="QVBoxLayout" name="verticalLayout">
+         <item>
+          <widget class="QRadioButton" name="database_import_radiobutton_common">
+           <property name="text">
+            <string>Импорт файлов из базы данных</string>
+           </property>
+           <property name="checked">
+            <bool>true</bool>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QRadioButton" name="file_import_radiobutton_common">
+           <property name="text">
+            <string>Импорт произвольного файла</string>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QRadioButton" name="textfragment_import_radiobutton_common">
+           <property name="text">
+            <string>Импорт текстового фрагмента</string>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <spacer name="verticalSpacer_2">
+           <property name="orientation">
+            <enum>Qt::Vertical</enum>
+           </property>
+           <property name="sizeHint" stdset="0">
+            <size>
+             <width>20</width>
+             <height>40</height>
+            </size>
+           </property>
+          </spacer>
+         </item>
+        </layout>
        </widget>
       </item>
      </layout>

+ 0 - 114
src/Legacy-advanced/widgets/lotroprocessdialog.cpp

@@ -1,114 +0,0 @@
-#include "lotroprocessdialog.h"
-#include "ui_processdialog.h"
-#include <QPixmap>
-#include <QBitmap>
-#include <QMouseEvent>
-#include "models/lotromanager.h"
-#include <QTextCodec>
-using namespace LOTRO_DAT;
-
-LotroProcessDialog::LotroProcessDialog(LotroManager* mgr, QWidget *parent) :
-    QDialog(parent),
-    ui(new Ui::ProcessDialog), lotro_manager(mgr)
-{
-    ui->setupUi(this);
-    setModal(true);
-    setWindowTitle("Выполнение операции...");
-    QPixmap background(":/assets/backgrounds/process_dialog.png");
-
-    QPixmap current_bg = background.scaled(width(), height(), Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
-    QBitmap current_mask = current_bg.mask();
-    setMask(current_mask);
-
-    QPalette palette;
-    palette.setBrush(QPalette::Window, current_bg);
-    setPalette(palette);
-
-    loader.setFileName(":/assets/backgrounds/loading-gear.gif");
-    ui->loader->setMovie(&loader);
-    loader.setScaledSize(ui->loader->size());
-    loader.start();
-
-    uiUpdateTimer.setInterval(30);
-    connect(&uiUpdateTimer, &QTimer::timeout, this, &LotroProcessDialog::updateUI);
-    uiUpdateTimer.start();
-}
-
-void LotroProcessDialog::mousePressEvent(QMouseEvent *event)
-{
-    if (event->button() == Qt::LeftButton) {
-        dragPosition = event->globalPos() - frameGeometry().topLeft();
-        event->accept();
-    }
-}
-
-void LotroProcessDialog::updateUI()
-{
-    if (!qApp)
-        return;
-
-//    std::string debug_msg = app->client_local_dat.GetStatusModule().GetDebugMessage();
-//    QTextCodec *codec = QTextCodec::codecForName("UTF8");
-//    QByteArray ba(debug_msg.c_str());
-//    QString dmsg = codec->toUnicode(ba);
-
-//    int percentage = app->client_local_dat.GetStatusModule().GetPercentage();
-
-//    DatStatus::DAT_STATUS status = app->client_local_dat.GetStatusModule().GetStatus();
-//    QString title = "";
-
-//    switch (status) {
-//    case DatStatus::E_INITIALISING:
-//        title = "Инициализация";
-//        break;
-//    case DatStatus::E_EXTRACTING:
-//        title = "Извлечение данных";
-//        break;
-//    case DatStatus::E_PATCHING:
-//        title = "Применение патча";
-//        break;
-//    case DatStatus::E_COMMITING:
-//        title = "Фиксация данных";
-//        break;
-//    case DatStatus::E_BACKUP_CREATING:
-//        title = "Создание резервной копии";
-//        break;
-//    case DatStatus::E_BACKUP_REMOVING:
-//        title = "Удаление резервной копии";
-//        break;
-//    case DatStatus::E_GATHERING_INFO:
-//        title = "Сбор информации ядра";
-//        break;
-//    case DatStatus::E_FREE:
-//        title = "Свободен";
-//        break;
-//    default:
-//        title = "Неизвестная операция";
-//        break;
-//    }
-
-//    if (status == DatStatus::E_FREE)
-//        hide();
-//    else
-//        show();
-
-//    ui->title->setText(title);
-//    ui->progressBar->setValue(percentage);
-//    ui->debug_info->setText(dmsg);
-}
-
-void LotroProcessDialog::mouseMoveEvent(QMouseEvent *event)
-{
-    if (event->buttons() & Qt::LeftButton) {
-        move(event->globalPos() - dragPosition);
-//        app->window.move(event->globalPos() - dragPosition +
-//                         QPoint((width() - app->window.width()) / 2, (height() - app->window.height()) / 2)
-//                         );
-        event->accept();
-    }
-}
-
-LotroProcessDialog::~LotroProcessDialog()
-{
-    delete ui;
-}

+ 0 - 38
src/Legacy-advanced/widgets/lotroprocessdialog.h

@@ -1,38 +0,0 @@
-#ifndef PROCESSDIALOG_H
-#define PROCESSDIALOG_H
-
-#include <QDialog>
-#include <QMovie>
-#include <QTimer>
-
-namespace Ui {
-class ProcessDialog;
-}
-
-class LotroManager;
-
-class LotroProcessDialog : public QDialog
-{
-    Q_OBJECT
-
-public:
-    explicit LotroProcessDialog(LotroManager* mgr, QWidget *parent = 0);
-    ~LotroProcessDialog();
-
-protected:
-    void mouseMoveEvent(QMouseEvent *event) override;
-    void mousePressEvent(QMouseEvent *event) override;
-
-public slots:
-    void updateUI();
-
-private:
-    Ui::ProcessDialog *ui;
-    QMovie loader;
-
-    LotroManager* lotro_manager;
-    QPoint dragPosition;
-    QTimer uiUpdateTimer;
-};
-
-#endif // PROCESSDIALOG_H

+ 70 - 0
src/Legacy-advanced/widgets/lotroprogresswidget.cpp

@@ -0,0 +1,70 @@
+#include "lotroprogresswidget.h"
+#include "ui_lotroprogresswidget.h"
+
+#include <QTextCodec>
+#include "models/lotromanager.h"
+
+LotroProgressWidget::LotroProgressWidget(LotroManager* mgr, QSettings* settings, QWidget *parent) :
+    QWidget(parent), lotro_manager(mgr), settings(settings), ui_update_timer(new QTimer(this)),
+    ui(new Ui::LotroProgressWidget)
+{
+    ui->setupUi(this);
+    ui_update_timer->setInterval(30);
+    connect(ui_update_timer, &QTimer::timeout, this, &LotroProgressWidget::updateUI);
+    ui_update_timer->start();
+}
+
+LotroProgressWidget::~LotroProgressWidget()
+{
+    delete ui;
+}
+
+void LotroProgressWidget::updateUI()
+{
+    if (!qApp || isHidden())
+        return;
+
+    std::string debug_msg = lotro_manager->getStatusModule()->GetDebugMessage();
+    QTextCodec *codec = QTextCodec::codecForName("UTF8");
+    QByteArray ba(debug_msg.c_str());
+    QString dmsg = codec->toUnicode(ba);
+
+    int percentage = lotro_manager->getStatusModule()->GetPercentage();
+
+    LOTRO_DAT::DatStatus::DAT_STATUS status = lotro_manager->getStatusModule()->GetStatus();
+    QString title = "";
+
+    switch (status) {
+    case LOTRO_DAT::DatStatus::E_INITIALISING:
+        title = "Инициализация";
+        break;
+    case LOTRO_DAT::DatStatus::E_EXTRACTING:
+        title = "Извлечение данных";
+        break;
+    case LOTRO_DAT::DatStatus::E_PATCHING:
+        title = "Применение патча";
+        break;
+    case LOTRO_DAT::DatStatus::E_COMMITING:
+        title = "Фиксация данных";
+        break;
+    case LOTRO_DAT::DatStatus::E_BACKUP_CREATING:
+        title = "Создание резервной копии";
+        break;
+    case LOTRO_DAT::DatStatus::E_BACKUP_REMOVING:
+        title = "Удаление резервной копии";
+        break;
+    case LOTRO_DAT::DatStatus::E_GATHERING_INFO:
+        title = "Сбор информации ядра";
+        break;
+    case LOTRO_DAT::DatStatus::E_FREE:
+        title = "Свободен";
+        break;
+    default:
+        title = "Неизвестная операция";
+        break;
+    }
+
+    ui->title->setText(title);
+    ui->progressBar->setValue(percentage);
+    ui->debug_info_common->setText(dmsg);
+}

+ 31 - 0
src/Legacy-advanced/widgets/lotroprogresswidget.h

@@ -0,0 +1,31 @@
+#ifndef LOTROPROGRESSWIDGET_H
+#define LOTROPROGRESSWIDGET_H
+
+#include <QWidget>
+#include <QSettings>
+#include <QTimer>
+
+class LotroManager;
+
+namespace Ui {
+class LotroProgressWidget;
+}
+
+class LotroProgressWidget : public QWidget
+{
+    Q_OBJECT
+
+public:
+    explicit LotroProgressWidget(LotroManager* mgr, QSettings* settings, QWidget *parent = 0);
+    ~LotroProgressWidget();
+public slots:
+    void updateUI();
+
+private:
+    Ui::LotroProgressWidget *ui;
+    LotroManager* lotro_manager;
+    QSettings* settings;
+    QTimer* ui_update_timer;
+};
+
+#endif // LOTROPROGRESSWIDGET_H

+ 141 - 0
src/Legacy-advanced/widgets/lotroprogresswidget.ui

@@ -0,0 +1,141 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>LotroProgressWidget</class>
+ <widget class="QWidget" name="LotroProgressWidget">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>642</width>
+    <height>453</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>Form</string>
+  </property>
+  <layout class="QGridLayout" name="gridLayout">
+   <item row="0" column="0">
+    <spacer name="verticalSpacer_2">
+     <property name="orientation">
+      <enum>Qt::Vertical</enum>
+     </property>
+     <property name="sizeHint" stdset="0">
+      <size>
+       <width>20</width>
+       <height>152</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
+   <item row="2" column="1">
+    <spacer name="verticalSpacer">
+     <property name="orientation">
+      <enum>Qt::Vertical</enum>
+     </property>
+     <property name="sizeHint" stdset="0">
+      <size>
+       <width>20</width>
+       <height>151</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
+   <item row="1" column="0" colspan="2">
+    <widget class="QWidget" name="widget" native="true">
+     <layout class="QGridLayout" name="gridLayout_2">
+      <item row="1" column="1">
+       <widget class="QProgressBar" name="progressBar">
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
+        <property name="minimumSize">
+         <size>
+          <width>400</width>
+          <height>0</height>
+         </size>
+        </property>
+        <property name="styleSheet">
+         <string notr="true">color: white;</string>
+        </property>
+        <property name="value">
+         <number>0</number>
+        </property>
+       </widget>
+      </item>
+      <item row="0" column="1">
+       <widget class="QLabel" name="title">
+        <property name="font">
+         <font>
+          <family>a_AlgeriusNr</family>
+          <pointsize>17</pointsize>
+         </font>
+        </property>
+        <property name="styleSheet">
+         <string notr="true">color:white</string>
+        </property>
+        <property name="text">
+         <string>Название</string>
+        </property>
+        <property name="alignment">
+         <set>Qt::AlignCenter</set>
+        </property>
+       </widget>
+      </item>
+      <item row="1" column="2">
+       <spacer name="horizontalSpacer_2">
+        <property name="orientation">
+         <enum>Qt::Horizontal</enum>
+        </property>
+        <property name="sizeHint" stdset="0">
+         <size>
+          <width>40</width>
+          <height>20</height>
+         </size>
+        </property>
+       </spacer>
+      </item>
+      <item row="2" column="1" colspan="2">
+       <widget class="QLabel" name="debug_info_common">
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
+        <property name="font">
+         <font>
+          <family>Trajan Pro 3</family>
+         </font>
+        </property>
+        <property name="styleSheet">
+         <string notr="true">color: gray;</string>
+        </property>
+        <property name="text">
+         <string>TextLabel</string>
+        </property>
+       </widget>
+      </item>
+      <item row="1" column="0" rowspan="2">
+       <spacer name="horizontalSpacer">
+        <property name="orientation">
+         <enum>Qt::Horizontal</enum>
+        </property>
+        <property name="sizeHint" stdset="0">
+         <size>
+          <width>40</width>
+          <height>20</height>
+         </size>
+        </property>
+       </spacer>
+      </item>
+     </layout>
+    </widget>
+   </item>
+  </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>

+ 71 - 10
src/Legacy-advanced/widgets/mainwindow.cpp

@@ -23,32 +23,41 @@ MainWindow::MainWindow(QWidget *parent) :
 
 
     qDebug() << "Creating lotro manager instance & thread";
-    QThread *lotro_mgr_thread = new QThread();
-    LotroManager *lotro_mgr = new LotroManager(settings);
-    QObject::connect(lotro_mgr_thread, &QThread::finished, lotro_mgr, &QObject::deleteLater, Qt::QueuedConnection);
-    lotro_mgr->moveToThread(lotro_mgr_thread);
+    lotro_mgr_thread = new QThread();
+    lotro_manager = new LotroManager(settings);
+    QObject::connect(lotro_mgr_thread, &QThread::finished, lotro_manager, &QObject::deleteLater, Qt::QueuedConnection);
+    lotro_manager->moveToThread(lotro_mgr_thread);
     lotro_mgr_thread->start();
 
     qDebug() << "Creating widgets";
     qDebug() << "1";
-    browse_widget = new BrowseWidget(lotro_mgr, settings, this);
+    browse_widget = new BrowseWidget(lotro_manager, settings, this);
     qDebug() << "2";
-    import_widget = new ImportWidget(lotro_mgr, settings, this);
+    import_widget = new ImportWidget(lotro_manager, settings, this);
     qDebug() << "3";
-    export_widget = new ExportWidget(lotro_mgr, settings, this);
+    export_widget = new ExportWidget(lotro_manager, settings, this);
     qDebug() << "4";
-    manage_widget = new ManageWidget(lotro_mgr, settings, this);
+    manage_widget = new ManageWidget(lotro_manager, settings, this);
+    connect(manage_widget, &ManageWidget::disableMenuItems, this, &MainWindow::disableMenuItems);
+    connect(manage_widget, &ManageWidget::enableMenuItems, this, &MainWindow::enableMenuItems);
+
+    qDebug() << "5";
+    lotro_progress_widget = new LotroProgressWidget(lotro_manager, settings, this);
+
     qDebug() << "Done. Adding to layouts";
     ui->content_layout->addWidget(export_widget);
     ui->content_layout->addWidget(import_widget);
     ui->content_layout->addWidget(manage_widget);
     ui->content_layout->addWidget(browse_widget);
+    ui->content_layout->addWidget(lotro_progress_widget);
+    lotro_progress_widget->hide();
 
     ui->centralWidget->setStyleSheet("");
 
     hideAllContentWidgets();
     manage_widget->show();
 
+
     qDebug() << "Making fonts and making background";
     changeFontSizeRecursive(100, this);
 
@@ -67,8 +76,16 @@ MainWindow::MainWindow(QWidget *parent) :
     connect(&background_update_timer, &QTimer::timeout, this, &MainWindow::randomChangeBackground);
     background_update_timer.start();
 
-    qDebug() << "Finighing main frame initialisation";
+    qDebug() << "Initialising main window connections";
+    makeConnections();
+
+    qDebug() << "Finishing main frame initialisation";
     show();
+
+    qDebug() << "Starting dat file initialisation";
+    QMetaObject::invokeMethod(lotro_manager, "initialiseDatFile", Qt::QueuedConnection,
+                              Q_ARG(QString, settings->value("advanced/dat_path").toString()));
+
 }
 
 void MainWindow::mousePressEvent(QMouseEvent *event)
@@ -103,6 +120,22 @@ void MainWindow::resizeEvent(QResizeEvent * event)
     setupWindowBackgroundAndMask(current_bg);
 }
 
+void MainWindow::enableMenuItems()
+{
+    ui->menuentry_1_common->setEnabled(true);
+    ui->menuentry_2_common->setEnabled(true);
+    ui->menuentry_3_common->setEnabled(true);
+    ui->menuentry_4_common->setEnabled(true);
+}
+
+void MainWindow::disableMenuItems()
+{
+    ui->menuentry_1_common->setEnabled(false);
+    ui->menuentry_2_common->setEnabled(false);
+    ui->menuentry_3_common->setEnabled(false);
+    ui->menuentry_4_common->setEnabled(false);
+}
+
 void MainWindow::randomChangeBackground()
 {
     if (!qApp)
@@ -141,7 +174,6 @@ void MainWindow::randomChangeBackground()
     });
 }
 
-
 MainWindow::~MainWindow()
 {
     delete ui;
@@ -189,6 +221,35 @@ void MainWindow::setupWindowBackgroundAndMask(QPixmap background)
     setPalette(palette);
 }
 
+void MainWindow::onLotroManagerStarted(QString, QVector<QVariant>)
+{
+    hideAllContentWidgets();
+    lotro_progress_widget->updateUI();
+    lotro_progress_widget->show();
+    disableMenuItems();
+}
+
+void MainWindow::onLotroManagerFinished(QString, QVector<QVariant>)
+{
+    hideAllContentWidgets();
+    lotro_progress_widget->hide();
+
+    emit MenuEntry::getActiveLabel()->clicked();
+    if (lotro_manager->initialised())
+        enableMenuItems();
+}
+
+void MainWindow::onLotroManagerErrorOccured(QString, QVector<QVariant>) {
+    QMessageBox::warning(nullptr, "Ошибка ядра Наследия!", "Случилась ошибка! Всё очень плохо! (надо добавить информацию об ошибке)");
+}
+
+void MainWindow::makeConnections()
+{
+    connect(lotro_manager, &LotroManager::processStarted, this, &MainWindow::onLotroManagerStarted, Qt::QueuedConnection);
+    connect(lotro_manager, &LotroManager::processFinished, this, &MainWindow::onLotroManagerFinished, Qt::QueuedConnection);
+    connect(lotro_manager, &LotroManager::caughtError, this, &MainWindow::onLotroManagerErrorOccured, Qt::QueuedConnection);
+}
+
 void MainWindow::setupMenuHoverWidget()
 {
     menuHoverWidget = new QWidget(ui->menu_widget);

+ 15 - 7
src/Legacy-advanced/widgets/mainwindow.h

@@ -11,6 +11,7 @@
 #include "importwidget.h"
 #include "managewidget.h"
 #include "browsewidget.h"
+#include "lotroprogresswidget.h"
 
 namespace Ui {
 class MainWindow;
@@ -22,13 +23,9 @@ class LotroManager;
 class MainWindow : public QMainWindow
 {
     Q_OBJECT
-    struct PixmapObertka{
-        QPixmap* pixmap;
-    };
 
 public:
     explicit MainWindow(QWidget *parent = 0);
-    void Init();
     void changeFontSizeRecursive(size_t percent, QWidget* widget);
     ~MainWindow();
 
@@ -37,6 +34,10 @@ protected:
     void mousePressEvent(QMouseEvent *event) override;
     void resizeEvent(QResizeEvent *event) override;
 
+public slots:
+    void enableMenuItems();
+    void disableMenuItems();
+
 private slots:
     void randomChangeBackground();
 
@@ -54,11 +55,17 @@ private slots:
 
     void on_minimizeButton_clicked();
 
-
-private slots:
     void setupWindowBackgroundAndMask(QPixmap background);
 
+    void onLotroManagerStarted(QString, QVector<QVariant>);
+
+    void onLotroManagerFinished(QString, QVector<QVariant>);
+
+    void onLotroManagerErrorOccured(QString, QVector<QVariant>);
+
 private:
+    void makeConnections();
+
     void setupMenuHoverWidget();
 
     void moveMenuHoverWidget(MenuEntry* target);
@@ -77,6 +84,7 @@ private:
     ImportWidget *import_widget;
     ManageWidget *manage_widget;
     BrowseWidget *browse_widget;
+    LotroProgressWidget *lotro_progress_widget;
 
     QWidget* menuHoverWidget;
     QPropertyAnimation* menuHoverWidgetAnimation;
@@ -90,7 +98,7 @@ private:
     QBitmap current_mask;
     QTimer background_update_timer;
 
-    const int MAX_PIXMAP_ID = 9;
+    const int MAX_PIXMAP_ID = 14;
 
     const size_t common_font_size = 15;
     const size_t title_font_size = 17;

+ 1 - 1
src/Legacy-advanced/widgets/mainwindow.ui

@@ -416,7 +416,7 @@ QScrollBar:vertical {
       </rect>
      </property>
      <property name="styleSheet">
-      <string notr="true">QWidget#content_area_layout{\nborder:none;background: transparent;\n}</string>
+      <string notr="true">QWidget#content_area_layout{border:none;background: transparent;}</string>
      </property>
      <layout class="QGridLayout" name="content_layout">
       <property name="leftMargin">

+ 75 - 25
src/Legacy-advanced/widgets/managewidget.cpp

@@ -1,19 +1,17 @@
-#include "gui/managewidget.h"
+#include "managewidget.h"
 #include "ui_managewidget.h"
-#include "legacyapp.h"
-#include "filesystem.h"
+#include "models/lotromanager.h"
+#include "models/filesystem.h"
+#include "widgets/mainwindow.h"
 #include <QMessageBox>
 #include <QFileDialog>
+#include <QDebug>
 
-ManageWidget::ManageWidget(LegacyApp *_app, QWidget *parent) :
-    QWidget(parent), app(_app),
-    ui(new Ui::ManageWidget)
+ManageWidget::ManageWidget(LotroManager* mgr, QSettings* settings, QWidget *parent) :
+    QWidget(parent), lotro_manager(mgr), settings(settings), ui(new Ui::ManageWidget)
 {
     ui->setupUi(this);
-
-    uiUpdateTimer.setInterval(30);
-    connect(&uiUpdateTimer, &QTimer::timeout, this, &ManageWidget::updateUI);
-    uiUpdateTimer.start();
+    connect(lotro_manager, &LotroManager::processFinished, this, &ManageWidget::onLotroManagerProcessFinished, Qt::QueuedConnection);
 }
 
 ManageWidget::~ManageWidget()
@@ -23,24 +21,27 @@ ManageWidget::~ManageWidget()
 
 void ManageWidget::updateUI()
 {
-    auto res = app->client_local_dat.GetIO().GetFilename();
-    if (res.result == LOTRO_DAT::SUCCESS)
-        ui->datfile_name_common->setText(QString::fromStdString(res.value));
-    else
-        ui->datfile_name_common->setText("(файл не инициализирован)");
-
-    if (app->client_local_dat.Initialized()) {
+    if (lotro_manager->initialised()) {
         ui->open_status_title->show();
         ui->close_status_title->hide();
+        ui->initButton_common->hide();
+        ui->deinitButton_common->show();
+
+        ui->changeLocaleButton_common->setEnabled(true);
+        ui->createCoreStatusFile_button_common->setEnabled(true);
+        ui->activate_category_button->setEnabled(true);
+        ui->deactivate_category_button->setEnabled(true);
+
+        emit enableMenuItems();
 
         // Updating patched status label
-        if (app->client_local_dat.GetStatusModule().CheckIfNotPatched())
+        if (lotro_manager->notPatched())
             ui->not_patched_status_title->show();
         else
             ui->not_patched_status_title->hide();
 
         // Updating current locale status label
-        if (app->client_local_dat.GetLocaleManager().GetCurrentLocale() == LOTRO_DAT::DatLocaleManager::PATCHED) {
+        if (lotro_manager->currentLocale() == int(LOTRO_DAT::DatLocaleManager::PATCHED)) {
             ui->original_locale_title->hide();
             ui->patched_locale_title->show();
         } else {
@@ -49,31 +50,80 @@ void ManageWidget::updateUI()
         }
 
     } else {
+        ui->initButton_common->show();
+        ui->deinitButton_common->hide();
+
+        ui->changeLocaleButton_common->setEnabled(false);
+        ui->createCoreStatusFile_button_common->setEnabled(false);
+        ui->activate_category_button->setEnabled(false);
+        ui->deactivate_category_button->setEnabled(false);
+
+        emit disableMenuItems();
+
         ui->open_status_title->hide();
         ui->close_status_title->show();
         ui->not_patched_status_title->hide();
     }
+}
+
+void ManageWidget::onLotroManagerProcessFinished(QString proc_name, QVector<QVariant> data) {
+    if (proc_name == "initialiseDatFile" && data[0].toString() == "Success") {
+        settings->setValue("advanced/dat_path", data[1].toString());
+        settings->sync();
+        ui->datfile_name_common->setText(data[1].toString());
+    }
+
+    if (proc_name == "initialiseDatFile" && data[0].toString() == "Error") {
+        settings->setValue("advanced/dat_path", "");
+        settings->sync();
+        ui->datfile_name_common->setText("Ошибка инициализации, файл не выбран");
+    }
 
+    updateUI();
 }
 
 void ManageWidget::on_change_folder_button_clicked()
 {
     QStringList known_paths = FileSystem::recognizeRegistryLotroPath();
     QString template_path = known_paths.size() > 0 ? known_paths[0] : "";
-    QString str = QFileDialog::getOpenFileName(0, "Расположение файла .dat", template_path, "*.dat");
+    QString fileName = QFileDialog::getOpenFileName(0, "Расположение файла .dat", template_path, "*.dat");
 
-    app->properties.setValue("advanced/dat_path", str);
-    app->properties.sync();
+    if (fileName.isEmpty())
+            return;
 
-    app->InitialiseDatFile();
+    QMetaObject::invokeMethod(lotro_manager, "initialiseDatFile", Qt::QueuedConnection,
+                              Q_ARG(QString, fileName));
 }
 
 void ManageWidget::on_changeLocaleButton_common_clicked()
 {
-    app->ChangeLocale();
+    QMetaObject::invokeMethod(lotro_manager, "changeLocale", Qt::QueuedConnection);
 }
 
 void ManageWidget::on_createCoreStatusFile_button_common_clicked()
 {
-    app->CreateCoreStatusFile(app->properties.value("advanced/export_folder", "").toString());
+    QString fileName = QFileDialog::getSaveFileName(this->parentWidget(), "Сохранение файла",
+                               settings->value("advanced/export_path", "").toString(), "Файл ядра Наследия (*.txt);;Все файлы (*)");
+    if (fileName.isEmpty())
+            return;
+
+    settings->setValue("advanced/export_path", fileName.left(std::max(fileName.lastIndexOf('/'), fileName.lastIndexOf('\\'))));
+    settings->sync();
+
+    qDebug() << "Saving export path to " << settings->value("advanced/export_path", "").toString();
+
+    QMetaObject::invokeMethod(lotro_manager, "createCoreStatusFile", Qt::QueuedConnection,
+                              Q_ARG(QString, fileName));
+}
+
+void ManageWidget::on_initButton_common_clicked()
+{
+
+    QMetaObject::invokeMethod(lotro_manager, "initialiseDatFile", Qt::QueuedConnection,
+                              Q_ARG(QString, settings->value("advanced/dat_path", "").toString()));
+}
+
+void ManageWidget::on_deinitButton_common_clicked()
+{
+    QMetaObject::invokeMethod(lotro_manager, "deinitialiseDatFile", Qt::QueuedConnection);
 }

+ 15 - 3
src/Legacy-advanced/widgets/managewidget.h

@@ -3,33 +3,45 @@
 
 #include <QWidget>
 #include <QTimer>
+#include <QSettings>
 
 namespace Ui {
 class ManageWidget;
 }
 
-class LegacyApp;
+class LotroManager;
 
 class ManageWidget : public QWidget
 {
     Q_OBJECT
 
 public:
-    explicit ManageWidget(LegacyApp *_app, QWidget *parent = 0);
+    explicit ManageWidget(LotroManager* mgr, QSettings* settings, QWidget *parent = 0);
     ~ManageWidget();
 
+signals:
+    void disableMenuItems();
+    void enableMenuItems();
+
 public slots:
     void updateUI();
 
 private slots:
+    void onLotroManagerProcessFinished(QString, QVector<QVariant>);
+
     void on_change_folder_button_clicked();
 
     void on_changeLocaleButton_common_clicked();
 
     void on_createCoreStatusFile_button_common_clicked();
 
+    void on_initButton_common_clicked();
+
+    void on_deinitButton_common_clicked();
+
 private:
-    LegacyApp *app;
+    LotroManager* lotro_manager;
+    QSettings* settings;
     Ui::ManageWidget *ui;
 
     QTimer uiUpdateTimer;

+ 22 - 13
src/Legacy-advanced/widgets/managewidget.ui

@@ -6,8 +6,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>891</width>
-    <height>473</height>
+    <width>883</width>
+    <height>522</height>
    </rect>
   </property>
   <property name="windowTitle">
@@ -28,8 +28,7 @@
       </sizepolicy>
      </property>
      <property name="styleSheet">
-      <string notr="true">border-radius: 20px;
-background-color: rgba(30, 0, 0, 100);</string>
+      <string notr="true"/>
      </property>
      <layout class="QHBoxLayout" name="horizontalLayout_15">
       <item>
@@ -56,7 +55,7 @@ background-color: none;</string>
 background-color: none;</string>
         </property>
         <property name="text">
-         <string>D:\Programming\SourceRepos\Legacy_v2</string>
+         <string>Файл не выбран</string>
         </property>
        </widget>
       </item>
@@ -78,7 +77,7 @@ background-color: none;</string>
          <cursorShape>PointingHandCursor</cursorShape>
         </property>
         <property name="styleSheet">
-         <string notr="true">border-image: url(:/assets/buttons/folder.png);
+         <string notr="true">border-image: url(:/buttons/folder.png);
 
 background-color: none;</string>
         </property>
@@ -99,8 +98,7 @@ background-color: none;</string>
       </sizepolicy>
      </property>
      <property name="styleSheet">
-      <string notr="true">border-radius: 20px;
-background-color: rgba(30, 0, 0, 100);</string>
+      <string notr="true"/>
      </property>
      <layout class="QGridLayout" name="gridLayout">
       <item row="3" column="0">
@@ -243,16 +241,13 @@ color:gold;</string>
       </sizepolicy>
      </property>
      <property name="styleSheet">
-      <string notr="true">QWidget#export_folder_widget_3{
-	border-radius: 20px;
-	background-color: rgba(30, 0, 0, 100);
-}</string>
+      <string notr="true"/>
      </property>
      <layout class="QGridLayout" name="gridLayout_13">
       <item row="0" column="1">
        <widget class="QLabel" name="label">
         <property name="text">
-         <string>(нет)</string>
+         <string>(нет) (функция пока недоступна)</string>
         </property>
        </widget>
       </item>
@@ -396,6 +391,20 @@ background-color: none;</string>
      </layout>
     </widget>
    </item>
+   <item>
+    <widget class="QPushButton" name="initButton_common">
+     <property name="text">
+      <string>Инициализировать</string>
+     </property>
+    </widget>
+   </item>
+   <item>
+    <widget class="QPushButton" name="deinitButton_common">
+     <property name="text">
+      <string>Деинициализировать</string>
+     </property>
+    </widget>
+   </item>
    <item>
     <widget class="QPushButton" name="changeLocaleButton_common">
      <property name="text">

+ 4 - 76
src/Legacy-advanced/widgets/messagedialog.cpp

@@ -1,19 +1,17 @@
-#include "gui\messagedialog.h"
+#include "messagedialog.h"
 #include "ui_messagedialog.h"
 #include <QPixmap>
 #include <QBitmap>
 #include <QMouseEvent>
-#include "legacyapp.h"
+#include "models/lotromanager.h"
 #include <QTextCodec>
 using namespace LOTRO_DAT;
 
-MessageDialog::MessageDialog(LegacyApp *app_, QWidget *parent) :
-    QDialog(parent),
-    ui(new Ui::MessageDialog), app(app_)
+MessageDialog::MessageDialog(QWidget *parent) :
+    QDialog(parent), ui(new Ui::MessageDialog)
 {
     ui->setupUi(this);
     setModal(true);
-    setWindowTitle("Выполнение операции...");
     QPixmap background(":/assets/backgrounds/process_dialog.png");
 
     QPixmap current_bg = background.scaled(width(), height(), Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
@@ -24,88 +22,18 @@ MessageDialog::MessageDialog(LegacyApp *app_, QWidget *parent) :
     palette.setBrush(QPalette::Window, current_bg);
     setPalette(palette);
 
-    loader.setFileName(":/assets/backgrounds/loading-gear.gif");
-    ui->loader->setMovie(&loader);
-    loader.setScaledSize(ui->loader->size());
-    loader.start();
-
-    uiUpdateTimer.setInterval(30);
-    connect(&uiUpdateTimer, &QTimer::timeout, this, &MessageDialog::updateUI);
-    uiUpdateTimer.start();
 }
 
 void MessageDialog::mousePressEvent(QMouseEvent *event)
 {
-    if (event->button() == Qt::LeftButton) {
-        dragPosition = event->globalPos() - frameGeometry().topLeft();
-        event->accept();
-    }
 }
 
 void MessageDialog::updateUI()
 {
-    if (!qApp)
-        return;
-
-    std::string debug_msg = app->client_local_dat.GetStatusModule().GetDebugMessage();
-    QTextCodec *codec = QTextCodec::codecForName("UTF8");
-    QByteArray ba(debug_msg.c_str());
-    QString dmsg = codec->toUnicode(ba);
-
-    int percentage = app->client_local_dat.GetStatusModule().GetPercentage();
-
-    DatStatus::DAT_STATUS status = app->client_local_dat.GetStatusModule().GetStatus();
-    QString title = "";
-
-    switch (status) {
-    case DatStatus::E_INITIALISING:
-        title = "Инициализация";
-        break;
-    case DatStatus::E_EXTRACTING:
-        title = "Извлечение данных";
-        break;
-    case DatStatus::E_PATCHING:
-        title = "Применение патча";
-        break;
-    case DatStatus::E_COMMITING:
-        title = "Фиксация данных";
-        break;
-    case DatStatus::E_BACKUP_CREATING:
-        title = "Создание резервной копии";
-        break;
-    case DatStatus::E_BACKUP_REMOVING:
-        title = "Удаление резервной копии";
-        break;
-    case DatStatus::E_GATHERING_INFO:
-        title = "Сбор информации ядра";
-        break;
-    case DatStatus::E_FREE:
-        title = "Свободен";
-        break;
-    default:
-        title = "Неизвестная операция";
-        break;
-    }
-
-    if (status == DatStatus::E_FREE)
-        hide();
-    else
-        show();
-
-    ui->title->setText(title);
-    ui->progressBar->setValue(percentage);
-    ui->debug_info->setText(dmsg);
 }
 
 void MessageDialog::mouseMoveEvent(QMouseEvent *event)
 {
-    if (event->buttons() & Qt::LeftButton) {
-        move(event->globalPos() - dragPosition);
-        app->window.move(event->globalPos() - dragPosition +
-                         QPoint((width() - app->window.width()) / 2, (height() - app->window.height()) / 2)
-                         );
-        event->accept();
-    }
 }
 
 MessageDialog::~MessageDialog()

+ 1 - 5
src/Legacy-advanced/widgets/messagedialog.h

@@ -9,14 +9,12 @@ namespace Ui {
 class MessageDialog;
 }
 
-class LegacyApp;
-
 class MessageDialog : public QDialog
 {
     Q_OBJECT
 
 public:
-    explicit MessageDialog(LegacyApp *app_, QWidget *parent = 0);
+    explicit MessageDialog(QWidget *parent = 0);
     ~MessageDialog();
     void setMessage(QString title, QString msg);
 
@@ -29,8 +27,6 @@ public slots:
 
 private:
     Ui::MessageDialog *ui;
-
-    LegacyApp* app;
     QPoint dragPosition;
 };
 

+ 0 - 89
src/Legacy-advanced/widgets/processdialog.ui

@@ -1,89 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>ProcessDialog</class>
- <widget class="QDialog" name="ProcessDialog">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>420</width>
-    <height>280</height>
-   </rect>
-  </property>
-  <property name="windowTitle">
-   <string>Dialog</string>
-  </property>
-  <widget class="QLabel" name="loader">
-   <property name="geometry">
-    <rect>
-     <x>190</x>
-     <y>15</y>
-     <width>40</width>
-     <height>40</height>
-    </rect>
-   </property>
-   <property name="text">
-    <string/>
-   </property>
-  </widget>
-  <widget class="QLabel" name="title">
-   <property name="geometry">
-    <rect>
-     <x>50</x>
-     <y>90</y>
-     <width>311</width>
-     <height>40</height>
-    </rect>
-   </property>
-   <property name="font">
-    <font>
-     <family>a_AlgeriusNr</family>
-     <pointsize>14</pointsize>
-    </font>
-   </property>
-   <property name="styleSheet">
-    <string notr="true">color:white</string>
-   </property>
-   <property name="text">
-    <string>Название</string>
-   </property>
-   <property name="alignment">
-    <set>Qt::AlignCenter</set>
-   </property>
-  </widget>
-  <widget class="QProgressBar" name="progressBar">
-   <property name="geometry">
-    <rect>
-     <x>50</x>
-     <y>130</y>
-     <width>321</width>
-     <height>31</height>
-    </rect>
-   </property>
-   <property name="styleSheet">
-    <string notr="true">color: white;</string>
-   </property>
-   <property name="value">
-    <number>0</number>
-   </property>
-  </widget>
-  <widget class="QLabel" name="debug_info">
-   <property name="geometry">
-    <rect>
-     <x>50</x>
-     <y>200</y>
-     <width>311</width>
-     <height>51</height>
-    </rect>
-   </property>
-   <property name="styleSheet">
-    <string notr="true">color: gray;</string>
-   </property>
-   <property name="text">
-    <string>TextLabel</string>
-   </property>
-  </widget>
- </widget>
- <resources/>
- <connections/>
-</ui>

+ 1 - 1
src/Legacy/Legacy_resource.rc

@@ -12,7 +12,7 @@ VS_VERSION_INFO VERSIONINFO
 	FILEFLAGS 0x0L
 #endif
 	FILEOS VOS__WINDOWS32
-	FILETYPE VFT_DLL
+	FILETYPE VFT_APP
 	FILESUBTYPE 0x0L
 	BEGIN
 		BLOCK "StringFileInfo"

+ 1 - 0
src/Legacy/gui/rusificationwidget.cpp

@@ -2,6 +2,7 @@
 #include "ui_rusificationwidget.h"
 #include "legacyapp.h"
 #include "rusificationtreeitem.h"
+#include <QDebug>
 
 void doStuffWithEveryItemInMyTree( QTreeWidgetItem *item )
 {

+ 1 - 0
src/Legacy/object_script.Legacy.Debug

@@ -13,6 +13,7 @@ INPUT(
 ./..\..\build\debug\Legacy\obj\helpwidget.o
 ./..\..\build\debug\Legacy\obj\networkdownloader.o
 ./..\..\build\debug\Legacy\obj\rusificationtreeitem.o
+./..\..\build\debug\Legacy\obj\legacy_plugin_import.o
 ./..\..\build\debug\Legacy\obj\moc_mainwindow.o
 ./..\..\build\debug\Legacy\obj\moc_menuentry.o
 ./..\..\build\debug\Legacy\obj\moc_legacyapp.o

+ 1 - 0
src/Legacy/object_script.Legacy.Release

@@ -11,6 +11,7 @@ INPUT(
 ./..\..\build\release\Legacy\obj\helpwidget.o
 ./..\..\build\release\Legacy\obj\networkdownloader.o
 ./..\..\build\release\Legacy\obj\rusificationtreeitem.o
+./..\..\build\release\Legacy\obj\legacy_plugin_import.o
 ./..\..\build\release\Legacy\obj\moc_mainwindow.o
 ./..\..\build\release\Legacy\obj\moc_menuentry.o
 ./..\..\build\release\Legacy\obj\moc_legacyapp.o

+ 1 - 0
src/Legacy/src/networkdownloader.cpp

@@ -1,6 +1,7 @@
 #include "networkdownloader.h"
 #include <QEventLoop>
 #include <QApplication>
+#include <QDebug>
 
 NetworkDownloader::NetworkDownloader(QObject *parent) :QObject(parent), busy(false)
 {