mirror of https://github.com/bsnes-emu/bsnes.git
f09c45f3e4
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. |
||
---|---|---|
.. | ||
about-dialog.cpp | ||
about-dialog.hpp | ||
browser-dialog.cpp | ||
browser-dialog.hpp | ||
extension.cpp | ||
extension.hpp | ||
fixed-layout.cpp | ||
fixed-layout.hpp | ||
horizontal-layout.cpp | ||
horizontal-layout.hpp | ||
horizontal-resize-grip.cpp | ||
horizontal-resize-grip.hpp | ||
list-view.cpp | ||
list-view.hpp | ||
message-dialog.cpp | ||
message-dialog.hpp | ||
name-dialog.cpp | ||
name-dialog.hpp | ||
shared.hpp | ||
table-layout.cpp | ||
table-layout.hpp | ||
vertical-layout.cpp | ||
vertical-layout.hpp | ||
vertical-resize-grip.cpp | ||
vertical-resize-grip.hpp |