diff options
author | Damien Thébault <[email protected]> | 2022-02-16 22:31:52 +0100 |
---|---|---|
committer | Robert Antoni Buj Gelonch <[email protected]> | 2022-03-21 12:41:09 +0100 |
commit | 13b04d59d0ca6bedc3b33369d8788d44b6152843 (patch) | |
tree | 2cc52f855e4a3386daaeacd2922fe528203e3c9f | |
parent | 67d510c50442471d10d090af04987f7771c1719b (diff) | |
download | mate-power-manager-13b04d59d0ca6bedc3b33369d8788d44b6152843.tar.bz2 mate-power-manager-13b04d59d0ca6bedc3b33369d8788d44b6152843.tar.xz |
Add support for gaming inputs
-rw-r--r-- | src/gpm-tray-icon.c | 1 | ||||
-rw-r--r-- | src/gpm-upower.c | 7 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/gpm-tray-icon.c b/src/gpm-tray-icon.c index 258c242..6ace66c 100644 --- a/src/gpm-tray-icon.c +++ b/src/gpm-tray-icon.c @@ -354,6 +354,7 @@ gpm_tray_icon_create_menu (GpmTrayIcon *icon) dev_cnt += gpm_tray_icon_add_device (icon, menu, array, UP_DEVICE_KIND_MEDIA_PLAYER); dev_cnt += gpm_tray_icon_add_device (icon, menu, array, UP_DEVICE_KIND_TABLET); dev_cnt += gpm_tray_icon_add_device (icon, menu, array, UP_DEVICE_KIND_COMPUTER); + dev_cnt += gpm_tray_icon_add_device (icon, menu, array, UP_DEVICE_KIND_GAMING_INPUT); g_ptr_array_unref (array); /* skip for things like live-cd's and GDM */ diff --git a/src/gpm-upower.c b/src/gpm-upower.c index 6cf24c6..7311936 100644 --- a/src/gpm-upower.c +++ b/src/gpm-upower.c @@ -162,6 +162,9 @@ gpm_upower_get_device_icon (UpDevice *device) index_str = gpm_upower_get_device_icon_index (device); filename = g_strdup_printf ("gpm-%s-%s", prefix, index_str); } + } else if (kind == UP_DEVICE_KIND_GAMING_INPUT) { + index_str = gpm_upower_get_device_icon_index (device); + filename = g_strdup_printf ("gpm-%s-%s", prefix, index_str); } /* nothing matched */ @@ -526,6 +529,10 @@ gpm_device_kind_to_localised_string (UpDeviceKind kind, guint number) /* TRANSLATORS: tablet device */ text = ngettext ("Computer", "Computers", number); break; + case UP_DEVICE_KIND_GAMING_INPUT: + /* TRANSLATORS: wireless gamepad, joystick etc */ + text = ngettext ("Gaming input", "Gaming inputs", number); + break; default: g_warning ("enum unrecognised: %i", kind); text = up_device_kind_to_string (kind); |