aboutsummaryrefslogtreecommitdiffstats
path: root/domain.c
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2012-09-13 15:41:00 +0200
committerGerd Hoffmann <kraxel@redhat.com>2012-09-13 15:41:00 +0200
commit4e7ddbbe5994297f383149cb85c949b670c697c9 (patch)
tree0dfe70909b15643a54122c21faba70f9d8fdf508 /domain.c
parentd6af7727d1defbc0b7a44b704deeeae4965c4409 (diff)
downloadvconsole-4e7ddbbe5994297f383149cb85c949b670c697c9.tar.gz
colorize domain list a bit
Diffstat (limited to 'domain.c')
-rw-r--r--domain.c23
1 files changed, 19 insertions, 4 deletions
diff --git a/domain.c b/domain.c
index 755468d..cafd5ce 100644
--- a/domain.c
+++ b/domain.c
@@ -398,7 +398,8 @@ void domain_update(struct vconsole_connect *conn,
struct vconsole_domain *dom = NULL;
void *ptr;
gboolean rc;
- const char *name;
+ const char *name, *foreground;
+ PangoWeight weight;
char uuid[VIR_UUID_STRING_BUFLEN];
char idstr[16];
int id;
@@ -461,11 +462,25 @@ void domain_update(struct vconsole_connect *conn,
strcpy(idstr, "-");
else
snprintf(idstr, sizeof(idstr), "%d", id);
+
domain_update_info(dom, d);
+ switch (dom->info.state) {
+ case VIR_DOMAIN_RUNNING:
+ foreground = "darkgreen";
+ weight = PANGO_WEIGHT_BOLD;
+ break;
+ default:
+ foreground = "black";
+ weight = PANGO_WEIGHT_NORMAL;
+ break;
+ }
+
gtk_tree_store_set(conn->win->store, &guest,
- NAME_COL, name,
- ID_COL, idstr,
- STATE_COL, domain_state_name(dom),
+ NAME_COL, name,
+ ID_COL, idstr,
+ STATE_COL, domain_state_name(dom),
+ FOREGROUND_COL, foreground,
+ WEIGHT_COL, weight,
-1);
}