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

Proposed by Ted Gould
Status: Merged
Approved by: Ken VanDine
Approved revision: not available
Merge reported by: Ken VanDine
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: 1081 lines (+547/-216)
20 files modified
Makefile.am (+1/-1)
configure.ac (+6/-1)
data/icons/16x16/Makefile.am (+1/-1)
data/icons/16x16/status/Makefile.am (+7/-0)
data/icons/22x22/Makefile.am (+1/-1)
data/icons/22x22/status/Makefile.am (+7/-0)
data/icons/24x24/Makefile.am (+1/-1)
data/icons/24x24/status/Makefile.am (+7/-0)
data/icons/32x32/Makefile.am (+1/-1)
data/icons/32x32/status/Makefile.am (+7/-0)
data/icons/scalable/Makefile.am (+1/-1)
data/icons/scalable/status/Makefile.am (+7/-0)
data/icons/scalable/status/account-logged-in.svg (+270/-0)
debian/changelog (+12/-0)
debian/patches/01_port_to_upower.patch (+0/-151)
src/Makefile.am (+2/-0)
src/dbus-shared-names.h (+4/-0)
src/dbusmenu-shared.h (+4/-0)
src/indicator-session.c (+147/-7)
src/session-service.c (+61/-51)
To merge this branch: bzr merge lp:~indicator-applet-developers/indicator-session/ubuntu
Reviewer Review Type Date Requested Status
Ken VanDine Approve
Sebastien Bacher Pending
Review via email: mp+19623@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Ted Gould (ted) wrote :

0.2.3

Revision history for this message
Ken VanDine (ken-vandine) wrote :

Approved

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Makefile.am'
2--- Makefile.am 2009-09-08 15:14:27 +0000
3+++ Makefile.am 2010-02-18 15:53:12 +0000
4@@ -4,7 +4,7 @@
5 data \
6 po
7
8-EXTRA_DIST = COPYING.LGPL
9+EXTRA_DIST = COPYING.LGPL autogen.sh
10
11 DISTCHECK_CONFIGURE_FLAGS = --enable-localinstall
12
13
14=== modified file 'configure.ac'
15--- configure.ac 2010-02-11 16:52:09 +0000
16+++ configure.ac 2010-02-18 15:53:12 +0000
17@@ -4,7 +4,7 @@
18 AC_PREREQ(2.53)
19
20 AM_CONFIG_HEADER(config.h)
21-AM_INIT_AUTOMAKE(indicator-session, 0.2.2)
22+AM_INIT_AUTOMAKE(indicator-session, 0.2.3)
23
24 AM_MAINTAINER_MODE
25
26@@ -132,14 +132,19 @@
27 data/icons/Makefile
28 data/icons/16x16/Makefile
29 data/icons/16x16/actions/Makefile
30+data/icons/16x16/status/Makefile
31 data/icons/22x22/Makefile
32 data/icons/22x22/actions/Makefile
33+data/icons/22x22/status/Makefile
34 data/icons/24x24/Makefile
35 data/icons/24x24/actions/Makefile
36+data/icons/24x24/status/Makefile
37 data/icons/32x32/Makefile
38 data/icons/32x32/actions/Makefile
39+data/icons/32x32/status/Makefile
40 data/icons/scalable/Makefile
41 data/icons/scalable/actions/Makefile
42+data/icons/scalable/status/Makefile
43 po/Makefile.in
44 ])
45
46
47=== modified file 'data/icons/16x16/Makefile.am'
48--- data/icons/16x16/Makefile.am 2009-12-24 19:31:30 +0000
49+++ data/icons/16x16/Makefile.am 2010-02-18 15:53:12 +0000
50@@ -1,1 +1,1 @@
51-SUBDIRS = actions
52+SUBDIRS = actions status
53
54=== added directory 'data/icons/16x16/status'
55=== added file 'data/icons/16x16/status/Makefile.am'
56--- data/icons/16x16/status/Makefile.am 1970-01-01 00:00:00 +0000
57+++ data/icons/16x16/status/Makefile.am 2010-02-18 15:53:12 +0000
58@@ -0,0 +1,7 @@
59+
60+iconsdir = $(INDICATORICONSDIR)/hicolor/16x16/status
61+
62+icons_DATA = \
63+ account-logged-in.png
64+
65+EXTRA_DIST = $(icons_DATA)
66
67=== added file 'data/icons/16x16/status/account-logged-in.png'
68Binary files data/icons/16x16/status/account-logged-in.png 1970-01-01 00:00:00 +0000 and data/icons/16x16/status/account-logged-in.png 2010-02-18 15:53:12 +0000 differ
69=== modified file 'data/icons/22x22/Makefile.am'
70--- data/icons/22x22/Makefile.am 2009-12-24 19:31:30 +0000
71+++ data/icons/22x22/Makefile.am 2010-02-18 15:53:12 +0000
72@@ -1,1 +1,1 @@
73-SUBDIRS = actions
74+SUBDIRS = actions status
75
76=== added directory 'data/icons/22x22/status'
77=== added file 'data/icons/22x22/status/Makefile.am'
78--- data/icons/22x22/status/Makefile.am 1970-01-01 00:00:00 +0000
79+++ data/icons/22x22/status/Makefile.am 2010-02-18 15:53:12 +0000
80@@ -0,0 +1,7 @@
81+
82+iconsdir = $(INDICATORICONSDIR)/hicolor/22x22/status
83+
84+icons_DATA = \
85+ account-logged-in.png
86+
87+EXTRA_DIST = $(icons_DATA)
88
89=== added file 'data/icons/22x22/status/account-logged-in.png'
90Binary files data/icons/22x22/status/account-logged-in.png 1970-01-01 00:00:00 +0000 and data/icons/22x22/status/account-logged-in.png 2010-02-18 15:53:12 +0000 differ
91=== modified file 'data/icons/24x24/Makefile.am'
92--- data/icons/24x24/Makefile.am 2009-12-24 19:31:30 +0000
93+++ data/icons/24x24/Makefile.am 2010-02-18 15:53:12 +0000
94@@ -1,1 +1,1 @@
95-SUBDIRS = actions
96+SUBDIRS = actions status
97
98=== added directory 'data/icons/24x24/status'
99=== added file 'data/icons/24x24/status/Makefile.am'
100--- data/icons/24x24/status/Makefile.am 1970-01-01 00:00:00 +0000
101+++ data/icons/24x24/status/Makefile.am 2010-02-18 15:53:12 +0000
102@@ -0,0 +1,7 @@
103+
104+iconsdir = $(INDICATORICONSDIR)/hicolor/24x24/status
105+
106+icons_DATA = \
107+ account-logged-in.png
108+
109+EXTRA_DIST = $(icons_DATA)
110
111=== added file 'data/icons/24x24/status/account-logged-in.png'
112Binary files data/icons/24x24/status/account-logged-in.png 1970-01-01 00:00:00 +0000 and data/icons/24x24/status/account-logged-in.png 2010-02-18 15:53:12 +0000 differ
113=== modified file 'data/icons/32x32/Makefile.am'
114--- data/icons/32x32/Makefile.am 2009-12-24 19:31:30 +0000
115+++ data/icons/32x32/Makefile.am 2010-02-18 15:53:12 +0000
116@@ -1,1 +1,1 @@
117-SUBDIRS = actions
118+SUBDIRS = actions status
119
120=== added directory 'data/icons/32x32/status'
121=== added file 'data/icons/32x32/status/Makefile.am'
122--- data/icons/32x32/status/Makefile.am 1970-01-01 00:00:00 +0000
123+++ data/icons/32x32/status/Makefile.am 2010-02-18 15:53:12 +0000
124@@ -0,0 +1,7 @@
125+
126+iconsdir = $(INDICATORICONSDIR)/hicolor/32x32/status
127+
128+icons_DATA = \
129+ account-logged-in.png
130+
131+EXTRA_DIST = $(icons_DATA)
132
133=== added file 'data/icons/32x32/status/account-logged-in.png'
134Binary files data/icons/32x32/status/account-logged-in.png 1970-01-01 00:00:00 +0000 and data/icons/32x32/status/account-logged-in.png 2010-02-18 15:53:12 +0000 differ
135=== modified file 'data/icons/scalable/Makefile.am'
136--- data/icons/scalable/Makefile.am 2009-12-24 19:31:30 +0000
137+++ data/icons/scalable/Makefile.am 2010-02-18 15:53:12 +0000
138@@ -1,1 +1,1 @@
139-SUBDIRS = actions
140+SUBDIRS = actions status
141
142=== added directory 'data/icons/scalable/status'
143=== added file 'data/icons/scalable/status/Makefile.am'
144--- data/icons/scalable/status/Makefile.am 1970-01-01 00:00:00 +0000
145+++ data/icons/scalable/status/Makefile.am 2010-02-18 15:53:12 +0000
146@@ -0,0 +1,7 @@
147+
148+iconsdir = $(INDICATORICONSDIR)/hicolor/scalable/status
149+
150+icons_DATA = \
151+ account-logged-in.svg
152+
153+EXTRA_DIST = $(icons_DATA)
154
155=== added file 'data/icons/scalable/status/account-logged-in.svg'
156--- data/icons/scalable/status/account-logged-in.svg 1970-01-01 00:00:00 +0000
157+++ data/icons/scalable/status/account-logged-in.svg 2010-02-18 15:53:12 +0000
158@@ -0,0 +1,270 @@
159+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
160+<!-- Created with Inkscape (http://www.inkscape.org/) -->
161+<svg
162+ xmlns:dc="http://purl.org/dc/elements/1.1/"
163+ xmlns:cc="http://web.resource.org/cc/"
164+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
165+ xmlns:svg="http://www.w3.org/2000/svg"
166+ xmlns="http://www.w3.org/2000/svg"
167+ xmlns:xlink="http://www.w3.org/1999/xlink"
168+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
169+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
170+ id="svg1"
171+ sodipodi:version="0.32"
172+ inkscape:version="0.45"
173+ width="48"
174+ height="48"
175+ sodipodi:docbase="/home/dobey/Projects/gnome-icon-theme/scalable/emblems"
176+ sodipodi:docname="emblem-default.svg"
177+ inkscape:output_extension="org.inkscape.output.svg.inkscape"
178+ version="1.0">
179+ <defs
180+ id="defs3">
181+ <linearGradient
182+ id="linearGradient5237">
183+ <stop
184+ style="stop-color:#ffffff;stop-opacity:1;"
185+ offset="0"
186+ id="stop5239" />
187+ <stop
188+ id="stop5247"
189+ offset="0.5"
190+ style="stop-color:#ffffff;stop-opacity:1;" />
191+ <stop
192+ style="stop-color:#9c9c9c;stop-opacity:1"
193+ offset="1"
194+ id="stop5241" />
195+ </linearGradient>
196+ <linearGradient
197+ id="linearGradient5226">
198+ <stop
199+ style="stop-color:#63b512;stop-opacity:1;"
200+ offset="0"
201+ id="stop5229" />
202+ <stop
203+ id="stop5245"
204+ offset="0.16030352"
205+ style="stop-color:#58a30e;stop-opacity:1;" />
206+ <stop
207+ id="stop5235"
208+ offset="0.66008514"
209+ style="stop-color:#366b04;stop-opacity:1" />
210+ <stop
211+ style="stop-color:#87ea25;stop-opacity:1"
212+ offset="1"
213+ id="stop5231" />
214+ </linearGradient>
215+ <linearGradient
216+ inkscape:collect="always"
217+ id="linearGradient5300">
218+ <stop
219+ style="stop-color:#ffffff;stop-opacity:1;"
220+ offset="0"
221+ id="stop5302" />
222+ <stop
223+ style="stop-color:#ffffff;stop-opacity:0;"
224+ offset="1"
225+ id="stop5304" />
226+ </linearGradient>
227+ <linearGradient
228+ inkscape:collect="always"
229+ id="linearGradient5224">
230+ <stop
231+ style="stop-color:#000000;stop-opacity:1;"
232+ offset="0"
233+ id="stop5226" />
234+ <stop
235+ style="stop-color:#000000;stop-opacity:0;"
236+ offset="1"
237+ id="stop5228" />
238+ </linearGradient>
239+ <radialGradient
240+ inkscape:collect="always"
241+ xlink:href="#linearGradient5224"
242+ id="radialGradient5230"
243+ cx="14.5"
244+ cy="26.6875"
245+ fx="14.5"
246+ fy="26.6875"
247+ r="10"
248+ gradientTransform="matrix(1,0,0,0.29375,0,18.848047)"
249+ gradientUnits="userSpaceOnUse" />
250+ <filter
251+ inkscape:collect="always"
252+ id="filter5296"
253+ x="-0.09814655"
254+ width="1.1962931"
255+ y="-0.33411592"
256+ height="1.6682318">
257+ <feGaussianBlur
258+ inkscape:collect="always"
259+ stdDeviation="0.81788793"
260+ id="feGaussianBlur5298" />
261+ </filter>
262+ <radialGradient
263+ inkscape:collect="always"
264+ xlink:href="#linearGradient5300"
265+ id="radialGradient5306"
266+ cx="29.77438"
267+ cy="7.0922189"
268+ fx="29.77438"
269+ fy="7.0922189"
270+ r="25.380436"
271+ gradientUnits="userSpaceOnUse"
272+ gradientTransform="matrix(2.2469896,0,0,2.2469896,-37.128341,-8.8439229)" />
273+ <radialGradient
274+ inkscape:collect="always"
275+ xlink:href="#linearGradient5224"
276+ id="radialGradient5330"
277+ gradientUnits="userSpaceOnUse"
278+ gradientTransform="matrix(1,0,0,0.29375,0,18.848047)"
279+ cx="14.5"
280+ cy="26.6875"
281+ fx="14.5"
282+ fy="26.6875"
283+ r="10" />
284+ <radialGradient
285+ inkscape:collect="always"
286+ xlink:href="#linearGradient5226"
287+ id="radialGradient5233"
288+ cx="29.392656"
289+ cy="18.898249"
290+ fx="29.392656"
291+ fy="18.898249"
292+ r="29.699959"
293+ gradientUnits="userSpaceOnUse"
294+ gradientTransform="matrix(1.5354369,0,0,1.5485894,-15.737913,-10.36738)" />
295+ <radialGradient
296+ inkscape:collect="always"
297+ xlink:href="#linearGradient5237"
298+ id="radialGradient5243"
299+ cx="22.9375"
300+ cy="16.305218"
301+ fx="22.9375"
302+ fy="16.305218"
303+ r="15.5625"
304+ gradientTransform="matrix(1.5301205,0,0,1.6745294,-12.159639,-11.709817)"
305+ gradientUnits="userSpaceOnUse" />
306+ </defs>
307+ <sodipodi:namedview
308+ id="base"
309+ pagecolor="#ffffff"
310+ bordercolor="#ededed"
311+ borderopacity="1"
312+ inkscape:pageopacity="0.0"
313+ inkscape:pageshadow="2"
314+ inkscape:zoom="1"
315+ inkscape:cx="39.269655"
316+ inkscape:cy="17.441445"
317+ inkscape:window-width="826"
318+ inkscape:window-height="790"
319+ gridspacingx="0.50000000mm"
320+ gridspacingy="0.50000000mm"
321+ showgrid="false"
322+ inkscape:grid-bbox="false"
323+ inkscape:window-x="461"
324+ inkscape:window-y="278"
325+ inkscape:current-layer="svg1"
326+ borderlayer="true"
327+ inkscape:showpageshadow="false"
328+ width="744.09449px"
329+ height="1052.3622px">
330+ <inkscape:grid
331+ type="xygrid"
332+ id="grid5308" />
333+ </sodipodi:namedview>
334+ <metadata
335+ id="metadata4">
336+ <rdf:RDF>
337+ <cc:Work
338+ rdf:about="">
339+ <dc:format>image/svg+xml</dc:format>
340+ <dc:type
341+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
342+ <dc:title>Emblem Urgent</dc:title>
343+ <dc:creator>
344+ <cc:Agent>
345+ <dc:title>Jakub Steiner</dc:title>
346+ </cc:Agent>
347+ </dc:creator>
348+ <dc:contributor>
349+ <cc:Agent>
350+ <dc:title>Andreas Nilsson</dc:title>
351+ </cc:Agent>
352+ </dc:contributor>
353+ <cc:license
354+ rdf:resource="http://creativecommons.org/licenses/GPL/2.0/" />
355+ <dc:subject>
356+ <rdf:Bag>
357+ <rdf:li>generic</rdf:li>
358+ </rdf:Bag>
359+ </dc:subject>
360+ </cc:Work>
361+ <cc:License
362+ rdf:about="http://creativecommons.org/licenses/GPL/2.0/">
363+ <cc:permits
364+ rdf:resource="http://web.resource.org/cc/Reproduction" />
365+ <cc:permits
366+ rdf:resource="http://web.resource.org/cc/Distribution" />
367+ <cc:requires
368+ rdf:resource="http://web.resource.org/cc/Notice" />
369+ <cc:permits
370+ rdf:resource="http://web.resource.org/cc/DerivativeWorks" />
371+ <cc:requires
372+ rdf:resource="http://web.resource.org/cc/ShareAlike" />
373+ <cc:requires
374+ rdf:resource="http://web.resource.org/cc/SourceCode" />
375+ </cc:License>
376+ </rdf:RDF>
377+ </metadata>
378+ <path
379+ sodipodi:type="arc"
380+ style="opacity:0.53012048;color:#000000;fill:url(#radialGradient5230);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;filter:url(#filter5296);enable-background:accumulate"
381+ id="path4645"
382+ sodipodi:cx="14.5"
383+ sodipodi:cy="26.6875"
384+ sodipodi:rx="10"
385+ sodipodi:ry="2.9375"
386+ d="M 24.5,26.6875 A 10,2.9375 0 1 1 4.5,26.6875 A 10,2.9375 0 1 1 24.5,26.6875 z"
387+ transform="matrix(2.1570145,0,0,2.155398,-7.8468552,-16.33814)" />
388+ <path
389+ transform="matrix(1.3478975,0,0,1.3468874,3.8853414,6.4889877)"
390+ d="M 24.5,26.6875 A 10,2.9375 0 1 1 4.5,26.6875 A 10,2.9375 0 1 1 24.5,26.6875 z"
391+ sodipodi:ry="2.9375"
392+ sodipodi:rx="10"
393+ sodipodi:cy="26.6875"
394+ sodipodi:cx="14.5"
395+ id="path5328"
396+ style="opacity:0.80120482;color:#000000;fill:url(#radialGradient5330);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;filter:url(#filter5296);enable-background:accumulate"
397+ sodipodi:type="arc" />
398+ <path
399+ sodipodi:type="arc"
400+ style="fill:url(#radialGradient5233);fill-opacity:1;fill-rule:evenodd;stroke:#316203;stroke-width:1.37804781999999992;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
401+ id="path907"
402+ sodipodi:cx="29.392656"
403+ sodipodi:cy="29.207693"
404+ sodipodi:rx="29.010935"
405+ sodipodi:ry="29.010935"
406+ d="M 58.403591,29.207693 A 29.010935,29.010935 0 1 1 0.3817215,29.207693 A 29.010935,29.010935 0 1 1 58.403591,29.207693 z"
407+ transform="matrix(0.7238447,0,0,0.7274883,2.1828126,2.3568607)" />
408+ <path
409+ sodipodi:type="arc"
410+ style="fill:none;fill-opacity:1;fill-rule:evenodd;stroke:url(#radialGradient5306);stroke-width:1.21160841;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
411+ id="path1552"
412+ sodipodi:cx="29.77438"
413+ sodipodi:cy="30.352861"
414+ sodipodi:rx="24.175779"
415+ sodipodi:ry="24.175779"
416+ d="M 53.950159,30.352861 A 24.175779,24.175779 0 1 1 5.5986004,30.352861 A 24.175779,24.175779 0 1 1 53.950159,30.352861 z"
417+ transform="matrix(0.8254302,0,0,0.8252681,-1.1457884,-1.4441229)" />
418+ <path
419+ style="opacity:1;color:#000000;fill:url(#radialGradient5243);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
420+ d="M 12.875,24.625 L 25.375,36.625 L 44,20.625 C 43.253602,16.729371 41.57038,13.679873 39.8125,11.0625 L 25.125,23.75 L 20.375,18.5 L 12.875,24.625 z"
421+ id="path5222"
422+ sodipodi:nodetypes="ccccccc" />
423+ <path
424+ style="opacity:1;color:#000000;fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#549910;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
425+ d="M 40.21875,10.8125 C 41.930961,13.346411 43.59334,15.979986 44.40625,20.3125"
426+ id="path5224"
427+ sodipodi:nodetypes="cc" />
428+</svg>
429
430=== modified file 'debian/changelog'
431--- debian/changelog 2010-02-17 10:30:06 +0000
432+++ debian/changelog 2010-02-18 15:53:12 +0000
433@@ -1,3 +1,15 @@
434+indicator-session (0.2.3-0ubuntu1~ppa1) lucid; urgency=low
435+
436+ * Upstream release 0.2.3
437+ * Switch menu ordering to match design spec
438+ * Change switch menu item to "Switch from..."
439+ * Move from Devkit-Power to upower
440+ * Adding in user logged in icon and menu item
441+ * Removed debian/patches/01_port_to_upower.patch as it is now merged
442+ upstream.
443+
444+ -- Ted Gould <ted@ubuntu.com> Thu, 18 Feb 2010 09:49:22 -0600
445+
446 indicator-session (0.2.2-0ubuntu2) lucid; urgency=low
447
448 * debian/control: Update devicekit-power dependency to upower.
449
450=== removed file 'debian/patches/01_port_to_upower.patch'
451--- debian/patches/01_port_to_upower.patch 2010-02-17 10:13:04 +0000
452+++ debian/patches/01_port_to_upower.patch 1970-01-01 00:00:00 +0000
453@@ -1,151 +0,0 @@
454-Description: Port to upower
455-Author: Martin Pitt <martin.pitt@ubuntu.com>
456-Upstream: https://code.launchpad.net/~pitti/indicator-session/upower/+merge/19472
457---- indicator-session/src/session-service.c 2010-02-16 10:25:28.000000000 +0100
458-+++ indicator-session.new/src/session-service.c 2010-02-17 11:11:18.149652860 +0100
459-@@ -44,9 +44,9 @@
460- #include "users-service-dbus.h"
461- #include "lock-helper.h"
462-
463--#define DKP_ADDRESS "org.freedesktop.DeviceKit.Power"
464--#define DKP_OBJECT "/org/freedesktop/DeviceKit/Power"
465--#define DKP_INTERFACE "org.freedesktop.DeviceKit.Power"
466-+#define UP_ADDRESS "org.freedesktop.UPower"
467-+#define UP_OBJECT "/org/freedesktop/UPower"
468-+#define UP_INTERFACE "org.freedesktop.UPower"
469-
470- #define GUEST_SESSION_LAUNCHER "/usr/share/gdm/guest-session/guest-session-launch"
471-
472-@@ -72,8 +72,8 @@
473-
474- static DbusmenuMenuitem * root_menuitem = NULL;
475- static GMainLoop * mainloop = NULL;
476--static DBusGProxy * dkp_main_proxy = NULL;
477--static DBusGProxy * dkp_prop_proxy = NULL;
478-+static DBusGProxy * up_main_proxy = NULL;
479-+static DBusGProxy * up_prop_proxy = NULL;
480-
481- static DBusGProxyCall * suspend_call = NULL;
482- static DBusGProxyCall * hibernate_call = NULL;
483-@@ -147,14 +147,14 @@
484- {
485- gchar * type = (gchar *)userdata;
486-
487-- if (dkp_main_proxy == NULL) {
488-- g_warning("Can not %s as no DeviceKit Power Proxy", type);
489-+ if (up_main_proxy == NULL) {
490-+ g_warning("Can not %s as no upower proxy", type);
491- }
492-
493- screensaver_throttle(type);
494- lock_screen(NULL, 0, NULL);
495-
496-- dbus_g_proxy_begin_call(dkp_main_proxy,
497-+ dbus_g_proxy_begin_call(up_main_proxy,
498- type,
499- sleep_response,
500- NULL,
501-@@ -213,17 +213,17 @@
502- /* A signal that we need to recheck to ensure we can still
503- hibernate and/or suspend */
504- static void
505--dpk_changed_cb (DBusGProxy * proxy, gpointer user_data)
506-+up_changed_cb (DBusGProxy * proxy, gpointer user_data)
507- {
508- /* Start Async call to see if we can hibernate */
509- if (suspend_call == NULL) {
510-- suspend_call = dbus_g_proxy_begin_call(dkp_prop_proxy,
511-+ suspend_call = dbus_g_proxy_begin_call(up_prop_proxy,
512- "Get",
513- suspend_prop_cb,
514- NULL,
515- NULL,
516- G_TYPE_STRING,
517-- DKP_INTERFACE,
518-+ UP_INTERFACE,
519- G_TYPE_STRING,
520- "can-suspend",
521- G_TYPE_INVALID,
522-@@ -233,13 +233,13 @@
523-
524- /* Start Async call to see if we can suspend */
525- if (hibernate_call == NULL) {
526-- hibernate_call = dbus_g_proxy_begin_call(dkp_prop_proxy,
527-+ hibernate_call = dbus_g_proxy_begin_call(up_prop_proxy,
528- "Get",
529- hibernate_prop_cb,
530- NULL,
531- NULL,
532- G_TYPE_STRING,
533-- DKP_INTERFACE,
534-+ UP_INTERFACE,
535- G_TYPE_STRING,
536- "can-hibernate",
537- G_TYPE_INVALID,
538-@@ -254,39 +254,39 @@
539- DKp checking. We're even setting up the calls for the props
540- we need */
541- static void
542--setup_dkp (void) {
543-+setup_up (void) {
544- DBusGConnection * bus = dbus_g_bus_get(DBUS_BUS_SYSTEM, NULL);
545- g_return_if_fail(bus != NULL);
546-
547-- if (dkp_main_proxy == NULL) {
548-- dkp_main_proxy = dbus_g_proxy_new_for_name(bus,
549-- DKP_ADDRESS,
550-- DKP_OBJECT,
551-- DKP_INTERFACE);
552-- }
553-- g_return_if_fail(dkp_main_proxy != NULL);
554--
555-- if (dkp_prop_proxy == NULL) {
556-- dkp_prop_proxy = dbus_g_proxy_new_for_name(bus,
557-- DKP_ADDRESS,
558-- DKP_OBJECT,
559-+ if (up_main_proxy == NULL) {
560-+ up_main_proxy = dbus_g_proxy_new_for_name(bus,
561-+ UP_ADDRESS,
562-+ UP_OBJECT,
563-+ UP_INTERFACE);
564-+ }
565-+ g_return_if_fail(up_main_proxy != NULL);
566-+
567-+ if (up_prop_proxy == NULL) {
568-+ up_prop_proxy = dbus_g_proxy_new_for_name(bus,
569-+ UP_ADDRESS,
570-+ UP_OBJECT,
571- DBUS_INTERFACE_PROPERTIES);
572- }
573-- g_return_if_fail(dkp_prop_proxy != NULL);
574-+ g_return_if_fail(up_prop_proxy != NULL);
575-
576- /* Connect to changed signal */
577-- dbus_g_proxy_add_signal(dkp_main_proxy,
578-+ dbus_g_proxy_add_signal(up_main_proxy,
579- "Changed",
580- G_TYPE_INVALID);
581-
582-- dbus_g_proxy_connect_signal(dkp_main_proxy,
583-+ dbus_g_proxy_connect_signal(up_main_proxy,
584- "Changed",
585-- G_CALLBACK(dpk_changed_cb),
586-+ G_CALLBACK(up_changed_cb),
587- NULL,
588- NULL);
589-
590- /* Force an original "changed" event */
591-- dpk_changed_cb(dkp_main_proxy, NULL);
592-+ up_changed_cb(up_main_proxy, NULL);
593-
594- return;
595- }
596-@@ -639,7 +639,7 @@
597- G_CALLBACK (user_removed),
598- root_menuitem);
599-
600-- setup_dkp();
601-+ setup_up();
602-
603- DbusmenuServer * server = dbusmenu_server_new(INDICATOR_SESSION_DBUS_OBJECT);
604- dbusmenu_server_set_root(server, root_menuitem);
605
606=== modified file 'src/Makefile.am'
607--- src/Makefile.am 2010-01-06 05:37:18 +0000
608+++ src/Makefile.am 2010-02-18 15:53:12 +0000
609@@ -11,6 +11,7 @@
610 libsession_la_SOURCES = \
611 indicator-session.c \
612 dbus-shared-names.h \
613+ dbusmenu-shared.h \
614 users-service-client.h
615 libsession_la_CFLAGS = $(APPLET_CFLAGS) -Wall -Werror
616 libsession_la_LIBADD = $(APPLET_LIBS)
617@@ -42,6 +43,7 @@
618 lock-helper.c \
619 lock-helper.h \
620 session-service.c \
621+ dbusmenu-shared.h \
622 gtk-dialog/gconf-helper.c \
623 users-service-dbus.h \
624 users-service-dbus.c \
625
626=== modified file 'src/dbus-shared-names.h'
627--- src/dbus-shared-names.h 2009-12-24 20:36:35 +0000
628+++ src/dbus-shared-names.h 2010-02-18 15:53:12 +0000
629@@ -38,4 +38,8 @@
630 #define INDICATOR_SESSION_DBUS_OBJECT "/org/ayatana/indicator/session/menu"
631 #define INDICATOR_SESSION_DBUS_VERSION 0
632
633+#define USER_ITEM_TYPE "x-canonical-user-item"
634+#define USER_ITEM_PROP_NAME "user-item-name"
635+#define USER_ITEM_PROP_LOGGED_IN "user-item-logged-in"
636+
637 #endif /* __DBUS_SHARED_NAMES_H__ */
638
639=== added file 'src/dbusmenu-shared.h'
640--- src/dbusmenu-shared.h 1970-01-01 00:00:00 +0000
641+++ src/dbusmenu-shared.h 2010-02-18 15:53:12 +0000
642@@ -0,0 +1,4 @@
643+
644+#define MENU_SWITCH_TYPE "x-canonical-switch-from"
645+#define MENU_SWITCH_USER "x-canonical-switch-username"
646+
647
648=== modified file 'src/indicator-session.c'
649--- src/indicator-session.c 2010-01-03 05:51:04 +0000
650+++ src/indicator-session.c 2010-02-18 15:53:12 +0000
651@@ -22,6 +22,7 @@
652
653 #include <glib.h>
654 #include <glib-object.h>
655+#include <glib/gi18n.h>
656 #include <gtk/gtk.h>
657 #include <libdbusmenu-gtk/menu.h>
658
659@@ -33,6 +34,7 @@
660 #include <libindicator/indicator-service-manager.h>
661
662 #include "dbus-shared-names.h"
663+#include "dbusmenu-shared.h"
664
665 #define INDICATOR_SESSION_TYPE (indicator_session_get_type ())
666 #define INDICATOR_SESSION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), INDICATOR_SESSION_TYPE, IndicatorSession))
667@@ -51,6 +53,8 @@
668 struct _IndicatorSession {
669 IndicatorObject parent;
670 IndicatorServiceManager * service;
671+ GtkImage * status_image;
672+ DbusmenuGtkMenu * menu;
673 };
674
675 GType indicator_session_get_type (void);
676@@ -63,6 +67,8 @@
677 static GtkLabel * get_label (IndicatorObject * io);
678 static GtkImage * get_icon (IndicatorObject * io);
679 static GtkMenu * get_menu (IndicatorObject * io);
680+static gboolean build_menu_switch (DbusmenuMenuitem * newitem, DbusmenuMenuitem * parent, DbusmenuClient * client);
681+static gboolean new_user_item (DbusmenuMenuitem * newitem, DbusmenuMenuitem * parent, DbusmenuClient * client);
682
683 static void indicator_session_class_init (IndicatorSessionClass *klass);
684 static void indicator_session_init (IndicatorSession *self);
685@@ -96,6 +102,13 @@
686 /* Now let's fire these guys up. */
687 self->service = indicator_service_manager_new_version(INDICATOR_SESSION_DBUS_NAME, INDICATOR_SESSION_DBUS_VERSION);
688
689+ self->status_image = GTK_IMAGE(gtk_image_new_from_icon_name("system-shutdown-panel", GTK_ICON_SIZE_MENU));
690+ self->menu = dbusmenu_gtkmenu_new(INDICATOR_SESSION_DBUS_NAME, INDICATOR_SESSION_DBUS_OBJECT);
691+
692+ DbusmenuClient * client = DBUSMENU_CLIENT(dbusmenu_gtkmenu_get_client(self->menu));
693+ dbusmenu_client_add_type_handler(client, MENU_SWITCH_TYPE, build_menu_switch);
694+ dbusmenu_client_add_type_handler(client, USER_ITEM_TYPE, new_user_item);
695+
696 return;
697 }
698
699@@ -130,9 +143,37 @@
700 static GtkImage *
701 get_icon (IndicatorObject * io)
702 {
703- GtkImage * status_image = GTK_IMAGE(gtk_image_new_from_icon_name("system-shutdown-panel", GTK_ICON_SIZE_MENU));
704- gtk_widget_show(GTK_WIDGET(status_image));
705- return status_image;
706+ gtk_widget_show(GTK_WIDGET(INDICATOR_SESSION(io)->status_image));
707+ return INDICATOR_SESSION(io)->status_image;
708+}
709+
710+/* Builds an item with a hip little logged in icon. */
711+static gboolean
712+new_user_item (DbusmenuMenuitem * newitem, DbusmenuMenuitem * parent, DbusmenuClient * client)
713+{
714+ GtkMenuItem * gmi = GTK_MENU_ITEM(gtk_menu_item_new());
715+ GtkWidget * hbox = gtk_hbox_new(FALSE, 0);
716+
717+ GtkWidget * label = gtk_label_new(dbusmenu_menuitem_property_get(newitem, USER_ITEM_PROP_NAME));
718+ gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
719+ gtk_box_pack_start(GTK_BOX(hbox), label, TRUE, TRUE, 0);
720+ gtk_widget_show(label);
721+
722+ GtkWidget * icon = gtk_image_new_from_icon_name("account-logged-in", GTK_ICON_SIZE_MENU);
723+ gtk_misc_set_alignment(GTK_MISC(icon), 1.0, 0.5);
724+ gtk_box_pack_start(GTK_BOX(hbox), icon, FALSE, FALSE, 0);
725+ if (dbusmenu_menuitem_property_get_bool(newitem, USER_ITEM_PROP_LOGGED_IN)) {
726+ gtk_widget_show(icon);
727+ } else {
728+ gtk_widget_hide(icon);
729+ }
730+
731+ gtk_container_add(GTK_CONTAINER(gmi), hbox);
732+ gtk_widget_show(hbox);
733+
734+ dbusmenu_gtkclient_newitem_base(DBUSMENU_GTKCLIENT(client), newitem, gmi, parent);
735+
736+ return TRUE;
737 }
738
739 /* Indicator based function to get the menu for the whole
740@@ -141,7 +182,106 @@
741 static GtkMenu *
742 get_menu (IndicatorObject * io)
743 {
744- return GTK_MENU(dbusmenu_gtkmenu_new(INDICATOR_SESSION_DBUS_NAME, INDICATOR_SESSION_DBUS_OBJECT));
745-}
746-
747-
748+ return GTK_MENU(INDICATOR_SESSION(io)->menu);
749+}
750+
751+static void
752+switch_property_change (DbusmenuMenuitem * item, const gchar * property, const GValue * value, gpointer user_data)
753+{
754+ if (g_strcmp0(property, MENU_SWITCH_USER) != 0) {
755+ return;
756+ }
757+
758+ GtkMenuItem * gmi = dbusmenu_gtkclient_menuitem_get(DBUSMENU_GTKCLIENT(user_data), item);
759+ gchar * finalstring = NULL;
760+ gboolean set_ellipsize = FALSE;
761+
762+ /* If there's a NULL string of some type, then we want to
763+ go back to our old 'Switch User' which isn't great but
764+ eh, this error condition should never happen. */
765+ if (value == NULL || g_value_get_string(value) == NULL || g_value_get_string(value)[0] == '\0') {
766+ finalstring = _("Switch User...");
767+ set_ellipsize = FALSE;
768+ }
769+
770+ if (finalstring == NULL) {
771+ const gchar * username = g_value_get_string(value);
772+ GtkStyle * style = gtk_widget_get_style(GTK_WIDGET(gmi));
773+
774+ PangoLayout * layout = pango_layout_new(gtk_widget_get_pango_context(GTK_WIDGET(gmi)));
775+ pango_layout_set_text(layout, username, -1);
776+ pango_layout_set_font_description(layout, style->font_desc);
777+
778+ gint width;
779+ pango_layout_get_pixel_size(layout, &width, NULL);
780+ g_debug("Username width %dpx", width);
781+
782+ gint point = pango_font_description_get_size(style->font_desc);
783+ g_debug("Font size %f pt", (gfloat)point / PANGO_SCALE);
784+
785+ gdouble dpi = gdk_screen_get_resolution(gdk_screen_get_default());
786+ g_debug("Screen DPI %f", dpi);
787+
788+ gdouble pixels_per_em = ((point * dpi) / 72.0f) / PANGO_SCALE;
789+ gdouble ems = width / pixels_per_em;
790+ g_debug("Username width %fem", ems);
791+
792+ /* TODO: We need some way to remove the elipsis from appearing
793+ twice in the label. Not sure how to do that yet. */
794+ finalstring = g_strdup_printf(_("Switch from %s..."), username);
795+ if (ems >= 20.0f) {
796+ set_ellipsize = TRUE;
797+ } else {
798+ set_ellipsize = FALSE;
799+ }
800+ }
801+
802+ gtk_menu_item_set_label(gmi, finalstring);
803+
804+ GtkLabel * label = GTK_LABEL(gtk_bin_get_child(GTK_BIN(gmi)));
805+ if (label != NULL) {
806+ if (set_ellipsize) {
807+ gtk_label_set_ellipsize(label, PANGO_ELLIPSIZE_END);
808+ } else {
809+ gtk_label_set_ellipsize(label, PANGO_ELLIPSIZE_NONE);
810+ }
811+ }
812+
813+ return;
814+}
815+
816+static const gchar * dbusmenu_item_data = "dbusmenu-item";
817+
818+/* Callback for when the style changes so we can reevaluate the
819+ size of the user name with the potentially new font. */
820+static void
821+switch_style_set (GtkWidget * widget, GtkStyle * prev_style, gpointer user_data)
822+{
823+ DbusmenuGtkClient * client = DBUSMENU_GTKCLIENT(user_data);
824+ DbusmenuMenuitem * mi = DBUSMENU_MENUITEM(g_object_get_data(G_OBJECT(widget), dbusmenu_item_data));
825+
826+ switch_property_change(mi, MENU_SWITCH_USER, dbusmenu_menuitem_property_get_value(mi, MENU_SWITCH_USER), client);
827+ return;
828+}
829+
830+
831+/* This function checks to see if the user name is short enough
832+ to not need ellipsing itself, or if, it will get ellipsed by
833+ the standard label processor. */
834+static gboolean
835+build_menu_switch (DbusmenuMenuitem * newitem, DbusmenuMenuitem * parent, DbusmenuClient * client)
836+{
837+ GtkMenuItem * gmi = GTK_MENU_ITEM(gtk_menu_item_new());
838+ if (gmi == NULL) {
839+ return FALSE;
840+ }
841+ g_object_set_data(G_OBJECT(gmi), dbusmenu_item_data, newitem);
842+
843+ dbusmenu_gtkclient_newitem_base(DBUSMENU_GTKCLIENT(client), newitem, gmi, parent);
844+
845+ g_signal_connect(G_OBJECT(newitem), DBUSMENU_MENUITEM_SIGNAL_PROPERTY_CHANGED, G_CALLBACK(switch_property_change), client);
846+ g_signal_connect(G_OBJECT(gmi), "style-set", G_CALLBACK(switch_style_set), client);
847+ switch_property_change(newitem, MENU_SWITCH_USER, dbusmenu_menuitem_property_get_value(newitem, MENU_SWITCH_USER), client);
848+
849+ return TRUE;
850+}
851
852=== modified file 'src/session-service.c'
853--- src/session-service.c 2010-02-08 22:46:35 +0000
854+++ src/session-service.c 2010-02-18 15:53:12 +0000
855@@ -38,15 +38,16 @@
856 #include <libindicator/indicator-service.h>
857
858 #include "dbus-shared-names.h"
859+#include "dbusmenu-shared.h"
860
861 #include "gtk-dialog/gconf-helper.h"
862
863 #include "users-service-dbus.h"
864 #include "lock-helper.h"
865
866-#define DKP_ADDRESS "org.freedesktop.DeviceKit.Power"
867-#define DKP_OBJECT "/org/freedesktop/DeviceKit/Power"
868-#define DKP_INTERFACE "org.freedesktop.DeviceKit.Power"
869+#define UP_ADDRESS "org.freedesktop.UPower"
870+#define UP_OBJECT "/org/freedesktop/UPower"
871+#define UP_INTERFACE "org.freedesktop.UPower"
872
873 #define GUEST_SESSION_LAUNCHER "/usr/share/gdm/guest-session/guest-session-launch"
874
875@@ -72,8 +73,8 @@
876
877 static DbusmenuMenuitem * root_menuitem = NULL;
878 static GMainLoop * mainloop = NULL;
879-static DBusGProxy * dkp_main_proxy = NULL;
880-static DBusGProxy * dkp_prop_proxy = NULL;
881+static DBusGProxy * up_main_proxy = NULL;
882+static DBusGProxy * up_prop_proxy = NULL;
883
884 static DBusGProxyCall * suspend_call = NULL;
885 static DBusGProxyCall * hibernate_call = NULL;
886@@ -147,14 +148,14 @@
887 {
888 gchar * type = (gchar *)userdata;
889
890- if (dkp_main_proxy == NULL) {
891- g_warning("Can not %s as no DeviceKit Power Proxy", type);
892+ if (up_main_proxy == NULL) {
893+ g_warning("Can not %s as no upower proxy", type);
894 }
895
896 screensaver_throttle(type);
897 lock_screen(NULL, 0, NULL);
898
899- dbus_g_proxy_begin_call(dkp_main_proxy,
900+ dbus_g_proxy_begin_call(up_main_proxy,
901 type,
902 sleep_response,
903 NULL,
904@@ -213,17 +214,17 @@
905 /* A signal that we need to recheck to ensure we can still
906 hibernate and/or suspend */
907 static void
908-dpk_changed_cb (DBusGProxy * proxy, gpointer user_data)
909+up_changed_cb (DBusGProxy * proxy, gpointer user_data)
910 {
911 /* Start Async call to see if we can hibernate */
912 if (suspend_call == NULL) {
913- suspend_call = dbus_g_proxy_begin_call(dkp_prop_proxy,
914+ suspend_call = dbus_g_proxy_begin_call(up_prop_proxy,
915 "Get",
916 suspend_prop_cb,
917 NULL,
918 NULL,
919 G_TYPE_STRING,
920- DKP_INTERFACE,
921+ UP_INTERFACE,
922 G_TYPE_STRING,
923 "can-suspend",
924 G_TYPE_INVALID,
925@@ -233,13 +234,13 @@
926
927 /* Start Async call to see if we can suspend */
928 if (hibernate_call == NULL) {
929- hibernate_call = dbus_g_proxy_begin_call(dkp_prop_proxy,
930+ hibernate_call = dbus_g_proxy_begin_call(up_prop_proxy,
931 "Get",
932 hibernate_prop_cb,
933 NULL,
934 NULL,
935 G_TYPE_STRING,
936- DKP_INTERFACE,
937+ UP_INTERFACE,
938 G_TYPE_STRING,
939 "can-hibernate",
940 G_TYPE_INVALID,
941@@ -254,39 +255,39 @@
942 DKp checking. We're even setting up the calls for the props
943 we need */
944 static void
945-setup_dkp (void) {
946+setup_up (void) {
947 DBusGConnection * bus = dbus_g_bus_get(DBUS_BUS_SYSTEM, NULL);
948 g_return_if_fail(bus != NULL);
949
950- if (dkp_main_proxy == NULL) {
951- dkp_main_proxy = dbus_g_proxy_new_for_name(bus,
952- DKP_ADDRESS,
953- DKP_OBJECT,
954- DKP_INTERFACE);
955+ if (up_main_proxy == NULL) {
956+ up_main_proxy = dbus_g_proxy_new_for_name(bus,
957+ UP_ADDRESS,
958+ UP_OBJECT,
959+ UP_INTERFACE);
960 }
961- g_return_if_fail(dkp_main_proxy != NULL);
962+ g_return_if_fail(up_main_proxy != NULL);
963
964- if (dkp_prop_proxy == NULL) {
965- dkp_prop_proxy = dbus_g_proxy_new_for_name(bus,
966- DKP_ADDRESS,
967- DKP_OBJECT,
968+ if (up_prop_proxy == NULL) {
969+ up_prop_proxy = dbus_g_proxy_new_for_name(bus,
970+ UP_ADDRESS,
971+ UP_OBJECT,
972 DBUS_INTERFACE_PROPERTIES);
973 }
974- g_return_if_fail(dkp_prop_proxy != NULL);
975+ g_return_if_fail(up_prop_proxy != NULL);
976
977 /* Connect to changed signal */
978- dbus_g_proxy_add_signal(dkp_main_proxy,
979+ dbus_g_proxy_add_signal(up_main_proxy,
980 "Changed",
981 G_TYPE_INVALID);
982
983- dbus_g_proxy_connect_signal(dkp_main_proxy,
984+ dbus_g_proxy_connect_signal(up_main_proxy,
985 "Changed",
986- G_CALLBACK(dpk_changed_cb),
987+ G_CALLBACK(up_changed_cb),
988 NULL,
989 NULL);
990
991 /* Force an original "changed" event */
992- dpk_changed_cb(dkp_main_proxy, NULL);
993+ up_changed_cb(up_main_proxy, NULL);
994
995 return;
996 }
997@@ -437,14 +438,40 @@
998
999 if (can_activate == TRUE)
1000 {
1001+ DbusmenuMenuitem * separator1 = dbusmenu_menuitem_new();
1002+ dbusmenu_menuitem_property_set(separator1, DBUSMENU_MENUITEM_PROP_TYPE, DBUSMENU_CLIENT_TYPES_SEPARATOR);
1003+ dbusmenu_menuitem_child_append(root, separator1);
1004+
1005 if (check_guest_session ())
1006 {
1007 mi = dbusmenu_menuitem_new ();
1008- dbusmenu_menuitem_property_set (mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Guest Session"));
1009+ dbusmenu_menuitem_property_set (mi, DBUSMENU_MENUITEM_PROP_TYPE, USER_ITEM_TYPE);
1010+ dbusmenu_menuitem_property_set (mi, USER_ITEM_PROP_NAME, _("Guest Session"));
1011+ dbusmenu_menuitem_property_set_bool (mi, USER_ITEM_PROP_LOGGED_IN, FALSE);
1012 dbusmenu_menuitem_child_append (root, mi);
1013 g_signal_connect (G_OBJECT (mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK (activate_guest_session), NULL);
1014 }
1015
1016+ if (check_new_session ())
1017+ {
1018+ ensure_gconf_client ();
1019+
1020+ switch_menuitem = dbusmenu_menuitem_new ();
1021+ dbusmenu_menuitem_property_set (switch_menuitem, DBUSMENU_MENUITEM_PROP_TYPE, MENU_SWITCH_TYPE);
1022+ dbusmenu_menuitem_property_set (switch_menuitem, MENU_SWITCH_USER, g_get_user_name());
1023+ dbusmenu_menuitem_child_append (root, switch_menuitem);
1024+ g_signal_connect (G_OBJECT (switch_menuitem), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK (activate_new_session), NULL);
1025+
1026+ if (gconf_client_get_bool (gconf_client, LOCKDOWN_KEY, NULL))
1027+ {
1028+ dbusmenu_menuitem_property_set_bool (switch_menuitem, DBUSMENU_MENUITEM_PROP_VISIBLE, FALSE);
1029+ }
1030+ else
1031+ {
1032+ dbusmenu_menuitem_property_set_bool (switch_menuitem, DBUSMENU_MENUITEM_PROP_VISIBLE, TRUE);
1033+ }
1034+ }
1035+
1036 if (count > MINIMUM_USERS && count < MAXIMUM_USERS)
1037 {
1038 if (users != NULL)
1039@@ -470,30 +497,13 @@
1040 user->service = service;
1041
1042 mi = dbusmenu_menuitem_new ();
1043- dbusmenu_menuitem_property_set (mi, DBUSMENU_MENUITEM_PROP_LABEL, user->real_name);
1044+ dbusmenu_menuitem_property_set (mi, DBUSMENU_MENUITEM_PROP_TYPE, USER_ITEM_TYPE);
1045+ dbusmenu_menuitem_property_set (mi, USER_ITEM_PROP_NAME, user->real_name);
1046+ dbusmenu_menuitem_property_set_bool (mi, USER_ITEM_PROP_LOGGED_IN, user->sessions != NULL);
1047 dbusmenu_menuitem_child_append (root, mi);
1048 g_signal_connect (G_OBJECT (mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK (activate_user_session), user);
1049 }
1050 }
1051-
1052- if (check_new_session ())
1053- {
1054- ensure_gconf_client ();
1055-
1056- switch_menuitem = dbusmenu_menuitem_new ();
1057- dbusmenu_menuitem_property_set (switch_menuitem, DBUSMENU_MENUITEM_PROP_LABEL, _("Switch User..."));
1058- dbusmenu_menuitem_child_append (root, switch_menuitem);
1059- g_signal_connect (G_OBJECT (switch_menuitem), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK (activate_new_session), NULL);
1060-
1061- if (gconf_client_get_bool (gconf_client, LOCKDOWN_KEY, NULL))
1062- {
1063- dbusmenu_menuitem_property_set_bool (switch_menuitem, DBUSMENU_MENUITEM_PROP_VISIBLE, FALSE);
1064- }
1065- else
1066- {
1067- dbusmenu_menuitem_property_set_bool (switch_menuitem, DBUSMENU_MENUITEM_PROP_VISIBLE, TRUE);
1068- }
1069- }
1070 }
1071
1072 DbusmenuMenuitem * separator = dbusmenu_menuitem_new();
1073@@ -639,7 +649,7 @@
1074 G_CALLBACK (user_removed),
1075 root_menuitem);
1076
1077- setup_dkp();
1078+ setup_up();
1079
1080 DbusmenuServer * server = dbusmenu_server_new(INDICATOR_SESSION_DBUS_OBJECT);
1081 dbusmenu_server_set_root(server, root_menuitem);

Subscribers

People subscribed via source and target branches

to all changes: