diff options
| author | Ben Boeckel <MathStuf@gmail.com> | 2009-02-23 20:24:14 -0500 |
|---|---|---|
| committer | Ben Boeckel <MathStuf@gmail.com> | 2009-02-23 20:28:12 -0500 |
| commit | cd9396d859cbba795c945796a6a0790a6c5c00a3 (patch) | |
| tree | 7ee18954a884e430b685b64686d8985ecf6c9a86 /sigmodr/widgets/ItemUI.cpp | |
| parent | 3479836bc56ed61f53ecd4aefa4a83a5378901a8 (diff) | |
| download | sigen-cd9396d859cbba795c945796a6a0790a6c5c00a3.tar.gz sigen-cd9396d859cbba795c945796a6a0790a6c5c00a3.tar.xz sigen-cd9396d859cbba795c945796a6a0790a6c5c00a3.zip | |
Moved the sources into the Widgets namespace
Diffstat (limited to 'sigmodr/widgets/ItemUI.cpp')
| -rw-r--r-- | sigmodr/widgets/ItemUI.cpp | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/sigmodr/widgets/ItemUI.cpp b/sigmodr/widgets/ItemUI.cpp index 45c42e96..3ef2ba11 100644 --- a/sigmodr/widgets/ItemUI.cpp +++ b/sigmodr/widgets/ItemUI.cpp @@ -24,7 +24,7 @@ #include <sigmod/Rules.h> #include <sigmod/Sigmod.h> -Sigmodr::ItemUI::ItemUI(Sigmod::Item* item, QWidget* parent) : +Sigmodr::Widgets::ItemUI::ItemUI(Sigmod::Item* item, QWidget* parent) : ObjectUI(parent), m_lastType(-1) { @@ -32,11 +32,11 @@ Sigmodr::ItemUI::ItemUI(Sigmod::Item* item, QWidget* parent) : setObjects(item, new Sigmod::Item(*item)); } -Sigmodr::ItemUI::~ItemUI() +Sigmodr::Widgets::ItemUI::~ItemUI() { } -void Sigmodr::ItemUI::refreshGui() +void Sigmodr::Widgets::ItemUI::refreshGui() { const bool blocked = varType->blockSignals(true); varType->clear(); @@ -49,7 +49,7 @@ void Sigmodr::ItemUI::refreshGui() varPrice->setMaximum(sigmod()->rules()->maxMoney()); } -void Sigmodr::ItemUI::setGui() +void Sigmodr::Widgets::ItemUI::setGui() { const bool resetWeight = (qobject_cast<Sigmod::Item*>(modified())->type() != m_lastType); varName->setText(qobject_cast<Sigmod::Item*>(modified())->name()); @@ -70,57 +70,57 @@ void Sigmodr::ItemUI::setGui() varScript->setValue(qobject_cast<Sigmod::Item*>(modified())->script()); } -void Sigmodr::ItemUI::apply() +void Sigmodr::Widgets::ItemUI::apply() { *qobject_cast<Sigmod::Item*>(original()) = *qobject_cast<Sigmod::Item*>(modified()); emit(changed(false)); } -void Sigmodr::ItemUI::discard() +void Sigmodr::Widgets::ItemUI::discard() { *qobject_cast<Sigmod::Item*>(modified()) = *qobject_cast<Sigmod::Item*>(original()); setGui(); emit(changed(false)); } -void Sigmodr::ItemUI::on_varName_textChanged(const QString& name) +void Sigmodr::Widgets::ItemUI::on_varName_textChanged(const QString& name) { const int cursor = varName->cursorPosition(); qobject_cast<Sigmod::Item*>(modified())->setName(name); varName->setCursorPosition(cursor); } -void Sigmodr::ItemUI::on_varSellable_toggled(const bool sellable) +void Sigmodr::Widgets::ItemUI::on_varSellable_toggled(const bool sellable) { qobject_cast<Sigmod::Item*>(modified())->setSellable(sellable); } -void Sigmodr::ItemUI::on_varType_activated(const int type) +void Sigmodr::Widgets::ItemUI::on_varType_activated(const int type) { qobject_cast<Sigmod::Item*>(modified())->setType(varType->itemData(type).toInt()); } -void Sigmodr::ItemUI::on_varPrice_valueChanged(const int price) +void Sigmodr::Widgets::ItemUI::on_varPrice_valueChanged(const int price) { qobject_cast<Sigmod::Item*>(modified())->setPrice(price); } -void Sigmodr::ItemUI::on_varSellPrice_valueChanged(const int sellPrice) +void Sigmodr::Widgets::ItemUI::on_varSellPrice_valueChanged(const int sellPrice) { qobject_cast<Sigmod::Item*>(modified())->setSellPrice(sellPrice); } -void Sigmodr::ItemUI::on_varWeight_valueChanged(const int weight) +void Sigmodr::Widgets::ItemUI::on_varWeight_valueChanged(const int weight) { qobject_cast<Sigmod::Item*>(modified())->setWeight(weight); } -void Sigmodr::ItemUI::on_varDescription_textChanged(const QString& description) +void Sigmodr::Widgets::ItemUI::on_varDescription_textChanged(const QString& description) { qobject_cast<Sigmod::Item*>(modified())->setDescription(description); } -void Sigmodr::ItemUI::on_varScript_valueChanged(const Sigcore::Script& script) +void Sigmodr::Widgets::ItemUI::on_varScript_valueChanged(const Sigcore::Script& script) { qobject_cast<Sigmod::Item*>(modified())->setScript(script); } |
