From 4acab35a099e9f6834432e7e89dee716c41549ba Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Tue, 24 Feb 2009 21:21:41 -0500 Subject: Fixed Sigmodr widgets to use namespaces in sources --- sigmodr/widgets/WeatherUI.cpp | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) (limited to 'sigmodr/widgets/WeatherUI.cpp') diff --git a/sigmodr/widgets/WeatherUI.cpp b/sigmodr/widgets/WeatherUI.cpp index 38ab41a8..537477a8 100644 --- a/sigmodr/widgets/WeatherUI.cpp +++ b/sigmodr/widgets/WeatherUI.cpp @@ -31,13 +31,17 @@ #include #include -Sigmodr::Widgets::WeatherUI::WeatherUI(Sigmod::Weather* weather, QWidget* parent) : +using namespace Sigcore; +using namespace Sigmod; +using namespace Sigmodr::Widgets; + +WeatherUI::WeatherUI(Weather* weather, QWidget* parent) : ObjectUI(parent) { - setObjects(weather, new Sigmod::Weather(*weather)); + setObjects(weather, new Weather(*weather)); } -void Sigmodr::Widgets::WeatherUI::initGui() +void WeatherUI::initGui() { QFile file(":/gui/weather.ui"); file.open(QFile::ReadOnly); @@ -49,33 +53,33 @@ void Sigmodr::Widgets::WeatherUI::initGui() connect(ui_script, SIGNAL(scriptChanged(Sigcore::Script)), this, SLOT(scriptChanged(Sigcore::Script))); } -void Sigmodr::Widgets::WeatherUI::setGui() +void WeatherUI::setGui() { - ui_name->setText(qobject_cast(modified())->name()); - ui_script->setValue(qobject_cast(modified())->script()); + ui_name->setText(qobject_cast(modified())->name()); + ui_script->setValue(qobject_cast(modified())->script()); } -void Sigmodr::Widgets::WeatherUI::apply() +void WeatherUI::apply() { - *qobject_cast(original()) = *qobject_cast(modified()); + *qobject_cast(original()) = *qobject_cast(modified()); emit(changed(false)); } -void Sigmodr::Widgets::WeatherUI::discard() +void WeatherUI::discard() { - *qobject_cast(modified()) = *qobject_cast(original()); + *qobject_cast(modified()) = *qobject_cast(original()); setGui(); emit(changed(false)); } -void Sigmodr::Widgets::WeatherUI::nameChanged(const QString& name) +void WeatherUI::nameChanged(const QString& name) { const int cursor = ui_name->cursorPosition(); - qobject_cast(modified())->setName(name); + qobject_cast(modified())->setName(name); ui_name->setCursorPosition(cursor); } -void Sigmodr::Widgets::WeatherUI::scriptChanged(const Sigcore::Script& script) +void WeatherUI::scriptChanged(const Script& script) { - qobject_cast(modified())->setScript(script); + qobject_cast(modified())->setScript(script); } -- cgit