diff options
| author | Ben Boeckel <MathStuf@gmail.com> | 2008-04-27 17:57:32 +0000 |
|---|---|---|
| committer | Ben Boeckel <MathStuf@gmail.com> | 2008-04-27 17:57:32 +0000 |
| commit | 0fa52c1f61c457c9b68bec53bcce3af858e5eb44 (patch) | |
| tree | c5b10b77a01b417775097476029bcf67fac79975 /pokemodr/CoinListUI.cpp | |
| parent | 807071d35159de0660f9df31c48d5bf895ca3622 (diff) | |
| download | sigen-0fa52c1f61c457c9b68bec53bcce3af858e5eb44.tar.gz sigen-0fa52c1f61c457c9b68bec53bcce3af858e5eb44.tar.xz sigen-0fa52c1f61c457c9b68bec53bcce3af858e5eb44.zip | |
[FIX] More header cleanliness
[FIX] UI classes now just use the ObjectUI pointers
[FIX] Some miscellaneous qmake options
git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@112 6ecfd1a5-f3ed-3746-8530-beee90d26b22
Diffstat (limited to 'pokemodr/CoinListUI.cpp')
| -rw-r--r-- | pokemodr/CoinListUI.cpp | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/pokemodr/CoinListUI.cpp b/pokemodr/CoinListUI.cpp index d8eadc3d..54355187 100644 --- a/pokemodr/CoinListUI.cpp +++ b/pokemodr/CoinListUI.cpp @@ -19,35 +19,34 @@ #include "CoinListUI.h" // Pokemod includes +#include "../pokemod/CoinList.h" #include "../pokemod/Item.h" #include "../pokemod/ItemEffect.h" #include "../pokemod/Pokemod.h" // General includes #include "../general/BugCatcher.h" -#include "../general/Exception.h" - -// Qt includes -#include <QVariant> CoinListUI::CoinListUI(CoinList* coinList, QWidget* parent) : - ObjectUI(parent), - m_coinList(coinList), - m_coinList_mod(new CoinList(*coinList)) + ObjectUI(parent) { setupUi(this); QMetaObject::connectSlotsByName(this); - setObjects(m_coinList, m_coinList_mod); + setObjects(coinList, new CoinList(*coinList)); connect(this, SIGNAL(changed(bool)), boxButtons, SLOT(setEnabled(bool))); init(); } +CoinListUI::~CoinListUI() +{ +} + void CoinListUI::refreshGui() { varValue->clear(); - for (int i = 0; i < static_cast<const Pokemod*>(m_coinList->pokemod())->itemCount(); ++i) + for (int i = 0; i < static_cast<const Pokemod*>(static_cast<CoinList*>(original())->pokemod())->itemCount(); ++i) { - const Item* item = static_cast<const Pokemod*>(m_coinList->pokemod())->item(i); + const Item* item = static_cast<const Pokemod*>(static_cast<CoinList*>(original())->pokemod())->item(i); for (int j = 0; j < item->effectCount(); ++j) { const ItemEffect* effect = item->effect(j); @@ -62,26 +61,26 @@ void CoinListUI::refreshGui() void CoinListUI::setGui() { - varName->setText(m_coinList_mod->name()); - varValue->setCurrentIndex(varValue->findData(m_coinList_mod->value())); + varName->setText(static_cast<CoinList*>(modified())->name()); + varValue->setCurrentIndex(varValue->findData(static_cast<CoinList*>(modified())->value())); } void CoinListUI::on_buttonApply_clicked() { - *m_coinList = *m_coinList_mod; + *static_cast<CoinList*>(original()) = *static_cast<CoinList*>(modified()); emit(changed(false)); } void CoinListUI::on_buttonDiscard_clicked() { - *m_coinList_mod = *m_coinList; + *static_cast<CoinList*>(modified()) = *static_cast<CoinList*>(original()); setGui(); emit(changed(false)); } void CoinListUI::on_varName_textChanged(const QString& name) { - m_coinList_mod->setName(name); + static_cast<CoinList*>(modified())->setName(name); emit(changed(true)); } @@ -89,7 +88,7 @@ void CoinListUI::on_varValue_currentIndexChanged(const int value) { try { - m_coinList_mod->setValue(varValue->itemData(value).toInt()); + static_cast<CoinList*>(modified())->setValue(varValue->itemData(value).toInt()); emit(changed(true)); } catch (Exception& exception) |
