summaryrefslogtreecommitdiff
path: root/rcm-client-receive.c
diff options
context:
space:
mode:
Diffstat (limited to 'rcm-client-receive.c')
-rw-r--r--rcm-client-receive.c28
1 files changed, 16 insertions, 12 deletions
diff --git a/rcm-client-receive.c b/rcm-client-receive.c
index 8f43c7a..4f21f78 100644
--- a/rcm-client-receive.c
+++ b/rcm-client-receive.c
@@ -23,7 +23,9 @@ struct keymap_entry {
};
struct remote {
+ char *id;
char *name;
+ char *description;
guint16 width;
guint16 height;
GList *buttons;
@@ -691,18 +693,20 @@ void rcng_client_receive_keypress(GDBusObject *obj, const gchar *keycode, bool p
}
static struct remote *
-get_keymap(RCDevice *object, const gchar *keymap_name)
+get_keymap(RCDevice *object, const gchar *keymap_id)
{
struct remote *remote;
GVariant *keymap_entries = NULL;
GVariant *layout_entries = NULL;
remote = g_malloc0(sizeof(*remote));
- remote->name = strdup(keymap_name);
+ remote->id = strdup(keymap_id);
- rcdevice_call_get_keymap_sync(object, keymap_name, &remote->width,
- &remote->height, &keymap_entries,
- &layout_entries, NULL, NULL);
+ rcdevice_call_get_keymap_sync(object, keymap_id,
+ &remote->name, &remote->description,
+ &remote->width, &remote->height,
+ &keymap_entries, &layout_entries,
+ NULL, NULL);
g_assert(g_variant_is_of_type(keymap_entries, G_VARIANT_TYPE("aa{sv}")));
g_assert(g_variant_is_of_type(layout_entries, G_VARIANT_TYPE("aa{sv}")));
@@ -713,7 +717,7 @@ get_keymap(RCDevice *object, const gchar *keymap_name)
remote->widget = fixed;
GtkWidget *frame;
- frame = gtk_frame_new(keymap_name);
+ frame = gtk_frame_new(remote->name);
gtk_widget_set_name(gtk_frame_get_label_widget(GTK_FRAME(frame)), "RemoteControlClientRemoteLabel");
gtk_widget_set_name(frame, "RemoteControlClientRemoteFrame");
gtk_fixed_put(GTK_FIXED(fixed), frame, 0, 0);
@@ -851,20 +855,20 @@ void rcng_client_receive_init_ui(GDBusObject *new_hw)
if (!interface)
return;
- gchar **keymaps = NULL;
+ gchar **keymap_ids = NULL;
RCDevice *object = RCDEVICE(interface);
- rcdevice_call_list_keymaps_sync(object, &keymaps, NULL, NULL);
- for (i = 0; keymaps[i]; i++) {
+ rcdevice_call_list_keymaps_sync(object, &keymap_ids, NULL, NULL);
+ for (i = 0; keymap_ids[i]; i++) {
struct remote *remote;
- g_print("Fetching keymap: %s\n", keymaps[i]);
- remote = get_keymap(object, keymaps[i]);
+ g_print("Fetching keymap: %s\n", keymap_ids[i]);
+ remote = get_keymap(object, keymap_ids[i]);
state.remotes = g_list_prepend(state.remotes, remote);
gtk_grid_attach(GTK_GRID(rgrid), remote->widget, i, 1, 1, 1);
}
- g_free(keymaps);
+ g_free(keymap_ids);
gtk_widget_show_all(scrollda);
}