aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2012-08-20 16:09:31 +0200
committerGerd Hoffmann <kraxel@redhat.com>2012-08-20 16:09:31 +0200
commit41421beafee4dbbb7d6483487ac098b5f51791c4 (patch)
tree79bcf165210981fbf2696f35bd958a63ca3d9b7d
parent4bcf40a96e5dd2c0be19ad3878e00b1defcbd671 (diff)
downloadvconsole-41421beafee4dbbb7d6483487ac098b5f51791c4.tar.gz
put logfile name into status line
-rw-r--r--domain.c27
1 files changed, 15 insertions, 12 deletions
diff --git a/domain.c b/domain.c
index 6cf7e77..3586ca8 100644
--- a/domain.c
+++ b/domain.c
@@ -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)