diff --git a/qt/prefs_dialog.cpp b/qt/prefs_dialog.cpp
index 0e9c8c7..95430a0 100644
--- a/qt/prefs_dialog.cpp
+++ b/qt/prefs_dialog.cpp
@@ -96,6 +96,8 @@ PrefsDialog::PrefsDialog(QWidget *iParent)
"It is still possible to change the master move afterwards."));
checkBoxArbitFillRack->setToolTip(_q("If checked, the rack will be completed with random letters.\n"
"Uncheck this option if you prefer to choose the letters yourself."));
+ checkBoxArbitSoloAuto->setToolTip(_q("If checked, solos are given automatically, when appropriate.\n"
+ "Uncheck this option if you prefer to do it manually."));
spinBoxArbitSearchLimit->setToolTip(spinBoxTrainSearchLimit->toolTip());
spinBoxArbitWarnLimit->setToolTip(_q("Maximal number of \"acceptable\" warnings.\n"
"Any additional warning will give a penalty to the player."));
@@ -107,6 +109,13 @@ PrefsDialog::PrefsDialog(QWidget *iParent)
completer->setModel(model);
lineEditIntfDicPath->setCompleter(completer);
+ // The "arbitration.solo-players" setting is meaningful only
+ // when "arbitration.solo-auto" is true
+ QObject::connect(checkBoxArbitSoloAuto, SIGNAL(toggled(bool)),
+ labelArbitSoloPlayers, SLOT(setEnabled(bool)));
+ QObject::connect(checkBoxArbitSoloAuto, SIGNAL(toggled(bool)),
+ spinBoxArbitSoloPlayers, SLOT(setEnabled(bool)));
+
try
{
// Interface settings
@@ -143,10 +152,12 @@ PrefsDialog::PrefsDialog(QWidget *iParent)
checkBoxArbitFillRack->setChecked(Settings::Instance().getBool("arbitration.fill-rack"));
bool linkArbit7P1 = qs.value(kARBIT_LINK_7P1, false).toBool();
checkBoxArbitLink7P1->setChecked(linkArbit7P1);
- spinBoxArbitSearchLimit->setValue(Settings::Instance().getInt("arbitration.search-limit"));
+ checkBoxArbitSoloAuto->setChecked(Settings::Instance().getBool("arbitration.solo-auto"));
+ spinBoxArbitSoloPlayers->setValue(Settings::Instance().getInt("arbitration.solo-players"));
+ spinBoxArbitSoloValue->setValue(Settings::Instance().getInt("arbitration.solo-value"));
spinBoxArbitPenaltyValue->setValue(Settings::Instance().getInt("arbitration.penalty-value"));
spinBoxArbitWarnLimit->setValue(Settings::Instance().getInt("arbitration.warnings-limit"));
- spinBoxArbitSoloValue->setValue(Settings::Instance().getInt("arbitration.solo-value"));
+ spinBoxArbitSearchLimit->setValue(Settings::Instance().getInt("arbitration.search-limit"));
// Confirmations
bool confoStartGame = qs.value(kCONFO_START_GAME, true).toBool();
@@ -267,14 +278,18 @@ void PrefsDialog::updateSettings()
shouldEmitUpdate = true;
qs.setValue(kARBIT_LINK_7P1, checkBoxArbitLink7P1->isChecked());
}
+ Settings::Instance().setBool("arbitration.solo-auto",
+ checkBoxArbitSoloAuto->isChecked());
+ Settings::Instance().setInt("arbitration.solo-players",
+ spinBoxArbitSoloPlayers->value());
+ Settings::Instance().setInt("arbitration.solo-value",
+ spinBoxArbitSoloValue->value());
Settings::Instance().setInt("arbitration.search-limit",
spinBoxArbitSearchLimit->value());
Settings::Instance().setInt("arbitration.penalty-value",
spinBoxArbitPenaltyValue->value());
Settings::Instance().setInt("arbitration.warnings-limit",
spinBoxArbitWarnLimit->value());
- Settings::Instance().setInt("arbitration.solo-value",
- spinBoxArbitSoloValue->value());
// Confirmations settings
qs.setValue(kCONFO_START_GAME, checkBoxConfoStartGame->isChecked());
diff --git a/qt/ui/prefs_dialog.ui b/qt/ui/prefs_dialog.ui
index dd82cf1..df68566 100644
--- a/qt/ui/prefs_dialog.ui
+++ b/qt/ui/prefs_dialog.ui
@@ -7,7 +7,7 @@
0
0
474
- 622
+ 630
@@ -371,40 +371,50 @@
+ -
+
+
+ _("Handle solos automatically")
+
+
+
-
-
-
+
-
+
+
+ false
+
+
+ _("Minimum number of players needed to take into account the solo bonus")
+
+
+ 16
+
+
+
+ -
3
- -
-
-
- 100000
-
-
- 100
-
-
-
- -
+
-
_("Penalty value:")
- -
+
-
_("Warnings limit:")
- -
+
-
_("Default number of points for a penalty")
@@ -417,7 +427,34 @@
- -
+
-
+
+
+ _("Solo value:")
+
+
+
+ -
+
+
+ _("Value of the solo bonus. Set it to 0 if you don't want solo bonus")
+
+
+ 10
+
+
+
+ -
+
+
+ false
+
+
+ _("Min. players for a solo:")
+
+
+
+ -
Qt::Horizontal
@@ -430,27 +467,20 @@
- -
+
-
_("Search results limit:")
- -
-
-
- _("Solo value:")
-
-
-
- -
-
-
- _("Value of the solo bonus. Set it to 0 if you don't want solo bonus")
+
-
+
+
+ 100000
- 10
+ 100
@@ -628,7 +658,6 @@
checkBoxArbitAutoMaster
checkBoxArbitFillRack
checkBoxArbitLink7P1
- spinBoxArbitSearchLimit
spinBoxArbitPenaltyValue
checkBoxConfoStartGame
checkBoxConfoLoadGame