diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2017-12-07 11:49:54 +0000 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2017-12-07 14:19:24 +0100 |
commit | 5309a605a0259edccb1745bafc117a02801af90e (patch) | |
tree | 9e79aac08c4de70178a570a1ab365aed6a620eed /src | |
parent | a162229fb1d77a1616dd7fed2b17ad6cbe038b12 (diff) | |
download | ayatana-indicator-sound-5309a605a0259edccb1745bafc117a02801af90e.tar.gz ayatana-indicator-sound-5309a605a0259edccb1745bafc117a02801af90e.tar.bz2 ayatana-indicator-sound-5309a605a0259edccb1745bafc117a02801af90e.zip |
Make AcctService SecurityPrivacy and System.Sound optional.
Diffstat (limited to 'src')
-rw-r--r-- | src/CMakeLists.txt | 37 | ||||
-rw-r--r-- | src/accounts-service-privacy-settings.vala | 4 | ||||
-rw-r--r-- | src/accounts-service-system-sound-settings.vala | 4 | ||||
-rw-r--r-- | src/accounts-service-user.vala | 15 |
4 files changed, 49 insertions, 11 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index c1254dc..a09020e 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -15,6 +15,18 @@ endif() if(EXISTS "/usr/share/glib-2.0/schemas/com.ubuntu.sound.gschema.xml") set (VALA_DEFINE_UBUNTU_SOUND_SCHEMA "--define=HAS_UBUNTU_SOUND_SCHEMA") add_definitions( -DHAS_UBUNTU_SOUND_SCHEMA ) +endif() + +if(EXISTS "/usr/share/accountsservice/interfaces/com.ubuntu.touch.AccountsService.SecurityPrivacy.xml") + set (HAVE_UT_ACCTSERVICE_PRIVACY_SETTINGS 1) + set (VALA_FILE_ACCTSERVICE_PRIVACY_SETTINGS "accounts-service-privacy-settings") + set (VALA_DEFINE_ACCTSERVICE_PRIVACY_SETTINGS "--define=HAS_UT_ACCTSERVICE_PRIVACY_SETTINGS") +endif() + +if(EXISTS "/usr/share/accountsservice/interfaces/com.ubuntu.touch.AccountsService.Sound.xml") + set (HAVE_UT_ACCTSERVICE_SYSTEMSOUND_SETTINGS 1) + set (VALA_FILE_ACCTSERVICE_SYSTEMSOUND_SETTINGS "accounts-service-system-sound-settings") + set (VALA_DEFINE_ACCTSERVICE_SYSTEMSOUND_SETTINGS "--define=HAS_UT_ACCTSERVICE_SYSTEMSOUND_SETTINGS") endif() vapi_gen(accounts-service @@ -49,6 +61,8 @@ vala_init(ayatana-indicator-sound-service ${VALA_PKG_URLDISPATCHER} ${VALA_DEFINE_URLDISPATCHER} ${VALA_DEFINE_UBUNTU_SOUND_SCHEMA} + ${VALA_DEFINE_ACCTSERVICE_PRIVACY_SETTINGS} + ${VALA_DEFINE_ACCTSERVICE_SYSTEMSOUND_SETTINGS} ) vala_add(ayatana-indicator-sound-service @@ -214,19 +228,26 @@ vala_add(ayatana-indicator-sound-service media-player mpris2-interfaces accounts-service-sound-settings - accounts-service-privacy-settings - accounts-service-system-sound-settings + ${VALA_FILE_ACCTSERVICE_PRIVACY_SETTINGS} + ${VALA_FILE_ACCTSERVICE_SYSTEMSOUND_SETTINGS} greeter-broadcast ) vala_add(ayatana-indicator-sound-service accounts-service-sound-settings.vala ) -vala_add(ayatana-indicator-sound-service - accounts-service-privacy-settings.vala -) -vala_add(ayatana-indicator-sound-service - accounts-service-system-sound-settings.vala -) + +if(HAVE_UT_ACCTSERVICE_PRIVACY_SETTINGS) + vala_add(ayatana-indicator-sound-service + accounts-service-system-sound-settings.vala + ) +endif() + +if(HAVE_UT_ACCTSERVICE_SYSTEMSOUND_SETTINGS) + vala_add(ayatana-indicator-sound-service + accounts-service-privacy-settings.vala + ) +endif() + vala_add(ayatana-indicator-sound-service greeter-broadcast.vala ) diff --git a/src/accounts-service-privacy-settings.vala b/src/accounts-service-privacy-settings.vala index cf6b267..3a311d0 100644 --- a/src/accounts-service-privacy-settings.vala +++ b/src/accounts-service-privacy-settings.vala @@ -17,9 +17,11 @@ * Ted Gould <ted@canonical.com> */ +#if HAS_UT_ACCTSERVICE_PRIVACY_SETTINGS [DBus (name = "com.ubuntu.touch.AccountsService.SecurityPrivacy")] public interface AccountsServicePrivacySettings : Object { - // properties + // properties public abstract bool stats_welcome_screen {owned get; set;} public abstract bool messages_welcome_screen {owned get; set;} } +#endif diff --git a/src/accounts-service-system-sound-settings.vala b/src/accounts-service-system-sound-settings.vala index 3b01561..d445c25 100644 --- a/src/accounts-service-system-sound-settings.vala +++ b/src/accounts-service-system-sound-settings.vala @@ -17,8 +17,10 @@ * Ted Gould <ted@canonical.com> */ +#if HAS_UT_ACCTSERVICE_SYSTEMSOUND_SETTINGS [DBus (name = "com.ubuntu.touch.AccountsService.Sound")] public interface AccountsServiceSystemSoundSettings : Object { - // properties + // properties public abstract bool silent_mode {owned get; set;} } +#endif diff --git a/src/accounts-service-user.vala b/src/accounts-service-user.vala index 535f6c7..25b19ee 100644 --- a/src/accounts-service-user.vala +++ b/src/accounts-service-user.vala @@ -21,8 +21,12 @@ public class AccountsServiceUser : Object { Act.UserManager accounts_manager = Act.UserManager.get_default(); Act.User? user = null; AccountsServiceSoundSettings? proxy = null; +#if HAS_UT_ACCTSERVICE_PRIVACY_SETTINGS AccountsServicePrivacySettings? privacyproxy = null; +#endif +#if HAS_UT_ACCTSERVICE_SYSTEMSOUND_SETTINGS AccountsServiceSystemSoundSettings? syssoundproxy = null; +#endif uint timer = 0; MediaPlayer? _player = null; GreeterBroadcast? greeter = null; @@ -36,8 +40,10 @@ public class AccountsServiceUser : Object { } set { _silentMode = value; +#if HAS_UT_ACCTSERVICE_SYSTEMSOUND_SETTINGS if (syssoundproxy != null) syssoundproxy.silent_mode = value; +#endif } } @@ -141,7 +147,7 @@ public class AccountsServiceUser : Object { DBusProxyFlags.GET_INVALIDATED_PROPERTIES, null, new_sound_proxy); - +#if HAS_UT_ACCTSERVICE_PRIVACY_SETTINGS Bus.get_proxy.begin<AccountsServicePrivacySettings> ( BusType.SYSTEM, "org.freedesktop.Accounts", @@ -149,7 +155,9 @@ public class AccountsServiceUser : Object { DBusProxyFlags.GET_INVALIDATED_PROPERTIES, null, new_privacy_proxy); +#endif +#if HAS_UT_ACCTSERVICE_SYSTEMSOUND_SETTINGS Bus.get_proxy.begin<AccountsServiceSystemSoundSettings> ( BusType.SYSTEM, "org.freedesktop.Accounts", @@ -157,6 +165,7 @@ public class AccountsServiceUser : Object { DBusProxyFlags.GET_INVALIDATED_PROPERTIES, null, new_system_sound_proxy); +#endif } } @@ -180,6 +189,7 @@ public class AccountsServiceUser : Object { } } +#if HAS_UT_ACCTSERVICE_PRIVACY_SETTINGS void new_privacy_proxy (GLib.Object? obj, AsyncResult res) { try { this.privacyproxy = Bus.get_proxy.end (res); @@ -198,7 +208,9 @@ public class AccountsServiceUser : Object { warning("Unable to get proxy to user privacy settings: %s", e.message); } } +#endif +#if HAS_UT_ACCTSERVICE_SYSTEMSOUND_SETTINGS void new_system_sound_proxy (GLib.Object? obj, AsyncResult res) { try { this.syssoundproxy = Bus.get_proxy.end (res); @@ -219,6 +231,7 @@ public class AccountsServiceUser : Object { warning("Unable to get proxy to system sound settings: %s", e.message); } } +#endif void greeter_proxy_new (GLib.Object? obj, AsyncResult res) { try { |