From 13b04d59d0ca6bedc3b33369d8788d44b6152843 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damien=20Th=C3=A9bault?= Date: Wed, 16 Feb 2022 22:31:52 +0100 Subject: Add support for gaming inputs --- src/gpm-tray-icon.c | 1 + src/gpm-upower.c | 7 +++++++ 2 files changed, 8 insertions(+) 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); -- cgit v1.2.1