From 0efb5b3a11b106572d3227fe518a92c9d7d168b5 Mon Sep 17 00:00:00 2001 From: Jonathan Archer Date: Wed, 22 Apr 2020 14:10:38 -0500 Subject: Desktop: Context menu option to open FileManager --- Applications/FileManager/main.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'Applications/FileManager') diff --git a/Applications/FileManager/main.cpp b/Applications/FileManager/main.cpp index 9735a20d4a..e6e33d804b 100644 --- a/Applications/FileManager/main.cpp +++ b/Applications/FileManager/main.cpp @@ -200,6 +200,10 @@ int run_in_desktop_mode(RefPtr 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 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 config, String initial_locatio }; return GUI::Application::the().exec(); -} \ No newline at end of file +} -- cgit v1.2.3