diff options
| author | Ben Boeckel <MathStuf@gmail.com> | 2008-05-07 02:08:51 +0000 |
|---|---|---|
| committer | Ben Boeckel <MathStuf@gmail.com> | 2008-05-07 02:08:51 +0000 |
| commit | 39a1b43adbebb73b87c4a2346b9ccb2c2a34753b (patch) | |
| tree | 08d55409c9d5b2149c4e8b341203dcbb42fa0a2c /pokemodr/StoreUI.cpp | |
| parent | 8714e1d409f46b05980b3e1e9f3a10910294b429 (diff) | |
| download | sigen-39a1b43adbebb73b87c4a2346b9ccb2c2a34753b.tar.gz sigen-39a1b43adbebb73b87c4a2346b9ccb2c2a34753b.tar.xz sigen-39a1b43adbebb73b87c4a2346b9ccb2c2a34753b.zip | |
[FIX] Added Q_OBJECT to pokemod classes
[FIX] UI classes fixed to work with new API
[FIX] Qmake files fixed
git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@121 6ecfd1a5-f3ed-3746-8530-beee90d26b22
Diffstat (limited to 'pokemodr/StoreUI.cpp')
| -rw-r--r-- | pokemodr/StoreUI.cpp | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/pokemodr/StoreUI.cpp b/pokemodr/StoreUI.cpp index 31db81a9..72128247 100644 --- a/pokemodr/StoreUI.cpp +++ b/pokemodr/StoreUI.cpp @@ -23,9 +23,6 @@ #include "../pokemod/Pokemod.h" #include "../pokemod/Store.h" -// General includes -#include "../general/BugCatcher.h" - StoreUI::StoreUI(Store* store, QWidget* parent) : ObjectUI(parent) { @@ -33,6 +30,10 @@ StoreUI::StoreUI(Store* store, QWidget* parent) : QMetaObject::connectSlotsByName(this); setObjects(store, new Store(*store)); connect(this, SIGNAL(changed(bool)), boxButtons, SLOT(setEnabled(bool))); + connect(modified(), SIGNAL(error()), this, SLOT(setGui())); + connect(modified(), SIGNAL(error(QString&)), this, SLOT(errorMessage(QString&))); + connect(modified(), SIGNAL(warning(QString&)), this, SLOT(warningMessage(QString&))); + connect(modified(), SIGNAL(changed()), this, SIGNAL(changed(true))); init(); } @@ -77,23 +78,13 @@ void StoreUI::on_buttonDiscard_clicked() void StoreUI::on_varName_textChanged(const QString& name) { static_cast<Store*>(modified())->setName(name); - emit(changed(true)); } void StoreUI::on_varItems_itemSelectionChanged() { - try - { - for (int i = 0; i < varItems->count(); ++i) - { - const QListWidgetItem* widgetItem = varItems->item(i); - static_cast<Store*>(modified())->setItem(widgetItem->data(Qt::UserRole).toInt(), widgetItem->isSelected()); - } - emit(changed(true)); - } - catch (BoundsException& exception) + for (int i = 0; i < varItems->count(); ++i) { - BugCatcher::report(exception); - setGui(); + const QListWidgetItem* widgetItem = varItems->item(i); + static_cast<Store*>(modified())->setItem(widgetItem->data(Qt::UserRole).toInt(), widgetItem->isSelected()); } } |
