[wesnoth-commits] [wesnoth/wesnoth] eabd37: GUI2: convert remaining uses of dialog_callback to...

GitHub noreply at github.com
Mon Mar 12 02:09:31 UTC 2018


  Branch: refs/heads/master
  Home:   https://github.com/wesnoth/wesnoth
  Commit: eabd3743f89876eb9942c333fc320e98c78a009c
      https://github.com/wesnoth/wesnoth/commit/eabd3743f89876eb9942c333fc320e98c78a009c
  Author: Charles Dang <exodia339 at gmail.com>
  Date:   2018-03-12 (Mon, 12 Mar 2018)

  Changed paths:
    M src/gui/dialogs/multiplayer/faction_select.cpp
    M src/gui/dialogs/multiplayer/mp_create_game.cpp
    M src/gui/dialogs/multiplayer/mp_create_game.hpp
    M src/gui/dialogs/unit_create.cpp
    M src/gui/dialogs/unit_create.hpp

  Log Message:
  -----------
  GUI2: convert remaining uses of dialog_callback to std::bind

dialog_callback was designed to be passed where a void(widget&) function was expected.
It took the widget parameter, then found its dialog and window, and called the given
callback on that dialog object with the window as a parameter. I had left a few remaining
usecases for convenience, but it's not needed anymore.

* Faction Select: window parameter can be directly bound with std::ref
* Unit Create: window parameter not even needed, was only there to satisfy dialog_callback's
  signature.
* MP Create Game: window parameter needed, but I changed it to an in-function variable using
  modal_dialog::get_window. There's no window object to directly bind in the constructor, and
  using the actual callback widget's own get_window method just seems redundant.


  Commit: e8da0d67cbadb727a9596fb41255620d38786703
      https://github.com/wesnoth/wesnoth/commit/e8da0d67cbadb727a9596fb41255620d38786703
  Author: Charles Dang <exodia339 at gmail.com>
  Date:   2018-03-12 (Mon, 12 Mar 2018)

  Changed paths:
    M projectfiles/VC12/wesnoth.vcxproj
    M projectfiles/VC12/wesnoth.vcxproj.filters
    M src/gui/dialogs/addon/manager.cpp
    M src/gui/dialogs/campaign_selection.cpp
    M src/gui/dialogs/chat_log.cpp
    M src/gui/dialogs/core_selection.cpp
    M src/gui/dialogs/editor/custom_tod.cpp
    M src/gui/dialogs/editor/generate_map.cpp
    M src/gui/dialogs/editor/resize_map.cpp
    M src/gui/dialogs/file_dialog.cpp
    M src/gui/dialogs/formula_debugger.cpp
    M src/gui/dialogs/game_load.cpp
    M src/gui/dialogs/game_stats.cpp
    M src/gui/dialogs/game_version.cpp
    M src/gui/dialogs/gamestate_inspector.cpp
    R src/gui/dialogs/helper.hpp
    M src/gui/dialogs/lua_interpreter.cpp
    M src/gui/dialogs/multiplayer/faction_select.cpp
    M src/gui/dialogs/multiplayer/lobby.cpp
    M src/gui/dialogs/multiplayer/mp_change_control.cpp
    M src/gui/dialogs/multiplayer/mp_create_game.cpp
    M src/gui/dialogs/multiplayer/mp_join_game.cpp
    M src/gui/dialogs/multiplayer/mp_staging.cpp
    M src/gui/dialogs/multiplayer/player_info.cpp
    M src/gui/dialogs/preferences_dialog.cpp
    M src/gui/dialogs/statistics_dialog.cpp
    M src/gui/dialogs/unit_advance.cpp
    M src/gui/dialogs/unit_create.cpp
    M src/gui/dialogs/unit_list.cpp
    M src/gui/dialogs/unit_recall.cpp
    M src/gui/dialogs/unit_recruit.cpp

  Log Message:
  -----------
  GUI2: removed now-unused dialog_callback helper


  Commit: 007c5b7473fe2b28e9f2007ac5622155f6a8e7c7
      https://github.com/wesnoth/wesnoth/commit/007c5b7473fe2b28e9f2007ac5622155f6a8e7c7
  Author: Charles Dang <exodia339 at gmail.com>
  Date:   2018-03-12 (Mon, 12 Mar 2018)

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

  Log Message:
  -----------
  GUI2/Widget: removed dialog() getter

The doc comment indicated this should be removed once dialog_callback was refactored out,
which has now been done.

This function just a wrapper for window::dialog(), which I left. That makes sense, since
windows and dialogs are closely related. If one *really* still needs to get the dialog in
which a widget is placed, they can still use widget.get_window().dialog().


  Commit: 61e9acec7cf1d67956c9f0b83ff0fd71e08a1986
      https://github.com/wesnoth/wesnoth/commit/61e9acec7cf1d67956c9f0b83ff0fd71e08a1986
  Author: Charles Dang <exodia339 at gmail.com>
  Date:   2018-03-12 (Mon, 12 Mar 2018)

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

  Log Message:
  -----------
  Fixup 26e8c148b176 for Travis


Compare: https://github.com/wesnoth/wesnoth/compare/09d3f31b48a4...61e9acec7cf1


More information about the Commits mailing list