diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2014-05-05 14:36:56 +0200 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2014-05-26 08:41:03 +0200 |
commit | 6a24ced5cab3e7cc5b2efd7122b5e191950998aa (patch) | |
tree | af116fa905973e4888754e7cd5ab76f65625e884 | |
parent | ed1132e41a31ded554adc542ddf043714f05b9d0 (diff) |
gtk: use device type as label
IMO useful than showing VGA for any graphic device
even in case it is something completely different.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
-rw-r--r-- | ui/gtk.c | 14 |
1 files changed, 12 insertions, 2 deletions
@@ -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; |