Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for gaming inputs (v2) #376

Merged
merged 3 commits into from
Mar 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/icons/16x16/status/gpm-gaming-input-000.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/icons/16x16/status/gpm-gaming-input-020.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/icons/16x16/status/gpm-gaming-input-040.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/icons/16x16/status/gpm-gaming-input-060.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/icons/16x16/status/gpm-gaming-input-080.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/icons/16x16/status/gpm-gaming-input-100.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/icons/22x22/status/gpm-gaming-input-020.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/icons/22x22/status/gpm-gaming-input-040.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/icons/22x22/status/gpm-gaming-input-060.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/icons/22x22/status/gpm-gaming-input-080.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/icons/22x22/status/gpm-gaming-input-100.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/icons/24x24/status/gpm-gaming-input-000.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/icons/24x24/status/gpm-gaming-input-020.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/icons/24x24/status/gpm-gaming-input-040.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/icons/32x32/status/gpm-gaming-input-000.png
Binary file added data/icons/32x32/status/gpm-gaming-input-020.png
Binary file added data/icons/32x32/status/gpm-gaming-input-040.png
Binary file added data/icons/32x32/status/gpm-gaming-input-060.png
Binary file added data/icons/32x32/status/gpm-gaming-input-080.png
Binary file added data/icons/32x32/status/gpm-gaming-input-100.png
Binary file added data/icons/48x48/status/gpm-gaming-input-000.png
Binary file added data/icons/48x48/status/gpm-gaming-input-020.png
Binary file added data/icons/48x48/status/gpm-gaming-input-040.png
Binary file added data/icons/48x48/status/gpm-gaming-input-060.png
Binary file added data/icons/48x48/status/gpm-gaming-input-080.png
Binary file added data/icons/48x48/status/gpm-gaming-input-100.png
Binary file added data/icons/64x64/status/gpm-gaming-input-000.png
Binary file added data/icons/64x64/status/gpm-gaming-input-020.png
Binary file added data/icons/64x64/status/gpm-gaming-input-040.png
Binary file added data/icons/64x64/status/gpm-gaming-input-060.png
Binary file added data/icons/64x64/status/gpm-gaming-input-080.png
Binary file added data/icons/64x64/status/gpm-gaming-input-100.png
Binary file added data/icons/96x96/status/gpm-gaming-input-000.png
Binary file added data/icons/96x96/status/gpm-gaming-input-020.png
Binary file added data/icons/96x96/status/gpm-gaming-input-040.png
Binary file added data/icons/96x96/status/gpm-gaming-input-060.png
Binary file added data/icons/96x96/status/gpm-gaming-input-080.png
Binary file added data/icons/96x96/status/gpm-gaming-input-100.png
507 changes: 507 additions & 0 deletions data/icons/scalable/status/gpm-gaming-input-000.svg

Large diffs are not rendered by default.

792 changes: 792 additions & 0 deletions data/icons/scalable/status/gpm-gaming-input-020.svg

Large diffs are not rendered by default.

673 changes: 673 additions & 0 deletions data/icons/scalable/status/gpm-gaming-input-040.svg

Large diffs are not rendered by default.

521 changes: 521 additions & 0 deletions data/icons/scalable/status/gpm-gaming-input-060.svg

Large diffs are not rendered by default.

673 changes: 673 additions & 0 deletions data/icons/scalable/status/gpm-gaming-input-080.svg

Large diffs are not rendered by default.

501 changes: 501 additions & 0 deletions data/icons/scalable/status/gpm-gaming-input-100.svg

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions src/gpm-statistics.c
Original file line number Diff line number Diff line change
Expand Up @@ -894,6 +894,9 @@ gpm_stats_add_device (UpDevice *device, GPtrArray *devices)
if ((vendor != NULL && strlen(vendor) != 0) && (model != NULL && strlen(model) != 0)) {
label = g_strdup_printf ("%s %s", vendor, model);
}
else if((vendor == NULL || strlen(vendor) == 0) && (model != NULL && strlen(model) != 0)) {
label = g_strdup_printf ("%s", model);
}
else {
label = g_strdup_printf ("%s", gpm_device_kind_to_localised_string (kind, 1));
}
Expand Down
4 changes: 4 additions & 0 deletions src/gpm-tray-icon.c
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,9 @@ gpm_tray_icon_add_device (GpmTrayIcon *icon, GtkMenu *menu, const GPtrArray *arr
if ((vendor != NULL && strlen(vendor) != 0) && (model != NULL && strlen(model) != 0)) {
label = g_strdup_printf ("%s %s (%.1f%%)", vendor, model, percentage);
}
else if((vendor == NULL || strlen(vendor) == 0) && (model != NULL && strlen(model) != 0)) {
label = g_strdup_printf ("%s (%.1f%%)", model, percentage);
}
else {
label = g_strdup_printf ("%s (%.1f%%)", gpm_device_kind_to_localised_string (kind, 1), percentage);
}
Expand Down Expand Up @@ -354,6 +357,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 */
Expand Down
7 changes: 7 additions & 0 deletions src/gpm-upower.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down Expand Up @@ -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);
Expand Down