mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 19:57:45 +00:00
LibGUI+HackStudio: Add way to tell FilePicker to open a folder
This now means that when trying to open a folder, one can click on the folder and press open instead of having to actually step into the desired folder. Of course, it also means it won't let you open non-directories anymore.
This commit is contained in:
parent
ce010de74f
commit
2ed5d19407
4 changed files with 13 additions and 6 deletions
|
@ -44,10 +44,11 @@ public:
|
|||
enum class Mode {
|
||||
Open,
|
||||
OpenMultiple,
|
||||
OpenFolder,
|
||||
Save
|
||||
};
|
||||
|
||||
static Optional<String> get_open_filepath(Window* parent_window, const String& window_title = {}, const StringView& path = Core::StandardPaths::home_directory());
|
||||
static Optional<String> get_open_filepath(Window* parent_window, const String& window_title = {}, const StringView& path = Core::StandardPaths::home_directory(), bool folder = false);
|
||||
static Optional<String> get_save_filepath(Window* parent_window, const String& title, const String& extension, const StringView& path = Core::StandardPaths::home_directory());
|
||||
|
||||
virtual ~FilePicker() override;
|
||||
|
@ -69,6 +70,7 @@ private:
|
|||
switch (mode) {
|
||||
case Mode::Open:
|
||||
case Mode::OpenMultiple:
|
||||
case Mode::OpenFolder:
|
||||
return "Open";
|
||||
case Mode::Save:
|
||||
return "Save";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue