From 526429f0090f50f148435bab0e4375b66edf03a7 Mon Sep 17 00:00:00 2001 From: bgk Date: Sun, 3 Feb 2013 12:51:40 +0000 Subject: [PATCH] GTK: Fix "#3598672 - emulated system option in gvbam changes by itself in Linux" Applied patch 3599614 thanks to Mika Attila git-svn-id: https://svn.code.sf.net/p/vbam/code/trunk@1154 a31d4220-a93d-0410-bf67-fe4944624d44 --- src/gtk/gameboyconfig.cpp | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/src/gtk/gameboyconfig.cpp b/src/gtk/gameboyconfig.cpp index c415fad7..57bc667d 100644 --- a/src/gtk/gameboyconfig.cpp +++ b/src/gtk/gameboyconfig.cpp @@ -27,6 +27,16 @@ namespace VBA { +static const VBA::Window::EEmulatorType aEmulatorType[] = +{ + VBA::Window::EmulatorAuto, + VBA::Window::EmulatorCGB, + VBA::Window::EmulatorSGB, + VBA::Window::EmulatorGB, + VBA::Window::EmulatorGBA, + VBA::Window::EmulatorSGB2 +}; + GameBoyConfigDialog::GameBoyConfigDialog(GtkDialog* _pstDialog, const Glib::RefPtr& refBuilder) : Gtk::Dialog(_pstDialog), m_poConfig(0) @@ -49,8 +59,6 @@ void GameBoyConfigDialog::vSetConfig(Config::Section * _poConfig, VBA::Window * m_poConfig = _poConfig; m_poWindow = _poWindow; - const int aEmulatorType[] = { 0, 2, 3, 5, 1, 4 }; - VBA::Window::EEmulatorType eDefaultEmulatorType = (VBA::Window::EEmulatorType)m_poConfig->oGetKey("emulator_type"); m_poSystemComboBox->set_active(aEmulatorType[eDefaultEmulatorType]); @@ -70,17 +78,7 @@ void GameBoyConfigDialog::vSetConfig(Config::Section * _poConfig, VBA::Window * void GameBoyConfigDialog::vOnSystemChanged() { - const VBA::Window::EEmulatorType aEmulatorType[] = - { - VBA::Window::EmulatorAuto, - VBA::Window::EmulatorCGB, - VBA::Window::EmulatorSGB, - VBA::Window::EmulatorGB, - VBA::Window::EmulatorGBA, - VBA::Window::EmulatorSGB2 - }; - - int iSystem = m_poSystemComboBox->get_active_row_number(); + int iSystem = m_poSystemComboBox->get_active_row_number(); m_poConfig->vSetKey("emulator_type", aEmulatorType[iSystem]); m_poWindow->vApplyConfigGBSystem();