diff options
| author | Ben Boeckel <MathStuf@gmail.com> | 2008-05-13 07:07:57 +0000 |
|---|---|---|
| committer | Ben Boeckel <MathStuf@gmail.com> | 2008-05-13 07:07:57 +0000 |
| commit | 56f272b11d13bbc5d829283ccf2813d3a7e41dbc (patch) | |
| tree | dbd826fc0df0e9b087f5c0d1889e3f9eaca5181f /pokemodr/TrainerUI.cpp | |
| parent | 654b25d1b4e73e840e5fe2ab63d844c2157f3379 (diff) | |
| download | sigen-56f272b11d13bbc5d829283ccf2813d3a7e41dbc.tar.gz sigen-56f272b11d13bbc5d829283ccf2813d3a7e41dbc.tar.xz sigen-56f272b11d13bbc5d829283ccf2813d3a7e41dbc.zip | |
[ADD] Sound UI code
[FIX] Using class-named includes for KDE as well now
[FIX] Signals fixed for UI classes
[FIX] FileDialog now created on heap rather than the stack
git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@128 6ecfd1a5-f3ed-3746-8530-beee90d26b22
Diffstat (limited to 'pokemodr/TrainerUI.cpp')
| -rw-r--r-- | pokemodr/TrainerUI.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/pokemodr/TrainerUI.cpp b/pokemodr/TrainerUI.cpp index fdd86a48..506cfa7a 100644 --- a/pokemodr/TrainerUI.cpp +++ b/pokemodr/TrainerUI.cpp @@ -32,8 +32,8 @@ TrainerUI::TrainerUI(Trainer * trainer, QWidget * parent) : setObjects(trainer, new Trainer(*trainer)); connect(this, SIGNAL(changed(bool)), boxButtons, SLOT(setEnabled(bool))); connect(modified(), SIGNAL(error(const QString&)), this, SLOT(setGui())); - connect(modified(), SIGNAL(error(QString&)), this, SLOT(errorMessage(QString&))); - connect(modified(), SIGNAL(warning(QString&)), this, SLOT(warningMessage(QString&))); + connect(modified(), SIGNAL(error(const QString&)), this, SLOT(errorMessage(const QString&))); + connect(modified(), SIGNAL(warning(const QString&)), this, SLOT(warningMessage(const QString&))); connect(modified(), SIGNAL(changed()), this, SLOT(setChanged())); init(); } @@ -74,17 +74,18 @@ void TrainerUI::on_varMoneyFactor_valueChaged(const int moneyFactor) void TrainerUI::on_varSkin_pressed() { - FileDialog dialog(QSize(192, 168)); - if (dialog.exec()) + FileDialog* dialog = new FileDialog(QSize(192, 168)); + if (dialog->exec() == QDialog::Accepted) { - static_cast<Trainer*>(modified())->setSkin(QPixmap(dialog.selectedFile())); + static_cast<Trainer*>(modified())->setSkin(QPixmap(dialog->selectedFile())); setGui(); } + delete dialog; } // void TrainerUI::on_varAI_pressed() // { -// FileDialog dialog(QString::fromUtf8("*.pai|PokéMod AI Files")); +// FileDialog* dialog = new FileDialog(QString::fromUtf8("*.pai|PokéMod AI Files")); // if (dlg.show()) // { // try |
