add switchLanguage ComboBox in Settings to change app language. add option to disable lobby-chat. string update
This commit is contained in:
@@ -52,7 +52,7 @@ ConfigFile::ConfigFile(int argc, char **argv) : noWriteAccess(0)
|
||||
if(strcmp(argv[i], "--nowriteaccess") == 0) { noWriteAccess = 1; }
|
||||
}
|
||||
// !!!! Revisionsnummer der Configdefaults !!!!!
|
||||
configRev = 45;
|
||||
configRev = 46;
|
||||
|
||||
//standard defaults
|
||||
logOnOffDefault = "1";
|
||||
@@ -207,6 +207,7 @@ ConfigFile::ConfigFile(int argc, char **argv) : noWriteAccess(0)
|
||||
configList.push_back(ConfigInfo("InternetServerUseSctp", CONFIG_TYPE_INT, "0"));
|
||||
configList.push_back(ConfigInfo("UseInternetGamePassword", CONFIG_TYPE_INT, "0"));
|
||||
configList.push_back(ConfigInfo("InternetGamePassword", CONFIG_TYPE_STRING, ""));
|
||||
configList.push_back(ConfigInfo("UseIRCLobbyChat", CONFIG_TYPE_INT, "1"));
|
||||
configList.push_back(ConfigInfo("IRCServerAddress", CONFIG_TYPE_STRING, "chat.freenode.net"));
|
||||
configList.push_back(ConfigInfo("IRCServerPort", CONFIG_TYPE_INT, "6667"));
|
||||
configList.push_back(ConfigInfo("IRCChannel", CONFIG_TYPE_STRING, "#pokerth-lobby"));
|
||||
|
||||
@@ -253,7 +253,10 @@ p, li { white-space: pre-wrap; }
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-weight:600;"> - <span style=" font-weight:400;">for different popular avatar picture resources</span></p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">Viktoria, Benedikt, Erhard, Felix, Florian, Linus, Lothar, Mark</span></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"> - for avatar pictures</p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"> - for people avatar pictures</p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">ZeiZei</span> </p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"> - for "misc" avatar pictures</p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="http://kde-look.org/"><span style=" font-weight:600; text-decoration: underline; color:#0000ff;">http://kde-look.org/</span></a></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"> - for different gpl lizensed sounds</p>
|
||||
|
||||
@@ -427,7 +427,7 @@
|
||||
</layout>
|
||||
</item>
|
||||
<item row="2" column="1" >
|
||||
<widget class="QGroupBox" name="groupBox" >
|
||||
<widget class="QGroupBox" name="groupBox_lobbyChat" >
|
||||
<property name="title" >
|
||||
<string>Lobby-Chat</string>
|
||||
</property>
|
||||
|
||||
@@ -46,6 +46,14 @@ void gameLobbyDialogImpl::exec()
|
||||
assert(mySession);
|
||||
mySession->terminateIrcClient();
|
||||
mySession->startIrcClient();
|
||||
|
||||
if(myConfig->readConfigInt("UseIRCLobbyChat")) {
|
||||
groupBox_lobbyChat->show();
|
||||
}
|
||||
else {
|
||||
groupBox_lobbyChat->hide();
|
||||
}
|
||||
|
||||
QDialog::exec();
|
||||
mySession->terminateIrcClient();
|
||||
}
|
||||
|
||||
@@ -71,68 +71,7 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="comboBox" >
|
||||
<item>
|
||||
<property name="text" >
|
||||
<string>Dutch</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text" >
|
||||
<string>English</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text" >
|
||||
<string>French</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text" >
|
||||
<string>German</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text" >
|
||||
<string>Hungarian</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text" >
|
||||
<string>Italian</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text" >
|
||||
<string>Norse</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text" >
|
||||
<string>Portuguese</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text" >
|
||||
<string>Russian</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text" >
|
||||
<string>Slovak</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text" >
|
||||
<string>Spanish</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text" >
|
||||
<string>Turkish</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
<widget class="QComboBox" name="comboBox_switchLanguage" />
|
||||
</item>
|
||||
<item>
|
||||
<spacer>
|
||||
@@ -1338,9 +1277,9 @@ p, li { white-space: pre-wrap; }
|
||||
</layout>
|
||||
</item>
|
||||
<item row="6" column="0" >
|
||||
<widget class="QGroupBox" name="groupBox_5" >
|
||||
<widget class="QGroupBox" name="groupBox_lobbyChat" >
|
||||
<property name="title" >
|
||||
<string>Lobby Chat (IRC Server)</string>
|
||||
<string>Enable/Disable Lobby Chat (IRC Server)</string>
|
||||
</property>
|
||||
<property name="checkable" >
|
||||
<bool>true</bool>
|
||||
@@ -2882,7 +2821,7 @@ p, li { white-space: pre-wrap; }
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_openLogDir" >
|
||||
<property name="icon" >
|
||||
<iconset/>
|
||||
<iconset>../../../../../../.designer/backup</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
@@ -41,6 +41,18 @@ settingsDialogImpl::settingsDialogImpl(QWidget *parent, ConfigFile *c, selectAva
|
||||
|
||||
if (myConfig->readConfigInt("CLA_NoWriteAccess")) { groupBox_logOnOff->setDisabled(TRUE); }
|
||||
|
||||
comboBox_switchLanguage->addItem(tr("Dutch"),"nl");
|
||||
comboBox_switchLanguage->addItem(tr("English"),"en");
|
||||
comboBox_switchLanguage->addItem(tr("French"),"fr");
|
||||
comboBox_switchLanguage->addItem(tr("German"),"de");
|
||||
comboBox_switchLanguage->addItem(tr("Hungarian"),"hu");
|
||||
comboBox_switchLanguage->addItem(tr("Italien"),"it");
|
||||
comboBox_switchLanguage->addItem(tr("Norse"),"no");
|
||||
comboBox_switchLanguage->addItem(tr("Portuguese"),"ptbr");
|
||||
comboBox_switchLanguage->addItem(tr("Russian"),"ru");
|
||||
comboBox_switchLanguage->addItem(tr("Solvak"),"sk");
|
||||
comboBox_switchLanguage->addItem(tr("Turkish"),"tr");
|
||||
|
||||
connect( buttonBox, SIGNAL( accepted() ), this, SLOT( isAccepted() ) );
|
||||
connect( lineEdit_HumanPlayerName, SIGNAL( textChanged( const QString &) ), this, SLOT( playerNickChanged() ) );
|
||||
connect( lineEdit_Opponent1Name, SIGNAL( textChanged(const QString &) ), this, SLOT( playerNickChanged() ) );
|
||||
@@ -69,6 +81,8 @@ settingsDialogImpl::settingsDialogImpl(QWidget *parent, ConfigFile *c, selectAva
|
||||
|
||||
connect( radioButton_netManualBlindsOrder, SIGNAL( toggled(bool) ), this, SLOT( setFirstSmallBlindMargin() ));
|
||||
connect( radioButton_manualBlindsOrder, SIGNAL( toggled(bool) ), this, SLOT( setFirstSmallBlindMargin() )); //temporarely unused until ai is enabled in network
|
||||
|
||||
connect( comboBox_switchLanguage, SIGNAL( currentIndexChanged (int) ), this, SLOT ( setLanguageChanged(int) ));
|
||||
// label_36->hide();
|
||||
// spinBox_netGameSpeed->hide();
|
||||
//
|
||||
@@ -82,6 +96,7 @@ void settingsDialogImpl::exec() {
|
||||
// page_4->hide();
|
||||
|
||||
playerNickIsChanged = FALSE;
|
||||
languageIsChanged = FALSE;
|
||||
|
||||
//Player Nicks
|
||||
lineEdit_HumanPlayerName->setText(QString::fromUtf8(myConfig->readConfigString("MyName").c_str()));
|
||||
@@ -149,12 +164,15 @@ void settingsDialogImpl::exec() {
|
||||
if(myConfig->readConfigInt("UseInternetGamePassword")) {
|
||||
lineEdit_InternetGamePassword->setText(QString::fromUtf8(myConfig->readConfigString("InternetGamePassword").c_str()));
|
||||
}
|
||||
groupBox_lobbyChat->setChecked(myConfig->readConfigInt("UseIRCLobbyChat"));
|
||||
lineEdit_IRCServerAddress->setText(QString::fromUtf8(myConfig->readConfigString("IRCServerAddress").c_str()));
|
||||
spinBox_IRCServerPort->setValue(myConfig->readConfigInt("IRCServerPort"));
|
||||
lineEdit_IRCChannel->setText(QString::fromUtf8(myConfig->readConfigString("IRCChannel").c_str()));
|
||||
checkBox_IRCServerUseIpv6->setChecked(myConfig->readConfigInt("IRCServerUseIpv6"));
|
||||
|
||||
//Interface
|
||||
|
||||
comboBox_switchLanguage->setCurrentIndex(comboBox_switchLanguage->findData(QString::fromUtf8(myConfig->readConfigString("Language").c_str()).section('_', 0, 0)));
|
||||
checkBox_showLeftToolbox->setChecked(myConfig->readConfigInt("ShowLeftToolBox"));
|
||||
checkBox_showRightToolbox->setChecked(myConfig->readConfigInt("ShowRightToolBox"));
|
||||
checkBox_showStatusbarMessages->setChecked(myConfig->readConfigInt("ShowStatusbarMessages"));
|
||||
@@ -273,12 +291,14 @@ void settingsDialogImpl::isAccepted() {
|
||||
myConfig->writeConfigInt("InternetServerUseSctp", checkBox_InternetServerUseSctp->isChecked());
|
||||
myConfig->writeConfigInt("UseInternetGamePassword", checkBox_UseInternetGamePassword->isChecked());
|
||||
myConfig->writeConfigString("InternetGamePassword", lineEdit_InternetGamePassword->text().toUtf8().constData());
|
||||
myConfig->writeConfigInt("UseIRCLobbyChat", groupBox_lobbyChat->isChecked());
|
||||
myConfig->writeConfigString("IRCServerAddress", lineEdit_IRCServerAddress->text().toUtf8().constData());
|
||||
myConfig->writeConfigInt("IRCServerPort", spinBox_IRCServerPort->value());
|
||||
myConfig->writeConfigString("IRCChannel", lineEdit_IRCChannel->text().toUtf8().constData());
|
||||
myConfig->writeConfigInt("IRCServerUseIpv6", checkBox_IRCServerUseIpv6->isChecked());
|
||||
|
||||
// Interface
|
||||
myConfig->writeConfigString("Language", comboBox_switchLanguage->itemData(comboBox_switchLanguage->currentIndex()).toString().toUtf8().constData());
|
||||
myConfig->writeConfigInt("ShowLeftToolBox", checkBox_showLeftToolbox->isChecked());
|
||||
myConfig->writeConfigInt("ShowRightToolBox", checkBox_showRightToolbox->isChecked());
|
||||
myConfig->writeConfigInt("ShowStatusbarMessages", checkBox_showStatusbarMessages->isChecked());
|
||||
@@ -343,6 +363,12 @@ void settingsDialogImpl::isAccepted() {
|
||||
//write buffer to disc
|
||||
myConfig->writeBuffer();
|
||||
|
||||
if(languageIsChanged) {
|
||||
QMessageBox::information(this, tr("Language Changed"),
|
||||
tr("You have changed application language to %1.\nPlease restart PokerTH to load new language!").arg(comboBox_switchLanguage->itemText(changedLanguageIndex)),
|
||||
QMessageBox::Ok);
|
||||
}
|
||||
|
||||
//Wenn alles richtig eingegeben wurde --> Dialog schließen
|
||||
if(settingsCorrect) { this->hide(); }
|
||||
}
|
||||
@@ -542,4 +568,11 @@ void settingsDialogImpl::setFirstSmallBlindMargin() {
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
void settingsDialogImpl::setLanguageChanged(int index) {
|
||||
|
||||
languageIsChanged = TRUE;
|
||||
changedLanguageIndex = index;
|
||||
|
||||
}
|
||||
|
||||
@@ -71,6 +71,8 @@ public slots:
|
||||
void checkProperNetFirstSmallBlind(int);
|
||||
void checkProperFirstSmallBlind(int);
|
||||
void setFirstSmallBlindMargin() ;
|
||||
|
||||
void setLanguageChanged(int);
|
||||
|
||||
private:
|
||||
|
||||
@@ -94,6 +96,9 @@ private:
|
||||
|
||||
QString myAppDataPath;
|
||||
|
||||
bool languageIsChanged;
|
||||
int changedLanguageIndex;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user