Commit Graph

187 Commits

Author SHA1 Message Date
Jente Hidskes
e2ce3ccfe0 MousePerspective: destroy profiles before adding new ones
Fixes #124.
2017-08-16 10:58:52 +10:00
Jente Hidskes
7265828ec4 Ratbagd: small return cleanup 2017-08-16 10:53:29 +10:00
Jente Hidskes
efdc85c99e Window: cast ValueError to str to display it 2017-08-16 10:53:29 +10:00
Jente Hidskes
1da54f7d6f MousePerspective: make device setter a real method
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.
2017-08-16 10:53:29 +10:00
Peter Hutterer
5440618ebc Piper: check for required GTK version at runtime
Related to #111
2017-08-16 10:21:57 +10:00
Jente Hidskes
7661feef67 ButtonsPage: apply profile cycle buttons across all profiles
Fixes #78.
2017-08-15 16:22:11 +10:00
Jente Hidskes
3e6ca8270a Window: ask for confirmation before closing with unsaved changes
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
2017-08-11 15:16:35 +02:00
Jente Hidskes
f23cef80c8 MousePerspective: correctly initialise the commit button
Piper can start with dirty profiles; only setting the button (in)active
doesn't update the CSS class so the suggested action hint would be
missed.
2017-08-11 15:16:35 +02:00
Jente Hidskes
7fd66be80f MousePerspective: change button icon to text
Fixes #69.
2017-08-11 13:30:25 +01:00
Jente Hidskes
3f829553ea Window: give perspectives a back button
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.
2017-08-11 13:29:09 +01:00
Jente Hidskes
2dca35d6ab Ratbagd: emit notify::devices when the devices change 2017-08-11 13:29:09 +01:00
Jente Hidskes
ff568ca4e4 Application: don't call show_all() on the window
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).
2017-08-11 13:29:09 +01:00
Jente Hidskes
e133ec976b MouseMap: work around do_forall getting an invalid instance
See https://bugzilla.gnome.org/show_bug.cgi?id=722562
2017-08-11 13:29:09 +01:00
Jente Hidskes
88bac26d85 Window: react to devices being added or removed
Fixes #89 and #90.
2017-08-11 13:29:09 +01:00
Jente Hidskes
aab340eaa6 WelcomePerspective: add methods to add and remove devices 2017-08-11 13:29:09 +01:00
Jente Hidskes
cac909dc4c Ratbagd: fix adding and removing devices 2017-08-11 13:29:09 +01:00
Jente Hidskes
39374c4687 Window: be more specific in error message 2017-08-11 13:29:09 +01:00
Jente Hidskes
d698ed5704 MousePerspective: make set_device a property
A property can be queried by Window, which it'll need when we start
reacting to devices being removed.
2017-08-11 13:29:09 +01:00
Jente Hidskes
5e857ce900 Ratbagd: add device-added and device-removed signals 2017-08-11 13:29:09 +01:00
Jente Hidskes
55e10bdfc8 ResolutionsPage: reduce width of the controls 2017-08-11 11:10:01 +01:00
Jente Hidskes
9652d8d721 MousePerspective: disable the commit button when the profile isn't dirty 2017-08-11 11:07:58 +01:00
Jente Hidskes
fb130e6719 MousePerspective: highlight the commit button when a profile gets dirty 2017-08-11 11:07:58 +01:00
Jente Hidskes
16256230be ResolutionRow: block the scale's value changed handler when initialising
This prevents the profile from becoming dirty while the MousePerspective
is initialising itself on a new device
2017-08-11 11:07:58 +01:00
Jente Hidskes
f69ccde09e RatbagProfile: add dirty property
This allows clients to react to dirty profiles.
2017-08-11 11:07:58 +01:00
Jente Hidskes
eda73cdd80 ResolutionsPage: fix labeling buttons related to resolutions
Fixes #88.
2017-08-09 19:20:05 +01:00
Jente Hidskes
bdc11e2578 Window: request a default size
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.
2017-08-09 19:17:45 +01:00
Jente Hidskes
9d46dcb89a Add a WelcomePerspective if there is more than 1 device 2017-08-09 19:17:45 +01:00
Jente Hidskes
0812e60b5e MousePerspective: make everything visible with show_all()
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.
2017-08-09 19:17:45 +01:00
Jente Hidskes
50205fbc46 Add an ErrorPerspective according to the empty state pattern
See https://developer.gnome.org/hig/stable/empty-placeholder.html.en and
https://github.com/gnome-design-team/gnome-mockups/tree/master/empty-app-states
2017-08-09 19:17:45 +01:00
Jente Hidskes
52bb5e3781 Introduce perspectives to manage different screens
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.
2017-08-09 19:17:45 +01:00
Jente Hidskes
d452c50e6b 404: remove caption and resize 2017-08-09 19:17:45 +01:00
Rasmus Thomsen
801784f876 Meson.build: allow customisation of bindir 2017-08-06 20:29:32 +02:00
Jente Hidskes
ee6f91bd49 ResolutionRow: do not display frame label "Resolution"
See #79
2017-08-04 08:49:42 +01:00
Jente Hidskes
83e215f08f ResolutionRow: remove "Resolution x"
See #75 and #79
2017-08-04 08:49:42 +01:00
Jente Hidskes
97f0be4486 LedsPage: do not number the LEDs
See #75.
2017-08-04 08:49:42 +01:00
Julian Richen
678b017443 Application: change aboutDialog.ui resource path to AboutDialog.ui 2017-08-03 10:07:54 +02:00
Jente Hidskes
b9815889f6 ButtonsPage: respond to profile changes 2017-08-01 16:39:30 +01:00
Jente Hidskes
a64f0bc8a6 LedsPage: respond to profile changes 2017-08-01 16:39:30 +01:00
Jente Hidskes
c36217fd14 ResolutionRow: respond to profile changes 2017-08-01 16:39:30 +01:00
Jente Hidskes
033420902a ResolutionsPage: respond to profile changes 2017-08-01 16:39:30 +01:00
Jente Hidskes
21e4ed75ef ratbagd: add active-profile-changed signal to RatbagdDevice
This signal is emitted whenever a new profile is made the active
profile, and allows Piper and other GUIs to reflect this change.
2017-08-01 16:39:30 +01:00
Jente Hidskes
799771acb6 RatbagdResolution: move report_rate setter to its getter 2017-08-01 16:39:30 +01:00
Jente Hidskes
b7d5525bbd RatbagdProfile: add active_resolution property 2017-08-01 16:39:30 +01:00
Jente Hidskes
04b69f0eef RatbagdDevice: add active_profile property 2017-08-01 16:39:30 +01:00
Jente Hidskes
da3efd0374 Window: add profile switch popover
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.
2017-08-01 16:39:30 +01:00
Jente Hidskes
9b97acd4da ratbagd: deal with notify::action-type better
Now that this signal is properly emitted from ratbagd (see
https://github.com/libratbag/libratbag/pull/264), we can remove our
hackish workaround and do this The Right Way.
2017-08-01 10:22:34 +01:00
Jente Hidskes
37b19d68aa ButtonsPage: display proper button labels
We don't use RatbagdButton.Type to describe function, see
https://github.com/libratbag/libratbag/issues/233 and specifically
https://github.com/libratbag/piper/pull/47#issuecomment-316040785
2017-08-01 10:22:34 +01:00
Jente Hidskes
fc9d9bffc6 Keystroke: remove clear, add cancel 2017-08-01 10:22:34 +01:00
Jente Hidskes
c64c08f713 ButtonDialog: separate different mappings in the list 2017-08-01 10:22:34 +01:00
Jente Hidskes
e874c81c69 Merge key mappings with macros 2017-08-01 10:22:34 +01:00