From 6bcfb6ed97bef820b1b3d071b9fdd34a2bbe8f7a Mon Sep 17 00:00:00 2001 From: Torbjörn Andersson Date: Mon, 16 May 2005 06:33:33 +0000 Subject: Fixed the SoundFont button's behaviour in the Edit Game dialog. svn-id: r18125 --- gui/launcher.cpp | 14 ++++++++++++++ gui/options.cpp | 4 +++- gui/options.h | 3 ++- 3 files changed, 19 insertions(+), 2 deletions(-) (limited to 'gui') diff --git a/gui/launcher.cpp b/gui/launcher.cpp index e7460b1842..ba03f00b1e 100644 --- a/gui/launcher.cpp +++ b/gui/launcher.cpp @@ -65,6 +65,8 @@ enum { kCmdGlobalMIDIOverride = 'OMID', kCmdGlobalVolumeOverride = 'OVOL', + kCmdChooseSoundFontCmd = 'chsf', + kCmdExtraBrowser = 'PEXT', kCmdGameBrowser = 'PGME', kCmdSaveBrowser = 'PSAV' @@ -375,6 +377,18 @@ void EditGameDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 dat draw(); break; + case kCmdChooseSoundFontCmd: { + BrowserDialog browser("Select SoundFont", false); + + if (browser.runModal() > 0) { + // User made this choice... + FilesystemNode file(browser.getResult()); + _soundFont->setLabel(file.path()); + draw(); + } + break; + } + // Change path for the game case kCmdGameBrowser: { BrowserDialog browser("Select additional game directory", true); diff --git a/gui/options.cpp b/gui/options.cpp index b9516b32ff..5116d67178 100644 --- a/gui/options.cpp +++ b/gui/options.cpp @@ -291,6 +291,8 @@ void OptionsDialog::setAudioSettingsState(bool enabled) { void OptionsDialog::setMIDISettingsState(bool enabled) { _enableMIDISettings = enabled; + _soundFontButton->setEnabled(enabled); + _soundFont->setEnabled(enabled); _multiMidiCheckbox->setEnabled(enabled); _mt32Checkbox->setEnabled(enabled); _enableGSCheckbox->setEnabled(enabled); @@ -383,7 +385,7 @@ int OptionsDialog::addMIDIControls(GuiObject *boss, int yoffset) { const int w = _w - 20; // SoundFont - new ButtonWidget(boss, x, yoffset, kButtonWidth + 14, 16, "SoundFont: ", kChooseSoundFontCmd, 0); + _soundFontButton = new ButtonWidget(boss, x, yoffset, kButtonWidth + 14, 16, "SoundFont: ", kChooseSoundFontCmd, 0); _soundFont = new StaticTextWidget(boss, x + kButtonWidth + 20, yoffset + 3, _w - (x + kButtonWidth + 20) - 10, kLineHeight, "None", kTextAlignLeft); yoffset += 18; diff --git a/gui/options.h b/gui/options.h index cfa40fae0e..9a68f16ca0 100644 --- a/gui/options.h +++ b/gui/options.h @@ -52,7 +52,8 @@ public: protected: /** Config domain this dialog is used to edit. */ String _domain; - + + ButtonWidget *_soundFontButton; StaticTextWidget *_soundFont; int addGraphicControls(GuiObject *boss, int yoffset); -- cgit v1.2.3