aboutsummaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2021-05-11 14:24:52 +0200
committerdec05eba <dec05eba@protonmail.com>2021-05-11 14:24:52 +0200
commite308d77b06405b91885cf6f97c0dc2a1b70679ef (patch)
tree7fb0ed73c20354f3e0ff49ebb199e33ebc3427f7 /plugins
parent6b90f55f4dc14b9d39fa0dbf6b82b3c12ccc29d9 (diff)
Improve file saving gui
Diffstat (limited to 'plugins')
-rw-r--r--plugins/FileManager.hpp16
1 files changed, 4 insertions, 12 deletions
diff --git a/plugins/FileManager.hpp b/plugins/FileManager.hpp
index 20ed49c..e452c40 100644
--- a/plugins/FileManager.hpp
+++ b/plugins/FileManager.hpp
@@ -18,27 +18,19 @@ namespace QuickMedia {
class FileManagerPage : public Page {
public:
- FileManagerPage(Program *program, FileManagerMimeType mime_type = FILE_MANAGER_MIME_TYPE_ALL, FileSelectionHandler selection_handler = nullptr, bool allow_empty_match_submit = false, const std::string &title_prefix = "") :
- Page(program), current_dir("/"), mime_type(mime_type), selection_handler(selection_handler), allow_empty_match_submit(allow_empty_match_submit), title_prefix(title_prefix)
- {
- title = title_prefix + current_dir.string();
- }
- const char* get_title() const override { return title.c_str(); }
+ FileManagerPage(Program *program, FileManagerMimeType mime_type = FILE_MANAGER_MIME_TYPE_ALL, FileSelectionHandler selection_handler = nullptr) :
+ Page(program), current_dir("/"), mime_type(mime_type), selection_handler(selection_handler) {}
+ const char* get_title() const override { return current_dir.c_str(); }
PluginResult submit(const std::string &title, const std::string &url, std::vector<Tab> &result_tabs) override;
bool is_single_page() const override { return true; }
- bool allow_submit_no_selection() const override { return allow_empty_match_submit; }
- void on_navigate_to_page(Body*) override;
bool set_current_directory(const std::string &path);
+ const std::filesystem::path& get_current_directory() const { return current_dir; }
PluginResult get_files_in_directory(BodyItems &result_items);
-
- bool close = false;
private:
std::filesystem::path current_dir;
FileManagerMimeType mime_type;
FileSelectionHandler selection_handler;
bool allow_empty_match_submit;
- std::string title;
- std::string title_prefix;
};
} \ No newline at end of file