From 6568765e8f89563fa76407ce5e369ec1eb09c125 Mon Sep 17 00:00:00 2001 From: Tom Date: Wed, 15 Jul 2020 19:52:02 -0600 Subject: LibGUI: Add parent window argument to FilePicker functions Since FilePicker almost always should be modal, add the parent window as mandatory first argument. --- Applications/Piano/SamplerWidget.cpp | 2 +- Applications/Piano/main.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'Applications/Piano') diff --git a/Applications/Piano/SamplerWidget.cpp b/Applications/Piano/SamplerWidget.cpp index e08026453e..bc522754e8 100644 --- a/Applications/Piano/SamplerWidget.cpp +++ b/Applications/Piano/SamplerWidget.cpp @@ -108,7 +108,7 @@ SamplerWidget::SamplerWidget(TrackManager& track_manager) m_open_button->set_focusable(false); m_open_button->set_icon(Gfx::Bitmap::load_from_file("/res/icons/16x16/open.png")); m_open_button->on_click = [this](auto) { - Optional open_path = GUI::FilePicker::get_open_filepath(); + Optional open_path = GUI::FilePicker::get_open_filepath(window()); if (!open_path.has_value()) return; String error_string = m_track_manager.current_track().set_recorded_sample(open_path.value()); diff --git a/Applications/Piano/main.cpp b/Applications/Piano/main.cpp index 0a9782bf37..53ce80d80d 100644 --- a/Applications/Piano/main.cpp +++ b/Applications/Piano/main.cpp @@ -96,7 +96,7 @@ int main(int argc, char** argv) auto& app_menu = menubar->add_menu("Piano"); app_menu.add_action(GUI::Action::create("Export", { Mod_Ctrl, Key_E }, [&](const GUI::Action&) { - save_path = GUI::FilePicker::get_save_filepath("Untitled", "wav"); + save_path = GUI::FilePicker::get_save_filepath(window, "Untitled", "wav"); if (!save_path.has_value()) return; wav_writer.set_file(save_path.value()); -- cgit v1.2.3