diff options
Diffstat (limited to 'sigmodr/widgets/MapWildListUI.cpp')
| -rw-r--r-- | sigmodr/widgets/MapWildListUI.cpp | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/sigmodr/widgets/MapWildListUI.cpp b/sigmodr/widgets/MapWildListUI.cpp index 376412b3..11a48151 100644 --- a/sigmodr/widgets/MapWildListUI.cpp +++ b/sigmodr/widgets/MapWildListUI.cpp @@ -28,13 +28,16 @@ #include <QtCore/QFile> #include <QtUiTools/QUiLoader> -Sigmodr::Widgets::MapWildListUI::MapWildListUI(Sigmod::MapWildList* wildList, QWidget* parent) : +using namespace Sigmod; +using namespace Sigmodr::Widgets; + +MapWildListUI::MapWildListUI(MapWildList* wildList, QWidget* parent) : ObjectUI(parent) { - setObjects(wildList, new Sigmod::MapWildList(*wildList)); + setObjects(wildList, new MapWildList(*wildList)); } -void Sigmodr::Widgets::MapWildListUI::initGui() +void MapWildListUI::initGui() { QFile file(":/gui/mapwildlist.ui"); file.open(QFile::ReadOnly); @@ -44,27 +47,27 @@ void Sigmodr::Widgets::MapWildListUI::initGui() connect(ui_name, SIGNAL(textChanged(QString)), this, SLOT(nameChanged(QString))); } -void Sigmodr::Widgets::MapWildListUI::setGui() +void MapWildListUI::setGui() { - ui_name->setText(qobject_cast<Sigmod::MapWildList*>(modified())->name()); + ui_name->setText(qobject_cast<MapWildList*>(modified())->name()); } -void Sigmodr::Widgets::MapWildListUI::apply() +void MapWildListUI::apply() { - *qobject_cast<Sigmod::MapWildList*>(original()) = *qobject_cast<Sigmod::MapWildList*>(modified()); + *qobject_cast<MapWildList*>(original()) = *qobject_cast<MapWildList*>(modified()); emit(changed(false)); } -void Sigmodr::Widgets::MapWildListUI::discard() +void MapWildListUI::discard() { - *qobject_cast<Sigmod::MapWildList*>(modified()) = *qobject_cast<Sigmod::MapWildList*>(original()); + *qobject_cast<MapWildList*>(modified()) = *qobject_cast<MapWildList*>(original()); setGui(); emit(changed(false)); } -void Sigmodr::Widgets::MapWildListUI::nameChanged(const QString& name) +void MapWildListUI::nameChanged(const QString& name) { const int cursor = ui_name->cursorPosition(); - qobject_cast<Sigmod::MapWildList*>(modified())->setName(name); + qobject_cast<MapWildList*>(modified())->setName(name); ui_name->setCursorPosition(cursor); } |
