summaryrefslogtreecommitdiffstats
path: root/pokemodr/ItemUI.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/ItemUI.cpp
parent8714e1d409f46b05980b3e1e9f3a10910294b429 (diff)
[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/ItemUI.cpp')
-rw-r--r--pokemodr/ItemUI.cpp30
1 files changed, 6 insertions, 24 deletions
diff --git a/pokemodr/ItemUI.cpp b/pokemodr/ItemUI.cpp
index f2d50867..5dbeb8ff 100644
--- a/pokemodr/ItemUI.cpp
+++ b/pokemodr/ItemUI.cpp
@@ -23,9 +23,6 @@
#include "../pokemod/ItemType.h"
#include "../pokemod/Pokemod.h"
-// General includes
-#include "../general/BugCatcher.h"
-
ItemUI::ItemUI(Item* item, QWidget* parent) :
ObjectUI(parent)
{
@@ -33,6 +30,10 @@ ItemUI::ItemUI(Item* item, QWidget* parent) :
QMetaObject::connectSlotsByName(this);
setObjects(item, new Item(*item));
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();
}
@@ -88,34 +89,15 @@ void ItemUI::on_boxSellable_toggled(const bool sellable)
void ItemUI::on_varType_currentIndexChanged(const int type)
{
- try
- {
- static_cast<Item*>(modified())->setType(varType->itemData(type).toInt());
- emit(changed(true));
- }
- catch (Exception& exception)
- {
- BugCatcher::report(exception);
- setGui();
- }
+ static_cast<Item*>(modified())->setType(varType->itemData(type).toInt());
}
void ItemUI::on_varPrice_valueChanged(const int price)
{
- try
- {
- static_cast<Item*>(modified())->setPrice(price);
- emit(changed(true));
- }
- catch (BoundsException& exception)
- {
- BugCatcher::report(exception);
- setGui();
- }
+ static_cast<Item*>(modified())->setPrice(price);
}
void ItemUI::on_varDescription_textChanged()
{
static_cast<Item*>(modified())->setDescription(varDescription->toPlainText());
- emit(changed(true));
}