From f83b39754961a757f072bd4883960d2eb4723c84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20Teuli=C3=A8re?= Date: Fri, 27 Apr 2012 20:21:58 +0200 Subject: [PATCH] Removed the now useless preference about the default AI level --- qt/main_window.cpp | 9 --------- qt/new_game.cpp | 11 +---------- qt/prefs_dialog.cpp | 12 ----------- qt/prefs_dialog.h | 1 - qt/ui/prefs_dialog.ui | 46 +++++++++++++------------------------------ 5 files changed, 15 insertions(+), 64 deletions(-) diff --git a/qt/main_window.cpp b/qt/main_window.cpp index 5acd26f..02e1f80 100644 --- a/qt/main_window.cpp +++ b/qt/main_window.cpp @@ -313,15 +313,6 @@ void MainWindow::prefsUpdated() // Refresh one signal/slot connection 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 QSettings qs; int timerTotal = qs.value(PrefsDialog::kINTF_TIMER_TOTAL_DURATION).toInt(); diff --git a/qt/new_game.cpp b/qt/new_game.cpp index f2551da..f855f30 100644 --- a/qt/new_game.cpp +++ b/qt/new_game.cpp @@ -67,15 +67,6 @@ NewGame::NewGame(QWidget *iParent) this, SLOT(addSelectedToFav())); 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 QList fav = PlayersTableHelper::getFavPlayers(); Q_FOREACH(const PlayerDef &def, fav) @@ -88,7 +79,7 @@ NewGame::NewGame(QWidget *iParent) if (m_helper->getRowCount() == 0) { 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 diff --git a/qt/prefs_dialog.cpp b/qt/prefs_dialog.cpp index 2f5560a..3794693 100644 --- a/qt/prefs_dialog.cpp +++ b/qt/prefs_dialog.cpp @@ -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_WARN_REPLAY_TURN = "Interface/WarnReplayTurn"; 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_ALERT_DURATION = "Interface/TimerAlertDuration"; const QString PrefsDialog::kINTF_TIMER_BEEPS = "Interface/TimerBeeps"; @@ -59,9 +58,6 @@ PrefsDialog::PrefsDialog(QWidget *iParent) "\thttp://fr.wiktionary.org/wiki/%w\n" "\thttp://en.wiktionary.org/wiki/%w\n" "\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" "Changing this value will reset the timer.")); spinBoxTimerAlert->setToolTip(_q("Number of remaining seconds when an alert is triggered.\n" @@ -99,8 +95,6 @@ PrefsDialog::PrefsDialog(QWidget *iParent) checkBoxIntfShowPoints->setChecked(showPoints); bool warnReplayTurn = qs.value(kINTF_WARN_REPLAY_TURN, true).toBool(); 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(); spinBoxTimerTotal->setValue(timerTotal); 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_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()) { // We need to change the default AI level diff --git a/qt/prefs_dialog.h b/qt/prefs_dialog.h index 224075a..5859878 100644 --- a/qt/prefs_dialog.h +++ b/qt/prefs_dialog.h @@ -44,7 +44,6 @@ public: static const QString kINTF_SHOW_TILES_POINTS; static const QString kINTF_WARN_REPLAY_TURN; 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_ALERT_DURATION; static const QString kINTF_TIMER_BEEPS; diff --git a/qt/ui/prefs_dialog.ui b/qt/ui/prefs_dialog.ui index 8307139..0239842 100644 --- a/qt/ui/prefs_dialog.ui +++ b/qt/ui/prefs_dialog.ui @@ -7,7 +7,7 @@ 0 0 443 - 817 + 784 @@ -123,36 +123,6 @@ - - - - _("Default computer level:") - - - - - - - 100 - - - 100 - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - @@ -183,6 +153,19 @@ + + + + Qt::Horizontal + + + + 40 + 20 + + + + @@ -428,7 +411,6 @@ checkBoxIntfShowPoints checkBoxIntfAlignHistory checkBoxIntfWarnReplayTurn - spinBoxDefaultLevel spinBoxTimerTotal spinBoxTimerAlert checkBoxDuplRefuseInvalid