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/CoinListObjectUI.cpp | 52 ++++++++----------------------------------- 1 file changed, 9 insertions(+), 43 deletions(-) (limited to 'pokemodr/CoinListObjectUI.cpp') diff --git a/pokemodr/CoinListObjectUI.cpp b/pokemodr/CoinListObjectUI.cpp index 18c80886..af166d9d 100644 --- a/pokemodr/CoinListObjectUI.cpp +++ b/pokemodr/CoinListObjectUI.cpp @@ -25,9 +25,6 @@ #include "../pokemod/Pokemod.h" #include "../pokemod/Species.h" -// General includes -#include "../general/BugCatcher.h" - CoinListObjectUI::CoinListObjectUI(CoinListObject* object, QWidget* parent) : ObjectUI(parent), m_lastType(-1) @@ -36,6 +33,10 @@ CoinListObjectUI::CoinListObjectUI(CoinListObject* object, QWidget* parent) : QMetaObject::connectSlotsByName(this); setObjects(object, new CoinListObject(*object)); 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(); } @@ -45,6 +46,7 @@ CoinListObjectUI::~CoinListObjectUI() void CoinListObjectUI::initGui() { + connect(varType, SIGNAL(currentIndexChanged()), this, SLOT(setGui())); varType->addItems(CoinListObject::TypeStr); } @@ -95,56 +97,20 @@ void CoinListObjectUI::on_buttonDiscard_clicked() void CoinListObjectUI::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 CoinListObjectUI::on_varObject_currentIndexChanged(const int obey) { - try - { - static_cast(modified())->setObject(varObject->itemData(obey).toInt()); - emit(changed(true)); - } - catch (BoundsException& exception) - { - BugCatcher::report(exception); - setGui(); - } + static_cast(modified())->setObject(varObject->itemData(obey).toInt()); } void CoinListObjectUI::on_varAmount_valueChanged(const int amount) { - try - { - static_cast(modified())->setAmount(amount); - emit(changed(true)); - } - catch (BoundsException& exception) - { - BugCatcher::report(exception); - setGui(); - } + static_cast(modified())->setAmount(amount); } void CoinListObjectUI::on_varCost_valueChanged(const int cost) { - try - { - static_cast(modified())->setCost(cost); - emit(changed(true)); - } - catch (BoundsException& exception) - { - BugCatcher::report(exception); - setGui(); - } + static_cast(modified())->setCost(cost); } -- cgit