Merge lp:~indicator-applet-developers/libindicate/ubuntu into lp:~ubuntu-desktop/libindicate/ubuntu

Proposed by Ted Gould
Status: Merged
Merged at revision: not available
Proposed branch: lp:~indicator-applet-developers/libindicate/ubuntu
Merge into: lp:~ubuntu-desktop/libindicate/ubuntu
Diff against target: 223 lines (+82/-6)
8 files modified
Makefile.am (+2/-1)
configure.ac (+4/-4)
debian/changelog (+9/-0)
examples/im-client.c (+23/-0)
libindicate/listener.c (+28/-0)
libindicate/listener.h (+7/-0)
libindicate/server.c (+8/-0)
tests/Makefile.am (+1/-1)
To merge this branch: bzr merge lp:~indicator-applet-developers/libindicate/ubuntu
Reviewer Review Type Date Requested Status
Sebastien Bacher Pending
Review via email: mp+19619@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Ted Gould (ted) wrote :

0.3.3

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Makefile.am'
2--- Makefile.am 2009-08-18 16:28:35 +0000
3+++ Makefile.am 2010-02-18 15:29:09 +0000
4@@ -10,7 +10,8 @@
5 COPYING.LGPL.2.1 \
6 gtk-doc.make \
7 omf.make \
8- xmldocs.make
9+ xmldocs.make \
10+ autogen.sh
11
12 DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc --disable-scrollkeeper
13
14
15=== modified file 'configure.ac'
16--- configure.ac 2010-02-11 15:36:39 +0000
17+++ configure.ac 2010-02-18 15:29:09 +0000
18@@ -1,10 +1,10 @@
19
20-AC_INIT(libindicate, 0.3.2, ted@canonical.com)
21+AC_INIT(libindicate, 0.3.3, ted@canonical.com)
22
23 AC_PREREQ(2.53)
24
25 AM_CONFIG_HEADER(config.h)
26-AM_INIT_AUTOMAKE(libindicate, 0.3.2)
27+AM_INIT_AUTOMAKE(libindicate, 0.3.3)
28
29 AM_MAINTAINER_MODE
30 m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES])
31@@ -28,7 +28,7 @@
32 ###########################
33
34 LIBINDICATE_CURRENT=4
35-LIBINDICATE_REVISION=0
36+LIBINDICATE_REVISION=1
37 LIBINDICATE_AGE=0
38
39 AC_SUBST(LIBINDICATE_CURRENT)
40@@ -40,7 +40,7 @@
41 ###########################
42
43 LIBINDICATEGTK_CURRENT=2
44-LIBINDICATEGTK_REVISION=0
45+LIBINDICATEGTK_REVISION=1
46 LIBINDICATEGTK_AGE=0
47
48 AC_SUBST(LIBINDICATEGTK_CURRENT)
49
50=== modified file 'debian/changelog'
51--- debian/changelog 2010-02-11 19:14:52 +0000
52+++ debian/changelog 2010-02-18 15:29:09 +0000
53@@ -1,3 +1,12 @@
54+libindicate (0.3.3-0ubuntu1~ppa1) lucid; urgency=low
55+
56+ * Upstream release 0.3.3
57+ * Add ability to get properties as values in the server.
58+ * Fix error messages on failed properties.
59+ * Add menu support to im-client example.
60+
61+ -- Ted Gould <ted@ubuntu.com> Thu, 18 Feb 2010 09:25:28 -0600
62+
63 libindicate (0.3.2-0ubuntu1) lucid; urgency=low
64
65 * Upstream release 0.3.2
66
67=== modified file 'examples/im-client.c'
68--- examples/im-client.c 2009-08-28 19:40:56 +0000
69+++ examples/im-client.c 2010-02-18 15:29:09 +0000
70@@ -78,6 +78,12 @@
71 g_debug("Someone is no longer interested in my for: %d", interest);
72 }
73
74+void
75+menuitem_click (DbusmenuMenuitem * menuitem, guint timestamp, gpointer data)
76+{
77+ g_debug("Menuitem '%s' clicked at %d", (gchar *)data, timestamp);
78+}
79+
80 int
81 main (int argc, char ** argv)
82 {
83@@ -90,6 +96,23 @@
84 g_signal_connect(G_OBJECT(server), INDICATE_SERVER_SIGNAL_INTEREST_ADDED, G_CALLBACK(interest_added), NULL);
85 g_signal_connect(G_OBJECT(server), INDICATE_SERVER_SIGNAL_INTEREST_REMOVED, G_CALLBACK(interest_removed), NULL);
86
87+ DbusmenuServer * dmserver = dbusmenu_server_new("/dbusmenu/path");
88+ DbusmenuMenuitem * root = dbusmenu_menuitem_new();
89+ dbusmenu_server_set_root(dmserver, root);
90+ DbusmenuMenuitem * item;
91+
92+ item = dbusmenu_menuitem_new();
93+ dbusmenu_menuitem_property_set(item, DBUSMENU_MENUITEM_PROP_LABEL, "Label 1");
94+ dbusmenu_menuitem_child_append(root, item);
95+ g_signal_connect(G_OBJECT(item), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(menuitem_click), "Label 1");
96+
97+ item = dbusmenu_menuitem_new();
98+ dbusmenu_menuitem_property_set(item, DBUSMENU_MENUITEM_PROP_LABEL, "Label 2");
99+ dbusmenu_menuitem_child_append(root, item);
100+ g_signal_connect(G_OBJECT(item), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(menuitem_click), "Label 2");
101+
102+ indicate_server_set_menu(server, dmserver);
103+
104 IndicateIndicator * indicator;
105
106 indicator = indicate_indicator_new();
107
108=== modified file 'libindicate/listener.c'
109--- libindicate/listener.c 2010-02-10 14:44:22 +0000
110+++ libindicate/listener.c 2010-02-18 15:29:09 +0000
111@@ -712,6 +712,7 @@
112
113 typedef enum _get_property_type get_property_type;
114 enum _get_property_type {
115+ PROPERTY_TYPE_VALUE,
116 PROPERTY_TYPE_STRING,
117 PROPERTY_TYPE_TIME,
118 PROPERTY_TYPE_INT,
119@@ -749,6 +750,12 @@
120 }
121
122 switch (get_property_data->type) {
123+ case PROPERTY_TYPE_VALUE: {
124+ /* Just pass the GValue along. */
125+ indicate_listener_get_property_value_cb cb =(indicate_listener_get_property_value_cb)get_property_data->cb;
126+ cb(get_property_data->listener, get_property_data->server, get_property_data->indicator, get_property_data->property, &OUT_value, get_property_data->data);
127+ break;
128+ }
129 case PROPERTY_TYPE_STRING: {
130 /* Just pass the string along. */
131 indicate_listener_get_property_cb cb = (indicate_listener_get_property_cb)get_property_data->cb;
132@@ -807,6 +814,27 @@
133 }
134
135 /**
136+ indicate_listener_get_property_value:
137+ @listener: The #IndicateListener representing the connection
138+ @server: The server that the indicator is on
139+ @indicator: Which indicator is being queried
140+ @property: Name of the property to get
141+ @callback: The callback function to call with the data
142+ @data: Arbitrary data to give the callback
143+
144+ A function to get a property from an indicator on a server
145+ and bring it back locally. This wraps all the hassle of using
146+ the DBus API and makes it pretty easy to get properties.
147+
148+ This function gets the raw gvalue data, without any conversion.
149+*/
150+void
151+indicate_listener_get_property_value (IndicateListener * listener, IndicateListenerServer * server, IndicateListenerIndicator * indicator, gchar * property, indicate_listener_get_property_value_cb callback, gpointer data)
152+{
153+ return get_property_helper(listener, server, indicator, property, G_CALLBACK(callback), data, PROPERTY_TYPE_VALUE);
154+}
155+
156+/**
157 indicate_listener_get_property:
158 @listener: The #IndicateListener representing the connection
159 @server: The server that the indicator is on
160
161=== modified file 'libindicate/listener.h'
162--- libindicate/listener.h 2010-02-04 22:41:43 +0000
163+++ libindicate/listener.h 2010-02-18 15:29:09 +0000
164@@ -111,6 +111,7 @@
165
166 GType indicate_listener_get_type (void) G_GNUC_CONST;
167
168+typedef void (*indicate_listener_get_property_value_cb) (IndicateListener * listener, IndicateListenerServer * server, IndicateListenerIndicator * indicator, gchar * property, const GValue * propertydata, gpointer data);
169 typedef void (*indicate_listener_get_property_cb) (IndicateListener * listener, IndicateListenerServer * server, IndicateListenerIndicator * indicator, gchar * property, const gchar * propertydata, gpointer data);
170 typedef void (*indicate_listener_get_property_time_cb) (IndicateListener * listener, IndicateListenerServer * server, IndicateListenerIndicator * indicator, gchar * property, const GTimeVal * propertydata, gpointer data);
171 typedef void (*indicate_listener_get_property_int_cb) (IndicateListener * listener, IndicateListenerServer * server, IndicateListenerIndicator * indicator, gchar * property, gint propertydata, gpointer data);
172@@ -121,6 +122,12 @@
173 /* Create a new listener */
174 IndicateListener * indicate_listener_new (void);
175 IndicateListener * indicate_listener_ref_default (void);
176+void indicate_listener_get_property_value (IndicateListener * listener,
177+ IndicateListenerServer * server,
178+ IndicateListenerIndicator * indicator,
179+ gchar * property,
180+ indicate_listener_get_property_value_cb callback,
181+ gpointer data);
182 void indicate_listener_get_property (IndicateListener * listener,
183 IndicateListenerServer * server,
184 IndicateListenerIndicator * indicator,
185
186=== modified file 'libindicate/server.c'
187--- libindicate/server.c 2010-02-10 14:27:48 +0000
188+++ libindicate/server.c 2010-02-18 15:29:09 +0000
189@@ -52,6 +52,7 @@
190 REMOVE_INTEREST_FAILED,
191 NO_MAX_INDICATORS_SET,
192 MAX_INDICATORS_SET_FAILED,
193+ NO_SUCH_PROPERTY,
194 LAST_ERROR
195 };
196
197@@ -1259,6 +1260,13 @@
198
199 const GValue * ind_property = indicate_indicator_get_property_value(indicator, property);
200 if (ind_property == NULL) {
201+ if (error != NULL) {
202+ g_set_error(error,
203+ indicate_server_error_quark(),
204+ NO_SUCH_PROPERTY,
205+ "Indicator %d has no property named '%s'",
206+ id, property);
207+ }
208 return FALSE;
209 }
210
211
212=== modified file 'tests/Makefile.am'
213--- tests/Makefile.am 2010-02-04 22:41:43 +0000
214+++ tests/Makefile.am 2010-02-18 15:29:09 +0000
215@@ -267,7 +267,7 @@
216
217 test-max-indicators-repeat: test-max-indicators-client test-max-indicators-server-repeat Makefile.am
218 @echo "#!/bin/sh" > $@
219- @echo "$(DBUS_RUNNER) --task ./test-max-indicators-client --task-name Client --task ./test-max-indicators-server-repeat --task-name Server" >> $@
220+ @echo "$(DBUS_RUNNER) --task ./test-max-indicators-client --task-name Client --task ./test-max-indicators-server-repeat --task-name Server --ignore-return " >> $@
221 @chmod +x $@
222
223 test_max_indicators_server_repeat_SOURCES = \

Subscribers

People subscribed via source and target branches

to all changes: