summaryrefslogtreecommitdiffstats
path: root/pokemodr/CoinListObjectUI.cpp
diff options
context:
space:
mode:
authorBen Boeckel <MathStuf@gmail.com>2008-05-07 02:08:51 +0000
committerBen Boeckel <MathStuf@gmail.com>2008-05-07 02:08:51 +0000
commit39a1b43adbebb73b87c4a2346b9ccb2c2a34753b (patch)
tree08d55409c9d5b2149c4e8b341203dcbb42fa0a2c /pokemodr/CoinListObjectUI.cpp
parent8714e1d409f46b05980b3e1e9f3a10910294b429 (diff)
downloadsigen-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/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);
}