summaryrefslogtreecommitdiff
path: root/Applications/FileManager
diff options
context:
space:
mode:
authorJonathan Archer <jon@jonnyarcher.com>2020-04-22 14:10:38 -0500
committerAndreas Kling <kling@serenityos.org>2020-04-23 11:22:32 +0200
commit0efb5b3a11b106572d3227fe518a92c9d7d168b5 (patch)
tree38eae6fdf148f3c7a0f92ac72fe3f5d9f902b7a3 /Applications/FileManager
parent3bbd7d94258044aad93f0f5976b9676c287dc320 (diff)
downloadserenity-0efb5b3a11b106572d3227fe518a92c9d7d168b5.zip
Desktop: Context menu option to open FileManager
Diffstat (limited to 'Applications/FileManager')
-rw-r--r--Applications/FileManager/main.cpp8
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
+}