diff --git a/src/Command.vala b/src/Command.vala index 60e7116..1ed802d 100644 --- a/src/Command.vala +++ b/src/Command.vala @@ -31,14 +31,16 @@ namespace Plotinus { class ActionCommand : Command { private Action action; + private Variant? parameter; public override void execute() { - action.activate(null); + action.activate(parameter); } - public ActionCommand(string[] path, string label, string[] accelerators, Action action) { + public ActionCommand(string[] path, string label, string[] accelerators, Action action, Variant? parameter) { base(path, label, accelerators); this.action = action; + this.parameter = parameter; } } diff --git a/src/CommandExtractor.vala b/src/CommandExtractor.vala index 9ea61b1..ba2d5d3 100644 --- a/src/CommandExtractor.vala +++ b/src/CommandExtractor.vala @@ -75,7 +75,8 @@ class Plotinus.CommandExtractor : Object { if (label != null && label != "" && action != null && action.enabled) { var accelerators = (application != null) ? application.get_accels_for_action(action_name) : new string[0]; - commands += new ActionCommand(path, label, accelerators, action); + var target = menu_model.get_item_attribute_value(i, Menu.ATTRIBUTE_TARGET, null); + commands += new ActionCommand(path, label, accelerators, action, target); } var link_iterator = menu_model.iterate_item_links(i);