mirror of
https://github.com/libratbag/libratbag.git
synced 2026-11-07 23:23:52 +01:00
tools: ratbagd.py: add readwrite=False when we are using explicit setters
Assigning an action on a button has some side effects, and this is why we do not have writable properties on those. Mark the _set_dbus_property() as read only so we do not get a bunch of PropertyReadOnly exceptions. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
This commit is contained in:
@@ -491,7 +491,7 @@ class RatbagdButton(_RatbagdDBus):
|
||||
@param button The button to map to, as int
|
||||
"""
|
||||
ret = self._dbus_call("SetButtonMapping", "u", button)
|
||||
self._set_dbus_property("ButtonMapping", "u", button)
|
||||
self._set_dbus_property("ButtonMapping", "u", button, readwrite=False)
|
||||
return ret
|
||||
|
||||
@GObject.Property
|
||||
@@ -527,7 +527,7 @@ class RatbagdButton(_RatbagdDBus):
|
||||
@param special The special entry, as str
|
||||
"""
|
||||
ret = self._dbus_call("SetSpecialMapping", "s", special)
|
||||
self._set_dbus_property("SpecialMapping", "s", special)
|
||||
self._set_dbus_property("SpecialMapping", "s", special, readwrite=False)
|
||||
return ret
|
||||
|
||||
@GObject.Property
|
||||
@@ -544,7 +544,7 @@ class RatbagdButton(_RatbagdDBus):
|
||||
modifiers.
|
||||
"""
|
||||
ret = self._dbus_call("SetKeyMapping", "au", keys)
|
||||
self._set_dbus_property("KeyMapping", "au", keys)
|
||||
self._set_dbus_property("KeyMapping", "au", keys, readwrite=False)
|
||||
return ret
|
||||
|
||||
@GObject.Property
|
||||
|
||||
Reference in New Issue
Block a user