]> Git Repo - qemu.git/commitdiff
gtk: use device type as label
authorGerd Hoffmann <[email protected]>
Mon, 5 May 2014 12:36:56 +0000 (14:36 +0200)
committerGerd Hoffmann <[email protected]>
Mon, 26 May 2014 06:41:03 +0000 (08:41 +0200)
IMO useful than showing VGA for any graphic device
even in case it is something completely different.

Signed-off-by: Gerd Hoffmann <[email protected]>
ui/gtk.c

index 0756432e8d15327a3f891e8730b77ed75052412b..a8393ddd7618994322605fcef33ff3ef3d803526 100644 (file)
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -67,6 +67,7 @@
 #include "x_keymap.h"
 #include "keymaps.h"
 #include "sysemu/char.h"
+#include "qom/object.h"
 
 #define MAX_VCS 10
 
@@ -1457,6 +1458,15 @@ static GSList *gd_vc_gfx_init(GtkDisplayState *s, VirtualConsole *vc,
                               QemuConsole *con, int idx,
                               GSList *group, GtkWidget *view_menu)
 {
+    const char *label = "VGA";
+    Error *local_err = NULL;
+    Object *obj;
+
+    obj = object_property_get_link(OBJECT(con), "device", &local_err);
+    if (obj) {
+        label = object_get_typename(obj);
+    }
+
     vc->s = s;
     vc->gfx.scale_x = 1.0;
     vc->gfx.scale_y = 1.0;
@@ -1477,10 +1487,10 @@ static GSList *gd_vc_gfx_init(GtkDisplayState *s, VirtualConsole *vc,
     vc->type = GD_VC_GFX;
     vc->tab_item = vc->gfx.drawing_area;
     gtk_notebook_append_page(GTK_NOTEBOOK(s->notebook),
-                             vc->tab_item, gtk_label_new("VGA"));
+                             vc->tab_item, gtk_label_new(label));
     gd_connect_vc_gfx_signals(vc);
 
-    group = gd_vc_menu_init(s, vc, "VGA", idx, group, view_menu);
+    group = gd_vc_menu_init(s, vc, label, idx, group, view_menu);
 
     vc->gfx.dcl.ops = &dcl_ops;
     vc->gfx.dcl.con = con;
This page took 0.024565 seconds and 4 git commands to generate.