From d64dd25713453f38ae33ff90371d16f7964b408e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Fri, 15 Jul 2011 18:41:21 +0200 Subject: [PATCH] Let virt_viewer_notebook_show_status take varags --- src/virt-viewer-notebook.c | 9 ++++++++- src/virt-viewer-notebook.h | 4 ++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/virt-viewer-notebook.c b/src/virt-viewer-notebook.c index ab51881..0e4ecb2 100644 --- a/src/virt-viewer-notebook.c +++ b/src/virt-viewer-notebook.c @@ -91,17 +91,24 @@ virt_viewer_notebook_init (VirtViewerNotebook *self) } void -virt_viewer_notebook_show_status(VirtViewerNotebook *self, const gchar *text) +virt_viewer_notebook_show_status(VirtViewerNotebook *self, const gchar *fmt, ...) { VirtViewerNotebookPrivate *priv; + gchar *text; + va_list args; DEBUG_LOG("notebook show status %p", self); g_return_if_fail(VIRT_VIEWER_IS_NOTEBOOK(self)); + va_start(args, fmt); + text = g_strdup_vprintf(fmt, args); + va_end(args); + priv = self->priv; gtk_label_set_text(GTK_LABEL(priv->status), text); gtk_notebook_set_current_page(GTK_NOTEBOOK(self), 0); gtk_widget_show_all(GTK_WIDGET(self)); + g_free(text); } void diff --git a/src/virt-viewer-notebook.h b/src/virt-viewer-notebook.h index 05dadc7..4ba6c08 100644 --- a/src/virt-viewer-notebook.h +++ b/src/virt-viewer-notebook.h @@ -60,8 +60,8 @@ typedef struct { GType virt_viewer_notebook_get_type (void); VirtViewerNotebook* virt_viewer_notebook_new (void); -void virt_viewer_notebook_show_status(VirtViewerNotebook *nb, const gchar *text); -void virt_viewer_notebook_show_display(VirtViewerNotebook *self); +void virt_viewer_notebook_show_status(VirtViewerNotebook *nb, const gchar *fmt, ...); +void virt_viewer_notebook_show_display(VirtViewerNotebook *nb); G_END_DECLS