1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 08:48:11 +00:00

Desktop: Context menu option to open FileManager

This commit is contained in:
Jonathan Archer 2020-04-22 14:10:38 -05:00 committed by Andreas Kling
parent 3bbd7d9425
commit 0efb5b3a11

View file

@ -200,6 +200,10 @@ int run_in_desktop_mode(RefPtr<Core::ConfigFile> config, String initial_location
}
});
auto file_manager_action = GUI::Action::create("Show in FileManager...", {}, Gfx::Bitmap::load_from_file("/res/icons/16x16/filetype-folder.png"), [&](const GUI::Action&) {
Core::DesktopServices::open(URL::create_with_file_protocol(model->root_path()));
});
auto display_properties_action = GUI::Action::create("Display properties...", {}, Gfx::Bitmap::load_from_file("/res/icons/16x16/app-display-properties.png"), [&](const GUI::Action&) {
Core::DesktopServices::open(URL::create_with_file_protocol("/bin/DisplayProperties"));
});
@ -207,6 +211,8 @@ int run_in_desktop_mode(RefPtr<Core::ConfigFile> config, String initial_location
desktop_view_context_menu->add_action(mkdir_action);
desktop_view_context_menu->add_action(touch_action);
desktop_view_context_menu->add_separator();
desktop_view_context_menu->add_action(file_manager_action);
desktop_view_context_menu->add_separator();
desktop_view_context_menu->add_action(display_properties_action);
item_view.on_context_menu_request = [&](const GUI::ModelIndex& index, const GUI::ContextMenuEvent& event) {
@ -808,4 +814,4 @@ int run_in_windowed_mode(RefPtr<Core::ConfigFile> config, String initial_locatio
};
return GUI::Application::the().exec();
}
}