Support explosive games in the Qt interface

This commit is contained in:
Olivier Teulière 2009-01-15 18:33:32 +00:00
parent 8b9478542a
commit d913be52a0
3 changed files with 79 additions and 4 deletions

View file

@ -145,6 +145,8 @@ PublicGame * NewGame::createGame(const Dictionary &iDic) const
// Joker game?
if (checkBoxJoker->isChecked())
game->setVariant(PublicGame::kJOKER);
if (checkBoxExplosive->isChecked())
game->setVariant(PublicGame::kEXPLOSIVE);
return game;
}
@ -216,6 +218,18 @@ void NewGame::on_pushButtonRemove_clicked()
m_model->removeRow(indexList.front().row());
}
void NewGame::on_checkBoxJoker_stateChanged(int newState)
{
if (newState == Qt::Checked)
checkBoxExplosive->setChecked(false);
}
void NewGame::on_checkBoxExplosive_stateChanged(int newState)
{
if (newState == Qt::Checked)
checkBoxJoker->setChecked(false);
}
PlayersTypeDelegate::PlayersTypeDelegate(QObject *parent)

View file

@ -57,6 +57,8 @@ private slots:
void on_comboBoxMode_activated(int);
void on_pushButtonAdd_clicked();
void on_pushButtonRemove_clicked();
void on_checkBoxJoker_stateChanged(int);
void on_checkBoxExplosive_stateChanged(int);
private:
/// Model of the players

View file

@ -5,8 +5,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>470</width>
<height>390</height>
<width>473</width>
<height>425</height>
</rect>
</property>
<property name="windowTitle" >
@ -22,6 +22,12 @@
<string>_("Game type")</string>
</property>
<layout class="QHBoxLayout" >
<property name="topMargin" >
<number>0</number>
</property>
<property name="bottomMargin" >
<number>4</number>
</property>
<item>
<widget class="QLabel" name="label_3" >
<property name="text" >
@ -62,12 +68,53 @@
</spacer>
</item>
<item>
<widget class="QCheckBox" name="checkBoxJoker" >
<widget class="QLabel" name="label_5" >
<property name="text" >
<string>_("Joker game")</string>
<string>_("Variant:")</string>
</property>
</widget>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout" >
<property name="spacing" >
<number>2</number>
</property>
<property name="topMargin" >
<number>0</number>
</property>
<item>
<widget class="QCheckBox" name="checkBoxJoker" >
<property name="toolTip" >
<string>_("In a joker game, each rack contains a joker. When a word containing
the joker is played on the grid, the joker is then replaced by the
corresponding letter from the bag, and the joker stays in the rack.
When the corresponding letter is not present in the bag, the joker is
placed on the board.
This variant, particularly interesting in Duplicate mode, is good to train
using the joker.")</string>
</property>
<property name="text" >
<string>_("Joker game")</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBoxExplosive" >
<property name="toolTip" >
<string>_("An explosive game is a bit like a joker game, except than when the
computer chooses the rack (containing a joker), it performs a search and
finds the best word possible with the rack. Then, if possible, it replaces
the joker in the rack with the letter allowing to play this best word.
This variant, unlike the joker game, allows playing with a normal-looking
rack, but it usually gives much higher scores than in a normal game.")</string>
</property>
<property name="text" >
<string>_("Explosive game")</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
@ -195,6 +242,18 @@
</item>
</layout>
</widget>
<tabstops>
<tabstop>buttonBox</tabstop>
<tabstop>comboBoxMode</tabstop>
<tabstop>checkBoxJoker</tabstop>
<tabstop>checkBoxExplosive</tabstop>
<tabstop>treeViewPlayers</tabstop>
<tabstop>lineEditName</tabstop>
<tabstop>comboBoxType</tabstop>
<tabstop>spinBoxLevel</tabstop>
<tabstop>pushButtonAdd</tabstop>
<tabstop>pushButtonRemove</tabstop>
</tabstops>
<resources/>
<connections>
<connection>