automountManager: Port to MetaSoundPlayer for emitting sounds

Move away from ShellGlobal API, which is too tightly coupled to
libcanberra-gtk.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/327
This commit is contained in:
Carlos Garnacho 2018-12-13 20:30:22 +01:00 committed by Florian Müllner
parent 4259676f6e
commit 9a35c9902a

View File

@ -87,7 +87,8 @@ var AutomountManager = new Lang.Class({
if (!this._session.SessionIsActive)
return;
global.play_theme_sound(0, 'device-added-media',
let player = global.display.get_sound_player();
player.play_from_theme('device-added-media',
_("External drive connected"),
null);
},
@ -98,7 +99,8 @@ var AutomountManager = new Lang.Class({
if (!this._session.SessionIsActive)
return;
global.play_theme_sound(0, 'device-removed-media',
let sound = global.display.get_sound();
sound.play_from_theme('device-removed-media',
_("External drive disconnected"),
null);
},