aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2014-09-23 11:05:43 -0500
committerTed Gould <ted@gould.cx>2014-09-23 11:05:43 -0500
commit92f7e3b4b41ff61742e42485ff1b7fd27c4ed449 (patch)
treefffb99f7feee7aa3eb78984e1caaea7be8c4e671 /src
parent4b0ce78d9b66ae752d55d3ba7405d6bd3e87408c (diff)
downloadayatana-indicator-sound-92f7e3b4b41ff61742e42485ff1b7fd27c4ed449.tar.gz
ayatana-indicator-sound-92f7e3b4b41ff61742e42485ff1b7fd27c4ed449.tar.bz2
ayatana-indicator-sound-92f7e3b4b41ff61742e42485ff1b7fd27c4ed449.zip
Drop the GSettings key and change the way we're interacting with the accounts service setting
Diffstat (limited to 'src')
-rw-r--r--src/service.vala34
1 files changed, 8 insertions, 26 deletions
diff --git a/src/service.vala b/src/service.vala
index af65b33..059724a 100644
--- a/src/service.vala
+++ b/src/service.vala
@@ -47,9 +47,11 @@ public class IndicatorSound.Service: Object {
this.volume_control.bind_property ("active-mic", menu, "show-mic-volume", BindingFlags.SYNC_CREATE);
});
- /* Setup handling for the greeter-export setting */
- this.settings.changed["greeter-export"].connect( () => this.build_accountsservice() );
- build_accountsservice();
+ /* If we're on the greeter, don't export */
+ if (GLib.Environment.get_user_name() != "lightdm") {
+ this.accounts_service = new AccountsServiceUser();
+ /* TODO: Watch for setting */
+ }
this.sync_preferred_players ();
this.settings.changed["interested-media-players"].connect ( () => {
@@ -75,28 +77,7 @@ public class IndicatorSound.Service: Object {
}
bool greeter_show_track () {
- return false;
- }
-
- void build_accountsservice () {
- clear_acts_player();
- this.accounts_service = null;
-
- /* If we're not exporting, don't build anything */
- if (!this.settings.get_boolean("greeter-export")) {
- debug("Accounts service export disabled due to user setting");
- return;
- }
-
- /* If we're on the greeter, don't export */
- if (GLib.Environment.get_user_name() == "lightdm") {
- debug("Accounts service export disabled due to being used on the greeter");
- return;
- }
-
- this.accounts_service = new AccountsServiceUser();
-
- this.eventually_update_player_actions();
+ return export_to_accounts_service;
}
void clear_acts_player () {
@@ -171,6 +152,7 @@ public class IndicatorSound.Service: Object {
Notify.Notification notification;
bool syncing_preferred_players = false;
AccountsServiceUser? accounts_service = null;
+ bool export_to_accounts_service = false;
/* Maximum volume as a scaling factor between the volume action's state and the value in
* this.volume_control. See create_volume_action().
@@ -413,7 +395,7 @@ public class IndicatorSound.Service: Object {
}
/* If we're playing then put that data in accounts service */
- if (player.is_running && accounts_service != null) {
+ if (player.is_running && export_to_accounts_service && accounts_service != null) {
accounts_service.player = player;
clear_accounts_player = false;
}