summaryrefslogtreecommitdiffstats
path: root/ui/gtk.c
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2015-02-17 10:41:08 +0100
committerGerd Hoffmann <kraxel@redhat.com>2015-04-22 13:21:16 +0200
commit779ce88fbd3f977112bc77ccb028b0ace762105e (patch)
tree3d913e151e1c41be977928b6dfc4de603cd99986 /ui/gtk.c
parentf8c223f69ac58488ea830597281b7ddd33037c4c (diff)
downloadhqemu-779ce88fbd3f977112bc77ccb028b0ace762105e.zip
hqemu-779ce88fbd3f977112bc77ccb028b0ace762105e.tar.gz
console/gtk: add qemu_console_get_label
Add a new function to get a nice label for a given QemuConsole. Drop the labeling code in gtk.c and use the new function instead. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'ui/gtk.c')
-rw-r--r--ui/gtk.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/ui/gtk.c b/ui/gtk.c
index c8d30fe..7180066 100644
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -1730,17 +1730,7 @@ static GSList *gd_vc_gfx_init(GtkDisplayState *s, VirtualConsole *vc,
QemuConsole *con, int idx,
GSList *group, GtkWidget *view_menu)
{
- Object *obj;
-
- obj = object_property_get_link(OBJECT(con), "device", NULL);
- if (obj) {
- vc->label = g_strdup_printf("%s", object_get_typename(obj));
- } else if (qemu_console_is_graphic(con)) {
- vc->label = g_strdup_printf("VGA");
- } else {
- vc->label = g_strdup_printf("vc%d", idx);
- }
-
+ vc->label = qemu_console_get_label(con);
vc->s = s;
vc->gfx.scale_x = 1.0;
vc->gfx.scale_y = 1.0;
OpenPOWER on IntegriCloud