diff options
author | Jonathan Archer <jon@jonnyarcher.com> | 2020-04-22 14:10:38 -0500 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-04-23 11:22:32 +0200 |
commit | 0efb5b3a11b106572d3227fe518a92c9d7d168b5 (patch) | |
tree | 38eae6fdf148f3c7a0f92ac72fe3f5d9f902b7a3 /Applications/FileManager | |
parent | 3bbd7d94258044aad93f0f5976b9676c287dc320 (diff) | |
download | serenity-0efb5b3a11b106572d3227fe518a92c9d7d168b5.zip |
Desktop: Context menu option to open FileManager
Diffstat (limited to 'Applications/FileManager')
-rw-r--r-- | Applications/FileManager/main.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
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<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(); -}
\ No newline at end of file +} |