mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-18 23:42:17 +00:00
Applications: Use GUI::CommonActions for save and save as menu options
This commit is contained in:
parent
9e80c67608
commit
e8ff7c895b
Notes:
sideshowbarker
2024-07-19 01:35:16 +09:00
Author: https://github.com/bcoles
Commit: e8ff7c895b
Pull-request: https://github.com/SerenityOS/serenity/pull/3911
4 changed files with 13 additions and 14 deletions
|
@ -74,15 +74,14 @@ int main(int argc, char** argv)
|
|||
keyboard_mapper_widget->save();
|
||||
});
|
||||
|
||||
auto save_as_action = GUI::Action::create("Save as...", { Mod_Ctrl | Mod_Shift, Key_S }, Gfx::Bitmap::load_from_file("/res/icons/16x16/save.png"),
|
||||
[&](auto&) {
|
||||
String m_name = "Unnamed";
|
||||
Optional<String> save_path = GUI::FilePicker::get_save_filepath(window, m_name, "json");
|
||||
if (!save_path.has_value())
|
||||
return;
|
||||
auto save_as_action = GUI::CommonActions::make_save_as_action([&](auto&) {
|
||||
String m_name = "Unnamed";
|
||||
Optional<String> save_path = GUI::FilePicker::get_save_filepath(window, m_name, "json");
|
||||
if (!save_path.has_value())
|
||||
return;
|
||||
|
||||
keyboard_mapper_widget->save_to_file(save_path.value());
|
||||
});
|
||||
keyboard_mapper_widget->save_to_file(save_path.value());
|
||||
});
|
||||
|
||||
auto quit_action = GUI::CommonActions::make_quit_action(
|
||||
[&](auto&) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue