From 27eac1c56904a853e79d66e1cf4daac7d8f8ba6b Mon Sep 17 00:00:00 2001 From: dec05eba Date: Fri, 7 May 2021 03:34:05 +0200 Subject: Add ctrl+i reverse image search to 4chan, add saucenao to launcher --- plugins/FileManager.hpp | 5 ++++- plugins/Saucenao.hpp | 5 +++-- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'plugins') 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()>; 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 &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&) 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 -- cgit v1.2.3