From 1dcd468f3037c0375213dbffa02e52e5cf814c20 Mon Sep 17 00:00:00 2001 From: Rafael Date: Tue, 26 Jul 2016 08:00:56 +0200 Subject: [PATCH] added non-restricted Custom Folder and Select GTA V Folder support --- OptionsDialog.cpp | 33 +++++++ OptionsDialog.h | 2 + OptionsDialog.ui | 32 ++++++- UserInterface.cpp | 22 +++-- UserInterface.h | 1 + UserInterface.ui | 29 ++++-- lang/gta5sync_ru.ts | 195 +++++++++++++++++++++++---------------- res/gta5sync_de.qm | Bin 22753 -> 23392 bytes res/gta5sync_de.ts | 216 +++++++++++++++++++++++++++++--------------- 9 files changed, 364 insertions(+), 166 deletions(-) diff --git a/OptionsDialog.cpp b/OptionsDialog.cpp index d78088e..b252916 100755 --- a/OptionsDialog.cpp +++ b/OptionsDialog.cpp @@ -18,10 +18,13 @@ #include "OptionsDialog.h" #include "ui_OptionsDialog.h" +#include "StandardPaths.h" +#include "UserInterface.h" #include "AppEnv.h" #include "config.h" #include #include +#include #include #include #include @@ -59,6 +62,7 @@ OptionsDialog::OptionsDialog(ProfileDatabase *profileDB, QWidget *parent) : setupRadioButtons(); setupDefaultProfile(); setupPictureSettings(); + setupCustomGTAFolder(); } OptionsDialog::~OptionsDialog() @@ -236,6 +240,11 @@ void OptionsDialog::applySettings() settings->setValue("AspectRatio", aspectRatio); settings->endGroup(); + settings->beginGroup("dir"); + settings->setValue("dir", ui->txtFolder->text()); + settings->setValue("force", ui->cbForceCustomFolder->isChecked()); + settings->endGroup(); + #if QT_VERSION >= 0x050000 emit settingsApplied(newContentMode, ui->cbLanguage->currentData().toString()); #else @@ -369,3 +378,27 @@ void OptionsDialog::on_cbIgnoreAspectRatio_toggled(bool checked) aspectRatio = Qt::KeepAspectRatio; } } + +void OptionsDialog::setupCustomGTAFolder() +{ + bool ok; + QString defaultGameFolder = AppEnv::getGameFolder(&ok); + settings->beginGroup("dir"); + QString customGameFolder = settings->value("dir", "").toString(); + if (customGameFolder == "" && ok) + { + customGameFolder = defaultGameFolder; + } + ui->txtFolder->setText(customGameFolder); + ui->cbForceCustomFolder->setChecked(settings->value("force", false).toBool()); + settings->endGroup(); +} + +void OptionsDialog::on_cmdExploreFolder_clicked() +{ + QString GTAV_Folder = QFileDialog::getExistingDirectory(this, UserInterface::tr("Select GTA V Folder..."), StandardPaths::documentsLocation(), QFileDialog::ShowDirsOnly); + if (QFileInfo(GTAV_Folder).exists()) + { + ui->txtFolder->setText(GTAV_Folder); + } +} diff --git a/OptionsDialog.h b/OptionsDialog.h index b446ccd..4fcdeaa 100755 --- a/OptionsDialog.h +++ b/OptionsDialog.h @@ -45,6 +45,7 @@ private slots: void on_cbPicCustomQuality_toggled(bool checked); void on_hsPicQuality_valueChanged(int value); void on_cbIgnoreAspectRatio_toggled(bool checked); + void on_cmdExploreFolder_clicked(); signals: void settingsApplied(int contentMode, QString language); @@ -68,6 +69,7 @@ private: void setupRadioButtons(); void setupDefaultProfile(); void setupPictureSettings(); + void setupCustomGTAFolder(); void applySettings(); }; diff --git a/OptionsDialog.ui b/OptionsDialog.ui index 0c1c460..38eae9b 100755 --- a/OptionsDialog.ui +++ b/OptionsDialog.ui @@ -24,7 +24,7 @@ - Profile + Profiles @@ -72,6 +72,36 @@ + + + + Custom GTA V Folder + + + + + + Force using Custom Folder + + + + + + + + + + + + ... + + + + + + + + diff --git a/UserInterface.cpp b/UserInterface.cpp index 3ce3f28..fb2c6f8 100755 --- a/UserInterface.cpp +++ b/UserInterface.cpp @@ -120,7 +120,7 @@ void UserInterface::setupProfileUi() { if (GTAV_Profiles.length() == 0) { - QPushButton *changeDirBtn = new QPushButton(tr("Select GTA V &Folder..."), ui->swSelection); + QPushButton *changeDirBtn = new QPushButton(tr("Select >A V Folder..."), ui->swSelection); changeDirBtn->setObjectName("cmdChangeDir"); changeDirBtn->setMinimumSize(0, 40); changeDirBtn->setAutoDefault(true); @@ -145,13 +145,7 @@ void UserInterface::setupProfileUi() void UserInterface::changeFolder_clicked() { - GTAV_Folder = QFileDialog::getExistingDirectory(this, tr("Select GTA V Folder..."), StandardPaths::documentsLocation(), QFileDialog::ShowDirsOnly); - if (QFileInfo(GTAV_Folder).exists()) - { - QDir::setCurrent(GTAV_Folder); - AppEnv::setGameFolder(GTAV_Folder); - on_cmdReload_clicked(); - } + on_actionSelect_GTA_Folder_triggered(); } void UserInterface::on_cmdReload_clicked() @@ -446,3 +440,15 @@ void UserInterface::settingsApplied(int _contentMode, QString _language) profileUI->settingsApplied(contentMode, language); } } + +void UserInterface::on_actionSelect_GTA_Folder_triggered() +{ + QString GTAV_Folder_Temp = QFileDialog::getExistingDirectory(this, tr("Select GTA V Folder..."), StandardPaths::documentsLocation(), QFileDialog::ShowDirsOnly); + if (QFileInfo(GTAV_Folder_Temp).exists()) + { + GTAV_Folder = GTAV_Folder_Temp; + QDir::setCurrent(GTAV_Folder); + AppEnv::setGameFolder(GTAV_Folder); + on_cmdReload_clicked(); + } +} diff --git a/UserInterface.h b/UserInterface.h index a3dc952..b2dd941 100755 --- a/UserInterface.h +++ b/UserInterface.h @@ -57,6 +57,7 @@ private slots: void on_actionOptions_triggered(); void on_action_Import_triggered(); void on_actionOpen_File_triggered(); + void on_actionSelect_GTA_Folder_triggered(); void settingsApplied(int contentMode, QString language); private: diff --git a/UserInterface.ui b/UserInterface.ui index 314e74e..02e61d6 100755 --- a/UserInterface.ui +++ b/UserInterface.ui @@ -128,13 +128,14 @@ 0 0 625 - 25 + 21 &File + @@ -201,7 +202,8 @@ - + + .. &Settings @@ -212,7 +214,8 @@ - + + .. Select &All @@ -223,7 +226,8 @@ - + + .. &Deselect All @@ -234,7 +238,8 @@ - + + .. &Export selected... @@ -253,7 +258,8 @@ - + + .. &Import files... @@ -274,6 +280,17 @@ Ctrl+O + + + Select &GTA V Folder... + + + Select GTA V Folder... + + + Ctrl+G + + diff --git a/lang/gta5sync_ru.ts b/lang/gta5sync_ru.ts index 5ee8251..1f45176 100755 --- a/lang/gta5sync_ru.ts +++ b/lang/gta5sync_ru.ts @@ -1,6 +1,6 @@ - + AboutDialog @@ -9,10 +9,11 @@ О программе gta5sync - + <span style=" font-weight:600;">gta5sync</span><br/> <br/> -A project for viewing and sync Grand Theft Auto 5 Snapmatic Pictures and Savegames<br/> +A project for viewing and sync Grand Theft Auto V Snapmatic<br/> +Pictures and Savegames<br/> <br/> Project version: %1<br/> Project build: %4, %5<br/> @@ -23,7 +24,7 @@ Copyright &copy; <a href="https://github.com/Syping/">Syping - + &Close @@ -106,11 +107,6 @@ Copyright &copy; <a href="https://github.com/Syping/">Syping gta5sync - Settings - - - Profile - - Content Open/Select Mode @@ -137,137 +133,157 @@ Copyright &copy; <a href="https://github.com/Syping/">Syping - + Pictures - + Export Size - + Screen Resolution: %1x%2 - + Default: %1x%2 - - + + Profiles + + + + + Custom GTA V Folder + + + + + Force using Custom Folder + + + + + ... + + + + + Custom Size: - + x - + Ignore Aspect Ratio - + Export Quality - + Enable Custom Quality - + Quality: - + %1% - + Players - + ID - + Name - - + + Language - + Sync - + Sync is not implemented at current time - + &OK OK, Cancel, Apply - + &Cancel OK, Cancel, Apply - + System System like PC System - + %1 (%2 if available) System like PC System = %1, System Language like Deutsch = %2 - + %1 %1 - + The language change will take effect after you restart %1. - + No Profile No Profile, as default - - - + + + Profile: %1 @@ -512,25 +528,25 @@ Copyright &copy; <a href="https://github.com/Syping/">Syping - + All profile files (SGTA* PGTA*) Все файлы профиля (SGTA* PGTA*) - + Savegames files (SGTA*) Файлы сохранения (SGTA*) - + Snapmatic pictures (PGTA*) Картинка Snapmatic (PGTA*) - + All files (**) Все файлы (**) @@ -543,13 +559,13 @@ Copyright &copy; <a href="https://github.com/Syping/">Syping - + Failed to read Snapmatic picture Не удалось загрузить картинку Snapmatic - + Failed to read Savegame file Не удалось загрузить файл сохранения @@ -561,7 +577,7 @@ Copyright &copy; <a href="https://github.com/Syping/">Syping - + No valid file is selected Выбранный файл неверен @@ -680,6 +696,19 @@ Copyright &copy; <a href="https://github.com/Syping/">Syping + + QApplication + + + Font + + + + + Selected Font: %1 + + + SavegameDialog @@ -1000,87 +1029,97 @@ Copyright &copy; <a href="https://github.com/Syping/">Syping - + &Help - + &Edit - + &Profile - + &About gta5sync - + &Exit - + Exit - + Close &Profile - + Ctrl+End - + &Settings - + Ctrl+Del - + &Import files... - + Ctrl+I + + + Select &GTA V Folder... + + + + + Ctrl+G + + &Close - + Select &All - + &Deselect All - + &Export selected... - + &Remove selected @@ -1097,7 +1136,7 @@ Copyright &copy; <a href="https://github.com/Syping/">Syping О программе gta5sync - + Ctrl+A Ctrl+A @@ -1106,49 +1145,51 @@ Copyright &copy; <a href="https://github.com/Syping/">Syping Закрыть - + Ctrl+Q Ctrl+Q - + Ctrl+P Ctrl+P - + &Open File... - + Ctrl+O - + Ctrl+S - + Ctrl+E - + Ctrl+D - + Select Profile + + - + Select GTA V Folder... @@ -1158,20 +1199,20 @@ Copyright &copy; <a href="https://github.com/Syping/">Syping - + Open File... - - - - + + + + Open File - + Can't open %1 because of not valid file format diff --git a/res/gta5sync_de.qm b/res/gta5sync_de.qm index 7946fd5a78fed1ea13770ec7bf613008b34a1caf..f7349b5f33df0404ef40572af84e98662bea84d5 100755 GIT binary patch delta 2180 zcmY+E4OCO-9mby|H@V48LO`Mjf~Hj{f(CK&Ay7(02;Yc&WbK)*3bCS)ctWtQXCreh zT|IT`ddqA(r*u>5L1(Q|TXl6)#?*NVR#~^BuB{H%aonl(gG!y1J>l-K_T=3B?tS0) z|GfXN_r3Ox>eHjDZPq{$fDM5DV}+5w2hRnDHE4^tKCBMfgZV&20NVaDz@mRDEJ=j^&85`UBk2U~0;NAh zQb?fm7?Li;17+1n`u9BYMI?s|vwo*=@kuY77Fd zD!?*=Jq-~+h805toY%MEmZt)Eq(UWKodYa9s4)M)I0Gn6QLU;Qp{Ku9T`GOZ=&Y(Q z%+Y-11RKCcUyX0|_3zvi@?vZbhUy*&}7;CH+_HAXnRq3RP zTtjNeox=V(dl=bw6&4l>Z$Iw>#PdS``d2xAO=00#;p!*tK+GKBU&~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<br/> +A project for viewing and sync Grand Theft Auto V Snapmatic<br/> +Pictures and Savegames<br/> +<br/> +Project version: %1<br/> +Project build: %4, %5<br/> +Compiled with Qt %2<br/> +Running with Qt %3<br/> +<br/> +Copyright &copy; <a href="https://github.com/Syping/">Syping</a> 2016<br/>gta5sync is licensed under <a href="https://www.gnu.org/licenses/gpl-3.0.html#content">GNU GPLv3</a> + <span style=" font-weight:600;">gta5sync</span><br/> +<br/> +Ein Projekt zum ansehen und synchronisieren von<br/> +Grand Theft Auto V Snapmatic Bilder und Spielständen<br/> +<br/> +Projektversion: %1<br/> +Projektbau: %4, %5<br/> +Gebaut mit Qt %2<br/> +Läuft auf Qt %3<br/> +<br/> +Copyright &copy; <a href="https://github.com/Syping/">Syping</a> 2016<br/>gta5sync is lizenziert unter <a href="https://www.gnu.org/licenses/gpl-3.0.html#content">GNU GPLv3</a> + + <span style=" font-weight:600;">gta5sync</span><br/> <br/> A project for viewing and sync Grand Theft Auto 5 Snapmatic Pictures and Savegames<br/> @@ -20,7 +44,7 @@ Compiled with Qt %2<br/> Running with Qt %3<br/> <br/> Copyright &copy; <a href="https://github.com/Syping/">Syping</a> 2016<br/>gta5sync is licensed under <a href="https://www.gnu.org/licenses/gpl-3.0.html#content">GNU GPLv3</a> - <span style=" font-weight:600;">gta5sync</span><br/> + <span style=" font-weight:600;">gta5sync</span><br/> <br/> Ein Projekt zum ansehen und synchronisieren von Grand Theft Auto 5 Snapmatic Bilder und Spielständen<br/> <br/> @@ -32,7 +56,7 @@ Läuft auf Qt %3<br/> Copyright &copy; <a href="https://github.com/Syping/">Syping</a> 2016<br/>gta5sync is lizenziert unter <a href="https://www.gnu.org/licenses/gpl-3.0.html#content">GNU GPLv3</a> - + &Close S&chließen @@ -140,9 +164,8 @@ Copyright &copy; <a href="https://github.com/Syping/">Syping gta5sync - Einstellungen - Profile - Profil + Profil @@ -170,12 +193,12 @@ Copyright &copy; <a href="https://github.com/Syping/">Syping Standardprofil - + Pictures Bilder - + Export Size Export Größe @@ -188,7 +211,7 @@ Copyright &copy; <a href="https://github.com/Syping/">Syping Desktop Größe: %1x%2 - + Screen Resolution: %1x%2 Bildschirmauflösung: %1x%2 @@ -197,85 +220,105 @@ Copyright &copy; <a href="https://github.com/Syping/">Syping Eigene Größe - + + Profiles + Profile + + + + Custom GTA V Folder + Eigener GTA V Ordner + + + + Force using Custom Folder + Nutzung vom eigenen Ordner erzwingen + + + + ... + ... + + + Default: %1x%2 Standard: %1x%2 - - + + Custom Size: Eigene Größe: - + x x - + Ignore Aspect Ratio Seitenverhältnis ignorieren - + Export Quality Export Qualität - + Enable Custom Quality Eigene Export Qualität benutzen - + Quality: Qualität: - + %1% %1% - + Players Spieler - + ID ID - + Name Name - - + + Language Sprache - + Sync Sync - + Sync is not implemented at current time Sync wurde bisher nicht implementiert - + &OK OK, Cancel, Apply &OK - + &Cancel OK, Cancel, Apply Abbre&chen @@ -286,38 +329,38 @@ Copyright &copy; <a href="https://github.com/Syping/">Syping %1 (%2 wenn verfügbar) [sys] - + System System like PC System System - + %1 (%2 if available) System like PC System = %1, System Language like Deutsch = %2 %1 (%2 wenn verfügbar) - + %1 %1 %1 - + The language change will take effect after you restart %1. Die Änderung der Sprache nimmt Effekt sobald du %1 neugestartet hast. - + No Profile No Profile, as default Kein Profil - - - + + + Profile: %1 Profil: %1 @@ -636,25 +679,25 @@ Copyright &copy; <a href="https://github.com/Syping/">Syping - + All profile files (SGTA* PGTA*) Alle Profildateien (SGTA* PGTA*) - + Savegames files (SGTA*) Spielstanddateien (SGTA*) - + Snapmatic pictures (PGTA*) Snapmatic Bilder (PGTA*) - + All files (**) Alle Dateien (**) @@ -669,13 +712,13 @@ Copyright &copy; <a href="https://github.com/Syping/">Syping - + Failed to read Snapmatic picture Fehler beim Lesen vom Snapmatic Bild - + Failed to read Savegame file Fehler beim Lesen von Spielstanddatei @@ -692,7 +735,7 @@ Copyright &copy; <a href="https://github.com/Syping/">Syping - + No valid file is selected Keine gültige Datei wurde ausgewählt @@ -856,6 +899,19 @@ Exportieren als: Exportiere Datei %1 von %2 Dateien + + QApplication + + + Font + Schrift + + + + Selected Font: %1 + Ausgewähle Schrift: %1 + + SavegameDialog @@ -1274,7 +1330,7 @@ Exportieren als: Über gta5sync - + Ctrl+A Strg+A @@ -1287,7 +1343,7 @@ Exportieren als: Optionen - + Ctrl+O Strg+O @@ -1296,7 +1352,7 @@ Exportieren als: Alles auswählen - + Ctrl+S Strg+S @@ -1313,7 +1369,7 @@ Exportieren als: Auswahl exportieren - + Ctrl+E Strg+E @@ -1322,22 +1378,22 @@ Exportieren als: Auswahl löschen - + Ctrl+D Strg+D - + Exit Beenden - + &Exit B&eenden - + Ctrl+Q Strg+Q @@ -1352,45 +1408,55 @@ Exportieren als: &Datei - + &Help &Hilfe - + &Edit Bearb&eiten - + &Profile &Profil - + &About gta5sync &Über gta5sync - + Close &Profile &Profil schließen - + Ctrl+End Strg+Ende - + Ctrl+Del Strg+Entf - + &Open File... Datei &öffnen... + + + Select &GTA V Folder... + Wähle &GTA V Ordner... + + + + Ctrl+G + Strg+G + &Close @@ -1401,7 +1467,7 @@ Exportieren als: &Profil auswählen - + Ctrl+P Strg+P @@ -1410,27 +1476,27 @@ Exportieren als: &Optionen - + &Settings Ein&stellungen - + Select &All &Alles auswählen - + &Deselect All Alles a&bwählen - + &Export selected... Auswahl &exportieren... - + &Remove selected Auswahl entfe&rnen @@ -1439,12 +1505,12 @@ Exportieren als: Strg+R - + &Import files... Dateien &importieren... - + Ctrl+I Strg+I @@ -1454,13 +1520,15 @@ Exportieren als: - + Select Profile Profil auswählen + + - + Select GTA V Folder... Wähle GTA V Ordner... @@ -1470,7 +1538,7 @@ Exportieren als: Wähle GTA V &Ordner... - + Open File... Datei öffnen... @@ -1479,15 +1547,15 @@ Exportieren als: Importieren - - - - + + + + Open File Datei öffnen - + Can't open %1 because of not valid file format Kann nicht %1 öffnen weil Dateiformat nicht gültig ist