From 072a64dac754e23400fc89cbb9802827badd4403 Mon Sep 17 00:00:00 2001 From: yggverse Date: Sat, 14 Sep 2024 12:05:48 +0300 Subject: [PATCH] draft action open --- src/app/browser.cpp | 12 ++++++++++++ .../main/tab/page/content/text/gemini/reader.cpp | 8 +++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/app/browser.cpp b/src/app/browser.cpp index 95f2dd02..078c63b2 100644 --- a/src/app/browser.cpp +++ b/src/app/browser.cpp @@ -26,6 +26,18 @@ Browser::Browser( } ); + const Glib::VariantType ACTION__OPEN__PARAMETER_TYPE("s"); + + const auto ACTION__OPEN = add_action_with_parameter( + "open", + ACTION__OPEN__PARAMETER_TYPE, + [this](const Glib::VariantBase & parameter) + { + // @TODO process request + // Glib::VariantBase::cast_dynamic>(parameter).get() + } + ); + const auto ACTION__CLEAN = add_action( "clean", [this] diff --git a/src/app/browser/main/tab/page/content/text/gemini/reader.cpp b/src/app/browser/main/tab/page/content/text/gemini/reader.cpp index e957fe28..b0d6263c 100644 --- a/src/app/browser/main/tab/page/content/text/gemini/reader.cpp +++ b/src/app/browser/main/tab/page/content/text/gemini/reader.cpp @@ -117,7 +117,13 @@ Reader::Reader( signal_activate_link().connect( [this](const Glib::ustring & URI) -> bool { - // @TODO follow action + // Open link URI + activate_action( + "win.open", + Glib::Variant::create( + URI + ) + ); return false; },