From fdd0eec1d145fb8ac97b4cc9aaed5218214416ec Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Thu, 15 May 2008 19:55:43 +0000 Subject: [FIX] Refactored out connections made within widgets [FIX] Flag, Fractiona, and Point widgets fixed to only emit signals when actually changed [FIX] Pokemod classes now emit signals git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@138 6ecfd1a5-f3ed-3746-8530-beee90d26b22 --- pokemodr/RulesUI.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'pokemodr/RulesUI.cpp') diff --git a/pokemodr/RulesUI.cpp b/pokemodr/RulesUI.cpp index e7648f14..9a489570 100644 --- a/pokemodr/RulesUI.cpp +++ b/pokemodr/RulesUI.cpp @@ -27,10 +27,6 @@ RulesUI::RulesUI(Rules* rules, QWidget* parent) : setupUi(this); QMetaObject::connectSlotsByName(this); setObjects(rules, new Rules(*rules)); - connect(modified(), SIGNAL(error(const QString&)), this, SLOT(setGui())); - connect(modified(), SIGNAL(error(const QString&)), this, SLOT(errorMessage(const QString&))); - connect(modified(), SIGNAL(warning(const QString&)), this, SLOT(warningMessage(const QString&))); - connect(modified(), SIGNAL(changed()), this, SLOT(setChanged())); init(); } @@ -52,10 +48,7 @@ void RulesUI::setGui() boxAllowAbilities->setChecked(static_cast(modified())->abilityAllowed() ? Qt::Checked : Qt::Unchecked); boxAllowNatures->setChecked(static_cast(modified())->natureAllowed() ? Qt::Checked : Qt::Unchecked); varBoxes->setValue(static_cast(modified())->numBoxes()); - if (static_cast(modified())->numBoxes()) - varBoxSize->setEnabled(true); - else - varBoxSize->setEnabled(false); + varBoxSize->setEnabled(0 < static_cast(modified())->numBoxes()); varBoxSize->setValue(static_cast(modified())->boxSize()); varMaxParty->setValue(static_cast(modified())->maxParty()); varMaxFight->setMaximum(static_cast(modified())->maxParty()); @@ -73,6 +66,7 @@ void RulesUI::setGui() varNumSteps->setValue(static_cast(modified())->happySteps()); boxEffortValues->setChecked(static_cast(modified())->effortValuesAllowed() ? Qt::Checked : Qt::Unchecked); varMaxEV->setValue(static_cast(modified())->maxTotalEV()); + varMaxEVPerStat->setEnabled(0 < static_cast(modified())->maxTotalEV()); varMaxEVPerStat->setMaximum(static_cast(modified())->maxTotalEV()); varMaxEVPerStat->setValue(static_cast(modified())->maxEVPerStat()); varPokerus->setValue(static_cast(modified())->pokerusChance()); -- cgit