diff options
| author | Ben Boeckel <MathStuf@gmail.com> | 2009-02-24 21:21:41 -0500 |
|---|---|---|
| committer | Ben Boeckel <MathStuf@gmail.com> | 2009-02-24 21:26:04 -0500 |
| commit | 4acab35a099e9f6834432e7e89dee716c41549ba (patch) | |
| tree | f8c50f0d94914e23443e85469aa13b6293932901 /sigmodr/widgets/TimeUI.cpp | |
| parent | 4b2969cf969ba5db1d63438c5964daddec65a9c9 (diff) | |
Fixed Sigmodr widgets to use namespaces in sources
Diffstat (limited to 'sigmodr/widgets/TimeUI.cpp')
| -rw-r--r-- | sigmodr/widgets/TimeUI.cpp | 40 |
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); } |
