Skip to content

Commit 2c2a711

Browse files
committed
Fix activation of radio menu items (#24)
1 parent 04f7876 commit 2c2a711

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/Command.vala

+4-2
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,16 @@ namespace Plotinus {
3131

3232
class ActionCommand : Command {
3333
private Action action;
34+
private Variant? parameter;
3435

3536
public override void execute() {
36-
action.activate(null);
37+
action.activate(parameter);
3738
}
3839

39-
public ActionCommand(string[] path, string label, string[] accelerators, Action action) {
40+
public ActionCommand(string[] path, string label, string[] accelerators, Action action, Variant? parameter) {
4041
base(path, label, accelerators);
4142
this.action = action;
43+
this.parameter = parameter;
4244
}
4345
}
4446

src/CommandExtractor.vala

+2-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@ class Plotinus.CommandExtractor : Object {
7575

7676
if (label != null && label != "" && action != null && action.enabled) {
7777
var accelerators = (application != null) ? application.get_accels_for_action(action_name) : new string[0];
78-
commands += new ActionCommand(path, label, accelerators, action);
78+
var target = menu_model.get_item_attribute_value(i, Menu.ATTRIBUTE_TARGET, null);
79+
commands += new ActionCommand(path, label, accelerators, action, target);
7980
}
8081

8182
var link_iterator = menu_model.iterate_item_links(i);

0 commit comments

Comments
 (0)