aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2014-03-20 11:35:45 -0500
committerTed Gould <ted@gould.cx>2014-03-20 11:35:45 -0500
commit006c044b3063c905a5c7aa8c31e91a4545acedae (patch)
treeb980f5cd24fc8994834124e2871886b467a54561
parentbef0abe544ecbb9e020b7d9f99255acefa5073ed (diff)
downloadayatana-indicator-sound-006c044b3063c905a5c7aa8c31e91a4545acedae.tar.gz
ayatana-indicator-sound-006c044b3063c905a5c7aa8c31e91a4545acedae.tar.bz2
ayatana-indicator-sound-006c044b3063c905a5c7aa8c31e91a4545acedae.zip
Connect to the setting for exporting to the greeter to the creation of the accounts service user
-rw-r--r--src/service.vala22
1 files changed, 19 insertions, 3 deletions
diff --git a/src/service.vala b/src/service.vala
index 6835896..7f4982f 100644
--- a/src/service.vala
+++ b/src/service.vala
@@ -46,9 +46,9 @@ public class IndicatorSound.Service: Object {
this.volume_control.bind_property ("active-mic", menu, "show-mic-volume", BindingFlags.SYNC_CREATE);
});
- if (GLib.Environment.get_user_name() != "lightdm") {
- accounts_service = new AccountsServiceUser();
- }
+ /* Setup handling for the greeter-export setting */
+ this.settings.changed["greeter-export"].connect( () => this.build_accountsservice() );
+ build_accountsservice();
this.sync_preferred_players ();
this.settings.changed["interested-media-players"].connect ( () => {
@@ -66,6 +66,22 @@ public class IndicatorSound.Service: Object {
sharedsettings.bind ("allow-amplified-volume", this, "allow-amplified-volume", SettingsBindFlags.GET);
}
+ void build_accountsservice () {
+ this.accounts_service = null;
+
+ /* If we're not exporting, don't build anything */
+ if (!this.settings.get_boolean("greeter-export")) {
+ return;
+ }
+
+ /* If we're on the greeter, don't export */
+ if (GLib.Environment.get_user_name() == "lightdm") {
+ return;
+ }
+
+ this.accounts_service = new AccountsServiceUser();
+ }
+
public int run () {
if (this.loop != null) {
warning ("service is already running");