diff options
Diffstat (limited to 'plugins/FileManager.hpp')
-rw-r--r-- | plugins/FileManager.hpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/plugins/FileManager.hpp b/plugins/FileManager.hpp index 2e93a8e..72ac75d 100644 --- a/plugins/FileManager.hpp +++ b/plugins/FileManager.hpp @@ -11,10 +11,12 @@ namespace QuickMedia { }; static const FileManagerMimeType FILE_MANAGER_MIME_TYPE_ALL = (FileManagerMimeType)(FILE_MANAGER_MIME_TYPE_IMAGE|FILE_MANAGER_MIME_TYPE_VIDEO|FILE_MANAGER_MIME_TYPE_OTHER); + // Return the tags to go to after selecting a file, or return an empty array to exit the program + using FileSelectionHandler = std::function<std::vector<Tab>()>; class FileManagerPage : public Page { public: - FileManagerPage(Program *program, FileManagerMimeType mime_type = FILE_MANAGER_MIME_TYPE_ALL) : Page(program), current_dir("/"), mime_type(mime_type) {} + 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; } @@ -24,5 +26,6 @@ namespace QuickMedia { private: std::filesystem::path current_dir; FileManagerMimeType mime_type; + FileSelectionHandler selection_handler; }; }
\ No newline at end of file |