Merge lp:~indicator-applet-developers/indicator-session/ubuntu into lp:~ubuntu-desktop/indicator-session/ubuntu
- ubuntu
- Merge into ubuntu
Proposed by
Ted Gould
Status: | Merged |
---|---|
Merged at revision: | not available |
Proposed branch: | lp:~indicator-applet-developers/indicator-session/ubuntu |
Merge into: | lp:~ubuntu-desktop/indicator-session/ubuntu |
Diff against target: |
4531 lines (+358/-3631) 44 files modified
configure.ac (+5/-23) data/Makefile.am (+1/-2) data/icons/16x16/Makefile.am (+1/-1) data/icons/16x16/status/Makefile.am (+0/-11) data/icons/22x22/Makefile.am (+1/-1) data/icons/22x22/status/Makefile.am (+0/-11) data/icons/24x24/Makefile.am (+1/-1) data/icons/24x24/status/Makefile.am (+0/-11) data/icons/32x32/Makefile.am (+1/-1) data/icons/32x32/status/Makefile.am (+0/-11) data/icons/48x48/Makefile.am (+0/-1) data/icons/48x48/status/Makefile.am (+0/-11) data/icons/Makefile.am (+1/-1) data/icons/scalable/Makefile.am (+1/-1) data/icons/scalable/status/Makefile.am (+0/-11) data/icons/scalable/status/user-available.svg (+0/-104) data/icons/scalable/status/user-away.svg (+0/-93) data/icons/scalable/status/user-busy.svg (+0/-140) data/icons/scalable/status/user-invisible.svg (+0/-78) data/icons/scalable/status/user-offline.svg (+0/-101) data/indicator-status.service.in (+0/-3) debian/changelog (+28/-0) debian/control (+2/-2) po/POTFILES.in (+0/-6) src/Makefile.am (+6/-102) src/dbus-shared-names.h (+1/-0) src/indicator-session.c (+17/-512) src/session-service.c (+292/-26) src/status-provider-mc5.c (+0/-322) src/status-provider-mc5.h (+0/-56) src/status-provider-mc5.list (+0/-1) src/status-provider-pidgin.c (+0/-431) src/status-provider-pidgin.h (+0/-56) src/status-provider-pidgin.list (+0/-1) src/status-provider-telepathy.c (+0/-383) src/status-provider-telepathy.h (+0/-56) src/status-provider-telepathy.list (+0/-1) src/status-provider.c (+0/-101) src/status-provider.h (+0/-78) src/status-service-dbus.c (+0/-205) src/status-service-dbus.h (+0/-59) src/status-service.c (+0/-265) src/status-service.xml (+0/-25) src/users-service.c (+0/-326) |
To merge this branch: | bzr merge lp:~indicator-applet-developers/indicator-session/ubuntu |
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Indicator Applet Developers | Pending | ||
Review via email: mp+17024@code.launchpad.net |
Commit message
Description of the change
To post a comment you must log in.
Revision history for this message
Ted Gould (ted) wrote : | # |
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'configure.ac' |
2 | --- configure.ac 2009-12-10 15:47:52 +0000 |
3 | +++ configure.ac 2010-01-08 15:36:21 +0000 |
4 | @@ -4,7 +4,7 @@ |
5 | AC_PREREQ(2.53) |
6 | |
7 | AM_CONFIG_HEADER(config.h) |
8 | -AM_INIT_AUTOMAKE(indicator-session, 0.1.7) |
9 | +AM_INIT_AUTOMAKE(indicator-session, 0.2.0) |
10 | |
11 | AM_MAINTAINER_MODE |
12 | |
13 | @@ -27,7 +27,7 @@ |
14 | |
15 | GTK_REQUIRED_VERSION=2.12 |
16 | INDICATOR_REQUIRED_VERSION=0.3.0 |
17 | -DBUSMENUGTK_REQUIRED_VERSION=0.1.1 |
18 | +DBUSMENUGTK_REQUIRED_VERSION=0.2.0 |
19 | POLKIT_REQUIRED_VERSION=0.92 |
20 | |
21 | PKG_CHECK_MODULES(APPLET, gtk+-2.0 >= $GTK_REQUIRED_VERSION |
22 | @@ -37,20 +37,9 @@ |
23 | AC_SUBST(APPLET_LIBS) |
24 | |
25 | DBUSMENUGLIB_REQUIRED_VERSION=0.1.1 |
26 | -TELEPATHYGLIB_REQUIRED_VERSION=0.9.0 |
27 | - |
28 | -PKG_CHECK_MODULES(STATUSSERVICE, dbusmenu-glib >= $DBUSMENUGLIB_REQUIRED_VERSION |
29 | - telepathy-glib >= $TELEPATHYGLIB_REQUIRED_VERSION) |
30 | - |
31 | -AC_SUBST(STATUSERVICE_CFLAGS) |
32 | -AC_SUBST(STATUSERVICE_LIBS) |
33 | - |
34 | -PKG_CHECK_MODULES(USERSSERVICE, dbusmenu-glib >= $DBUSMENUGLIB_REQUIRED_VERSION) |
35 | - |
36 | -AC_SUBST(USERSERVICE_CFLAGS) |
37 | -AC_SUBST(USERSERVICE_LIBS) |
38 | - |
39 | -PKG_CHECK_MODULES(SESSIONSERVICE, dbusmenu-glib >= $DBUSMENUGLIB_REQUIRED_VERSION) |
40 | + |
41 | +PKG_CHECK_MODULES(SESSIONSERVICE, dbusmenu-glib >= $DBUSMENUGLIB_REQUIRED_VERSION |
42 | + indicator >= $INDICATOR_REQUIRED_VERSION) |
43 | |
44 | AC_SUBST(SESSIONERVICE_CFLAGS) |
45 | AC_SUBST(SESSIONERVICE_LIBS) |
46 | @@ -142,21 +131,14 @@ |
47 | data/Makefile |
48 | data/icons/Makefile |
49 | data/icons/16x16/Makefile |
50 | -data/icons/16x16/status/Makefile |
51 | data/icons/16x16/actions/Makefile |
52 | data/icons/22x22/Makefile |
53 | -data/icons/22x22/status/Makefile |
54 | data/icons/22x22/actions/Makefile |
55 | data/icons/24x24/Makefile |
56 | -data/icons/24x24/status/Makefile |
57 | data/icons/24x24/actions/Makefile |
58 | data/icons/32x32/Makefile |
59 | -data/icons/32x32/status/Makefile |
60 | data/icons/32x32/actions/Makefile |
61 | -data/icons/48x48/Makefile |
62 | -data/icons/48x48/status/Makefile |
63 | data/icons/scalable/Makefile |
64 | -data/icons/scalable/status/Makefile |
65 | data/icons/scalable/actions/Makefile |
66 | po/Makefile.in |
67 | ]) |
68 | |
69 | === modified file 'data/Makefile.am' |
70 | --- data/Makefile.am 2009-09-02 14:17:44 +0000 |
71 | +++ data/Makefile.am 2010-01-08 15:36:21 +0000 |
72 | @@ -1,8 +1,7 @@ |
73 | SUBDIRS = icons |
74 | |
75 | dbus_servicesdir = $(DBUSSERVICEDIR) |
76 | -service_in_files = indicator-status.service.in \ |
77 | - indicator-users.service.in \ |
78 | +service_in_files = indicator-users.service.in \ |
79 | indicator-session.service.in |
80 | dbus_services_DATA = $(service_in_files:.service.in=.service) |
81 | |
82 | |
83 | === modified file 'data/icons/16x16/Makefile.am' |
84 | --- data/icons/16x16/Makefile.am 2009-08-07 19:10:15 +0000 |
85 | +++ data/icons/16x16/Makefile.am 2010-01-08 15:36:21 +0000 |
86 | @@ -1,1 +1,1 @@ |
87 | -SUBDIRS = status actions |
88 | +SUBDIRS = actions |
89 | |
90 | === removed directory 'data/icons/16x16/status' |
91 | === removed file 'data/icons/16x16/status/Makefile.am' |
92 | --- data/icons/16x16/status/Makefile.am 2009-09-17 16:05:10 +0000 |
93 | +++ data/icons/16x16/status/Makefile.am 1970-01-01 00:00:00 +0000 |
94 | @@ -1,11 +0,0 @@ |
95 | - |
96 | -iconsdir = $(INDICATORICONSDIR)/hicolor/16x16/status |
97 | - |
98 | -icons_DATA = \ |
99 | - user-available.png \ |
100 | - user-offline.png \ |
101 | - user-away.png \ |
102 | - user-busy.png \ |
103 | - user-invisible.png |
104 | - |
105 | -EXTRA_DIST = $(icons_DATA) |
106 | |
107 | === removed file 'data/icons/16x16/status/user-available.png' |
108 | Binary files data/icons/16x16/status/user-available.png 2009-09-16 20:59:37 +0000 and data/icons/16x16/status/user-available.png 1970-01-01 00:00:00 +0000 differ |
109 | === removed file 'data/icons/16x16/status/user-away.png' |
110 | Binary files data/icons/16x16/status/user-away.png 2009-08-07 19:10:15 +0000 and data/icons/16x16/status/user-away.png 1970-01-01 00:00:00 +0000 differ |
111 | === removed file 'data/icons/16x16/status/user-busy.png' |
112 | Binary files data/icons/16x16/status/user-busy.png 2009-08-07 19:10:15 +0000 and data/icons/16x16/status/user-busy.png 1970-01-01 00:00:00 +0000 differ |
113 | === removed file 'data/icons/16x16/status/user-invisible.png' |
114 | Binary files data/icons/16x16/status/user-invisible.png 2009-08-07 19:10:15 +0000 and data/icons/16x16/status/user-invisible.png 1970-01-01 00:00:00 +0000 differ |
115 | === removed file 'data/icons/16x16/status/user-offline.png' |
116 | Binary files data/icons/16x16/status/user-offline.png 2009-08-07 19:10:15 +0000 and data/icons/16x16/status/user-offline.png 1970-01-01 00:00:00 +0000 differ |
117 | === modified file 'data/icons/22x22/Makefile.am' |
118 | --- data/icons/22x22/Makefile.am 2009-08-07 19:10:15 +0000 |
119 | +++ data/icons/22x22/Makefile.am 2010-01-08 15:36:21 +0000 |
120 | @@ -1,1 +1,1 @@ |
121 | -SUBDIRS = status actions |
122 | +SUBDIRS = actions |
123 | |
124 | === removed directory 'data/icons/22x22/status' |
125 | === removed file 'data/icons/22x22/status/Makefile.am' |
126 | --- data/icons/22x22/status/Makefile.am 2009-09-17 16:05:10 +0000 |
127 | +++ data/icons/22x22/status/Makefile.am 1970-01-01 00:00:00 +0000 |
128 | @@ -1,11 +0,0 @@ |
129 | - |
130 | -iconsdir = $(INDICATORICONSDIR)/hicolor/22x22/status |
131 | - |
132 | -icons_DATA = \ |
133 | - user-available.png \ |
134 | - user-offline.png \ |
135 | - user-away.png \ |
136 | - user-busy.png \ |
137 | - user-invisible.png |
138 | - |
139 | -EXTRA_DIST = $(icons_DATA) |
140 | |
141 | === removed file 'data/icons/22x22/status/user-available.png' |
142 | Binary files data/icons/22x22/status/user-available.png 2009-09-16 20:59:37 +0000 and data/icons/22x22/status/user-available.png 1970-01-01 00:00:00 +0000 differ |
143 | === removed file 'data/icons/22x22/status/user-away.png' |
144 | Binary files data/icons/22x22/status/user-away.png 2009-08-07 19:10:15 +0000 and data/icons/22x22/status/user-away.png 1970-01-01 00:00:00 +0000 differ |
145 | === removed file 'data/icons/22x22/status/user-busy.png' |
146 | Binary files data/icons/22x22/status/user-busy.png 2009-08-07 19:10:15 +0000 and data/icons/22x22/status/user-busy.png 1970-01-01 00:00:00 +0000 differ |
147 | === removed file 'data/icons/22x22/status/user-invisible.png' |
148 | Binary files data/icons/22x22/status/user-invisible.png 2009-08-07 19:10:15 +0000 and data/icons/22x22/status/user-invisible.png 1970-01-01 00:00:00 +0000 differ |
149 | === removed file 'data/icons/22x22/status/user-offline.png' |
150 | Binary files data/icons/22x22/status/user-offline.png 2009-08-07 19:10:15 +0000 and data/icons/22x22/status/user-offline.png 1970-01-01 00:00:00 +0000 differ |
151 | === modified file 'data/icons/24x24/Makefile.am' |
152 | --- data/icons/24x24/Makefile.am 2009-08-07 19:10:15 +0000 |
153 | +++ data/icons/24x24/Makefile.am 2010-01-08 15:36:21 +0000 |
154 | @@ -1,1 +1,1 @@ |
155 | -SUBDIRS = status actions |
156 | +SUBDIRS = actions |
157 | |
158 | === removed directory 'data/icons/24x24/status' |
159 | === removed file 'data/icons/24x24/status/Makefile.am' |
160 | --- data/icons/24x24/status/Makefile.am 2009-09-17 16:05:10 +0000 |
161 | +++ data/icons/24x24/status/Makefile.am 1970-01-01 00:00:00 +0000 |
162 | @@ -1,11 +0,0 @@ |
163 | - |
164 | -iconsdir = $(INDICATORICONSDIR)/hicolor/24x24/status |
165 | - |
166 | -icons_DATA = \ |
167 | - user-available.png \ |
168 | - user-offline.png \ |
169 | - user-away.png \ |
170 | - user-busy.png \ |
171 | - user-invisible.png |
172 | - |
173 | -EXTRA_DIST = $(icons_DATA) |
174 | |
175 | === removed file 'data/icons/24x24/status/user-available.png' |
176 | Binary files data/icons/24x24/status/user-available.png 2009-09-16 20:59:37 +0000 and data/icons/24x24/status/user-available.png 1970-01-01 00:00:00 +0000 differ |
177 | === removed file 'data/icons/24x24/status/user-away.png' |
178 | Binary files data/icons/24x24/status/user-away.png 2009-08-07 19:10:15 +0000 and data/icons/24x24/status/user-away.png 1970-01-01 00:00:00 +0000 differ |
179 | === removed file 'data/icons/24x24/status/user-busy.png' |
180 | Binary files data/icons/24x24/status/user-busy.png 2009-08-07 19:10:15 +0000 and data/icons/24x24/status/user-busy.png 1970-01-01 00:00:00 +0000 differ |
181 | === removed file 'data/icons/24x24/status/user-invisible.png' |
182 | Binary files data/icons/24x24/status/user-invisible.png 2009-08-07 19:10:15 +0000 and data/icons/24x24/status/user-invisible.png 1970-01-01 00:00:00 +0000 differ |
183 | === removed file 'data/icons/24x24/status/user-offline.png' |
184 | Binary files data/icons/24x24/status/user-offline.png 2009-08-07 19:10:15 +0000 and data/icons/24x24/status/user-offline.png 1970-01-01 00:00:00 +0000 differ |
185 | === modified file 'data/icons/32x32/Makefile.am' |
186 | --- data/icons/32x32/Makefile.am 2009-08-07 19:10:15 +0000 |
187 | +++ data/icons/32x32/Makefile.am 2010-01-08 15:36:21 +0000 |
188 | @@ -1,1 +1,1 @@ |
189 | -SUBDIRS = status actions |
190 | +SUBDIRS = actions |
191 | |
192 | === removed directory 'data/icons/32x32/status' |
193 | === removed file 'data/icons/32x32/status/Makefile.am' |
194 | --- data/icons/32x32/status/Makefile.am 2009-09-17 16:05:10 +0000 |
195 | +++ data/icons/32x32/status/Makefile.am 1970-01-01 00:00:00 +0000 |
196 | @@ -1,11 +0,0 @@ |
197 | - |
198 | -iconsdir = $(INDICATORICONSDIR)/hicolor/32x32/status |
199 | - |
200 | -icons_DATA = \ |
201 | - user-available.png \ |
202 | - user-offline.png \ |
203 | - user-away.png \ |
204 | - user-busy.png \ |
205 | - user-invisible.png |
206 | - |
207 | -EXTRA_DIST = $(icons_DATA) |
208 | |
209 | === removed file 'data/icons/32x32/status/user-available.png' |
210 | Binary files data/icons/32x32/status/user-available.png 2009-09-16 20:59:37 +0000 and data/icons/32x32/status/user-available.png 1970-01-01 00:00:00 +0000 differ |
211 | === removed file 'data/icons/32x32/status/user-away.png' |
212 | Binary files data/icons/32x32/status/user-away.png 2009-08-07 19:10:15 +0000 and data/icons/32x32/status/user-away.png 1970-01-01 00:00:00 +0000 differ |
213 | === removed file 'data/icons/32x32/status/user-busy.png' |
214 | Binary files data/icons/32x32/status/user-busy.png 2009-08-07 19:10:15 +0000 and data/icons/32x32/status/user-busy.png 1970-01-01 00:00:00 +0000 differ |
215 | === removed file 'data/icons/32x32/status/user-invisible.png' |
216 | Binary files data/icons/32x32/status/user-invisible.png 2009-08-07 19:10:15 +0000 and data/icons/32x32/status/user-invisible.png 1970-01-01 00:00:00 +0000 differ |
217 | === removed file 'data/icons/32x32/status/user-offline.png' |
218 | Binary files data/icons/32x32/status/user-offline.png 2009-08-07 19:10:15 +0000 and data/icons/32x32/status/user-offline.png 1970-01-01 00:00:00 +0000 differ |
219 | === removed directory 'data/icons/48x48' |
220 | === removed file 'data/icons/48x48/Makefile.am' |
221 | --- data/icons/48x48/Makefile.am 2009-08-07 19:10:15 +0000 |
222 | +++ data/icons/48x48/Makefile.am 1970-01-01 00:00:00 +0000 |
223 | @@ -1,1 +0,0 @@ |
224 | -SUBDIRS = status |
225 | |
226 | === removed directory 'data/icons/48x48/status' |
227 | === removed file 'data/icons/48x48/status/Makefile.am' |
228 | --- data/icons/48x48/status/Makefile.am 2009-09-17 16:05:10 +0000 |
229 | +++ data/icons/48x48/status/Makefile.am 1970-01-01 00:00:00 +0000 |
230 | @@ -1,11 +0,0 @@ |
231 | - |
232 | -iconsdir = $(INDICATORICONSDIR)/hicolor/48x48/status |
233 | - |
234 | -icons_DATA = \ |
235 | - user-available.png \ |
236 | - user-offline.png \ |
237 | - user-away.png \ |
238 | - user-busy.png \ |
239 | - user-invisible.png |
240 | - |
241 | -EXTRA_DIST = $(icons_DATA) |
242 | |
243 | === removed file 'data/icons/48x48/status/user-available.png' |
244 | Binary files data/icons/48x48/status/user-available.png 2009-09-16 20:59:37 +0000 and data/icons/48x48/status/user-available.png 1970-01-01 00:00:00 +0000 differ |
245 | === removed file 'data/icons/48x48/status/user-away.png' |
246 | Binary files data/icons/48x48/status/user-away.png 2009-08-07 19:10:15 +0000 and data/icons/48x48/status/user-away.png 1970-01-01 00:00:00 +0000 differ |
247 | === removed file 'data/icons/48x48/status/user-busy.png' |
248 | Binary files data/icons/48x48/status/user-busy.png 2009-08-07 19:10:15 +0000 and data/icons/48x48/status/user-busy.png 1970-01-01 00:00:00 +0000 differ |
249 | === removed file 'data/icons/48x48/status/user-invisible.png' |
250 | Binary files data/icons/48x48/status/user-invisible.png 2009-08-07 19:10:15 +0000 and data/icons/48x48/status/user-invisible.png 1970-01-01 00:00:00 +0000 differ |
251 | === removed file 'data/icons/48x48/status/user-offline.png' |
252 | Binary files data/icons/48x48/status/user-offline.png 2009-08-07 19:10:15 +0000 and data/icons/48x48/status/user-offline.png 1970-01-01 00:00:00 +0000 differ |
253 | === modified file 'data/icons/Makefile.am' |
254 | --- data/icons/Makefile.am 2009-08-08 15:39:29 +0000 |
255 | +++ data/icons/Makefile.am 2010-01-08 15:36:21 +0000 |
256 | @@ -1,4 +1,4 @@ |
257 | -SUBDIRS = scalable 16x16 22x22 24x24 32x32 48x48 |
258 | +SUBDIRS = scalable 16x16 22x22 24x24 32x32 |
259 | |
260 | gtk_update_icon_cache = gtk-update-icon-cache -f -t $(INDICATORICONSDIR)/hicolor |
261 | |
262 | |
263 | === modified file 'data/icons/scalable/Makefile.am' |
264 | --- data/icons/scalable/Makefile.am 2009-08-07 19:10:15 +0000 |
265 | +++ data/icons/scalable/Makefile.am 2010-01-08 15:36:21 +0000 |
266 | @@ -1,1 +1,1 @@ |
267 | -SUBDIRS = status actions |
268 | +SUBDIRS = actions |
269 | |
270 | === removed directory 'data/icons/scalable/status' |
271 | === removed file 'data/icons/scalable/status/Makefile.am' |
272 | --- data/icons/scalable/status/Makefile.am 2009-09-17 16:05:10 +0000 |
273 | +++ data/icons/scalable/status/Makefile.am 1970-01-01 00:00:00 +0000 |
274 | @@ -1,11 +0,0 @@ |
275 | - |
276 | -iconsdir = $(INDICATORICONSDIR)/hicolor/scalable/status |
277 | - |
278 | -icons_DATA = \ |
279 | - user-available.svg \ |
280 | - user-offline.svg \ |
281 | - user-away.svg \ |
282 | - user-busy.svg \ |
283 | - user-invisible.svg |
284 | - |
285 | -EXTRA_DIST = $(icons_DATA) |
286 | |
287 | === removed file 'data/icons/scalable/status/user-available.svg' |
288 | --- data/icons/scalable/status/user-available.svg 2009-09-16 20:59:37 +0000 |
289 | +++ data/icons/scalable/status/user-available.svg 1970-01-01 00:00:00 +0000 |
290 | @@ -1,104 +0,0 @@ |
291 | -<?xml version="1.0" encoding="UTF-8" standalone="no"?> |
292 | -<!-- Created with Inkscape (http://www.inkscape.org/) --> |
293 | -<svg |
294 | - xmlns:dc="http://purl.org/dc/elements/1.1/" |
295 | - xmlns:cc="http://web.resource.org/cc/" |
296 | - xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" |
297 | - xmlns:svg="http://www.w3.org/2000/svg" |
298 | - xmlns="http://www.w3.org/2000/svg" |
299 | - xmlns:xlink="http://www.w3.org/1999/xlink" |
300 | - xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" |
301 | - xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" |
302 | - width="16px" |
303 | - height="16px" |
304 | - id="svg4908" |
305 | - sodipodi:version="0.32" |
306 | - inkscape:version="0.44+devel" |
307 | - sodipodi:docbase="/home/andreas/project/gossip/16x16" |
308 | - sodipodi:docname="status-avaible.svg" |
309 | - inkscape:output_extension="org.inkscape.output.svg.inkscape" |
310 | - inkscape:export-filename="/home/andreas/project/gossip/16x16/status-avaible.png" |
311 | - inkscape:export-xdpi="90" |
312 | - inkscape:export-ydpi="90" |
313 | - sodipodi:modified="true"> |
314 | - <defs |
315 | - id="defs4910"> |
316 | - <linearGradient |
317 | - inkscape:collect="always" |
318 | - id="linearGradient5899"> |
319 | - <stop |
320 | - style="stop-color:#7fe719;stop-opacity:1" |
321 | - offset="0" |
322 | - id="stop5901" /> |
323 | - <stop |
324 | - style="stop-color:#67bc13;stop-opacity:1" |
325 | - offset="1" |
326 | - id="stop5903" /> |
327 | - </linearGradient> |
328 | - <radialGradient |
329 | - inkscape:collect="always" |
330 | - xlink:href="#linearGradient5899" |
331 | - id="radialGradient5905" |
332 | - cx="9.466115" |
333 | - cy="8.9839392" |
334 | - fx="9.466115" |
335 | - fy="8.9839392" |
336 | - r="6.7474474" |
337 | - gradientTransform="matrix(1.1671849,-3.2679277e-3,2.7524467e-3,1.0150183,-1.6222549,-0.2024225)" |
338 | - gradientUnits="userSpaceOnUse" /> |
339 | - </defs> |
340 | - <sodipodi:namedview |
341 | - id="base" |
342 | - pagecolor="#ffffff" |
343 | - bordercolor="#666666" |
344 | - borderopacity="1.0" |
345 | - inkscape:pageopacity="0.0" |
346 | - inkscape:pageshadow="2" |
347 | - inkscape:zoom="22.197802" |
348 | - inkscape:cx="14.452639" |
349 | - inkscape:cy="6.4458104" |
350 | - inkscape:current-layer="layer1" |
351 | - showgrid="false" |
352 | - inkscape:grid-bbox="true" |
353 | - inkscape:document-units="px" |
354 | - inkscape:window-width="1674" |
355 | - inkscape:window-height="969" |
356 | - inkscape:window-x="0" |
357 | - inkscape:window-y="26" /> |
358 | - <metadata |
359 | - id="metadata4913"> |
360 | - <rdf:RDF> |
361 | - <cc:Work |
362 | - rdf:about=""> |
363 | - <dc:format>image/svg+xml</dc:format> |
364 | - <dc:type |
365 | - rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> |
366 | - </cc:Work> |
367 | - </rdf:RDF> |
368 | - </metadata> |
369 | - <g |
370 | - id="layer1" |
371 | - inkscape:label="Layer 1" |
372 | - inkscape:groupmode="layer"> |
373 | - <path |
374 | - sodipodi:type="arc" |
375 | - style="opacity:1;fill:url(#radialGradient5905);fill-opacity:1;stroke:#376e01;stroke-width:0.97113216;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" |
376 | - id="path4926" |
377 | - sodipodi:cx="7.9737625" |
378 | - sodipodi:cy="7.7221532" |
379 | - sodipodi:rx="6.2618814" |
380 | - sodipodi:ry="6.3632426" |
381 | - d="M 14.235644 7.7221532 A 6.2618814 6.3632426 0 1 1 1.7118812,7.7221532 A 6.2618814 6.3632426 0 1 1 14.235644 7.7221532 z" |
382 | - transform="matrix(1.0380267,0,0,1.0214918,-0.2769783,0.1118841)" /> |
383 | - <path |
384 | - sodipodi:type="arc" |
385 | - style="opacity:0.4;fill:none;fill-opacity:1;stroke:#ffffff;stroke-width:1.14770162;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" |
386 | - id="path5897" |
387 | - sodipodi:cx="7.9737625" |
388 | - sodipodi:cy="7.7221532" |
389 | - sodipodi:rx="6.2618814" |
390 | - sodipodi:ry="6.3632426" |
391 | - d="M 14.235644 7.7221532 A 6.2618814 6.3632426 0 1 1 1.7118812,7.7221532 A 6.2618814 6.3632426 0 1 1 14.235644 7.7221532 z" |
392 | - transform="matrix(0.8783303,0,0,0.8643392,0.996403,1.3254404)" /> |
393 | - </g> |
394 | -</svg> |
395 | |
396 | === removed file 'data/icons/scalable/status/user-away.svg' |
397 | --- data/icons/scalable/status/user-away.svg 2009-08-07 19:10:15 +0000 |
398 | +++ data/icons/scalable/status/user-away.svg 1970-01-01 00:00:00 +0000 |
399 | @@ -1,93 +0,0 @@ |
400 | -<?xml version="1.0" encoding="UTF-8" standalone="no"?> |
401 | -<!-- Created with Inkscape (http://www.inkscape.org/) --> |
402 | -<svg |
403 | - xmlns:dc="http://purl.org/dc/elements/1.1/" |
404 | - xmlns:cc="http://web.resource.org/cc/" |
405 | - xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" |
406 | - xmlns:svg="http://www.w3.org/2000/svg" |
407 | - xmlns="http://www.w3.org/2000/svg" |
408 | - xmlns:xlink="http://www.w3.org/1999/xlink" |
409 | - xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" |
410 | - xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" |
411 | - width="16px" |
412 | - height="16px" |
413 | - id="svg4908" |
414 | - sodipodi:version="0.32" |
415 | - inkscape:version="0.44+devel" |
416 | - sodipodi:docbase="/home/andreas/project/gossip/16x16" |
417 | - sodipodi:docname="status-away.svg" |
418 | - inkscape:output_extension="org.inkscape.output.svg.inkscape" |
419 | - inkscape:export-filename="/home/andreas/project/gossip/16x16/status-away.png" |
420 | - inkscape:export-xdpi="90" |
421 | - inkscape:export-ydpi="90" |
422 | - sodipodi:modified="true"> |
423 | - <defs |
424 | - id="defs4910"> |
425 | - <linearGradient |
426 | - inkscape:collect="always" |
427 | - id="linearGradient5917"> |
428 | - <stop |
429 | - style="stop-color:#f80000;stop-opacity:1" |
430 | - offset="0" |
431 | - id="stop5919" /> |
432 | - <stop |
433 | - style="stop-color:#e70000;stop-opacity:1" |
434 | - offset="1" |
435 | - id="stop5921" /> |
436 | - </linearGradient> |
437 | - <linearGradient |
438 | - inkscape:collect="always" |
439 | - xlink:href="#linearGradient5917" |
440 | - id="linearGradient5923" |
441 | - x1="6.5096536" |
442 | - y1="8.5893564" |
443 | - x2="9.9108915" |
444 | - y2="11.540099" |
445 | - gradientUnits="userSpaceOnUse" |
446 | - gradientTransform="matrix(1,0,0,0.9925682,6.043956e-8,1.1147803e-2)" /> |
447 | - </defs> |
448 | - <sodipodi:namedview |
449 | - id="base" |
450 | - pagecolor="#ffffff" |
451 | - bordercolor="#666666" |
452 | - borderopacity="1.0" |
453 | - inkscape:pageopacity="0.0" |
454 | - inkscape:pageshadow="2" |
455 | - inkscape:zoom="22.627417" |
456 | - inkscape:cx="13.206814" |
457 | - inkscape:cy="4.0564985" |
458 | - inkscape:current-layer="layer1" |
459 | - showgrid="false" |
460 | - inkscape:grid-bbox="true" |
461 | - inkscape:document-units="px" |
462 | - inkscape:window-width="1674" |
463 | - inkscape:window-height="969" |
464 | - inkscape:window-x="0" |
465 | - inkscape:window-y="26" /> |
466 | - <metadata |
467 | - id="metadata4913"> |
468 | - <rdf:RDF> |
469 | - <cc:Work |
470 | - rdf:about=""> |
471 | - <dc:format>image/svg+xml</dc:format> |
472 | - <dc:type |
473 | - rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> |
474 | - </cc:Work> |
475 | - </rdf:RDF> |
476 | - </metadata> |
477 | - <g |
478 | - id="layer1" |
479 | - inkscape:label="Layer 1" |
480 | - inkscape:groupmode="layer"> |
481 | - <path |
482 | - style="fill:url(#linearGradient5923);fill-opacity:1;fill-rule:evenodd;stroke:#8a0000;stroke-width:0.99999988px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1" |
483 | - d="M 1.5,13.5 L 14.499999,13.5 L 7.9789933,1.4999999 L 1.5,13.5 z " |
484 | - id="path4944" |
485 | - sodipodi:nodetypes="cccc" /> |
486 | - <path |
487 | - style="opacity:0.3;fill:none;fill-rule:evenodd;stroke:#ffffff;stroke-width:1.00000012px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" |
488 | - d="M 3.2186016,12.488535 L 12.832121,12.488535 L 8.0098272,3.5671249 L 3.2186016,12.488535 z " |
489 | - id="path4946" |
490 | - sodipodi:nodetypes="cccc" /> |
491 | - </g> |
492 | -</svg> |
493 | |
494 | === removed file 'data/icons/scalable/status/user-busy.svg' |
495 | --- data/icons/scalable/status/user-busy.svg 2009-08-07 19:10:15 +0000 |
496 | +++ data/icons/scalable/status/user-busy.svg 1970-01-01 00:00:00 +0000 |
497 | @@ -1,140 +0,0 @@ |
498 | -<?xml version="1.0" encoding="UTF-8" standalone="no"?> |
499 | -<!-- Created with Inkscape (http://www.inkscape.org/) --> |
500 | -<svg |
501 | - xmlns:dc="http://purl.org/dc/elements/1.1/" |
502 | - xmlns:cc="http://web.resource.org/cc/" |
503 | - xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" |
504 | - xmlns:svg="http://www.w3.org/2000/svg" |
505 | - xmlns="http://www.w3.org/2000/svg" |
506 | - xmlns:xlink="http://www.w3.org/1999/xlink" |
507 | - xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" |
508 | - xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" |
509 | - width="16px" |
510 | - height="16px" |
511 | - id="svg6941" |
512 | - sodipodi:version="0.32" |
513 | - inkscape:version="0.44+devel" |
514 | - sodipodi:docbase="/home/andreas/project/gossip/16x16" |
515 | - sodipodi:docname="status-busy.svg" |
516 | - inkscape:output_extension="org.inkscape.output.svg.inkscape" |
517 | - inkscape:export-filename="/home/andreas/project/gossip/16x16/status-busy.png" |
518 | - inkscape:export-xdpi="90" |
519 | - inkscape:export-ydpi="90" |
520 | - sodipodi:modified="true"> |
521 | - <defs |
522 | - id="defs6943"> |
523 | - <linearGradient |
524 | - inkscape:collect="always" |
525 | - id="linearGradient5899"> |
526 | - <stop |
527 | - style="stop-color:#fce94f;stop-opacity:1" |
528 | - offset="0" |
529 | - id="stop5901" /> |
530 | - <stop |
531 | - style="stop-color:#edd400;stop-opacity:1" |
532 | - offset="1" |
533 | - id="stop5903" /> |
534 | - </linearGradient> |
535 | - <radialGradient |
536 | - inkscape:collect="always" |
537 | - xlink:href="#linearGradient5899" |
538 | - id="radialGradient5905" |
539 | - cx="9.466115" |
540 | - cy="8.9839392" |
541 | - fx="9.466115" |
542 | - fy="8.9839392" |
543 | - r="6.7474474" |
544 | - gradientTransform="matrix(1.1671849,-3.2679277e-3,2.7524467e-3,1.0150183,-1.6222549,-0.2024225)" |
545 | - gradientUnits="userSpaceOnUse" /> |
546 | - </defs> |
547 | - <sodipodi:namedview |
548 | - id="base" |
549 | - pagecolor="#ffffff" |
550 | - bordercolor="#666666" |
551 | - borderopacity="1.0" |
552 | - inkscape:pageopacity="0.0" |
553 | - inkscape:pageshadow="2" |
554 | - inkscape:zoom="15.696217" |
555 | - inkscape:cx="17.665904" |
556 | - inkscape:cy="9.7718474" |
557 | - inkscape:current-layer="layer1" |
558 | - showgrid="false" |
559 | - inkscape:grid-bbox="true" |
560 | - inkscape:document-units="px" |
561 | - inkscape:window-width="1674" |
562 | - inkscape:window-height="969" |
563 | - inkscape:window-x="0" |
564 | - inkscape:window-y="26" /> |
565 | - <metadata |
566 | - id="metadata6946"> |
567 | - <rdf:RDF> |
568 | - <cc:Work |
569 | - rdf:about=""> |
570 | - <dc:format>image/svg+xml</dc:format> |
571 | - <dc:type |
572 | - rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> |
573 | - </cc:Work> |
574 | - </rdf:RDF> |
575 | - </metadata> |
576 | - <g |
577 | - id="layer1" |
578 | - inkscape:label="Layer 1" |
579 | - inkscape:groupmode="layer"> |
580 | - <path |
581 | - sodipodi:type="arc" |
582 | - style="opacity:1;fill:url(#radialGradient5905);fill-opacity:1;stroke:#8d7300;stroke-width:0.97113222;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" |
583 | - id="path4926" |
584 | - sodipodi:cx="7.9737625" |
585 | - sodipodi:cy="7.7221532" |
586 | - sodipodi:rx="6.2618814" |
587 | - sodipodi:ry="6.3632426" |
588 | - d="M 14.235644 7.7221532 A 6.2618814 6.3632426 0 1 1 1.7118812,7.7221532 A 6.2618814 6.3632426 0 1 1 14.235644 7.7221532 z" |
589 | - transform="matrix(1.0380267,0,0,1.0214918,-0.2769782,0.1118841)" /> |
590 | - <path |
591 | - sodipodi:type="arc" |
592 | - style="opacity:0.6;fill:none;fill-opacity:1;stroke:#ffffff;stroke-width:1.14770162;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" |
593 | - id="path5897" |
594 | - sodipodi:cx="7.9737625" |
595 | - sodipodi:cy="7.7221532" |
596 | - sodipodi:rx="6.2618814" |
597 | - sodipodi:ry="6.3632426" |
598 | - d="M 14.235644 7.7221532 A 6.2618814 6.3632426 0 1 1 1.7118812,7.7221532 A 6.2618814 6.3632426 0 1 1 14.235644 7.7221532 z" |
599 | - transform="matrix(0.8783303,0,0,0.8643392,0.996403,1.3254404)" /> |
600 | - <rect |
601 | - style="opacity:1;fill:#eeeeec;fill-opacity:1;stroke:#888a85;stroke-width:0.99999994;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" |
602 | - id="rect5886" |
603 | - width="9.000001" |
604 | - height="9" |
605 | - x="5.5" |
606 | - y="5.5" |
607 | - rx="0" |
608 | - ry="0" /> |
609 | - <rect |
610 | - style="opacity:1;fill:none;fill-opacity:1;stroke:#ffffff;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" |
611 | - id="rect5969" |
612 | - width="7" |
613 | - height="7" |
614 | - x="6.5" |
615 | - y="6.5" |
616 | - rx="0" |
617 | - ry="0" /> |
618 | - <path |
619 | - sodipodi:type="arc" |
620 | - style="opacity:1;fill:#8d7300;fill-opacity:1;stroke:none;stroke-width:1.46393549;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" |
621 | - id="path5888" |
622 | - sodipodi:cx="10.676733" |
623 | - sodipodi:cy="7.8460393" |
624 | - sodipodi:rx="1.4415842" |
625 | - sodipodi:ry="1.4866337" |
626 | - d="M 12.118317 7.8460393 A 1.4415842 1.4866337 0 1 1 9.2351488,7.8460393 A 1.4415842 1.4866337 0 1 1 12.118317 7.8460393 z" |
627 | - transform="matrix(0.6936814,0,0,0.6726606,2.5937487,2.7222784)" /> |
628 | - <path |
629 | - style="fill:none;fill-rule:evenodd;stroke:#888a85;stroke-width:0.99999994px;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1" |
630 | - d="M 7.4772272,10.5 L 11.522773,10.5" |
631 | - id="path5883" /> |
632 | - <path |
633 | - style="fill:none;fill-rule:evenodd;stroke:#888a85;stroke-width:1px;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1" |
634 | - d="M 7.4872926,12.5 L 11.524094,12.5" |
635 | - id="path5885" /> |
636 | - </g> |
637 | -</svg> |
638 | |
639 | === removed file 'data/icons/scalable/status/user-invisible.svg' |
640 | --- data/icons/scalable/status/user-invisible.svg 2009-08-07 19:10:15 +0000 |
641 | +++ data/icons/scalable/status/user-invisible.svg 1970-01-01 00:00:00 +0000 |
642 | @@ -1,78 +0,0 @@ |
643 | -<?xml version="1.0" encoding="UTF-8" standalone="no"?> |
644 | -<!-- Created with Inkscape (http://www.inkscape.org/) --> |
645 | -<svg |
646 | - xmlns:dc="http://purl.org/dc/elements/1.1/" |
647 | - xmlns:cc="http://creativecommons.org/ns#" |
648 | - xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" |
649 | - xmlns:svg="http://www.w3.org/2000/svg" |
650 | - xmlns="http://www.w3.org/2000/svg" |
651 | - xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" |
652 | - xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" |
653 | - width="16px" |
654 | - height="16px" |
655 | - id="svg4908" |
656 | - sodipodi:version="0.32" |
657 | - inkscape:version="0.46" |
658 | - sodipodi:docbase="/home/andreas/project/gossip/16x16" |
659 | - sodipodi:docname="user-invisible.svg" |
660 | - inkscape:output_extension="org.inkscape.output.svg.inkscape" |
661 | - inkscape:export-filename="/Users/kwwii/Desktop/user-invisible.png" |
662 | - inkscape:export-xdpi="270" |
663 | - inkscape:export-ydpi="270" |
664 | - sodipodi:modified="true"> |
665 | - <defs |
666 | - id="defs4910" /> |
667 | - <sodipodi:namedview |
668 | - id="base" |
669 | - pagecolor="#efebe7" |
670 | - bordercolor="#666666" |
671 | - borderopacity="1.0" |
672 | - inkscape:pageopacity="0" |
673 | - inkscape:pageshadow="2" |
674 | - inkscape:zoom="49.332695" |
675 | - inkscape:cx="8.0156251" |
676 | - inkscape:cy="8.0034278" |
677 | - inkscape:current-layer="layer1" |
678 | - showgrid="false" |
679 | - inkscape:grid-bbox="true" |
680 | - inkscape:document-units="px" |
681 | - inkscape:window-width="1343" |
682 | - inkscape:window-height="894" |
683 | - inkscape:window-x="18" |
684 | - inkscape:window-y="36" |
685 | - gridtolerance="10000"> |
686 | - <inkscape:grid |
687 | - type="xygrid" |
688 | - id="grid2386" |
689 | - visible="true" |
690 | - enabled="true" /> |
691 | - </sodipodi:namedview> |
692 | - <metadata |
693 | - id="metadata4913"> |
694 | - <rdf:RDF> |
695 | - <cc:Work |
696 | - rdf:about=""> |
697 | - <dc:format>image/svg+xml</dc:format> |
698 | - <dc:type |
699 | - rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> |
700 | - </cc:Work> |
701 | - </rdf:RDF> |
702 | - </metadata> |
703 | - <g |
704 | - id="layer1" |
705 | - inkscape:label="Layer 1" |
706 | - inkscape:groupmode="layer"> |
707 | - <path |
708 | - style="opacity:0.6;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;marker:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" |
709 | - d="M 8,2 L 2,7 L 4,14 L 12,14 L 14,7 L 8,2 z M 8.03125,3.28125 L 12.875,7.34375 L 11.28125,13 L 4.75,13 L 3.15625,7.34375 L 8.03125,3.28125 z" |
710 | - id="path3169" /> |
711 | - <path |
712 | - style="fill:#555753;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;marker:none;stroke-miterlimit:4;stroke-dasharray:1, 24;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" |
713 | - d="M 7.90625 1 C 7.7115832 1.0193883 7.5268771 1.0954437 7.375 1.21875 L 1.375 6.21875 C 1.0663414 6.4776493 0.94315913 6.8964687 1.0625 7.28125 L 3.0625 14.28125 C 3.1850026 14.699518 3.5642702 14.99029 4 15 L 12 15 C 12.447322 15.004039 12.842922 14.710529 12.96875 14.28125 L 14.96875 7.28125 C 15.088091 6.8964689 14.964909 6.4776491 14.65625 6.21875 L 8.65625 1.21875 C 8.4462475 1.047164 8.1755683 0.96821579 7.90625 1 z M 8 2 L 14 7 L 12 14 L 4 14 L 2 7 L 8 2 z " |
714 | - id="path2388" /> |
715 | - <path |
716 | - style="opacity:0.38251367;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;marker:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" |
717 | - d="M 8,2 L 14,7 L 12,14 L 4,14 L 2,7 L 8,2 z" |
718 | - id="path3182" /> |
719 | - </g> |
720 | -</svg> |
721 | |
722 | === removed file 'data/icons/scalable/status/user-offline.svg' |
723 | --- data/icons/scalable/status/user-offline.svg 2009-08-07 19:10:15 +0000 |
724 | +++ data/icons/scalable/status/user-offline.svg 1970-01-01 00:00:00 +0000 |
725 | @@ -1,101 +0,0 @@ |
726 | -<?xml version="1.0" encoding="UTF-8" standalone="no"?> |
727 | -<!-- Created with Inkscape (http://www.inkscape.org/) --> |
728 | -<svg |
729 | - xmlns:dc="http://purl.org/dc/elements/1.1/" |
730 | - xmlns:cc="http://web.resource.org/cc/" |
731 | - xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" |
732 | - xmlns:svg="http://www.w3.org/2000/svg" |
733 | - xmlns="http://www.w3.org/2000/svg" |
734 | - xmlns:xlink="http://www.w3.org/1999/xlink" |
735 | - xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" |
736 | - xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" |
737 | - width="16px" |
738 | - height="16px" |
739 | - id="svg6941" |
740 | - sodipodi:version="0.32" |
741 | - inkscape:version="0.44+devel" |
742 | - sodipodi:docbase="/home/andreas/project/gossip/16x16" |
743 | - sodipodi:docname="status-offline.svg" |
744 | - inkscape:output_extension="org.inkscape.output.svg.inkscape" |
745 | - inkscape:export-filename="/home/andreas/project/gossip/16x16/status-offline.png" |
746 | - inkscape:export-xdpi="90" |
747 | - inkscape:export-ydpi="90" |
748 | - sodipodi:modified="true"> |
749 | - <defs |
750 | - id="defs6943"> |
751 | - <linearGradient |
752 | - inkscape:collect="always" |
753 | - id="linearGradient7922"> |
754 | - <stop |
755 | - style="stop-color:#e8e8e6;stop-opacity:1" |
756 | - offset="0" |
757 | - id="stop7924" /> |
758 | - <stop |
759 | - style="stop-color:#babdb6;stop-opacity:1" |
760 | - offset="1" |
761 | - id="stop7926" /> |
762 | - </linearGradient> |
763 | - <linearGradient |
764 | - inkscape:collect="always" |
765 | - xlink:href="#linearGradient7922" |
766 | - id="linearGradient7928" |
767 | - x1="0.67574239" |
768 | - y1="0.81831664" |
769 | - x2="9.8658419" |
770 | - y2="10.594059" |
771 | - gradientUnits="userSpaceOnUse" |
772 | - gradientTransform="matrix(0.8666667,0,0,0.8666667,1.0666667,1.0666666)" /> |
773 | - </defs> |
774 | - <sodipodi:namedview |
775 | - id="base" |
776 | - pagecolor="#ffffff" |
777 | - bordercolor="#666666" |
778 | - borderopacity="1.0" |
779 | - inkscape:pageopacity="0.0" |
780 | - inkscape:pageshadow="2" |
781 | - inkscape:zoom="22.197802" |
782 | - inkscape:cx="15.038145" |
783 | - inkscape:cy="7.8865336" |
784 | - inkscape:current-layer="layer1" |
785 | - showgrid="false" |
786 | - inkscape:grid-bbox="true" |
787 | - inkscape:document-units="px" |
788 | - inkscape:window-width="1674" |
789 | - inkscape:window-height="969" |
790 | - inkscape:window-x="0" |
791 | - inkscape:window-y="26" /> |
792 | - <metadata |
793 | - id="metadata6946"> |
794 | - <rdf:RDF> |
795 | - <cc:Work |
796 | - rdf:about=""> |
797 | - <dc:format>image/svg+xml</dc:format> |
798 | - <dc:type |
799 | - rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> |
800 | - </cc:Work> |
801 | - </rdf:RDF> |
802 | - </metadata> |
803 | - <g |
804 | - id="layer1" |
805 | - inkscape:label="Layer 1" |
806 | - inkscape:groupmode="layer"> |
807 | - <rect |
808 | - style="opacity:1;fill:url(#linearGradient7928);fill-opacity:1;stroke:#555753;stroke-width:0.99999994;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" |
809 | - id="rect6949" |
810 | - width="13" |
811 | - height="13" |
812 | - x="1.5" |
813 | - y="1.4999999" |
814 | - rx="1.4641089" |
815 | - ry="1.4641089" /> |
816 | - <rect |
817 | - style="opacity:0.4;fill:none;fill-opacity:1;stroke:#ffffff;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" |
818 | - id="rect7920" |
819 | - width="11" |
820 | - height="11" |
821 | - x="2.5" |
822 | - y="2.5" |
823 | - rx="0.45049509" |
824 | - ry="0.45049506" /> |
825 | - </g> |
826 | -</svg> |
827 | |
828 | === removed file 'data/indicator-status.service.in' |
829 | --- data/indicator-status.service.in 2009-07-24 21:57:58 +0000 |
830 | +++ data/indicator-status.service.in 1970-01-01 00:00:00 +0000 |
831 | @@ -1,3 +0,0 @@ |
832 | -[D-BUS Service] |
833 | -Name=org.ayatana.indicator.status |
834 | -Exec=@libexecdir@/indicator-status-service |
835 | |
836 | === modified file 'debian/changelog' |
837 | --- debian/changelog 2009-12-10 17:54:48 +0000 |
838 | +++ debian/changelog 2010-01-08 15:36:21 +0000 |
839 | @@ -1,3 +1,31 @@ |
840 | +indicator-session (0.2.0-0ubuntu1~ppa1) karmic; urgency=low |
841 | + |
842 | + * Upstream release 0.2.0 |
843 | + |
844 | + -- Ted Gould <ted@ubuntu.com> Fri, 08 Jan 2010 09:33:15 -0600 |
845 | + |
846 | +indicator-session (0.2.0~dev-0ubuntu1~ppa5) karmic; urgency=low |
847 | + |
848 | + * Upstream merge |
849 | + * Distcheck fixes |
850 | + |
851 | + -- Ted Gould <ted@ubuntu.com> Tue, 05 Jan 2010 23:39:06 -0600 |
852 | + |
853 | +indicator-session (0.2.0~dev-0ubuntu1~ppa4) karmic; urgency=low |
854 | + |
855 | + * Upstream merge |
856 | + * Removing status support |
857 | + * Merging the users service and the session service |
858 | + |
859 | + -- Ted Gould <ted@ubuntu.com> Tue, 05 Jan 2010 22:44:55 -0600 |
860 | + |
861 | +indicator-session (0.2.0~dev-0ubuntu1~ppa3) karmic; urgency=low |
862 | + |
863 | + * Updating to use dbusmenu 0.2.0 |
864 | + * debian/control: Updating to depend on dbusmenu 0.2.0~dev or higher. |
865 | + |
866 | + -- Ted Gould <ted@ubuntu.com> Tue, 22 Dec 2009 14:44:35 -0600 |
867 | + |
868 | indicator-session (0.1.7+r58-0ubuntu1) lucid; urgency=low |
869 | |
870 | * New snapshot for libindicator 0.3.0 |
871 | |
872 | === modified file 'debian/control' |
873 | --- debian/control 2009-12-10 17:26:31 +0000 |
874 | +++ debian/control 2010-01-08 15:36:21 +0000 |
875 | @@ -9,8 +9,8 @@ |
876 | libdbus-glib-1-dev, |
877 | gnome-doc-utils, |
878 | libindicator-dev (>= 0.3.0), |
879 | - libdbusmenu-glib-dev (>= 0.1.2), |
880 | - libdbusmenu-gtk-dev (>= 0.1.2), |
881 | + libdbusmenu-glib-dev (>= 0.2.0~dev), |
882 | + libdbusmenu-gtk-dev (>= 0.2.0~dev), |
883 | libpolkit-gobject-1-dev, |
884 | intltool, |
885 | libtelepathy-glib-dev (>= 0.9.0) |
886 | |
887 | === modified file 'po/POTFILES.in' |
888 | --- po/POTFILES.in 2009-09-08 15:09:45 +0000 |
889 | +++ po/POTFILES.in 2010-01-08 15:36:21 +0000 |
890 | @@ -6,9 +6,3 @@ |
891 | src/gtk-dialog/logout-dialog.c |
892 | src/indicator-session.c |
893 | src/session-service.c |
894 | -src/status-provider.c |
895 | -src/status-provider-pidgin.c |
896 | -src/status-provider-telepathy.c |
897 | -src/status-service.c |
898 | -src/status-service-dbus.c |
899 | -src/users-service.c |
900 | |
901 | === modified file 'src/Makefile.am' |
902 | --- src/Makefile.am 2009-12-10 15:47:52 +0000 |
903 | +++ src/Makefile.am 2010-01-08 15:36:21 +0000 |
904 | @@ -1,6 +1,6 @@ |
905 | SUBDIRS = gtk-dialog |
906 | |
907 | -libexec_PROGRAMS = indicator-status-service indicator-users-service indicator-session-service |
908 | +libexec_PROGRAMS = indicator-session-service |
909 | |
910 | ################### |
911 | # Indicator Stuff |
912 | @@ -11,41 +11,11 @@ |
913 | libsession_la_SOURCES = \ |
914 | indicator-session.c \ |
915 | dbus-shared-names.h \ |
916 | - status-service-client.h \ |
917 | users-service-client.h |
918 | libsession_la_CFLAGS = $(APPLET_CFLAGS) -Wall -Werror |
919 | libsession_la_LIBADD = $(APPLET_LIBS) |
920 | libsession_la_LDFLAGS = -module -avoid-version |
921 | |
922 | -################ |
923 | -# Status Stuff |
924 | -################ |
925 | - |
926 | -indicator_status_service_SOURCES = \ |
927 | - status-service.c \ |
928 | - status-service-dbus.h \ |
929 | - status-service-dbus.c \ |
930 | - status-service-server.h \ |
931 | - users-service-dbus.h \ |
932 | - users-service-dbus.c \ |
933 | - users-service-marshal.c \ |
934 | - users-service-marshal.h \ |
935 | - status-provider.h \ |
936 | - status-provider.c \ |
937 | - status-provider-mc5.h \ |
938 | - status-provider-mc5.c \ |
939 | - status-provider-mc5-marshal.h \ |
940 | - status-provider-mc5-marshal.c \ |
941 | - status-provider-pidgin.h \ |
942 | - status-provider-pidgin.c \ |
943 | - status-provider-pidgin-marshal.h \ |
944 | - status-provider-pidgin-marshal.c \ |
945 | - status-provider-telepathy.h \ |
946 | - status-provider-telepathy.c \ |
947 | - status-provider-telepathy-marshal.h \ |
948 | - status-provider-telepathy-marshal.c |
949 | -indicator_status_service_CFLAGS = $(STATUSSERVICE_CFLAGS) -Wall -Werror |
950 | -indicator_status_service_LDADD = $(STATUSSERVICE_LIBS) |
951 | |
952 | users-service-client.h: $(srcdir)/users-service.xml |
953 | dbus-binding-tool \ |
954 | @@ -54,20 +24,6 @@ |
955 | --output=users-service-client.h \ |
956 | $(srcdir)/users-service.xml |
957 | |
958 | -status-service-client.h: $(srcdir)/status-service.xml |
959 | - dbus-binding-tool \ |
960 | - --prefix=_status_service_client \ |
961 | - --mode=glib-client \ |
962 | - --output=status-service-client.h \ |
963 | - $(srcdir)/status-service.xml |
964 | - |
965 | -status-service-server.h: $(srcdir)/status-service.xml |
966 | - dbus-binding-tool \ |
967 | - --prefix=_status_service_server \ |
968 | - --mode=glib-server \ |
969 | - --output=status-service-server.h \ |
970 | - $(srcdir)/status-service.xml |
971 | - |
972 | users-service-marshal.h: $(srcdir)/users-service.list |
973 | glib-genmarshal --header \ |
974 | --prefix=_users_service_marshal $(srcdir)/users-service.list \ |
975 | @@ -78,49 +34,6 @@ |
976 | --prefix=_users_service_marshal $(srcdir)/users-service.list \ |
977 | > users-service-marshal.c |
978 | |
979 | -status-provider-pidgin-marshal.h: $(srcdir)/status-provider-pidgin.list |
980 | - glib-genmarshal --header \ |
981 | - --prefix=_status_provider_pidgin_marshal $(srcdir)/status-provider-pidgin.list \ |
982 | - > status-provider-pidgin-marshal.h |
983 | - |
984 | -status-provider-pidgin-marshal.c: $(srcdir)/status-provider-pidgin.list |
985 | - glib-genmarshal --body \ |
986 | - --prefix=_status_provider_pidgin_marshal $(srcdir)/status-provider-pidgin.list \ |
987 | - > status-provider-pidgin-marshal.c |
988 | - |
989 | -status-provider-telepathy-marshal.h: $(srcdir)/status-provider-telepathy.list |
990 | - glib-genmarshal --header \ |
991 | - --prefix=_status_provider_telepathy_marshal $(srcdir)/status-provider-telepathy.list \ |
992 | - > status-provider-telepathy-marshal.h |
993 | - |
994 | -status-provider-telepathy-marshal.c: $(srcdir)/status-provider-telepathy.list |
995 | - glib-genmarshal --body \ |
996 | - --prefix=_status_provider_telepathy_marshal $(srcdir)/status-provider-telepathy.list \ |
997 | - > status-provider-telepathy-marshal.c |
998 | - |
999 | -status-provider-mc5-marshal.h: $(srcdir)/status-provider-mc5.list |
1000 | - glib-genmarshal --header \ |
1001 | - --prefix=_status_provider_mc5_marshal $(srcdir)/status-provider-mc5.list \ |
1002 | - > status-provider-mc5-marshal.h |
1003 | - |
1004 | -status-provider-mc5-marshal.c: $(srcdir)/status-provider-mc5.list |
1005 | - glib-genmarshal --body \ |
1006 | - --prefix=_status_provider_mc5_marshal $(srcdir)/status-provider-mc5.list \ |
1007 | - > status-provider-mc5-marshal.c |
1008 | - |
1009 | -############### |
1010 | -# Users Stuff |
1011 | -############### |
1012 | - |
1013 | -indicator_users_service_SOURCES = \ |
1014 | - lock-helper.c \ |
1015 | - lock-helper.h \ |
1016 | - users-service.c \ |
1017 | - users-service-dbus.c \ |
1018 | - users-service-marshal.c |
1019 | -indicator_users_service_CFLAGS = $(USERSSERVICE_CFLAGS) -Wall -Werror |
1020 | -indicator_users_service_LDADD = $(USERSSERVICE_LIBS) |
1021 | - |
1022 | ################# |
1023 | # Session Stuff |
1024 | ################# |
1025 | @@ -129,7 +42,10 @@ |
1026 | lock-helper.c \ |
1027 | lock-helper.h \ |
1028 | session-service.c \ |
1029 | - gtk-dialog/gconf-helper.c |
1030 | + gtk-dialog/gconf-helper.c \ |
1031 | + users-service-dbus.h \ |
1032 | + users-service-dbus.c \ |
1033 | + users-service-marshal.c |
1034 | indicator_session_service_CFLAGS = $(SESSIONSERVICE_CFLAGS) $(GCONF_CFLAGS) -DLIBEXECDIR=\"$(libexecdir)\" -Wall -Werror |
1035 | indicator_session_service_LDADD = $(SESSIONSERVICE_LIBS) $(GCONF_LIBS) |
1036 | |
1037 | @@ -139,22 +55,10 @@ |
1038 | |
1039 | BUILT_SOURCES = \ |
1040 | users-service-client.h \ |
1041 | - status-service-client.h \ |
1042 | - status-service-server.h \ |
1043 | - status-provider-mc5-marshal.h \ |
1044 | - status-provider-mc5-marshal.c \ |
1045 | users-service-marshal.h \ |
1046 | - users-service-marshal.c \ |
1047 | - status-provider-pidgin-marshal.h \ |
1048 | - status-provider-pidgin-marshal.c \ |
1049 | - status-provider-telepathy-marshal.h \ |
1050 | - status-provider-telepathy-marshal.c |
1051 | + users-service-marshal.c |
1052 | |
1053 | EXTRA_DIST = \ |
1054 | - status-service.xml \ |
1055 | - status-provider-mc5.list \ |
1056 | - status-provider-pidgin.list \ |
1057 | - status-provider-telepathy.list \ |
1058 | users-service.xml \ |
1059 | users-service.list |
1060 | |
1061 | |
1062 | === modified file 'src/dbus-shared-names.h' |
1063 | --- src/dbus-shared-names.h 2009-09-10 21:26:01 +0000 |
1064 | +++ src/dbus-shared-names.h 2010-01-08 15:36:21 +0000 |
1065 | @@ -36,5 +36,6 @@ |
1066 | |
1067 | #define INDICATOR_SESSION_DBUS_NAME "org.ayatana.indicator.session" |
1068 | #define INDICATOR_SESSION_DBUS_OBJECT "/org/ayatana/indicator/session/menu" |
1069 | +#define INDICATOR_SESSION_DBUS_VERSION 0 |
1070 | |
1071 | #endif /* __DBUS_SHARED_NAMES_H__ */ |
1072 | |
1073 | === modified file 'src/indicator-session.c' |
1074 | --- src/indicator-session.c 2009-11-04 22:36:46 +0000 |
1075 | +++ src/indicator-session.c 2010-01-08 15:36:21 +0000 |
1076 | @@ -23,16 +23,16 @@ |
1077 | #include <glib.h> |
1078 | #include <glib-object.h> |
1079 | #include <gtk/gtk.h> |
1080 | -#include <libdbusmenu-gtk/client.h> |
1081 | +#include <libdbusmenu-gtk/menu.h> |
1082 | |
1083 | #include <dbus/dbus-glib.h> |
1084 | #include <dbus/dbus-glib-bindings.h> |
1085 | |
1086 | #include <libindicator/indicator.h> |
1087 | #include <libindicator/indicator-object.h> |
1088 | +#include <libindicator/indicator-service-manager.h> |
1089 | |
1090 | #include "dbus-shared-names.h" |
1091 | -#include "status-service-client.h" |
1092 | |
1093 | #define INDICATOR_SESSION_TYPE (indicator_session_get_type ()) |
1094 | #define INDICATOR_SESSION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), INDICATOR_SESSION_TYPE, IndicatorSession)) |
1095 | @@ -50,6 +50,7 @@ |
1096 | |
1097 | struct _IndicatorSession { |
1098 | IndicatorObject parent; |
1099 | + IndicatorServiceManager * service; |
1100 | }; |
1101 | |
1102 | GType indicator_session_get_type (void); |
1103 | @@ -58,38 +59,7 @@ |
1104 | INDICATOR_SET_VERSION |
1105 | INDICATOR_SET_TYPE(INDICATOR_SESSION_TYPE) |
1106 | |
1107 | -/* Globals */ |
1108 | -static DbusmenuGtkClient * status_client = NULL; |
1109 | -static DbusmenuGtkClient * users_client = NULL; |
1110 | -static DbusmenuGtkClient * session_client = NULL; |
1111 | - |
1112 | -static GtkMenu * main_menu = NULL; |
1113 | -static GtkImage * status_image = NULL; |
1114 | - |
1115 | -static GtkWidget * status_separator = NULL; |
1116 | -static GtkWidget * users_separator = NULL; |
1117 | -#define SEPARATOR_SHOWN(sep) (sep != NULL && GTK_WIDGET_VISIBLE(sep)) |
1118 | -static GtkWidget * loading_item = NULL; |
1119 | - |
1120 | -static DBusGConnection * connection = NULL; |
1121 | -static DBusGProxy * proxy = NULL; |
1122 | -static DBusGProxy * status_proxy = NULL; |
1123 | - |
1124 | -typedef enum { |
1125 | - STATUS_SECTION, |
1126 | - USERS_SECTION, |
1127 | - SESSION_SECTION, |
1128 | - END_OF_SECTIONS |
1129 | -} section_t; |
1130 | - |
1131 | /* Prototypes */ |
1132 | -static void child_added (DbusmenuMenuitem * parent, DbusmenuMenuitem * child, guint position, gpointer section); |
1133 | -static guint status_menu_pos_offset (void); |
1134 | -static guint users_menu_pos_offset (void); |
1135 | -static guint session_menu_pos_offset (void); |
1136 | -static void child_realized (DbusmenuMenuitem * child, gpointer userdata); |
1137 | -static gboolean start_service (gpointer userdata); |
1138 | -static void start_service_phase2 (DBusGProxy * proxy, guint status, GError * error, gpointer data); |
1139 | static GtkLabel * get_label (IndicatorObject * io); |
1140 | static GtkImage * get_icon (IndicatorObject * io); |
1141 | static GtkMenu * get_menu (IndicatorObject * io); |
1142 | @@ -120,6 +90,11 @@ |
1143 | static void |
1144 | indicator_session_init (IndicatorSession *self) |
1145 | { |
1146 | + /* Set good defaults */ |
1147 | + self->service = NULL; |
1148 | + |
1149 | + /* Now let's fire these guys up. */ |
1150 | + self->service = indicator_service_manager_new_version(INDICATOR_SESSION_DBUS_NAME, INDICATOR_SESSION_DBUS_VERSION); |
1151 | |
1152 | return; |
1153 | } |
1154 | @@ -127,6 +102,12 @@ |
1155 | static void |
1156 | indicator_session_dispose (GObject *object) |
1157 | { |
1158 | + IndicatorSession * self = INDICATOR_SESSION(object); |
1159 | + |
1160 | + if (self->service != NULL) { |
1161 | + g_object_unref(G_OBJECT(self->service)); |
1162 | + self->service = NULL; |
1163 | + } |
1164 | |
1165 | G_OBJECT_CLASS (indicator_session_parent_class)->dispose (object); |
1166 | return; |
1167 | @@ -143,500 +124,24 @@ |
1168 | static GtkLabel * |
1169 | get_label (IndicatorObject * io) |
1170 | { |
1171 | - GtkLabel * returnval = GTK_LABEL(gtk_label_new(g_get_user_name())); |
1172 | - gtk_widget_show(GTK_WIDGET(returnval)); |
1173 | - return returnval; |
1174 | + return NULL; |
1175 | } |
1176 | |
1177 | static GtkImage * |
1178 | get_icon (IndicatorObject * io) |
1179 | { |
1180 | - g_debug("Changing status icon: '%s'", "system-shutdown-panel"); |
1181 | - status_image = GTK_IMAGE(gtk_image_new_from_icon_name("system-shutdown-panel", GTK_ICON_SIZE_MENU)); |
1182 | + GtkImage * status_image = GTK_IMAGE(gtk_image_new_from_icon_name("system-shutdown-panel", GTK_ICON_SIZE_MENU)); |
1183 | gtk_widget_show(GTK_WIDGET(status_image)); |
1184 | return status_image; |
1185 | } |
1186 | |
1187 | -typedef struct _realized_data_t realized_data_t; |
1188 | -struct _realized_data_t { |
1189 | - section_t section; |
1190 | -}; |
1191 | - |
1192 | -static void |
1193 | -resort_menu (void) |
1194 | -{ |
1195 | - guint location = 0; |
1196 | - guint clientnum; |
1197 | - |
1198 | - for (clientnum = 0; clientnum < 3; clientnum++) { |
1199 | - DbusmenuGtkClient * client = NULL; |
1200 | - if (clientnum == 0) client = status_client; |
1201 | - if (clientnum == 1) client = users_client; |
1202 | - if (clientnum == 2) client = session_client; |
1203 | - |
1204 | - if (client == NULL) continue; |
1205 | - |
1206 | - DbusmenuMenuitem * root = dbusmenu_client_get_root(DBUSMENU_CLIENT(client)); |
1207 | - |
1208 | - GList * children = dbusmenu_menuitem_get_children(root); |
1209 | - if (children == NULL) { |
1210 | - continue; |
1211 | - } |
1212 | - |
1213 | - GList * child; |
1214 | - for (child = children; child != NULL; child = g_list_next(child)) { |
1215 | - GtkMenuItem * widget = dbusmenu_gtkclient_menuitem_get(client, DBUSMENU_MENUITEM(child->data)); |
1216 | - if (widget != NULL) { |
1217 | - gtk_menu_reorder_child(main_menu, GTK_WIDGET(widget), location); |
1218 | - location++; |
1219 | - } |
1220 | - } |
1221 | - |
1222 | - if (clientnum == 0) { |
1223 | - gtk_menu_reorder_child(main_menu, status_separator, location); |
1224 | - location++; |
1225 | - } |
1226 | - if (clientnum == 1) { |
1227 | - gtk_menu_reorder_child(main_menu, users_separator, location); |
1228 | - location++; |
1229 | - } |
1230 | - } |
1231 | - |
1232 | - return; |
1233 | -} |
1234 | - |
1235 | -static void |
1236 | -child_added (DbusmenuMenuitem * parent, DbusmenuMenuitem * child, guint position, gpointer section) |
1237 | -{ |
1238 | - realized_data_t * data = g_new0(realized_data_t, 1); |
1239 | - if (data == NULL) { |
1240 | - g_warning("Unable to allocate data for realization of item"); |
1241 | - return; |
1242 | - } |
1243 | - |
1244 | - data->section = GPOINTER_TO_UINT(section); |
1245 | - |
1246 | - g_signal_connect(G_OBJECT(child), DBUSMENU_MENUITEM_SIGNAL_REALIZED, G_CALLBACK(child_realized), data); |
1247 | - return; |
1248 | -} |
1249 | - |
1250 | -static void |
1251 | -child_realized (DbusmenuMenuitem * child, gpointer userdata) |
1252 | -{ |
1253 | - g_return_if_fail(userdata != NULL); |
1254 | - g_return_if_fail(DBUSMENU_IS_MENUITEM(child)); |
1255 | - |
1256 | - realized_data_t * data = (realized_data_t *)userdata; |
1257 | - section_t section = data->section; |
1258 | - g_free(data); |
1259 | - |
1260 | - DbusmenuGtkClient * client = NULL; |
1261 | - gchar * errorstr = NULL; |
1262 | - guint (*posfunc) (void) = NULL; |
1263 | - |
1264 | - switch (section) { |
1265 | - case STATUS_SECTION: |
1266 | - client = status_client; |
1267 | - errorstr = "Status"; |
1268 | - posfunc = status_menu_pos_offset; |
1269 | - break; |
1270 | - case USERS_SECTION: |
1271 | - client = users_client; |
1272 | - errorstr = "Users"; |
1273 | - posfunc = users_menu_pos_offset; |
1274 | - break; |
1275 | - case SESSION_SECTION: |
1276 | - client = session_client; |
1277 | - errorstr = "Session"; |
1278 | - posfunc = session_menu_pos_offset; |
1279 | - break; |
1280 | - default: |
1281 | - g_warning("Child Added called with an unknown position function!"); |
1282 | - return; |
1283 | - } |
1284 | - |
1285 | - if (client == NULL) { |
1286 | - g_warning("Child realized for a menu we don't have? Section: %s", errorstr); |
1287 | - return; |
1288 | - } |
1289 | - |
1290 | - GtkMenuItem * widget = dbusmenu_gtkclient_menuitem_get(client, child); |
1291 | - |
1292 | - if (widget == NULL) { |
1293 | - g_warning("Had a menu item added to the %s menu, but yet it didn't have a GtkWidget with it. Can't add that to a menu now can we? You need to figure this @#$# out!", errorstr); |
1294 | - return; |
1295 | - } |
1296 | - |
1297 | - gtk_menu_append(main_menu, GTK_WIDGET(widget)); |
1298 | - gtk_widget_show(GTK_WIDGET(widget)); |
1299 | - |
1300 | - resort_menu(); |
1301 | - |
1302 | - gtk_widget_hide(loading_item); |
1303 | - |
1304 | - return; |
1305 | -} |
1306 | - |
1307 | -static void |
1308 | -child_moved (DbusmenuMenuitem * parent, DbusmenuMenuitem * child, guint newpos, guint oldpos, guint (*posfunc) (void)) |
1309 | -{ |
1310 | - |
1311 | - |
1312 | -} |
1313 | - |
1314 | - |
1315 | -/* Status Menu */ |
1316 | -static guint |
1317 | -status_menu_pos_offset (void) |
1318 | -{ |
1319 | - return 0; |
1320 | -} |
1321 | - |
1322 | -static void |
1323 | -status_menu_added (DbusmenuMenuitem * root, DbusmenuMenuitem * child, guint position, gpointer user_data) |
1324 | -{ |
1325 | - gtk_widget_show(GTK_WIDGET(status_separator)); |
1326 | - return; |
1327 | -} |
1328 | - |
1329 | -static void |
1330 | -status_menu_removed (DbusmenuMenuitem * root, DbusmenuMenuitem * child, gpointer user_data) |
1331 | -{ |
1332 | - if (g_list_length(dbusmenu_menuitem_get_children(root)) == 0) { |
1333 | - gtk_widget_hide(GTK_WIDGET(status_separator)); |
1334 | - } |
1335 | - |
1336 | - return; |
1337 | -} |
1338 | - |
1339 | -static void |
1340 | -status_menu_root_changed(DbusmenuGtkClient * client, DbusmenuMenuitem * newroot, GtkMenu * main) |
1341 | -{ |
1342 | - if (newroot == NULL) { |
1343 | - gtk_widget_hide(GTK_WIDGET(status_separator)); |
1344 | - return; |
1345 | - } |
1346 | - |
1347 | - g_signal_connect(G_OBJECT(newroot), DBUSMENU_MENUITEM_SIGNAL_CHILD_ADDED, G_CALLBACK(child_added), GUINT_TO_POINTER(STATUS_SECTION)); |
1348 | - g_signal_connect(G_OBJECT(newroot), DBUSMENU_MENUITEM_SIGNAL_CHILD_REMOVED, G_CALLBACK(status_menu_added), NULL); |
1349 | - g_signal_connect(G_OBJECT(newroot), DBUSMENU_MENUITEM_SIGNAL_CHILD_REMOVED, G_CALLBACK(status_menu_removed), NULL); |
1350 | - g_signal_connect(G_OBJECT(newroot), DBUSMENU_MENUITEM_SIGNAL_CHILD_MOVED, G_CALLBACK(child_moved), GUINT_TO_POINTER(STATUS_SECTION)); |
1351 | - |
1352 | - GList * child = NULL; |
1353 | - guint count = 0; |
1354 | - for (child = dbusmenu_menuitem_get_children(newroot); child != NULL; child = g_list_next(child), count++) { |
1355 | - child_added(newroot, DBUSMENU_MENUITEM(child->data), count, GUINT_TO_POINTER(STATUS_SECTION)); |
1356 | - } |
1357 | - |
1358 | - if (count > 0) { |
1359 | - gtk_widget_show(GTK_WIDGET(status_separator)); |
1360 | - } |
1361 | - |
1362 | - return; |
1363 | -} |
1364 | - |
1365 | -static void |
1366 | -status_icon_cb (DBusGProxy * proxy, char * icons, GError *error, gpointer userdata) |
1367 | -{ |
1368 | - g_return_if_fail(status_image != NULL); |
1369 | - g_return_if_fail(icons != NULL); |
1370 | - g_return_if_fail(icons[0] != '\0'); |
1371 | - |
1372 | - g_debug("Changing status icon: '%s'", icons); |
1373 | - gtk_image_set_from_icon_name(status_image, icons, GTK_ICON_SIZE_MENU); |
1374 | - |
1375 | - return; |
1376 | -} |
1377 | - |
1378 | -static void |
1379 | -status_icon_changed (DBusGProxy * proxy, gchar * icon, gpointer userdata) |
1380 | -{ |
1381 | - return status_icon_cb(proxy, icon, NULL, NULL); |
1382 | -} |
1383 | - |
1384 | - |
1385 | -static gboolean |
1386 | -connect_to_status (gpointer userdata) |
1387 | -{ |
1388 | - if (status_proxy == NULL) { |
1389 | - GError * error = NULL; |
1390 | - |
1391 | - DBusGConnection * sbus = dbus_g_bus_get(DBUS_BUS_SESSION, NULL); |
1392 | - |
1393 | - status_proxy = dbus_g_proxy_new_for_name_owner(sbus, |
1394 | - INDICATOR_STATUS_DBUS_NAME, |
1395 | - INDICATOR_STATUS_SERVICE_DBUS_OBJECT, |
1396 | - INDICATOR_STATUS_SERVICE_DBUS_INTERFACE, |
1397 | - &error); |
1398 | - |
1399 | - if (error != NULL) { |
1400 | - g_warning("Unable to get status proxy: %s", error->message); |
1401 | - g_error_free(error); |
1402 | - return FALSE; |
1403 | - } |
1404 | - |
1405 | - dbus_g_proxy_add_signal(status_proxy, "StatusIconsChanged", G_TYPE_STRING, G_TYPE_INVALID); |
1406 | - dbus_g_proxy_connect_signal(status_proxy, "StatusIconsChanged", G_CALLBACK(status_icon_changed), NULL, NULL); |
1407 | - } |
1408 | - |
1409 | - org_ayatana_indicator_status_service_status_icons_async(status_proxy, status_icon_cb, NULL); |
1410 | - |
1411 | - return FALSE; |
1412 | -} |
1413 | - |
1414 | -/* Follow up the service being started by connecting |
1415 | - up the DBus Menu Client and creating our separator. |
1416 | - Also creates an idle func to connect to the service for |
1417 | - getting the icon that we should be using on the panel. */ |
1418 | -static void |
1419 | -status_followup (void) |
1420 | -{ |
1421 | - status_client = dbusmenu_gtkclient_new(INDICATOR_STATUS_DBUS_NAME, INDICATOR_STATUS_DBUS_OBJECT); |
1422 | - g_signal_connect(G_OBJECT(status_client), DBUSMENU_GTKCLIENT_SIGNAL_ROOT_CHANGED, G_CALLBACK(status_menu_root_changed), main_menu); |
1423 | - |
1424 | - status_separator = gtk_separator_menu_item_new(); |
1425 | - gtk_menu_shell_append(GTK_MENU_SHELL(main_menu), status_separator); |
1426 | - gtk_widget_hide(status_separator); /* Should be default, I'm just being explicit. $(%*#$ hide already! */ |
1427 | - |
1428 | - g_idle_add(connect_to_status, NULL); |
1429 | - |
1430 | - return; |
1431 | -} |
1432 | - |
1433 | -/* Users menu */ |
1434 | - |
1435 | -static guint |
1436 | -users_menu_pos_offset (void) |
1437 | -{ |
1438 | - guint position = 0; |
1439 | - if (SEPARATOR_SHOWN(status_separator)) { |
1440 | - GList * location = g_list_find(GTK_MENU_SHELL(main_menu)->children, status_separator); |
1441 | - position = g_list_position(GTK_MENU_SHELL(main_menu)->children, location) + 1; |
1442 | - } |
1443 | - |
1444 | - return position; |
1445 | -} |
1446 | - |
1447 | -static void |
1448 | -users_menu_added (DbusmenuMenuitem * root, DbusmenuMenuitem * child, guint position, gpointer user_data) |
1449 | -{ |
1450 | - gtk_widget_show(GTK_WIDGET(users_separator)); |
1451 | - return; |
1452 | -} |
1453 | - |
1454 | -static void |
1455 | -users_menu_removed (DbusmenuMenuitem * root, DbusmenuMenuitem * child, gpointer user_data) |
1456 | -{ |
1457 | - if (g_list_length(dbusmenu_menuitem_get_children(root)) == 0) { |
1458 | - gtk_widget_hide(GTK_WIDGET(users_separator)); |
1459 | - } |
1460 | - |
1461 | - return; |
1462 | -} |
1463 | - |
1464 | -static void |
1465 | -users_menu_root_changed(DbusmenuGtkClient * client, DbusmenuMenuitem * newroot, GtkMenu * main) |
1466 | -{ |
1467 | - if (newroot == NULL) { |
1468 | - gtk_widget_hide(GTK_WIDGET(users_separator)); |
1469 | - return; |
1470 | - } |
1471 | - |
1472 | - g_signal_connect(G_OBJECT(newroot), DBUSMENU_MENUITEM_SIGNAL_CHILD_ADDED, G_CALLBACK(child_added), GUINT_TO_POINTER(USERS_SECTION)); |
1473 | - g_signal_connect(G_OBJECT(newroot), DBUSMENU_MENUITEM_SIGNAL_CHILD_REMOVED, G_CALLBACK(users_menu_added), NULL); |
1474 | - g_signal_connect(G_OBJECT(newroot), DBUSMENU_MENUITEM_SIGNAL_CHILD_REMOVED, G_CALLBACK(users_menu_removed), NULL); |
1475 | - g_signal_connect(G_OBJECT(newroot), DBUSMENU_MENUITEM_SIGNAL_CHILD_MOVED, G_CALLBACK(child_moved), GUINT_TO_POINTER(USERS_SECTION)); |
1476 | - |
1477 | - GList * child = NULL; |
1478 | - guint count = 0; |
1479 | - for (child = dbusmenu_menuitem_get_children(newroot); child != NULL; child = g_list_next(child), count++) { |
1480 | - child_added(newroot, DBUSMENU_MENUITEM(child->data), count, GUINT_TO_POINTER(USERS_SECTION)); |
1481 | - } |
1482 | - |
1483 | - if (count > 0) { |
1484 | - gtk_widget_show(GTK_WIDGET(users_separator)); |
1485 | - } |
1486 | - |
1487 | - return; |
1488 | -} |
1489 | - |
1490 | -/* Follow up the service being started by connecting |
1491 | - up the DBus Menu Client and creating our separator. */ |
1492 | -static void |
1493 | -users_followup (void) |
1494 | -{ |
1495 | - users_client = dbusmenu_gtkclient_new(INDICATOR_USERS_DBUS_NAME, INDICATOR_USERS_DBUS_OBJECT); |
1496 | - g_signal_connect(G_OBJECT(users_client), DBUSMENU_GTKCLIENT_SIGNAL_ROOT_CHANGED, G_CALLBACK(users_menu_root_changed), main_menu); |
1497 | - |
1498 | - users_separator = gtk_separator_menu_item_new(); |
1499 | - gtk_menu_shell_append(GTK_MENU_SHELL(main_menu), users_separator); |
1500 | - gtk_widget_hide(users_separator); /* Should be default, I'm just being explicit. $(%*#$ hide already! */ |
1501 | - |
1502 | - return; |
1503 | -} |
1504 | - |
1505 | -/* Session Menu Stuff */ |
1506 | - |
1507 | -static guint |
1508 | -session_menu_pos_offset (void) |
1509 | -{ |
1510 | - guint position = 0; |
1511 | - if (SEPARATOR_SHOWN(users_separator)) { |
1512 | - GList * location = g_list_find(GTK_MENU_SHELL(main_menu)->children, users_separator); |
1513 | - position = g_list_position(GTK_MENU_SHELL(main_menu)->children, location) + 1; |
1514 | - } else if (SEPARATOR_SHOWN(status_separator)) { |
1515 | - GList * location = g_list_find(GTK_MENU_SHELL(main_menu)->children, status_separator); |
1516 | - position = g_list_position(GTK_MENU_SHELL(main_menu)->children, location) + 1; |
1517 | - } |
1518 | - |
1519 | - return position; |
1520 | -} |
1521 | - |
1522 | -static void |
1523 | -session_menu_removed (DbusmenuMenuitem * root, DbusmenuMenuitem * child, gpointer user_data) |
1524 | -{ |
1525 | - return; |
1526 | -} |
1527 | - |
1528 | -static void |
1529 | -session_menu_root_changed(DbusmenuGtkClient * client, DbusmenuMenuitem * newroot, GtkMenu * main) |
1530 | -{ |
1531 | - if (newroot == NULL) { |
1532 | - /* We're assuming this'll crash the least so it doesn't |
1533 | - hide a separator. May be a bad choice. */ |
1534 | - return; |
1535 | - } |
1536 | - |
1537 | - g_signal_connect(G_OBJECT(newroot), DBUSMENU_MENUITEM_SIGNAL_CHILD_ADDED, G_CALLBACK(child_added), GUINT_TO_POINTER(SESSION_SECTION)); |
1538 | - g_signal_connect(G_OBJECT(newroot), DBUSMENU_MENUITEM_SIGNAL_CHILD_REMOVED, G_CALLBACK(session_menu_removed), NULL); |
1539 | - g_signal_connect(G_OBJECT(newroot), DBUSMENU_MENUITEM_SIGNAL_CHILD_MOVED, G_CALLBACK(child_moved), GUINT_TO_POINTER(SESSION_SECTION)); |
1540 | - |
1541 | - GList * child = NULL; |
1542 | - guint count = 0; |
1543 | - for (child = dbusmenu_menuitem_get_children(newroot); child != NULL; child = g_list_next(child), count++) { |
1544 | - child_added(newroot, DBUSMENU_MENUITEM(child->data), count, GUINT_TO_POINTER(SESSION_SECTION)); |
1545 | - } |
1546 | - |
1547 | - return; |
1548 | -} |
1549 | - |
1550 | -/* Follow up the service being started by connecting |
1551 | - up the DBus Menu Client. */ |
1552 | -static void |
1553 | -session_followup (void) |
1554 | -{ |
1555 | - session_client = dbusmenu_gtkclient_new(INDICATOR_SESSION_DBUS_NAME, INDICATOR_SESSION_DBUS_OBJECT); |
1556 | - g_signal_connect(G_OBJECT(session_client), DBUSMENU_GTKCLIENT_SIGNAL_ROOT_CHANGED, G_CALLBACK(session_menu_root_changed), main_menu); |
1557 | - |
1558 | - return; |
1559 | -} |
1560 | - |
1561 | -/* Base menu stuff */ |
1562 | - |
1563 | -/* This takes the response to the service starting up. |
1564 | - It checks to see if it's started and if so, continues |
1565 | - with the follow function for the particular area that |
1566 | - it's working in. */ |
1567 | -static void |
1568 | -start_service_phase2 (DBusGProxy * proxy, guint status, GError * error, gpointer data) |
1569 | -{ |
1570 | - /* If we've got an error respond to it */ |
1571 | - if (error != NULL) { |
1572 | - g_critical("Starting service has resulted in error."); |
1573 | - g_error_free(error); |
1574 | - /* Try it all again, we need to get this started! */ |
1575 | - g_idle_add(start_service, data); |
1576 | - return; |
1577 | - } |
1578 | - |
1579 | - /* If it's not running or we started it, try again */ |
1580 | - if (status != DBUS_START_REPLY_SUCCESS && status != DBUS_START_REPLY_ALREADY_RUNNING) { |
1581 | - g_critical("Return value isn't indicative of success: %d", status); |
1582 | - /* Try it all again, we need to get this started! */ |
1583 | - g_idle_add(start_service, data); |
1584 | - return; |
1585 | - } |
1586 | - |
1587 | - /* Check which part of the menu we're in and do the |
1588 | - appropriate follow up from the service being started. */ |
1589 | - switch (GPOINTER_TO_INT(data)) { |
1590 | - case STATUS_SECTION: |
1591 | - status_followup(); |
1592 | - break; |
1593 | - case USERS_SECTION: |
1594 | - users_followup(); |
1595 | - break; |
1596 | - case SESSION_SECTION: |
1597 | - session_followup(); |
1598 | - break; |
1599 | - default: |
1600 | - g_critical("Oh, how can we get a value that we don't know!"); |
1601 | - break; |
1602 | - } |
1603 | - |
1604 | - return; |
1605 | -} |
1606 | - |
1607 | -/* Our idle service starter. It looks at the section that |
1608 | - we're doing and then asks async for that service to be |
1609 | - started by dbus. Probably not really useful to be in |
1610 | - the idle loop as it's so quick, but why not. */ |
1611 | -static gboolean |
1612 | -start_service (gpointer userdata) |
1613 | -{ |
1614 | - g_debug("Starting a service"); |
1615 | - |
1616 | - if (proxy == NULL) { |
1617 | - /* If we don't have DBus, let's stay in the idle loop */ |
1618 | - return TRUE; |
1619 | - } |
1620 | - |
1621 | - const gchar * service = NULL; |
1622 | - switch (GPOINTER_TO_INT(userdata)) { |
1623 | - case STATUS_SECTION: |
1624 | - service = INDICATOR_STATUS_DBUS_NAME; |
1625 | - break; |
1626 | - case USERS_SECTION: |
1627 | - service = INDICATOR_USERS_DBUS_NAME; |
1628 | - break; |
1629 | - case SESSION_SECTION: |
1630 | - service = INDICATOR_SESSION_DBUS_NAME; |
1631 | - break; |
1632 | - default: |
1633 | - g_critical("Oh, how can we get a value that we don't know!"); |
1634 | - return FALSE; |
1635 | - } |
1636 | - |
1637 | - org_freedesktop_DBus_start_service_by_name_async (proxy, service, 0 /* Flags */, start_service_phase2, userdata); |
1638 | - |
1639 | - return FALSE; |
1640 | -} |
1641 | - |
1642 | /* Indicator based function to get the menu for the whole |
1643 | applet. This starts up asking for the parts of the menu |
1644 | from the various services. */ |
1645 | static GtkMenu * |
1646 | get_menu (IndicatorObject * io) |
1647 | { |
1648 | - connection = dbus_g_bus_get(DBUS_BUS_SESSION, NULL); |
1649 | - proxy = dbus_g_proxy_new_for_name(connection, DBUS_SERVICE_DBUS, DBUS_PATH_DBUS, DBUS_INTERFACE_DBUS); |
1650 | - if (proxy == NULL) { |
1651 | - g_warning("Unable to get proxy for DBus itself. Seriously."); |
1652 | - } |
1653 | - |
1654 | - /* Startup in the idle loop */ |
1655 | - g_idle_add(start_service, GINT_TO_POINTER(STATUS_SECTION)); |
1656 | - g_idle_add(start_service, GINT_TO_POINTER(USERS_SECTION)); |
1657 | - g_idle_add(start_service, GINT_TO_POINTER(SESSION_SECTION)); |
1658 | - |
1659 | - /* Build a temp menu incase someone can ask for it |
1660 | - before the services start. Fast user! */ |
1661 | - main_menu = GTK_MENU(gtk_menu_new()); |
1662 | - loading_item = gtk_menu_item_new_with_label("Loading..."); |
1663 | - gtk_menu_shell_append(GTK_MENU_SHELL(main_menu), loading_item); |
1664 | - gtk_widget_show(GTK_WIDGET(loading_item)); |
1665 | - |
1666 | - return main_menu; |
1667 | + return GTK_MENU(dbusmenu_gtkmenu_new(INDICATOR_SESSION_DBUS_NAME, INDICATOR_SESSION_DBUS_OBJECT)); |
1668 | } |
1669 | |
1670 | |
1671 | |
1672 | === modified file 'src/session-service.c' |
1673 | --- src/session-service.c 2009-10-07 16:56:05 +0000 |
1674 | +++ src/session-service.c 2010-01-08 15:36:21 +0000 |
1675 | @@ -7,6 +7,7 @@ |
1676 | Authors: |
1677 | Ted Gould <ted@canonical.com> |
1678 | Christoph Korn <c_korn@gmx.de> |
1679 | + Cody Russell <crussell@canonical.com> |
1680 | |
1681 | This program is free software: you can redistribute it and/or modify it |
1682 | under the terms of the GNU General Public License version 3, as published |
1683 | @@ -23,6 +24,8 @@ |
1684 | |
1685 | #include <config.h> |
1686 | |
1687 | +#include <unistd.h> |
1688 | + |
1689 | #include <glib/gi18n.h> |
1690 | |
1691 | #include <dbus/dbus-glib.h> |
1692 | @@ -30,17 +33,39 @@ |
1693 | |
1694 | #include <libdbusmenu-glib/server.h> |
1695 | #include <libdbusmenu-glib/menuitem.h> |
1696 | +#include <libdbusmenu-glib/client.h> |
1697 | + |
1698 | +#include <libindicator/indicator-service.h> |
1699 | |
1700 | #include "dbus-shared-names.h" |
1701 | |
1702 | #include "gtk-dialog/gconf-helper.h" |
1703 | |
1704 | +#include "users-service-dbus.h" |
1705 | #include "lock-helper.h" |
1706 | |
1707 | #define DKP_ADDRESS "org.freedesktop.DeviceKit.Power" |
1708 | #define DKP_OBJECT "/org/freedesktop/DeviceKit/Power" |
1709 | #define DKP_INTERFACE "org.freedesktop.DeviceKit.Power" |
1710 | |
1711 | +#define GUEST_SESSION_LAUNCHER "/usr/share/gdm/guest-session/guest-session-launch" |
1712 | + |
1713 | +typedef struct _ActivateData ActivateData; |
1714 | +struct _ActivateData |
1715 | +{ |
1716 | + UsersServiceDbus *service; |
1717 | + UserData *user; |
1718 | +}; |
1719 | + |
1720 | +static DBusGConnection *system_bus = NULL; |
1721 | +static DBusGProxy *gdm_proxy = NULL; |
1722 | +static UsersServiceDbus *dbus_interface = NULL; |
1723 | + |
1724 | +static DbusmenuMenuitem *lock_menuitem = NULL; |
1725 | + |
1726 | +static gint count; |
1727 | +static GList *users; |
1728 | + |
1729 | static DbusmenuMenuitem * root_menuitem = NULL; |
1730 | static GMainLoop * mainloop = NULL; |
1731 | static DBusGProxy * dkp_main_proxy = NULL; |
1732 | @@ -67,7 +92,7 @@ |
1733 | /* Let's put this machine to sleep, with some info on how |
1734 | it should sleep. */ |
1735 | static void |
1736 | -sleep (DbusmenuMenuitem * mi, gpointer userdata) |
1737 | +machine_sleep (DbusmenuMenuitem * mi, gpointer userdata) |
1738 | { |
1739 | gchar * type = (gchar *)userdata; |
1740 | |
1741 | @@ -105,7 +130,7 @@ |
1742 | g_debug("Got Suspend: %s", g_value_get_boolean(&candoit) ? "true" : "false"); |
1743 | |
1744 | if (suspend_mi != NULL) { |
1745 | - dbusmenu_menuitem_property_set(suspend_mi, DBUSMENU_MENUITEM_PROP_VISIBLE, g_value_get_boolean(&candoit) ? "true" : "false"); |
1746 | + dbusmenu_menuitem_property_set_value(suspend_mi, DBUSMENU_MENUITEM_PROP_VISIBLE, &candoit); |
1747 | } |
1748 | |
1749 | return; |
1750 | @@ -128,7 +153,7 @@ |
1751 | g_debug("Got Hibernate: %s", g_value_get_boolean(&candoit) ? "true" : "false"); |
1752 | |
1753 | if (suspend_mi != NULL) { |
1754 | - dbusmenu_menuitem_property_set(hibernate_mi, DBUSMENU_MENUITEM_PROP_VISIBLE, g_value_get_boolean(&candoit) ? "true" : "false"); |
1755 | + dbusmenu_menuitem_property_set_value(hibernate_mi, DBUSMENU_MENUITEM_PROP_VISIBLE, &candoit); |
1756 | } |
1757 | |
1758 | return; |
1759 | @@ -239,10 +264,194 @@ |
1760 | return; |
1761 | } |
1762 | |
1763 | -/* This function creates all of the menuitems that the service |
1764 | - provides in the UI. It also connects them to the callbacks. */ |
1765 | -static void |
1766 | -create_items (DbusmenuMenuitem * root) { |
1767 | +/* Respond to the signal of autologin changing to see if the |
1768 | + setting for timed login changes. */ |
1769 | +static void |
1770 | +gdm_settings_change (void) |
1771 | +{ |
1772 | + if (!will_lock_screen()) { |
1773 | + dbusmenu_menuitem_property_set_bool(lock_menuitem, DBUSMENU_MENUITEM_PROP_SENSITIVE, FALSE); |
1774 | + } else { |
1775 | + dbusmenu_menuitem_property_set_bool(lock_menuitem, DBUSMENU_MENUITEM_PROP_SENSITIVE, TRUE); |
1776 | + } |
1777 | + |
1778 | + return; |
1779 | +} |
1780 | + |
1781 | +/* Checks to see if we should show the guest suession item */ |
1782 | +static gboolean |
1783 | +check_guest_session (void) |
1784 | +{ |
1785 | + if (geteuid() < 500) { |
1786 | + /* System users shouldn't have guest account shown. Mosly |
1787 | + this would be the case of the guest user itself. */ |
1788 | + return FALSE; |
1789 | + } |
1790 | + if (!g_file_test(GUEST_SESSION_LAUNCHER, G_FILE_TEST_IS_EXECUTABLE)) { |
1791 | + /* It doesn't appear that the Guest session stuff is |
1792 | + installed. So let's not use it then! */ |
1793 | + return FALSE; |
1794 | + } |
1795 | + |
1796 | + return TRUE; |
1797 | +} |
1798 | + |
1799 | +/* Called when someone clicks on the guest session item. */ |
1800 | +static void |
1801 | +activate_guest_session (DbusmenuMenuitem * mi, gpointer user_data) |
1802 | +{ |
1803 | + GError * error = NULL; |
1804 | + if (!g_spawn_command_line_async(GUEST_SESSION_LAUNCHER, &error)) { |
1805 | + g_warning("Unable to start guest session: %s", error->message); |
1806 | + g_error_free(error); |
1807 | + } |
1808 | + |
1809 | + return; |
1810 | +} |
1811 | + |
1812 | +/* Checks to see if we can create sessions and get a proxy |
1813 | + to the display manager (GDM) */ |
1814 | +static gboolean |
1815 | +check_new_session (void) |
1816 | +{ |
1817 | + if (system_bus == NULL) { |
1818 | + system_bus = dbus_g_bus_get(DBUS_BUS_SYSTEM, NULL); |
1819 | + } |
1820 | + |
1821 | + if (system_bus == NULL) { |
1822 | + return FALSE; |
1823 | + } |
1824 | + |
1825 | + if (gdm_proxy == NULL) { |
1826 | + gdm_proxy = dbus_g_proxy_new_for_name(system_bus, |
1827 | + "org.gnome.DisplayManager", |
1828 | + "/org/gnome/DisplayManager/LocalDisplayFactory", |
1829 | + "org.gnome.DisplayManager.LocalDisplayFactory"); |
1830 | + } |
1831 | + |
1832 | + if (gdm_proxy == NULL) { |
1833 | + return FALSE; |
1834 | + } |
1835 | + |
1836 | + return TRUE; |
1837 | +} |
1838 | + |
1839 | +/* Starts a new generic session */ |
1840 | +static void |
1841 | +activate_new_session (DbusmenuMenuitem * mi, gpointer user_data) |
1842 | +{ |
1843 | + GError * error = NULL; |
1844 | + if (!g_spawn_command_line_async("gdmflexiserver --startnew", &error)) { |
1845 | + g_warning("Unable to start new session: %s", error->message); |
1846 | + g_error_free(error); |
1847 | + } |
1848 | + |
1849 | + return; |
1850 | +} |
1851 | + |
1852 | +/* Activates a session for a particular user. */ |
1853 | +static void |
1854 | +activate_user_session (DbusmenuMenuitem *mi, gpointer user_data) |
1855 | +{ |
1856 | + UserData *user = (UserData *)user_data; |
1857 | + UsersServiceDbus *service = user->service; |
1858 | + |
1859 | + users_service_dbus_activate_user_session (service, user); |
1860 | +} |
1861 | + |
1862 | +/* Comparison function to look into the UserData struct |
1863 | + to compare by using the username value */ |
1864 | +static gint |
1865 | +compare_users_by_username (const gchar *a, |
1866 | + const gchar *b) |
1867 | +{ |
1868 | + UserData *user1 = (UserData *)a; |
1869 | + UserData *user2 = (UserData *)b; |
1870 | + |
1871 | + return g_strcmp0 (user1->user_name, user2->user_name); |
1872 | +} |
1873 | + |
1874 | +/* Builds up the menu for us */ |
1875 | +static void |
1876 | +rebuild_items (DbusmenuMenuitem *root, |
1877 | + UsersServiceDbus *service) |
1878 | +{ |
1879 | + DbusmenuMenuitem *mi = NULL; |
1880 | + GList *u; |
1881 | + UserData *user; |
1882 | + gboolean can_activate; |
1883 | + GList *children; |
1884 | + |
1885 | + can_activate = users_service_dbus_can_activate_session (service); |
1886 | + |
1887 | + children = dbusmenu_menuitem_take_children (root); |
1888 | + g_list_foreach (children, (GFunc)g_object_unref, NULL); |
1889 | + g_list_free (children); |
1890 | + |
1891 | + lock_menuitem = dbusmenu_menuitem_new(); |
1892 | + dbusmenu_menuitem_property_set(lock_menuitem, DBUSMENU_MENUITEM_PROP_LABEL, _("Lock Screen")); |
1893 | + g_signal_connect(G_OBJECT(lock_menuitem), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(lock_screen), NULL); |
1894 | + dbusmenu_menuitem_child_append(root, lock_menuitem); |
1895 | + if (!will_lock_screen()) { |
1896 | + dbusmenu_menuitem_property_set_bool(lock_menuitem, DBUSMENU_MENUITEM_PROP_SENSITIVE, FALSE); |
1897 | + } else { |
1898 | + dbusmenu_menuitem_property_set_bool(lock_menuitem, DBUSMENU_MENUITEM_PROP_SENSITIVE, TRUE); |
1899 | + } |
1900 | + |
1901 | + if (can_activate == TRUE) |
1902 | + { |
1903 | + if (check_guest_session ()) |
1904 | + { |
1905 | + mi = dbusmenu_menuitem_new (); |
1906 | + dbusmenu_menuitem_property_set (mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Guest Session")); |
1907 | + dbusmenu_menuitem_child_append (root, mi); |
1908 | + g_signal_connect (G_OBJECT (mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK (activate_guest_session), NULL); |
1909 | + } |
1910 | + |
1911 | + if (count > MINIMUM_USERS && count < MAXIMUM_USERS) |
1912 | + { |
1913 | + if (users != NULL) |
1914 | + { |
1915 | + GList *l = NULL; |
1916 | + |
1917 | + for (l = users; l != NULL; l = l->next) |
1918 | + { |
1919 | + users = g_list_delete_link (users, l); |
1920 | + } |
1921 | + |
1922 | + users = NULL; |
1923 | + } |
1924 | + |
1925 | + users = users_service_dbus_get_user_list (service); |
1926 | + |
1927 | + users = g_list_sort (users, (GCompareFunc)compare_users_by_username); |
1928 | + |
1929 | + for (u = users; u != NULL; u = g_list_next (u)) |
1930 | + { |
1931 | + user = u->data; |
1932 | + |
1933 | + user->service = service; |
1934 | + |
1935 | + mi = dbusmenu_menuitem_new (); |
1936 | + dbusmenu_menuitem_property_set (mi, DBUSMENU_MENUITEM_PROP_LABEL, user->real_name); |
1937 | + dbusmenu_menuitem_child_append (root, mi); |
1938 | + g_signal_connect (G_OBJECT (mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK (activate_user_session), user); |
1939 | + } |
1940 | + } |
1941 | + |
1942 | + if (check_new_session ()) |
1943 | + { |
1944 | + mi = dbusmenu_menuitem_new (); |
1945 | + dbusmenu_menuitem_property_set (mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Switch User...")); |
1946 | + dbusmenu_menuitem_child_append (root, mi); |
1947 | + g_signal_connect (G_OBJECT (mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK (activate_new_session), NULL); |
1948 | + } |
1949 | + } |
1950 | + |
1951 | + DbusmenuMenuitem * separator = dbusmenu_menuitem_new(); |
1952 | + dbusmenu_menuitem_property_set(separator, DBUSMENU_MENUITEM_PROP_TYPE, DBUSMENU_CLIENT_TYPES_SEPARATOR); |
1953 | + dbusmenu_menuitem_child_append(root, separator); |
1954 | + |
1955 | logout_mi = dbusmenu_menuitem_new(); |
1956 | if (supress_confirmations()) { |
1957 | dbusmenu_menuitem_property_set(logout_mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Log Out")); |
1958 | @@ -253,16 +462,16 @@ |
1959 | g_signal_connect(G_OBJECT(logout_mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(show_dialog), "logout"); |
1960 | |
1961 | suspend_mi = dbusmenu_menuitem_new(); |
1962 | - dbusmenu_menuitem_property_set(suspend_mi, DBUSMENU_MENUITEM_PROP_VISIBLE, "false"); |
1963 | + dbusmenu_menuitem_property_set_bool(suspend_mi, DBUSMENU_MENUITEM_PROP_VISIBLE, FALSE); |
1964 | dbusmenu_menuitem_property_set(suspend_mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Suspend")); |
1965 | dbusmenu_menuitem_child_append(root, suspend_mi); |
1966 | - g_signal_connect(G_OBJECT(suspend_mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(sleep), "Suspend"); |
1967 | + g_signal_connect(G_OBJECT(suspend_mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(machine_sleep), "Suspend"); |
1968 | |
1969 | hibernate_mi = dbusmenu_menuitem_new(); |
1970 | - dbusmenu_menuitem_property_set(hibernate_mi, DBUSMENU_MENUITEM_PROP_VISIBLE, "false"); |
1971 | + dbusmenu_menuitem_property_set_bool(hibernate_mi, DBUSMENU_MENUITEM_PROP_VISIBLE, FALSE); |
1972 | dbusmenu_menuitem_property_set(hibernate_mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Hibernate")); |
1973 | dbusmenu_menuitem_child_append(root, hibernate_mi); |
1974 | - g_signal_connect(G_OBJECT(hibernate_mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(sleep), "Hibernate"); |
1975 | + g_signal_connect(G_OBJECT(hibernate_mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(machine_sleep), "Hibernate"); |
1976 | |
1977 | restart_mi = dbusmenu_menuitem_new(); |
1978 | if (supress_confirmations()) { |
1979 | @@ -292,6 +501,59 @@ |
1980 | return; |
1981 | } |
1982 | |
1983 | +/* Signal called when a user is added. It updates the count and |
1984 | + rebuilds the menu */ |
1985 | +static void |
1986 | +user_added (UsersServiceDbus *service, |
1987 | + UserData *user, |
1988 | + gpointer user_data) |
1989 | +{ |
1990 | + DbusmenuMenuitem *root = (DbusmenuMenuitem *)user_data; |
1991 | + |
1992 | + count++; |
1993 | + |
1994 | + rebuild_items (root, service); |
1995 | +} |
1996 | + |
1997 | +/* Signal called when a user is deleted. It updates the count and |
1998 | + rebuilds the menu */ |
1999 | +static void |
2000 | +user_removed (UsersServiceDbus *service, |
2001 | + UserData *user, |
2002 | + gpointer user_data) |
2003 | +{ |
2004 | + DbusmenuMenuitem *root = (DbusmenuMenuitem *)user_data; |
2005 | + |
2006 | + count--; |
2007 | + |
2008 | + rebuild_items (root, service); |
2009 | +} |
2010 | + |
2011 | +/* Wrapper around rebuild_items that is used on the first call |
2012 | + so that we can initialize the count variable. */ |
2013 | +static void |
2014 | +create_items (DbusmenuMenuitem *root, |
2015 | + UsersServiceDbus *service) |
2016 | +{ |
2017 | + g_return_if_fail (IS_USERS_SERVICE_DBUS (service)); |
2018 | + |
2019 | + count = users_service_dbus_get_user_count (service); |
2020 | + |
2021 | + rebuild_items (root, service); |
2022 | +} |
2023 | + |
2024 | +/* When the service interface starts to shutdown, we |
2025 | + should follow it. */ |
2026 | +void |
2027 | +service_shutdown (IndicatorService * service, gpointer user_data) |
2028 | +{ |
2029 | + if (mainloop != NULL) { |
2030 | + g_debug("Service shutdown"); |
2031 | + g_main_loop_quit(mainloop); |
2032 | + } |
2033 | + return; |
2034 | +} |
2035 | + |
2036 | /* Main, is well, main. It brings everything up and throws |
2037 | us into the mainloop of no return. */ |
2038 | int |
2039 | @@ -305,27 +567,31 @@ |
2040 | bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR); |
2041 | textdomain (GETTEXT_PACKAGE); |
2042 | |
2043 | - DBusGConnection * connection = dbus_g_bus_get(DBUS_BUS_SESSION, NULL); |
2044 | - DBusGProxy * bus_proxy = dbus_g_proxy_new_for_name(connection, DBUS_SERVICE_DBUS, DBUS_PATH_DBUS, DBUS_INTERFACE_DBUS); |
2045 | - GError * error = NULL; |
2046 | - guint nameret = 0; |
2047 | - |
2048 | - if (!org_freedesktop_DBus_request_name(bus_proxy, INDICATOR_SESSION_DBUS_NAME, 0, &nameret, &error)) { |
2049 | - g_error("Unable to call to request name"); |
2050 | - return 1; |
2051 | - } |
2052 | - |
2053 | - if (nameret != DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER) { |
2054 | - g_error("Unable to get name"); |
2055 | - return 1; |
2056 | - } |
2057 | + IndicatorService * service = indicator_service_new_version(INDICATOR_SESSION_DBUS_NAME, |
2058 | + INDICATOR_SESSION_DBUS_VERSION); |
2059 | + g_signal_connect(G_OBJECT(service), |
2060 | + INDICATOR_SERVICE_SIGNAL_SHUTDOWN, |
2061 | + G_CALLBACK(service_shutdown), NULL); |
2062 | |
2063 | g_idle_add(lock_screen_setup, NULL); |
2064 | + lock_screen_gdm_cb_set(gdm_settings_change); |
2065 | |
2066 | root_menuitem = dbusmenu_menuitem_new(); |
2067 | g_debug("Root ID: %d", dbusmenu_menuitem_get_id(root_menuitem)); |
2068 | |
2069 | - create_items(root_menuitem); |
2070 | + dbus_interface = g_object_new (USERS_SERVICE_DBUS_TYPE, NULL); |
2071 | + |
2072 | + create_items (root_menuitem, dbus_interface); |
2073 | + |
2074 | + g_signal_connect (G_OBJECT (dbus_interface), |
2075 | + "user-added", |
2076 | + G_CALLBACK (user_added), |
2077 | + root_menuitem); |
2078 | + g_signal_connect (G_OBJECT (dbus_interface), |
2079 | + "user-removed", |
2080 | + G_CALLBACK (user_removed), |
2081 | + root_menuitem); |
2082 | + |
2083 | setup_dkp(); |
2084 | |
2085 | DbusmenuServer * server = dbusmenu_server_new(INDICATOR_SESSION_DBUS_OBJECT); |
2086 | |
2087 | === removed file 'src/status-provider-mc5.c' |
2088 | --- src/status-provider-mc5.c 2009-12-08 16:13:30 +0000 |
2089 | +++ src/status-provider-mc5.c 1970-01-01 00:00:00 +0000 |
2090 | @@ -1,322 +0,0 @@ |
2091 | -/* |
2092 | -A small wrapper utility to load indicators and put them as menu items |
2093 | -into the gnome-panel using it's applet interface. |
2094 | - |
2095 | -Copyright 2009 Canonical Ltd. |
2096 | - |
2097 | -Authors: |
2098 | - Ted Gould <ted@canonical.com> |
2099 | - |
2100 | -This program is free software: you can redistribute it and/or modify it |
2101 | -under the terms of the GNU General Public License version 3, as published |
2102 | -by the Free Software Foundation. |
2103 | - |
2104 | -This program is distributed in the hope that it will be useful, but |
2105 | -WITHOUT ANY WARRANTY; without even the implied warranties of |
2106 | -MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR |
2107 | -PURPOSE. See the GNU General Public License for more details. |
2108 | - |
2109 | -You should have received a copy of the GNU General Public License along |
2110 | -with this program. If not, see <http://www.gnu.org/licenses/>. |
2111 | -*/ |
2112 | - |
2113 | -#ifdef HAVE_CONFIG_H |
2114 | -#include "config.h" |
2115 | -#endif |
2116 | - |
2117 | -#include <telepathy-glib/account-manager.h> |
2118 | - |
2119 | -#include "status-provider.h" |
2120 | -#include "status-provider-mc5.h" |
2121 | -#include "status-provider-mc5-marshal.h" |
2122 | - |
2123 | -#include <dbus/dbus-glib.h> |
2124 | -#include <dbus/dbus-glib-bindings.h> |
2125 | - |
2126 | -static gchar * sp_to_mc_map[STATUS_PROVIDER_STATUS_LAST] = { |
2127 | - /* STATUS_PROVIDER_STATUS_ONLINE, */ "available", |
2128 | - /* STATUS_PROVIDER_STATUS_AWAY, */ "away", |
2129 | - /* STATUS_PROVIDER_STATUS_DND */ "busy", |
2130 | - /* STATUS_PROVIDER_STATUS_INVISIBLE*/ "hidden", |
2131 | - /* STATUS_PROVIDER_STATUS_OFFLINE */ "offline", |
2132 | - /* STATUS_PROVIDER_STATUS_DISCONNECTED*/NULL |
2133 | -}; |
2134 | - |
2135 | -static TpConnectionPresenceType sp_to_tp_map[STATUS_PROVIDER_STATUS_LAST] = { |
2136 | - /* STATUS_PROVIDER_STATUS_ONLINE, */ TP_CONNECTION_PRESENCE_TYPE_AVAILABLE, |
2137 | - /* STATUS_PROVIDER_STATUS_AWAY, */ TP_CONNECTION_PRESENCE_TYPE_AWAY, |
2138 | - /* STATUS_PROVIDER_STATUS_DND */ TP_CONNECTION_PRESENCE_TYPE_BUSY, |
2139 | - /* STATUS_PROVIDER_STATUS_INVISIBLE*/ TP_CONNECTION_PRESENCE_TYPE_HIDDEN, |
2140 | - /* STATUS_PROVIDER_STATUS_OFFLINE */ TP_CONNECTION_PRESENCE_TYPE_OFFLINE, |
2141 | - /* STATUS_PROVIDER_STATUS_DISCONNECTED*/ TP_CONNECTION_PRESENCE_TYPE_UNSET |
2142 | -}; |
2143 | - |
2144 | -static StatusProviderStatus tp_to_sp_map[TP_CONNECTION_PRESENCE_TYPE_ERROR + 1] = { |
2145 | - /* TP_CONNECTION_PRESENCE_TYPE_UNSET */ STATUS_PROVIDER_STATUS_DISCONNECTED, |
2146 | - /* TP_CONNECTION_PRESENCE_TYPE_OFFLINE */ STATUS_PROVIDER_STATUS_OFFLINE, |
2147 | - /* TP_CONNECTION_PRESENCE_TYPE_AVAILABLE */ STATUS_PROVIDER_STATUS_ONLINE, |
2148 | - /* TP_CONNECTION_PRESENCE_TYPE_AWAY */ STATUS_PROVIDER_STATUS_AWAY, |
2149 | - /* TP_CONNECTION_PRESENCE_TYPE_EXTENDED_AWAY */ STATUS_PROVIDER_STATUS_AWAY, |
2150 | - /* TP_CONNECTION_PRESENCE_TYPE_HIDDEN */ STATUS_PROVIDER_STATUS_INVISIBLE, |
2151 | - /* TP_CONNECTION_PRESENCE_TYPE_BUSY */ STATUS_PROVIDER_STATUS_DND, |
2152 | - /* TP_CONNECTION_PRESENCE_TYPE_UNKNOWN */ STATUS_PROVIDER_STATUS_DISCONNECTED, |
2153 | - /* TP_CONNECTION_PRESENCE_TYPE_ERROR */ STATUS_PROVIDER_STATUS_DISCONNECTED |
2154 | -}; |
2155 | - |
2156 | -typedef struct _StatusProviderMC5Private StatusProviderMC5Private; |
2157 | -struct _StatusProviderMC5Private { |
2158 | - TpAccountManager * manager; |
2159 | - StatusProviderStatus status; |
2160 | - DBusGProxy * dbus_proxy; |
2161 | -}; |
2162 | - |
2163 | -#define STATUS_PROVIDER_MC5_GET_PRIVATE(o) \ |
2164 | -(G_TYPE_INSTANCE_GET_PRIVATE ((o), STATUS_PROVIDER_MC5_TYPE, StatusProviderMC5Private)) |
2165 | -#define MC5_WELL_KNOWN_NAME "org.freedesktop.Telepathy.MissionControl5" |
2166 | - |
2167 | -/* Prototypes */ |
2168 | -/* GObject stuff */ |
2169 | -static void status_provider_mc5_class_init (StatusProviderMC5Class *klass); |
2170 | -static void status_provider_mc5_init (StatusProviderMC5 *self); |
2171 | -static void status_provider_mc5_dispose (GObject *object); |
2172 | -static void status_provider_mc5_finalize (GObject *object); |
2173 | -/* Internal Funcs */ |
2174 | -static void set_status (StatusProvider * sp, StatusProviderStatus status); |
2175 | -static StatusProviderStatus get_status (StatusProvider * sp); |
2176 | -static void presence_changed (TpAccountManager * eam, guint type, const gchar * type_str, const gchar * message, StatusProviderMC5 * sp); |
2177 | -static void dbus_namechange (DBusGProxy * proxy, const gchar * name, const gchar * prev, const gchar * new, StatusProviderMC5 * self); |
2178 | -static void mc5_exists_cb (DBusGProxy * proxy, gboolean exists, GError * error, gpointer userdata); |
2179 | - |
2180 | -G_DEFINE_TYPE (StatusProviderMC5, status_provider_mc5, STATUS_PROVIDER_TYPE); |
2181 | - |
2182 | -/* Create the class. We over ride a few functions but nothing |
2183 | - really shocking. Most interesting is the set and get status. */ |
2184 | -static void |
2185 | -status_provider_mc5_class_init (StatusProviderMC5Class *klass) |
2186 | -{ |
2187 | - GObjectClass *object_class = G_OBJECT_CLASS (klass); |
2188 | - |
2189 | - g_type_class_add_private (klass, sizeof (StatusProviderMC5Private)); |
2190 | - |
2191 | - object_class->dispose = status_provider_mc5_dispose; |
2192 | - object_class->finalize = status_provider_mc5_finalize; |
2193 | - |
2194 | - StatusProviderClass * spclass = STATUS_PROVIDER_CLASS(klass); |
2195 | - |
2196 | - spclass->set_status = set_status; |
2197 | - spclass->get_status = get_status; |
2198 | - |
2199 | - return; |
2200 | -} |
2201 | - |
2202 | -/* Build our telepathy account manager instance if we don't |
2203 | - have one. */ |
2204 | -static void |
2205 | -build_eam (StatusProviderMC5 * self) |
2206 | -{ |
2207 | - StatusProviderMC5Private * priv = STATUS_PROVIDER_MC5_GET_PRIVATE(self); |
2208 | - static TpDBusDaemon *daemon = NULL; |
2209 | - GError *error = NULL; |
2210 | - |
2211 | - if (priv->manager != NULL) { |
2212 | - return; |
2213 | - } |
2214 | - /* the daemon is used to communicate via DBus */ |
2215 | - daemon = tp_dbus_daemon_dup(&error); |
2216 | - |
2217 | - if (daemon == NULL) |
2218 | - { |
2219 | - g_debug("Cannot create DBus daemon: %s\n", error->message); |
2220 | - g_error_free(error); |
2221 | - return; |
2222 | - } |
2223 | - |
2224 | - priv->manager = TP_ACCOUNT_MANAGER (g_object_new (TP_TYPE_ACCOUNT_MANAGER, |
2225 | - "dbus-daemon", daemon, |
2226 | - "dbus-connection", ((TpProxy *) daemon)->dbus_connection, |
2227 | - "bus-name", "org.freedesktop.Telepathy.MissionControl5", |
2228 | - "object-path", "/org/freedesktop/Telepathy/AccountManager", |
2229 | - NULL)); |
2230 | - g_signal_connect(G_OBJECT(priv->manager), "most-available-presence-changed", G_CALLBACK(presence_changed), self); |
2231 | - |
2232 | - return; |
2233 | -} |
2234 | - |
2235 | -/* Creating an instance of the status provider. We set the variables |
2236 | - and create an TpAccountManager object. It does all the hard |
2237 | - work in this module of tracking MissionControl and enumerating the |
2238 | - accounts and all that jazz. */ |
2239 | -static void |
2240 | -status_provider_mc5_init (StatusProviderMC5 *self) |
2241 | -{ |
2242 | - StatusProviderMC5Private * priv = STATUS_PROVIDER_MC5_GET_PRIVATE(self); |
2243 | - |
2244 | - priv->status = STATUS_PROVIDER_STATUS_DISCONNECTED; |
2245 | - priv->manager = NULL; |
2246 | - |
2247 | - DBusGConnection * bus = dbus_g_bus_get(DBUS_BUS_SESSION, NULL); |
2248 | - g_return_if_fail(bus != NULL); /* Can't do anymore DBus stuff without this, |
2249 | - all non-DBus stuff should be done */ |
2250 | - |
2251 | - GError * error = NULL; |
2252 | - |
2253 | - /* Set up the dbus Proxy */ |
2254 | - priv->dbus_proxy = dbus_g_proxy_new_for_name_owner (bus, |
2255 | - DBUS_SERVICE_DBUS, |
2256 | - DBUS_PATH_DBUS, |
2257 | - DBUS_INTERFACE_DBUS, |
2258 | - &error); |
2259 | - if (error != NULL) { |
2260 | - g_warning("Unable to connect to DBus events: %s", error->message); |
2261 | - g_error_free(error); |
2262 | - return; |
2263 | - } |
2264 | - |
2265 | - /* Configure the name owner changing */ |
2266 | - dbus_g_proxy_add_signal(priv->dbus_proxy, "NameOwnerChanged", |
2267 | - G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, |
2268 | - G_TYPE_INVALID); |
2269 | - dbus_g_proxy_connect_signal(priv->dbus_proxy, "NameOwnerChanged", |
2270 | - G_CALLBACK(dbus_namechange), |
2271 | - self, NULL); |
2272 | - |
2273 | - org_freedesktop_DBus_name_has_owner_async(priv->dbus_proxy, MC5_WELL_KNOWN_NAME, mc5_exists_cb, self); |
2274 | - |
2275 | - return; |
2276 | -} |
2277 | - |
2278 | -/* Unref the account manager and move on. Sadly, we're |
2279 | - leaving the show. */ |
2280 | -static void |
2281 | -status_provider_mc5_dispose (GObject *object) |
2282 | -{ |
2283 | - StatusProviderMC5Private * priv = STATUS_PROVIDER_MC5_GET_PRIVATE(object); |
2284 | - |
2285 | - if (priv->manager != NULL) { |
2286 | - g_object_unref(priv->manager); |
2287 | - priv->manager = NULL; |
2288 | - } |
2289 | - |
2290 | - if (priv->dbus_proxy != NULL) { |
2291 | - g_object_unref(priv->dbus_proxy); |
2292 | - priv->dbus_proxy = NULL; |
2293 | - } |
2294 | - |
2295 | - G_OBJECT_CLASS (status_provider_mc5_parent_class)->dispose (object); |
2296 | - return; |
2297 | -} |
2298 | - |
2299 | -/* Pass to superclass */ |
2300 | -static void |
2301 | -status_provider_mc5_finalize (GObject *object) |
2302 | -{ |
2303 | - |
2304 | - G_OBJECT_CLASS (status_provider_mc5_parent_class)->finalize (object); |
2305 | - return; |
2306 | -} |
2307 | - |
2308 | -/* Watch for MC5 Coming on and off the bus. */ |
2309 | -static void |
2310 | -dbus_namechange (DBusGProxy * proxy, const gchar * name, const gchar * prev, const gchar * new, StatusProviderMC5 * self) |
2311 | -{ |
2312 | - /* g_debug("DBUS NAMECHANGE: %s %s %s", name, prev, new); */ |
2313 | - |
2314 | - if (prev[0] == '\0' && g_strcmp0(name, MC5_WELL_KNOWN_NAME) == 0) { |
2315 | - g_debug("MC5 Coming online"); |
2316 | - build_eam(self); |
2317 | - } |
2318 | - if (new[0] == '\0' && g_strcmp0(name, MC5_WELL_KNOWN_NAME) == 0) { |
2319 | - g_debug("MC5 going offline"); |
2320 | - StatusProviderMC5Private * priv = STATUS_PROVIDER_MC5_GET_PRIVATE(self); |
2321 | - if (priv->manager != NULL) { |
2322 | - g_object_unref(priv->manager); |
2323 | - priv->manager = NULL; |
2324 | - } |
2325 | - |
2326 | - priv->status = STATUS_PROVIDER_STATUS_DISCONNECTED; |
2327 | - g_signal_emit(G_OBJECT(self), STATUS_PROVIDER_SIGNAL_STATUS_CHANGED_ID, 0, priv->status, TRUE); |
2328 | - } |
2329 | - |
2330 | - return; |
2331 | -} |
2332 | - |
2333 | -/* Callback for the Dbus command to do HasOwner on |
2334 | - the MC5 service. If it exists, we want to have an |
2335 | - account manager. */ |
2336 | -static void |
2337 | -mc5_exists_cb (DBusGProxy * proxy, gboolean exists, GError * error, gpointer userdata) |
2338 | -{ |
2339 | - if (error) { |
2340 | - g_warning("Unable to check if MC5 is running: %s", error->message); |
2341 | - return; |
2342 | - } |
2343 | - |
2344 | - if (exists) { |
2345 | - build_eam(STATUS_PROVIDER_MC5(userdata)); |
2346 | - } |
2347 | - |
2348 | - return; |
2349 | -} |
2350 | - |
2351 | -/** |
2352 | - status_provider_mc5_new: |
2353 | - |
2354 | - Creates a new #StatusProviderMC5 object. No parameters or anything |
2355 | - like that. Just a convience function. |
2356 | - |
2357 | - Return value: A new instance of #StatusProviderMC5 |
2358 | -*/ |
2359 | -StatusProvider * |
2360 | -status_provider_mc5_new (void) |
2361 | -{ |
2362 | - return STATUS_PROVIDER(g_object_new(STATUS_PROVIDER_MC5_TYPE, NULL)); |
2363 | -} |
2364 | - |
2365 | -/* Setting the status in the empathy account manager. We're |
2366 | - basically requesting a global status. This may or may not |
2367 | - get applied to all accounts. It's really the best we can |
2368 | - hope to do. */ |
2369 | -static void |
2370 | -set_status (StatusProvider * sp, StatusProviderStatus status) |
2371 | -{ |
2372 | - StatusProviderMC5Private * priv = STATUS_PROVIDER_MC5_GET_PRIVATE(sp); |
2373 | - |
2374 | - build_eam(STATUS_PROVIDER_MC5(sp)); |
2375 | - tp_account_manager_set_all_requested_presences(priv->manager, sp_to_tp_map[status], sp_to_mc_map[status], ""); |
2376 | - |
2377 | - return; |
2378 | -} |
2379 | - |
2380 | -/* Gets the status, uses the cached value that we have. Asking |
2381 | - would just be painful. */ |
2382 | -static StatusProviderStatus |
2383 | -get_status (StatusProvider * sp) |
2384 | -{ |
2385 | - g_return_val_if_fail(IS_STATUS_PROVIDER_MC5(sp), STATUS_PROVIDER_STATUS_DISCONNECTED); |
2386 | - StatusProviderMC5Private * priv = STATUS_PROVIDER_MC5_GET_PRIVATE(sp); |
2387 | - |
2388 | - if (priv->manager == NULL) { |
2389 | - return STATUS_PROVIDER_STATUS_DISCONNECTED; |
2390 | - } |
2391 | - |
2392 | - return priv->status; |
2393 | -} |
2394 | - |
2395 | -/* A signal handler for when the TpAccountManager believes |
2396 | - that the global status has changed. It roughly calculates this |
2397 | - by finding the most available of all accounts that are active. */ |
2398 | -static void |
2399 | -presence_changed (TpAccountManager * eam, guint type, const gchar * type_str, const gchar * message, StatusProviderMC5 * sp) |
2400 | -{ |
2401 | - StatusProviderMC5Private * priv = STATUS_PROVIDER_MC5_GET_PRIVATE(sp); |
2402 | - |
2403 | - g_debug("MC5 Status changed: %d %s %s", type, type_str, message); |
2404 | - |
2405 | - if (priv->status != tp_to_sp_map[type]) { |
2406 | - priv->status = tp_to_sp_map[type]; |
2407 | - g_signal_emit(G_OBJECT(sp), STATUS_PROVIDER_SIGNAL_STATUS_CHANGED_ID, 0, priv->status, TRUE); |
2408 | - } |
2409 | - |
2410 | - return; |
2411 | -} |
2412 | - |
2413 | |
2414 | === removed file 'src/status-provider-mc5.h' |
2415 | --- src/status-provider-mc5.h 2009-10-08 18:05:02 +0000 |
2416 | +++ src/status-provider-mc5.h 1970-01-01 00:00:00 +0000 |
2417 | @@ -1,56 +0,0 @@ |
2418 | -/* |
2419 | -A small wrapper utility to load indicators and put them as menu items |
2420 | -into the gnome-panel using it's applet interface. |
2421 | - |
2422 | -Copyright 2009 Canonical Ltd. |
2423 | - |
2424 | -Authors: |
2425 | - Ted Gould <ted@canonical.com> |
2426 | - |
2427 | -This program is free software: you can redistribute it and/or modify it |
2428 | -under the terms of the GNU General Public License version 3, as published |
2429 | -by the Free Software Foundation. |
2430 | - |
2431 | -This program is distributed in the hope that it will be useful, but |
2432 | -WITHOUT ANY WARRANTY; without even the implied warranties of |
2433 | -MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR |
2434 | -PURPOSE. See the GNU General Public License for more details. |
2435 | - |
2436 | -You should have received a copy of the GNU General Public License along |
2437 | -with this program. If not, see <http://www.gnu.org/licenses/>. |
2438 | -*/ |
2439 | - |
2440 | -#ifndef __STATUS_PROVIDER_MC5_H__ |
2441 | -#define __STATUS_PROVIDER_MC5_H__ |
2442 | - |
2443 | -#include <glib.h> |
2444 | -#include <glib-object.h> |
2445 | - |
2446 | -#include "status-provider.h" |
2447 | - |
2448 | -G_BEGIN_DECLS |
2449 | - |
2450 | -#define STATUS_PROVIDER_MC5_TYPE (status_provider_mc5_get_type ()) |
2451 | -#define STATUS_PROVIDER_MC5(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), STATUS_PROVIDER_MC5_TYPE, StatusProviderMC5)) |
2452 | -#define STATUS_PROVIDER_MC5_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), STATUS_PROVIDER_MC5_TYPE, StatusProviderMC5Class)) |
2453 | -#define IS_STATUS_PROVIDER_MC5(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), STATUS_PROVIDER_MC5_TYPE)) |
2454 | -#define IS_STATUS_PROVIDER_MC5_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), STATUS_PROVIDER_MC5_TYPE)) |
2455 | -#define STATUS_PROVIDER_MC5_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), STATUS_PROVIDER_MC5_TYPE, StatusProviderMC5Class)) |
2456 | - |
2457 | - |
2458 | -typedef struct _StatusProviderMC5Class StatusProviderMC5Class; |
2459 | -struct _StatusProviderMC5Class { |
2460 | - StatusProviderClass parent_class; |
2461 | -}; |
2462 | - |
2463 | -typedef struct _StatusProviderMC5 StatusProviderMC5; |
2464 | -struct _StatusProviderMC5 { |
2465 | - StatusProvider parent; |
2466 | -}; |
2467 | - |
2468 | -GType status_provider_mc5_get_type (void); |
2469 | -StatusProvider * status_provider_mc5_new (void); |
2470 | - |
2471 | -G_END_DECLS |
2472 | - |
2473 | -#endif |
2474 | |
2475 | === removed file 'src/status-provider-mc5.list' |
2476 | --- src/status-provider-mc5.list 2009-09-16 22:08:31 +0000 |
2477 | +++ src/status-provider-mc5.list 1970-01-01 00:00:00 +0000 |
2478 | @@ -1,1 +0,0 @@ |
2479 | -VOID:UINT,STRING |
2480 | |
2481 | === removed file 'src/status-provider-pidgin.c' |
2482 | --- src/status-provider-pidgin.c 2009-09-10 18:28:43 +0000 |
2483 | +++ src/status-provider-pidgin.c 1970-01-01 00:00:00 +0000 |
2484 | @@ -1,431 +0,0 @@ |
2485 | -/* |
2486 | -A small wrapper utility to load indicators and put them as menu items |
2487 | -into the gnome-panel using it's applet interface. |
2488 | - |
2489 | -Copyright 2009 Canonical Ltd. |
2490 | - |
2491 | -Authors: |
2492 | - Ted Gould <ted@canonical.com> |
2493 | - |
2494 | -This program is free software: you can redistribute it and/or modify it |
2495 | -under the terms of the GNU General Public License version 3, as published |
2496 | -by the Free Software Foundation. |
2497 | - |
2498 | -This program is distributed in the hope that it will be useful, but |
2499 | -WITHOUT ANY WARRANTY; without even the implied warranties of |
2500 | -MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR |
2501 | -PURPOSE. See the GNU General Public License for more details. |
2502 | - |
2503 | -You should have received a copy of the GNU General Public License along |
2504 | -with this program. If not, see <http://www.gnu.org/licenses/>. |
2505 | -*/ |
2506 | - |
2507 | -#ifdef HAVE_CONFIG_H |
2508 | -#include "config.h" |
2509 | -#endif |
2510 | - |
2511 | -#include "status-provider.h" |
2512 | -#include "status-provider-pidgin.h" |
2513 | -#include "status-provider-pidgin-marshal.h" |
2514 | - |
2515 | -#include <dbus/dbus-glib.h> |
2516 | - |
2517 | -typedef enum { |
2518 | - PG_STATUS_UNKNOWN, |
2519 | - PG_STATUS_OFFLINE, |
2520 | - PG_STATUS_AVAILABLE, |
2521 | - PG_STATUS_UNAVAILABLE, |
2522 | - PG_STATUS_INVISIBLE, |
2523 | - PG_STATUS_AWAY, |
2524 | - PG_STATUS_EXTENDEND_AWAY, |
2525 | - PG_STATUS_MOBILE, |
2526 | - PG_STATUS_TUNE |
2527 | -} pg_status_t; |
2528 | - |
2529 | -static const StatusProviderStatus pg_to_sp_map[] = { |
2530 | - /* PG_STATUS_UNKNOWN, */ STATUS_PROVIDER_STATUS_OFFLINE, |
2531 | - /* PG_STATUS_OFFLINE, */ STATUS_PROVIDER_STATUS_OFFLINE, |
2532 | - /* PG_STATUS_AVAILABLE, */ STATUS_PROVIDER_STATUS_ONLINE, |
2533 | - /* PG_STATUS_UNAVAILABLE, */ STATUS_PROVIDER_STATUS_DND, |
2534 | - /* PG_STATUS_INVISIBLE, */ STATUS_PROVIDER_STATUS_INVISIBLE, |
2535 | - /* PG_STATUS_AWAY, */ STATUS_PROVIDER_STATUS_AWAY, |
2536 | - /* PG_STATUS_EXTENDEND_AWAY, */ STATUS_PROVIDER_STATUS_AWAY, |
2537 | - /* PG_STATUS_MOBILE, */ STATUS_PROVIDER_STATUS_OFFLINE, |
2538 | - /* PG_STATUS_TUNE */ STATUS_PROVIDER_STATUS_OFFLINE |
2539 | -}; |
2540 | - |
2541 | -static const pg_status_t sp_to_pg_map[STATUS_PROVIDER_STATUS_LAST] = { |
2542 | - /* STATUS_PROVIDER_STATUS_ONLINE, */ PG_STATUS_AVAILABLE, |
2543 | - /* STATUS_PROVIDER_STATUS_AWAY, */ PG_STATUS_AWAY, |
2544 | - /* STATUS_PROVIDER_STATUS_DND */ PG_STATUS_UNAVAILABLE, |
2545 | - /* STATUS_PROVIDER_STATUS_INVISIBLE*/ PG_STATUS_INVISIBLE, |
2546 | - /* STATUS_PROVIDER_STATUS_OFFLINE */ PG_STATUS_OFFLINE, |
2547 | - /* STATUS_PROVIDER_STATUS_DISCONNECTED*/ PG_STATUS_OFFLINE |
2548 | -}; |
2549 | - |
2550 | -typedef struct _StatusProviderPidginPrivate StatusProviderPidginPrivate; |
2551 | -struct _StatusProviderPidginPrivate { |
2552 | - DBusGProxy * proxy; |
2553 | - DBusGProxy * dbus_proxy; |
2554 | - pg_status_t pg_status; |
2555 | -}; |
2556 | - |
2557 | -#define STATUS_PROVIDER_PIDGIN_GET_PRIVATE(o) \ |
2558 | -(G_TYPE_INSTANCE_GET_PRIVATE ((o), STATUS_PROVIDER_PIDGIN_TYPE, StatusProviderPidginPrivate)) |
2559 | - |
2560 | -/* Prototypes */ |
2561 | -/* GObject stuff */ |
2562 | -static void status_provider_pidgin_class_init (StatusProviderPidginClass *klass); |
2563 | -static void status_provider_pidgin_init (StatusProviderPidgin *self); |
2564 | -static void status_provider_pidgin_dispose (GObject *object); |
2565 | -static void status_provider_pidgin_finalize (GObject *object); |
2566 | -/* Internal Funcs */ |
2567 | -static void set_status (StatusProvider * sp, StatusProviderStatus status); |
2568 | -static StatusProviderStatus get_status (StatusProvider * sp); |
2569 | -static void setup_pidgin_proxy (StatusProviderPidgin * self); |
2570 | -static void dbus_namechange (DBusGProxy * proxy, const gchar * name, const gchar * prev, const gchar * new, StatusProviderPidgin * self); |
2571 | - |
2572 | -G_DEFINE_TYPE (StatusProviderPidgin, status_provider_pidgin, STATUS_PROVIDER_TYPE); |
2573 | - |
2574 | -static void |
2575 | -status_provider_pidgin_class_init (StatusProviderPidginClass *klass) |
2576 | -{ |
2577 | - GObjectClass *object_class = G_OBJECT_CLASS (klass); |
2578 | - |
2579 | - g_type_class_add_private (klass, sizeof (StatusProviderPidginPrivate)); |
2580 | - |
2581 | - object_class->dispose = status_provider_pidgin_dispose; |
2582 | - object_class->finalize = status_provider_pidgin_finalize; |
2583 | - |
2584 | - StatusProviderClass * spclass = STATUS_PROVIDER_CLASS(klass); |
2585 | - |
2586 | - spclass->set_status = set_status; |
2587 | - spclass->get_status = get_status; |
2588 | - |
2589 | - return; |
2590 | -} |
2591 | - |
2592 | -static void |
2593 | -type_cb (DBusGProxy * proxy, DBusGProxyCall * call, gpointer userdata) |
2594 | -{ |
2595 | - GError * error = NULL; |
2596 | - gint status = 0; |
2597 | - if (!dbus_g_proxy_end_call(proxy, call, &error, G_TYPE_INT, &status, G_TYPE_INVALID)) { |
2598 | - g_warning("Unable to get type from Pidgin: %s", error->message); |
2599 | - g_error_free(error); |
2600 | - return; |
2601 | - } |
2602 | - |
2603 | - StatusProviderPidginPrivate * priv = STATUS_PROVIDER_PIDGIN_GET_PRIVATE(userdata); |
2604 | - if (status != priv->pg_status) { |
2605 | - priv->pg_status = status; |
2606 | - |
2607 | - g_signal_emit(G_OBJECT(userdata), STATUS_PROVIDER_SIGNAL_STATUS_CHANGED_ID, 0, pg_to_sp_map[priv->pg_status], TRUE); |
2608 | - } |
2609 | - |
2610 | - return; |
2611 | -} |
2612 | - |
2613 | -static void |
2614 | -saved_status_to_type (StatusProviderPidgin * spp, gint savedstatus) |
2615 | -{ |
2616 | - StatusProviderPidginPrivate * priv = STATUS_PROVIDER_PIDGIN_GET_PRIVATE(spp); |
2617 | - |
2618 | - g_debug("Pidgin figuring out type for %d", savedstatus); |
2619 | - dbus_g_proxy_begin_call(priv->proxy, |
2620 | - "PurpleSavedstatusGetType", type_cb, spp, NULL, |
2621 | - G_TYPE_INT, savedstatus, G_TYPE_INVALID); |
2622 | - |
2623 | - return; |
2624 | -} |
2625 | - |
2626 | -static void |
2627 | -savedstatus_cb (DBusGProxy * proxy, DBusGProxyCall * call, gpointer userdata) |
2628 | -{ |
2629 | - GError * error = NULL; |
2630 | - gint status = 0; |
2631 | - if (!dbus_g_proxy_end_call(proxy, call, &error, G_TYPE_INT, &status, G_TYPE_INVALID)) { |
2632 | - g_warning("Unable to get saved status from Pidgin: %s", error->message); |
2633 | - g_error_free(error); |
2634 | - return; |
2635 | - } |
2636 | - |
2637 | - saved_status_to_type(STATUS_PROVIDER_PIDGIN(userdata), status); |
2638 | - return; |
2639 | -} |
2640 | - |
2641 | - |
2642 | -static void |
2643 | -changed_status (DBusGProxy * proxy, gint savedstatus, GError ** error, StatusProviderPidgin * spp) |
2644 | -{ |
2645 | - saved_status_to_type(spp, savedstatus); |
2646 | - return; |
2647 | -} |
2648 | - |
2649 | -static void |
2650 | -proxy_destroy (DBusGProxy * proxy, StatusProviderPidgin * spp) |
2651 | -{ |
2652 | - StatusProviderPidginPrivate * priv = STATUS_PROVIDER_PIDGIN_GET_PRIVATE(spp); |
2653 | - |
2654 | - priv->proxy = NULL; |
2655 | - priv->pg_status = PG_STATUS_OFFLINE; |
2656 | - |
2657 | - g_signal_emit(G_OBJECT(spp), STATUS_PROVIDER_SIGNAL_STATUS_CHANGED_ID, 0, pg_to_sp_map[priv->pg_status], TRUE); |
2658 | - return; |
2659 | -} |
2660 | - |
2661 | -static void |
2662 | -status_provider_pidgin_init (StatusProviderPidgin *self) |
2663 | -{ |
2664 | - StatusProviderPidginPrivate * priv = STATUS_PROVIDER_PIDGIN_GET_PRIVATE(self); |
2665 | - |
2666 | - priv->proxy = NULL; |
2667 | - priv->pg_status = PG_STATUS_OFFLINE; |
2668 | - |
2669 | - DBusGConnection * bus = dbus_g_bus_get(DBUS_BUS_SESSION, NULL); |
2670 | - g_return_if_fail(bus != NULL); /* Can't do anymore DBus stuff without this, |
2671 | - all non-DBus stuff should be done */ |
2672 | - |
2673 | - GError * error = NULL; |
2674 | - |
2675 | - /* Set up the dbus Proxy */ |
2676 | - priv->dbus_proxy = dbus_g_proxy_new_for_name_owner (bus, |
2677 | - DBUS_SERVICE_DBUS, |
2678 | - DBUS_PATH_DBUS, |
2679 | - DBUS_INTERFACE_DBUS, |
2680 | - &error); |
2681 | - if (error != NULL) { |
2682 | - g_warning("Unable to connect to DBus events: %s", error->message); |
2683 | - g_error_free(error); |
2684 | - return; |
2685 | - } |
2686 | - |
2687 | - /* Configure the name owner changing */ |
2688 | - dbus_g_proxy_add_signal(priv->dbus_proxy, "NameOwnerChanged", |
2689 | - G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, |
2690 | - G_TYPE_INVALID); |
2691 | - dbus_g_proxy_connect_signal(priv->dbus_proxy, "NameOwnerChanged", |
2692 | - G_CALLBACK(dbus_namechange), |
2693 | - self, NULL); |
2694 | - |
2695 | - setup_pidgin_proxy(self); |
2696 | - |
2697 | - return; |
2698 | -} |
2699 | - |
2700 | -/* Watch to see if the Pidgin comes up on Dbus */ |
2701 | -static void |
2702 | -dbus_namechange (DBusGProxy * proxy, const gchar * name, const gchar * prev, const gchar * new, StatusProviderPidgin * self) |
2703 | -{ |
2704 | - g_return_if_fail(name != NULL); |
2705 | - g_return_if_fail(new != NULL); |
2706 | - |
2707 | - if (g_strcmp0(name, "im.pidgin.purple.PurpleService") == 0) { |
2708 | - setup_pidgin_proxy(self); |
2709 | - } |
2710 | - return; |
2711 | -} |
2712 | - |
2713 | -/* Setup the Pidgin proxy so that we can talk to it |
2714 | - and get signals from it. */ |
2715 | -static void |
2716 | -setup_pidgin_proxy (StatusProviderPidgin * self) |
2717 | -{ |
2718 | - StatusProviderPidginPrivate * priv = STATUS_PROVIDER_PIDGIN_GET_PRIVATE(self); |
2719 | - |
2720 | - if (priv->proxy != NULL) { |
2721 | - g_debug("Odd, we were asked to set up a Pidgin proxy when we already had one."); |
2722 | - return; |
2723 | - } |
2724 | - |
2725 | - DBusGConnection * bus = dbus_g_bus_get(DBUS_BUS_SESSION, NULL); |
2726 | - g_return_if_fail(bus != NULL); /* Can't do anymore DBus stuff without this, |
2727 | - all non-DBus stuff should be done */ |
2728 | - |
2729 | - GError * error = NULL; |
2730 | - |
2731 | - /* Set up the Pidgin Proxy */ |
2732 | - priv->proxy = dbus_g_proxy_new_for_name_owner (bus, |
2733 | - "im.pidgin.purple.PurpleService", |
2734 | - "/im/pidgin/purple/PurpleObject", |
2735 | - "im.pidgin.purple.PurpleInterface", |
2736 | - &error); |
2737 | - /* Report any errors */ |
2738 | - if (error != NULL) { |
2739 | - g_debug("Unable to get Pidgin proxy: %s", error->message); |
2740 | - g_error_free(error); |
2741 | - } |
2742 | - |
2743 | - /* If we have a proxy, let's start using it */ |
2744 | - if (priv->proxy != NULL) { |
2745 | - /* Set the proxy to NULL if it's destroyed */ |
2746 | - g_object_add_weak_pointer (G_OBJECT(priv->proxy), (gpointer *)&priv->proxy); |
2747 | - /* If it's destroyed, let's clean up as well */ |
2748 | - g_signal_connect(G_OBJECT(priv->proxy), "destroy", |
2749 | - G_CALLBACK(proxy_destroy), self); |
2750 | - |
2751 | - /* Watching for the status change coming from the |
2752 | - Pidgin side of things. */ |
2753 | - g_debug("Adding Pidgin Signals"); |
2754 | - dbus_g_object_register_marshaller(_status_provider_pidgin_marshal_VOID__INT_INT, |
2755 | - G_TYPE_NONE, |
2756 | - G_TYPE_INT, |
2757 | - G_TYPE_INT, |
2758 | - G_TYPE_INVALID); |
2759 | - dbus_g_proxy_add_signal (priv->proxy, |
2760 | - "SavedstatusChanged", |
2761 | - G_TYPE_INT, |
2762 | - G_TYPE_INT, |
2763 | - G_TYPE_INVALID); |
2764 | - dbus_g_proxy_connect_signal(priv->proxy, |
2765 | - "SavedstatusChanged", |
2766 | - G_CALLBACK(changed_status), |
2767 | - (void *)self, |
2768 | - NULL); |
2769 | - |
2770 | - /* Get the current status to update our cached |
2771 | - value of the status. */ |
2772 | - dbus_g_proxy_begin_call(priv->proxy, |
2773 | - "PurpleSavedstatusGetCurrent", |
2774 | - savedstatus_cb, |
2775 | - self, |
2776 | - NULL, |
2777 | - G_TYPE_INVALID); |
2778 | - } |
2779 | - |
2780 | - return; |
2781 | -} |
2782 | - |
2783 | -static void |
2784 | -status_provider_pidgin_dispose (GObject *object) |
2785 | -{ |
2786 | - StatusProviderPidginPrivate * priv = STATUS_PROVIDER_PIDGIN_GET_PRIVATE(object); |
2787 | - |
2788 | - if (priv->proxy != NULL) { |
2789 | - g_object_unref(priv->proxy); |
2790 | - priv->proxy = NULL; |
2791 | - } |
2792 | - |
2793 | - G_OBJECT_CLASS (status_provider_pidgin_parent_class)->dispose (object); |
2794 | - return; |
2795 | -} |
2796 | - |
2797 | -static void |
2798 | -status_provider_pidgin_finalize (GObject *object) |
2799 | -{ |
2800 | - |
2801 | - G_OBJECT_CLASS (status_provider_pidgin_parent_class)->finalize (object); |
2802 | - return; |
2803 | -} |
2804 | - |
2805 | -/** |
2806 | - status_provider_pidgin_new: |
2807 | - |
2808 | - Creates a new #StatusProviderPidgin object. No parameters or anything |
2809 | - like that. Just a convience function. |
2810 | - |
2811 | - Return value: A new instance of #StatusProviderPidgin |
2812 | -*/ |
2813 | -StatusProvider * |
2814 | -status_provider_pidgin_new (void) |
2815 | -{ |
2816 | - return STATUS_PROVIDER(g_object_new(STATUS_PROVIDER_PIDGIN_TYPE, NULL)); |
2817 | -} |
2818 | - |
2819 | -/* Takes the status provided generically for Status providers |
2820 | - and turns it into a Pidgin status and sends it to Pidgin. */ |
2821 | -static void |
2822 | -set_status (StatusProvider * sp, StatusProviderStatus status) |
2823 | -{ |
2824 | - gchar * message = ""; |
2825 | - |
2826 | - g_return_if_fail(IS_STATUS_PROVIDER_PIDGIN(sp)); |
2827 | - StatusProviderPidginPrivate * priv = STATUS_PROVIDER_PIDGIN_GET_PRIVATE(sp); |
2828 | - |
2829 | - g_debug("\tPidgin set status to %d", status); |
2830 | - if (priv->proxy == NULL) { |
2831 | - return; |
2832 | - } |
2833 | - |
2834 | - priv->pg_status = sp_to_pg_map[status]; |
2835 | - gint status_val = 0; |
2836 | - gboolean ret = FALSE; |
2837 | - GError * error = NULL; |
2838 | - |
2839 | - ret = dbus_g_proxy_call(priv->proxy, |
2840 | - "PurpleSavedstatusFindTransientByTypeAndMessage", &error, |
2841 | - G_TYPE_INT, priv->pg_status, |
2842 | - G_TYPE_STRING, message, |
2843 | - G_TYPE_INVALID, |
2844 | - G_TYPE_INT, &status_val, |
2845 | - G_TYPE_INVALID); |
2846 | - |
2847 | - if (!ret) { |
2848 | - if (error != NULL) { |
2849 | - g_error_free(error); |
2850 | - } |
2851 | - error = NULL; |
2852 | - status_val = 0; |
2853 | - g_debug("No Pidgin saved status to apply"); |
2854 | - } |
2855 | - |
2856 | - if (status_val == 0) { |
2857 | - ret = dbus_g_proxy_call(priv->proxy, |
2858 | - "PurpleSavedstatusNew", &error, |
2859 | - G_TYPE_STRING, message, |
2860 | - G_TYPE_INT, priv->pg_status, |
2861 | - G_TYPE_INVALID, |
2862 | - G_TYPE_INT, &status_val, |
2863 | - G_TYPE_INVALID); |
2864 | - |
2865 | - if (!ret) { |
2866 | - status_val = 0; |
2867 | - if (error != NULL) { |
2868 | - g_warning("Unable to create Pidgin status for %d: %s", status, error->message); |
2869 | - g_error_free(error); |
2870 | - } else { |
2871 | - g_warning("Unable to create Pidgin status for %d", status); |
2872 | - } |
2873 | - error = NULL; |
2874 | - } |
2875 | - } |
2876 | - |
2877 | - if (status_val == 0) { |
2878 | - return; |
2879 | - } |
2880 | - |
2881 | - ret = dbus_g_proxy_call(priv->proxy, |
2882 | - "PurpleSavedstatusActivate", &error, |
2883 | - G_TYPE_INT, status_val, |
2884 | - G_TYPE_INVALID, |
2885 | - G_TYPE_INVALID); |
2886 | - |
2887 | - if (!ret) { |
2888 | - if (error != NULL) { |
2889 | - g_warning("Pidgin unable to change to status: %s", error->message); |
2890 | - g_error_free(error); |
2891 | - } else { |
2892 | - g_warning("Pidgin unable to change to status"); |
2893 | - } |
2894 | - error = NULL; |
2895 | - } |
2896 | - |
2897 | - g_signal_emit(G_OBJECT(sp), STATUS_PROVIDER_SIGNAL_STATUS_CHANGED_ID, 0, pg_to_sp_map[priv->pg_status], TRUE); |
2898 | - return; |
2899 | -} |
2900 | - |
2901 | -/* Takes the cached Pidgin status and makes it into the generic |
2902 | - Status provider status. If there is no Pidgin proxy then it |
2903 | - returns the disconnected state. */ |
2904 | -static StatusProviderStatus |
2905 | -get_status (StatusProvider * sp) |
2906 | -{ |
2907 | - g_return_val_if_fail(IS_STATUS_PROVIDER_PIDGIN(sp), STATUS_PROVIDER_STATUS_DISCONNECTED); |
2908 | - StatusProviderPidginPrivate * priv = STATUS_PROVIDER_PIDGIN_GET_PRIVATE(sp); |
2909 | - |
2910 | - if (priv->proxy == NULL) { |
2911 | - return STATUS_PROVIDER_STATUS_DISCONNECTED; |
2912 | - } |
2913 | - |
2914 | - return pg_to_sp_map[priv->pg_status]; |
2915 | -} |
2916 | |
2917 | === removed file 'src/status-provider-pidgin.h' |
2918 | --- src/status-provider-pidgin.h 2009-08-07 22:52:48 +0000 |
2919 | +++ src/status-provider-pidgin.h 1970-01-01 00:00:00 +0000 |
2920 | @@ -1,56 +0,0 @@ |
2921 | -/* |
2922 | -A small wrapper utility to load indicators and put them as menu items |
2923 | -into the gnome-panel using it's applet interface. |
2924 | - |
2925 | -Copyright 2009 Canonical Ltd. |
2926 | - |
2927 | -Authors: |
2928 | - Ted Gould <ted@canonical.com> |
2929 | - |
2930 | -This program is free software: you can redistribute it and/or modify it |
2931 | -under the terms of the GNU General Public License version 3, as published |
2932 | -by the Free Software Foundation. |
2933 | - |
2934 | -This program is distributed in the hope that it will be useful, but |
2935 | -WITHOUT ANY WARRANTY; without even the implied warranties of |
2936 | -MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR |
2937 | -PURPOSE. See the GNU General Public License for more details. |
2938 | - |
2939 | -You should have received a copy of the GNU General Public License along |
2940 | -with this program. If not, see <http://www.gnu.org/licenses/>. |
2941 | -*/ |
2942 | - |
2943 | -#ifndef __STATUS_PROVIDER_PIDGIN_H__ |
2944 | -#define __STATUS_PROVIDER_PIDGIN_H__ |
2945 | - |
2946 | -#include <glib.h> |
2947 | -#include <glib-object.h> |
2948 | - |
2949 | -#include "status-provider.h" |
2950 | - |
2951 | -G_BEGIN_DECLS |
2952 | - |
2953 | -#define STATUS_PROVIDER_PIDGIN_TYPE (status_provider_pidgin_get_type ()) |
2954 | -#define STATUS_PROVIDER_PIDGIN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), STATUS_PROVIDER_PIDGIN_TYPE, StatusProviderPidgin)) |
2955 | -#define STATUS_PROVIDER_PIDGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), STATUS_PROVIDER_PIDGIN_TYPE, StatusProviderPidginClass)) |
2956 | -#define IS_STATUS_PROVIDER_PIDGIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), STATUS_PROVIDER_PIDGIN_TYPE)) |
2957 | -#define IS_STATUS_PROVIDER_PIDGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), STATUS_PROVIDER_PIDGIN_TYPE)) |
2958 | -#define STATUS_PROVIDER_PIDGIN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), STATUS_PROVIDER_PIDGIN_TYPE, StatusProviderPidginClass)) |
2959 | - |
2960 | - |
2961 | -typedef struct _StatusProviderPidginClass StatusProviderPidginClass; |
2962 | -struct _StatusProviderPidginClass { |
2963 | - StatusProviderClass parent_class; |
2964 | -}; |
2965 | - |
2966 | -typedef struct _StatusProviderPidgin StatusProviderPidgin; |
2967 | -struct _StatusProviderPidgin { |
2968 | - StatusProvider parent; |
2969 | -}; |
2970 | - |
2971 | -GType status_provider_pidgin_get_type (void); |
2972 | -StatusProvider * status_provider_pidgin_new (void); |
2973 | - |
2974 | -G_END_DECLS |
2975 | - |
2976 | -#endif |
2977 | |
2978 | === removed file 'src/status-provider-pidgin.list' |
2979 | --- src/status-provider-pidgin.list 2009-08-17 19:22:11 +0000 |
2980 | +++ src/status-provider-pidgin.list 1970-01-01 00:00:00 +0000 |
2981 | @@ -1,1 +0,0 @@ |
2982 | -VOID:INT,INT |
2983 | |
2984 | === removed file 'src/status-provider-telepathy.c' |
2985 | --- src/status-provider-telepathy.c 2009-09-10 19:09:43 +0000 |
2986 | +++ src/status-provider-telepathy.c 1970-01-01 00:00:00 +0000 |
2987 | @@ -1,383 +0,0 @@ |
2988 | -/* |
2989 | -A small wrapper utility to load indicators and put them as menu items |
2990 | -into the gnome-panel using it's applet interface. |
2991 | - |
2992 | -Copyright 2009 Canonical Ltd. |
2993 | - |
2994 | -Authors: |
2995 | - Ted Gould <ted@canonical.com> |
2996 | - |
2997 | -This program is free software: you can redistribute it and/or modify it |
2998 | -under the terms of the GNU General Public License version 3, as published |
2999 | -by the Free Software Foundation. |
3000 | - |
3001 | -This program is distributed in the hope that it will be useful, but |
3002 | -WITHOUT ANY WARRANTY; without even the implied warranties of |
3003 | -MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR |
3004 | -PURPOSE. See the GNU General Public License for more details. |
3005 | - |
3006 | -You should have received a copy of the GNU General Public License along |
3007 | -with this program. If not, see <http://www.gnu.org/licenses/>. |
3008 | -*/ |
3009 | - |
3010 | -#ifdef HAVE_CONFIG_H |
3011 | -#include "config.h" |
3012 | -#endif |
3013 | - |
3014 | -#include "status-provider.h" |
3015 | -#include "status-provider-telepathy.h" |
3016 | -#include "status-provider-telepathy-marshal.h" |
3017 | - |
3018 | -#include <dbus/dbus-glib.h> |
3019 | - |
3020 | -typedef enum { |
3021 | - MC_STATUS_UNSET, |
3022 | - MC_STATUS_OFFLINE, |
3023 | - MC_STATUS_AVAILABLE, |
3024 | - MC_STATUS_AWAY, |
3025 | - MC_STATUS_EXTENDED_AWAY, |
3026 | - MC_STATUS_HIDDEN, |
3027 | - MC_STATUS_DND |
3028 | -} mc_status_t; |
3029 | - |
3030 | -static StatusProviderStatus mc_to_sp_map[] = { |
3031 | - /* MC_STATUS_UNSET, */ STATUS_PROVIDER_STATUS_OFFLINE, |
3032 | - /* MC_STATUS_OFFLINE, */ STATUS_PROVIDER_STATUS_OFFLINE, |
3033 | - /* MC_STATUS_AVAILABLE, */ STATUS_PROVIDER_STATUS_ONLINE, |
3034 | - /* MC_STATUS_AWAY, */ STATUS_PROVIDER_STATUS_AWAY, |
3035 | - /* MC_STATUS_EXTENDED_AWAY, */ STATUS_PROVIDER_STATUS_AWAY, |
3036 | - /* MC_STATUS_HIDDEN, */ STATUS_PROVIDER_STATUS_INVISIBLE, |
3037 | - /* MC_STATUS_DND */ STATUS_PROVIDER_STATUS_DND |
3038 | -}; |
3039 | - |
3040 | -static mc_status_t sp_to_mc_map[] = { |
3041 | - /* STATUS_PROVIDER_STATUS_ONLINE, */ MC_STATUS_AVAILABLE, |
3042 | - /* STATUS_PROVIDER_STATUS_AWAY, */ MC_STATUS_AWAY, |
3043 | - /* STATUS_PROVIDER_STATUS_DND */ MC_STATUS_DND, |
3044 | - /* STATUS_PROVIDER_STATUS_INVISIBLE*/ MC_STATUS_HIDDEN, |
3045 | - /* STATUS_PROVIDER_STATUS_OFFLINE */ MC_STATUS_OFFLINE, |
3046 | - /* STATUS_PROVIDER_STATUS_DISCONNECTED*/MC_STATUS_OFFLINE |
3047 | -}; |
3048 | - |
3049 | -typedef struct _StatusProviderTelepathyPrivate StatusProviderTelepathyPrivate; |
3050 | -struct _StatusProviderTelepathyPrivate { |
3051 | - DBusGProxy * proxy; |
3052 | - DBusGProxy * dbus_proxy; |
3053 | - mc_status_t mc_status; |
3054 | -}; |
3055 | - |
3056 | -#define STATUS_PROVIDER_TELEPATHY_GET_PRIVATE(o) \ |
3057 | -(G_TYPE_INSTANCE_GET_PRIVATE ((o), STATUS_PROVIDER_TELEPATHY_TYPE, StatusProviderTelepathyPrivate)) |
3058 | - |
3059 | -/* Prototypes */ |
3060 | -/* GObject stuff */ |
3061 | -static void status_provider_telepathy_class_init (StatusProviderTelepathyClass *klass); |
3062 | -static void status_provider_telepathy_init (StatusProviderTelepathy *self); |
3063 | -static void status_provider_telepathy_dispose (GObject *object); |
3064 | -static void status_provider_telepathy_finalize (GObject *object); |
3065 | -/* Internal Funcs */ |
3066 | -static void build_telepathy_proxy (StatusProviderTelepathy * self); |
3067 | -static void dbus_namechange (DBusGProxy * proxy, const gchar * name, const gchar * prev, const gchar * new, StatusProviderTelepathy * self); |
3068 | -static void set_status (StatusProvider * sp, StatusProviderStatus status); |
3069 | -static StatusProviderStatus get_status (StatusProvider * sp); |
3070 | -static void changed_status (DBusGProxy * proxy, guint status, gchar * message, StatusProvider * sp); |
3071 | -static void proxy_destroy (DBusGProxy * proxy, StatusProvider * sp); |
3072 | -static void get_status_async (DBusGProxy * proxy, DBusGProxyCall * call, gpointer userdata); |
3073 | - |
3074 | -G_DEFINE_TYPE (StatusProviderTelepathy, status_provider_telepathy, STATUS_PROVIDER_TYPE); |
3075 | - |
3076 | -static void |
3077 | -status_provider_telepathy_class_init (StatusProviderTelepathyClass *klass) |
3078 | -{ |
3079 | - GObjectClass *object_class = G_OBJECT_CLASS (klass); |
3080 | - |
3081 | - g_type_class_add_private (klass, sizeof (StatusProviderTelepathyPrivate)); |
3082 | - |
3083 | - object_class->dispose = status_provider_telepathy_dispose; |
3084 | - object_class->finalize = status_provider_telepathy_finalize; |
3085 | - |
3086 | - StatusProviderClass * spclass = STATUS_PROVIDER_CLASS(klass); |
3087 | - |
3088 | - spclass->set_status = set_status; |
3089 | - spclass->get_status = get_status; |
3090 | - |
3091 | - return; |
3092 | -} |
3093 | - |
3094 | - |
3095 | -static void |
3096 | -status_provider_telepathy_init (StatusProviderTelepathy *self) |
3097 | -{ |
3098 | - StatusProviderTelepathyPrivate * priv = STATUS_PROVIDER_TELEPATHY_GET_PRIVATE(self); |
3099 | - |
3100 | - priv->proxy = NULL; |
3101 | - priv->dbus_proxy = NULL; |
3102 | - priv->mc_status = MC_STATUS_OFFLINE; |
3103 | - |
3104 | - GError * error = NULL; |
3105 | - |
3106 | - /* Grabbing the session bus */ |
3107 | - DBusGConnection * bus = dbus_g_bus_get(DBUS_BUS_SESSION, &error); |
3108 | - if (bus == NULL) { |
3109 | - g_warning("Unable to connect to Session Bus: %s", error == NULL ? "No message" : error->message); |
3110 | - g_error_free(error); |
3111 | - return; |
3112 | - } |
3113 | - |
3114 | - /* Set up the dbus Proxy */ |
3115 | - priv->dbus_proxy = dbus_g_proxy_new_for_name_owner (bus, |
3116 | - DBUS_SERVICE_DBUS, |
3117 | - DBUS_PATH_DBUS, |
3118 | - DBUS_INTERFACE_DBUS, |
3119 | - &error); |
3120 | - if (error != NULL) { |
3121 | - g_warning("Unable to connect to DBus events: %s", error->message); |
3122 | - g_error_free(error); |
3123 | - return; |
3124 | - } |
3125 | - |
3126 | - /* Configure the name owner changing */ |
3127 | - dbus_g_proxy_add_signal(priv->dbus_proxy, "NameOwnerChanged", |
3128 | - G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, |
3129 | - G_TYPE_INVALID); |
3130 | - dbus_g_proxy_connect_signal(priv->dbus_proxy, "NameOwnerChanged", |
3131 | - G_CALLBACK(dbus_namechange), |
3132 | - self, NULL); |
3133 | - |
3134 | - build_telepathy_proxy(self); |
3135 | - |
3136 | - return; |
3137 | -} |
3138 | - |
3139 | -/* Builds up the proxy to Mission Control and configures all of the |
3140 | - signals for getting info from the proxy. Also does a call to get |
3141 | - the inital value of the status. */ |
3142 | -static void |
3143 | -build_telepathy_proxy (StatusProviderTelepathy * self) |
3144 | -{ |
3145 | - g_debug("Building Telepathy Proxy"); |
3146 | - StatusProviderTelepathyPrivate * priv = STATUS_PROVIDER_TELEPATHY_GET_PRIVATE(self); |
3147 | - |
3148 | - if (priv->proxy != NULL) { |
3149 | - g_debug("Hmm, being asked to build a proxy we alredy have."); |
3150 | - return; |
3151 | - } |
3152 | - |
3153 | - GError * error = NULL; |
3154 | - |
3155 | - /* Grabbing the session bus */ |
3156 | - DBusGConnection * session_bus = dbus_g_bus_get(DBUS_BUS_SESSION, &error); |
3157 | - if (session_bus == NULL) { |
3158 | - g_warning("Unable to connect to Session Bus: %s", error == NULL ? "No message" : error->message); |
3159 | - g_error_free(error); |
3160 | - return; |
3161 | - } |
3162 | - |
3163 | - /* Get the proxy to Mission Control */ |
3164 | - priv->proxy = dbus_g_proxy_new_for_name_owner(session_bus, |
3165 | - "org.freedesktop.Telepathy.MissionControl", |
3166 | - "/org/freedesktop/Telepathy/MissionControl", |
3167 | - "org.freedesktop.Telepathy.MissionControl", |
3168 | - &error); |
3169 | - |
3170 | - if (priv->proxy != NULL) { |
3171 | - /* If it goes, we set the proxy to NULL */ |
3172 | - g_object_add_weak_pointer (G_OBJECT(priv->proxy), (gpointer *)&priv->proxy); |
3173 | - /* And we clean up other variables associated */ |
3174 | - g_signal_connect(G_OBJECT(priv->proxy), "destroy", |
3175 | - G_CALLBACK(proxy_destroy), self); |
3176 | - |
3177 | - /* Set up the signal handler for watching when status changes. */ |
3178 | - dbus_g_object_register_marshaller(_status_provider_telepathy_marshal_VOID__UINT_STRING, |
3179 | - G_TYPE_NONE, |
3180 | - G_TYPE_UINT, |
3181 | - G_TYPE_STRING, |
3182 | - G_TYPE_INVALID); |
3183 | - dbus_g_proxy_add_signal (priv->proxy, |
3184 | - "PresenceChanged", |
3185 | - G_TYPE_UINT, |
3186 | - G_TYPE_STRING, |
3187 | - G_TYPE_INVALID); |
3188 | - dbus_g_proxy_connect_signal(priv->proxy, |
3189 | - "PresenceChanged", |
3190 | - G_CALLBACK(changed_status), |
3191 | - (void *)self, |
3192 | - NULL); |
3193 | - |
3194 | - /* Do a get here, to init the status */ |
3195 | - dbus_g_proxy_begin_call(priv->proxy, |
3196 | - "GetStatus", |
3197 | - get_status_async, |
3198 | - self, |
3199 | - NULL, |
3200 | - G_TYPE_INVALID); |
3201 | - } else { |
3202 | - g_warning("Unable to connect to Mission Control"); |
3203 | - if (error != NULL) { |
3204 | - g_error_free(error); |
3205 | - } |
3206 | - } |
3207 | - |
3208 | - return; |
3209 | -} |
3210 | - |
3211 | -/* Watch to see if the Mission Control comes up on Dbus */ |
3212 | -static void |
3213 | -dbus_namechange (DBusGProxy * proxy, const gchar * name, const gchar * prev, const gchar * new, StatusProviderTelepathy * self) |
3214 | -{ |
3215 | - g_return_if_fail(name != NULL); |
3216 | - g_return_if_fail(new != NULL); |
3217 | - |
3218 | - if (g_strcmp0(name, "org.freedesktop.Telepathy.MissionControl") == 0) { |
3219 | - build_telepathy_proxy(self); |
3220 | - } |
3221 | - return; |
3222 | -} |
3223 | - |
3224 | -static void |
3225 | -status_provider_telepathy_dispose (GObject *object) |
3226 | -{ |
3227 | - StatusProviderTelepathyPrivate * priv = STATUS_PROVIDER_TELEPATHY_GET_PRIVATE(object); |
3228 | - |
3229 | - if (priv->proxy != NULL) { |
3230 | - g_object_unref(priv->proxy); |
3231 | - priv->proxy = NULL; |
3232 | - } |
3233 | - |
3234 | - G_OBJECT_CLASS (status_provider_telepathy_parent_class)->dispose (object); |
3235 | - return; |
3236 | -} |
3237 | - |
3238 | -static void |
3239 | -status_provider_telepathy_finalize (GObject *object) |
3240 | -{ |
3241 | - |
3242 | - G_OBJECT_CLASS (status_provider_telepathy_parent_class)->finalize (object); |
3243 | - return; |
3244 | -} |
3245 | - |
3246 | -/** |
3247 | - status_provider_telepathy_new: |
3248 | - |
3249 | - Creates a new #StatusProviderTelepathy object. No parameters or anything |
3250 | - like that. Just a convience function. |
3251 | - |
3252 | - Return value: A new instance of #StatusProviderTelepathy |
3253 | -*/ |
3254 | -StatusProvider * |
3255 | -status_provider_telepathy_new (void) |
3256 | -{ |
3257 | - return STATUS_PROVIDER(g_object_new(STATUS_PROVIDER_TELEPATHY_TYPE, NULL)); |
3258 | -} |
3259 | - |
3260 | -static void |
3261 | -set_status (StatusProvider * sp, StatusProviderStatus status) |
3262 | -{ |
3263 | - StatusProviderTelepathyPrivate * priv = STATUS_PROVIDER_TELEPATHY_GET_PRIVATE(sp); |
3264 | - if (priv->proxy == NULL) { |
3265 | - priv->mc_status = MC_STATUS_OFFLINE; |
3266 | - return; |
3267 | - } |
3268 | - |
3269 | - priv->mc_status = sp_to_mc_map[status]; |
3270 | - |
3271 | - guint mcstatus = MC_STATUS_UNSET; |
3272 | - gboolean ret = FALSE; |
3273 | - GError * error = NULL; |
3274 | - |
3275 | - ret = dbus_g_proxy_call(priv->proxy, |
3276 | - "GetPresence", &error, |
3277 | - G_TYPE_INVALID, |
3278 | - G_TYPE_UINT, &priv->mc_status, |
3279 | - G_TYPE_INVALID); |
3280 | - |
3281 | - /* If we can't get the get call to work, let's not set */ |
3282 | - if (!ret) { |
3283 | - if (error != NULL) { |
3284 | - g_error_free(error); |
3285 | - } |
3286 | - return; |
3287 | - } |
3288 | - |
3289 | - /* If the get call doesn't return a status, that means that there |
3290 | - are no clients connected. We don't want to connect them by telling |
3291 | - MC that we're going online -- we'd like to be more passive than that. */ |
3292 | - if (mcstatus == MC_STATUS_UNSET) { |
3293 | - return; |
3294 | - } |
3295 | - |
3296 | - ret = dbus_g_proxy_call(priv->proxy, |
3297 | - "SetPresence", &error, |
3298 | - G_TYPE_UINT, priv->mc_status, |
3299 | - G_TYPE_STRING, "", |
3300 | - G_TYPE_INVALID, |
3301 | - G_TYPE_INVALID); |
3302 | - |
3303 | - if (!ret) { |
3304 | - if (error != NULL) { |
3305 | - g_warning("Unable to set Mission Control Presence: %s", error->message); |
3306 | - g_error_free(error); |
3307 | - } else { |
3308 | - g_warning("Unable to set Mission Control Presence"); |
3309 | - } |
3310 | - return; |
3311 | - } |
3312 | - |
3313 | - return; |
3314 | -} |
3315 | - |
3316 | -static StatusProviderStatus |
3317 | -get_status (StatusProvider * sp) |
3318 | -{ |
3319 | - g_return_val_if_fail(IS_STATUS_PROVIDER_TELEPATHY(sp), STATUS_PROVIDER_STATUS_DISCONNECTED); |
3320 | - StatusProviderTelepathyPrivate * priv = STATUS_PROVIDER_TELEPATHY_GET_PRIVATE(sp); |
3321 | - |
3322 | - if (priv->proxy == NULL) { |
3323 | - return STATUS_PROVIDER_STATUS_DISCONNECTED; |
3324 | - } |
3325 | - |
3326 | - return mc_to_sp_map[priv->mc_status]; |
3327 | -} |
3328 | - |
3329 | -static void |
3330 | -changed_status (DBusGProxy * proxy, guint status, gchar * message, StatusProvider * sp) |
3331 | -{ |
3332 | - StatusProviderTelepathyPrivate * priv = STATUS_PROVIDER_TELEPATHY_GET_PRIVATE(sp); |
3333 | - priv->mc_status = status; |
3334 | - g_signal_emit(G_OBJECT(sp), STATUS_PROVIDER_SIGNAL_STATUS_CHANGED_ID, 0, mc_to_sp_map[priv->mc_status], TRUE); |
3335 | -} |
3336 | - |
3337 | -static void |
3338 | -proxy_destroy (DBusGProxy * proxy, StatusProvider * sp) |
3339 | -{ |
3340 | - g_debug("Signal: Mission Control proxy destroyed"); |
3341 | - g_signal_emit(G_OBJECT(sp), STATUS_PROVIDER_SIGNAL_STATUS_CHANGED_ID, 0, STATUS_PROVIDER_STATUS_OFFLINE, TRUE); |
3342 | - return; |
3343 | -} |
3344 | - |
3345 | -static void |
3346 | -get_status_async (DBusGProxy * proxy, DBusGProxyCall * call, gpointer userdata) |
3347 | -{ |
3348 | - GError * error = NULL; |
3349 | - guint status = 0; |
3350 | - if (!dbus_g_proxy_end_call(proxy, call, &error, G_TYPE_UINT, &status, G_TYPE_INVALID)) { |
3351 | - g_warning("Unable to get type from Mission Control: %s", error->message); |
3352 | - g_error_free(error); |
3353 | - return; |
3354 | - } |
3355 | - |
3356 | - StatusProviderTelepathyPrivate * priv = STATUS_PROVIDER_TELEPATHY_GET_PRIVATE(userdata); |
3357 | - |
3358 | - gboolean changed = FALSE; |
3359 | - if (status != priv->mc_status) { |
3360 | - changed = TRUE; |
3361 | - } |
3362 | - |
3363 | - priv->mc_status = status; |
3364 | - |
3365 | - if (changed) { |
3366 | - g_signal_emit(G_OBJECT(userdata), STATUS_PROVIDER_SIGNAL_STATUS_CHANGED_ID, 0, mc_to_sp_map[priv->mc_status], TRUE); |
3367 | - } |
3368 | - |
3369 | - return; |
3370 | -} |
3371 | |
3372 | === removed file 'src/status-provider-telepathy.h' |
3373 | --- src/status-provider-telepathy.h 2009-08-17 22:20:45 +0000 |
3374 | +++ src/status-provider-telepathy.h 1970-01-01 00:00:00 +0000 |
3375 | @@ -1,56 +0,0 @@ |
3376 | -/* |
3377 | -A small wrapper utility to load indicators and put them as menu items |
3378 | -into the gnome-panel using it's applet interface. |
3379 | - |
3380 | -Copyright 2009 Canonical Ltd. |
3381 | - |
3382 | -Authors: |
3383 | - Ted Gould <ted@canonical.com> |
3384 | - |
3385 | -This program is free software: you can redistribute it and/or modify it |
3386 | -under the terms of the GNU General Public License version 3, as published |
3387 | -by the Free Software Foundation. |
3388 | - |
3389 | -This program is distributed in the hope that it will be useful, but |
3390 | -WITHOUT ANY WARRANTY; without even the implied warranties of |
3391 | -MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR |
3392 | -PURPOSE. See the GNU General Public License for more details. |
3393 | - |
3394 | -You should have received a copy of the GNU General Public License along |
3395 | -with this program. If not, see <http://www.gnu.org/licenses/>. |
3396 | -*/ |
3397 | - |
3398 | -#ifndef __STATUS_PROVIDER_TELEPATHY_H__ |
3399 | -#define __STATUS_PROVIDER_TELEPATHY_H__ |
3400 | - |
3401 | -#include <glib.h> |
3402 | -#include <glib-object.h> |
3403 | - |
3404 | -#include "status-provider.h" |
3405 | - |
3406 | -G_BEGIN_DECLS |
3407 | - |
3408 | -#define STATUS_PROVIDER_TELEPATHY_TYPE (status_provider_telepathy_get_type ()) |
3409 | -#define STATUS_PROVIDER_TELEPATHY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), STATUS_PROVIDER_TELEPATHY_TYPE, StatusProviderTelepathy)) |
3410 | -#define STATUS_PROVIDER_TELEPATHY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), STATUS_PROVIDER_TELEPATHY_TYPE, StatusProviderTelepathyClass)) |
3411 | -#define IS_STATUS_PROVIDER_TELEPATHY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), STATUS_PROVIDER_TELEPATHY_TYPE)) |
3412 | -#define IS_STATUS_PROVIDER_TELEPATHY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), STATUS_PROVIDER_TELEPATHY_TYPE)) |
3413 | -#define STATUS_PROVIDER_TELEPATHY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), STATUS_PROVIDER_TELEPATHY_TYPE, StatusProviderTelepathyClass)) |
3414 | - |
3415 | - |
3416 | -typedef struct _StatusProviderTelepathyClass StatusProviderTelepathyClass; |
3417 | -struct _StatusProviderTelepathyClass { |
3418 | - StatusProviderClass parent_class; |
3419 | -}; |
3420 | - |
3421 | -typedef struct _StatusProviderTelepathy StatusProviderTelepathy; |
3422 | -struct _StatusProviderTelepathy { |
3423 | - StatusProvider parent; |
3424 | -}; |
3425 | - |
3426 | -GType status_provider_telepathy_get_type (void); |
3427 | -StatusProvider * status_provider_telepathy_new (void); |
3428 | - |
3429 | -G_END_DECLS |
3430 | - |
3431 | -#endif |
3432 | |
3433 | === removed file 'src/status-provider-telepathy.list' |
3434 | --- src/status-provider-telepathy.list 2009-08-17 22:07:07 +0000 |
3435 | +++ src/status-provider-telepathy.list 1970-01-01 00:00:00 +0000 |
3436 | @@ -1,1 +0,0 @@ |
3437 | -VOID:UINT,STRING |
3438 | |
3439 | === removed file 'src/status-provider.c' |
3440 | --- src/status-provider.c 2009-08-25 04:43:50 +0000 |
3441 | +++ src/status-provider.c 1970-01-01 00:00:00 +0000 |
3442 | @@ -1,101 +0,0 @@ |
3443 | -/* |
3444 | -A small wrapper utility to load indicators and put them as menu items |
3445 | -into the gnome-panel using it's applet interface. |
3446 | - |
3447 | -Copyright 2009 Canonical Ltd. |
3448 | - |
3449 | -Authors: |
3450 | - Ted Gould <ted@canonical.com> |
3451 | - |
3452 | -This program is free software: you can redistribute it and/or modify it |
3453 | -under the terms of the GNU General Public License version 3, as published |
3454 | -by the Free Software Foundation. |
3455 | - |
3456 | -This program is distributed in the hope that it will be useful, but |
3457 | -WITHOUT ANY WARRANTY; without even the implied warranties of |
3458 | -MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR |
3459 | -PURPOSE. See the GNU General Public License for more details. |
3460 | - |
3461 | -You should have received a copy of the GNU General Public License along |
3462 | -with this program. If not, see <http://www.gnu.org/licenses/>. |
3463 | -*/ |
3464 | - |
3465 | -#ifdef HAVE_CONFIG_H |
3466 | -#include "config.h" |
3467 | -#endif |
3468 | - |
3469 | -#include "status-provider.h" |
3470 | - |
3471 | -/* Signals */ |
3472 | -enum { |
3473 | - STATUS_CHANGED, |
3474 | - LAST_SIGNAL |
3475 | -}; |
3476 | - |
3477 | -static guint signals[LAST_SIGNAL] = { 0 }; |
3478 | - |
3479 | -/* GObject Boilerplate */ |
3480 | -static void status_provider_class_init (StatusProviderClass *klass); |
3481 | -static void status_provider_init (StatusProvider *self); |
3482 | - |
3483 | -G_DEFINE_TYPE (StatusProvider, status_provider, G_TYPE_OBJECT); |
3484 | - |
3485 | -static void |
3486 | -status_provider_class_init (StatusProviderClass *klass) |
3487 | -{ |
3488 | - // GObjectClass *object_class = G_OBJECT_CLASS (klass); |
3489 | - |
3490 | - klass->status_changed = NULL; |
3491 | - |
3492 | - klass->set_status = NULL; |
3493 | - klass->get_status = NULL; |
3494 | - |
3495 | - /** |
3496 | - StatusProvider::status-changed: |
3497 | - @arg0: The #StatusProvider object. |
3498 | - @arg1: The new status #StatusProviderStatus |
3499 | - |
3500 | - Should be emitted by subclasses everytime that the status |
3501 | - changes externally to us. |
3502 | - */ |
3503 | - signals[STATUS_CHANGED] = g_signal_new(STATUS_PROVIDER_SIGNAL_STATUS_CHANGED, |
3504 | - G_TYPE_FROM_CLASS(klass), |
3505 | - G_SIGNAL_RUN_LAST, |
3506 | - G_STRUCT_OFFSET(StatusProviderClass, status_changed), |
3507 | - NULL, NULL, |
3508 | - g_cclosure_marshal_VOID__UINT, |
3509 | - G_TYPE_NONE, 1, G_TYPE_UINT); |
3510 | - |
3511 | - return; |
3512 | -} |
3513 | - |
3514 | -static void |
3515 | -status_provider_init (StatusProvider *self) |
3516 | -{ |
3517 | - |
3518 | - return; |
3519 | -} |
3520 | - |
3521 | -void |
3522 | -status_provider_set_status (StatusProvider * sp, StatusProviderStatus status) |
3523 | -{ |
3524 | - g_return_if_fail(IS_STATUS_PROVIDER(sp)); |
3525 | - |
3526 | - StatusProviderClass * class = STATUS_PROVIDER_GET_CLASS(sp); |
3527 | - g_return_if_fail(class != NULL); |
3528 | - g_return_if_fail(class->set_status != NULL); |
3529 | - |
3530 | - return class->set_status(sp, status); |
3531 | -} |
3532 | - |
3533 | -StatusProviderStatus |
3534 | -status_provider_get_status (StatusProvider * sp) |
3535 | -{ |
3536 | - g_return_val_if_fail(IS_STATUS_PROVIDER(sp), STATUS_PROVIDER_STATUS_OFFLINE); |
3537 | - |
3538 | - StatusProviderClass * class = STATUS_PROVIDER_GET_CLASS(sp); |
3539 | - g_return_val_if_fail(class->get_status != NULL, STATUS_PROVIDER_STATUS_OFFLINE); |
3540 | - |
3541 | - return class->get_status(sp); |
3542 | -} |
3543 | - |
3544 | |
3545 | === removed file 'src/status-provider.h' |
3546 | --- src/status-provider.h 2009-09-10 17:10:07 +0000 |
3547 | +++ src/status-provider.h 1970-01-01 00:00:00 +0000 |
3548 | @@ -1,78 +0,0 @@ |
3549 | -/* |
3550 | -A small wrapper utility to load indicators and put them as menu items |
3551 | -into the gnome-panel using it's applet interface. |
3552 | - |
3553 | -Copyright 2009 Canonical Ltd. |
3554 | - |
3555 | -Authors: |
3556 | - Ted Gould <ted@canonical.com> |
3557 | - |
3558 | -This program is free software: you can redistribute it and/or modify it |
3559 | -under the terms of the GNU General Public License version 3, as published |
3560 | -by the Free Software Foundation. |
3561 | - |
3562 | -This program is distributed in the hope that it will be useful, but |
3563 | -WITHOUT ANY WARRANTY; without even the implied warranties of |
3564 | -MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR |
3565 | -PURPOSE. See the GNU General Public License for more details. |
3566 | - |
3567 | -You should have received a copy of the GNU General Public License along |
3568 | -with this program. If not, see <http://www.gnu.org/licenses/>. |
3569 | -*/ |
3570 | - |
3571 | -#ifndef __STATUS_PROVIDER_H__ |
3572 | -#define __STATUS_PROVIDER_H__ |
3573 | - |
3574 | -#include <glib.h> |
3575 | -#include <glib-object.h> |
3576 | - |
3577 | -G_BEGIN_DECLS |
3578 | - |
3579 | -#define STATUS_PROVIDER_TYPE (status_provider_get_type ()) |
3580 | -#define STATUS_PROVIDER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), STATUS_PROVIDER_TYPE, StatusProvider)) |
3581 | -#define STATUS_PROVIDER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), STATUS_PROVIDER_TYPE, StatusProviderClass)) |
3582 | -#define IS_STATUS_PROVIDER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), STATUS_PROVIDER_TYPE)) |
3583 | -#define IS_STATUS_PROVIDER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), STATUS_PROVIDER_TYPE)) |
3584 | -#define STATUS_PROVIDER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), STATUS_PROVIDER_TYPE, StatusProviderClass)) |
3585 | - |
3586 | -typedef enum |
3587 | -{ |
3588 | - STATUS_PROVIDER_STATUS_ONLINE, |
3589 | - STATUS_PROVIDER_STATUS_AWAY, |
3590 | - STATUS_PROVIDER_STATUS_DND, |
3591 | - STATUS_PROVIDER_STATUS_INVISIBLE, |
3592 | - STATUS_PROVIDER_STATUS_OFFLINE, |
3593 | - STATUS_PROVIDER_STATUS_DISCONNECTED, |
3594 | - /* Leave as last */ |
3595 | - STATUS_PROVIDER_STATUS_LAST |
3596 | -} |
3597 | -StatusProviderStatus; |
3598 | - |
3599 | -#define STATUS_PROVIDER_SIGNAL_STATUS_CHANGED "status-changed" |
3600 | -#define STATUS_PROVIDER_SIGNAL_STATUS_CHANGED_ID (g_signal_lookup(STATUS_PROVIDER_SIGNAL_STATUS_CHANGED, STATUS_PROVIDER_TYPE)) |
3601 | - |
3602 | -typedef struct _StatusProvider StatusProvider; |
3603 | -struct _StatusProvider { |
3604 | - GObject parent; |
3605 | -}; |
3606 | - |
3607 | -typedef struct _StatusProviderClass StatusProviderClass; |
3608 | -struct _StatusProviderClass { |
3609 | - GObjectClass parent_class; |
3610 | - |
3611 | - /* Signals */ |
3612 | - void (*status_changed) (StatusProviderStatus newstatus); |
3613 | - |
3614 | - /* Virtual Functions */ |
3615 | - void (*set_status) (StatusProvider * sp, StatusProviderStatus newstatus); |
3616 | - StatusProviderStatus (*get_status) (StatusProvider * sp); |
3617 | -}; |
3618 | - |
3619 | -GType status_provider_get_type (void); |
3620 | - |
3621 | -void status_provider_set_status (StatusProvider * sp, StatusProviderStatus status); |
3622 | -StatusProviderStatus status_provider_get_status (StatusProvider * sp); |
3623 | - |
3624 | -G_END_DECLS |
3625 | - |
3626 | -#endif |
3627 | |
3628 | === removed file 'src/status-service-dbus.c' |
3629 | --- src/status-service-dbus.c 2009-08-08 20:54:51 +0000 |
3630 | +++ src/status-service-dbus.c 1970-01-01 00:00:00 +0000 |
3631 | @@ -1,205 +0,0 @@ |
3632 | -/* |
3633 | -A small wrapper utility to load indicators and put them as menu items |
3634 | -into the gnome-panel using it's applet interface. |
3635 | - |
3636 | -Copyright 2009 Canonical Ltd. |
3637 | - |
3638 | -Authors: |
3639 | - Ted Gould <ted@canonical.com> |
3640 | - |
3641 | -This program is free software: you can redistribute it and/or modify it |
3642 | -under the terms of the GNU General Public License version 3, as published |
3643 | -by the Free Software Foundation. |
3644 | - |
3645 | -This program is distributed in the hope that it will be useful, but |
3646 | -WITHOUT ANY WARRANTY; without even the implied warranties of |
3647 | -MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR |
3648 | -PURPOSE. See the GNU General Public License for more details. |
3649 | - |
3650 | -You should have received a copy of the GNU General Public License along |
3651 | -with this program. If not, see <http://www.gnu.org/licenses/>. |
3652 | -*/ |
3653 | - |
3654 | -#ifdef HAVE_CONFIG_H |
3655 | -#include "config.h" |
3656 | -#endif |
3657 | - |
3658 | -#include <dbus/dbus-glib.h> |
3659 | - |
3660 | -#include "dbus-shared-names.h" |
3661 | -#include "status-service-dbus.h" |
3662 | - |
3663 | -static void status_service_dbus_class_init (StatusServiceDbusClass *klass); |
3664 | -static void status_service_dbus_init (StatusServiceDbus *self); |
3665 | -static void status_service_dbus_dispose (GObject *object); |
3666 | -static void status_service_dbus_finalize (GObject *object); |
3667 | -static gboolean _status_service_server_watch (StatusServiceDbus * service, GError ** error); |
3668 | -static gboolean _status_service_server_status_icons (StatusServiceDbus * service, gchar ** icon, GError ** error); |
3669 | -static gboolean _status_service_server_pretty_user_name (StatusServiceDbus * service, gchar ** username, GError ** error); |
3670 | - |
3671 | -#include "status-service-server.h" |
3672 | - |
3673 | -/* Private */ |
3674 | -typedef struct _StatusServiceDbusPrivate StatusServiceDbusPrivate; |
3675 | -struct _StatusServiceDbusPrivate |
3676 | -{ |
3677 | - gchar * name; |
3678 | - gchar * icon; |
3679 | -}; |
3680 | - |
3681 | -#define STATUS_SERVICE_DBUS_GET_PRIVATE(o) \ |
3682 | - (G_TYPE_INSTANCE_GET_PRIVATE ((o), STATUS_SERVICE_DBUS_TYPE, StatusServiceDbusPrivate)) |
3683 | - |
3684 | -/* Signals */ |
3685 | -enum { |
3686 | - USER_CHANGED, |
3687 | - STATUS_ICONS_CHANGED, |
3688 | - LAST_SIGNAL |
3689 | -}; |
3690 | - |
3691 | -static guint signals[LAST_SIGNAL] = { 0 }; |
3692 | - |
3693 | -/* GObject Boilerplate */ |
3694 | -G_DEFINE_TYPE (StatusServiceDbus, status_service_dbus, G_TYPE_OBJECT); |
3695 | - |
3696 | -static void |
3697 | -status_service_dbus_class_init (StatusServiceDbusClass *klass) |
3698 | -{ |
3699 | - GObjectClass *object_class = G_OBJECT_CLASS (klass); |
3700 | - |
3701 | - g_type_class_add_private (object_class, sizeof(StatusServiceDbusPrivate)); |
3702 | - |
3703 | - object_class->dispose = status_service_dbus_dispose; |
3704 | - object_class->finalize = status_service_dbus_finalize; |
3705 | - |
3706 | - /** |
3707 | - StatusServiceDbus::user-changed: |
3708 | - @arg0: The #StatusServiceDbus object. |
3709 | - @arg1: The place to put the new user name |
3710 | - |
3711 | - Signals that the user name has changed and gives the |
3712 | - new user name. |
3713 | - */ |
3714 | - signals[USER_CHANGED] = g_signal_new("user-changed", |
3715 | - G_TYPE_FROM_CLASS(klass), |
3716 | - G_SIGNAL_RUN_LAST, |
3717 | - G_STRUCT_OFFSET(StatusServiceDbusClass, user_changed), |
3718 | - NULL, NULL, |
3719 | - g_cclosure_marshal_VOID__POINTER, |
3720 | - G_TYPE_NONE, 1, G_TYPE_POINTER); |
3721 | - |
3722 | - /** |
3723 | - StatusServiceDbus::status-icons-changed: |
3724 | - @arg0: The #StatusServiceDbus object. |
3725 | - @arg1: The list of icon names representing the statuses in |
3726 | - the order they should be displayed. Left to right. |
3727 | - |
3728 | - Signals that the user status set has changed and that |
3729 | - new icons may need to be loaded. The list of icons will |
3730 | - always be complete. |
3731 | - */ |
3732 | - signals[STATUS_ICONS_CHANGED] = g_signal_new("status-icons-changed", |
3733 | - G_TYPE_FROM_CLASS(klass), |
3734 | - G_SIGNAL_RUN_LAST, |
3735 | - G_STRUCT_OFFSET(StatusServiceDbusClass, status_icons_changed), |
3736 | - NULL, NULL, |
3737 | - g_cclosure_marshal_VOID__STRING, |
3738 | - G_TYPE_NONE, 1, G_TYPE_STRING); |
3739 | - |
3740 | - dbus_g_object_type_install_info(STATUS_SERVICE_DBUS_TYPE, &dbus_glib__status_service_server_object_info); |
3741 | - |
3742 | - return; |
3743 | -} |
3744 | - |
3745 | -static void |
3746 | -status_service_dbus_init (StatusServiceDbus *self) |
3747 | -{ |
3748 | - |
3749 | - DBusGConnection * connection = dbus_g_bus_get(DBUS_BUS_SESSION, NULL); |
3750 | - dbus_g_connection_register_g_object(connection, |
3751 | - INDICATOR_STATUS_SERVICE_DBUS_OBJECT, |
3752 | - G_OBJECT(self)); |
3753 | - |
3754 | - StatusServiceDbusPrivate * priv = STATUS_SERVICE_DBUS_GET_PRIVATE(self); |
3755 | - priv->name = NULL; |
3756 | - priv->icon = NULL; |
3757 | - |
3758 | - return; |
3759 | -} |
3760 | - |
3761 | -static void |
3762 | -status_service_dbus_dispose (GObject *object) |
3763 | -{ |
3764 | - |
3765 | - G_OBJECT_CLASS (status_service_dbus_parent_class)->dispose (object); |
3766 | - return; |
3767 | -} |
3768 | - |
3769 | -static void |
3770 | -status_service_dbus_finalize (GObject *object) |
3771 | -{ |
3772 | - |
3773 | - G_OBJECT_CLASS (status_service_dbus_parent_class)->finalize (object); |
3774 | - return; |
3775 | -} |
3776 | - |
3777 | -static gboolean |
3778 | -_status_service_server_watch (StatusServiceDbus * service, GError ** error) |
3779 | -{ |
3780 | - |
3781 | - return TRUE; |
3782 | -} |
3783 | - |
3784 | -static gboolean |
3785 | -_status_service_server_status_icons (StatusServiceDbus * service, gchar ** icon, GError ** error) |
3786 | -{ |
3787 | - if (!IS_STATUS_SERVICE_DBUS(service)) { |
3788 | - g_warning("NO BAD EVIL!"); |
3789 | - return FALSE; |
3790 | - } |
3791 | - |
3792 | - StatusServiceDbusPrivate * priv = STATUS_SERVICE_DBUS_GET_PRIVATE(service); |
3793 | - if (priv->icon == NULL) { |
3794 | - *icon = g_strdup(""); |
3795 | - } else { |
3796 | - *icon = g_strdup(priv->icon); |
3797 | - } |
3798 | - |
3799 | - return TRUE; |
3800 | -} |
3801 | - |
3802 | -static gboolean |
3803 | -_status_service_server_pretty_user_name (StatusServiceDbus * service, gchar ** username, GError ** error) |
3804 | -{ |
3805 | - if (!IS_STATUS_SERVICE_DBUS(service)) { |
3806 | - g_warning("NO BAD EVIL!"); |
3807 | - return FALSE; |
3808 | - } |
3809 | - |
3810 | - StatusServiceDbusPrivate * priv = STATUS_SERVICE_DBUS_GET_PRIVATE(service); |
3811 | - if (priv->name == NULL) { |
3812 | - *username = g_strdup(""); |
3813 | - } else { |
3814 | - *username = g_strdup(priv->name); |
3815 | - } |
3816 | - |
3817 | - return TRUE; |
3818 | -} |
3819 | - |
3820 | -void |
3821 | -status_service_dbus_set_status (StatusServiceDbus * self, const gchar * icon) |
3822 | -{ |
3823 | - g_return_if_fail(IS_STATUS_SERVICE_DBUS(self)); |
3824 | - |
3825 | - g_debug("Setting icon to: %s", icon); |
3826 | - |
3827 | - StatusServiceDbusPrivate * priv = STATUS_SERVICE_DBUS_GET_PRIVATE(self); |
3828 | - |
3829 | - if (priv->icon != NULL) { |
3830 | - g_free(priv->icon); |
3831 | - } |
3832 | - priv->icon = g_strdup(icon); |
3833 | - |
3834 | - g_signal_emit(G_OBJECT(self), signals[STATUS_ICONS_CHANGED], 0, priv->icon, TRUE); |
3835 | - return; |
3836 | -} |
3837 | |
3838 | === removed file 'src/status-service-dbus.h' |
3839 | --- src/status-service-dbus.h 2009-08-08 12:24:04 +0000 |
3840 | +++ src/status-service-dbus.h 1970-01-01 00:00:00 +0000 |
3841 | @@ -1,59 +0,0 @@ |
3842 | -/* |
3843 | -A small wrapper utility to load indicators and put them as menu items |
3844 | -into the gnome-panel using it's applet interface. |
3845 | - |
3846 | -Copyright 2009 Canonical Ltd. |
3847 | - |
3848 | -Authors: |
3849 | - Ted Gould <ted@canonical.com> |
3850 | - |
3851 | -This program is free software: you can redistribute it and/or modify it |
3852 | -under the terms of the GNU General Public License version 3, as published |
3853 | -by the Free Software Foundation. |
3854 | - |
3855 | -This program is distributed in the hope that it will be useful, but |
3856 | -WITHOUT ANY WARRANTY; without even the implied warranties of |
3857 | -MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR |
3858 | -PURPOSE. See the GNU General Public License for more details. |
3859 | - |
3860 | -You should have received a copy of the GNU General Public License along |
3861 | -with this program. If not, see <http://www.gnu.org/licenses/>. |
3862 | -*/ |
3863 | - |
3864 | -#ifndef __STATUS_SERVICE_DBUS_H__ |
3865 | -#define __STATUS_SERVICE_DBUS_H__ |
3866 | - |
3867 | -#include <glib.h> |
3868 | -#include <glib-object.h> |
3869 | - |
3870 | -G_BEGIN_DECLS |
3871 | - |
3872 | -#define STATUS_SERVICE_DBUS_TYPE (status_service_dbus_get_type ()) |
3873 | -#define STATUS_SERVICE_DBUS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), STATUS_SERVICE_DBUS_TYPE, StatusServiceDbus)) |
3874 | -#define STATUS_SERVICE_DBUS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), STATUS_SERVICE_DBUS_TYPE, StatusServiceDbusClass)) |
3875 | -#define IS_STATUS_SERVICE_DBUS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), STATUS_SERVICE_DBUS_TYPE)) |
3876 | -#define IS_STATUS_SERVICE_DBUS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), STATUS_SERVICE_DBUS_TYPE)) |
3877 | -#define STATUS_SERVICE_DBUS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), STATUS_SERVICE_DBUS_TYPE, StatusServiceDbusClass)) |
3878 | - |
3879 | -typedef struct _StatusServiceDbus StatusServiceDbus; |
3880 | -typedef struct _StatusServiceDbusClass StatusServiceDbusClass; |
3881 | - |
3882 | -struct _StatusServiceDbusClass { |
3883 | - GObjectClass parent_class; |
3884 | - |
3885 | - /* Signals */ |
3886 | - gboolean (*user_changed) (StatusServiceDbus * self, gchar ** name, gpointer user_data); |
3887 | - gboolean (*status_icons_changed) (StatusServiceDbus * self, GArray ** icons, gpointer user_data); |
3888 | - |
3889 | -}; |
3890 | - |
3891 | -struct _StatusServiceDbus { |
3892 | - GObject parent; |
3893 | -}; |
3894 | - |
3895 | -GType status_service_dbus_get_type (void); |
3896 | -void status_service_dbus_set_status (StatusServiceDbus * self, const gchar * icon); |
3897 | - |
3898 | -G_END_DECLS |
3899 | - |
3900 | -#endif |
3901 | |
3902 | === removed file 'src/status-service.c' |
3903 | --- src/status-service.c 2009-10-06 22:52:51 +0000 |
3904 | +++ src/status-service.c 1970-01-01 00:00:00 +0000 |
3905 | @@ -1,265 +0,0 @@ |
3906 | -/* |
3907 | -A small wrapper utility to load indicators and put them as menu items |
3908 | -into the gnome-panel using it's applet interface. |
3909 | - |
3910 | -Copyright 2009 Canonical Ltd. |
3911 | - |
3912 | -Authors: |
3913 | - Ted Gould <ted@canonical.com> |
3914 | - |
3915 | -This program is free software: you can redistribute it and/or modify it |
3916 | -under the terms of the GNU General Public License version 3, as published |
3917 | -by the Free Software Foundation. |
3918 | - |
3919 | -This program is distributed in the hope that it will be useful, but |
3920 | -WITHOUT ANY WARRANTY; without even the implied warranties of |
3921 | -MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR |
3922 | -PURPOSE. See the GNU General Public License for more details. |
3923 | - |
3924 | -You should have received a copy of the GNU General Public License along |
3925 | -with this program. If not, see <http://www.gnu.org/licenses/>. |
3926 | -*/ |
3927 | - |
3928 | -#include <config.h> |
3929 | - |
3930 | -#include <sys/types.h> |
3931 | -#include <pwd.h> |
3932 | -#include <unistd.h> |
3933 | - |
3934 | -#include <glib/gi18n.h> |
3935 | - |
3936 | -#include <dbus/dbus-glib.h> |
3937 | -#include <dbus/dbus-glib-bindings.h> |
3938 | - |
3939 | -#include <libdbusmenu-glib/client.h> |
3940 | -#include <libdbusmenu-glib/server.h> |
3941 | -#include <libdbusmenu-glib/menuitem.h> |
3942 | - |
3943 | -#include "dbus-shared-names.h" |
3944 | - |
3945 | -#include "status-service-dbus.h" |
3946 | - |
3947 | -#include "status-provider.h" |
3948 | -#include "status-provider-mc5.h" |
3949 | -#include "status-provider-pidgin.h" |
3950 | -#include "status-provider-telepathy.h" |
3951 | - |
3952 | -typedef StatusProvider * (*newfunc) (void); |
3953 | -#define STATUS_PROVIDER_CNT 3 |
3954 | -static newfunc status_provider_newfuncs[STATUS_PROVIDER_CNT] = { |
3955 | - status_provider_mc5_new, |
3956 | - status_provider_pidgin_new, |
3957 | - status_provider_telepathy_new |
3958 | -}; |
3959 | -static StatusProvider * status_providers[STATUS_PROVIDER_CNT] = { 0 }; |
3960 | - |
3961 | -static const gchar * status_strings [STATUS_PROVIDER_STATUS_LAST] = { |
3962 | - /* STATUS_PROVIDER_STATUS_ONLINE, */ N_("Available"), |
3963 | - /* STATUS_PROVIDER_STATUS_AWAY, */ N_("Away"), |
3964 | - /* STATUS_PROVIDER_STATUS_DND */ N_("Busy"), |
3965 | - /* STATUS_PROVIDER_STATUS_INVISIBLE */ N_("Invisible"), |
3966 | - /* STATUS_PROVIDER_STATUS_OFFLINE, */ N_("Offline"), |
3967 | - /* STATUS_PROVIDER_STATUS_DISCONNECTED*/ N_("Offline") |
3968 | -}; |
3969 | - |
3970 | -static const gchar * status_icons[STATUS_PROVIDER_STATUS_LAST] = { |
3971 | - /* STATUS_PROVIDER_STATUS_ONLINE, */ "user-available", |
3972 | - /* STATUS_PROVIDER_STATUS_AWAY, */ "user-away", |
3973 | - /* STATUS_PROVIDER_STATUS_DND, */ "user-busy", |
3974 | - /* STATUS_PROVIDER_STATUS_INVISIBLE, */ "user-invisible", |
3975 | - /* STATUS_PROVIDER_STATUS_OFFLINE */ "user-offline", |
3976 | - /* STATUS_PROVIDER_STATUS_DISCONNECTED */"system-shutdown-panel" |
3977 | -}; |
3978 | - |
3979 | - |
3980 | -static DbusmenuMenuitem * root_menuitem = NULL; |
3981 | -static DbusmenuMenuitem * status_menuitem = NULL; |
3982 | -static DbusmenuMenuitem * status_menuitems[STATUS_PROVIDER_STATUS_LAST] = {0}; |
3983 | -static GMainLoop * mainloop = NULL; |
3984 | -static StatusServiceDbus * dbus_interface = NULL; |
3985 | -static StatusProviderStatus global_status = STATUS_PROVIDER_STATUS_DISCONNECTED; |
3986 | - |
3987 | -static void |
3988 | -status_update (void) { |
3989 | - StatusProviderStatus oldglobal = global_status; |
3990 | - global_status = STATUS_PROVIDER_STATUS_DISCONNECTED; |
3991 | - |
3992 | - /* Ask everyone what they think the status should be, if |
3993 | - they're more connected, up the global level */ |
3994 | - int i; |
3995 | - for (i = 0; i < STATUS_PROVIDER_CNT; i++) { |
3996 | - StatusProviderStatus localstatus = status_provider_get_status(status_providers[i]); |
3997 | - if (localstatus < global_status) { |
3998 | - global_status = localstatus; |
3999 | - } |
4000 | - } |
4001 | - |
4002 | - /* If changed */ |
4003 | - if (global_status != oldglobal) { |
4004 | - g_debug("Global status changed to: %s", _(status_strings[global_status])); |
4005 | - |
4006 | - /* Configure the icon on the panel */ |
4007 | - status_service_dbus_set_status(dbus_interface, status_icons[global_status]); |
4008 | - |
4009 | - /* If we're now disconnected, make setting the statuses |
4010 | - insensitive. */ |
4011 | - if (global_status == STATUS_PROVIDER_STATUS_DISCONNECTED) { |
4012 | - StatusProviderStatus i; |
4013 | - for (i = STATUS_PROVIDER_STATUS_ONLINE; i < STATUS_PROVIDER_STATUS_LAST; i++) { |
4014 | - if (status_menuitems[i] == NULL) continue; |
4015 | - dbusmenu_menuitem_property_set(status_menuitems[i], DBUSMENU_MENUITEM_PROP_SENSITIVE, "false"); |
4016 | - } |
4017 | - } |
4018 | - |
4019 | - /* If we're now back to a state where we have an IM client |
4020 | - connected then we need to resensitize the items. */ |
4021 | - if (oldglobal == STATUS_PROVIDER_STATUS_DISCONNECTED) { |
4022 | - StatusProviderStatus i; |
4023 | - for (i = STATUS_PROVIDER_STATUS_ONLINE; i < STATUS_PROVIDER_STATUS_LAST; i++) { |
4024 | - if (status_menuitems[i] == NULL) continue; |
4025 | - dbusmenu_menuitem_property_set(status_menuitems[i], DBUSMENU_MENUITEM_PROP_SENSITIVE, "true"); |
4026 | - } |
4027 | - } |
4028 | - } |
4029 | - |
4030 | - return; |
4031 | -} |
4032 | - |
4033 | -static void |
4034 | -status_menu_click (DbusmenuMenuitem * mi, gpointer data) |
4035 | -{ |
4036 | - StatusProviderStatus status = (StatusProviderStatus)GPOINTER_TO_INT(data); |
4037 | - g_debug("Setting status: %d", status); |
4038 | - int i; |
4039 | - for (i = 0; i < STATUS_PROVIDER_CNT; i++) { |
4040 | - status_provider_set_status(status_providers[i], status); |
4041 | - } |
4042 | - |
4043 | - return; |
4044 | -} |
4045 | - |
4046 | -static gboolean |
4047 | -build_providers (gpointer data) |
4048 | -{ |
4049 | - int i; |
4050 | - for (i = 0; i < STATUS_PROVIDER_CNT; i++) { |
4051 | - status_providers[i] = status_provider_newfuncs[i](); |
4052 | - |
4053 | - if (status_providers[i] != NULL) { |
4054 | - g_signal_connect(G_OBJECT(status_providers[i]), STATUS_PROVIDER_SIGNAL_STATUS_CHANGED, G_CALLBACK(status_update), NULL); |
4055 | - } |
4056 | - } |
4057 | - |
4058 | - status_update(); |
4059 | - |
4060 | - return FALSE; |
4061 | -} |
4062 | - |
4063 | -static void |
4064 | -build_user_item (DbusmenuMenuitem * root) |
4065 | -{ |
4066 | - struct passwd * pwd = NULL; |
4067 | - |
4068 | - pwd = getpwuid(getuid()); |
4069 | - |
4070 | - if (pwd != NULL && pwd->pw_gecos != NULL) { |
4071 | - gchar * name = g_strdup(pwd->pw_gecos); |
4072 | - gchar * walker = name; |
4073 | - while (*walker != '\0' && *walker != ',') { walker++; } |
4074 | - *walker = '\0'; |
4075 | - |
4076 | - if (name[0] != '\0') { |
4077 | - DbusmenuMenuitem * useritem = dbusmenu_menuitem_new(); |
4078 | - dbusmenu_menuitem_property_set(useritem, DBUSMENU_MENUITEM_PROP_LABEL, name); |
4079 | - dbusmenu_menuitem_property_set(useritem, DBUSMENU_MENUITEM_PROP_SENSITIVE, "false"); |
4080 | - dbusmenu_menuitem_child_append(root, useritem); |
4081 | - } |
4082 | - |
4083 | - g_free(name); |
4084 | - } else { |
4085 | - g_debug("PWD: %s", (pwd == NULL ? "(pwd null)" : (pwd->pw_gecos == NULL ? "(gecos null)" : pwd->pw_gecos))); |
4086 | - } |
4087 | - |
4088 | - return; |
4089 | -} |
4090 | - |
4091 | -static gboolean |
4092 | -build_menu (gpointer data) |
4093 | -{ |
4094 | - DbusmenuMenuitem * root = DBUSMENU_MENUITEM(data); |
4095 | - g_return_val_if_fail(root != NULL, FALSE); |
4096 | - |
4097 | - build_user_item(root); |
4098 | - |
4099 | - status_menuitem = dbusmenu_menuitem_new(); |
4100 | - dbusmenu_menuitem_property_set(status_menuitem, DBUSMENU_MENUITEM_PROP_LABEL, _("Set Status")); |
4101 | - dbusmenu_menuitem_child_append(root, status_menuitem); |
4102 | - |
4103 | - StatusProviderStatus i; |
4104 | - for (i = STATUS_PROVIDER_STATUS_ONLINE; i < STATUS_PROVIDER_STATUS_LAST; i++) { |
4105 | - if (i == STATUS_PROVIDER_STATUS_DISCONNECTED) { |
4106 | - /* We don't want an item for the disconnected status. Users |
4107 | - can't set that value through the menu :) */ |
4108 | - continue; |
4109 | - } |
4110 | - |
4111 | - status_menuitems[i] = dbusmenu_menuitem_new(); |
4112 | - |
4113 | - dbusmenu_menuitem_property_set(status_menuitems[i], "type", DBUSMENU_CLIENT_TYPES_IMAGE); |
4114 | - dbusmenu_menuitem_property_set(status_menuitems[i], DBUSMENU_MENUITEM_PROP_LABEL, _(status_strings[i])); |
4115 | - dbusmenu_menuitem_property_set(status_menuitems[i], DBUSMENU_MENUITEM_PROP_ICON, status_icons[i]); |
4116 | - if (global_status == STATUS_PROVIDER_STATUS_DISCONNECTED) { |
4117 | - dbusmenu_menuitem_property_set(status_menuitems[i], DBUSMENU_MENUITEM_PROP_SENSITIVE, "false"); |
4118 | - } |
4119 | - g_signal_connect(G_OBJECT(status_menuitems[i]), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(status_menu_click), GINT_TO_POINTER(i)); |
4120 | - |
4121 | - dbusmenu_menuitem_child_append(status_menuitem, status_menuitems[i]); |
4122 | - |
4123 | - g_debug("Built %s", status_strings[i]); |
4124 | - } |
4125 | - |
4126 | - return FALSE; |
4127 | -} |
4128 | - |
4129 | -int |
4130 | -main (int argc, char ** argv) |
4131 | -{ |
4132 | - g_type_init(); |
4133 | - |
4134 | - /* Setting up i18n and gettext. Apparently, we need |
4135 | - all of these. */ |
4136 | - setlocale (LC_ALL, ""); |
4137 | - bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR); |
4138 | - textdomain (GETTEXT_PACKAGE); |
4139 | - |
4140 | - DBusGConnection * connection = dbus_g_bus_get(DBUS_BUS_SESSION, NULL); |
4141 | - DBusGProxy * bus_proxy = dbus_g_proxy_new_for_name(connection, DBUS_SERVICE_DBUS, DBUS_PATH_DBUS, DBUS_INTERFACE_DBUS); |
4142 | - GError * error = NULL; |
4143 | - guint nameret = 0; |
4144 | - |
4145 | - if (!org_freedesktop_DBus_request_name(bus_proxy, INDICATOR_STATUS_DBUS_NAME, 0, &nameret, &error)) { |
4146 | - g_error("Unable to call to request name"); |
4147 | - return 1; |
4148 | - } |
4149 | - |
4150 | - if (nameret != DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER) { |
4151 | - g_error("Unable to get name"); |
4152 | - return 1; |
4153 | - } |
4154 | - |
4155 | - g_idle_add(build_providers, NULL); |
4156 | - |
4157 | - root_menuitem = dbusmenu_menuitem_new(); |
4158 | - DbusmenuServer * server = dbusmenu_server_new(INDICATOR_STATUS_DBUS_OBJECT); |
4159 | - dbusmenu_server_set_root(server, root_menuitem); |
4160 | - |
4161 | - g_idle_add(build_menu, root_menuitem); |
4162 | - |
4163 | - dbus_interface = g_object_new(STATUS_SERVICE_DBUS_TYPE, NULL); |
4164 | - |
4165 | - mainloop = g_main_loop_new(NULL, FALSE); |
4166 | - g_main_loop_run(mainloop); |
4167 | - |
4168 | - return 0; |
4169 | -} |
4170 | - |
4171 | |
4172 | === removed file 'src/status-service.xml' |
4173 | --- src/status-service.xml 2009-08-08 16:47:24 +0000 |
4174 | +++ src/status-service.xml 1970-01-01 00:00:00 +0000 |
4175 | @@ -1,25 +0,0 @@ |
4176 | -<?xml version="1.0" encoding="UTF-8"?> |
4177 | -<node name="/"> |
4178 | - <interface name="org.ayatana.indicator.status.service"> |
4179 | - |
4180 | -<!-- Methods --> |
4181 | - <method name="Watch"> |
4182 | - <annotation name="org.freedesktop.DBus.GLib.Async" value="true" /> |
4183 | - </method> |
4184 | - <method name="StatusIcons"> |
4185 | - <arg type="s" name="icons" direction="out" /> |
4186 | - </method> |
4187 | - <method name="PrettyUserName"> |
4188 | - <arg type="s" name="name" direction="out" /> |
4189 | - </method> |
4190 | - |
4191 | -<!-- Signals --> |
4192 | - <signal name="UserChanged"> |
4193 | - <arg type="s" name="name" direction="out" /> |
4194 | - </signal> |
4195 | - <signal name="StatusIconsChanged"> |
4196 | - <arg type="s" name="icons" direction="out" /> |
4197 | - </signal> |
4198 | - |
4199 | - </interface> |
4200 | -</node> |
4201 | |
4202 | === removed file 'src/users-service.c' |
4203 | --- src/users-service.c 2009-10-07 00:28:06 +0000 |
4204 | +++ src/users-service.c 1970-01-01 00:00:00 +0000 |
4205 | @@ -1,326 +0,0 @@ |
4206 | -/* |
4207 | - * A small wrapper utility to load indicators and put them as menu items |
4208 | - * into the gnome-panel using it's applet interface. |
4209 | - * |
4210 | - * Copyright 2009 Canonical Ltd. |
4211 | - * |
4212 | - * Authors: |
4213 | - * Ted Gould <ted@canonical.com> |
4214 | - * Cody Russell <crussell@canonical.com> |
4215 | - * |
4216 | - * This program is free software: you can redistribute it and/or modify it |
4217 | - * under the terms of the GNU General Public License version 3, as published |
4218 | - * by the Free Software Foundation. |
4219 | - * |
4220 | - * This program is distributed in the hope that it will be useful, but |
4221 | - * WITHOUT ANY WARRANTY; without even the implied warranties of |
4222 | - * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR |
4223 | - * PURPOSE. See the GNU General Public License for more details. |
4224 | - * |
4225 | - * You should have received a copy of the GNU General Public License along |
4226 | - *with this program. If not, see <http://www.gnu.org/licenses/>. |
4227 | - */ |
4228 | - |
4229 | -#include <config.h> |
4230 | - |
4231 | -#include <unistd.h> |
4232 | - |
4233 | -#include <glib/gi18n.h> |
4234 | - |
4235 | -#include <dbus/dbus-glib.h> |
4236 | -#include <dbus/dbus-glib-bindings.h> |
4237 | - |
4238 | -#include <libdbusmenu-glib/server.h> |
4239 | -#include <libdbusmenu-glib/menuitem.h> |
4240 | - |
4241 | -#include "dbus-shared-names.h" |
4242 | -#include "users-service-dbus.h" |
4243 | -#include "lock-helper.h" |
4244 | - |
4245 | -#define GUEST_SESSION_LAUNCHER "/usr/share/gdm/guest-session/guest-session-launch" |
4246 | - |
4247 | -typedef struct _ActivateData ActivateData; |
4248 | -struct _ActivateData |
4249 | -{ |
4250 | - UsersServiceDbus *service; |
4251 | - UserData *user; |
4252 | -}; |
4253 | - |
4254 | -static DBusGConnection *session_bus = NULL; |
4255 | -static DBusGConnection *system_bus = NULL; |
4256 | -static DBusGProxy *bus_proxy = NULL; |
4257 | -static DBusGProxy *gdm_proxy = NULL; |
4258 | -static DbusmenuMenuitem *root_menuitem = NULL; |
4259 | -static GMainLoop *mainloop = NULL; |
4260 | -static UsersServiceDbus *dbus_interface = NULL; |
4261 | - |
4262 | -static DbusmenuMenuitem *lock_menuitem = NULL; |
4263 | - |
4264 | -static gint count; |
4265 | -static GList *users; |
4266 | - |
4267 | -/* Respond to the signal of autologin changing to see if the |
4268 | - setting for timed login changes. */ |
4269 | -static void |
4270 | -gdm_settings_change (void) |
4271 | -{ |
4272 | - if (!will_lock_screen()) { |
4273 | - dbusmenu_menuitem_property_set(lock_menuitem, DBUSMENU_MENUITEM_PROP_SENSITIVE, "false"); |
4274 | - } else { |
4275 | - dbusmenu_menuitem_property_set(lock_menuitem, DBUSMENU_MENUITEM_PROP_SENSITIVE, "true"); |
4276 | - } |
4277 | - |
4278 | - return; |
4279 | -} |
4280 | - |
4281 | -static gboolean |
4282 | -check_guest_session (void) |
4283 | -{ |
4284 | - if (geteuid() < 500) { |
4285 | - /* System users shouldn't have guest account shown. Mosly |
4286 | - this would be the case of the guest user itself. */ |
4287 | - return FALSE; |
4288 | - } |
4289 | - if (!g_file_test(GUEST_SESSION_LAUNCHER, G_FILE_TEST_IS_EXECUTABLE)) { |
4290 | - /* It doesn't appear that the Guest session stuff is |
4291 | - installed. So let's not use it then! */ |
4292 | - return FALSE; |
4293 | - } |
4294 | - |
4295 | - return TRUE; |
4296 | -} |
4297 | - |
4298 | -static void |
4299 | -activate_guest_session (DbusmenuMenuitem * mi, gpointer user_data) |
4300 | -{ |
4301 | - GError * error = NULL; |
4302 | - if (!g_spawn_command_line_async(GUEST_SESSION_LAUNCHER, &error)) { |
4303 | - g_warning("Unable to start guest session: %s", error->message); |
4304 | - g_error_free(error); |
4305 | - } |
4306 | - |
4307 | - return; |
4308 | -} |
4309 | - |
4310 | -static gboolean |
4311 | -check_new_session (void) |
4312 | -{ |
4313 | - if (system_bus == NULL) { |
4314 | - system_bus = dbus_g_bus_get(DBUS_BUS_SYSTEM, NULL); |
4315 | - } |
4316 | - |
4317 | - if (system_bus == NULL) { |
4318 | - return FALSE; |
4319 | - } |
4320 | - |
4321 | - if (gdm_proxy == NULL) { |
4322 | - gdm_proxy = dbus_g_proxy_new_for_name(system_bus, |
4323 | - "org.gnome.DisplayManager", |
4324 | - "/org/gnome/DisplayManager/LocalDisplayFactory", |
4325 | - "org.gnome.DisplayManager.LocalDisplayFactory"); |
4326 | - } |
4327 | - |
4328 | - if (gdm_proxy == NULL) { |
4329 | - return FALSE; |
4330 | - } |
4331 | - |
4332 | - return TRUE; |
4333 | -} |
4334 | - |
4335 | -static void |
4336 | -activate_new_session (DbusmenuMenuitem * mi, gpointer user_data) |
4337 | -{ |
4338 | - GError * error = NULL; |
4339 | - if (!g_spawn_command_line_async("gdmflexiserver --startnew", &error)) { |
4340 | - g_warning("Unable to start guest session: %s", error->message); |
4341 | - g_error_free(error); |
4342 | - } |
4343 | - |
4344 | - return; |
4345 | -} |
4346 | - |
4347 | -static void |
4348 | -activate_user_session (DbusmenuMenuitem *mi, gpointer user_data) |
4349 | -{ |
4350 | - UserData *user = (UserData *)user_data; |
4351 | - UsersServiceDbus *service = user->service; |
4352 | - |
4353 | - users_service_dbus_activate_user_session (service, user); |
4354 | -} |
4355 | - |
4356 | -static gint |
4357 | -compare_users_by_username (const gchar *a, |
4358 | - const gchar *b) |
4359 | -{ |
4360 | - UserData *user1 = (UserData *)a; |
4361 | - UserData *user2 = (UserData *)b; |
4362 | - |
4363 | - return g_strcmp0 (user1->user_name, user2->user_name); |
4364 | -} |
4365 | - |
4366 | -static void |
4367 | -rebuild_items (DbusmenuMenuitem *root, |
4368 | - UsersServiceDbus *service) |
4369 | -{ |
4370 | - DbusmenuMenuitem *mi = NULL; |
4371 | - GList *u; |
4372 | - UserData *user; |
4373 | - gboolean can_activate; |
4374 | - GList *children; |
4375 | - |
4376 | - can_activate = users_service_dbus_can_activate_session (service); |
4377 | - |
4378 | - children = dbusmenu_menuitem_take_children (root); |
4379 | - g_list_foreach (children, (GFunc)g_object_unref, NULL); |
4380 | - g_list_free (children); |
4381 | - |
4382 | - lock_menuitem = dbusmenu_menuitem_new(); |
4383 | - dbusmenu_menuitem_property_set(lock_menuitem, DBUSMENU_MENUITEM_PROP_LABEL, _("Lock Screen")); |
4384 | - g_signal_connect(G_OBJECT(lock_menuitem), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(lock_screen), NULL); |
4385 | - dbusmenu_menuitem_child_append(root, lock_menuitem); |
4386 | - if (!will_lock_screen()) { |
4387 | - dbusmenu_menuitem_property_set(lock_menuitem, DBUSMENU_MENUITEM_PROP_SENSITIVE, "false"); |
4388 | - } else { |
4389 | - dbusmenu_menuitem_property_set(lock_menuitem, DBUSMENU_MENUITEM_PROP_SENSITIVE, "true"); |
4390 | - } |
4391 | - |
4392 | - if (can_activate == TRUE) |
4393 | - { |
4394 | - if (check_guest_session ()) |
4395 | - { |
4396 | - mi = dbusmenu_menuitem_new (); |
4397 | - dbusmenu_menuitem_property_set (mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Guest Session")); |
4398 | - dbusmenu_menuitem_child_append (root, mi); |
4399 | - g_signal_connect (G_OBJECT (mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK (activate_guest_session), NULL); |
4400 | - } |
4401 | - |
4402 | - if (count > MINIMUM_USERS && count < MAXIMUM_USERS) |
4403 | - { |
4404 | - if (users != NULL) |
4405 | - { |
4406 | - GList *l = NULL; |
4407 | - |
4408 | - for (l = users; l != NULL; l = l->next) |
4409 | - { |
4410 | - users = g_list_delete_link (users, l); |
4411 | - } |
4412 | - |
4413 | - users = NULL; |
4414 | - } |
4415 | - |
4416 | - users = users_service_dbus_get_user_list (service); |
4417 | - |
4418 | - users = g_list_sort (users, (GCompareFunc)compare_users_by_username); |
4419 | - |
4420 | - for (u = users; u != NULL; u = g_list_next (u)) |
4421 | - { |
4422 | - user = u->data; |
4423 | - |
4424 | - user->service = service; |
4425 | - |
4426 | - mi = dbusmenu_menuitem_new (); |
4427 | - dbusmenu_menuitem_property_set (mi, DBUSMENU_MENUITEM_PROP_LABEL, user->real_name); |
4428 | - dbusmenu_menuitem_child_append (root, mi); |
4429 | - g_signal_connect (G_OBJECT (mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK (activate_user_session), user); |
4430 | - } |
4431 | - } |
4432 | - |
4433 | - if (check_new_session ()) |
4434 | - { |
4435 | - mi = dbusmenu_menuitem_new (); |
4436 | - dbusmenu_menuitem_property_set (mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Switch User...")); |
4437 | - dbusmenu_menuitem_child_append (root, mi); |
4438 | - g_signal_connect (G_OBJECT (mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK (activate_new_session), NULL); |
4439 | - } |
4440 | - } |
4441 | -} |
4442 | - |
4443 | -static void |
4444 | -user_added (UsersServiceDbus *service, |
4445 | - UserData *user, |
4446 | - gpointer user_data) |
4447 | -{ |
4448 | - DbusmenuMenuitem *root = (DbusmenuMenuitem *)user_data; |
4449 | - |
4450 | - count++; |
4451 | - |
4452 | - rebuild_items (root, service); |
4453 | -} |
4454 | - |
4455 | -static void |
4456 | -user_removed (UsersServiceDbus *service, |
4457 | - UserData *user, |
4458 | - gpointer user_data) |
4459 | -{ |
4460 | - DbusmenuMenuitem *root = (DbusmenuMenuitem *)user_data; |
4461 | - |
4462 | - count--; |
4463 | - |
4464 | - rebuild_items (root, service); |
4465 | -} |
4466 | - |
4467 | -static void |
4468 | -create_items (DbusmenuMenuitem *root, |
4469 | - UsersServiceDbus *service) |
4470 | -{ |
4471 | - g_return_if_fail (IS_USERS_SERVICE_DBUS (service)); |
4472 | - |
4473 | - count = users_service_dbus_get_user_count (service); |
4474 | - |
4475 | - rebuild_items (root, service); |
4476 | -} |
4477 | - |
4478 | -int |
4479 | -main (int argc, char ** argv) |
4480 | -{ |
4481 | - g_type_init(); |
4482 | - |
4483 | - /* Setting up i18n and gettext. Apparently, we need |
4484 | - all of these. */ |
4485 | - setlocale (LC_ALL, ""); |
4486 | - bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR); |
4487 | - textdomain (GETTEXT_PACKAGE); |
4488 | - |
4489 | - session_bus = dbus_g_bus_get(DBUS_BUS_SESSION, NULL); |
4490 | - bus_proxy = dbus_g_proxy_new_for_name (session_bus, DBUS_SERVICE_DBUS, DBUS_PATH_DBUS, DBUS_INTERFACE_DBUS); |
4491 | - GError * error = NULL; |
4492 | - guint nameret = 0; |
4493 | - |
4494 | - if (!org_freedesktop_DBus_request_name(bus_proxy, INDICATOR_USERS_DBUS_NAME, 0, &nameret, &error)) { |
4495 | - g_error("Unable to call to request name"); |
4496 | - return 1; |
4497 | - } |
4498 | - |
4499 | - if (nameret != DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER) { |
4500 | - g_error("Unable to get name"); |
4501 | - return 1; |
4502 | - } |
4503 | - |
4504 | - g_idle_add(lock_screen_setup, NULL); |
4505 | - lock_screen_gdm_cb_set(gdm_settings_change); |
4506 | - |
4507 | - dbus_interface = g_object_new (USERS_SERVICE_DBUS_TYPE, NULL); |
4508 | - |
4509 | - root_menuitem = dbusmenu_menuitem_new (); |
4510 | - g_debug ("Root ID: %d", dbusmenu_menuitem_get_id (root_menuitem)); |
4511 | - |
4512 | - create_items (root_menuitem, dbus_interface); |
4513 | - |
4514 | - DbusmenuServer * server = dbusmenu_server_new(INDICATOR_USERS_DBUS_OBJECT); |
4515 | - dbusmenu_server_set_root(server, root_menuitem); |
4516 | - |
4517 | - g_signal_connect (G_OBJECT (dbus_interface), |
4518 | - "user-added", |
4519 | - G_CALLBACK (user_added), |
4520 | - root_menuitem); |
4521 | - g_signal_connect (G_OBJECT (dbus_interface), |
4522 | - "user-removed", |
4523 | - G_CALLBACK (user_removed), |
4524 | - root_menuitem); |
4525 | - |
4526 | - mainloop = g_main_loop_new(NULL, FALSE); |
4527 | - g_main_loop_run(mainloop); |
4528 | - |
4529 | - return 0; |
4530 | -} |
4531 | - |
Upstream release 0.2.0