add parameter_type argument

This commit is contained in:
yggverse 2024-10-15 08:20:43 +03:00
parent e41216ab75
commit c92a5406f5
2 changed files with 15 additions and 15 deletions

View File

@ -38,18 +38,18 @@ impl App {
profile_path: PathBuf,
) -> Self {
// Init actions
let action_tool_debug = Action::new("win", true);
let action_tool_profile = Action::new("win", true);
let action_quit = Action::new("win", true);
let action_update = Action::new("win", true);
let action_tab_append = Action::new("win", true);
let action_tab_close = Action::new("win", true);
let action_tab_close_all = Action::new("win", true);
let action_tab_page_navigation_base = Action::new("win", false);
let action_tab_page_navigation_history_back = Action::new("win", false);
let action_tab_page_navigation_history_forward = Action::new("win", false);
let action_tab_page_navigation_reload = Action::new("win", true);
let action_tab_pin = Action::new("win", true);
let action_tool_debug = Action::new("win", true, None);
let action_tool_profile = Action::new("win", true, None);
let action_quit = Action::new("win", true, None);
let action_update = Action::new("win", true, None);
let action_tab_append = Action::new("win", true, None);
let action_tab_close = Action::new("win", true, None);
let action_tab_close_all = Action::new("win", true, None);
let action_tab_page_navigation_base = Action::new("win", false, None);
let action_tab_page_navigation_history_back = Action::new("win", false, None);
let action_tab_page_navigation_history_forward = Action::new("win", false, None);
let action_tab_page_navigation_reload = Action::new("win", true, None);
let action_tab_pin = Action::new("win", true, None);
// Init GTK
let gobject = Application::builder()

View File

@ -6,7 +6,7 @@ use std::sync::Arc;
use gtk::{
gio::SimpleAction,
glib::{gformat, uuid_string_random, GString},
glib::{gformat, uuid_string_random, GString, VariantTy},
prelude::ActionExt,
};
@ -17,9 +17,9 @@ pub struct Action {
impl Action {
// Construct
pub fn new(group: &str, is_enabled: bool) -> Self {
pub fn new(group: &str, is_enabled: bool, parameter_type: Option<&VariantTy>) -> Self {
// Create random action name as no static values should be in use
let simple = Arc::new(SimpleAction::new(&uuid_string_random(), None));
let simple = Arc::new(SimpleAction::new(&uuid_string_random(), parameter_type));
simple.set_enabled(is_enabled);
// Assign action to the group