From 39a1b43adbebb73b87c4a2346b9ccb2c2a34753b Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Wed, 7 May 2008 02:08:51 +0000 Subject: [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 --- pokemodr/MapUI.cpp | 31 ++++++------------------------- 1 file changed, 6 insertions(+), 25 deletions(-) (limited to 'pokemodr/MapUI.cpp') 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 @@ -45,6 +42,10 @@ MapUI::MapUI(Map* map, QWidget* parent) : setObjects(map, new Map(*map)); m_model = new TilemapModel(this, static_cast(modified())->map(), static_cast(static_cast(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(modified())->setName(name); - emit(changed(true)); } void MapUI::on_boxFlyWarp_toggled() { static_cast(modified())->setFlyWarp(-1); - emit(changed(true)); } void MapUI::on_varFlyWarp_currentIndexChanged(const int flyWarp) { - try - { - static_cast(modified())->setFlyWarp(varFlyWarp->itemData(flyWarp).toInt()); - emit(changed(true)); - } - catch (BoundsException& exception) - { - BugCatcher::report(exception); - setGui(); - } + static_cast(modified())->setFlyWarp(varFlyWarp->itemData(flyWarp).toInt()); } void MapUI::on_varType_currentIndexChanged(const int type) { - try - { - static_cast(modified())->setType(type); - emit(changed(true)); - } - catch (BoundsException& exception) - { - BugCatcher::report(exception); - setGui(); - } + static_cast(modified())->setType(type); } void MapUI::on_buttonAddColumn_pressed() -- cgit