Merge lp:~microcai/libappindicator/libappindicator into lp:libappindicator/15.04

Proposed by microcai
Status: Rejected
Rejected by: Ted Gould
Proposed branch: lp:~microcai/libappindicator/libappindicator
Merge into: lp:libappindicator/15.04
Diff against target: 92 lines (+21/-22)
2 files modified
src/app-indicator.c (+20/-21)
src/app-indicator.h (+1/-1)
To merge this branch: bzr merge lp:~microcai/libappindicator/libappindicator
Reviewer Review Type Date Requested Status
Ted Gould (community) Disapprove
Review via email: mp+252024@code.launchpad.net

Description of the change

To post a comment you must log in.
Revision history for this message
Ted Gould (ted) wrote :

See comment on bug, we don't want that feature.

review: Disapprove

Unmerged revisions

274. By microcai <email address hidden>

fix stupid ubuntu, add Activate signals support

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/app-indicator.c'
2--- src/app-indicator.c 2014-11-10 09:14:07 +0000
3+++ src/app-indicator.c 2015-03-05 21:20:43 +0000
4@@ -107,6 +107,7 @@
5 CONNECTION_CHANGED,
6 NEW_ICON_THEME_PATH,
7 SCROLL_EVENT,
8+ ACTIVATE,
9 LAST_SIGNAL
10 };
11
12@@ -538,6 +539,20 @@
13 _application_service_marshal_VOID__INT_UINT,
14 G_TYPE_NONE, 2, G_TYPE_INT, GDK_TYPE_SCROLL_DIRECTION);
15
16+ /**
17+ * AppIndicator:: activate:
18+ * @arg0: The #AppIndicator object
19+ *
20+ * Signaled when the #AppIndicator receives a activate event.
21+ */
22+ signals[ACTIVATE] = g_signal_new (APP_INDICATOR_SIGNAL_ACTIVATE,
23+ G_TYPE_FROM_CLASS(klass),
24+ G_SIGNAL_RUN_LAST,
25+ G_STRUCT_OFFSET (AppIndicatorClass, scroll_event),
26+ NULL, NULL,
27+ g_cclosure_marshal_VOID__VOID,
28+ G_TYPE_NONE, 0);
29+
30 /* DBus interfaces */
31 if (item_node_info == NULL) {
32 GError * error = NULL;
33@@ -1092,7 +1107,11 @@
34 {
35 gtk_widget_activate (menuitem);
36 }
37- } else {
38+ } else if (g_strcmp0(method, "Activate") == 0 ) {
39+
40+ g_signal_emit(app, signals[ACTIVATE], 0, 0, 0);
41+
42+ }else {
43 g_warning("Calling method '%s' on the app-indicator and it's unknown", method);
44 }
45
46@@ -2465,24 +2484,6 @@
47
48 #define APP_INDICATOR_SHORTY_NICK "app-indicator-shorty-nick"
49
50-/* Callback when an item from the desktop shortcuts gets
51- called. */
52-static void
53-shorty_activated_cb (DbusmenuMenuitem * mi, guint timestamp, gpointer user_data)
54-{
55- gchar * nick = g_object_get_data(G_OBJECT(mi), APP_INDICATOR_SHORTY_NICK);
56- g_return_if_fail(nick != NULL);
57-
58- g_return_if_fail(IS_APP_INDICATOR(user_data));
59- AppIndicator * self = APP_INDICATOR(user_data);
60- AppIndicatorPrivate *priv = self->priv;
61-
62- g_return_if_fail(priv->shorties != NULL);
63-
64- indicator_desktop_shortcuts_nick_exec_with_context(priv->shorties, nick, NULL);
65-
66- return;
67-}
68
69 /**
70 * app_indicator_build_menu_from_desktop:
71@@ -2521,8 +2522,6 @@
72 dbusmenu_menuitem_property_set(item, DBUSMENU_MENUITEM_PROP_LABEL, name);
73 g_free(name);
74
75- g_signal_connect(G_OBJECT(item), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(shorty_activated_cb), self);
76-
77 dbusmenu_menuitem_child_append(root, item);
78 }
79
80
81=== modified file 'src/app-indicator.h'
82--- src/app-indicator.h 2012-02-03 20:37:56 +0000
83+++ src/app-indicator.h 2015-03-05 21:20:43 +0000
84@@ -119,7 +119,7 @@
85 #define APP_INDICATOR_SIGNAL_CONNECTION_CHANGED "connection-changed"
86 #define APP_INDICATOR_SIGNAL_NEW_ICON_THEME_PATH "new-icon-theme-path"
87 #define APP_INDICATOR_SIGNAL_SCROLL_EVENT "scroll-event"
88-
89+#define APP_INDICATOR_SIGNAL_ACTIVATE "activate"
90 /**
91 * AppIndicatorCategory:
92 * @APP_INDICATOR_CATEGORY_APPLICATION_STATUS: The indicator is used to display the status of the application.

Subscribers

People subscribed via source and target branches