Merge lp:~cjcurran/unity-greeter/play-synchronised-start-up-sound into lp:unity-greeter

Proposed by Conor Curran
Status: Superseded
Proposed branch: lp:~cjcurran/unity-greeter/play-synchronised-start-up-sound
Merge into: lp:unity-greeter
Diff against target: 91 lines (+30/-1)
3 files modified
configure.ac (+1/-0)
src/Makefile.am (+2/-1)
src/unity-greeter.vala (+27/-0)
To merge this branch: bzr merge lp:~cjcurran/unity-greeter/play-synchronised-start-up-sound
Reviewer Review Type Date Requested Status
Michael Terry (community) Needs Fixing
David Henningsson Pending
Review via email: mp+93022@code.launchpad.net

This proposal has been superseded by a proposal from 2012-02-15.

Description of the change

This branch applies the patch to allow for the soon to be chosen startup sound for precise.

To post a comment you must log in.
Revision history for this message
Sebastien Bacher (seb128) wrote :

random comment from somebody not maintaining that code:

- shouldn't that be an option?
- can't you use the libcanberra api rather than spawning commands?
- did I mention how annoying sounds on boot are before? ;-)

Revision history for this message
Michael Terry (mterry) wrote :

I am sure users will ask about a way to turn it off. Maybe add a gsettings option for it?

The libcanberra API question is a good one, especially since we're spawning two apps here in a racy way.

review: Needs Fixing
287. By Conor Curran

use libcanberra vala bindings so as we can be explicit as to what theme to use

Unmerged revisions

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 2012-02-15 09:24:44 +0000
3+++ configure.ac 2012-02-15 11:32:21 +0000
4@@ -25,6 +25,7 @@
5 liblightdm-gobject-1 >= 1.1.3
6 freetype2
7 cairo-ft
8+ libcanberra
9 ])
10
11 INDICATORDIR=`$PKG_CONFIG --variable=indicatordir indicator3-0.4`
12
13=== modified file 'src/Makefile.am'
14--- src/Makefile.am 2012-01-31 14:43:25 +0000
15+++ src/Makefile.am 2012-02-15 11:32:21 +0000
16@@ -35,7 +35,8 @@
17 --pkg gtk+-3.0 \
18 --pkg gdk-x11-3.0 \
19 --pkg x11 \
20- --pkg liblightdm-gobject-1
21+ --pkg liblightdm-gobject-1 \
22+ --pkg libcanberra
23
24 unity_greeter_LDADD = \
25 $(UNITY_GREETER_LIBS)
26
27=== modified file 'src/unity-greeter.vala'
28--- src/unity-greeter.vala 2012-02-15 09:22:24 +0000
29+++ src/unity-greeter.vala 2012-02-15 11:32:21 +0000
30@@ -17,6 +17,7 @@
31 * Authored by: Robert Ancell <robert.ancell@canonical.com>
32 */
33
34+
35 public const int grid_size = 40;
36
37 public class UnityGreeter
38@@ -55,6 +56,8 @@
39
40 private string? test_username = null;
41 private bool test_is_authenticated = false;
42+ private uint ready_id;
43+ private Canberra.Context canberra_context;
44
45 public UnityGreeter ()
46 {
47@@ -161,6 +164,7 @@
48 user_selected_cb (user_list.selected);
49
50 start_fake_wm ();
51+ ready_id = Gdk.threads_add_idle (ready_cb);
52 }
53
54 public static void add_style_class (Gtk.Widget widget)
55@@ -195,6 +199,28 @@
56 return null;
57 }
58
59+ private bool ready_cb ()
60+ {
61+ debug ("starting system-ready sound");
62+
63+ try
64+ {
65+ /* Launch canberra */
66+ Canberra.Context.create (out canberra_context);
67+ debug ("PLAYING WITH CANBERRA");
68+ canberra_context.play (0,
69+ Canberra.PROP_CANBERRA_XDG_THEME_NAME,
70+ "ubuntu",
71+ Canberra.PROP_EVENT_ID,
72+ "system-ready");
73+ }
74+ catch (Error e)
75+ {
76+ warning ("Failed to play system-ready sound through canberra: %s", e.message);
77+ }
78+ return false;
79+ }
80+
81 private void user_added_cb (LightDM.User user)
82 {
83 debug ("Adding/updating user %s (%s)", user.name, user.real_name);
84@@ -223,6 +249,7 @@
85 public void show ()
86 {
87 debug ("Showing main window");
88+
89 main_window.show ();
90 main_window.get_window ().focus (Gdk.CURRENT_TIME);
91 }

Subscribers

People subscribed via source and target branches