From 0fa52c1f61c457c9b68bec53bcce3af858e5eb44 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Sun, 27 Apr 2008 17:57:32 +0000 Subject: [FIX] More header cleanliness [FIX] UI classes now just use the ObjectUI pointers [FIX] Some miscellaneous qmake options git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@112 6ecfd1a5-f3ed-3746-8530-beee90d26b22 --- pokemodr/TimeUI.cpp | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) (limited to 'pokemodr/TimeUI.cpp') diff --git a/pokemodr/TimeUI.cpp b/pokemodr/TimeUI.cpp index cef3522e..402f2066 100644 --- a/pokemodr/TimeUI.cpp +++ b/pokemodr/TimeUI.cpp @@ -15,47 +15,51 @@ * with this program. If not, see . */ +// Header include +#include "TimeUI.h" + +// Pokemod includes +#include "../pokemod/Time.h" + // General includes #include "../general/BugCatcher.h" -#include "../general/Exception.h" - -// Gheaer include -#include "TimeUI.h" TimeUI::TimeUI(Time* time, QWidget* parent) : - ObjectUI(parent), - m_time(time), - m_time_mod(new Time(*time)) + ObjectUI(parent) { setupUi(this); QMetaObject::connectSlotsByName(this); - setObjects(m_time, m_time_mod); + setObjects(time, new Time(*time)); connect(this, SIGNAL(changed(bool)), boxButtons, SLOT(setEnabled(bool))); init(); } +TimeUI::~TimeUI() +{ +} + void TimeUI::setGui() { - varName->setText(m_time_mod->name()); - varTime->setTime(QTime(m_time_mod->hour(), m_time_mod->minute())); + varName->setText(static_cast(modified())->name()); + varTime->setTime(QTime(static_cast(modified())->hour(), static_cast(modified())->minute())); } void TimeUI::on_buttonApply_clicked() { - *m_time = *m_time_mod; + *static_cast(original()) = *static_cast(modified()); emit(changed(false)); } void TimeUI::on_buttonDiscard_clicked() { - *m_time_mod = *m_time; + *static_cast(modified()) = *static_cast(original()); setGui(); emit(changed(false)); } void TimeUI::on_varName_textChanged(const QString& name) { - m_time_mod->setName(name); + static_cast(modified())->setName(name); emit(changed(true)); } @@ -63,8 +67,8 @@ void TimeUI::on_varTime_timeChanged(const QTime& time) { try { - m_time_mod->setHour(time.hour()); - m_time_mod->setMinute(time.minute()); + static_cast(modified())->setHour(time.hour()); + static_cast(modified())->setMinute(time.minute()); emit(changed(true)); } catch (BoundsException& exception) -- cgit