From e02cbd9daae621dc2a8d3ae784ba299719d6649b Mon Sep 17 00:00:00 2001 From: Karol Kosek Date: Tue, 9 May 2023 18:32:59 +0200 Subject: GMLPlayground: Make 'Open' action start in the Application source folder Font Editor and Theme Editor already open the dialog in system folders (/res/fonts and /res/themes). To be fair, they do have a special folder just for their files, but I think this is good enough if you want to start hacking an app :^) Additionaly, this also adds a filter to show only .gml files by default. --- Userland/DevTools/GMLPlayground/MainWidget.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Userland/DevTools/GMLPlayground/MainWidget.cpp b/Userland/DevTools/GMLPlayground/MainWidget.cpp index 33a142174f..78392b78a1 100644 --- a/Userland/DevTools/GMLPlayground/MainWidget.cpp +++ b/Userland/DevTools/GMLPlayground/MainWidget.cpp @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -160,7 +161,11 @@ ErrorOr MainWidget::initialize_menubar(GUI::Window& window) auto open_action = GUI::CommonActions::make_open_action([&](auto&) { if (request_close() == GUI::Window::CloseRequestDecision::StayOpen) return; - auto response = FileSystemAccessClient::Client::the().open_file(&window); + auto response = FileSystemAccessClient::Client::the().open_file(&window, {}, "/usr/src/serenity/Userland/Applications"sv, Core::File::OpenMode::Read, + Vector { + GUI::FileTypeFilter { "GML Files", { { "gml" } } }, + GUI::FileTypeFilter::all_files(), + }); if (response.is_error()) return; -- cgit v1.2.3