gui/game_version: Fix Open Log File button being missing

In commit fc7c87b765 someone missed the
logic surrounding the Open Log File button's setup that should've been
made not Windows-specific anymore.

This commit enables the Open Log File button back whenever Wesnoth has
a log file open for the current session. It also removes a few more
leftovers of the old Windows-specific UI layout path.
This commit is contained in:
Iris Morelle 2023-05-24 04:18:52 -04:00
parent f7140b2e44
commit acd9429a23
No known key found for this signature in database
GPG key ID: BB9666228F278524
2 changed files with 7 additions and 26 deletions

View file

@ -151,27 +151,14 @@
[column]
horizontal_alignment = right
vertical_alignment = top
border = all
border_size = 5
[grid]
id = "win32_paths"
[row]
[column]
border = all
border_size = 5
[button]
id = "open_stderr"
label = _ "Open Log File"
tooltip = _ "Opens the log file, which may contain useful debug information"
[/button]
[/column]
[/row]
[/grid]
[button]
id = "open_stderr"
label = _ "Open Log File"
tooltip = _ "Opens the log file, which may contain useful debug information"
[/button]
[/column]
[/row]

View file

@ -142,15 +142,9 @@ void game_version::pre_show(window& window)
}
}
#ifndef _WIN32
for(const auto& wid : {"win32_paths"}) {
find_widget<widget>(&window, wid, false).set_visible(widget::visibility::invisible);
}
#else
button& stderr_button = find_widget<button>(&window, "open_stderr", false);
connect_signal_mouse_left_click(stderr_button, std::bind(&game_version::browse_directory_callback, this, log_path_));
stderr_button.set_active(!log_path_.empty());
#endif
//
// Build info tab.