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/MapUI.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/MapUI.cpp')
| -rw-r--r-- | pokemodr/MapUI.cpp | 31 |
1 files changed, 6 insertions, 25 deletions
diff --git a/pokemodr/MapUI.cpp b/pokemodr/MapUI.cpp index fd23d637..9364edfc 100644 --- a/pokemodr/MapUI.cpp +++ b/pokemodr/MapUI.cpp @@ -27,9 +27,6 @@ #include "../pokemod/MapWarp.h" #include "../pokemod/Pokemod.h" -// General includes -#include "../general/BugCatcher.h" - // Qt includes #include <QHeaderView> @@ -45,6 +42,10 @@ MapUI::MapUI(Map* map, QWidget* parent) : setObjects(map, new Map(*map)); m_model = new TilemapModel(this, static_cast<Map*>(modified())->map(), static_cast<const Pokemod*>(static_cast<Map*>(original())->pokemod())); 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(); } @@ -102,41 +103,21 @@ void MapUI::on_buttonDiscard_clicked() void MapUI::on_varName_textChanged(const QString& name) { static_cast<Map*>(modified())->setName(name); - emit(changed(true)); } void MapUI::on_boxFlyWarp_toggled() { static_cast<Map*>(modified())->setFlyWarp(-1); - emit(changed(true)); } void MapUI::on_varFlyWarp_currentIndexChanged(const int flyWarp) { - try - { - static_cast<Map*>(modified())->setFlyWarp(varFlyWarp->itemData(flyWarp).toInt()); - emit(changed(true)); - } - catch (BoundsException& exception) - { - BugCatcher::report(exception); - setGui(); - } + static_cast<Map*>(modified())->setFlyWarp(varFlyWarp->itemData(flyWarp).toInt()); } void MapUI::on_varType_currentIndexChanged(const int type) { - try - { - static_cast<Map*>(modified())->setType(type); - emit(changed(true)); - } - catch (BoundsException& exception) - { - BugCatcher::report(exception); - setGui(); - } + static_cast<Map*>(modified())->setType(type); } void MapUI::on_buttonAddColumn_pressed() |
