提交 6a24ced5 编写于 作者: G Gerd Hoffmann

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: NGerd Hoffmann <kraxel@redhat.com>
上级 ed1132e4
...@@ -67,6 +67,7 @@ ...@@ -67,6 +67,7 @@
#include "x_keymap.h" #include "x_keymap.h"
#include "keymaps.h" #include "keymaps.h"
#include "sysemu/char.h" #include "sysemu/char.h"
#include "qom/object.h"
#define MAX_VCS 10 #define MAX_VCS 10
...@@ -1457,6 +1458,15 @@ static GSList *gd_vc_gfx_init(GtkDisplayState *s, VirtualConsole *vc, ...@@ -1457,6 +1458,15 @@ static GSList *gd_vc_gfx_init(GtkDisplayState *s, VirtualConsole *vc,
QemuConsole *con, int idx, QemuConsole *con, int idx,
GSList *group, GtkWidget *view_menu) 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->s = s;
vc->gfx.scale_x = 1.0; vc->gfx.scale_x = 1.0;
vc->gfx.scale_y = 1.0; vc->gfx.scale_y = 1.0;
...@@ -1477,10 +1487,10 @@ static GSList *gd_vc_gfx_init(GtkDisplayState *s, VirtualConsole *vc, ...@@ -1477,10 +1487,10 @@ static GSList *gd_vc_gfx_init(GtkDisplayState *s, VirtualConsole *vc,
vc->type = GD_VC_GFX; vc->type = GD_VC_GFX;
vc->tab_item = vc->gfx.drawing_area; vc->tab_item = vc->gfx.drawing_area;
gtk_notebook_append_page(GTK_NOTEBOOK(s->notebook), 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); 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.ops = &dcl_ops;
vc->gfx.dcl.con = con; vc->gfx.dcl.con = con;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册