Merge lp:~muktupavels/indicator-applet/about-menu into lp:indicator-applet

Proposed by Alberts Muktupāvels on 2020-04-09
Status: Merged
Approved by: Dmitry Shachnev on 2020-04-09
Approved revision: 447
Merged at revision: 447
Proposed branch: lp:~muktupavels/indicator-applet/about-menu
Merge into: lp:indicator-applet
Diff against target: 199 lines (+89/-13)
5 files modified
src/indicator-applet-appmenu.c (+21/-0)
src/indicator-applet-complete.c (+21/-0)
src/indicator-applet-session.c (+21/-1)
src/indicator-applet.c (+24/-12)
src/indicator-applet.h (+2/-0)
To merge this branch: bzr merge lp:~muktupavels/indicator-applet/about-menu
Reviewer Review Type Date Requested Status
Dmitry Shachnev 2020-04-09 Pending
Review via email: mp+381992@code.launchpad.net

Commit message

Restore applet menu.

To post a comment you must log in.
447. By Alberts Muktupāvels on 2020-04-09

Restore applet menu.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/indicator-applet-appmenu.c'
2--- src/indicator-applet-appmenu.c 2020-03-22 12:39:10 +0000
3+++ src/indicator-applet-appmenu.c 2020-04-09 11:05:51 +0000
4@@ -65,6 +65,26 @@
5 return "<Super>F1";
6 }
7
8+static const char *
9+indicator_applet_appmenu_get_menu_xml (void)
10+{
11+ const char *menu_xml;
12+
13+ menu_xml = ""
14+ "<interface>"
15+ " <menu id=\"indicator-appmenu-menu\">"
16+ " <section>"
17+ " <item>"
18+ " <attribute name=\"label\" translatable=\"yes\">_About</attribute>"
19+ " <attribute name=\"action\">indicator-appmenu.about</attribute>"
20+ " </item>"
21+ " </section>"
22+ " </menu>"
23+ "</interface>";
24+
25+ return menu_xml;
26+}
27+
28 static void
29 indicator_applet_appmenu_class_init (IndicatorAppletAppmenuClass *self_class)
30 {
31@@ -78,6 +98,7 @@
32 applet_class->load_module = indicator_applet_appmenu_load_module;
33 applet_class->load_indicator = indicator_applet_appmenu_load_indicator;
34 applet_class->get_hotkey_keycode = indicator_applet_appmenu_get_hotkey_keycode;
35+ applet_class->get_menu_xml = indicator_applet_appmenu_get_menu_xml;
36 }
37
38 static void
39
40=== modified file 'src/indicator-applet-complete.c'
41--- src/indicator-applet-complete.c 2020-03-22 12:39:10 +0000
42+++ src/indicator-applet-complete.c 2020-04-09 11:05:51 +0000
43@@ -71,6 +71,26 @@
44 return "<Super>S";
45 }
46
47+static const char *
48+indicator_applet_complete_get_menu_xml (void)
49+{
50+ const char *menu_xml;
51+
52+ menu_xml = ""
53+ "<interface>"
54+ " <menu id=\"indicator-complete-menu\">"
55+ " <section>"
56+ " <item>"
57+ " <attribute name=\"label\" translatable=\"yes\">_About</attribute>"
58+ " <attribute name=\"action\">indicator-complete.about</attribute>"
59+ " </item>"
60+ " </section>"
61+ " </menu>"
62+ "</interface>";
63+
64+ return menu_xml;
65+}
66+
67 static void
68 indicator_applet_complete_class_init (IndicatorAppletCompleteClass *self_class)
69 {
70@@ -84,6 +104,7 @@
71 applet_class->load_module = indicator_applet_complete_load_module;
72 applet_class->load_indicator = indicator_applet_complete_load_indicator;
73 applet_class->get_hotkey_keycode = indicator_applet_complete_get_hotkey_keycode;
74+ applet_class->get_menu_xml = indicator_applet_complete_get_menu_xml;
75 }
76
77 static void
78
79=== modified file 'src/indicator-applet-session.c'
80--- src/indicator-applet-session.c 2020-03-22 12:39:10 +0000
81+++ src/indicator-applet-session.c 2020-04-09 11:05:51 +0000
82@@ -67,6 +67,26 @@
83 return "<Super>S";
84 }
85
86+static const char *
87+indicator_applet_session_get_menu_xml (void)
88+{
89+ const char *menu_xml;
90+
91+ menu_xml = ""
92+ "<interface>"
93+ " <menu id=\"indicator-session-menu\">"
94+ " <section>"
95+ " <item>"
96+ " <attribute name=\"label\" translatable=\"yes\">_About</attribute>"
97+ " <attribute name=\"action\">indicator-session.about</attribute>"
98+ " </item>"
99+ " </section>"
100+ " </menu>"
101+ "</interface>";
102+
103+ return menu_xml;
104+}
105+
106 static void
107 indicator_applet_session_class_init (IndicatorAppletSessionClass *self_class)
108 {
109@@ -79,8 +99,8 @@
110 applet_class->get_indicator_env = indicator_applet_session_get_indicator_env;
111 applet_class->load_module = indicator_applet_session_load_module;
112 applet_class->load_indicator = indicator_applet_session_load_indicator;
113-
114 applet_class->get_hotkey_keycode = indicator_applet_session_get_hotkey_keycode;
115+ applet_class->get_menu_xml = indicator_applet_session_get_menu_xml;
116 }
117
118 static void
119
120=== modified file 'src/indicator-applet.c'
121--- src/indicator-applet.c 2020-03-29 14:43:47 +0000
122+++ src/indicator-applet.c 2020-04-09 11:05:51 +0000
123@@ -857,17 +857,6 @@
124 {"about", about_cb },
125 { NULL }
126 };
127- static const gchar *menu_xml = ""
128- "<interface>"
129- "<menu id=\"indicator-applet-menu\">"
130- "<section>"
131- "<item>"
132- "<attribute name=\"label\" translatable=\"yes\">_About</attribute>"
133- "<attribute name=\"action\">indicator-applet.about</attribute>"
134- "</item>"
135- "</section>"
136- "</menu>"
137- "</interface>";
138
139 static gboolean first_time = FALSE;
140 gint indicators_loaded = 0;
141@@ -892,7 +881,9 @@
142 gp_applet_set_flags (applet, GP_APPLET_FLAGS_EXPAND_MINOR);
143 priv->menubar = gtk_menu_bar_new ();
144
145- gp_applet_setup_menu (applet, menu_xml, menu_actions);
146+ gp_applet_setup_menu (applet,
147+ INDICATOR_APPLET_GET_CLASS (self)->get_menu_xml (),
148+ menu_actions);
149
150 gtk_widget_set_name(GTK_WIDGET (applet), "fast-user-switch-applet");
151
152@@ -1009,6 +1000,26 @@
153 return "<Super>M";
154 }
155
156+static const char *
157+indicator_applet_get_menu_xml (void)
158+{
159+ const char *menu_xml;
160+
161+ menu_xml = ""
162+ "<interface>"
163+ " <menu id=\"indicator-menu\">"
164+ " <section>"
165+ " <item>"
166+ " <attribute name=\"label\" translatable=\"yes\">_About</attribute>"
167+ " <attribute name=\"action\">indicator.about</attribute>"
168+ " </item>"
169+ " </section>"
170+ " </menu>"
171+ "</interface>";
172+
173+ return menu_xml;
174+}
175+
176 static void
177 indicator_applet_class_init (IndicatorAppletClass *self_class)
178 {
179@@ -1025,6 +1036,7 @@
180 self_class->load_module = indicator_applet_load_module;
181 self_class->load_indicator = indicator_applet_load_indicator;
182 self_class->get_hotkey_keycode = indicator_applet_get_hotkey_keycode;
183+ self_class->get_menu_xml = indicator_applet_get_menu_xml;
184 }
185
186 static void
187
188=== modified file 'src/indicator-applet.h'
189--- src/indicator-applet.h 2020-03-22 12:39:10 +0000
190+++ src/indicator-applet.h 2020-04-09 11:05:51 +0000
191@@ -39,6 +39,8 @@
192 gboolean (* load_indicator) (const char *name);
193
194 const char * (* get_hotkey_keycode) (void);
195+
196+ const char * (* get_menu_xml) (void);
197 };
198
199 G_END_DECLS

Subscribers

People subscribed via source and target branches