mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-29 07:48:47 +00:00
GFilePicker: Allow overriding the window title for get_open_filepath()
This commit is contained in:
parent
9129dbe0b9
commit
4089690cf1
Notes:
sideshowbarker
2024-07-19 11:32:00 +09:00
Author: https://github.com/awesomekling
Commit: 4089690cf1
2 changed files with 5 additions and 2 deletions
|
@ -13,10 +13,13 @@
|
|||
#include <LibGUI/GTextBox.h>
|
||||
#include <LibGUI/GToolBar.h>
|
||||
|
||||
Optional<String> GFilePicker::get_open_filepath()
|
||||
Optional<String> GFilePicker::get_open_filepath(const String& window_title)
|
||||
{
|
||||
auto picker = GFilePicker::construct(Mode::Open);
|
||||
|
||||
if (!window_title.is_null())
|
||||
picker->set_title(window_title);
|
||||
|
||||
if (picker->exec() == GDialog::ExecOK) {
|
||||
String file_path = picker->selected_file().string();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue