bsnes/hiro/extension
Tim Allen f09c45f3e4 Fix region auto-detection when using native file dialogs.
hiro has two confusingly-named file-picker dialogs. "BrowserDialog" is the
custom dialog built entirely with hiro widgets, "BrowserWindow" is a wrapper
around the native file-picker. bsnes is built for BrowserDialog, but if you tick
"Use native file picker" in the Emulator options, when it needs a file it will
construct a BrowserDialog, copy the relevant config options across to a new
BrowserWindow and invoke that.

Unfortunately, BrowserDialog and BrowserWindow have different capabilities.
Specifically, BrowserDialog includes an "options" list which bsnes uses to let
the user override region detection when loading a game. BrowserWindow has no
such widget. Thus, when using a BrowserDialog the options list worked as intended,
but when using a BrowserWindow the options list was never initialised and no
option was ever chosen. As a result, when opening a game with the native file-
picker, bsnes always used NTSC emulation mode, instead of auto-detecting.

Previously, constructing a BrowserDialog and calling setOptions would leave the
BrowserDialog in an inconsistent state (with no option selected). This was OK if
you immediately displayed the dialog to the user (this would complete the
initialisation and choose a default), but bsnes also used BrowserDialog as an
*interface* typee, to represent the parameters and results of a file-picker
operation that was implemented elsewhere. For this use-case, the inconsistent
state caused problems.

Therefore, BrowserDialog has been changed:

  - setting the list of options always chooses a default, maintaining the
    invariant that `.options()` always returns one of the available options.
  - The internal BrowserDialogWindow class now takes a reference to a Response
    object, instead of constructing one from scratch and having to duplicate
    the "set .option to a reasonable value" code.

Fixes #44.
2020-10-27 23:20:56 +11:00
..
about-dialog.cpp v114.5 2020-02-23 20:23:25 +09:00
about-dialog.hpp v114.5 2020-02-23 20:23:25 +09:00
browser-dialog.cpp Fix region auto-detection when using native file dialogs. 2020-10-27 23:20:56 +11:00
browser-dialog.hpp v114.5 2020-02-23 20:23:25 +09:00
extension.cpp v107.8 2019-07-17 21:11:46 +09:00
extension.hpp v107.8 2019-07-17 21:11:46 +09:00
fixed-layout.cpp v107.8 2019-07-17 21:11:46 +09:00
fixed-layout.hpp v107.8 2019-07-17 21:11:46 +09:00
horizontal-layout.cpp v107.8 2019-07-17 21:11:46 +09:00
horizontal-layout.hpp v107.8 2019-07-17 21:11:46 +09:00
horizontal-resize-grip.cpp Update to bsnes v107r4 beta release. 2019-07-07 19:44:09 +10:00
horizontal-resize-grip.hpp Update to bsnes v107.1 release. 2019-04-09 11:16:30 +10:00
list-view.cpp v108.1 2019-07-31 06:57:31 +09:00
list-view.hpp Update to bsnes v107r4 beta release. 2019-07-07 19:44:09 +10:00
message-dialog.cpp v107.8 2019-07-17 21:11:46 +09:00
message-dialog.hpp v107.8 2019-07-17 21:11:46 +09:00
name-dialog.cpp Update to bsnes v107.1 release. 2019-04-09 11:16:30 +10:00
name-dialog.hpp Update to bsnes v107.1 release. 2019-04-09 11:16:30 +10:00
shared.hpp v107.8 2019-07-17 21:11:46 +09:00
table-layout.cpp Update to bsnes v107.1 release. 2019-04-09 11:16:30 +10:00
table-layout.hpp Update to bsnes v107.1 release. 2019-04-09 11:16:30 +10:00
vertical-layout.cpp v107.8 2019-07-17 21:11:46 +09:00
vertical-layout.hpp v107.8 2019-07-17 21:11:46 +09:00
vertical-resize-grip.cpp Update to bsnes v107r4 beta release. 2019-07-07 19:44:09 +10:00
vertical-resize-grip.hpp Update to bsnes v107.1 release. 2019-04-09 11:16:30 +10:00