mirror of
https://github.com/libratbag/piper.git
synced 2026-05-19 04:16:08 -04:00
MousePerspective: allow shutdown when no device
If _device was not set yet then we will get an exception when accessing its 'profiles' attribute. GObject.Property does not support exceptions and we end up returning False. This caused Piper to think that there is a dirty profile and that warns the user about unapplied changes.
This commit is contained in:
committed by
Peter Hutterer
parent
161ca99049
commit
fe91c2f36a
@@ -67,6 +67,9 @@ class MousePerspective(Gtk.Overlay):
|
||||
|
||||
@GObject.Property
|
||||
def can_shutdown(self):
|
||||
if self._device is None:
|
||||
return True
|
||||
|
||||
"""Whether this perspective can safely shutdown."""
|
||||
for profile in self._device.profiles:
|
||||
if profile.dirty:
|
||||
|
||||
Reference in New Issue
Block a user