summaryrefslogtreecommitdiffstats
path: root/pokemodr/TrainerUI.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/TrainerUI.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/TrainerUI.cpp')
-rw-r--r--pokemodr/TrainerUI.cpp28
1 files changed, 6 insertions, 22 deletions
diff --git a/pokemodr/TrainerUI.cpp b/pokemodr/TrainerUI.cpp
index 5551df55..d105369f 100644
--- a/pokemodr/TrainerUI.cpp
+++ b/pokemodr/TrainerUI.cpp
@@ -24,9 +24,6 @@
// Pokemod includes
#include "../pokemod/Trainer.h"
-// General includes
-#include "../general/BugCatcher.h"
-
TrainerUI::TrainerUI(Trainer * trainer, QWidget * parent) :
ObjectUI(parent)
{
@@ -34,6 +31,10 @@ TrainerUI::TrainerUI(Trainer * trainer, QWidget * parent) :
QMetaObject::connectSlotsByName(this);
setObjects(trainer, new Trainer(*trainer));
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();
}
@@ -64,21 +65,11 @@ void TrainerUI::on_buttonDiscard_clicked()
void TrainerUI::on_varName_textChanged(const QString & name)
{
static_cast<Trainer*>(modified())->setName(name);
- emit(changed(true));
}
void TrainerUI::on_varMoneyFactor_valueChaged(const int moneyFactor)
{
- try
- {
- static_cast<Trainer*>(modified())->setMoneyFactor(moneyFactor);
- emit(changed(true));
- }
- catch (BoundsException& exception)
- {
- BugCatcher::report(exception);
- setGui();
- }
+ static_cast<Trainer*>(modified())->setMoneyFactor(moneyFactor);
}
void TrainerUI::on_varSkin_pressed()
@@ -86,14 +77,7 @@ void TrainerUI::on_varSkin_pressed()
FileDialog dialog(QSize(192, 168));
if (dialog.exec())
{
- try
- {
- static_cast<Trainer*>(modified())->setSkin(QPixmap(dialog.selectedFile()));
- }
- catch (SaveException& exception)
- {
- BugCatcher::report(exception);
- }
+ static_cast<Trainer*>(modified())->setSkin(QPixmap(dialog.selectedFile()));
setGui();
}
}