summaryrefslogtreecommitdiffstats
path: root/sigmodr/widgets/CoinListUI.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'sigmodr/widgets/CoinListUI.cpp')
-rw-r--r--sigmodr/widgets/CoinListUI.cpp32
1 files changed, 18 insertions, 14 deletions
diff --git a/sigmodr/widgets/CoinListUI.cpp b/sigmodr/widgets/CoinListUI.cpp
index 153214fe..4448a984 100644
--- a/sigmodr/widgets/CoinListUI.cpp
+++ b/sigmodr/widgets/CoinListUI.cpp
@@ -32,13 +32,17 @@
#include <QtCore/QFile>
#include <QtUiTools/QUiLoader>
-Sigmodr::Widgets::CoinListUI::CoinListUI(Sigmod::CoinList* coinList, QWidget* parent) :
+using namespace Sigcore;
+using namespace Sigmod;
+using namespace Sigmodr::Widgets;
+
+CoinListUI::CoinListUI(CoinList* coinList, QWidget* parent) :
ObjectUI(parent)
{
- setObjects(coinList, new Sigmod::CoinList(*coinList));
+ setObjects(coinList, new CoinList(*coinList));
}
-void Sigmodr::Widgets::CoinListUI::initGui()
+void CoinListUI::initGui()
{
QFile file(":/gui/coinlist.ui");
file.open(QFile::ReadOnly);
@@ -50,33 +54,33 @@ void Sigmodr::Widgets::CoinListUI::initGui()
connect(ui_script, SIGNAL(valueChanged(Sigcore::Script)), this, SLOT(scriptChanged(Sigcore::Script)));
}
-void Sigmodr::Widgets::CoinListUI::setGui()
+void CoinListUI::setGui()
{
- ui_name->setText(qobject_cast<Sigmod::CoinList*>(modified())->name());
- ui_script->setValue(qobject_cast<Sigmod::CoinList*>(modified())->script());
+ ui_name->setText(qobject_cast<CoinList*>(modified())->name());
+ ui_script->setValue(qobject_cast<CoinList*>(modified())->script());
}
-void Sigmodr::Widgets::CoinListUI::apply()
+void CoinListUI::apply()
{
- *qobject_cast<Sigmod::CoinList*>(original()) = *qobject_cast<Sigmod::CoinList*>(modified());
+ *qobject_cast<CoinList*>(original()) = *qobject_cast<CoinList*>(modified());
emit(changed(false));
}
-void Sigmodr::Widgets::CoinListUI::discard()
+void CoinListUI::discard()
{
- *qobject_cast<Sigmod::CoinList*>(modified()) = *qobject_cast<Sigmod::CoinList*>(original());
+ *qobject_cast<CoinList*>(modified()) = *qobject_cast<CoinList*>(original());
setGui();
emit(changed(false));
}
-void Sigmodr::Widgets::CoinListUI::nameChanged(const QString& name)
+void CoinListUI::nameChanged(const QString& name)
{
const int cursor = ui_name->cursorPosition();
- qobject_cast<Sigmod::CoinList*>(modified())->setName(name);
+ qobject_cast<CoinList*>(modified())->setName(name);
ui_name->setCursorPosition(cursor);
}
-void Sigmodr::Widgets::CoinListUI::scriptChanged(const Sigcore::Script& script)
+void CoinListUI::scriptChanged(const Script& script)
{
- qobject_cast<Sigmod::CoinList*>(modified())->setScript(script);
+ qobject_cast<CoinList*>(modified())->setScript(script);
}