diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2012-08-20 16:09:31 +0200 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2012-08-20 16:09:31 +0200 |
commit | 41421beafee4dbbb7d6483487ac098b5f51791c4 (patch) | |
tree | 79bcf165210981fbf2696f35bd958a63ca3d9b7d | |
parent | 4bcf40a96e5dd2c0be19ad3878e00b1defcbd671 (diff) | |
download | vconsole-41421beafee4dbbb7d6483487ac098b5f51791c4.tar.gz |
put logfile name into status line
-rw-r--r-- | domain.c | 27 |
1 files changed, 15 insertions, 12 deletions
@@ -20,6 +20,20 @@ static const char *domain_state_name(struct vconsole_domain *dom) return "-?-"; } +static void domain_update_status(struct vconsole_domain *dom) +{ + char *line; + + if (!dom->status) + return; + line = g_strdup_printf("%s%s%s%s", domain_state_name(dom), + dom->stream ? ", connected" : "", + dom->logname ? ", log " : "", + dom->logname ? dom->logname : ""); + gtk_label_set_text(GTK_LABEL(dom->status), line); + g_free(line); +} + /* ------------------------------------------------------------------ */ static void domain_foreach(struct vconsole_window *win, @@ -147,6 +161,7 @@ static void domain_configure_logging(struct vconsole_domain *dom) domain_log_close(dom); else domain_log_open(dom); + domain_update_status(dom); } void domain_configure_all_vtes(struct vconsole_window *win) @@ -159,18 +174,6 @@ void domain_configure_all_logging(struct vconsole_window *win) domain_foreach(win, domain_configure_logging); } -static void domain_update_status(struct vconsole_domain *dom) -{ - char line[128]; - - if (!dom->status) - return; - snprintf(line, sizeof(line), "%s%s", - domain_state_name(dom), - dom->stream ? ", connected" : ""); - gtk_label_set_text(GTK_LABEL(dom->status), line); -} - static void domain_disconnect(struct vconsole_domain *dom, virDomainPtr d) { if (!dom->stream) |