aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2020-01-17 13:11:00 +0100
committerGerd Hoffmann <kraxel@redhat.com>2020-01-17 13:11:00 +0100
commit4451b995f54ee7afb22ab263aa5bea55b0de640a (patch)
tree45d174caab3abcd93e8b0a2ad8351b10b9cccd40
parent6341635273f7319027e6406638405cd743ca7f23 (diff)
downloadvconsole-4451b995f54ee7afb22ab263aa5bea55b0de640a.tar.gz
guestlog
-rw-r--r--main.ui2
-rw-r--r--vconsole.c17
-rw-r--r--vconsole.h1
3 files changed, 13 insertions, 7 deletions
diff --git a/main.ui b/main.ui
index edd595a..c603495 100644
--- a/main.ui
+++ b/main.ui
@@ -168,7 +168,7 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
- <object class="GtkCheckMenuItem">
+ <object class="GtkCheckMenuItem" id='guestlog'>
<property name="can_focus">False</property>
<property name="action_name">main.GuestLogging</property>
<property name="label" translatable="yes">_Log to file</property>
diff --git a/vconsole.c b/vconsole.c
index 58272be..33a98cc 100644
--- a/vconsole.c
+++ b/vconsole.c
@@ -621,18 +621,20 @@ static void menu_cb_blink_cursor(GtkToggleAction *action, gpointer userdata)
config_write();
}
-static void menu_cb_vm_logging(GtkToggleAction *action, gpointer userdata)
+#endif
+
+static void menu_cb_vm_logging(GSimpleAction *action,
+ GVariant *parameter,
+ gpointer userdata)
{
struct vconsole_window *win = userdata;
- win->vm_logging = gtk_toggle_action_get_active(action);
+ win->vm_logging = gtk_check_menu_item_get_active(win->guestlog);
domain_configure_all_logging(win);
g_key_file_set_boolean(config, "vm", "logging", win->vm_logging);
config_write();
}
-#endif
-
/* ------------------------------------------------------------------ */
static const GActionEntry entries[] = {
@@ -663,6 +665,9 @@ static const GActionEntry entries[] = {
},{
/* --- guest menu --- */
+ .name = "GuestLogging",
+ .activate = menu_cb_vm_logging,
+ },{
.name = "GuestEdit",
.activate = menu_cb_vm_edit,
},{
@@ -913,6 +918,7 @@ static struct vconsole_window *vconsole_toplevel_create(void)
win->toplevel = GTK_WIDGET(gtk_builder_get_object(builder, "toplevel"));
win->notebook = GTK_WIDGET(gtk_builder_get_object(builder, "notebook"));
win->recent = GTK_WIDGET(gtk_builder_get_object(builder, "recent"));
+ win->guestlog = GTK_CHECK_MENU_ITEM(gtk_builder_get_object(builder, "guestlog"));
/* signals */
gtk_builder_add_callback_symbols
@@ -955,9 +961,8 @@ static struct vconsole_window *vconsole_toplevel_create(void)
#if 0
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);
#endif
+ gtk_check_menu_item_set_active(win->guestlog, win->vm_logging);
return win;
}
diff --git a/vconsole.h b/vconsole.h
index 680d699..eec11ea 100644
--- a/vconsole.h
+++ b/vconsole.h
@@ -54,6 +54,7 @@ struct vconsole_window {
GtkWidget *toplevel;
GtkWidget *notebook;
GtkWidget *recent;
+ GtkCheckMenuItem *guestlog;
GtkUIManager *ui;
gboolean fullscreen;