[Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1733280-replay_filenames into lp:widelands

2018-05-14 Thread GunChleoc
GunChleoc has proposed merging 
lp:~widelands-dev/widelands/bug-1733280-replay_filenames into lp:widelands.

Commit message:
Added a checkbox to toggle filenames when loading a replay. This is on per 
default, as one would never want to toggle them off except on low resolution.

Requested reviews:
  Widelands Developers (widelands-dev)
Related bugs:
  Bug #1733280 in widelands: "Add filenames to list of replays"
  https://bugs.launchpad.net/widelands/+bug/1733280

For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/bug-1733280-replay_filenames/+merge/345566
-- 
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/bug-1733280-replay_filenames into lp:widelands.
=== modified file 'src/ui_basic/table.cc'
--- src/ui_basic/table.cc	2018-05-14 08:24:46 +
+++ src/ui_basic/table.cc	2018-05-15 05:28:21 +
@@ -134,6 +134,13 @@
 	column.btn->set_title(title);
 }
 
+void Table::set_column_tooltip(uint8_t col, const std::string& tooltip) {
+	assert(col < columns_.size());
+	Column& column = columns_.at(col);
+	assert(column.btn);
+	column.btn->set_tooltip(tooltip);
+}
+
 /**
  * Set a custom comparison function for sorting of the given column.
  */
@@ -437,7 +444,14 @@
 	selected(selection_);
 }
 
-void Table::multiselect(uint32_t row) {
+/**
+ * If 'force' is true, adds the given 'row' to the selection, ignoring everything else.
+ */
+void Table::multiselect(uint32_t row, bool force) {
+	if (force) {
+		select(row);
+		return;
+	}
 	if (is_multiselect_) {
 		// Ranged selection with Shift
 		if (SDL_GetModState() & KMOD_SHIFT) {

=== modified file 'src/ui_basic/table.h'
--- src/ui_basic/table.h	2018-05-07 05:35:32 +
+++ src/ui_basic/table.h	2018-05-15 05:28:21 +
@@ -76,6 +76,7 @@
 
 	/// Text conventions: Title Case for the 'title'
 	void set_column_title(uint8_t col, const std::string& title);
+	void set_column_tooltip(uint8_t col, const std::string& tooltip);
 
 	void clear();
 	void set_sort_column(uint8_t col);
@@ -101,7 +102,7 @@
 	EntryRecord* find(Entry) const;
 
 	void select(uint32_t);
-	void multiselect(uint32_t row);
+	void multiselect(uint32_t row, bool force = false);
 	uint32_t toggle_entry(uint32_t row);
 	void move_selection(int32_t offset);
 	struct NoSelection : public std::exception {
@@ -189,6 +190,7 @@
 	TableColumnType column_type = TableColumnType::kFixed);
 
 	void set_column_title(uint8_t col, const std::string& title);
+	void set_column_tooltip(uint8_t col, const std::string& tooltip);
 	void set_column_compare(uint8_t col, const CompareFn& fn);
 
 	void clear();
@@ -247,7 +249,7 @@
 	EntryRecord* find(const void* entry) const;
 
 	void select(uint32_t);
-	void multiselect(uint32_t row);
+	void multiselect(uint32_t row, bool force = false);
 	uint32_t toggle_entry(uint32_t row);
 	void move_selection(int32_t offset);
 	struct NoSelection : public std::exception {

=== modified file 'src/ui_fsmenu/loadgame.cc'
--- src/ui_fsmenu/loadgame.cc	2018-05-13 07:15:39 +
+++ src/ui_fsmenu/loadgame.cc	2018-05-15 05:28:21 +
@@ -48,7 +48,7 @@
UI::PanelStyle::kFsMenu,
true),
 
- is_replay_(is_replay) {
+ is_replay_(is_replay), showing_filenames_(false) {
 
 	// Make sure that we have some space to work with.
 	main_box_.set_size(get_w(), get_w());
@@ -57,6 +57,10 @@
 	main_box_.add_inf_space();
 	main_box_.add(_, UI::Box::Resizing::kAlign, UI::Align::kCenter);
 	main_box_.add_inf_space();
+	if (is_replay_) {
+		show_filenames_ = new UI::Checkbox(_box_, Vector2i::zero(), _("Show Filenames"));
+		main_box_.add(show_filenames_, UI::Box::Resizing::kFullSize);
+	}
 	main_box_.add_inf_space();
 	main_box_.add(_box_, UI::Box::Resizing::kExpandBoth);
 	main_box_.add_space(padding_);
@@ -89,6 +93,12 @@
 	load_or_save_.table().double_clicked.connect(
 	   boost::bind(::clicked_ok, boost::ref(*this)));
 
+	if (is_replay_) {
+		show_filenames_->changed.connect(
+		   boost::bind(::toggle_filenames, boost::ref(*this)));
+		show_filenames_->set_state(true);
+	}
+
 	fill_table();
 	if (!load_or_save_.table().empty()) {
 		load_or_save_.table().select(0);
@@ -107,6 +117,23 @@
 	   main_box_.get_w() - tablew_ - right_column_margin_, tableh_);
 }
 
+void FullscreenMenuLoadGame::toggle_filenames() {
+	showing_filenames_ = show_filenames_->get_state();
+
+	// Remember selection
+	const std::set selected = load_or_save_.table().selections();
+	// Fill table again
+	fill_table();
+
+	// Restore selection items
+	// TODO(GunChleoc): It would be nice to have a function to just change the entry texts
+	for (const uint32_t selectme : selected) {
+		load_or_save_.table().multiselect(selectme, true);
+	}
+	entry_selected();
+}
+
+
 void FullscreenMenuLoadGame::clicked_ok() {
 	if (load_or_save_.table().selections().size() != 1) {
 		return;
@@ -128,7 +155,7 @@
 }
 
 void FullscreenMenuLoadGame::fill_table() {
-	load_or_save_.fill_table();
+	

Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1636586-editor-player-menu-i18n into lp:widelands

2018-05-14 Thread GunChleoc
You're right, the plain version is already taken care of during loading, so no 
need to check it when saving.

Thanks for the review!

@bunnybot merge
-- 
https://code.launchpad.net/~widelands-dev/widelands/bug-1636586-editor-player-menu-i18n/+merge/345464
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/bug-1636586-editor-player-menu-i18n.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1636586-editor-player-menu-i18n into lp:widelands

2018-05-14 Thread Notabilis
Review: Approve diff

Not tested but code is looking good.
One question: Why checking for both the localized and "plain" name variant when 
saving? In English they should resolve to the same name anyway (right?) and I 
don't see where the plain version can appear otherwise.
-- 
https://code.launchpad.net/~widelands-dev/widelands/bug-1636586-editor-player-menu-i18n/+merge/345464
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/bug-1636586-editor-player-menu-i18n.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1627374-chat-input into lp:widelands

2018-05-14 Thread Notabilis
I am not quite convinced of this branch, since it only solves the problem 
partially.

In trunk:
- Hotkey like Ctrl+1 and "s" do not work
- Arrow keys do not work
- Enter key closes the minimized window
In this branch:
- Hotkeys work
- Arrow keys still do not work
- Enter key does nothing on first press, closes window on second press

The working hotkeys are nice, additionally working arrow keys would be even 
better. And the behavior of the enter key is quite strange, no idea where that 
is coming from. A suggestion independent of the current behavior: Maximize chat 
window on enter key when currently minimized instead of closing it?

For what it's worth: Code is looking good.
-- 
https://code.launchpad.net/~widelands-dev/widelands/bug-1627374-chat-input/+merge/345457
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/bug-1627374-chat-input into lp:widelands.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


[Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1741779-map-description-edit-cutoff into lp:widelands

2018-05-14 Thread bunnybot
Continuous integration builds have changed state:

Travis build 3514. State: passed. Details: 
https://travis-ci.org/widelands/widelands/builds/378610485.
Appveyor build 3319. State: success. Details: 
https://ci.appveyor.com/project/widelands-dev/widelands/build/_widelands_dev_widelands_bug_1741779_map_description_edit_cutoff-3319.
-- 
https://code.launchpad.net/~widelands-dev/widelands/bug-1741779-map-description-edit-cutoff/+merge/345495
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/bug-1741779-map-description-edit-cutoff into 
lp:widelands.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


[Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-message-removal into lp:widelands

2018-05-14 Thread noreply
The proposal to merge lp:~widelands-dev/widelands/bug-message-removal into 
lp:widelands has been updated.

Status: Needs review => Merged

For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/bug-message-removal/+merge/345475
-- 
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/bug-message-removal.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


[Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1741779-map-description-edit-cutoff into lp:widelands

2018-05-14 Thread GunChleoc
GunChleoc has proposed merging 
lp:~widelands-dev/widelands/bug-1741779-map-description-edit-cutoff into 
lp:widelands.

Commit message:
Removed texture size restrictions from editboxes. We no longer need them thanks 
to the RenderedText class.

Requested reviews:
  Widelands Developers (widelands-dev)
Related bugs:
  Bug #1741779 in widelands: "Editor: Description is cut in map options 
multilineeditbox"
  https://bugs.launchpad.net/widelands/+bug/1741779

For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/bug-1741779-map-description-edit-cutoff/+merge/345495
-- 
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/bug-1741779-map-description-edit-cutoff into 
lp:widelands.
=== modified file 'src/ui_basic/editbox.cc'
--- src/ui_basic/editbox.cc	2018-04-27 06:11:05 +
+++ src/ui_basic/editbox.cc	2018-05-14 08:00:19 +
@@ -97,8 +97,7 @@
 	m_->caret = 0;
 	m_->scrolloffset = 0;
 	// yes, use *signed* max as maximum length; just a small safe-guard.
-	m_->maxLength =
-	   std::min(g_gr->max_texture_size() / UI_FONT_SIZE_SMALL, std::numeric_limits::max());
+	m_->maxLength = std::numeric_limits::max();
 
 	set_handle_mouse(true);
 	set_can_focus(true);

=== modified file 'src/ui_basic/multilineeditbox.cc'
--- src/ui_basic/multilineeditbox.cc	2018-05-13 07:15:39 +
+++ src/ui_basic/multilineeditbox.cc	2018-05-14 08:00:19 +
@@ -97,7 +97,7 @@
  background_style(style),
  cursor_pos(0),
  lineheight(text_height()),
- maxbytes(std::min(g_gr->max_texture_size() / UI_FONT_SIZE_SMALL, 0x)),
+ maxbytes(std::numeric_limits::max()),
  ww_valid(false),
  owner(o) {
 	scrollbar.moved.connect(boost::bind(::scrollpos_changed, , _1));
@@ -133,8 +133,7 @@
 		d_->erase_bytes(d_->prev_char(d_->text.size()), d_->text.size());
 	}
 
-	d_->set_cursor_pos(d_->text.size());
-
+	d_->set_cursor_pos(0);
 	d_->update();
 	d_->scroll_cursor_into_view();
 

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-message-removal into lp:widelands

2018-05-14 Thread GunChleoc
Review: Approve


-- 
https://code.launchpad.net/~widelands-dev/widelands/bug-message-removal/+merge/345475
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/bug-message-removal.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-message-removal into lp:widelands

2018-05-14 Thread GunChleoc
Thanks, this was so annoying!

@bunnybot merge
-- 
https://code.launchpad.net/~widelands-dev/widelands/bug-message-removal/+merge/345475
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/bug-message-removal into lp:widelands.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp