Merge lp:~mterry/unity-greeter/dbus-interface into lp:unity-greeter

Proposed by Michael Terry
Status: Merged
Approved by: Michael Terry
Approved revision: 778
Merged at revision: 778
Proposed branch: lp:~mterry/unity-greeter/dbus-interface
Merge into: lp:unity-greeter
Prerequisite: lp:~mterry/unity-greeter/indicator-gsettings
Diff against target: 103 lines (+60/-1)
2 files modified
src/greeter-list.vala (+49/-1)
src/menubar.vala (+11/-0)
To merge this branch: bzr merge lp:~mterry/unity-greeter/dbus-interface
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Robert Ancell Approve
Review via email: mp+151594@code.launchpad.net

This proposal supersedes a proposal from 2013-03-04.

Commit message

Expose a dbus session interface for setting active users.

Description of the change

Expose a dbus session interface for setting active users. This could be useful for custom indicators (which can only happen after https://code.launchpad.net/~mterry/unity-greeter/indicator-gsettings/+merge/151573 )

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
Michael Terry (mterry) wrote : Posted in a previous version of this proposal

Wait, I'm just now realizing you said elsewhere: "there could potentially be more than one greeter running at the same time so the bus address would need to be unique"

When does LightDM spawn more than one? I can rework patch to fit.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:778
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https://code.launchpad.net/~mterry/unity-greeter/dbus-interface/+merge/151594/+edit-commit-message

http://jenkins.qa.ubuntu.com/job/unity-greeter-ci/7/
Executed test runs:
    FAILURE: http://jenkins.qa.ubuntu.com/job/unity-greeter-ci/./label=precise/7/console

Click here to trigger a rebuild:
http://jenkins.qa.ubuntu.com/job/unity-greeter-ci/7//rebuild/?

review: Needs Fixing (continuous-integration)
Revision history for this message
Allan LeSage (allanlesage) wrote :

Updated our Jenkins config and tested separately, appears ok--this should ameliorate PS Jenkins bot's complaints.

Revision history for this message
Robert Ancell (robert-ancell) wrote :

Looks good.

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/greeter-list.vala'
--- src/greeter-list.vala 2013-01-03 15:15:54 +0000
+++ src/greeter-list.vala 2013-03-04 19:11:26 +0000
@@ -24,6 +24,22 @@
24 return (int) (size % grid_size) / 2;24 return (int) (size % grid_size) / 2;
25}25}
2626
27[DBus (name="com.canonical.UnityGreeter.List")]
28public class ListDBusInterface : Object
29{
30 private GreeterList list;
31
32 public ListDBusInterface (GreeterList list)
33 {
34 this.list = list;
35 }
36
37 public void set_active_entry (string entry_name)
38 {
39 list.set_active_entry (entry_name);
40 }
41}
42
27public abstract class GreeterList : FadableBox43public abstract class GreeterList : FadableBox
28{44{
29 public Background background { get; construct; }45 public Background background { get; construct; }
@@ -49,6 +65,7 @@
4965
50 protected List<PromptBox> entries = null;66 protected List<PromptBox> entries = null;
5167
68 private ListDBusInterface dbus_object;
5269
53 private double scroll_target_location;70 private double scroll_target_location;
54 private double scroll_start_location;71 private double scroll_start_location;
@@ -152,6 +169,29 @@
152169
153 scroll_timer = new AnimateTimer (AnimateTimer.ease_out_quint, AnimateTimer.FAST);170 scroll_timer = new AnimateTimer (AnimateTimer.ease_out_quint, AnimateTimer.FAST);
154 scroll_timer.animate.connect (animate_scrolling);171 scroll_timer.animate.connect (animate_scrolling);
172
173 try
174 {
175 Bus.get.begin (BusType.SESSION, null, on_bus_acquired);
176 }
177 catch (IOError e)
178 {
179 debug ("Error getting session bus: %s", e.message);
180 }
181 }
182
183 private void on_bus_acquired (Object? obj, AsyncResult res)
184 {
185 try
186 {
187 var conn = Bus.get.end (res);
188 this.dbus_object = new ListDBusInterface (this);
189 conn.register_object ("/list", this.dbus_object);
190 }
191 catch (IOError e)
192 {
193 debug ("Error registering user list dbus object: %s", e.message);
194 }
155 }195 }
156196
157 public enum ScrollTarget197 public enum ScrollTarget
@@ -354,7 +394,15 @@
354 {394 {
355 var e = find_entry (name);395 var e = find_entry (name);
356 if (e != null)396 if (e != null)
357 select_entry (e, 1.0);397 {
398 var direction = 1.0;
399 if (selected_entry != null &&
400 entries.index (selected_entry) > entries.index (e))
401 {
402 direction = -1.0;
403 }
404 select_entry (e, direction);
405 }
358 }406 }
359407
360 public void set_active_first_entry_with_prefix (string prefix)408 public void set_active_first_entry_with_prefix (string prefix)
361409
=== modified file 'src/menubar.vala'
--- src/menubar.vala 2013-03-04 19:11:26 +0000
+++ src/menubar.vala 2013-03-04 19:11:26 +0000
@@ -370,6 +370,17 @@
370 /* Hint to have gnome-settings-daemon run in greeter mode */370 /* Hint to have gnome-settings-daemon run in greeter mode */
371 greeter_set_env ("RUNNING_UNDER_GDM", "1");371 greeter_set_env ("RUNNING_UNDER_GDM", "1");
372372
373 /* Let indicators know about our unique dbus name */
374 try
375 {
376 var conn = Bus.get_sync (BusType.SESSION);
377 greeter_set_env ("UNITY_GREETER_DBUS_NAME", conn.get_unique_name ());
378 }
379 catch (IOError e)
380 {
381 debug ("Could not set DBUS_NAME: %s", e.message);
382 }
383
373 debug ("LANG=%s LANGUAGE=%s", Environment.get_variable ("LANG"), Environment.get_variable ("LANGUAGE"));384 debug ("LANG=%s LANGUAGE=%s", Environment.get_variable ("LANG"), Environment.get_variable ("LANGUAGE"));
374385
375 var indicator_list = UGSettings.get_strv(UGSettings.KEY_INDICATORS);386 var indicator_list = UGSettings.get_strv(UGSettings.KEY_INDICATORS);

Subscribers

People subscribed via source and target branches