diff options
| author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2011-07-15 18:41:21 +0200 |
|---|---|---|
| committer | Daniel P. Berrange <berrange@redhat.com> | 2011-07-26 12:00:28 +0100 |
| commit | d64dd25713453f38ae33ff90371d16f7964b408e (patch) | |
| tree | d164648065dcdd7b70ce9c45d8e8732cdb47ef68 /src | |
| parent | dcbbf99050b786f69e1e728921c90510f06c8734 (diff) | |
Let virt_viewer_notebook_show_status take varags
Diffstat (limited to 'src')
| -rw-r--r-- | src/virt-viewer-notebook.c | 9 | ||||
| -rw-r--r-- | 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 |
