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.c50
1 files changed, 44 insertions, 6 deletions
diff --git a/rcm-client-hardware-list.c b/rcm-client-hardware-list.c
index 12d0052..cf61d42 100644
--- a/rcm-client-hardware-list.c
+++ b/rcm-client-hardware-list.c
@@ -46,14 +46,43 @@ void rcng_client_hardware_list_remove(GDBusObject *hw)
}
static void
-on_hw_selected(GtkButton *button,
- gpointer user_data)
+edit_keymaps_cb(GtkButton *button, gpointer user_data)
{
GDBusObject *hw = user_data;
rcng_client_receive_init_ui(hw);
}
+static void
+hardware_properties_cb(GtkButton *button, gpointer user_data)
+{
+ RCDevice *object = user_data;
+ GtkWidget *dialog;
+ GtkLabel *dev;
+ GtkLabel *desc;
+ GtkLabel *driver;
+ GtkLabel *kernelmap;
+
+ dialog = GTK_WIDGET(gtk_builder_get_object(global->builder, "hardware_properties"));
+
+ dev = GTK_LABEL(gtk_builder_get_object(global->builder, "hardware_properties_dev_value"));
+ gtk_label_set_text(dev, rcdevice_get_sys_name(object));
+
+ desc = GTK_LABEL(gtk_builder_get_object(global->builder, "hardware_properties_desc_value"));
+ gtk_label_set_text(desc, rcdevice_get_description(object));
+
+ driver = GTK_LABEL(gtk_builder_get_object(global->builder, "hardware_properties_driver_value"));
+ gtk_label_set_text(driver, rcdevice_get_driver_name(object));
+
+ kernelmap = GTK_LABEL(gtk_builder_get_object(global->builder, "hardware_properties_kernelmap_value"));
+ gtk_label_set_text(kernelmap, rcdevice_get_kernel_keymap_name(object));
+
+ gtk_widget_show_all(dialog);
+
+ gtk_dialog_run(GTK_DIALOG(dialog));
+
+ gtk_widget_hide(dialog);
+}
void rcng_client_hardware_list_add(GDBusObject *hw)
{
@@ -98,9 +127,12 @@ void rcng_client_hardware_list_add(GDBusObject *hw)
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_box_pack_start(GTK_BOX(box), icon, FALSE, FALSE, 0);
+
labeltxt = g_strdup_printf("%s: %s (%s)",
rcdevice_get_sys_name(object),
rcdevice_get_description(object),
@@ -108,14 +140,20 @@ void rcng_client_hardware_list_add(GDBusObject *hw)
label = gtk_label_new(labeltxt);
g_free(labeltxt);
gtk_widget_set_valign(label, GTK_ALIGN_CENTER);
- //button = gtk_button_new_from_icon_name("emblem-system-symbolic", GTK_ICON_SIZE_MENU);
+ gtk_box_pack_start(GTK_BOX(box), label, FALSE, FALSE, 0);
+
+ button = gtk_button_new_from_icon_name("emblem-system-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(hardware_properties_cb), object);
+ gtk_box_pack_end(GTK_BOX(box), button, FALSE, FALSE, 0);
+
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);
- gtk_box_pack_start(GTK_BOX(box), label, FALSE, FALSE, 0);
+ g_signal_connect(button, "clicked", G_CALLBACK(edit_keymaps_cb), hw);
gtk_box_pack_end(GTK_BOX(box), button, FALSE, FALSE, 0);
+
gtk_container_add(GTK_CONTAINER(row), box);
gtk_widget_show_all(row);