summaryrefslogtreecommitdiffstats
path: root/sigmodr/widgets/TimeUI.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'sigmodr/widgets/TimeUI.cpp')
-rw-r--r--sigmodr/widgets/TimeUI.cpp40
1 files changed, 22 insertions, 18 deletions
diff --git a/sigmodr/widgets/TimeUI.cpp b/sigmodr/widgets/TimeUI.cpp
index 928c8cea..3793b5b0 100644
--- a/sigmodr/widgets/TimeUI.cpp
+++ b/sigmodr/widgets/TimeUI.cpp
@@ -32,13 +32,17 @@
#include <QtGui/QTimeEdit>
#include <QtUiTools/QUiLoader>
-Sigmodr::Widgets::TimeUI::TimeUI(Sigmod::Time* time, QWidget* parent) :
+using namespace Sigcore;
+using namespace Sigmod;
+using namespace Sigmodr::Widgets;
+
+TimeUI::TimeUI(Time* time, QWidget* parent) :
ObjectUI(parent)
{
- setObjects(time, new Sigmod::Time(*time));
+ setObjects(time, new Time(*time));
}
-void Sigmodr::Widgets::TimeUI::initGui()
+void TimeUI::initGui()
{
QFile file(":/gui/time.ui");
file.open(QFile::ReadOnly);
@@ -52,40 +56,40 @@ void Sigmodr::Widgets::TimeUI::initGui()
connect(ui_script, SIGNAL(valueChanged(Sigcore::Script)), this, SLOT(scriptChanged(Sigcore::Script)));
}
-void Sigmodr::Widgets::TimeUI::setGui()
+void TimeUI::setGui()
{
- ui_name->setText(qobject_cast<Sigmod::Time*>(modified())->name());
- ui_time->setTime(QTime(qobject_cast<Sigmod::Time*>(modified())->hour(), qobject_cast<Sigmod::Time*>(modified())->minute()));
- ui_script->setValue(qobject_cast<Sigmod::Time*>(modified())->script());
+ ui_name->setText(qobject_cast<Time*>(modified())->name());
+ ui_time->setTime(QTime(qobject_cast<Time*>(modified())->hour(), qobject_cast<Time*>(modified())->minute()));
+ ui_script->setValue(qobject_cast<Time*>(modified())->script());
}
-void Sigmodr::Widgets::TimeUI::apply()
+void TimeUI::apply()
{
- *qobject_cast<Sigmod::Time*>(original()) = *qobject_cast<Sigmod::Time*>(modified());
+ *qobject_cast<Time*>(original()) = *qobject_cast<Time*>(modified());
emit(changed(false));
}
-void Sigmodr::Widgets::TimeUI::discard()
+void TimeUI::discard()
{
- *qobject_cast<Sigmod::Time*>(modified()) = *qobject_cast<Sigmod::Time*>(original());
+ *qobject_cast<Time*>(modified()) = *qobject_cast<Time*>(original());
setGui();
emit(changed(false));
}
-void Sigmodr::Widgets::TimeUI::nameChanged(const QString& name)
+void TimeUI::nameChanged(const QString& name)
{
const int cursor = ui_name->cursorPosition();
- qobject_cast<Sigmod::Time*>(modified())->setName(name);
+ qobject_cast<Time*>(modified())->setName(name);
ui_name->setCursorPosition(cursor);
}
-void Sigmodr::Widgets::TimeUI::timeChanged(const QTime& time)
+void TimeUI::timeChanged(const QTime& time)
{
- qobject_cast<Sigmod::Time*>(modified())->setHour(time.hour());
- qobject_cast<Sigmod::Time*>(modified())->setMinute(time.minute());
+ qobject_cast<Time*>(modified())->setHour(time.hour());
+ qobject_cast<Time*>(modified())->setMinute(time.minute());
}
-void Sigmodr::Widgets::TimeUI::scriptChanged(const Sigcore::Script& script)
+void TimeUI::scriptChanged(const Script& script)
{
- qobject_cast<Sigmod::Time*>(modified())->setScript(script);
+ qobject_cast<Time*>(modified())->setScript(script);
}