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.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/rcm-client-hardware-list.c b/rcm-client-hardware-list.c
index eec0d03..9f55e82 100644
--- a/rcm-client-hardware-list.c
+++ b/rcm-client-hardware-list.c
@@ -8,7 +8,7 @@
#include "generated.h"
#include "rcm-client-main.h"
#include "rcm-client-hardware-list.h"
-#include "rcm-client-hardware-info.h"
+#include "rcm-client-receive.h"
static GtkWidget *status_msg;
static GtkWidget *hw_list_box;
@@ -64,6 +64,7 @@ void rcng_client_hardware_list_add(GDBusObject *hw)
GtkWidget *icon;
GtkWidget *label;
struct hwentry *hwe;
+ gchar *labeltxt;
g_print(" - Object at %s\n", g_dbus_object_get_object_path(hw));
@@ -83,7 +84,10 @@ void rcng_client_hardware_list_add(GDBusObject *hw)
gtk_widget_set_halign(icon, GTK_ALIGN_START);
gtk_widget_set_margin_start(icon, 12);
gtk_widget_set_margin_end(icon, 12);
- label = gtk_label_new(g_dbus_object_get_object_path(hw));
+ 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);
+ g_free(labeltxt);
gtk_box_pack_start(GTK_BOX(box), icon, FALSE, FALSE, 0);
gtk_box_pack_start(GTK_BOX(box), label, FALSE, FALSE, 0);
gtk_widget_show_all(box);
@@ -96,6 +100,8 @@ void rcng_client_hardware_list_add(GDBusObject *hw)
hw_list = g_list_append(hw_list, hwe);
}
+static struct hwentry *old_hwe = NULL;
+
static void
on_hw_selected(GtkListBox *box,
GtkListBoxRow *row,
@@ -109,7 +115,12 @@ on_hw_selected(GtkListBox *box,
entry = g_list_find_custom(hw_list, child, find_hwentry_by_widget);
hwe = entry ? entry->data : NULL;
- rcng_client_hardware_init_info_ui(hwe ? hwe->hw : NULL);
+ if (hwe == old_hwe)
+ return;
+
+ old_hwe = hwe;
+ rcng_client_receive_destroy_ui();
+ rcng_client_receive_init_ui(hwe ? hwe->hw : NULL);
}
void rcng_client_hardware_list_update_status(gchar *status)