Commit Graph

269 Commits

Author SHA1 Message Date
Jente Hidskes
2965979484 ButtonDialog: move handedness to its separate stack page 2017-08-21 12:50:44 +02:00
Jente Hidskes
6dc3a54f71 ButtonDialog: add a search entry to search mappings
Fixes #77.
2017-08-21 12:50:44 +02:00
Jente Hidskes
92ca0d894b Meson: copy configuration data so we don't have to duplicate it manually
Fixes #138 and 5d81027e84.
2017-08-21 20:30:38 +10:00
Jente Hidskes
6962abf3b6 Revert "meson: copy configuration data so we don't have to duplicate it manually"
This reverts commit 5d81027e84.

It wrongly doesn't override the pkgdatadir anymore, and (less
importantly) also forgets localedir
2017-08-21 20:30:38 +10:00
Peter Hutterer
ae588769e1 circle.yml: fix typo in flake8 scan targets 2017-08-21 19:27:51 +10:00
Jente Hidskes
74af3a96ee Ratbagd: remove unneeded global line 2017-08-21 19:15:18 +10:00
Jente Hidskes
29f8f55d94 Ratbagd: do not return _dbus_call return value in setters
Setters do not support returning values.
2017-08-21 19:15:18 +10:00
Jente Hidskes
06a53acf47 Ratbagd: _set_dbus_property doesn't return anything
We don't want to return values from setters, but more importantly,
_set_dbus_property doesn't even return anything anymore.
2017-08-21 19:15:18 +10:00
Jente Hidskes
b7a67340a0 LedsPage: move LED mode to string to the bindings
This is more consistent with RatbagdButton, and one less translatable
file.
2017-08-21 11:07:41 +02:00
Jente Hidskes
2c522002e6 ButtonDialog.ui: do not track links in labels 2017-08-21 11:06:38 +02:00
Jente Hidskes
c16fbb51c7 UI files: consistently use (untranslatable) placeholder labels 2017-08-21 11:06:38 +02:00
Jente Hidskes
cd6c528608 UI files: unmark placeholder strings as translatable 2017-08-21 11:06:38 +02:00
Jente Hidskes
d19895c380 Remove old piper code from the tree 2017-08-21 10:58:36 +02:00
Jente Hidskes
f17e341dbe ResolutionRow: add label to highlight the active resolution
Fixes #80, #81.
2017-08-21 16:27:24 +10:00
Jente Hidskes
2cec0e4e0e Ratbagd: emit notify::is-active when IsActive is changed 2017-08-21 16:27:24 +10:00
Jente Hidskes
5d81027e84 meson: copy configuration data so we don't have to duplicate it manually
Fixes #138.
2017-08-21 06:50:33 +10:00
Jente Hidskes
4239b603b6 MouseMap: do not redraw on allocate
We don't need to redraw the entire widget when the size changes, so this
is another little optimization.
2017-08-18 03:59:23 +10:00
Jente Hidskes
ccb9f83c10 MouseMap: save & restore GtkStyleContext to prevent hogging the CPU
Since Gtk 3.18 passing a state other than the current state isn't
recommended and can apparently lead to hogging the CPU due to triggering
a loop: requesting style context triggers pixel cache refresh, which triggers
do_draw, which requests the style context that triggers the pixel cache again,
et cetera.

For background, see https://bugzilla.gnome.org/show_bug.cgi?id=760462
and the linked blog post https://blogs.gnome.org/mclasen/2015/11/20/a-gtk-update/.
Note that the advice of using the gtk_render_* API doesn't work for the
MouseMap, so we have to use the suggested workaround.

Fixes #133.
2017-08-18 03:59:23 +10:00
Jente Hidskes
424a66ae48 Meson: remove whitespace 2017-08-17 10:01:13 +02:00
Jente Hidskes
7542943c2d Meson: fix build with meson 0.42.0
Fixes a newly introduced warning:

WARNING: The variable(s) 'devel' in the input file 'piper.in' are not present in
the given configuration data.
2017-08-17 10:01:13 +02:00
Jente Hidskes
191cbf6d36 ResolutionRow: initialize the DPI label 2017-08-17 09:50:58 +02:00
Jente Hidskes
182f44ed40 MousePerspective: do not use show_all()
This again interferes with hiding widgets on purpose.
2017-08-17 09:50:52 +02:00
Jente Hidskes
d41b2ce547 ResolutionRow: rename title_label to dpi_label 2017-08-17 09:50:46 +02:00
Jente Hidskes
3c432d3c63 ButtonDialog: fix the tooltip for the macro row 2017-08-17 09:49:47 +02:00
Jente Hidskes
f74deb9cc9 ButtonDialog: do not track visited links 2017-08-17 09:49:47 +02:00
Jente Hidskes
31c6fc1c76 ButtonDialog: only allow swapping for left- and right buttons
Fixes #82.
2017-08-17 09:49:47 +02:00
Jente Hidskes
e85fbf232d Ratbagd: increase timeout from 500 to 2000 milliseconds
As mentioned in #119, this is just a stop-gap until libratbag
switches to an async commit (https://github.com/libratbag/libratbag/issues/269)

Fixes #119.
2017-08-17 08:09:17 +10:00
Jente Hidskes
4ebea6fed1 MousePerspective: replace == with is 2017-08-16 18:46:17 +10:00
Jente Hidskes
9f6e8aa6f7 Do not crash if there is no active profile or resolution
See #120.
2017-08-16 18:46:17 +10:00
Jente Hidskes
adc8d9b712 RatbagdButton: add ACTION_SPECIAL_UNKNOWN to SPECIAL_DESCRIPTION
This prevents crashing when a device reports an unknown special action
type to libratbag, see e.g. #120.
2017-08-16 09:57:10 +02:00
Jente Hidskes
93a62a7fb4 ButtonDialog: also register key releases
Fixes #56
2017-08-16 11:04:04 +10:00
Jente Hidskes
c0a27b911c MousePerspective: only consider profile dirty for commit button
Fixes #123.
2017-08-16 11:02:16 +10:00
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