summaryrefslogtreecommitdiffstats
path: root/pokemodr/CoinListUI.cpp
diff options
context:
space:
mode:
authorBen Boeckel <MathStuf@gmail.com>2008-01-31 19:54:19 +0000
committerBen Boeckel <MathStuf@gmail.com>2008-01-31 19:54:19 +0000
commit29d664520f09818f4762169c4a13f4cacb4e55aa (patch)
tree75375d363075d2808bcb7e4ae73343358fbfb040 /pokemodr/CoinListUI.cpp
parent14a52db47b4268b03c4b37d84df48cdb3128f09c (diff)
downloadsigen-29d664520f09818f4762169c4a13f4cacb4e55aa.tar.gz
sigen-29d664520f09818f4762169c4a13f4cacb4e55aa.tar.xz
sigen-29d664520f09818f4762169c4a13f4cacb4e55aa.zip
[FIX] Changelog fixed
[FIX] Warnings in pokemod gone [FIX] BoundsException thrown from Item::setPrice() [FIX] CoinLIst now has correct className [FIX] Frac needed in header for ItemEffect [ADD] CoinList, EggGroup, and Item UI logic added git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@52 6ecfd1a5-f3ed-3746-8530-beee90d26b22
Diffstat (limited to 'pokemodr/CoinListUI.cpp')
-rw-r--r--pokemodr/CoinListUI.cpp82
1 files changed, 82 insertions, 0 deletions
diff --git a/pokemodr/CoinListUI.cpp b/pokemodr/CoinListUI.cpp
new file mode 100644
index 00000000..6fc14aa0
--- /dev/null
+++ b/pokemodr/CoinListUI.cpp
@@ -0,0 +1,82 @@
+/////////////////////////////////////////////////////////////////////////////
+// Name: pokegen/CoinListUI.cpp
+// Purpose: CoinList UI form handling
+// Author: Ben Boeckel
+// Modified by: Ben Boeckel
+// Created: Sun Jan 27 12:31:08 2008
+// Copyright: ©2007-2008 Ben Boeckel and Nerdy Productions
+// Licence:
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTCoinList or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with this program. If not, see <http://www.gnu.org/licenses/>.
+/////////////////////////////////////////////////////////////////////////////
+
+#include <QMetaObject>
+#include "../general/BugCatcher.h"
+#include "../general/Exception.h"
+#include "CoinListUI.h"
+
+CoinListUI::CoinListUI(CoinList* c, QWidget* parent) :
+ ObjectUI(parent),
+ coinList(c),
+ coinList_mod(new CoinList(c->getPokemod(), *c, c->getId()))
+{
+ setupUi(this);
+ QMetaObject::connectSlotsByName(this);
+ setObjects(coinList, coinList_mod);
+ setGui();
+}
+
+// KToolbar CoinListUI::getToolbar(QWidget* parent)
+// {
+//
+// }
+
+void CoinListUI::setGui()
+{
+ varName->setText(coinList_mod->getName());
+ varValue->setValue(coinList_mod->getValue());
+}
+
+void CoinListUI::on_buttonApply_clicked()
+{
+ *coinList = *coinList_mod;
+ emit(setChanged(false));
+}
+
+void CoinListUI::on_buttonDiscard_clicked()
+{
+ *coinList_mod = *coinList;
+ emit(setChanged(false));
+ setGui();
+}
+
+void CoinListUI::on_varName_textChanged(const QString& n)
+{
+ coinList_mod->setName(n);
+ emit(setChanged(true));
+}
+
+void CoinListUI::on_varValue_valueChanged(const int v)
+{
+ // TODO: Make a KComboBox with all available coin types instead
+ try
+ {
+ coinList_mod->setValue(v);
+ emit(setChanged(true));
+ }
+ catch (Exception& e)
+ {
+// BugCatcher::report(e);
+ setGui();
+ }
+}