Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gui: "Settings->System->Load settings from File": Provide Feedback #3769

Merged
merged 1 commit into from
Mar 7, 2024

Conversation

bkerler
Copy link
Contributor

@bkerler bkerler commented Feb 18, 2024

This PR will add user feedback to the function "Settings->System->Load settings from File".
There was no feedback given and users cannot see if their "prusa_printer_settings.ini" failed or not.

load_settings

@vorner
Copy link
Contributor

vorner commented Feb 23, 2024

Good morning

Agreed it would be nice to have some feedback coming from this menu item. It's always been this very out of the way „geek“ access.

Nevertheless, the current solution seems both a bit overkill (a complete new screen) and not really looking nice. Do you think a simple message box (possibly with slightly less detailed output, maybe just success/failure) would suffice?

An inspiration can be taken here: https://github.com/prusa3d/Prusa-Firmware-Buddy/blob/master/src/gui/screen_menu_connect.cpp#L35

@bkerler
Copy link
Contributor Author

bkerler commented Feb 24, 2024

@vorner Couldn't agree more. I tried a more minimalistic approach based on your code recommendation, I hope you like it :)

Copy link
Contributor

@vorner vorner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I like it better, with just a small nitpick.

src/gui/MItem_menus.cpp Outdated Show resolved Hide resolved
src/gui/MItem_menus.cpp Outdated Show resolved Hide resolved
src/gui/MItem_menus.cpp Outdated Show resolved Hide resolved
src/gui/MItem_menus.cpp Outdated Show resolved Hide resolved
src/gui/MItem_menus.cpp Outdated Show resolved Hide resolved
src/gui/MItem_menus.cpp Outdated Show resolved Hide resolved
src/gui/MItem_menus.cpp Outdated Show resolved Hide resolved
src/gui/MItem_menus.cpp Outdated Show resolved Hide resolved
src/gui/MItem_menus.cpp Outdated Show resolved Hide resolved
src/gui/MItem_menus.cpp Outdated Show resolved Hide resolved
src/gui/MItem_menus.cpp Outdated Show resolved Hide resolved
src/gui/MItem_menus.cpp Outdated Show resolved Hide resolved
src/gui/MItem_menus.cpp Outdated Show resolved Hide resolved
src/gui/MItem_menus.cpp Outdated Show resolved Hide resolved
src/gui/MItem_menus.cpp Outdated Show resolved Hide resolved
}

char b;
str.copyToRAM(&b, 1);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uff, haven't noticed this before. copyToRam is quite heavy for this, I'd suggest making getbyte public instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's now lightweighter :)

src/gui/MItem_menus.cpp Outdated Show resolved Hide resolved
src/gui/MItem_menus.cpp Outdated Show resolved Hide resolved
return;
}

char b = str.getUtf8Char();
Copy link
Contributor

@CZDanol CZDanol Mar 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getUtf8Char does decoding and returns a full unicode. You cannot use it here. You have to use getbyte

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getbyte was private, so I added a public getbyte function

StringBuilder msg_builder(msg);
msg_builder.append_string_view(_("\nLoading settings finished.\n\n"));

bool network_settings_loaded = netdev_load_ini_to_eeprom();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick: This can be made const bool

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

CZDanol
CZDanol previously approved these changes Mar 6, 2024
@vorner
Copy link
Contributor

vorner commented Mar 7, 2024

Hmm, I've noticed the unit tests don't build now. Can you have a look? This one should be easy.

@bkerler
Copy link
Contributor Author

bkerler commented Mar 7, 2024

@vorner Tests build fine now. Everything looks perfect.

@bkerler bkerler requested a review from CZDanol March 7, 2024 08:17
@vorner vorner merged commit acf08f9 into prusa3d:master Mar 7, 2024
1 check was pending
@bkerler bkerler deleted the load_settings_feedback branch March 7, 2024 09:12
bkerler added a commit to bkerler/Prusa-Firmware-Buddy that referenced this pull request Apr 29, 2024
bkerler added a commit to bkerler/Prusa-Firmware-Buddy that referenced this pull request Apr 29, 2024
bkerler added a commit to bkerler/Prusa-Firmware-Buddy that referenced this pull request Apr 29, 2024
danopernis pushed a commit that referenced this pull request Aug 13, 2024
bkerler added a commit to bkerler/Prusa-Firmware-Buddy that referenced this pull request Aug 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants