GObject property setters do not allow exceptions to be thrown, so in
order to catch the ValueErrors from the MouseMap we need to make this a
`real' Python setter method.
This adds another property to the perspectives, which signals whether a
perspective can safely shutdown. On a delete event, the Window checks
all its perspectives' properties and if one perspective signals that it
cannot safely shutdown, a dialog is presented that allows the user to
either shutdown ignoring any changes or to abort and commit or make other changes.
Fixes#102
I extended the perspective ``interface'' with another property called
`can_go_back`, which signifies if a perspective can go back into the
welcome perspective.
When this property is true, the window inserts a back button into the
perspective's titlebar that is visible when the perspective is presented
and there is more than one device connected.
Fixes#96.
It's not required anymore, and messes with visibilities of widgets that
are invisible on purpose (for example the back button in the mouse perspective).
This size is determined to be the best one with the current set of
device SVGs in libratbag. It is set to ensure that the jump in size
caused by the MousePerspective populating itself when switched to is
minimal and the least disturbing. We can't populate the MousePerspective
in advance because we need to know the device.
This is weirdly necessary in order to show all the widgets when the
MousePerspective is opened from the WelcomePerspective; it doesn't seem
to be required when the MousePerspective is started straight away as was
the case before the introduction of perspectives.
The welcome and error screens both require a different "perspective"
into Piper, while being in the same window. For this reason, we
introduce a titlebar and a regular stack and the concept of a
"perspective", which is defined as a certain view into Piper.
A perspective needs to implement an interface of sorts of two methods:
one to retrieve its string name, and another to retrieve its widget titlebar.
Different scenarios can then show different perspectives, that have full
control over the main widget and the titlebar displayed. This commit
introduces the MousePerspective, which is a perspective showing the
mouse configuration. Future commits will add an ErrorPerspective and a
WelcomePerspective, and even further into the future we can add a
KeyboardPerspective as well.
This commits adds the necessary bits in the UI to switch between
popovers. Following commits will propagate profile changes through the
rest of Piper so that all control widgets update corresponding to
profile changes.