From 5c27b5fbaa0f1693bf4605a3e6fc57d0f066c0ec Mon Sep 17 00:00:00 2001 From: dec05eba Date: Fri, 12 Nov 2021 22:37:23 +0100 Subject: Allow plugins to add their own tabs in ctrl+r instead of search, comments, related and channel --- plugins/Page.hpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'plugins/Page.hpp') diff --git a/plugins/Page.hpp b/plugins/Page.hpp index 4fed1c8..c07679d 100644 --- a/plugins/Page.hpp +++ b/plugins/Page.hpp @@ -129,12 +129,13 @@ namespace QuickMedia { virtual PageTypez get_type() const override { return PageTypez::VIDEO; } virtual bool autoplay_next_item() { return false; } virtual BodyItems get_related_media(const std::string &url) { (void)url; return {}; } - virtual bool create_search_page(Program *program, Tab &tab) { (void)program; (void)tab; return false; } - virtual std::unique_ptr create_comments_page(Program *program) { (void)program; return nullptr; } - // Return nullptr if the service doesn't support related videos page - virtual std::unique_ptr create_related_videos_page(Program *program) = 0; - // Return nullptr if the service doesn't support channels page - virtual std::unique_ptr create_channels_page(Program *program, const std::string &channel_url) = 0; + virtual PluginResult get_related_pages(const BodyItems &related_videos, const std::string &channel_url, std::vector &result_tabs) { + (void)related_videos; + (void)channel_url; + (void)result_tabs; + return PluginResult::OK; + } + virtual int get_related_pages_first_tab() { return 0; } virtual void set_url(std::string new_url) { url = std::move(new_url); } std::string get_url() { return url; } virtual std::string get_download_url(int max_height) { (void)max_height; return url; } -- cgit v1.2.3