1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-08 23:07:35 +00:00

LibGUI: Add parent window argument to FilePicker functions

Since FilePicker almost always should be modal, add the parent
window as mandatory first argument.
This commit is contained in:
Tom 2020-07-15 19:52:02 -06:00 committed by Andreas Kling
parent 9844088964
commit 6568765e8f
14 changed files with 27 additions and 26 deletions

View file

@ -222,7 +222,7 @@ int main(int argc, char** argv)
});
auto add_existing_file_action = GUI::Action::create("Add existing file to project...", Gfx::Bitmap::load_from_file("/res/icons/16x16/open.png"), [&](auto&) {
auto result = GUI::FilePicker::get_open_filepath("Add existing file to project");
auto result = GUI::FilePicker::get_open_filepath(g_window, "Add existing file to project");
if (!result.has_value())
return;
auto& filename = result.value();
@ -425,7 +425,7 @@ int main(int argc, char** argv)
});
auto open_action = GUI::Action::create("Open project...", { Mod_Ctrl | Mod_Shift, Key_O }, Gfx::Bitmap::load_from_file("/res/icons/16x16/open.png"), [&](auto&) {
auto open_path = GUI::FilePicker::get_open_filepath("Open project");
auto open_path = GUI::FilePicker::get_open_filepath(g_window, "Open project");
if (!open_path.has_value())
return;
open_project(open_path.value());