diff options
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() |
