summaryrefslogtreecommitdiff
path: root/rcm-client-hardware-list.c
diff options
context:
space:
mode:
Diffstat (limited to 'rcm-client-hardware-list.c')
-rw-r--r--rcm-client-hardware-list.c46
1 files changed, 33 insertions, 13 deletions
diff --git a/rcm-client-hardware-list.c b/rcm-client-hardware-list.c
index 597e26c..12d0052 100644
--- a/rcm-client-hardware-list.c
+++ b/rcm-client-hardware-list.c
@@ -68,29 +68,49 @@ void rcng_client_hardware_list_add(GDBusObject *hw)
gchar *labeltxt;
GtkWidget *hw_list_swin;
GtkWidget *hw_list_box;
+ GDBusInterface *interface;
+ RCDevice *object;
g_print(" - Object at %s\n", g_dbus_object_get_object_path(hw));
interfaces = g_dbus_object_get_interfaces(hw);
for (ll = interfaces; ll != NULL; ll = ll->next) {
- GDBusInterface *interface = G_DBUS_INTERFACE(ll->data);
- g_print (" - Interface %s\n", g_dbus_interface_get_info(interface)->name);
+ GDBusInterface *iface = G_DBUS_INTERFACE(ll->data);
+ g_print (" - Interface %s\n", g_dbus_interface_get_info(iface)->name);
}
- g_list_free_full (interfaces, g_object_unref);
+ g_list_free_full(interfaces, g_object_unref);
+
+ interface = g_dbus_object_get_interface(hw, "org.gnome.RemoteControlManager.Device");
+ if (!interface)
+ return;
+
+ object = RCDEVICE(interface);
+ printf("Name: %s, Desc: %s, Driver: %s, Kernel keymap: %s, HW: %s\n",
+ rcdevice_get_sys_name(object),
+ rcdevice_get_description(object),
+ rcdevice_get_driver_name(object),
+ rcdevice_get_kernel_keymap_name(object),
+ rcdevice_get_hardware_type(object));
row = gtk_list_box_row_new();
- box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
- icon = gtk_image_new_from_icon_name("gtk-harddisk", GTK_ICON_SIZE_DIALOG);
- gtk_widget_set_valign(icon, GTK_ALIGN_START);
+ box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 12);
+ gtk_widget_set_margin_top(box, 6);
+ gtk_widget_set_margin_bottom(box, 6);
+ gtk_widget_set_margin_start(box, 12);
+ gtk_widget_set_margin_end(box, 12);
+ icon = gtk_image_new_from_icon_name("input-dialpad-symbolic", GTK_ICON_SIZE_MENU);
+ gtk_widget_set_valign(icon, GTK_ALIGN_CENTER);
gtk_widget_set_halign(icon, GTK_ALIGN_START);
- gtk_widget_set_margin_start(icon, 12);
- gtk_widget_set_margin_end(icon, 12);
- labeltxt = g_strdup_printf("<b>Hardware</b>\n\ntest\ntest\ntest%s", g_dbus_object_get_object_path(hw));
- label = gtk_label_new(NULL);
- gtk_label_set_markup(GTK_LABEL(label), labeltxt);
+ labeltxt = g_strdup_printf("%s: %s (%s)",
+ rcdevice_get_sys_name(object),
+ rcdevice_get_description(object),
+ rcdevice_get_driver_name(object));
+ label = gtk_label_new(labeltxt);
g_free(labeltxt);
- button = gtk_button_new_from_icon_name("emblem-system-symbolic", GTK_ICON_SIZE_MENU);
- gtk_widget_set_valign(button, GTK_ALIGN_END);
+ gtk_widget_set_valign(label, GTK_ALIGN_CENTER);
+ //button = gtk_button_new_from_icon_name("emblem-system-symbolic", GTK_ICON_SIZE_MENU);
+ button = gtk_button_new_from_icon_name("accessories-calculator-symbolic", GTK_ICON_SIZE_MENU);
+ gtk_widget_set_valign(button, GTK_ALIGN_CENTER);
gtk_widget_set_halign(button, GTK_ALIGN_END);
g_signal_connect(button, "clicked", G_CALLBACK(on_hw_selected), hw);
gtk_box_pack_start(GTK_BOX(box), icon, FALSE, FALSE, 0);