summaryrefslogtreecommitdiffstats
path: root/pokemodr/CoinListObjectUI.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'pokemodr/CoinListObjectUI.cpp')
-rw-r--r--pokemodr/CoinListObjectUI.cpp52
1 files changed, 9 insertions, 43 deletions
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<CoinListObject*>(modified())->setType(type);
- emit(changed(true));
- }
- catch (BoundsException& exception)
- {
- BugCatcher::report(exception);
- }
- setGui();
+ static_cast<CoinListObject*>(modified())->setType(type);
}
void CoinListObjectUI::on_varObject_currentIndexChanged(const int obey)
{
- try
- {
- static_cast<CoinListObject*>(modified())->setObject(varObject->itemData(obey).toInt());
- emit(changed(true));
- }
- catch (BoundsException& exception)
- {
- BugCatcher::report(exception);
- setGui();
- }
+ static_cast<CoinListObject*>(modified())->setObject(varObject->itemData(obey).toInt());
}
void CoinListObjectUI::on_varAmount_valueChanged(const int amount)
{
- try
- {
- static_cast<CoinListObject*>(modified())->setAmount(amount);
- emit(changed(true));
- }
- catch (BoundsException& exception)
- {
- BugCatcher::report(exception);
- setGui();
- }
+ static_cast<CoinListObject*>(modified())->setAmount(amount);
}
void CoinListObjectUI::on_varCost_valueChanged(const int cost)
{
- try
- {
- static_cast<CoinListObject*>(modified())->setCost(cost);
- emit(changed(true));
- }
- catch (BoundsException& exception)
- {
- BugCatcher::report(exception);
- setGui();
- }
+ static_cast<CoinListObject*>(modified())->setCost(cost);
}