diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2012-08-20 14:44:51 +0200 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2012-08-20 14:44:51 +0200 |
commit | 7a7ffc74974ec4c4b2afef762365dfdb4cf59cc2 (patch) | |
tree | d5783f88d8fac109e986c6f0ad7a8d05ea768394 /vconsole.c | |
parent | e9b7cd8485539db84d3b37fce828d8c051a0d8a4 (diff) | |
download | vconsole-7a7ffc74974ec4c4b2afef762365dfdb4cf59cc2.tar.gz |
log option: gui windup
Diffstat (limited to 'vconsole.c')
-rw-r--r-- | vconsole.c | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -302,6 +302,16 @@ static void menu_cb_blink_cursor(GtkToggleAction *action, gpointer userdata) config_write(); } +static void menu_cb_vm_logging(GtkToggleAction *action, gpointer userdata) +{ + struct vconsole_window *win = userdata; + + win->vm_logging = gtk_toggle_action_get_active(action); + domain_configure_all_logging(win); + g_key_file_set_boolean(config, "vm", "logging", win->vm_logging); + config_write(); +} + /* ------------------------------------------------------------------ */ static const GtkActionEntry entries[] = { @@ -408,6 +418,10 @@ static const GtkToggleActionEntry tentries[] = { .label = "_Fullscreen", .accelerator = "F11", .callback = G_CALLBACK(menu_cb_fullscreen), + },{ + .name = "GuestLogging", + .label = "Log to file", + .callback = G_CALLBACK(menu_cb_vm_logging), } }; @@ -431,6 +445,8 @@ static char ui_xml[] = " <menuitem action='FullScreen'/>\n" " </menu>\n" " <menu action='GuestMenu'>\n" +" <menuitem action='GuestLogging'/>\n" +" <separator/>\n" " <menuitem action='GuestRun'/>\n" " <menuitem action='GuestPause'/>\n" " <menuitem action='GuestReboot'/>\n" @@ -598,6 +614,8 @@ static struct vconsole_window *vconsole_toplevel_create(void) win->tty_bg = g_key_file_get_string(config, "tty", "background", &err); err = NULL; win->tty_blink = g_key_file_get_boolean(config, "tty", "blink", &err); + err = NULL; + win->vm_logging = g_key_file_get_boolean(config, "vm", "logging", &err); /* config defaults */ if (!win->tty_font) @@ -610,6 +628,8 @@ static struct vconsole_window *vconsole_toplevel_create(void) /* apply config */ item = gtk_ui_manager_get_widget(win->ui, "/MainMenu/ViewMenu/TerminalBlink"); gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(item), win->tty_blink); + item = gtk_ui_manager_get_widget(win->ui, "/MainMenu/GuestMenu/GuestLogging"); + gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(item), win->vm_logging); return win; } |