diff options
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/FileManager.hpp | 5 | ||||
-rw-r--r-- | plugins/Saucenao.hpp | 5 |
2 files changed, 7 insertions, 3 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 diff --git a/plugins/Saucenao.hpp b/plugins/Saucenao.hpp index a5aadf9..297dde3 100644 --- a/plugins/Saucenao.hpp +++ b/plugins/Saucenao.hpp @@ -5,7 +5,7 @@ namespace QuickMedia { class SaucenaoPage : public LazyFetchPage { public: - SaucenaoPage(Program *program, const std::string &upload_filepath) : LazyFetchPage(program), upload_filepath(upload_filepath) {} + SaucenaoPage(Program *program, const std::string &path, bool is_local) : LazyFetchPage(program), path(path), is_local(is_local) {} const char* get_title() const override { return "SauceNAO"; } PluginResult submit(const std::string&, const std::string&, std::vector<Tab>&) override { return PluginResult::OK; @@ -13,6 +13,7 @@ namespace QuickMedia { PluginResult lazy_fetch(BodyItems &result_items) override; bool is_single_page() const override { return true; } private: - std::string upload_filepath; + std::string path; + bool is_local; }; }
\ No newline at end of file |