aboutsummaryrefslogtreecommitdiff
path: root/src/service.vala
diff options
context:
space:
mode:
authorXavi Garcia Mena <xavi.garcia.mena@canonical.com>2016-02-23 13:48:46 +0100
committerXavi Garcia Mena <xavi.garcia.mena@canonical.com>2016-02-23 13:48:46 +0100
commite40da89a473b15b64d036cdce2e1ead59770778b (patch)
tree1de74f75836e8c7246544ad08be30fa6ba729065 /src/service.vala
parent957c495207b8c53ffa9d3622c24fdff4f31cebfa (diff)
downloadayatana-indicator-sound-e40da89a473b15b64d036cdce2e1ead59770778b.tar.gz
ayatana-indicator-sound-e40da89a473b15b64d036cdce2e1ead59770778b.tar.bz2
ayatana-indicator-sound-e40da89a473b15b64d036cdce2e1ead59770778b.zip
Created new class AccountsServiceAccess to hold all accounts service operations
Diffstat (limited to 'src/service.vala')
-rw-r--r--src/service.vala11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/service.vala b/src/service.vala
index d72f16e..2a50b53 100644
--- a/src/service.vala
+++ b/src/service.vala
@@ -20,7 +20,9 @@
public class IndicatorSound.Service: Object {
DBusConnection bus;
- public Service (MediaPlayerList playerlist, VolumeControl volume, AccountsServiceUser? accounts, Options options, VolumeWarning volume_warning) {
+ public Service (MediaPlayerList playerlist, VolumeControl volume, AccountsServiceUser? accounts, Options options, VolumeWarning volume_warning, AccountsServiceAccess? accounts_service_access) {
+
+ _accounts_service_access = accounts_service_access;
try {
bus = Bus.get_sync(GLib.BusType.SESSION);
@@ -111,13 +113,13 @@ public class IndicatorSound.Service: Object {
this.menus.@foreach ( (profile, menu) => {
menu.last_player_updated.connect ((player_id) => {
- this.volume_control.last_running_player = player_id;
+ this._accounts_service_access.last_running_player = player_id;
});
});
- this.volume_control.notify["last-running-player"].connect(() => {
+ this._accounts_service_access.notify["last-running-player"].connect(() => {
this.menus.@foreach ( (profile, menu) => {
- menu.set_default_player (this.volume_control.last_running_player);
+ menu.set_default_player (this._accounts_service_access.last_running_player);
});
});
@@ -204,6 +206,7 @@ public class IndicatorSound.Service: Object {
private Options _options;
private VolumeWarning _volume_warning;
private IndicatorSound.InfoNotification _info_notification = new IndicatorSound.InfoNotification();
+ private AccountsServiceAccess _accounts_service_access;
const double volume_step_percentage = 0.06;