summaryrefslogtreecommitdiffstats
path: root/sigmodr/widgets/WeatherUI.cpp
diff options
context:
space:
mode:
authorBen Boeckel <MathStuf@gmail.com>2009-02-24 21:21:41 -0500
committerBen Boeckel <MathStuf@gmail.com>2009-02-24 21:26:04 -0500
commit4acab35a099e9f6834432e7e89dee716c41549ba (patch)
treef8c50f0d94914e23443e85469aa13b6293932901 /sigmodr/widgets/WeatherUI.cpp
parent4b2969cf969ba5db1d63438c5964daddec65a9c9 (diff)
Fixed Sigmodr widgets to use namespaces in sources
Diffstat (limited to 'sigmodr/widgets/WeatherUI.cpp')
-rw-r--r--sigmodr/widgets/WeatherUI.cpp32
1 files changed, 18 insertions, 14 deletions
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 <QtCore/QFile>
#include <QtUiTools/QUiLoader>
-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<Sigmod::Weather*>(modified())->name());
- ui_script->setValue(qobject_cast<Sigmod::Weather*>(modified())->script());
+ ui_name->setText(qobject_cast<Weather*>(modified())->name());
+ ui_script->setValue(qobject_cast<Weather*>(modified())->script());
}
-void Sigmodr::Widgets::WeatherUI::apply()
+void WeatherUI::apply()
{
- *qobject_cast<Sigmod::Weather*>(original()) = *qobject_cast<Sigmod::Weather*>(modified());
+ *qobject_cast<Weather*>(original()) = *qobject_cast<Weather*>(modified());
emit(changed(false));
}
-void Sigmodr::Widgets::WeatherUI::discard()
+void WeatherUI::discard()
{
- *qobject_cast<Sigmod::Weather*>(modified()) = *qobject_cast<Sigmod::Weather*>(original());
+ *qobject_cast<Weather*>(modified()) = *qobject_cast<Weather*>(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<Sigmod::Weather*>(modified())->setName(name);
+ qobject_cast<Weather*>(modified())->setName(name);
ui_name->setCursorPosition(cursor);
}
-void Sigmodr::Widgets::WeatherUI::scriptChanged(const Sigcore::Script& script)
+void WeatherUI::scriptChanged(const Script& script)
{
- qobject_cast<Sigmod::Weather*>(modified())->setScript(script);
+ qobject_cast<Weather*>(modified())->setScript(script);
}