mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 04:17:34 +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:
parent
9844088964
commit
6568765e8f
14 changed files with 27 additions and 26 deletions
|
@ -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<String> open_path = GUI::FilePicker::get_open_filepath();
|
||||
Optional<String> 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());
|
||||
|
|
|
@ -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());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue