diff options
author | Ben Boeckel <MathStuf@gmail.com> | 2008-03-10 02:31:26 +0000 |
---|---|---|
committer | Ben Boeckel <MathStuf@gmail.com> | 2008-03-10 02:31:26 +0000 |
commit | 8e1ec2aec50999bae30625303f2c96e5b3b7f318 (patch) | |
tree | 1cdabdde0e2518b71f0ab7247069e971424650bd | |
parent | 0191933210bd20a59527fcf2732a4f3c846fb2a9 (diff) | |
download | sigen-8e1ec2aec50999bae30625303f2c96e5b3b7f318.tar.gz sigen-8e1ec2aec50999bae30625303f2c96e5b3b7f318.tar.xz sigen-8e1ec2aec50999bae30625303f2c96e5b3b7f318.zip |
[FIX] ImageDialog -> FileDialog
[FIX] FileDialog will filter out images based on size now
git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@94 6ecfd1a5-f3ed-3746-8530-beee90d26b22
-rw-r--r-- | Changelog | 8 | ||||
-rw-r--r-- | pokemodr/BadgeUI.cpp | 13 | ||||
-rw-r--r-- | pokemodr/FileDialog.cpp | 64 | ||||
-rw-r--r-- | pokemodr/FileDialog.h (renamed from pokemodr/ImageDialog.h) | 48 | ||||
-rw-r--r-- | pokemodr/PokeModTreeItem.cpp | 13 | ||||
-rw-r--r-- | pokemodr/PokeModr.cpp | 4 | ||||
-rw-r--r-- | pokemodr/PokemodUI.cpp | 35 | ||||
-rw-r--r-- | pokemodr/SpeciesUI.cpp | 28 | ||||
-rw-r--r-- | pokemodr/TileUI.cpp | 8 | ||||
-rw-r--r-- | pokemodr/TrainerUI.cpp | 123 | ||||
-rw-r--r-- | pokemodr/TrainerUI.h (renamed from pokemodr/ImageDialog.cpp) | 65 | ||||
-rw-r--r-- | pokemodr/pokemodr.pro | 6 |
12 files changed, 332 insertions, 83 deletions
@@ -1,4 +1,12 @@ ----------------- +Rev: 94 +Date: 9 March 2008 +User: MathStuf +----------------- +[FIX] ImageDialog -> FileDialog +[FIX] FileDialog will filter out images based on size now + +----------------- Rev: 93 Date: 9 March 2008 User: MathStuf diff --git a/pokemodr/BadgeUI.cpp b/pokemodr/BadgeUI.cpp index 3522f5d4..f77b873b 100644 --- a/pokemodr/BadgeUI.cpp +++ b/pokemodr/BadgeUI.cpp @@ -22,6 +22,7 @@ #include <QListWidgetItem> #include <QMetaObject> +#include <QSize> #include <BugCatcher.h> #include <Exception.h> @@ -29,7 +30,7 @@ #include <Pokemod.h> -#include "ImageDialog.h" +#include "FileDialog.h" #include "BadgeUI.h" BadgeUI::BadgeUI(Badge* b, QWidget* parent) : @@ -117,11 +118,12 @@ void BadgeUI::on_varObey_valueChanged(const int o) void BadgeUI::on_varFace_pressed() { - if (ImageDialog::exec()) + FileDialog dlg("*.png", QSize(64, 64)); + if (dlg.show()) { try { - badge_mod->setFace(ImageDialog::selectedUrl()); + badge_mod->setFace(dlg.selectedUrl()); } catch (SaveException& e) { @@ -133,11 +135,12 @@ void BadgeUI::on_varFace_pressed() void BadgeUI::on_varBadge_pressed() { - if (ImageDialog::exec()) + FileDialog dlg("*.png", QSize(64, 64)); + if (dlg.show()) { try { - badge_mod->setBadge(ImageDialog::selectedUrl()); + badge_mod->setBadge(dlg.selectedUrl()); } catch (SaveException& e) { diff --git a/pokemodr/FileDialog.cpp b/pokemodr/FileDialog.cpp new file mode 100644 index 00000000..09afd852 --- /dev/null +++ b/pokemodr/FileDialog.cpp @@ -0,0 +1,64 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: pokegen/FileDialog.cpp +// Purpose: Dialog to open files +// Author: Ben Boeckel +// Modified by: Ben Boeckel +// Created: Fri Feb 1 08:34:34 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 +// MERCHANTABILITY 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 <kdiroperator.h> +#include <kfilewidget.h> +#include <kimagefilepreview.h> + +#include <QDir> +#include <QImage> +#include <QStringList> + +#include "FileDialog.h" + +FileDialog::FileDialog(const QString& filter, const QSize& imgSize) : + QObject(NULL), + dlg(NULL) +{ + if (latestDir == "") + latestDir = KUrl(QString("%1/.kde/share/apps/pokegen/images").arg(QDir::homePath())); + size = imgSize; + dlg = new KFileDialog(latestDir, filter, NULL); + dlg->setOperationMode(KFileDialog::Opening); + if (size.isValid()) + { + dlg->setPreviewWidget(new KImageFilePreview()); + connect(static_cast<KFileWidget*>(dlg->fileWidget())->findChild<KDirOperator*>(), SIGNAL(dirActivated(const KFileItem&)), this, SLOT(sizeFilter(const FileItem&))); + } +} + +void FileDialog::sizeFilter(const KFileItem& item) +{ + QString filter; + QStringList files(QDir(item.url().path()).entryList(QStringList() << "*.png", QDir::Files)); + for (int i = 0; i < files.size(); ++i) + { + if (QImage(files.at(i)).size() == size) + { + if (filter.length()) + filter.append(" "); + filter.append(files.at(i)); + } + } + filter.append("|Valid PNG Files"); + dlg->setFilter(filter); +} diff --git a/pokemodr/ImageDialog.h b/pokemodr/FileDialog.h index 7c6ebee4..4b60dac0 100644 --- a/pokemodr/ImageDialog.h +++ b/pokemodr/FileDialog.h @@ -1,6 +1,6 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: pokegen/ImageDialog.h -// Purpose: Dialog to open dialogs +// Name: pokegen/FileDialog.h +// Purpose: Dialog to open files // Author: Ben Boeckel // Modified by: Ben Boeckel // Created: Fri Feb 1 08:27:29 2008 @@ -20,23 +20,47 @@ // with this program. If not, see <http://www.gnu.org/licenses/>. ///////////////////////////////////////////////////////////////////////////// -#ifndef __POKEMODR_IMAGEDIALOG__ -#define __POKEMODR_IMAGEDIALOG__ +#ifndef __POKEMODR_FILEDIALOG__ +#define __POKEMODR_FILEDIALOG__ #include <kfiledialog.h> -#include <kimagefilepreview.h> +#include <kfileitem.h> +#include <kurl.h> -#include <QDir> +#include <QObject> +#include <QSize> +#include <QString> -class ImageDialog +class FileDialog : public QObject { + Q_OBJECT + public: - static void init(QWidget* parent); - static void cleanUp(); - static int exec(); - static QString selectedUrl(); + FileDialog(const QString& filter, const QSize& size = QSize()); + ~FileDialog() + { + if (dlg) + delete dlg; + } + + int show() + { + int ret = dlg->exec(); + url = dlg->selectedFile(); + latestDir = dlg->baseUrl(); + return ret; + } + QString selectedUrl() + { + return url; + } + public slots: + void sizeFilter(const KFileItem& item); private: - static KFileDialog* dlg; + KFileDialog* dlg; + QSize size; + QString url; + KUrl latestDir; }; #endif diff --git a/pokemodr/PokeModTreeItem.cpp b/pokemodr/PokeModTreeItem.cpp index e44e14c6..5a237f70 100644 --- a/pokemodr/PokeModTreeItem.cpp +++ b/pokemodr/PokeModTreeItem.cpp @@ -58,6 +58,7 @@ #include <Store.h> #include <Tile.h> #include <Time.h> +#include <Trainer.h> #include <Type.h> #include "AbilityUI.h" @@ -91,6 +92,7 @@ #include "StoreUI.h" #include "TileUI.h" #include "TimeUI.h" +#include "TrainerUI.h" #include "TypeUI.h" #include "PokeModTreeItem.h" @@ -137,6 +139,7 @@ void PokeModTreeItem::update() new PokeModTreeItem(this, obj, "Stores"); new PokeModTreeItem(this, obj, "Tiles"); new PokeModTreeItem(this, obj, "Times"); + new PokeModTreeItem(this, obj, "Trainers"); new PokeModTreeItem(this, obj, "Types"); } else if (name == "Species") @@ -288,6 +291,11 @@ void PokeModTreeItem::update() for (int i = 0; i < p->getTimeCount(); ++i) new PokeModTreeItem(this, p->getTime(i)); } + else if (text(0) == "Trainers") + { + for (int i = 0; i < p->getTrainerCount(); ++i) + new PokeModTreeItem(this, p->getTrainer(i)); + } else if (text(0) == "Types") { for (int i = 0; i < p->getTypeCount(); ++i) @@ -362,6 +370,7 @@ void PokeModTreeItem::init(QWidget* pnt) else IF_IS_CLASS(Store) else IF_IS_CLASS(Tile) else IF_IS_CLASS(Time) +// else IF_IS_CLASS(Trainer) else IF_IS_CLASS(Type) connect(ui, SIGNAL(changed(bool)), this, SLOT(changed(bool))); connect(ui, SIGNAL(changed(bool)), this, SLOT(updateName())); @@ -450,6 +459,8 @@ void PokeModTreeItem::updateName() text = static_cast<Tile*>(obj)->getName(); else if (name == "Time") text = static_cast<Time*>(obj)->getName(); + else if (name == "Trainer") + text = static_cast<Trainer*>(obj)->getName(); else if (name == "Type") text = static_cast< ::Type* >(obj)->getName(); setText(0, text); @@ -496,6 +507,7 @@ Object* PokeModTreeItem::copy() else IF_IS_CLASS(Store) else IF_IS_CLASS(Tile) else IF_IS_CLASS(Time) + else IF_IS_CLASS(Trainer) else IF_IS_CLASS(Type) #undef IF_IS_CLASS } @@ -540,6 +552,7 @@ Object* PokeModTreeItem::cut() else IF_IS_CLASS(Store) else IF_IS_CLASS(Tile) else IF_IS_CLASS(Time) + else IF_IS_CLASS(Trainer) else IF_IS_CLASS(Type) #undef IF_IS_CLASS } diff --git a/pokemodr/PokeModr.cpp b/pokemodr/PokeModr.cpp index 56688cc5..80b50e66 100644 --- a/pokemodr/PokeModr.cpp +++ b/pokemodr/PokeModr.cpp @@ -31,7 +31,7 @@ #include <BugCatcher.h> #include <Exception.h> -#include "ImageDialog.h" +#include "FileDialog.h" #include "PokeModrUI.h" #include "PokeModr.h" @@ -56,7 +56,6 @@ int main(int argc, char* argv[]) try { PokeModrUI mainWindow(cfg.group("pokemodr"), cfg.group("pokemodr-recent")); - ImageDialog::init(&mainWindow); mainWindow.show(); app.exec(); } @@ -66,6 +65,5 @@ int main(int argc, char* argv[]) BugCatcher::report(Exception("PokeModr", "Uncaught exception")); ret = 1; } - ImageDialog::cleanUp(); return ret; } diff --git a/pokemodr/PokemodUI.cpp b/pokemodr/PokemodUI.cpp index 5d550e68..ac3c987b 100644 --- a/pokemodr/PokemodUI.cpp +++ b/pokemodr/PokemodUI.cpp @@ -20,9 +20,8 @@ // with this program. If not, see <http://www.gnu.org/licenses/>. ///////////////////////////////////////////////////////////////////////////// -#include <iostream> - #include <QMetaObject> +#include <QSize> #include <BugCatcher.h> #include <Exception.h> @@ -32,7 +31,7 @@ #include <Map.h> #include <MapWarp.h> -#include "ImageDialog.h" +#include "FileDialog.h" #include "PokemodUI.h" #include "TypechartWidgetItem.h" @@ -222,11 +221,12 @@ void PokemodUI::on_varSuperPCPassword_textChanged(const QString& p) void PokemodUI::on_varWalkSkin_pressed() { - if (ImageDialog::exec()) + FileDialog dlg("*.png", QSize(192, 168)); + if (dlg.show()) { try { - pokemod->setWalkSkin(ImageDialog::selectedUrl()); + pokemod->setWalkSkin(dlg.selectedUrl()); } catch (SaveException& e) { @@ -238,11 +238,12 @@ void PokemodUI::on_varWalkSkin_pressed() void PokemodUI::on_varBikeSkin_pressed() { - if (ImageDialog::exec()) + FileDialog dlg("*.png", QSize(192, 168)); + if (dlg.show()) { try { - pokemod->setBikeSkin(ImageDialog::selectedUrl()); + pokemod->setBikeSkin(dlg.selectedUrl()); } catch (SaveException& e) { @@ -254,11 +255,12 @@ void PokemodUI::on_varBikeSkin_pressed() void PokemodUI::on_varFlySkin_pressed() { - if (ImageDialog::exec()) + FileDialog dlg("*.png", QSize(192, 168)); + if (dlg.show()) { try { - pokemod->setFlySkin(ImageDialog::selectedUrl()); + pokemod->setFlySkin(dlg.selectedUrl()); } catch (SaveException& e) { @@ -270,11 +272,12 @@ void PokemodUI::on_varFlySkin_pressed() void PokemodUI::on_varSurfSkin_pressed() { - if (ImageDialog::exec()) + FileDialog dlg("*.png", QSize(192, 168)); + if (dlg.show()) { try { - pokemod->setSurfSkin(ImageDialog::selectedUrl()); + pokemod->setSurfSkin(dlg.selectedUrl()); } catch (SaveException& e) { @@ -286,11 +289,12 @@ void PokemodUI::on_varSurfSkin_pressed() void PokemodUI::on_varFishSkin_pressed() { - if (ImageDialog::exec()) + FileDialog dlg("*.png", QSize(192, 168)); + if (dlg.show()) { try { - pokemod->setFishSkin(ImageDialog::selectedUrl()); + pokemod->setFishSkin(dlg.selectedUrl()); } catch (SaveException& e) { @@ -302,11 +306,12 @@ void PokemodUI::on_varFishSkin_pressed() void PokemodUI::on_varSurfFishSkin_pressed() { - if (ImageDialog::exec()) + FileDialog dlg("*.png", QSize(192, 168)); + if (dlg.show()) { try { - pokemod->setSurfFishSkin(ImageDialog::selectedUrl()); + pokemod->setSurfFishSkin(dlg.selectedUrl()); } catch (SaveException& e) { diff --git a/pokemodr/SpeciesUI.cpp b/pokemodr/SpeciesUI.cpp index 06a14a18..2ef67362 100644 --- a/pokemodr/SpeciesUI.cpp +++ b/pokemodr/SpeciesUI.cpp @@ -21,6 +21,7 @@ ///////////////////////////////////////////////////////////////////////////// #include <QMetaObject> +#include <QSize> #include <QVariant> #include <BugCatcher.h> @@ -32,7 +33,7 @@ #include <Species.h> #include <Type.h> -#include "ImageDialog.h" +#include "FileDialog.h" #include "SpeciesUI.h" SpeciesUI::SpeciesUI(Species* s, QWidget* parent) : @@ -366,11 +367,12 @@ void SpeciesUI::on_varPokedexEntry_textChanged() void SpeciesUI::on_varFrontMaleSprite_pressed() { - if (ImageDialog::exec()) + FileDialog dlg("*.png", QSize(64, 64)); + if (dlg.show()) { try { - species_mod->setBackMaleSprite(ImageDialog::selectedUrl()); + species_mod->setBackMaleSprite(dlg.selectedUrl()); } catch (SaveException& e) { @@ -382,11 +384,12 @@ void SpeciesUI::on_varFrontMaleSprite_pressed() void SpeciesUI::on_varBackMaleSprite_pressed() { - if (ImageDialog::exec()) + FileDialog dlg("*.png", QSize(64, 64)); + if (dlg.show()) { try { - species_mod->setBackMaleSprite(ImageDialog::selectedUrl()); + species_mod->setBackMaleSprite(dlg.selectedUrl()); } catch (SaveException& e) { @@ -398,11 +401,12 @@ void SpeciesUI::on_varBackMaleSprite_pressed() void SpeciesUI::on_varFrontFemaleSprite_pressed() { - if (ImageDialog::exec()) + FileDialog dlg("*.png", QSize(64, 64)); + if (dlg.show()) { try { - species_mod->setFrontFemaleSprite(ImageDialog::selectedUrl()); + species_mod->setFrontFemaleSprite(dlg.selectedUrl()); } catch (SaveException& e) { @@ -414,11 +418,12 @@ void SpeciesUI::on_varFrontFemaleSprite_pressed() void SpeciesUI::on_varBackFemaleSprite_pressed() { - if (ImageDialog::exec()) + FileDialog dlg("*.png", QSize(64, 64)); + if (dlg.show()) { try { - species_mod->setBackFemaleSprite(ImageDialog::selectedUrl()); + species_mod->setBackFemaleSprite(dlg.selectedUrl()); } catch (SaveException& e) { @@ -430,11 +435,12 @@ void SpeciesUI::on_varBackFemaleSprite_pressed() void SpeciesUI::on_varListSprite_pressed() { - if (ImageDialog::exec()) + FileDialog dlg("*.png", QSize(128, 64)); + if (dlg.show()) { try { - species_mod->setListSprite(ImageDialog::selectedUrl()); + species_mod->setListSprite(dlg.selectedUrl()); } catch (SaveException& e) { diff --git a/pokemodr/TileUI.cpp b/pokemodr/TileUI.cpp index 6e8e2d84..15fa59cc 100644 --- a/pokemodr/TileUI.cpp +++ b/pokemodr/TileUI.cpp @@ -24,6 +24,7 @@ #include <QListIterator> #include <QListWidgetItem> #include <QMetaObject> +#include <QSize> #include <BugCatcher.h> #include <Exception.h> @@ -31,7 +32,7 @@ #include <Pokemod.h> -#include "ImageDialog.h" +#include "FileDialog.h" #include "TileUI.h" TileUI::TileUI(Tile* t, QWidget* parent) : @@ -115,11 +116,12 @@ void TileUI::on_varName_textChanged(const QString& n) void TileUI::on_varImage_pressed() { - if (ImageDialog::exec()) + FileDialog dlg("*.png", QSize(64, 64)); + if (dlg.show()) { try { - tile_mod->setPic(ImageDialog::selectedUrl()); + tile_mod->setPic(dlg.selectedUrl()); } catch (SaveException& e) { diff --git a/pokemodr/TrainerUI.cpp b/pokemodr/TrainerUI.cpp new file mode 100644 index 00000000..9d77af36 --- /dev/null +++ b/pokemodr/TrainerUI.cpp @@ -0,0 +1,123 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: pokegen/TrainerUI.cpp +// Purpose: Trainer UI form handling +// Author: Ben Boeckel +// Modified by: Ben Boeckel +// Created: Sun Mar 9 18:41:24 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 +// MERCHANTABILITY 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 <QSize> + +#include <BugCatcher.h> +#include <Exception.h> +#include <ImageCache.h> + +#include "FileDialog.h" +#include "TrainerUI.h" + +TrainerUI::TrainerUI(Trainer * t, QWidget * parent) : + ObjectUI(parent), + trainer(t), + trainer_mod(new Trainer(t->getPokemod(), *t, t->getId())) +{ + setupUi(this); + QMetaObject::connectSlotsByName(this); + setObjects(trainer, trainer_mod); + connect(this, SIGNAL(changed(bool)), boxButtons, SLOT(setEnabled(bool))); + init(); +} + +void TrainerUI::setGui() +{ + varName->setText(trainer_mod->getName()); + varMoneyFactor->setValue(trainer_mod->getMoneyFactor()); + try + { + varSkin->setIcon(ImageCache::open(trainer_mod->getSkin())); + } + catch (OpenException& e) + { + } + varAI->setText(QFile::exists(trainer_mod->getAi()) ? "Valid" : "Invalid"); +} + +void TrainerUI::on_buttonApply_clicked() +{ + *trainer = *trainer_mod; + emit(changed(false)); +} + +void TrainerUI::on_buttonDiscard_clicked() +{ + *trainer_mod = *trainer; + emit(changed(false)); +} + +void TrainerUI::on_varName_textChanged(const QString & n) +{ + trainer_mod->setName(n); + emit(changed(true)); +} + +void TrainerUI::on_varMoneyFactor_valueChaged(const int m) +{ + try + { + trainer_mod->setMoneyFactor(m); + emit(changed(true)); + } + catch (BoundsException& e) + { + BugCatcher::report(e); + setGui(); + } +} + +void TrainerUI::on_varSkin_pressed() +{ + FileDialog dlg("*.png", QSize(192, 168)); + if (dlg.show()) + { + try + { + trainer_mod->setSkin(dlg.selectedUrl()); + } + catch (SaveException& e) + { + BugCatcher::report(e); + } + setGui(); + } +} + +void TrainerUI::on_varAI_pressed() +{ + FileDialog dlg(QString::fromUtf8("*.pai|PokéMod AI Files")); + if (dlg.show()) + { + try + { + trainer_mod->setAi(dlg.selectedUrl()); + } + catch (SaveException& e) + { + BugCatcher::report(e); + } + setGui(); + } +} diff --git a/pokemodr/ImageDialog.cpp b/pokemodr/TrainerUI.h index 8deb2972..8aff783a 100644 --- a/pokemodr/ImageDialog.cpp +++ b/pokemodr/TrainerUI.h @@ -1,9 +1,9 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: pokegen/ImageDialog.cpp -// Purpose: Dialog to open dialogs +// Name: pokegen/TrainerUI.h +// Purpose: Trainer UI form handling // Author: Ben Boeckel // Modified by: Ben Boeckel -// Created: Fri Feb 1 08:34:34 2008 +// Created: Sun Mar 9 18:37:58 2008 // Copyright: ©2007-2008 Ben Boeckel and Nerdy Productions // Licence: // This program is free software: you can redistribute it and/or modify @@ -20,38 +20,39 @@ // with this program. If not, see <http://www.gnu.org/licenses/>. ///////////////////////////////////////////////////////////////////////////// -#include "ImageDialog.h" +#ifndef __POKEMODR_TRAINERUI__ +#define __POKEMODR_TRAINERUI__ -KFileDialog* ImageDialog::dlg = NULL; +#include <QString> -void ImageDialog::init(QWidget* parent) -{ - if (dlg) - return; - dlg = new KFileDialog(KUrl(QString("%1/.kde/share/apps/pokegen/images").arg(QDir::homePath())), "*.png|PNG Files", parent); - dlg->setOperationMode(KFileDialog::Opening); - dlg->setPreviewWidget(new KImageFilePreview()); -} +#include <Trainer.h> -void ImageDialog::cleanUp() -{ - if (dlg) - { - delete dlg; - dlg = NULL; - } -} +#include "ObjectUI.h" -int ImageDialog::exec() -{ - if (!dlg) - return 0; - return dlg->exec(); -} +#include "ui_trainer.h" -QString ImageDialog::selectedUrl() +class TrainerUI : public ObjectUI, private Ui::formTrainer { - if (!dlg) - return ""; - return dlg->selectedUrl().path(); -} + Q_OBJECT + + public: + TrainerUI(Trainer* t, QWidget* parent); + ~TrainerUI() + { + delete trainer_mod; + } + public slots: + void on_buttonApply_clicked(); + void on_buttonDiscard_clicked(); + void on_varName_textChanged(const QString& n); + void on_varMoneyFactor_valueChaged(const int m); + void on_varSkin_pressed(); + void on_varAI_pressed(); + private: + void setGui(); + + Trainer* trainer; + Trainer* trainer_mod; +}; + +#endif diff --git a/pokemodr/pokemodr.pro b/pokemodr/pokemodr.pro index 43278b1b..a5a48382 100644 --- a/pokemodr/pokemodr.pro +++ b/pokemodr/pokemodr.pro @@ -70,7 +70,7 @@ SOURCES += AbilityUI.cpp \ CoinListUI.cpp \ CoinListObjectUI.cpp \ EggGroupUI.cpp \ - ImageDialog.cpp \ + FileDialog.cpp \ ItemUI.cpp \ ItemTypeUI.cpp \ MapUI.cpp \ @@ -95,6 +95,7 @@ SOURCES += AbilityUI.cpp \ TilemapModel.cpp \ TileUI.cpp \ TimeUI.cpp \ + TrainerUI.cpp \ TypeUI.cpp HEADERS += AbilityUI.h \ @@ -103,7 +104,7 @@ HEADERS += AbilityUI.h \ CoinListUI.h \ CoinListObjectUI.h \ EggGroupUI.h \ - ImageDialog.h \ + FileDialog.h \ ItemUI.h \ ItemTypeUI.h \ MapUI.h \ @@ -130,6 +131,7 @@ HEADERS += AbilityUI.h \ TileUI.h \ TimeUI.h \ TypechartWidgetItem.h \ + TrainerUI.h \ TypeUI.h FORMS += gui/ability.ui \ |