Reload Button don't get removed, string update

This commit is contained in:
Rafael 2016-04-11 17:18:16 +02:00
parent 3be65a3edb
commit 31d58d5b53
6 changed files with 67 additions and 79 deletions

View File

@ -99,26 +99,15 @@ void UserInterface::setupDirEnv()
void UserInterface::setupProfileUi(QStringList GTAV_Profiles) void UserInterface::setupProfileUi(QStringList GTAV_Profiles)
{ {
bool profilesFound = true;
if (GTAV_Profiles.length() == 0) if (GTAV_Profiles.length() == 0)
{ {
profilesFound = false; QPushButton *changeDirBtn = new QPushButton(tr("Select GTA V &Folder..."), ui->swSelection);
QPushButton *reloadBtn = new QPushButton(tr("&Reload"), ui->swSelection);
reloadBtn->setObjectName("cmdReload");
reloadBtn->setMinimumSize(0, 40);
reloadBtn->setAutoDefault(true);
ui->vlButtons->addWidget(reloadBtn);
profileBtns.append(reloadBtn);
QPushButton *changeDirBtn = new QPushButton(tr("Change GTA V &Folder"), ui->swSelection);
changeDirBtn->setObjectName("cmdChangeDir"); changeDirBtn->setObjectName("cmdChangeDir");
changeDirBtn->setMinimumSize(0, 40); changeDirBtn->setMinimumSize(0, 40);
changeDirBtn->setAutoDefault(true); changeDirBtn->setAutoDefault(true);
ui->vlButtons->addWidget(changeDirBtn); ui->vlButtons->addWidget(changeDirBtn);
profileBtns.append(changeDirBtn); profileBtns.append(changeDirBtn);
QObject::connect(reloadBtn, SIGNAL(clicked(bool)), this, SLOT(reloadProfiles_clicked()));
QObject::connect(changeDirBtn, SIGNAL(clicked(bool)), this, SLOT(changeFolder_clicked())); QObject::connect(changeDirBtn, SIGNAL(clicked(bool)), this, SLOT(changeFolder_clicked()));
} }
else foreach(const QString &GTAV_Profile, GTAV_Profiles) else foreach(const QString &GTAV_Profile, GTAV_Profiles)
@ -132,16 +121,6 @@ void UserInterface::setupProfileUi(QStringList GTAV_Profiles)
QObject::connect(profileBtn, SIGNAL(clicked(bool)), this, SLOT(profileButton_clicked())); QObject::connect(profileBtn, SIGNAL(clicked(bool)), this, SLOT(profileButton_clicked()));
} }
if (profilesFound)
{
QPushButton *reloadBtn = new QPushButton(tr("&Reload"), ui->swSelection);
reloadBtn->setObjectName("cmdReload");
reloadBtn->setAutoDefault(true);
ui->hlButtons->insertWidget(1, reloadBtn);
profileBtns.append(reloadBtn);
QObject::connect(reloadBtn, SIGNAL(clicked(bool)), this, SLOT(reloadProfiles_clicked()));
}
profileBtns.at(0)->setFocus(); profileBtns.at(0)->setFocus();
} }
@ -152,11 +131,11 @@ void UserInterface::changeFolder_clicked()
{ {
QDir::setCurrent(GTAV_Folder); QDir::setCurrent(GTAV_Folder);
AppEnv::setGameFolder(GTAV_Folder); AppEnv::setGameFolder(GTAV_Folder);
reloadProfiles_clicked(); on_cmdReload_clicked();
} }
} }
void UserInterface::reloadProfiles_clicked() void UserInterface::on_cmdReload_clicked()
{ {
foreach(QPushButton *profileBtn, profileBtns) foreach(QPushButton *profileBtn, profileBtns)
{ {

View File

@ -44,7 +44,7 @@ private slots:
void profileLoaded(); void profileLoaded();
void changeFolder_clicked(); void changeFolder_clicked();
void profileButton_clicked(); void profileButton_clicked();
void reloadProfiles_clicked(); void on_cmdReload_clicked();
void on_actionExit_triggered(); void on_actionExit_triggered();
void on_actionSelect_profile_triggered(); void on_actionSelect_profile_triggered();
void on_actionAbout_gta5sync_triggered(); void on_actionAbout_gta5sync_triggered();

View File

@ -97,6 +97,13 @@
</property> </property>
</spacer> </spacer>
</item> </item>
<item>
<widget class="QPushButton" name="cmdReload">
<property name="text">
<string>&amp;Reload</string>
</property>
</widget>
</item>
<item> <item>
<widget class="QPushButton" name="cmdClose"> <widget class="QPushButton" name="cmdClose">
<property name="text"> <property name="text">

View File

@ -723,63 +723,63 @@ Export as:</source>
<translation>Выбор профиля</translation> <translation>Выбор профиля</translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.ui" line="129"/> <location filename="../UserInterface.ui" line="136"/>
<source>&amp;File</source> <source>&amp;File</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.ui" line="136"/> <location filename="../UserInterface.ui" line="143"/>
<source>&amp;Help</source> <source>&amp;Help</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.ui" line="142"/> <location filename="../UserInterface.ui" line="149"/>
<source>&amp;Edit</source> <source>&amp;Edit</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.ui" line="146"/> <location filename="../UserInterface.ui" line="153"/>
<source>&amp;Profile</source> <source>&amp;Profile</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.ui" line="164"/> <location filename="../UserInterface.ui" line="171"/>
<source>&amp;About gta5sync</source> <source>&amp;About gta5sync</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.ui" line="103"/> <location filename="../UserInterface.ui" line="110"/>
<location filename="../UserInterface.ui" line="172"/> <location filename="../UserInterface.ui" line="179"/>
<source>&amp;Close</source> <source>&amp;Close</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.ui" line="188"/> <location filename="../UserInterface.ui" line="195"/>
<source>&amp;Options</source> <source>&amp;Options</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.ui" line="196"/> <location filename="../UserInterface.ui" line="203"/>
<source>Select &amp;All</source> <source>Select &amp;All</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.ui" line="204"/> <location filename="../UserInterface.ui" line="211"/>
<source>&amp;Deselect All</source> <source>&amp;Deselect All</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.ui" line="212"/> <location filename="../UserInterface.ui" line="219"/>
<source>&amp;Export selected...</source> <source>&amp;Export selected...</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.ui" line="220"/> <location filename="../UserInterface.ui" line="227"/>
<source>&amp;Remove selected</source> <source>&amp;Remove selected</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.ui" line="223"/> <location filename="../UserInterface.ui" line="230"/>
<source>Ctrl+R</source> <source>Ctrl+R</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
@ -796,7 +796,7 @@ Export as:</source>
<translation type="obsolete">О программе gta5sync</translation> <translation type="obsolete">О программе gta5sync</translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.ui" line="167"/> <location filename="../UserInterface.ui" line="174"/>
<source>Ctrl+A</source> <source>Ctrl+A</source>
<translation>Ctrl+A</translation> <translation>Ctrl+A</translation>
</message> </message>
@ -805,55 +805,55 @@ Export as:</source>
<translation type="obsolete">Закрыть</translation> <translation type="obsolete">Закрыть</translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.ui" line="175"/> <location filename="../UserInterface.ui" line="182"/>
<source>Ctrl+Q</source> <source>Ctrl+Q</source>
<translation>Ctrl+Q</translation> <translation>Ctrl+Q</translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.ui" line="180"/> <location filename="../UserInterface.ui" line="187"/>
<source>Select &amp;Profile</source> <source>Select &amp;Profile</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.ui" line="183"/> <location filename="../UserInterface.ui" line="190"/>
<source>Ctrl+P</source> <source>Ctrl+P</source>
<translation>Ctrl+P</translation> <translation>Ctrl+P</translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.ui" line="191"/> <location filename="../UserInterface.ui" line="198"/>
<source>Ctrl+O</source> <source>Ctrl+O</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.ui" line="199"/> <location filename="../UserInterface.ui" line="206"/>
<source>Ctrl+S</source> <source>Ctrl+S</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.ui" line="215"/> <location filename="../UserInterface.ui" line="222"/>
<source>Ctrl+E</source> <source>Ctrl+E</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.ui" line="207"/> <location filename="../UserInterface.ui" line="214"/>
<source>Ctrl+D</source> <source>Ctrl+D</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.cpp" line="49"/> <location filename="../UserInterface.cpp" line="49"/>
<location filename="../UserInterface.cpp" line="199"/> <location filename="../UserInterface.cpp" line="178"/>
<source>Select Profile</source> <source>Select Profile</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.cpp" line="62"/> <location filename="../UserInterface.cpp" line="62"/>
<location filename="../UserInterface.cpp" line="150"/> <location filename="../UserInterface.cpp" line="129"/>
<source>Select GTA V Folder...</source> <source>Select GTA V Folder...</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.cpp" line="114"/> <location filename="../UserInterface.cpp" line="104"/>
<source>Change GTA V &amp;Folder</source> <source>Select GTA V &amp;Folder...</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
@ -861,8 +861,7 @@ Export as:</source>
<translation type="vanished">gta5sync</translation> <translation type="vanished">gta5sync</translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.cpp" line="107"/> <location filename="../UserInterface.ui" line="103"/>
<location filename="../UserInterface.cpp" line="137"/>
<source>&amp;Reload</source> <source>&amp;Reload</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>

Binary file not shown.

View File

@ -914,7 +914,7 @@ Exportieren als:</translation>
<translation type="obsolete">Über gta5sync</translation> <translation type="obsolete">Über gta5sync</translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.ui" line="167"/> <location filename="../UserInterface.ui" line="174"/>
<source>Ctrl+A</source> <source>Ctrl+A</source>
<translation>Strg+A</translation> <translation>Strg+A</translation>
</message> </message>
@ -927,7 +927,7 @@ Exportieren als:</translation>
<translation type="obsolete">Optionen</translation> <translation type="obsolete">Optionen</translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.ui" line="191"/> <location filename="../UserInterface.ui" line="198"/>
<source>Ctrl+O</source> <source>Ctrl+O</source>
<translation>Strg+O</translation> <translation>Strg+O</translation>
</message> </message>
@ -936,7 +936,7 @@ Exportieren als:</translation>
<translation type="obsolete">Alles auswählen</translation> <translation type="obsolete">Alles auswählen</translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.ui" line="199"/> <location filename="../UserInterface.ui" line="206"/>
<source>Ctrl+S</source> <source>Ctrl+S</source>
<translation>Strg+S</translation> <translation>Strg+S</translation>
</message> </message>
@ -953,7 +953,7 @@ Exportieren als:</translation>
<translation type="obsolete">Auswahl exportieren</translation> <translation type="obsolete">Auswahl exportieren</translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.ui" line="215"/> <location filename="../UserInterface.ui" line="222"/>
<source>Ctrl+E</source> <source>Ctrl+E</source>
<translation>Strg+E</translation> <translation>Strg+E</translation>
</message> </message>
@ -962,7 +962,7 @@ Exportieren als:</translation>
<translation type="obsolete">Auswahl löschen</translation> <translation type="obsolete">Auswahl löschen</translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.ui" line="207"/> <location filename="../UserInterface.ui" line="214"/>
<source>Ctrl+D</source> <source>Ctrl+D</source>
<translation>Strg+D</translation> <translation>Strg+D</translation>
</message> </message>
@ -971,7 +971,7 @@ Exportieren als:</translation>
<translation type="obsolete">Schließen</translation> <translation type="obsolete">Schließen</translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.ui" line="175"/> <location filename="../UserInterface.ui" line="182"/>
<source>Ctrl+Q</source> <source>Ctrl+Q</source>
<translation>Strg+Q</translation> <translation>Strg+Q</translation>
</message> </message>
@ -981,73 +981,73 @@ Exportieren als:</translation>
<translation>Profil auswählen</translation> <translation>Profil auswählen</translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.ui" line="129"/> <location filename="../UserInterface.ui" line="136"/>
<source>&amp;File</source> <source>&amp;File</source>
<translation>&amp;Datei</translation> <translation>&amp;Datei</translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.ui" line="136"/> <location filename="../UserInterface.ui" line="143"/>
<source>&amp;Help</source> <source>&amp;Help</source>
<translation>&amp;Hilfe</translation> <translation>&amp;Hilfe</translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.ui" line="142"/> <location filename="../UserInterface.ui" line="149"/>
<source>&amp;Edit</source> <source>&amp;Edit</source>
<translation>Bearb&amp;eiten</translation> <translation>Bearb&amp;eiten</translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.ui" line="146"/> <location filename="../UserInterface.ui" line="153"/>
<source>&amp;Profile</source> <source>&amp;Profile</source>
<translation>&amp;Profil</translation> <translation>&amp;Profil</translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.ui" line="164"/> <location filename="../UserInterface.ui" line="171"/>
<source>&amp;About gta5sync</source> <source>&amp;About gta5sync</source>
<translation>&amp;Über gta5sync</translation> <translation>&amp;Über gta5sync</translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.ui" line="103"/> <location filename="../UserInterface.ui" line="110"/>
<location filename="../UserInterface.ui" line="172"/> <location filename="../UserInterface.ui" line="179"/>
<source>&amp;Close</source> <source>&amp;Close</source>
<translation>&amp;Schließen</translation> <translation>&amp;Schließen</translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.ui" line="180"/> <location filename="../UserInterface.ui" line="187"/>
<source>Select &amp;Profile</source> <source>Select &amp;Profile</source>
<translation>&amp;Profil auswählen</translation> <translation>&amp;Profil auswählen</translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.ui" line="183"/> <location filename="../UserInterface.ui" line="190"/>
<source>Ctrl+P</source> <source>Ctrl+P</source>
<translation>Strg+P</translation> <translation>Strg+P</translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.ui" line="188"/> <location filename="../UserInterface.ui" line="195"/>
<source>&amp;Options</source> <source>&amp;Options</source>
<translation>&amp;Optionen</translation> <translation>&amp;Optionen</translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.ui" line="196"/> <location filename="../UserInterface.ui" line="203"/>
<source>Select &amp;All</source> <source>Select &amp;All</source>
<translation>&amp;Alles auswählen</translation> <translation>&amp;Alles auswählen</translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.ui" line="204"/> <location filename="../UserInterface.ui" line="211"/>
<source>&amp;Deselect All</source> <source>&amp;Deselect All</source>
<translation>Alles a&amp;bwählen</translation> <translation>Alles a&amp;bwählen</translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.ui" line="212"/> <location filename="../UserInterface.ui" line="219"/>
<source>&amp;Export selected...</source> <source>&amp;Export selected...</source>
<translation>Auswahl &amp;exportieren...</translation> <translation>Auswahl &amp;exportieren...</translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.ui" line="220"/> <location filename="../UserInterface.ui" line="227"/>
<source>&amp;Remove selected</source> <source>&amp;Remove selected</source>
<translation>Auswahl entfe&amp;rnen</translation> <translation>Auswahl entfe&amp;rnen</translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.ui" line="223"/> <location filename="../UserInterface.ui" line="230"/>
<source>Ctrl+R</source> <source>Ctrl+R</source>
<translation>Strg+R</translation> <translation>Strg+R</translation>
</message> </message>
@ -1057,20 +1057,24 @@ Exportieren als:</translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.cpp" line="49"/> <location filename="../UserInterface.cpp" line="49"/>
<location filename="../UserInterface.cpp" line="199"/> <location filename="../UserInterface.cpp" line="178"/>
<source>Select Profile</source> <source>Select Profile</source>
<translation>Profil auswählen</translation> <translation>Profil auswählen</translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.cpp" line="62"/> <location filename="../UserInterface.cpp" line="62"/>
<location filename="../UserInterface.cpp" line="150"/> <location filename="../UserInterface.cpp" line="129"/>
<source>Select GTA V Folder...</source> <source>Select GTA V Folder...</source>
<translation>Wähle GTA V Ordner...</translation> <translation>Wähle GTA V Ordner...</translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.cpp" line="114"/> <location filename="../UserInterface.cpp" line="104"/>
<source>Select GTA V &amp;Folder...</source>
<translation>Wähle GTA V &amp;Ordner...</translation>
</message>
<message>
<source>Change GTA V &amp;Folder</source> <source>Change GTA V &amp;Folder</source>
<translation>GTA V &amp;Ordner ändern</translation> <translation type="vanished">GTA V &amp;Ordner ändern</translation>
</message> </message>
<message> <message>
<source>gta5sync</source> <source>gta5sync</source>
@ -1081,8 +1085,7 @@ Exportieren als:</translation>
<translation type="vanished">Grand Theft Auto V Ordner wurde nicht gefunden!</translation> <translation type="vanished">Grand Theft Auto V Ordner wurde nicht gefunden!</translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.cpp" line="107"/> <location filename="../UserInterface.ui" line="103"/>
<location filename="../UserInterface.cpp" line="137"/>
<source>&amp;Reload</source> <source>&amp;Reload</source>
<translation>&amp;Neuladen</translation> <translation>&amp;Neuladen</translation>
</message> </message>