summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibGUI/FilePicker.cpp
diff options
context:
space:
mode:
authorthankyouverycool <66646555+thankyouverycool@users.noreply.github.com>2021-04-04 11:09:28 -0400
committerAndreas Kling <kling@serenityos.org>2021-04-06 22:24:05 +0200
commit8afe013069ef1058d93fd443de1babab3454f8ad (patch)
treebc3ea48e15202a883cbeeae0fc805aca5b6f17e7 /Userland/Libraries/LibGUI/FilePicker.cpp
parent3ba86e315657580415b676fb2a40ea1342f10d4e (diff)
downloadserenity-8afe013069ef1058d93fd443de1babab3454f8ad.zip
LibGUI:: Let open/save specify starting directory in FilePicker
Diffstat (limited to 'Userland/Libraries/LibGUI/FilePicker.cpp')
-rw-r--r--Userland/Libraries/LibGUI/FilePicker.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/Userland/Libraries/LibGUI/FilePicker.cpp b/Userland/Libraries/LibGUI/FilePicker.cpp
index fbca7fc9a2..4ca510d4a4 100644
--- a/Userland/Libraries/LibGUI/FilePicker.cpp
+++ b/Userland/Libraries/LibGUI/FilePicker.cpp
@@ -48,9 +48,9 @@
namespace GUI {
-Optional<String> FilePicker::get_open_filepath(Window* parent_window, const String& window_title)
+Optional<String> FilePicker::get_open_filepath(Window* parent_window, const String& window_title, const StringView& path)
{
- auto picker = FilePicker::construct(parent_window, Mode::Open);
+ auto picker = FilePicker::construct(parent_window, Mode::Open, "", path);
if (!window_title.is_null())
picker->set_title(window_title);
@@ -66,9 +66,9 @@ Optional<String> FilePicker::get_open_filepath(Window* parent_window, const Stri
return {};
}
-Optional<String> FilePicker::get_save_filepath(Window* parent_window, const String& title, const String& extension)
+Optional<String> FilePicker::get_save_filepath(Window* parent_window, const String& title, const String& extension, const StringView& path)
{
- auto picker = FilePicker::construct(parent_window, Mode::Save, String::formatted("{}.{}", title, extension));
+ auto picker = FilePicker::construct(parent_window, Mode::Save, String::formatted("{}.{}", title, extension), path);
if (picker->exec() == Dialog::ExecOK) {
String file_path = picker->selected_file().string();