[Commits] [wesnoth/wesnoth] 913333: gui2/tchat_log: Refactor log formatting and page e...

GitHub noreply at github.com
Thu Jun 12 00:33:11 UTC 2014


  Branch: refs/heads/master
  Home:   https://github.com/wesnoth/wesnoth
  Commit: 913333e3ef895b4c9febdd04008c4ca458d2a44f
      https://github.com/wesnoth/wesnoth/commit/913333e3ef895b4c9febdd04008c4ca458d2a44f
  Author: Ignacio R. Morelle <shadowm at wesnoth.org>
  Date:   2014-06-11 (Wed, 11 Jun 2014)

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

  Log Message:
  -----------
  gui2/tchat_log: Refactor log formatting and page extents calculation

This functionality will be shared with a new Copy to Clipboard button
and its callback in the next commit, so it has to be refactored so that
we don't wind up with duplicate code. This is also why
gui2::tchat_log::model::stream_log() now has a 'raw' parameter which
defaults to 'false'.

I couldn't resist the temptation so I added some const specifications to
a few write-once variables, in particular those that ended up in
gui2::tchat_log::controller::calculate_log_line_range().

While I didn't change any existing behavior (to my knowledge, anyway), I
changed the algorithm for the 'count_of_pages' value as follows:

  // Before:
  count_of_pages = model_.count_of_pages() != 0
             ? model_.count_of_pages()
             : 1;
  // After:
  count_of_pages = model_.count_of_pages() >= 1
            ? model_.count_of_pages()
            : 1;

I don't believe model_.count_of_pages() can yield a value less than
zero, so this shouldn't alter the previous behavior in practice.


  Commit: 9b065fd9a0dd066418c4b0b1c1aa304f7889a015
      https://github.com/wesnoth/wesnoth/commit/9b065fd9a0dd066418c4b0b1c1aa304f7889a015
  Author: Ignacio R. Morelle <shadowm at wesnoth.org>
  Date:   2014-06-11 (Wed, 11 Jun 2014)

  Changed paths:
    M changelog
    M data/gui/default/window/chat_log.cfg
    M players_changelog
    M src/gui/dialogs/chat_log.cpp

  Log Message:
  -----------
  gui2/tchat_log: Add a button to copy the filtered page contents to clipboard

This copies the current contents of the dialog to clipboard. The button
currently lacks a tooltip because the tooltip has the potential to cause
map labels to glitch through the dialog when displayed (see commit
eab3e6fb646fda8cc6101a3e568c86c2b17b707f and bug #22176).


Compare: https://github.com/wesnoth/wesnoth/compare/acd814f64c3c...9b065fd9a0dd


More information about the Commits mailing list