OptionsDialog give informations at changing default Custom Folder

This commit is contained in:
Rafael 2016-07-26 08:22:10 +02:00
parent 1dcd468f30
commit b591ff45ac
5 changed files with 46 additions and 25 deletions

View file

@ -240,9 +240,10 @@ void OptionsDialog::applySettings()
settings->setValue("AspectRatio", aspectRatio);
settings->endGroup();
bool forceCustomFolder = ui->cbForceCustomFolder->isChecked();
settings->beginGroup("dir");
settings->setValue("dir", ui->txtFolder->text());
settings->setValue("force", ui->cbForceCustomFolder->isChecked());
settings->setValue("force", forceCustomFolder);
settings->endGroup();
#if QT_VERSION >= 0x050000
@ -256,6 +257,11 @@ void OptionsDialog::applySettings()
#else
bool languageChanged = ui->cbLanguage->itemData(ui->cbLanguage->currentIndex()).toString() != currentLanguage;
#endif
if (forceCustomFolder && ui->txtFolder->text() != currentCFolder || forceCustomFolder != currentFFolder && forceCustomFolder)
{
QMessageBox::information(this, tr("%1", "%1").arg(GTA5SYNC_APPSTR), tr("The new Custom Folder will initialize after you restart %1.").arg(GTA5SYNC_APPSTR));
}
if (languageChanged)
{
QMessageBox::information(this, tr("%1", "%1").arg(GTA5SYNC_APPSTR), tr("The language change will take effect after you restart %1.").arg(GTA5SYNC_APPSTR));
@ -384,13 +390,14 @@ void OptionsDialog::setupCustomGTAFolder()
bool ok;
QString defaultGameFolder = AppEnv::getGameFolder(&ok);
settings->beginGroup("dir");
QString customGameFolder = settings->value("dir", "").toString();
if (customGameFolder == "" && ok)
currentCFolder = settings->value("dir", "").toString();
currentFFolder = settings->value("force", false).toBool();
if (currentCFolder == "" && ok)
{
customGameFolder = defaultGameFolder;
currentCFolder = defaultGameFolder;
}
ui->txtFolder->setText(customGameFolder);
ui->cbForceCustomFolder->setChecked(settings->value("force", false).toBool());
ui->txtFolder->setText(currentCFolder);
ui->cbForceCustomFolder->setChecked(currentFFolder);
settings->endGroup();
}

View file

@ -56,9 +56,11 @@ private:
QList<QTreeWidgetItem*> playerItems;
Qt::AspectRatioMode aspectRatio;
QString currentLanguage;
QString currentCFolder;
QString defaultProfile;
QString percentString;
QSettings *settings;
bool currentFFolder;
int contentMode;
int customQuality;
int defaultQuality;

View file

@ -264,26 +264,32 @@ Copyright &amp;copy; &lt;a href=&quot;https://github.com/Syping/&quot;&gt;Syping
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../OptionsDialog.cpp" line="261"/>
<location filename="../OptionsDialog.cpp" line="263"/>
<location filename="../OptionsDialog.cpp" line="267"/>
<source>%1</source>
<comment>%1</comment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../OptionsDialog.cpp" line="261"/>
<location filename="../OptionsDialog.cpp" line="263"/>
<source>The new Custom Folder will initialize after you restart %1.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../OptionsDialog.cpp" line="267"/>
<source>The language change will take effect after you restart %1.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../OptionsDialog.cpp" line="271"/>
<location filename="../OptionsDialog.cpp" line="277"/>
<source>No Profile</source>
<comment>No Profile, as default</comment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../OptionsDialog.cpp" line="279"/>
<location filename="../OptionsDialog.cpp" line="283"/>
<location filename="../OptionsDialog.cpp" line="285"/>
<location filename="../OptionsDialog.cpp" line="289"/>
<location filename="../OptionsDialog.cpp" line="291"/>
<source>Profile: %1</source>
<translation type="unfinished"></translation>
</message>
@ -1090,6 +1096,7 @@ Copyright &amp;copy; &lt;a href=&quot;https://github.com/Syping/&quot;&gt;Syping
</message>
<message>
<location filename="../UserInterface.ui" line="285"/>
<location filename="../UserInterface.cpp" line="123"/>
<source>Select &amp;GTA V Folder...</source>
<translation type="unfinished"></translation>
</message>
@ -1187,17 +1194,12 @@ Copyright &amp;copy; &lt;a href=&quot;https://github.com/Syping/&quot;&gt;Syping
</message>
<message>
<location filename="../UserInterface.ui" line="288"/>
<location filename="../OptionsDialog.cpp" line="398"/>
<location filename="../OptionsDialog.cpp" line="406"/>
<location filename="../UserInterface.cpp" line="72"/>
<location filename="../UserInterface.cpp" line="446"/>
<source>Select GTA V Folder...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../UserInterface.cpp" line="123"/>
<source>Select GTA V &amp;Folder...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../UserInterface.cpp" line="303"/>
<source>Open File...</source>

Binary file not shown.

View file

@ -341,26 +341,36 @@ Copyright &amp;copy; &lt;a href=&quot;https://github.com/Syping/&quot;&gt;Syping
<translation>%1 (%2 wenn verfügbar)</translation>
</message>
<message>
<location filename="../OptionsDialog.cpp" line="261"/>
<location filename="../OptionsDialog.cpp" line="263"/>
<location filename="../OptionsDialog.cpp" line="267"/>
<source>%1</source>
<comment>%1</comment>
<translation>%1</translation>
</message>
<message>
<location filename="../OptionsDialog.cpp" line="261"/>
<location filename="../OptionsDialog.cpp" line="263"/>
<source>The new Custom Folder will initialize after you restart %1.</source>
<translation>Der eigene Ordner wird initialisiert sobald du %1 neugestartet hast.</translation>
</message>
<message>
<source>The new Custom Folder initialize after you restart %1.</source>
<translation type="vanished">Der eigene Ordner initialisiert sobald du %1 neugestartet hast.</translation>
</message>
<message>
<location filename="../OptionsDialog.cpp" line="267"/>
<source>The language change will take effect after you restart %1.</source>
<translation>Die Änderung der Sprache nimmt Effekt sobald du %1 neugestartet hast.</translation>
</message>
<message>
<location filename="../OptionsDialog.cpp" line="271"/>
<location filename="../OptionsDialog.cpp" line="277"/>
<source>No Profile</source>
<comment>No Profile, as default</comment>
<translation>Kein Profil</translation>
</message>
<message>
<location filename="../OptionsDialog.cpp" line="279"/>
<location filename="../OptionsDialog.cpp" line="283"/>
<location filename="../OptionsDialog.cpp" line="285"/>
<location filename="../OptionsDialog.cpp" line="289"/>
<location filename="../OptionsDialog.cpp" line="291"/>
<source>Profile: %1</source>
<translation>Profil: %1</translation>
</message>
@ -1449,6 +1459,7 @@ Exportieren als:</translation>
</message>
<message>
<location filename="../UserInterface.ui" line="285"/>
<location filename="../UserInterface.cpp" line="123"/>
<source>Select &amp;GTA V Folder...</source>
<translation>Wähle &amp;GTA V Ordner...</translation>
</message>
@ -1526,16 +1537,15 @@ Exportieren als:</translation>
</message>
<message>
<location filename="../UserInterface.ui" line="288"/>
<location filename="../OptionsDialog.cpp" line="398"/>
<location filename="../OptionsDialog.cpp" line="406"/>
<location filename="../UserInterface.cpp" line="72"/>
<location filename="../UserInterface.cpp" line="446"/>
<source>Select GTA V Folder...</source>
<translation>Wähle GTA V Ordner...</translation>
</message>
<message>
<location filename="../UserInterface.cpp" line="123"/>
<source>Select GTA V &amp;Folder...</source>
<translation>Wähle GTA V &amp;Ordner...</translation>
<translation type="vanished">Wähle GTA V &amp;Ordner...</translation>
</message>
<message>
<location filename="../UserInterface.cpp" line="303"/>