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/TimeUI.cpp | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) (limited to 'pokemodr/TimeUI.cpp') diff --git a/pokemodr/TimeUI.cpp b/pokemodr/TimeUI.cpp index 402f2066..7b7874e8 100644 --- a/pokemodr/TimeUI.cpp +++ b/pokemodr/TimeUI.cpp @@ -21,9 +21,6 @@ // Pokemod includes #include "../pokemod/Time.h" -// General includes -#include "../general/BugCatcher.h" - TimeUI::TimeUI(Time* time, QWidget* parent) : ObjectUI(parent) { @@ -31,6 +28,10 @@ TimeUI::TimeUI(Time* time, QWidget* parent) : QMetaObject::connectSlotsByName(this); setObjects(time, new Time(*time)); 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(); } @@ -60,20 +61,10 @@ void TimeUI::on_buttonDiscard_clicked() void TimeUI::on_varName_textChanged(const QString& name) { static_cast(modified())->setName(name); - emit(changed(true)); } void TimeUI::on_varTime_timeChanged(const QTime& time) { - try - { - static_cast(modified())->setHour(time.hour()); - static_cast(modified())->setMinute(time.minute()); - emit(changed(true)); - } - catch (BoundsException& exception) - { - BugCatcher::report(exception); - setGui(); - } + static_cast(modified())->setHour(time.hour()); + static_cast(modified())->setMinute(time.minute()); } -- cgit