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 7946fd5..f7349b5 100755 Binary files a/res/gta5sync_de.qm and b/res/gta5sync_de.qm differ diff --git a/res/gta5sync_de.ts b/res/gta5sync_de.ts index d3d8a64..8904ee0 100755 --- a/res/gta5sync_de.ts +++ b/res/gta5sync_de.ts @@ -1,6 +1,6 @@ - + AboutDialog @@ -9,7 +9,31 @@ Über gta5sync - + + <span style=" font-weight:600;">gta5sync</span><br/> +<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