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
=== modified file 'Makefile.am'
--- Makefile.am 2009-09-08 15:14:27 +0000
+++ Makefile.am 2010-02-18 15:53:12 +0000
@@ -4,7 +4,7 @@
4 data \4 data \
5 po5 po
66
7EXTRA_DIST = COPYING.LGPL7EXTRA_DIST = COPYING.LGPL autogen.sh
88
9DISTCHECK_CONFIGURE_FLAGS = --enable-localinstall9DISTCHECK_CONFIGURE_FLAGS = --enable-localinstall
1010
1111
=== modified file 'configure.ac'
--- configure.ac 2010-02-11 16:52:09 +0000
+++ configure.ac 2010-02-18 15:53:12 +0000
@@ -4,7 +4,7 @@
4AC_PREREQ(2.53)4AC_PREREQ(2.53)
55
6AM_CONFIG_HEADER(config.h)6AM_CONFIG_HEADER(config.h)
7AM_INIT_AUTOMAKE(indicator-session, 0.2.2)7AM_INIT_AUTOMAKE(indicator-session, 0.2.3)
88
9AM_MAINTAINER_MODE9AM_MAINTAINER_MODE
1010
@@ -132,14 +132,19 @@
132data/icons/Makefile132data/icons/Makefile
133data/icons/16x16/Makefile133data/icons/16x16/Makefile
134data/icons/16x16/actions/Makefile134data/icons/16x16/actions/Makefile
135data/icons/16x16/status/Makefile
135data/icons/22x22/Makefile136data/icons/22x22/Makefile
136data/icons/22x22/actions/Makefile137data/icons/22x22/actions/Makefile
138data/icons/22x22/status/Makefile
137data/icons/24x24/Makefile139data/icons/24x24/Makefile
138data/icons/24x24/actions/Makefile140data/icons/24x24/actions/Makefile
141data/icons/24x24/status/Makefile
139data/icons/32x32/Makefile142data/icons/32x32/Makefile
140data/icons/32x32/actions/Makefile143data/icons/32x32/actions/Makefile
144data/icons/32x32/status/Makefile
141data/icons/scalable/Makefile145data/icons/scalable/Makefile
142data/icons/scalable/actions/Makefile146data/icons/scalable/actions/Makefile
147data/icons/scalable/status/Makefile
143po/Makefile.in148po/Makefile.in
144])149])
145150
146151
=== modified file 'data/icons/16x16/Makefile.am'
--- data/icons/16x16/Makefile.am 2009-12-24 19:31:30 +0000
+++ data/icons/16x16/Makefile.am 2010-02-18 15:53:12 +0000
@@ -1,1 +1,1 @@
1SUBDIRS = actions1SUBDIRS = actions status
22
=== added directory 'data/icons/16x16/status'
=== added file 'data/icons/16x16/status/Makefile.am'
--- data/icons/16x16/status/Makefile.am 1970-01-01 00:00:00 +0000
+++ data/icons/16x16/status/Makefile.am 2010-02-18 15:53:12 +0000
@@ -0,0 +1,7 @@
1
2iconsdir = $(INDICATORICONSDIR)/hicolor/16x16/status
3
4icons_DATA = \
5 account-logged-in.png
6
7EXTRA_DIST = $(icons_DATA)
08
=== added file 'data/icons/16x16/status/account-logged-in.png'
1Binary 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 differ9Binary 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
=== modified file 'data/icons/22x22/Makefile.am'
--- data/icons/22x22/Makefile.am 2009-12-24 19:31:30 +0000
+++ data/icons/22x22/Makefile.am 2010-02-18 15:53:12 +0000
@@ -1,1 +1,1 @@
1SUBDIRS = actions1SUBDIRS = actions status
22
=== added directory 'data/icons/22x22/status'
=== added file 'data/icons/22x22/status/Makefile.am'
--- data/icons/22x22/status/Makefile.am 1970-01-01 00:00:00 +0000
+++ data/icons/22x22/status/Makefile.am 2010-02-18 15:53:12 +0000
@@ -0,0 +1,7 @@
1
2iconsdir = $(INDICATORICONSDIR)/hicolor/22x22/status
3
4icons_DATA = \
5 account-logged-in.png
6
7EXTRA_DIST = $(icons_DATA)
08
=== added file 'data/icons/22x22/status/account-logged-in.png'
1Binary 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 differ9Binary 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
=== modified file 'data/icons/24x24/Makefile.am'
--- data/icons/24x24/Makefile.am 2009-12-24 19:31:30 +0000
+++ data/icons/24x24/Makefile.am 2010-02-18 15:53:12 +0000
@@ -1,1 +1,1 @@
1SUBDIRS = actions1SUBDIRS = actions status
22
=== added directory 'data/icons/24x24/status'
=== added file 'data/icons/24x24/status/Makefile.am'
--- data/icons/24x24/status/Makefile.am 1970-01-01 00:00:00 +0000
+++ data/icons/24x24/status/Makefile.am 2010-02-18 15:53:12 +0000
@@ -0,0 +1,7 @@
1
2iconsdir = $(INDICATORICONSDIR)/hicolor/24x24/status
3
4icons_DATA = \
5 account-logged-in.png
6
7EXTRA_DIST = $(icons_DATA)
08
=== added file 'data/icons/24x24/status/account-logged-in.png'
1Binary 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 differ9Binary 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
=== modified file 'data/icons/32x32/Makefile.am'
--- data/icons/32x32/Makefile.am 2009-12-24 19:31:30 +0000
+++ data/icons/32x32/Makefile.am 2010-02-18 15:53:12 +0000
@@ -1,1 +1,1 @@
1SUBDIRS = actions1SUBDIRS = actions status
22
=== added directory 'data/icons/32x32/status'
=== added file 'data/icons/32x32/status/Makefile.am'
--- data/icons/32x32/status/Makefile.am 1970-01-01 00:00:00 +0000
+++ data/icons/32x32/status/Makefile.am 2010-02-18 15:53:12 +0000
@@ -0,0 +1,7 @@
1
2iconsdir = $(INDICATORICONSDIR)/hicolor/32x32/status
3
4icons_DATA = \
5 account-logged-in.png
6
7EXTRA_DIST = $(icons_DATA)
08
=== added file 'data/icons/32x32/status/account-logged-in.png'
1Binary 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 differ9Binary 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
=== modified file 'data/icons/scalable/Makefile.am'
--- data/icons/scalable/Makefile.am 2009-12-24 19:31:30 +0000
+++ data/icons/scalable/Makefile.am 2010-02-18 15:53:12 +0000
@@ -1,1 +1,1 @@
1SUBDIRS = actions1SUBDIRS = actions status
22
=== added directory 'data/icons/scalable/status'
=== added file 'data/icons/scalable/status/Makefile.am'
--- data/icons/scalable/status/Makefile.am 1970-01-01 00:00:00 +0000
+++ data/icons/scalable/status/Makefile.am 2010-02-18 15:53:12 +0000
@@ -0,0 +1,7 @@
1
2iconsdir = $(INDICATORICONSDIR)/hicolor/scalable/status
3
4icons_DATA = \
5 account-logged-in.svg
6
7EXTRA_DIST = $(icons_DATA)
08
=== added file 'data/icons/scalable/status/account-logged-in.svg'
--- data/icons/scalable/status/account-logged-in.svg 1970-01-01 00:00:00 +0000
+++ data/icons/scalable/status/account-logged-in.svg 2010-02-18 15:53:12 +0000
@@ -0,0 +1,270 @@
1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2<!-- Created with Inkscape (http://www.inkscape.org/) -->
3<svg
4 xmlns:dc="http://purl.org/dc/elements/1.1/"
5 xmlns:cc="http://web.resource.org/cc/"
6 xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
7 xmlns:svg="http://www.w3.org/2000/svg"
8 xmlns="http://www.w3.org/2000/svg"
9 xmlns:xlink="http://www.w3.org/1999/xlink"
10 xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
11 xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
12 id="svg1"
13 sodipodi:version="0.32"
14 inkscape:version="0.45"
15 width="48"
16 height="48"
17 sodipodi:docbase="/home/dobey/Projects/gnome-icon-theme/scalable/emblems"
18 sodipodi:docname="emblem-default.svg"
19 inkscape:output_extension="org.inkscape.output.svg.inkscape"
20 version="1.0">
21 <defs
22 id="defs3">
23 <linearGradient
24 id="linearGradient5237">
25 <stop
26 style="stop-color:#ffffff;stop-opacity:1;"
27 offset="0"
28 id="stop5239" />
29 <stop
30 id="stop5247"
31 offset="0.5"
32 style="stop-color:#ffffff;stop-opacity:1;" />
33 <stop
34 style="stop-color:#9c9c9c;stop-opacity:1"
35 offset="1"
36 id="stop5241" />
37 </linearGradient>
38 <linearGradient
39 id="linearGradient5226">
40 <stop
41 style="stop-color:#63b512;stop-opacity:1;"
42 offset="0"
43 id="stop5229" />
44 <stop
45 id="stop5245"
46 offset="0.16030352"
47 style="stop-color:#58a30e;stop-opacity:1;" />
48 <stop
49 id="stop5235"
50 offset="0.66008514"
51 style="stop-color:#366b04;stop-opacity:1" />
52 <stop
53 style="stop-color:#87ea25;stop-opacity:1"
54 offset="1"
55 id="stop5231" />
56 </linearGradient>
57 <linearGradient
58 inkscape:collect="always"
59 id="linearGradient5300">
60 <stop
61 style="stop-color:#ffffff;stop-opacity:1;"
62 offset="0"
63 id="stop5302" />
64 <stop
65 style="stop-color:#ffffff;stop-opacity:0;"
66 offset="1"
67 id="stop5304" />
68 </linearGradient>
69 <linearGradient
70 inkscape:collect="always"
71 id="linearGradient5224">
72 <stop
73 style="stop-color:#000000;stop-opacity:1;"
74 offset="0"
75 id="stop5226" />
76 <stop
77 style="stop-color:#000000;stop-opacity:0;"
78 offset="1"
79 id="stop5228" />
80 </linearGradient>
81 <radialGradient
82 inkscape:collect="always"
83 xlink:href="#linearGradient5224"
84 id="radialGradient5230"
85 cx="14.5"
86 cy="26.6875"
87 fx="14.5"
88 fy="26.6875"
89 r="10"
90 gradientTransform="matrix(1,0,0,0.29375,0,18.848047)"
91 gradientUnits="userSpaceOnUse" />
92 <filter
93 inkscape:collect="always"
94 id="filter5296"
95 x="-0.09814655"
96 width="1.1962931"
97 y="-0.33411592"
98 height="1.6682318">
99 <feGaussianBlur
100 inkscape:collect="always"
101 stdDeviation="0.81788793"
102 id="feGaussianBlur5298" />
103 </filter>
104 <radialGradient
105 inkscape:collect="always"
106 xlink:href="#linearGradient5300"
107 id="radialGradient5306"
108 cx="29.77438"
109 cy="7.0922189"
110 fx="29.77438"
111 fy="7.0922189"
112 r="25.380436"
113 gradientUnits="userSpaceOnUse"
114 gradientTransform="matrix(2.2469896,0,0,2.2469896,-37.128341,-8.8439229)" />
115 <radialGradient
116 inkscape:collect="always"
117 xlink:href="#linearGradient5224"
118 id="radialGradient5330"
119 gradientUnits="userSpaceOnUse"
120 gradientTransform="matrix(1,0,0,0.29375,0,18.848047)"
121 cx="14.5"
122 cy="26.6875"
123 fx="14.5"
124 fy="26.6875"
125 r="10" />
126 <radialGradient
127 inkscape:collect="always"
128 xlink:href="#linearGradient5226"
129 id="radialGradient5233"
130 cx="29.392656"
131 cy="18.898249"
132 fx="29.392656"
133 fy="18.898249"
134 r="29.699959"
135 gradientUnits="userSpaceOnUse"
136 gradientTransform="matrix(1.5354369,0,0,1.5485894,-15.737913,-10.36738)" />
137 <radialGradient
138 inkscape:collect="always"
139 xlink:href="#linearGradient5237"
140 id="radialGradient5243"
141 cx="22.9375"
142 cy="16.305218"
143 fx="22.9375"
144 fy="16.305218"
145 r="15.5625"
146 gradientTransform="matrix(1.5301205,0,0,1.6745294,-12.159639,-11.709817)"
147 gradientUnits="userSpaceOnUse" />
148 </defs>
149 <sodipodi:namedview
150 id="base"
151 pagecolor="#ffffff"
152 bordercolor="#ededed"
153 borderopacity="1"
154 inkscape:pageopacity="0.0"
155 inkscape:pageshadow="2"
156 inkscape:zoom="1"
157 inkscape:cx="39.269655"
158 inkscape:cy="17.441445"
159 inkscape:window-width="826"
160 inkscape:window-height="790"
161 gridspacingx="0.50000000mm"
162 gridspacingy="0.50000000mm"
163 showgrid="false"
164 inkscape:grid-bbox="false"
165 inkscape:window-x="461"
166 inkscape:window-y="278"
167 inkscape:current-layer="svg1"
168 borderlayer="true"
169 inkscape:showpageshadow="false"
170 width="744.09449px"
171 height="1052.3622px">
172 <inkscape:grid
173 type="xygrid"
174 id="grid5308" />
175 </sodipodi:namedview>
176 <metadata
177 id="metadata4">
178 <rdf:RDF>
179 <cc:Work
180 rdf:about="">
181 <dc:format>image/svg+xml</dc:format>
182 <dc:type
183 rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
184 <dc:title>Emblem Urgent</dc:title>
185 <dc:creator>
186 <cc:Agent>
187 <dc:title>Jakub Steiner</dc:title>
188 </cc:Agent>
189 </dc:creator>
190 <dc:contributor>
191 <cc:Agent>
192 <dc:title>Andreas Nilsson</dc:title>
193 </cc:Agent>
194 </dc:contributor>
195 <cc:license
196 rdf:resource="http://creativecommons.org/licenses/GPL/2.0/" />
197 <dc:subject>
198 <rdf:Bag>
199 <rdf:li>generic</rdf:li>
200 </rdf:Bag>
201 </dc:subject>
202 </cc:Work>
203 <cc:License
204 rdf:about="http://creativecommons.org/licenses/GPL/2.0/">
205 <cc:permits
206 rdf:resource="http://web.resource.org/cc/Reproduction" />
207 <cc:permits
208 rdf:resource="http://web.resource.org/cc/Distribution" />
209 <cc:requires
210 rdf:resource="http://web.resource.org/cc/Notice" />
211 <cc:permits
212 rdf:resource="http://web.resource.org/cc/DerivativeWorks" />
213 <cc:requires
214 rdf:resource="http://web.resource.org/cc/ShareAlike" />
215 <cc:requires
216 rdf:resource="http://web.resource.org/cc/SourceCode" />
217 </cc:License>
218 </rdf:RDF>
219 </metadata>
220 <path
221 sodipodi:type="arc"
222 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"
223 id="path4645"
224 sodipodi:cx="14.5"
225 sodipodi:cy="26.6875"
226 sodipodi:rx="10"
227 sodipodi:ry="2.9375"
228 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"
229 transform="matrix(2.1570145,0,0,2.155398,-7.8468552,-16.33814)" />
230 <path
231 transform="matrix(1.3478975,0,0,1.3468874,3.8853414,6.4889877)"
232 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"
233 sodipodi:ry="2.9375"
234 sodipodi:rx="10"
235 sodipodi:cy="26.6875"
236 sodipodi:cx="14.5"
237 id="path5328"
238 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"
239 sodipodi:type="arc" />
240 <path
241 sodipodi:type="arc"
242 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"
243 id="path907"
244 sodipodi:cx="29.392656"
245 sodipodi:cy="29.207693"
246 sodipodi:rx="29.010935"
247 sodipodi:ry="29.010935"
248 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"
249 transform="matrix(0.7238447,0,0,0.7274883,2.1828126,2.3568607)" />
250 <path
251 sodipodi:type="arc"
252 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"
253 id="path1552"
254 sodipodi:cx="29.77438"
255 sodipodi:cy="30.352861"
256 sodipodi:rx="24.175779"
257 sodipodi:ry="24.175779"
258 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"
259 transform="matrix(0.8254302,0,0,0.8252681,-1.1457884,-1.4441229)" />
260 <path
261 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"
262 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"
263 id="path5222"
264 sodipodi:nodetypes="ccccccc" />
265 <path
266 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"
267 d="M 40.21875,10.8125 C 41.930961,13.346411 43.59334,15.979986 44.40625,20.3125"
268 id="path5224"
269 sodipodi:nodetypes="cc" />
270</svg>
0271
=== modified file 'debian/changelog'
--- debian/changelog 2010-02-17 10:30:06 +0000
+++ debian/changelog 2010-02-18 15:53:12 +0000
@@ -1,3 +1,15 @@
1indicator-session (0.2.3-0ubuntu1~ppa1) lucid; urgency=low
2
3 * Upstream release 0.2.3
4 * Switch menu ordering to match design spec
5 * Change switch menu item to "Switch from..."
6 * Move from Devkit-Power to upower
7 * Adding in user logged in icon and menu item
8 * Removed debian/patches/01_port_to_upower.patch as it is now merged
9 upstream.
10
11 -- Ted Gould <ted@ubuntu.com> Thu, 18 Feb 2010 09:49:22 -0600
12
1indicator-session (0.2.2-0ubuntu2) lucid; urgency=low13indicator-session (0.2.2-0ubuntu2) lucid; urgency=low
214
3 * debian/control: Update devicekit-power dependency to upower.15 * debian/control: Update devicekit-power dependency to upower.
416
=== removed file 'debian/patches/01_port_to_upower.patch'
--- debian/patches/01_port_to_upower.patch 2010-02-17 10:13:04 +0000
+++ debian/patches/01_port_to_upower.patch 1970-01-01 00:00:00 +0000
@@ -1,151 +0,0 @@
1Description: Port to upower
2Author: Martin Pitt <martin.pitt@ubuntu.com>
3Upstream: https://code.launchpad.net/~pitti/indicator-session/upower/+merge/19472
4--- indicator-session/src/session-service.c 2010-02-16 10:25:28.000000000 +0100
5+++ indicator-session.new/src/session-service.c 2010-02-17 11:11:18.149652860 +0100
6@@ -44,9 +44,9 @@
7 #include "users-service-dbus.h"
8 #include "lock-helper.h"
9
10-#define DKP_ADDRESS "org.freedesktop.DeviceKit.Power"
11-#define DKP_OBJECT "/org/freedesktop/DeviceKit/Power"
12-#define DKP_INTERFACE "org.freedesktop.DeviceKit.Power"
13+#define UP_ADDRESS "org.freedesktop.UPower"
14+#define UP_OBJECT "/org/freedesktop/UPower"
15+#define UP_INTERFACE "org.freedesktop.UPower"
16
17 #define GUEST_SESSION_LAUNCHER "/usr/share/gdm/guest-session/guest-session-launch"
18
19@@ -72,8 +72,8 @@
20
21 static DbusmenuMenuitem * root_menuitem = NULL;
22 static GMainLoop * mainloop = NULL;
23-static DBusGProxy * dkp_main_proxy = NULL;
24-static DBusGProxy * dkp_prop_proxy = NULL;
25+static DBusGProxy * up_main_proxy = NULL;
26+static DBusGProxy * up_prop_proxy = NULL;
27
28 static DBusGProxyCall * suspend_call = NULL;
29 static DBusGProxyCall * hibernate_call = NULL;
30@@ -147,14 +147,14 @@
31 {
32 gchar * type = (gchar *)userdata;
33
34- if (dkp_main_proxy == NULL) {
35- g_warning("Can not %s as no DeviceKit Power Proxy", type);
36+ if (up_main_proxy == NULL) {
37+ g_warning("Can not %s as no upower proxy", type);
38 }
39
40 screensaver_throttle(type);
41 lock_screen(NULL, 0, NULL);
42
43- dbus_g_proxy_begin_call(dkp_main_proxy,
44+ dbus_g_proxy_begin_call(up_main_proxy,
45 type,
46 sleep_response,
47 NULL,
48@@ -213,17 +213,17 @@
49 /* A signal that we need to recheck to ensure we can still
50 hibernate and/or suspend */
51 static void
52-dpk_changed_cb (DBusGProxy * proxy, gpointer user_data)
53+up_changed_cb (DBusGProxy * proxy, gpointer user_data)
54 {
55 /* Start Async call to see if we can hibernate */
56 if (suspend_call == NULL) {
57- suspend_call = dbus_g_proxy_begin_call(dkp_prop_proxy,
58+ suspend_call = dbus_g_proxy_begin_call(up_prop_proxy,
59 "Get",
60 suspend_prop_cb,
61 NULL,
62 NULL,
63 G_TYPE_STRING,
64- DKP_INTERFACE,
65+ UP_INTERFACE,
66 G_TYPE_STRING,
67 "can-suspend",
68 G_TYPE_INVALID,
69@@ -233,13 +233,13 @@
70
71 /* Start Async call to see if we can suspend */
72 if (hibernate_call == NULL) {
73- hibernate_call = dbus_g_proxy_begin_call(dkp_prop_proxy,
74+ hibernate_call = dbus_g_proxy_begin_call(up_prop_proxy,
75 "Get",
76 hibernate_prop_cb,
77 NULL,
78 NULL,
79 G_TYPE_STRING,
80- DKP_INTERFACE,
81+ UP_INTERFACE,
82 G_TYPE_STRING,
83 "can-hibernate",
84 G_TYPE_INVALID,
85@@ -254,39 +254,39 @@
86 DKp checking. We're even setting up the calls for the props
87 we need */
88 static void
89-setup_dkp (void) {
90+setup_up (void) {
91 DBusGConnection * bus = dbus_g_bus_get(DBUS_BUS_SYSTEM, NULL);
92 g_return_if_fail(bus != NULL);
93
94- if (dkp_main_proxy == NULL) {
95- dkp_main_proxy = dbus_g_proxy_new_for_name(bus,
96- DKP_ADDRESS,
97- DKP_OBJECT,
98- DKP_INTERFACE);
99- }
100- g_return_if_fail(dkp_main_proxy != NULL);
101-
102- if (dkp_prop_proxy == NULL) {
103- dkp_prop_proxy = dbus_g_proxy_new_for_name(bus,
104- DKP_ADDRESS,
105- DKP_OBJECT,
106+ if (up_main_proxy == NULL) {
107+ up_main_proxy = dbus_g_proxy_new_for_name(bus,
108+ UP_ADDRESS,
109+ UP_OBJECT,
110+ UP_INTERFACE);
111+ }
112+ g_return_if_fail(up_main_proxy != NULL);
113+
114+ if (up_prop_proxy == NULL) {
115+ up_prop_proxy = dbus_g_proxy_new_for_name(bus,
116+ UP_ADDRESS,
117+ UP_OBJECT,
118 DBUS_INTERFACE_PROPERTIES);
119 }
120- g_return_if_fail(dkp_prop_proxy != NULL);
121+ g_return_if_fail(up_prop_proxy != NULL);
122
123 /* Connect to changed signal */
124- dbus_g_proxy_add_signal(dkp_main_proxy,
125+ dbus_g_proxy_add_signal(up_main_proxy,
126 "Changed",
127 G_TYPE_INVALID);
128
129- dbus_g_proxy_connect_signal(dkp_main_proxy,
130+ dbus_g_proxy_connect_signal(up_main_proxy,
131 "Changed",
132- G_CALLBACK(dpk_changed_cb),
133+ G_CALLBACK(up_changed_cb),
134 NULL,
135 NULL);
136
137 /* Force an original "changed" event */
138- dpk_changed_cb(dkp_main_proxy, NULL);
139+ up_changed_cb(up_main_proxy, NULL);
140
141 return;
142 }
143@@ -639,7 +639,7 @@
144 G_CALLBACK (user_removed),
145 root_menuitem);
146
147- setup_dkp();
148+ setup_up();
149
150 DbusmenuServer * server = dbusmenu_server_new(INDICATOR_SESSION_DBUS_OBJECT);
151 dbusmenu_server_set_root(server, root_menuitem);
1520
=== modified file 'src/Makefile.am'
--- src/Makefile.am 2010-01-06 05:37:18 +0000
+++ src/Makefile.am 2010-02-18 15:53:12 +0000
@@ -11,6 +11,7 @@
11libsession_la_SOURCES = \11libsession_la_SOURCES = \
12 indicator-session.c \12 indicator-session.c \
13 dbus-shared-names.h \13 dbus-shared-names.h \
14 dbusmenu-shared.h \
14 users-service-client.h15 users-service-client.h
15libsession_la_CFLAGS = $(APPLET_CFLAGS) -Wall -Werror16libsession_la_CFLAGS = $(APPLET_CFLAGS) -Wall -Werror
16libsession_la_LIBADD = $(APPLET_LIBS)17libsession_la_LIBADD = $(APPLET_LIBS)
@@ -42,6 +43,7 @@
42 lock-helper.c \43 lock-helper.c \
43 lock-helper.h \44 lock-helper.h \
44 session-service.c \45 session-service.c \
46 dbusmenu-shared.h \
45 gtk-dialog/gconf-helper.c \47 gtk-dialog/gconf-helper.c \
46 users-service-dbus.h \48 users-service-dbus.h \
47 users-service-dbus.c \49 users-service-dbus.c \
4850
=== modified file 'src/dbus-shared-names.h'
--- src/dbus-shared-names.h 2009-12-24 20:36:35 +0000
+++ src/dbus-shared-names.h 2010-02-18 15:53:12 +0000
@@ -38,4 +38,8 @@
38#define INDICATOR_SESSION_DBUS_OBJECT "/org/ayatana/indicator/session/menu"38#define INDICATOR_SESSION_DBUS_OBJECT "/org/ayatana/indicator/session/menu"
39#define INDICATOR_SESSION_DBUS_VERSION 039#define INDICATOR_SESSION_DBUS_VERSION 0
4040
41#define USER_ITEM_TYPE "x-canonical-user-item"
42#define USER_ITEM_PROP_NAME "user-item-name"
43#define USER_ITEM_PROP_LOGGED_IN "user-item-logged-in"
44
41#endif /* __DBUS_SHARED_NAMES_H__ */45#endif /* __DBUS_SHARED_NAMES_H__ */
4246
=== added file 'src/dbusmenu-shared.h'
--- src/dbusmenu-shared.h 1970-01-01 00:00:00 +0000
+++ src/dbusmenu-shared.h 2010-02-18 15:53:12 +0000
@@ -0,0 +1,4 @@
1
2#define MENU_SWITCH_TYPE "x-canonical-switch-from"
3#define MENU_SWITCH_USER "x-canonical-switch-username"
4
05
=== modified file 'src/indicator-session.c'
--- src/indicator-session.c 2010-01-03 05:51:04 +0000
+++ src/indicator-session.c 2010-02-18 15:53:12 +0000
@@ -22,6 +22,7 @@
2222
23#include <glib.h>23#include <glib.h>
24#include <glib-object.h>24#include <glib-object.h>
25#include <glib/gi18n.h>
25#include <gtk/gtk.h>26#include <gtk/gtk.h>
26#include <libdbusmenu-gtk/menu.h>27#include <libdbusmenu-gtk/menu.h>
2728
@@ -33,6 +34,7 @@
33#include <libindicator/indicator-service-manager.h>34#include <libindicator/indicator-service-manager.h>
3435
35#include "dbus-shared-names.h"36#include "dbus-shared-names.h"
37#include "dbusmenu-shared.h"
3638
37#define INDICATOR_SESSION_TYPE (indicator_session_get_type ())39#define INDICATOR_SESSION_TYPE (indicator_session_get_type ())
38#define INDICATOR_SESSION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), INDICATOR_SESSION_TYPE, IndicatorSession))40#define INDICATOR_SESSION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), INDICATOR_SESSION_TYPE, IndicatorSession))
@@ -51,6 +53,8 @@
51struct _IndicatorSession {53struct _IndicatorSession {
52 IndicatorObject parent;54 IndicatorObject parent;
53 IndicatorServiceManager * service;55 IndicatorServiceManager * service;
56 GtkImage * status_image;
57 DbusmenuGtkMenu * menu;
54};58};
5559
56GType indicator_session_get_type (void);60GType indicator_session_get_type (void);
@@ -63,6 +67,8 @@
63static GtkLabel * get_label (IndicatorObject * io);67static GtkLabel * get_label (IndicatorObject * io);
64static GtkImage * get_icon (IndicatorObject * io);68static GtkImage * get_icon (IndicatorObject * io);
65static GtkMenu * get_menu (IndicatorObject * io);69static GtkMenu * get_menu (IndicatorObject * io);
70static gboolean build_menu_switch (DbusmenuMenuitem * newitem, DbusmenuMenuitem * parent, DbusmenuClient * client);
71static gboolean new_user_item (DbusmenuMenuitem * newitem, DbusmenuMenuitem * parent, DbusmenuClient * client);
6672
67static void indicator_session_class_init (IndicatorSessionClass *klass);73static void indicator_session_class_init (IndicatorSessionClass *klass);
68static void indicator_session_init (IndicatorSession *self);74static void indicator_session_init (IndicatorSession *self);
@@ -96,6 +102,13 @@
96 /* Now let's fire these guys up. */102 /* Now let's fire these guys up. */
97 self->service = indicator_service_manager_new_version(INDICATOR_SESSION_DBUS_NAME, INDICATOR_SESSION_DBUS_VERSION);103 self->service = indicator_service_manager_new_version(INDICATOR_SESSION_DBUS_NAME, INDICATOR_SESSION_DBUS_VERSION);
98104
105 self->status_image = GTK_IMAGE(gtk_image_new_from_icon_name("system-shutdown-panel", GTK_ICON_SIZE_MENU));
106 self->menu = dbusmenu_gtkmenu_new(INDICATOR_SESSION_DBUS_NAME, INDICATOR_SESSION_DBUS_OBJECT);
107
108 DbusmenuClient * client = DBUSMENU_CLIENT(dbusmenu_gtkmenu_get_client(self->menu));
109 dbusmenu_client_add_type_handler(client, MENU_SWITCH_TYPE, build_menu_switch);
110 dbusmenu_client_add_type_handler(client, USER_ITEM_TYPE, new_user_item);
111
99 return;112 return;
100}113}
101114
@@ -130,9 +143,37 @@
130static GtkImage *143static GtkImage *
131get_icon (IndicatorObject * io)144get_icon (IndicatorObject * io)
132{145{
133 GtkImage * status_image = GTK_IMAGE(gtk_image_new_from_icon_name("system-shutdown-panel", GTK_ICON_SIZE_MENU));146 gtk_widget_show(GTK_WIDGET(INDICATOR_SESSION(io)->status_image));
134 gtk_widget_show(GTK_WIDGET(status_image));147 return INDICATOR_SESSION(io)->status_image;
135 return status_image;148}
149
150/* Builds an item with a hip little logged in icon. */
151static gboolean
152new_user_item (DbusmenuMenuitem * newitem, DbusmenuMenuitem * parent, DbusmenuClient * client)
153{
154 GtkMenuItem * gmi = GTK_MENU_ITEM(gtk_menu_item_new());
155 GtkWidget * hbox = gtk_hbox_new(FALSE, 0);
156
157 GtkWidget * label = gtk_label_new(dbusmenu_menuitem_property_get(newitem, USER_ITEM_PROP_NAME));
158 gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
159 gtk_box_pack_start(GTK_BOX(hbox), label, TRUE, TRUE, 0);
160 gtk_widget_show(label);
161
162 GtkWidget * icon = gtk_image_new_from_icon_name("account-logged-in", GTK_ICON_SIZE_MENU);
163 gtk_misc_set_alignment(GTK_MISC(icon), 1.0, 0.5);
164 gtk_box_pack_start(GTK_BOX(hbox), icon, FALSE, FALSE, 0);
165 if (dbusmenu_menuitem_property_get_bool(newitem, USER_ITEM_PROP_LOGGED_IN)) {
166 gtk_widget_show(icon);
167 } else {
168 gtk_widget_hide(icon);
169 }
170
171 gtk_container_add(GTK_CONTAINER(gmi), hbox);
172 gtk_widget_show(hbox);
173
174 dbusmenu_gtkclient_newitem_base(DBUSMENU_GTKCLIENT(client), newitem, gmi, parent);
175
176 return TRUE;
136}177}
137178
138/* Indicator based function to get the menu for the whole179/* Indicator based function to get the menu for the whole
@@ -141,7 +182,106 @@
141static GtkMenu *182static GtkMenu *
142get_menu (IndicatorObject * io)183get_menu (IndicatorObject * io)
143{184{
144 return GTK_MENU(dbusmenu_gtkmenu_new(INDICATOR_SESSION_DBUS_NAME, INDICATOR_SESSION_DBUS_OBJECT));185 return GTK_MENU(INDICATOR_SESSION(io)->menu);
145}186}
146187
147188static void
189switch_property_change (DbusmenuMenuitem * item, const gchar * property, const GValue * value, gpointer user_data)
190{
191 if (g_strcmp0(property, MENU_SWITCH_USER) != 0) {
192 return;
193 }
194
195 GtkMenuItem * gmi = dbusmenu_gtkclient_menuitem_get(DBUSMENU_GTKCLIENT(user_data), item);
196 gchar * finalstring = NULL;
197 gboolean set_ellipsize = FALSE;
198
199 /* If there's a NULL string of some type, then we want to
200 go back to our old 'Switch User' which isn't great but
201 eh, this error condition should never happen. */
202 if (value == NULL || g_value_get_string(value) == NULL || g_value_get_string(value)[0] == '\0') {
203 finalstring = _("Switch User...");
204 set_ellipsize = FALSE;
205 }
206
207 if (finalstring == NULL) {
208 const gchar * username = g_value_get_string(value);
209 GtkStyle * style = gtk_widget_get_style(GTK_WIDGET(gmi));
210
211 PangoLayout * layout = pango_layout_new(gtk_widget_get_pango_context(GTK_WIDGET(gmi)));
212 pango_layout_set_text(layout, username, -1);
213 pango_layout_set_font_description(layout, style->font_desc);
214
215 gint width;
216 pango_layout_get_pixel_size(layout, &width, NULL);
217 g_debug("Username width %dpx", width);
218
219 gint point = pango_font_description_get_size(style->font_desc);
220 g_debug("Font size %f pt", (gfloat)point / PANGO_SCALE);
221
222 gdouble dpi = gdk_screen_get_resolution(gdk_screen_get_default());
223 g_debug("Screen DPI %f", dpi);
224
225 gdouble pixels_per_em = ((point * dpi) / 72.0f) / PANGO_SCALE;
226 gdouble ems = width / pixels_per_em;
227 g_debug("Username width %fem", ems);
228
229 /* TODO: We need some way to remove the elipsis from appearing
230 twice in the label. Not sure how to do that yet. */
231 finalstring = g_strdup_printf(_("Switch from %s..."), username);
232 if (ems >= 20.0f) {
233 set_ellipsize = TRUE;
234 } else {
235 set_ellipsize = FALSE;
236 }
237 }
238
239 gtk_menu_item_set_label(gmi, finalstring);
240
241 GtkLabel * label = GTK_LABEL(gtk_bin_get_child(GTK_BIN(gmi)));
242 if (label != NULL) {
243 if (set_ellipsize) {
244 gtk_label_set_ellipsize(label, PANGO_ELLIPSIZE_END);
245 } else {
246 gtk_label_set_ellipsize(label, PANGO_ELLIPSIZE_NONE);
247 }
248 }
249
250 return;
251}
252
253static const gchar * dbusmenu_item_data = "dbusmenu-item";
254
255/* Callback for when the style changes so we can reevaluate the
256 size of the user name with the potentially new font. */
257static void
258switch_style_set (GtkWidget * widget, GtkStyle * prev_style, gpointer user_data)
259{
260 DbusmenuGtkClient * client = DBUSMENU_GTKCLIENT(user_data);
261 DbusmenuMenuitem * mi = DBUSMENU_MENUITEM(g_object_get_data(G_OBJECT(widget), dbusmenu_item_data));
262
263 switch_property_change(mi, MENU_SWITCH_USER, dbusmenu_menuitem_property_get_value(mi, MENU_SWITCH_USER), client);
264 return;
265}
266
267
268/* This function checks to see if the user name is short enough
269 to not need ellipsing itself, or if, it will get ellipsed by
270 the standard label processor. */
271static gboolean
272build_menu_switch (DbusmenuMenuitem * newitem, DbusmenuMenuitem * parent, DbusmenuClient * client)
273{
274 GtkMenuItem * gmi = GTK_MENU_ITEM(gtk_menu_item_new());
275 if (gmi == NULL) {
276 return FALSE;
277 }
278 g_object_set_data(G_OBJECT(gmi), dbusmenu_item_data, newitem);
279
280 dbusmenu_gtkclient_newitem_base(DBUSMENU_GTKCLIENT(client), newitem, gmi, parent);
281
282 g_signal_connect(G_OBJECT(newitem), DBUSMENU_MENUITEM_SIGNAL_PROPERTY_CHANGED, G_CALLBACK(switch_property_change), client);
283 g_signal_connect(G_OBJECT(gmi), "style-set", G_CALLBACK(switch_style_set), client);
284 switch_property_change(newitem, MENU_SWITCH_USER, dbusmenu_menuitem_property_get_value(newitem, MENU_SWITCH_USER), client);
285
286 return TRUE;
287}
148288
=== modified file 'src/session-service.c'
--- src/session-service.c 2010-02-08 22:46:35 +0000
+++ src/session-service.c 2010-02-18 15:53:12 +0000
@@ -38,15 +38,16 @@
38#include <libindicator/indicator-service.h>38#include <libindicator/indicator-service.h>
3939
40#include "dbus-shared-names.h"40#include "dbus-shared-names.h"
41#include "dbusmenu-shared.h"
4142
42#include "gtk-dialog/gconf-helper.h"43#include "gtk-dialog/gconf-helper.h"
4344
44#include "users-service-dbus.h"45#include "users-service-dbus.h"
45#include "lock-helper.h"46#include "lock-helper.h"
4647
47#define DKP_ADDRESS "org.freedesktop.DeviceKit.Power"48#define UP_ADDRESS "org.freedesktop.UPower"
48#define DKP_OBJECT "/org/freedesktop/DeviceKit/Power"49#define UP_OBJECT "/org/freedesktop/UPower"
49#define DKP_INTERFACE "org.freedesktop.DeviceKit.Power"50#define UP_INTERFACE "org.freedesktop.UPower"
5051
51#define GUEST_SESSION_LAUNCHER "/usr/share/gdm/guest-session/guest-session-launch"52#define GUEST_SESSION_LAUNCHER "/usr/share/gdm/guest-session/guest-session-launch"
5253
@@ -72,8 +73,8 @@
7273
73static DbusmenuMenuitem * root_menuitem = NULL;74static DbusmenuMenuitem * root_menuitem = NULL;
74static GMainLoop * mainloop = NULL;75static GMainLoop * mainloop = NULL;
75static DBusGProxy * dkp_main_proxy = NULL;76static DBusGProxy * up_main_proxy = NULL;
76static DBusGProxy * dkp_prop_proxy = NULL;77static DBusGProxy * up_prop_proxy = NULL;
7778
78static DBusGProxyCall * suspend_call = NULL;79static DBusGProxyCall * suspend_call = NULL;
79static DBusGProxyCall * hibernate_call = NULL;80static DBusGProxyCall * hibernate_call = NULL;
@@ -147,14 +148,14 @@
147{148{
148 gchar * type = (gchar *)userdata;149 gchar * type = (gchar *)userdata;
149150
150 if (dkp_main_proxy == NULL) {151 if (up_main_proxy == NULL) {
151 g_warning("Can not %s as no DeviceKit Power Proxy", type);152 g_warning("Can not %s as no upower proxy", type);
152 }153 }
153154
154 screensaver_throttle(type);155 screensaver_throttle(type);
155 lock_screen(NULL, 0, NULL);156 lock_screen(NULL, 0, NULL);
156157
157 dbus_g_proxy_begin_call(dkp_main_proxy,158 dbus_g_proxy_begin_call(up_main_proxy,
158 type,159 type,
159 sleep_response,160 sleep_response,
160 NULL,161 NULL,
@@ -213,17 +214,17 @@
213/* A signal that we need to recheck to ensure we can still214/* A signal that we need to recheck to ensure we can still
214 hibernate and/or suspend */215 hibernate and/or suspend */
215static void216static void
216dpk_changed_cb (DBusGProxy * proxy, gpointer user_data)217up_changed_cb (DBusGProxy * proxy, gpointer user_data)
217{218{
218 /* Start Async call to see if we can hibernate */219 /* Start Async call to see if we can hibernate */
219 if (suspend_call == NULL) {220 if (suspend_call == NULL) {
220 suspend_call = dbus_g_proxy_begin_call(dkp_prop_proxy,221 suspend_call = dbus_g_proxy_begin_call(up_prop_proxy,
221 "Get",222 "Get",
222 suspend_prop_cb,223 suspend_prop_cb,
223 NULL,224 NULL,
224 NULL,225 NULL,
225 G_TYPE_STRING,226 G_TYPE_STRING,
226 DKP_INTERFACE,227 UP_INTERFACE,
227 G_TYPE_STRING,228 G_TYPE_STRING,
228 "can-suspend",229 "can-suspend",
229 G_TYPE_INVALID,230 G_TYPE_INVALID,
@@ -233,13 +234,13 @@
233234
234 /* Start Async call to see if we can suspend */235 /* Start Async call to see if we can suspend */
235 if (hibernate_call == NULL) {236 if (hibernate_call == NULL) {
236 hibernate_call = dbus_g_proxy_begin_call(dkp_prop_proxy,237 hibernate_call = dbus_g_proxy_begin_call(up_prop_proxy,
237 "Get",238 "Get",
238 hibernate_prop_cb,239 hibernate_prop_cb,
239 NULL,240 NULL,
240 NULL,241 NULL,
241 G_TYPE_STRING,242 G_TYPE_STRING,
242 DKP_INTERFACE,243 UP_INTERFACE,
243 G_TYPE_STRING,244 G_TYPE_STRING,
244 "can-hibernate",245 "can-hibernate",
245 G_TYPE_INVALID,246 G_TYPE_INVALID,
@@ -254,39 +255,39 @@
254 DKp checking. We're even setting up the calls for the props255 DKp checking. We're even setting up the calls for the props
255 we need */256 we need */
256static void257static void
257setup_dkp (void) {258setup_up (void) {
258 DBusGConnection * bus = dbus_g_bus_get(DBUS_BUS_SYSTEM, NULL);259 DBusGConnection * bus = dbus_g_bus_get(DBUS_BUS_SYSTEM, NULL);
259 g_return_if_fail(bus != NULL);260 g_return_if_fail(bus != NULL);
260261
261 if (dkp_main_proxy == NULL) {262 if (up_main_proxy == NULL) {
262 dkp_main_proxy = dbus_g_proxy_new_for_name(bus,263 up_main_proxy = dbus_g_proxy_new_for_name(bus,
263 DKP_ADDRESS,264 UP_ADDRESS,
264 DKP_OBJECT,265 UP_OBJECT,
265 DKP_INTERFACE);266 UP_INTERFACE);
266 }267 }
267 g_return_if_fail(dkp_main_proxy != NULL);268 g_return_if_fail(up_main_proxy != NULL);
268269
269 if (dkp_prop_proxy == NULL) {270 if (up_prop_proxy == NULL) {
270 dkp_prop_proxy = dbus_g_proxy_new_for_name(bus,271 up_prop_proxy = dbus_g_proxy_new_for_name(bus,
271 DKP_ADDRESS,272 UP_ADDRESS,
272 DKP_OBJECT,273 UP_OBJECT,
273 DBUS_INTERFACE_PROPERTIES);274 DBUS_INTERFACE_PROPERTIES);
274 }275 }
275 g_return_if_fail(dkp_prop_proxy != NULL);276 g_return_if_fail(up_prop_proxy != NULL);
276277
277 /* Connect to changed signal */278 /* Connect to changed signal */
278 dbus_g_proxy_add_signal(dkp_main_proxy,279 dbus_g_proxy_add_signal(up_main_proxy,
279 "Changed",280 "Changed",
280 G_TYPE_INVALID);281 G_TYPE_INVALID);
281282
282 dbus_g_proxy_connect_signal(dkp_main_proxy,283 dbus_g_proxy_connect_signal(up_main_proxy,
283 "Changed",284 "Changed",
284 G_CALLBACK(dpk_changed_cb),285 G_CALLBACK(up_changed_cb),
285 NULL,286 NULL,
286 NULL);287 NULL);
287288
288 /* Force an original "changed" event */289 /* Force an original "changed" event */
289 dpk_changed_cb(dkp_main_proxy, NULL);290 up_changed_cb(up_main_proxy, NULL);
290291
291 return;292 return;
292}293}
@@ -437,14 +438,40 @@
437438
438 if (can_activate == TRUE)439 if (can_activate == TRUE)
439 {440 {
441 DbusmenuMenuitem * separator1 = dbusmenu_menuitem_new();
442 dbusmenu_menuitem_property_set(separator1, DBUSMENU_MENUITEM_PROP_TYPE, DBUSMENU_CLIENT_TYPES_SEPARATOR);
443 dbusmenu_menuitem_child_append(root, separator1);
444
440 if (check_guest_session ())445 if (check_guest_session ())
441 {446 {
442 mi = dbusmenu_menuitem_new ();447 mi = dbusmenu_menuitem_new ();
443 dbusmenu_menuitem_property_set (mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Guest Session"));448 dbusmenu_menuitem_property_set (mi, DBUSMENU_MENUITEM_PROP_TYPE, USER_ITEM_TYPE);
449 dbusmenu_menuitem_property_set (mi, USER_ITEM_PROP_NAME, _("Guest Session"));
450 dbusmenu_menuitem_property_set_bool (mi, USER_ITEM_PROP_LOGGED_IN, FALSE);
444 dbusmenu_menuitem_child_append (root, mi);451 dbusmenu_menuitem_child_append (root, mi);
445 g_signal_connect (G_OBJECT (mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK (activate_guest_session), NULL);452 g_signal_connect (G_OBJECT (mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK (activate_guest_session), NULL);
446 }453 }
447454
455 if (check_new_session ())
456 {
457 ensure_gconf_client ();
458
459 switch_menuitem = dbusmenu_menuitem_new ();
460 dbusmenu_menuitem_property_set (switch_menuitem, DBUSMENU_MENUITEM_PROP_TYPE, MENU_SWITCH_TYPE);
461 dbusmenu_menuitem_property_set (switch_menuitem, MENU_SWITCH_USER, g_get_user_name());
462 dbusmenu_menuitem_child_append (root, switch_menuitem);
463 g_signal_connect (G_OBJECT (switch_menuitem), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK (activate_new_session), NULL);
464
465 if (gconf_client_get_bool (gconf_client, LOCKDOWN_KEY, NULL))
466 {
467 dbusmenu_menuitem_property_set_bool (switch_menuitem, DBUSMENU_MENUITEM_PROP_VISIBLE, FALSE);
468 }
469 else
470 {
471 dbusmenu_menuitem_property_set_bool (switch_menuitem, DBUSMENU_MENUITEM_PROP_VISIBLE, TRUE);
472 }
473 }
474
448 if (count > MINIMUM_USERS && count < MAXIMUM_USERS)475 if (count > MINIMUM_USERS && count < MAXIMUM_USERS)
449 {476 {
450 if (users != NULL)477 if (users != NULL)
@@ -470,30 +497,13 @@
470 user->service = service;497 user->service = service;
471498
472 mi = dbusmenu_menuitem_new ();499 mi = dbusmenu_menuitem_new ();
473 dbusmenu_menuitem_property_set (mi, DBUSMENU_MENUITEM_PROP_LABEL, user->real_name);500 dbusmenu_menuitem_property_set (mi, DBUSMENU_MENUITEM_PROP_TYPE, USER_ITEM_TYPE);
501 dbusmenu_menuitem_property_set (mi, USER_ITEM_PROP_NAME, user->real_name);
502 dbusmenu_menuitem_property_set_bool (mi, USER_ITEM_PROP_LOGGED_IN, user->sessions != NULL);
474 dbusmenu_menuitem_child_append (root, mi);503 dbusmenu_menuitem_child_append (root, mi);
475 g_signal_connect (G_OBJECT (mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK (activate_user_session), user);504 g_signal_connect (G_OBJECT (mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK (activate_user_session), user);
476 }505 }
477 }506 }
478
479 if (check_new_session ())
480 {
481 ensure_gconf_client ();
482
483 switch_menuitem = dbusmenu_menuitem_new ();
484 dbusmenu_menuitem_property_set (switch_menuitem, DBUSMENU_MENUITEM_PROP_LABEL, _("Switch User..."));
485 dbusmenu_menuitem_child_append (root, switch_menuitem);
486 g_signal_connect (G_OBJECT (switch_menuitem), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK (activate_new_session), NULL);
487
488 if (gconf_client_get_bool (gconf_client, LOCKDOWN_KEY, NULL))
489 {
490 dbusmenu_menuitem_property_set_bool (switch_menuitem, DBUSMENU_MENUITEM_PROP_VISIBLE, FALSE);
491 }
492 else
493 {
494 dbusmenu_menuitem_property_set_bool (switch_menuitem, DBUSMENU_MENUITEM_PROP_VISIBLE, TRUE);
495 }
496 }
497 }507 }
498508
499 DbusmenuMenuitem * separator = dbusmenu_menuitem_new();509 DbusmenuMenuitem * separator = dbusmenu_menuitem_new();
@@ -639,7 +649,7 @@
639 G_CALLBACK (user_removed),649 G_CALLBACK (user_removed),
640 root_menuitem);650 root_menuitem);
641651
642 setup_dkp();652 setup_up();
643653
644 DbusmenuServer * server = dbusmenu_server_new(INDICATOR_SESSION_DBUS_OBJECT);654 DbusmenuServer * server = dbusmenu_server_new(INDICATOR_SESSION_DBUS_OBJECT);
645 dbusmenu_server_set_root(server, root_menuitem);655 dbusmenu_server_set_root(server, root_menuitem);

Subscribers

People subscribed via source and target branches

to all changes: