aboutsummaryrefslogtreecommitdiff
path: root/src/accounts-service-user.vala
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2014-10-16 11:11:21 -0500
committerTed Gould <ted@gould.cx>2014-10-16 11:11:21 -0500
commit1c9b9820bff54e5b99e8a0833eab1093bc070ae7 (patch)
tree303f446dcf3303e17361a84dbeef7a1a30ebe219 /src/accounts-service-user.vala
parent16a72ae6f4c18c621e16e259bc9122cdaf39eb6b (diff)
parent4a8ee52ea141103bcb632069755af77ad510de9e (diff)
downloadayatana-indicator-sound-1c9b9820bff54e5b99e8a0833eab1093bc070ae7.tar.gz
ayatana-indicator-sound-1c9b9820bff54e5b99e8a0833eab1093bc070ae7.tar.bz2
ayatana-indicator-sound-1c9b9820bff54e5b99e8a0833eab1093bc070ae7.zip
Align with trunk to prepare for landing there
Diffstat (limited to 'src/accounts-service-user.vala')
-rw-r--r--src/accounts-service-user.vala74
1 files changed, 72 insertions, 2 deletions
diff --git a/src/accounts-service-user.vala b/src/accounts-service-user.vala
index 04c38cc..ec52730 100644
--- a/src/accounts-service-user.vala
+++ b/src/accounts-service-user.vala
@@ -21,10 +21,25 @@ public class AccountsServiceUser : Object {
Act.UserManager accounts_manager = Act.UserManager.get_default();
Act.User? user = null;
AccountsServiceSoundSettings? proxy = null;
+ AccountsServicePrivacySettings? privacyproxy = null;
+ AccountsServiceSystemSoundSettings? syssoundproxy = null;
uint timer = 0;
MediaPlayer? _player = null;
GreeterBroadcast? greeter = null;
+ public bool showDataOnGreeter { get; set; }
+
+ bool _silentMode = false;
+ public bool silentMode {
+ get {
+ return _silentMode;
+ }
+ set {
+ if (syssoundproxy != null)
+ syssoundproxy.silent_mode = value;
+ }
+ }
+
public MediaPlayer? player {
set {
this._player = value;
@@ -124,7 +139,23 @@ public class AccountsServiceUser : Object {
user.get_object_path(),
DBusProxyFlags.GET_INVALIDATED_PROPERTIES,
null,
- new_proxy);
+ new_sound_proxy);
+
+ Bus.get_proxy.begin<AccountsServicePrivacySettings> (
+ BusType.SYSTEM,
+ "org.freedesktop.Accounts",
+ user.get_object_path(),
+ DBusProxyFlags.GET_INVALIDATED_PROPERTIES,
+ null,
+ new_privacy_proxy);
+
+ Bus.get_proxy.begin<AccountsServiceSystemSoundSettings> (
+ BusType.SYSTEM,
+ "org.freedesktop.Accounts",
+ user.get_object_path(),
+ DBusProxyFlags.GET_INVALIDATED_PROPERTIES,
+ null,
+ new_system_sound_proxy);
}
}
@@ -138,7 +169,7 @@ public class AccountsServiceUser : Object {
}
}
- void new_proxy (GLib.Object? obj, AsyncResult res) {
+ void new_sound_proxy (GLib.Object? obj, AsyncResult res) {
try {
this.proxy = Bus.get_proxy.end (res);
this.player = _player;
@@ -148,6 +179,45 @@ public class AccountsServiceUser : Object {
}
}
+ void new_privacy_proxy (GLib.Object? obj, AsyncResult res) {
+ try {
+ this.privacyproxy = Bus.get_proxy.end (res);
+
+ (this.privacyproxy as DBusProxy).g_properties_changed.connect((proxy, changed, invalid) => {
+ var welcomeval = changed.lookup_value("MessagesWelcomeScreen", new VariantType("b"));
+ if (welcomeval != null) {
+ debug("Messages on welcome screen changed");
+ this.showDataOnGreeter = welcomeval.get_boolean();
+ }
+ });
+
+ this.showDataOnGreeter = this.privacyproxy.messages_welcome_screen;
+ } catch (Error e) {
+ this.privacyproxy = null;
+ warning("Unable to get proxy to user privacy settings: %s", e.message);
+ }
+ }
+
+ void new_system_sound_proxy (GLib.Object? obj, AsyncResult res) {
+ try {
+ this.syssoundproxy = Bus.get_proxy.end (res);
+
+ (this.syssoundproxy as DBusProxy).g_properties_changed.connect((proxy, changed, invalid) => {
+ var silentvar = changed.lookup_value("SilentMode", new VariantType("b"));
+ if (silentvar != null) {
+ debug("Silent Mode changed");
+ this._silentMode = silentvar.get_boolean();
+ this.notify_property("silentMode");
+ }
+ });
+
+ this.silentMode = this.syssoundproxy.silent_mode;
+ } catch (Error e) {
+ this.syssoundproxy = null;
+ warning("Unable to get proxy to system sound settings: %s", e.message);
+ }
+ }
+
void greeter_proxy_new (GLib.Object? obj, AsyncResult res) {
try {
this.greeter = Bus.get_proxy.end (res);