ratbagd.py: listen and notify about RatabgdProfile.Disabled changes

This commit is contained in:
Yaroslav Chvanov
2023-03-09 17:37:02 +03:00
parent 05cd7a7031
commit c69a8a4ea9

View File

@@ -443,6 +443,7 @@ class RatbagdProfile(_RatbagdDBus):
self._angle_snapping = self._get_dbus_property("AngleSnapping")
self._debounce = self._get_dbus_property("Debounce")
self._dirty = self._get_dbus_property("IsDirty")
self._disabled = self._get_dbus_property("Disabled")
self._report_rate = self._get_dbus_property("ReportRate")
# FIXME: if we start adding and removing objects from any of these
@@ -489,6 +490,16 @@ class RatbagdProfile(_RatbagdDBus):
self._debounce = debounce
self.notify("debounce")
try:
disabled = changed_props["Disabled"]
except KeyError:
# Different property changed, skip.
pass
else:
if disabled != self._disabled:
self._disabled = disabled
self.notify("disabled")
try:
active = changed_props["IsActive"]
except KeyError:
@@ -554,7 +565,7 @@ class RatbagdProfile(_RatbagdDBus):
@GObject.Property
def disabled(self):
"""tells if the profile is disabled."""
return self._get_dbus_property("Disabled")
return self._disabled
@disabled.setter
def disabled(self, disabled):