summaryrefslogtreecommitdiffstats
path: root/pokemodr/TimeUI.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'pokemodr/TimeUI.cpp')
-rw-r--r--pokemodr/TimeUI.cpp21
1 files changed, 6 insertions, 15 deletions
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<Time*>(modified())->setName(name);
- emit(changed(true));
}
void TimeUI::on_varTime_timeChanged(const QTime& time)
{
- try
- {
- static_cast<Time*>(modified())->setHour(time.hour());
- static_cast<Time*>(modified())->setMinute(time.minute());
- emit(changed(true));
- }
- catch (BoundsException& exception)
- {
- BugCatcher::report(exception);
- setGui();
- }
+ static_cast<Time*>(modified())->setHour(time.hour());
+ static_cast<Time*>(modified())->setMinute(time.minute());
}