[Commits] [wesnoth/wesnoth] 16e642: gui2/tchat_log: Refactor log formatting and page e...
GitHub
noreply at github.com
Sun Jun 15 03:47:20 UTC 2014
Branch: refs/heads/1.12
Home: https://github.com/wesnoth/wesnoth
Commit: 16e642b654225e7c2cfd743d116d9aca2e1f97d2
https://github.com/wesnoth/wesnoth/commit/16e642b654225e7c2cfd743d116d9aca2e1f97d2
Author: Ignacio R. Morelle <shadowm at wesnoth.org>
Date: 2014-06-14 (Sat, 14 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: 799e09d94a4774854ddd29fbb9bd1362105da9cd
https://github.com/wesnoth/wesnoth/commit/799e09d94a4774854ddd29fbb9bd1362105da9cd
Author: Ignacio R. Morelle <shadowm at wesnoth.org>
Date: 2014-06-14 (Sat, 14 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).
(The tooltip should also remain commented-out because this is a backport
to 1.12.)
Compare: https://github.com/wesnoth/wesnoth/compare/474f30c75965...799e09d94a47
More information about the Commits
mailing list