Giter VIP home page Giter VIP logo

Comments (12)

Wedge009 avatar Wedge009 commented on May 10, 2024 1

for(const auto & path_ent : path_map_)
{
const std::string& path_id = path_ent.first;
const std::string& path_path = filesystem::normalize_path(path_ent.second, true);
text_box_base& path_w = find_widget<text_box_base>(&window, path_wid_stem_ + path_id, false);
button& copy_w = find_widget<button>(&window, copy_wid_stem_ + path_id, false);
button& browse_w = find_widget<button>(&window, browse_wid_stem_ + path_id, false);
path_w.set_value(path_path);
path_w.set_active(false);
connect_signal_mouse_left_click(
copy_w,
std::bind(&game_version::copy_to_clipboard_callback, this, path_path));
connect_signal_mouse_left_click(
browse_w,
std::bind(&game_version::browse_directory_callback, this, path_path));
if(!desktop::open_object_is_supported()) {
// No point in displaying these on platforms that can't do
// open_object().
browse_w.set_visible(widget::visibility::invisible);
}
if(!desktop::clipboard::available()) {
copy_w.set_active(false);
copy_w.set_tooltip(_("Clipboard support not found, contact your packager"));
}
}

The paths are collated into a map and added to the dialogue one at a time, with accompanying open and copy buttons. I suppose one could check that the paths are valid and disable the open button in the cases where it is not.

from wesnoth.

Wedge009 avatar Wedge009 commented on May 10, 2024

It looks like this is not an issue in Windows because a default logs directory gets created if one doesn't already exist.

Edit: I'm not able to replicate this. If I remove the logs directory, it triggers the migration dialogue and part of that process seems to recreate the logs directory.

from wesnoth.

sevu avatar sevu commented on May 10, 2024

It is about using the command line option --no-log-to-file

from wesnoth.

Wedge009 avatar Wedge009 commented on May 10, 2024

Yes, I know. Even using --no-log-to-file, the logs directory still gets recreated for me. BTW, you didn't specify which version - I was testing official 1.18.0 release and self-compiled 1.18 branch, though I presume master/1.19.0+dev would behave the same way.

from wesnoth.

Wedge009 avatar Wedge009 commented on May 10, 2024

Can anyone replicate the underlying bug for this request and specify the details, please?

from wesnoth.

sevu avatar sevu commented on May 10, 2024

I mean that it should not offer the button at all. The button is for opening the log file, and as it is specified on command line to not use a log file, there cannot be a correct path. It does not matter whether the logs directory exists. If it exists, then there is no file to open (and should not be).

I use a self-compiled 1.18.0, though with current 1.18 branch.

from wesnoth.

Wedge009 avatar Wedge009 commented on May 10, 2024

Again, I understand that - on my system when I specify the console to be used for logging via --no-log-to-file the logs directory is always created. Therefore, I cannot replicate the scenario you had in the original report.

As for the idea that the option to open the normal logs directory should not be available if logging to file is disabled, I don't necessarily agree with that. Even though I normally disable logging to file on Linux, I still have some logs available there and I don't think it's harmful or even makes sense to disable the option to open an existing logs directory, even if it's empty.

from wesnoth.

soliton- avatar soliton- commented on May 10, 2024

I think there is a misunderstanding about what is meant. I think sevu means the log file button on the lower left of the dialog. Not the button to open the log dir.

from wesnoth.

Wedge009 avatar Wedge009 commented on May 10, 2024

image

I ran Wesnoth with --no-log-to-file. The bottom-left icon just copies a report into a buffer and I can paste this text as normal. I do not think disabling logging should affect this in any way.

Since the logs directory gets recreated, I cannot replicate the error in the original report, no matter what button I try.

from wesnoth.

soliton- avatar soliton- commented on May 10, 2024

In your screenshot the button in question is the one saying "Fichier de journalisation". The one that explains it opens the current log file in the tool tip.

When I press that button in the flatpak build I get the error Failed to open '/home/wesnoth/.log': No such file or directory.

from wesnoth.

Wedge009 avatar Wedge009 commented on May 10, 2024

Okay, I feel pretty silly now, seeing it stare at me in the face. I've never used that button before, I've always just gone straight to the logs directory myself.

Strangely, in both Windows and Linux (specifically, KDE/X11), when using --no-log-to-file, I still can't replicate either of your errors. Instead, no action occurs when the log file button is clicked - error messages go to the log console rather than shown in a separate dialogue. Nonetheless, I agree that the button should be disabled with the no-log-file option - while no action is better than the error messages you're reporting, it's still a problem.

from wesnoth.

Wedge009 avatar Wedge009 commented on May 10, 2024

So the relevant code is here:

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());

Looks like it should be checking for the existence of the file at log_path_, not just that the string is non-empty.

from wesnoth.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.