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/MapTrainerTeamMemberUI.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/MapTrainerTeamMemberUI.cpp')
| -rw-r--r-- | pokemodr/MapTrainerTeamMemberUI.cpp | 55 |
1 files changed, 10 insertions, 45 deletions
diff --git a/pokemodr/MapTrainerTeamMemberUI.cpp b/pokemodr/MapTrainerTeamMemberUI.cpp index f8836671..e239cd0c 100644 --- a/pokemodr/MapTrainerTeamMemberUI.cpp +++ b/pokemodr/MapTrainerTeamMemberUI.cpp @@ -25,9 +25,6 @@ #include "../pokemod/Pokemod.h" #include "../pokemod/Species.h" -// General includes -#include "../general/BugCatcher.h" - MapTrainerTeamMemberUI::MapTrainerTeamMemberUI(MapTrainerTeamMember* teamMember, QWidget* parent) : ObjectUI(parent) { @@ -35,6 +32,10 @@ MapTrainerTeamMemberUI::MapTrainerTeamMemberUI(MapTrainerTeamMember* teamMember, QMetaObject::connectSlotsByName(this); setObjects(teamMember, new MapTrainerTeamMember(*teamMember)); 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(); } @@ -105,60 +106,24 @@ void MapTrainerTeamMemberUI::on_buttonDiscard_clicked() void MapTrainerTeamMemberUI::on_varSpecies_currentIndexChanged(const int species) { - try - { - static_cast<MapTrainerTeamMember*>(modified())->setSpecies(varSpecies->itemData(species).toInt()); - emit(changed(true)); - } - catch (BoundsException& exception) - { - BugCatcher::report(exception); - setGui(); - } + static_cast<MapTrainerTeamMember*>(modified())->setSpecies(varSpecies->itemData(species).toInt()); } void MapTrainerTeamMemberUI::on_varLevel_valueChanged(const int level) { - try - { - static_cast<MapTrainerTeamMember*>(modified())->setLevel(level); - emit(changed(true)); - } - catch (Exception& exception) - { - BugCatcher::report(exception); - } - setGui(); + static_cast<MapTrainerTeamMember*>(modified())->setLevel(level); } void MapTrainerTeamMemberUI::on_varNature_currentIndexChanged(const int nature) { - try - { - static_cast<MapTrainerTeamMember*>(modified())->setNature(varNature->itemData(nature).toInt()); - emit(changed(true)); - } - catch (BoundsException& exception) - { - BugCatcher::report(exception); - setGui(); - } + static_cast<MapTrainerTeamMember*>(modified())->setNature(varNature->itemData(nature).toInt()); } void MapTrainerTeamMemberUI::on_varItems_itemSelectionChanged() { - try - { - for (int i = 0; i < varItems->count(); ++i) - { - const QListWidgetItem* widgetItem = varItems->item(i); - static_cast<MapTrainerTeamMember*>(modified())->setItem(widgetItem->data(Qt::UserRole).toInt(), widgetItem->isSelected()); - } - emit(changed(true)); - } - catch (BoundsException& exception) + for (int i = 0; i < varItems->count(); ++i) { - BugCatcher::report(exception); - setGui(); + const QListWidgetItem* widgetItem = varItems->item(i); + static_cast<MapTrainerTeamMember*>(modified())->setItem(widgetItem->data(Qt::UserRole).toInt(), widgetItem->isSelected()); } } |
