GUI: set default game settings for ranking game
This commit is contained in:
@@ -185,7 +185,7 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="6" column="0" colspan="2">
|
<item row="6" column="0" colspan="2">
|
||||||
<widget class="QGroupBox" name="groupBox_2">
|
<widget class="QGroupBox" name="groupBox_blinds">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string>Blinds</string>
|
<string>Blinds</string>
|
||||||
</property>
|
</property>
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
|
|
||||||
createInternetGameDialogImpl::createInternetGameDialogImpl(QWidget *parent, ConfigFile *c)
|
createInternetGameDialogImpl::createInternetGameDialogImpl(QWidget *parent, ConfigFile *c)
|
||||||
: QDialog(parent), myConfig(c)
|
: QDialog(parent), myConfig(c), currentGuestMode(false), currentPlayerName("")
|
||||||
{
|
{
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
setWindowModality(Qt::ApplicationModal);
|
setWindowModality(Qt::ApplicationModal);
|
||||||
@@ -40,22 +40,26 @@ createInternetGameDialogImpl::createInternetGameDialogImpl(QWidget *parent, Conf
|
|||||||
|
|
||||||
myChangeCompleteBlindsDialog = new changeCompleteBlindsDialogImpl;
|
myChangeCompleteBlindsDialog = new changeCompleteBlindsDialogImpl;
|
||||||
|
|
||||||
|
startBlind = new QLabel(tr("<i>Start blind: $25</i>"));
|
||||||
|
raiseMode = new QLabel(tr("<i>Double blinds every 11'th hand</i>"));
|
||||||
|
startBlind->hide();
|
||||||
|
raiseMode->hide();
|
||||||
|
gridLayout1->addWidget(startBlind, 0, 0, 1, 1);
|
||||||
|
gridLayout1->addWidget(raiseMode, 1, 0, 1, 1);
|
||||||
|
|
||||||
connect( radioButton_changeBlindsSettings, SIGNAL( clicked(bool) ), this, SLOT( callChangeBlindsDialog(bool) ) );
|
connect( radioButton_changeBlindsSettings, SIGNAL( clicked(bool) ), this, SLOT( callChangeBlindsDialog(bool) ) );
|
||||||
connect( pushButton_cancel, SIGNAL( clicked() ), this, SLOT( cancel() ) );
|
connect( pushButton_cancel, SIGNAL( clicked() ), this, SLOT( cancel() ) );
|
||||||
connect( pushButton_createGame, SIGNAL( clicked() ), this, SLOT( createGame() ) );
|
connect( pushButton_createGame, SIGNAL( clicked() ), this, SLOT( createGame() ) );
|
||||||
connect( checkBox_Password, SIGNAL( toggled(bool) ), this, SLOT( clearGamePassword(bool)) );
|
connect( checkBox_Password, SIGNAL( toggled(bool) ), this, SLOT( clearGamePassword(bool)) );
|
||||||
connect( comboBox_gameType, SIGNAL(currentIndexChanged(int)), this, SLOT( gameTypeChanged() ) );
|
connect( comboBox_gameType, SIGNAL(currentIndexChanged(int)), this, SLOT( gameTypeChanged() ) );
|
||||||
|
|
||||||
//temporarely unused until ai is enabled in network
|
|
||||||
// label_5->hide();
|
|
||||||
// spinBox_gameSpeed->hide();
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void createInternetGameDialogImpl::exec(bool guestMode, QString playerName) {
|
void createInternetGameDialogImpl::exec(bool guestMode, QString playerName) {
|
||||||
|
|
||||||
|
currentGuestMode = guestMode;
|
||||||
|
currentPlayerName = playerName;
|
||||||
fillFormular(guestMode, playerName);
|
fillFormular(guestMode, playerName);
|
||||||
QDialog::exec();
|
QDialog::exec();
|
||||||
}
|
}
|
||||||
@@ -150,16 +154,58 @@ void createInternetGameDialogImpl::gameTypeChanged() {
|
|||||||
|
|
||||||
switch (comboBox_gameType->currentIndex()) {
|
switch (comboBox_gameType->currentIndex()) {
|
||||||
|
|
||||||
case 0: { checkBox_Password->setDisabled(FALSE); }
|
case GAME_TYPE_NORMAL-1: {
|
||||||
|
checkBox_Password->setDisabled(FALSE);
|
||||||
|
spinBox_startCash->setDisabled(FALSE);
|
||||||
|
spinBox_quantityPlayers->setDisabled(FALSE);
|
||||||
|
spinBox_quantityPlayers->setValue(myConfig->readConfigInt("NetNumberOfPlayers"));
|
||||||
|
spinBox_startCash->setValue(myConfig->readConfigInt("NetStartCash"));
|
||||||
|
radioButton_useSavedBlindsSettings->show();
|
||||||
|
radioButton_changeBlindsSettings->show();
|
||||||
|
startBlind->hide();
|
||||||
|
raiseMode->hide();
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case 1: { checkBox_Password->setDisabled(FALSE); }
|
case GAME_TYPE_REGISTERED_ONLY-1: {
|
||||||
break;
|
checkBox_Password->setDisabled(FALSE);
|
||||||
case 2: { checkBox_Password->setChecked(FALSE);
|
spinBox_startCash->setDisabled(FALSE);
|
||||||
checkBox_Password->setDisabled(TRUE);
|
spinBox_quantityPlayers->setDisabled(FALSE);
|
||||||
|
spinBox_quantityPlayers->setValue(myConfig->readConfigInt("NetNumberOfPlayers"));
|
||||||
|
spinBox_startCash->setValue(myConfig->readConfigInt("NetStartCash"));
|
||||||
|
radioButton_useSavedBlindsSettings->show();
|
||||||
|
radioButton_changeBlindsSettings->show();
|
||||||
|
startBlind->hide();
|
||||||
|
raiseMode->hide();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 3: { checkBox_Password->setChecked(FALSE);
|
case GAME_TYPE_INVITE_ONLY-1: {
|
||||||
|
checkBox_Password->setChecked(FALSE);
|
||||||
checkBox_Password->setDisabled(TRUE);
|
checkBox_Password->setDisabled(TRUE);
|
||||||
|
spinBox_startCash->setDisabled(FALSE);
|
||||||
|
spinBox_quantityPlayers->setDisabled(FALSE);
|
||||||
|
spinBox_quantityPlayers->setValue(myConfig->readConfigInt("NetNumberOfPlayers"));
|
||||||
|
spinBox_startCash->setValue(myConfig->readConfigInt("NetStartCash"));
|
||||||
|
radioButton_useSavedBlindsSettings->show();
|
||||||
|
radioButton_changeBlindsSettings->show();
|
||||||
|
startBlind->hide();
|
||||||
|
raiseMode->hide();
|
||||||
|
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case GAME_TYPE_RANKING-1: {
|
||||||
|
checkBox_Password->setChecked(FALSE);
|
||||||
|
checkBox_Password->setDisabled(TRUE);
|
||||||
|
|
||||||
|
spinBox_startCash->setValue(10000);
|
||||||
|
spinBox_startCash->setDisabled(TRUE);
|
||||||
|
spinBox_quantityPlayers->setValue(10);
|
||||||
|
spinBox_quantityPlayers->setDisabled(TRUE);
|
||||||
|
radioButton_useSavedBlindsSettings->hide();
|
||||||
|
radioButton_changeBlindsSettings->hide();
|
||||||
|
startBlind->show();
|
||||||
|
raiseMode->show();
|
||||||
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,6 +51,11 @@ private:
|
|||||||
|
|
||||||
ConfigFile *myConfig;
|
ConfigFile *myConfig;
|
||||||
changeCompleteBlindsDialogImpl *myChangeCompleteBlindsDialog;
|
changeCompleteBlindsDialogImpl *myChangeCompleteBlindsDialog;
|
||||||
|
bool currentGuestMode;
|
||||||
|
QString currentPlayerName;
|
||||||
|
QLabel *startBlind;
|
||||||
|
QLabel *raiseMode;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user