mirror of
git://git.savannah.nongnu.org/eliot.git
synced 2025-01-18 10:26:15 +01:00
Removed the now useless preference about the default AI level
This commit is contained in:
parent
eaf536b3ba
commit
f83b397549
5 changed files with 15 additions and 64 deletions
|
@ -313,15 +313,6 @@ void MainWindow::prefsUpdated()
|
||||||
// Refresh one signal/slot connection
|
// Refresh one signal/slot connection
|
||||||
linkArbitrationAnd7P1();
|
linkArbitrationAnd7P1();
|
||||||
|
|
||||||
// XXX: is this preference still useful?
|
|
||||||
#if 0
|
|
||||||
// Refresh the default level for the Eliot player
|
|
||||||
if (m_newGameDialog != NULL)
|
|
||||||
{
|
|
||||||
m_newGameDialog->refresh();
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Refresh the timer values
|
// Refresh the timer values
|
||||||
QSettings qs;
|
QSettings qs;
|
||||||
int timerTotal = qs.value(PrefsDialog::kINTF_TIMER_TOTAL_DURATION).toInt();
|
int timerTotal = qs.value(PrefsDialog::kINTF_TIMER_TOTAL_DURATION).toInt();
|
||||||
|
|
|
@ -67,15 +67,6 @@ NewGame::NewGame(QWidget *iParent)
|
||||||
this, SLOT(addSelectedToFav()));
|
this, SLOT(addSelectedToFav()));
|
||||||
m_helper->addPopupAction(addToFavAction);
|
m_helper->addPopupAction(addToFavAction);
|
||||||
|
|
||||||
// Retrieve the default computer level
|
|
||||||
QSettings qs;
|
|
||||||
int defLevel = qs.value(PrefsDialog::kINTF_DEFAULT_AI_LEVEL, 100).toInt();
|
|
||||||
// Ensure a valid range
|
|
||||||
if (defLevel < 0)
|
|
||||||
defLevel = 0;
|
|
||||||
if (defLevel > 100)
|
|
||||||
defLevel = 100;
|
|
||||||
|
|
||||||
// Initialize the model of the default players
|
// Initialize the model of the default players
|
||||||
QList<PlayerDef> fav = PlayersTableHelper::getFavPlayers();
|
QList<PlayerDef> fav = PlayersTableHelper::getFavPlayers();
|
||||||
Q_FOREACH(const PlayerDef &def, fav)
|
Q_FOREACH(const PlayerDef &def, fav)
|
||||||
|
@ -88,7 +79,7 @@ NewGame::NewGame(QWidget *iParent)
|
||||||
if (m_helper->getRowCount() == 0)
|
if (m_helper->getRowCount() == 0)
|
||||||
{
|
{
|
||||||
m_helper->addPlayer(PlayerDef(_q("Player %1").arg(1), _q(kHUMAN), "", false));
|
m_helper->addPlayer(PlayerDef(_q("Player %1").arg(1), _q(kHUMAN), "", false));
|
||||||
m_helper->addPlayer(PlayerDef(_q("Eliot"), _q(kAI), QString("%1").arg(defLevel), false));
|
m_helper->addPlayer(PlayerDef(_q("Eliot"), _q(kAI), "100", false));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Enable the Ok button only if there are enough players for the
|
// Enable the Ok button only if there are enough players for the
|
||||||
|
|
|
@ -41,7 +41,6 @@ const QString PrefsDialog::kINTF_DEFINITIONS_SITE_URL = "Interface/DefinitionsSi
|
||||||
const QString PrefsDialog::kINTF_SHOW_TILES_POINTS = "Interface/ShowTilesPoints";
|
const QString PrefsDialog::kINTF_SHOW_TILES_POINTS = "Interface/ShowTilesPoints";
|
||||||
const QString PrefsDialog::kINTF_WARN_REPLAY_TURN = "Interface/WarnReplayTurn";
|
const QString PrefsDialog::kINTF_WARN_REPLAY_TURN = "Interface/WarnReplayTurn";
|
||||||
const QString PrefsDialog::kINTF_SHOW_TOOLBAR = "Interface/ShowToolBar";
|
const QString PrefsDialog::kINTF_SHOW_TOOLBAR = "Interface/ShowToolBar";
|
||||||
const QString PrefsDialog::kINTF_DEFAULT_AI_LEVEL = "Interface/DefaultAiLevel";
|
|
||||||
const QString PrefsDialog::kINTF_TIMER_TOTAL_DURATION = "Interface/TimerTotalDuration";
|
const QString PrefsDialog::kINTF_TIMER_TOTAL_DURATION = "Interface/TimerTotalDuration";
|
||||||
const QString PrefsDialog::kINTF_TIMER_ALERT_DURATION = "Interface/TimerAlertDuration";
|
const QString PrefsDialog::kINTF_TIMER_ALERT_DURATION = "Interface/TimerAlertDuration";
|
||||||
const QString PrefsDialog::kINTF_TIMER_BEEPS = "Interface/TimerBeeps";
|
const QString PrefsDialog::kINTF_TIMER_BEEPS = "Interface/TimerBeeps";
|
||||||
|
@ -59,9 +58,6 @@ PrefsDialog::PrefsDialog(QWidget *iParent)
|
||||||
"\thttp://fr.wiktionary.org/wiki/%w\n"
|
"\thttp://fr.wiktionary.org/wiki/%w\n"
|
||||||
"\thttp://en.wiktionary.org/wiki/%w\n"
|
"\thttp://en.wiktionary.org/wiki/%w\n"
|
||||||
"\thttp://images.google.com/images?q=%w"));
|
"\thttp://images.google.com/images?q=%w"));
|
||||||
spinBoxDefaultLevel->setToolTip(_q("Default level for Eliot, "
|
|
||||||
"used when creating a new game.\n"
|
|
||||||
"Accepted range: [0-100]"));
|
|
||||||
spinBoxTimerTotal->setToolTip(_q("Total duration of the timer, in seconds.\n"
|
spinBoxTimerTotal->setToolTip(_q("Total duration of the timer, in seconds.\n"
|
||||||
"Changing this value will reset the timer."));
|
"Changing this value will reset the timer."));
|
||||||
spinBoxTimerAlert->setToolTip(_q("Number of remaining seconds when an alert is triggered.\n"
|
spinBoxTimerAlert->setToolTip(_q("Number of remaining seconds when an alert is triggered.\n"
|
||||||
|
@ -99,8 +95,6 @@ PrefsDialog::PrefsDialog(QWidget *iParent)
|
||||||
checkBoxIntfShowPoints->setChecked(showPoints);
|
checkBoxIntfShowPoints->setChecked(showPoints);
|
||||||
bool warnReplayTurn = qs.value(kINTF_WARN_REPLAY_TURN, true).toBool();
|
bool warnReplayTurn = qs.value(kINTF_WARN_REPLAY_TURN, true).toBool();
|
||||||
checkBoxIntfWarnReplayTurn->setChecked(warnReplayTurn);
|
checkBoxIntfWarnReplayTurn->setChecked(warnReplayTurn);
|
||||||
int defaultAiLevel = qs.value(kINTF_DEFAULT_AI_LEVEL, 100).toInt();
|
|
||||||
spinBoxDefaultLevel->setValue(defaultAiLevel);
|
|
||||||
int timerTotal = qs.value(kINTF_TIMER_TOTAL_DURATION, 180).toInt();
|
int timerTotal = qs.value(kINTF_TIMER_TOTAL_DURATION, 180).toInt();
|
||||||
spinBoxTimerTotal->setValue(timerTotal);
|
spinBoxTimerTotal->setValue(timerTotal);
|
||||||
int timerAlert = qs.value(kINTF_TIMER_ALERT_DURATION, 30).toInt();
|
int timerAlert = qs.value(kINTF_TIMER_ALERT_DURATION, 30).toInt();
|
||||||
|
@ -175,12 +169,6 @@ void PrefsDialog::updateSettings()
|
||||||
qs.setValue(kINTF_SHOW_TILES_POINTS, checkBoxIntfShowPoints->isChecked());
|
qs.setValue(kINTF_SHOW_TILES_POINTS, checkBoxIntfShowPoints->isChecked());
|
||||||
}
|
}
|
||||||
qs.setValue(kINTF_WARN_REPLAY_TURN, checkBoxIntfWarnReplayTurn->isChecked());
|
qs.setValue(kINTF_WARN_REPLAY_TURN, checkBoxIntfWarnReplayTurn->isChecked());
|
||||||
if (qs.value(kINTF_DEFAULT_AI_LEVEL, 100).toInt() != spinBoxDefaultLevel->value())
|
|
||||||
{
|
|
||||||
// We need to change the default AI level
|
|
||||||
shouldEmitUpdate = true;
|
|
||||||
qs.setValue(kINTF_DEFAULT_AI_LEVEL, spinBoxDefaultLevel->value());
|
|
||||||
}
|
|
||||||
if (qs.value(kINTF_TIMER_TOTAL_DURATION, 180).toInt() != spinBoxTimerTotal->value())
|
if (qs.value(kINTF_TIMER_TOTAL_DURATION, 180).toInt() != spinBoxTimerTotal->value())
|
||||||
{
|
{
|
||||||
// We need to change the default AI level
|
// We need to change the default AI level
|
||||||
|
|
|
@ -44,7 +44,6 @@ public:
|
||||||
static const QString kINTF_SHOW_TILES_POINTS;
|
static const QString kINTF_SHOW_TILES_POINTS;
|
||||||
static const QString kINTF_WARN_REPLAY_TURN;
|
static const QString kINTF_WARN_REPLAY_TURN;
|
||||||
static const QString kINTF_SHOW_TOOLBAR;
|
static const QString kINTF_SHOW_TOOLBAR;
|
||||||
static const QString kINTF_DEFAULT_AI_LEVEL;
|
|
||||||
static const QString kINTF_TIMER_TOTAL_DURATION;
|
static const QString kINTF_TIMER_TOTAL_DURATION;
|
||||||
static const QString kINTF_TIMER_ALERT_DURATION;
|
static const QString kINTF_TIMER_ALERT_DURATION;
|
||||||
static const QString kINTF_TIMER_BEEPS;
|
static const QString kINTF_TIMER_BEEPS;
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>443</width>
|
<width>443</width>
|
||||||
<height>817</height>
|
<height>784</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
|
@ -123,36 +123,6 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="0">
|
|
||||||
<widget class="QLabel" name="label_6">
|
|
||||||
<property name="text">
|
|
||||||
<string>_("Default computer level:")</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="1">
|
|
||||||
<widget class="QSpinBox" name="spinBoxDefaultLevel">
|
|
||||||
<property name="maximum">
|
|
||||||
<number>100</number>
|
|
||||||
</property>
|
|
||||||
<property name="value">
|
|
||||||
<number>100</number>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="2">
|
|
||||||
<spacer name="horizontalSpacer_4">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>40</width>
|
|
||||||
<height>20</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="1">
|
<item row="1" column="1">
|
||||||
<widget class="QSpinBox" name="spinBoxTimerTotal">
|
<widget class="QSpinBox" name="spinBoxTimerTotal">
|
||||||
<property name="maximum">
|
<property name="maximum">
|
||||||
|
@ -183,6 +153,19 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="1" column="2">
|
||||||
|
<spacer name="horizontalSpacer_4">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>40</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
|
@ -428,7 +411,6 @@
|
||||||
<tabstop>checkBoxIntfShowPoints</tabstop>
|
<tabstop>checkBoxIntfShowPoints</tabstop>
|
||||||
<tabstop>checkBoxIntfAlignHistory</tabstop>
|
<tabstop>checkBoxIntfAlignHistory</tabstop>
|
||||||
<tabstop>checkBoxIntfWarnReplayTurn</tabstop>
|
<tabstop>checkBoxIntfWarnReplayTurn</tabstop>
|
||||||
<tabstop>spinBoxDefaultLevel</tabstop>
|
|
||||||
<tabstop>spinBoxTimerTotal</tabstop>
|
<tabstop>spinBoxTimerTotal</tabstop>
|
||||||
<tabstop>spinBoxTimerAlert</tabstop>
|
<tabstop>spinBoxTimerAlert</tabstop>
|
||||||
<tabstop>checkBoxDuplRefuseInvalid</tabstop>
|
<tabstop>checkBoxDuplRefuseInvalid</tabstop>
|
||||||
|
|
Loading…
Reference in a new issue