[Commits] [wesnoth/wesnoth] 42f353: Fix corner case where Terrain Layers dialog could ...

GitHub noreply at github.com
Thu Sep 21 19:18:56 UTC 2017


  Branch: refs/heads/master
  Home:   https://github.com/wesnoth/wesnoth
  Commit: 42f353dec35d071f366df5c2a2e2b60b70d4cc18
      https://github.com/wesnoth/wesnoth/commit/42f353dec35d071f366df5c2a2e2b60b70d4cc18
  Author: Charles Dang <exodia339 at gmail.com>
  Date:   2017-09-21 (Thu, 21 Sep 2017)

  Changed paths:
    M src/menu_events.cpp

  Log Message:
  -----------
  Fix corner case where Terrain Layers dialog could assert (fixes #2026)

See comment for explanation.


  Commit: d1bcb6fe720019cfe55081c7fa9cff1b003a65b6
      https://github.com/wesnoth/wesnoth/commit/d1bcb6fe720019cfe55081c7fa9cff1b003a65b6
  Author: Charles Dang <exodia339 at gmail.com>
  Date:   2017-09-21 (Thu, 21 Sep 2017)

  Changed paths:
    M src/gui/widgets/stacked_widget.cpp
    M src/gui/widgets/stacked_widget.hpp

  Log Message:
  -----------
  GUI2/Stacked Widget: added ability for widgets to be found in all layers

This is controlled by a find_in_all_layers flag (false by default). The reason I added this was to
have a cleaner method for find_widget to locate widgets on layers other than the currently visible
one. Usually, they aren't found, which leads to a rather hacky workaround of showing all layers
(selecting layer -1) manually whenever this was needed. There are a few cases where this isn't doable,
though, such as in the Preferences dialog. Right now, if a setting isn't on the currently visible page
when you exit the dialog, your selections won't be saved. Since modal_dialog::finalize_fields is called
before post_show, I can't do the show-all-layers trick in post_show.

This will provide a cleaner method for dialogs to use the find-in-all-layers behavior, if desired, without
unexpectedly running into issues in the future if someone forgot to add the workaround code.

This also adds a const overload for get_layer_grid to facilitate the find() implementation. I also haven't
implemented a find_at overload since I don't think it's necessary yet. Probably should get to that at some
point, though.


  Commit: ef0d4602e719e76bc3a86dbf7891426b482f1562
      https://github.com/wesnoth/wesnoth/commit/ef0d4602e719e76bc3a86dbf7891426b482f1562
  Author: Charles Dang <exodia339 at gmail.com>
  Date:   2017-09-21 (Thu, 21 Sep 2017)

  Changed paths:
    M src/gui/dialogs/preferences_dialog.cpp

  Log Message:
  -----------
  Preferences Dialog: fixed issue where certain prefs aren't saved

If a preference wasn't in the selected tab, it wouldn't be saved. This was a serious issue.
See d1bcb6fe720 for more details.


Compare: https://github.com/wesnoth/wesnoth/compare/a672f3c8a6ee...ef0d4602e719


More information about the Commits mailing list