diff options
| author | Ben Boeckel <MathStuf@gmail.com> | 2008-05-07 02:08:51 +0000 |
|---|---|---|
| committer | Ben Boeckel <MathStuf@gmail.com> | 2008-05-07 02:08:51 +0000 |
| commit | 39a1b43adbebb73b87c4a2346b9ccb2c2a34753b (patch) | |
| tree | 08d55409c9d5b2149c4e8b341203dcbb42fa0a2c /pokemodr/MoveUI.cpp | |
| parent | 8714e1d409f46b05980b3e1e9f3a10910294b429 (diff) | |
| download | sigen-39a1b43adbebb73b87c4a2346b9ccb2c2a34753b.tar.gz sigen-39a1b43adbebb73b87c4a2346b9ccb2c2a34753b.tar.xz sigen-39a1b43adbebb73b87c4a2346b9ccb2c2a34753b.zip | |
[FIX] Added Q_OBJECT to pokemod classes
[FIX] UI classes fixed to work with new API
[FIX] Qmake files fixed
git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@121 6ecfd1a5-f3ed-3746-8530-beee90d26b22
Diffstat (limited to 'pokemodr/MoveUI.cpp')
| -rw-r--r-- | pokemodr/MoveUI.cpp | 81 |
1 files changed, 10 insertions, 71 deletions
diff --git a/pokemodr/MoveUI.cpp b/pokemodr/MoveUI.cpp index 38a526c5..33454ebd 100644 --- a/pokemodr/MoveUI.cpp +++ b/pokemodr/MoveUI.cpp @@ -23,9 +23,6 @@ #include "../pokemod/Type.h" #include "../pokemod/Pokemod.h" -// General includes -#include "../general/BugCatcher.h" - MoveUI::MoveUI(Move* move, QWidget* parent) : ObjectUI(parent) { @@ -33,6 +30,10 @@ MoveUI::MoveUI(Move* move, QWidget* parent) : QMetaObject::connectSlotsByName(this); setObjects(move, new Move(*move)); connect(this, SIGNAL(changed(bool)), boxButtons, SLOT(setEnabled(bool))); + connect(modified(), SIGNAL(error()), this, SLOT(setGui())); + connect(modified(), SIGNAL(error(QString&)), this, SLOT(errorMessage(QString&))); + connect(modified(), SIGNAL(warning(QString&)), this, SLOT(warningMessage(QString&))); + connect(modified(), SIGNAL(changed()), this, SIGNAL(changed(true))); init(); } @@ -91,131 +92,69 @@ void MoveUI::on_buttonDiscard_clicked() void MoveUI::on_varName_textChanged(const QString& name) { static_cast<Move*>(modified())->setName(name); - emit(changed(true)); } void MoveUI::on_varAccuracy_valueChanged(const Fraction& accuracy) { - try - { - static_cast<Move*>(modified())->setAccuracy(accuracy); - emit(changed(true)); - } - catch (Exception& exception) - { - BugCatcher::report(exception); - setGui(); - } + static_cast<Move*>(modified())->setAccuracy(accuracy); } void MoveUI::on_varType_currentIndexChanged(const int type) { - try - { - static_cast<Move*>(modified())->setType(varType->itemData(type).toInt()); - emit(changed(true)); - } - catch (BoundsException& exception) - { - BugCatcher::report(exception); - setGui(); - } + static_cast<Move*>(modified())->setType(varType->itemData(type).toInt()); } void MoveUI::on_varPowerPoints_valueChanged(const int powerPoints) { - try - { - static_cast<Move*>(modified())->setPowerPoints(powerPoints); - emit(changed(true)); - } - catch (BoundsException& exception) - { - BugCatcher::report(exception); - setGui(); - } + static_cast<Move*>(modified())->setPowerPoints(powerPoints); } void MoveUI::on_varTarget_currentIndexChanged(const int target) { - try - { - static_cast<Move*>(modified())->setTarget(target); - emit(changed(true)); - } - catch (BoundsException& exception) - { - BugCatcher::report(exception); - setGui(); - } + static_cast<Move*>(modified())->setTarget(target); } void MoveUI::on_varNumTargets_valueChanged(const int numTargets) { - try - { - static_cast<Move*>(modified())->setNumTargets(numTargets); - emit(changed(true)); - } - catch (BoundsException& exception) - { - BugCatcher::report(exception); - setGui(); - } + static_cast<Move*>(modified())->setNumTargets(numTargets); } void MoveUI::on_varTargetChoice_currentIndexChanged(const int targetChoice) { - try - { - static_cast<Move*>(modified())->setTargetChoice(targetChoice); - emit(changed(true)); - } - catch (BoundsException& exception) - { - BugCatcher::report(exception); - setGui(); - } + static_cast<Move*>(modified())->setTargetChoice(targetChoice); } void MoveUI::on_varSpecial_toggled(const bool special) { static_cast<Move*>(modified())->setSpecial(special); - emit(changed(true)); } void MoveUI::on_varIgnoreAccuracy_toggled(const bool ignoreAccuracy) { static_cast<Move*>(modified())->setIgnoreAccuracy(ignoreAccuracy); - emit(changed(true)); } void MoveUI::on_varCanFlinch_toggled(const bool canFlinch) { static_cast<Move*>(modified())->setCanFlinch(canFlinch); - emit(changed(true)); } void MoveUI::on_varCanRandom_toggled(const bool canRandom) { static_cast<Move*>(modified())->setCanRandom(canRandom); - emit(changed(true)); } void MoveUI::on_varCanSnatch_toggled(const bool canSnatch) { static_cast<Move*>(modified())->setCanSnatch(canSnatch); - emit(changed(true)); } void MoveUI::on_varSound_toggled(const bool sound) { static_cast<Move*>(modified())->setSound(sound); - emit(changed(true)); } void MoveUI::on_varDescription_textChanged() { static_cast<Move*>(modified())->setDescription(varDescription->toPlainText()); - emit(changed(true)); } |
