check if settingsdialog is called from ingame and disable reset settings
button
This commit is contained in:
@@ -605,7 +605,8 @@ gameTableImpl::~gameTableImpl()
|
||||
|
||||
void gameTableImpl::callSettingsDialog()
|
||||
{
|
||||
myStartWindow->callSettingsDialog();
|
||||
bool iamInGame = true;
|
||||
myStartWindow->callSettingsDialog(iamInGame);
|
||||
}
|
||||
|
||||
void gameTableImpl::applySettings(settingsDialogImpl* mySettingsDialog)
|
||||
|
||||
@@ -3701,7 +3701,7 @@ p, li { white-space: pre-wrap; }
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<item row="6" column="1">
|
||||
<spacer name="verticalSpacer_6">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
@@ -3721,6 +3721,18 @@ p, li { white-space: pre-wrap; }
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0" colspan="2">
|
||||
<widget class="QLabel" name="label_resetNote">
|
||||
<property name="font">
|
||||
<font>
|
||||
<italic>true</italic>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Note: You can not reset all settings to default during a running game!</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
|
||||
@@ -486,11 +486,22 @@ void settingsDialogImpl::prepareDialog()
|
||||
|
||||
//set this AFTER switch combobox like config-settings. This IS a currentIndexChanged() ;-)
|
||||
languageIsChanged = FALSE;
|
||||
|
||||
//disable reset config button when dialog is called from ingame
|
||||
if(calledIngame) {
|
||||
pushButton_resetSettings->setDisabled(true);
|
||||
label_resetNote->show();
|
||||
}
|
||||
else {
|
||||
pushButton_resetSettings->setEnabled(true);
|
||||
label_resetNote->hide();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void settingsDialogImpl::exec()
|
||||
void settingsDialogImpl::exec(bool in_game)
|
||||
{
|
||||
|
||||
calledIngame = in_game;
|
||||
prepareDialog();
|
||||
QDialog::exec();
|
||||
|
||||
@@ -1371,7 +1382,7 @@ void settingsDialogImpl::showLogFilePreview()
|
||||
void settingsDialogImpl::resetSettings()
|
||||
{
|
||||
int ret = QMessageBox::warning(this, tr("PokerTH - Settings"),
|
||||
tr("Attention: this will delete all your personal settings!\n"
|
||||
tr("Attention: this will delete all your personal settings and close PokerTH!\n"
|
||||
"Do you really want to reset factory settings?"),
|
||||
QMessageBox::Yes | QMessageBox::No);
|
||||
if(ret == QMessageBox::Yes)
|
||||
|
||||
@@ -44,7 +44,7 @@ public:
|
||||
~settingsDialogImpl();
|
||||
|
||||
void prepareDialog();
|
||||
void exec();
|
||||
void exec(bool ingame);
|
||||
|
||||
void setPlayerNickIsChanged(bool theValue) {
|
||||
playerNickIsChanged = theValue;
|
||||
@@ -142,6 +142,7 @@ private:
|
||||
QString myAppDataPath;
|
||||
|
||||
bool languageIsChanged;
|
||||
bool calledIngame;
|
||||
int changedLanguageIndex;
|
||||
};
|
||||
|
||||
|
||||
@@ -110,7 +110,7 @@ startWindowImpl::startWindowImpl(ConfigFile *c, Log *l)
|
||||
connect( pushButton_Join_Network_Game, SIGNAL( clicked() ), this, SLOT( callJoinNetworkGameDialog() ) );
|
||||
|
||||
connect( actionAbout_PokerTH, SIGNAL( triggered() ), this, SLOT( callAboutPokerthDialog() ) );
|
||||
connect( actionConfigure_PokerTH, SIGNAL( triggered() ), this, SLOT( callSettingsDialog() ) );
|
||||
connect( actionConfigure_PokerTH, SIGNAL( triggered() ), this, SLOT( callSettingsDialogFromStartwindow() ) );
|
||||
|
||||
|
||||
connect(this, SIGNAL(signalShowClientDialog()), this, SLOT(showClientDialog()));
|
||||
@@ -587,10 +587,14 @@ void startWindowImpl::callAboutPokerthDialog()
|
||||
myAboutPokerthDialog->exec();
|
||||
}
|
||||
|
||||
void startWindowImpl::callSettingsDialog()
|
||||
void startWindowImpl::callSettingsDialogFromStartwindow()
|
||||
{
|
||||
callSettingsDialog(false);
|
||||
}
|
||||
|
||||
mySettingsDialog->exec();
|
||||
void startWindowImpl::callSettingsDialog(bool ingame)
|
||||
{
|
||||
mySettingsDialog->exec(ingame);
|
||||
|
||||
if (mySettingsDialog->result() == QDialog::Accepted && mySettingsDialog->getSettingsCorrect()) {
|
||||
myGuiInterface->getMyW()->applySettings(mySettingsDialog);
|
||||
|
||||
@@ -126,7 +126,8 @@ signals:
|
||||
public slots:
|
||||
|
||||
void callAboutPokerthDialog();
|
||||
void callSettingsDialog();
|
||||
void callSettingsDialog(bool);
|
||||
void callSettingsDialogFromStartwindow();
|
||||
void callNewGameDialog();
|
||||
void callGameLobbyDialog();
|
||||
void callCreateNetworkGameDialog();
|
||||
|
||||
Reference in New Issue
Block a user