mirror of
https://github.com/RGBCube/serenity
synced 2025-05-15 21:24:58 +00:00
GFilePicker: Allow overriding the window title for get_open_filepath()
This commit is contained in:
parent
9129dbe0b9
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