mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-05 06:32:30 +02:00
Applications: Open folder with pre-selected file where appropriate :^)
This commit is contained in:
Notes:
sideshowbarker
2024-07-18 21:39:29 +09:00
Author: https://github.com/speles Commit: https://github.com/SerenityOS/serenity/commit/6e16a5cdfa1 Pull-request: https://github.com/SerenityOS/serenity/pull/5595 Issue: https://github.com/SerenityOS/serenity/issues/5586
@@ -24,6 +24,7 @@
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
#include "TreeMapWidget.h"
|
||||
#include <AK/LexicalPath.h>
|
||||
#include <AK/Queue.h>
|
||||
#include <AK/QuickSort.h>
|
||||
#include <AK/RefCounted.h>
|
||||
@@ -305,7 +306,8 @@ int main(int argc, char* argv[])
|
||||
Desktop::Launcher::open(URL::create_with_file_protocol(get_absolute_path_to_selected_node(treemapwidget)));
|
||||
});
|
||||
auto open_containing_folder_action = GUI::Action::create("Open Containing Folder", { Mod_Ctrl, Key_O }, Gfx::Bitmap::load_from_file("/res/icons/16x16/open.png"), [&](auto&) {
|
||||
Desktop::Launcher::open(URL::create_with_file_protocol(get_absolute_path_to_selected_node(treemapwidget, false)));
|
||||
LexicalPath path { get_absolute_path_to_selected_node(treemapwidget) };
|
||||
Desktop::Launcher::open(URL::create_with_file_protocol(path.dirname(), path.basename()));
|
||||
});
|
||||
auto copy_path_action = GUI::Action::create("Copy Path to Clipboard", { Mod_Ctrl, Key_C }, Gfx::Bitmap::load_from_file("/res/icons/16x16/edit-copy.png"), [&](auto&) {
|
||||
GUI::Clipboard::the().set_plain_text(get_absolute_path_to_selected_node(treemapwidget));
|
||||
|
||||
Reference in New Issue
Block a user