draft action open

This commit is contained in:
yggverse 2024-09-14 12:05:48 +03:00
parent 2a0b9f194f
commit 072a64dac7
2 changed files with 19 additions and 1 deletions

View File

@ -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<Glib::Variant<Glib::ustring>>(parameter).get()
}
);
const auto ACTION__CLEAN = add_action( const auto ACTION__CLEAN = add_action(
"clean", "clean",
[this] [this]

View File

@ -117,7 +117,13 @@ Reader::Reader(
signal_activate_link().connect( signal_activate_link().connect(
[this](const Glib::ustring & URI) -> bool [this](const Glib::ustring & URI) -> bool
{ {
// @TODO follow action // Open link URI
activate_action(
"win.open",
Glib::Variant<Glib::ustring>::create(
URI
)
);
return false; return false;
}, },