Merge lp:~attente/unity-gtk-module/1243974 into lp:unity-gtk-module/14.04

Proposed by William Hua
Status: Merged
Approved by: Lars Karlitski
Approved revision: 310
Merged at revision: 310
Proposed branch: lp:~attente/unity-gtk-module/1243974
Merge into: lp:unity-gtk-module/14.04
Diff against target: 114 lines (+40/-6)
5 files modified
lib/unity-gtk-action-group.c (+3/-4)
lib/unity-gtk-menu-item-private.h (+2/-0)
lib/unity-gtk-menu-item.c (+16/-2)
lib/unity-gtk-menu-shell-private.h (+3/-0)
lib/unity-gtk-menu-shell.c (+16/-0)
To merge this branch: bzr merge lp:~attente/unity-gtk-module/1243974
Reviewer Review Type Date Requested Status
Ted Gould (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+197108@code.launchpad.net

Commit message

Fix regression on GtkRecentChooserMenus. (LP: #1243974)

Description of the change

Fix regression on GtkRecentChooserMenus. (LP: #1243974)

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Ted Gould (ted) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/unity-gtk-action-group.c'
2--- lib/unity-gtk-action-group.c 2013-02-19 11:55:57 +0000
3+++ lib/unity-gtk-action-group.c 2013-11-28 18:39:29 +0000
4@@ -394,8 +394,8 @@
5 name = g_variant_get_string (parameter, NULL);
6 item = g_hash_table_lookup (action->items_by_name, name);
7
8- if (item != NULL && item->menu_item != NULL)
9- gtk_menu_item_activate (item->menu_item);
10+ if (item != NULL)
11+ unity_gtk_menu_item_activate (item);
12
13 g_action_group_action_state_changed (G_ACTION_GROUP (group), action->name, parameter);
14 }
15@@ -406,8 +406,7 @@
16 else
17 g_warn_if_fail (parameter == NULL);
18
19- if (action->item->menu_item != NULL)
20- gtk_menu_item_activate (action->item->menu_item);
21+ unity_gtk_menu_item_activate (action->item);
22 }
23
24 return;
25
26=== modified file 'lib/unity-gtk-menu-item-private.h'
27--- lib/unity-gtk-menu-item-private.h 2013-06-17 17:32:33 +0000
28+++ lib/unity-gtk-menu-item-private.h 2013-11-28 18:39:29 +0000
29@@ -84,6 +84,8 @@
30
31 gboolean unity_gtk_menu_item_get_draw_as_radio (UnityGtkMenuItem *item) G_GNUC_INTERNAL;
32
33+void unity_gtk_menu_item_activate (UnityGtkMenuItem *item) G_GNUC_INTERNAL;
34+
35 void unity_gtk_menu_item_print (UnityGtkMenuItem *item,
36 guint indent) G_GNUC_INTERNAL;
37
38
39=== modified file 'lib/unity-gtk-menu-item.c'
40--- lib/unity-gtk-menu-item.c 2013-07-09 17:25:52 +0000
41+++ lib/unity-gtk-menu-item.c 2013-11-28 18:39:29 +0000
42@@ -425,8 +425,13 @@
43 {
44 UnityGtkMenuShell *parent_shell = item->parent_shell;
45
46- if (parent_shell != NULL && parent_shell->action_group != NULL)
47- unity_gtk_action_group_connect_shell (parent_shell->action_group, item->child_shell);
48+ if (parent_shell != NULL)
49+ {
50+ if (parent_shell->action_group != NULL)
51+ unity_gtk_action_group_connect_shell (parent_shell->action_group, item->child_shell);
52+ }
53+ else
54+ g_warn_if_reached ();
55 }
56 }
57
58@@ -563,6 +568,15 @@
59 }
60
61 void
62+unity_gtk_menu_item_activate (UnityGtkMenuItem *item)
63+{
64+ g_return_if_fail (UNITY_GTK_IS_MENU_ITEM (item));
65+ g_return_if_fail (item->parent_shell != NULL);
66+
67+ unity_gtk_menu_shell_activate_item (item->parent_shell, item);
68+}
69+
70+void
71 unity_gtk_menu_item_print (UnityGtkMenuItem *item,
72 guint indent)
73 {
74
75=== modified file 'lib/unity-gtk-menu-shell-private.h'
76--- lib/unity-gtk-menu-shell-private.h 2013-02-19 11:55:57 +0000
77+++ lib/unity-gtk-menu-shell-private.h 2013-11-28 18:39:29 +0000
78@@ -37,6 +37,9 @@
79 UnityGtkMenuItem *item,
80 GParamSpec *pspec) G_GNUC_INTERNAL;
81
82+void unity_gtk_menu_shell_activate_item (UnityGtkMenuShell *shell,
83+ UnityGtkMenuItem *item) G_GNUC_INTERNAL;
84+
85 void unity_gtk_menu_shell_print (UnityGtkMenuShell *shell,
86 guint indent) G_GNUC_INTERNAL;
87
88
89=== modified file 'lib/unity-gtk-menu-shell.c'
90--- lib/unity-gtk-menu-shell.c 2013-07-08 19:53:09 +0000
91+++ lib/unity-gtk-menu-shell.c 2013-11-28 18:39:29 +0000
92@@ -972,6 +972,22 @@
93 }
94
95 void
96+unity_gtk_menu_shell_activate_item (UnityGtkMenuShell *shell,
97+ UnityGtkMenuItem *item)
98+{
99+ g_return_if_fail (UNITY_GTK_IS_MENU_SHELL (shell));
100+ g_return_if_fail (UNITY_GTK_IS_MENU_ITEM (item));
101+
102+ if (item->menu_item != NULL)
103+ {
104+ if (GTK_IS_MENU (shell->menu_shell))
105+ gtk_menu_set_active (GTK_MENU (shell->menu_shell), item->item_index);
106+
107+ gtk_menu_item_activate (item->menu_item);
108+ }
109+}
110+
111+void
112 unity_gtk_menu_shell_print (UnityGtkMenuShell *shell,
113 guint indent)
114 {

Subscribers

People subscribed via source and target branches