aboutsummaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2021-09-18 18:07:10 +0200
committerdec05eba <dec05eba@protonmail.com>2021-09-18 18:07:16 +0200
commitd74766245facd48805c2576c711d20cafa33aa35 (patch)
tree0be58368480ada332d62af14ef1a300170149871 /plugins
parent63774155016ad581dcf418c94cd2ec84fcf86445 (diff)
Show option to open saucenao result urls
ctrl+c for info should only copy the url
Diffstat (limited to 'plugins')
-rw-r--r--plugins/Info.hpp3
-rw-r--r--plugins/Page.hpp2
-rw-r--r--plugins/Saucenao.hpp6
3 files changed, 7 insertions, 4 deletions
diff --git a/plugins/Info.hpp b/plugins/Info.hpp
index af62282..fbf7a41 100644
--- a/plugins/Info.hpp
+++ b/plugins/Info.hpp
@@ -10,7 +10,10 @@ namespace QuickMedia {
PluginResult submit(const std::string &title, const std::string &url, std::vector<Tab> &result_tabs) override;
bool submit_is_async() const override { return false; }
+ void copy_to_clipboard(const BodyItem *body_item) const override;
+
static std::shared_ptr<BodyItem> add_url(const std::string &url);
static std::shared_ptr<BodyItem> add_reverse_image_search(const std::string &image_url);
+ static std::shared_ptr<BodyItem> add_google_search(const std::string &search_term);
};
} \ No newline at end of file
diff --git a/plugins/Page.hpp b/plugins/Page.hpp
index d5daa3d..4fed1c8 100644
--- a/plugins/Page.hpp
+++ b/plugins/Page.hpp
@@ -74,6 +74,8 @@ namespace QuickMedia {
virtual void on_navigate_to_page(Body *body) { (void)body; }
virtual void cancel_operation() {}
+ virtual void copy_to_clipboard(const BodyItem *body_item) const;
+
std::unique_ptr<Body> create_body(bool plain_text_list = false, bool prefer_card_view = false);
std::unique_ptr<SearchBar> create_search_bar(const std::string &placeholder_text, int search_delay);
diff --git a/plugins/Saucenao.hpp b/plugins/Saucenao.hpp
index 297dde3..d58b424 100644
--- a/plugins/Saucenao.hpp
+++ b/plugins/Saucenao.hpp
@@ -7,11 +7,9 @@ namespace QuickMedia {
public:
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;
- }
+ bool submit_is_async() const override { return false; }
+ PluginResult submit(const std::string &title, const std::string &url, std::vector<Tab> &result_tabs) override;
PluginResult lazy_fetch(BodyItems &result_items) override;
- bool is_single_page() const override { return true; }
private:
std::string path;
bool is_local;