summaryrefslogtreecommitdiffstats
path: root/pokemodr/TimeUI.cpp
diff options
context:
space:
mode:
authorBen Boeckel <MathStuf@gmail.com>2008-04-27 17:57:32 +0000
committerBen Boeckel <MathStuf@gmail.com>2008-04-27 17:57:32 +0000
commit0fa52c1f61c457c9b68bec53bcce3af858e5eb44 (patch)
treec5b10b77a01b417775097476029bcf67fac79975 /pokemodr/TimeUI.cpp
parent807071d35159de0660f9df31c48d5bf895ca3622 (diff)
[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
Diffstat (limited to 'pokemodr/TimeUI.cpp')
-rw-r--r--pokemodr/TimeUI.cpp34
1 files changed, 19 insertions, 15 deletions
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 <http://www.gnu.org/licenses/>.
*/
+// 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<Time*>(modified())->name());
+ varTime->setTime(QTime(static_cast<Time*>(modified())->hour(), static_cast<Time*>(modified())->minute()));
}
void TimeUI::on_buttonApply_clicked()
{
- *m_time = *m_time_mod;
+ *static_cast<Time*>(original()) = *static_cast<Time*>(modified());
emit(changed(false));
}
void TimeUI::on_buttonDiscard_clicked()
{
- *m_time_mod = *m_time;
+ *static_cast<Time*>(modified()) = *static_cast<Time*>(original());
setGui();
emit(changed(false));
}
void TimeUI::on_varName_textChanged(const QString& name)
{
- m_time_mod->setName(name);
+ static_cast<Time*>(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<Time*>(modified())->setHour(time.hour());
+ static_cast<Time*>(modified())->setMinute(time.minute());
emit(changed(true));
}
catch (BoundsException& exception)