aboutsummaryrefslogtreecommitdiffstats
path: root/gtk/main_statusbar.c
diff options
context:
space:
mode:
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2010-11-27 21:50:49 +0000
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2010-11-27 21:50:49 +0000
commitf345d2ae144e533600acdfe06560918c059d5b59 (patch)
tree7ffed53d8b537c9a207f28b5438525b428cc21d5 /gtk/main_statusbar.c
parent58a78e262c7dc66f04b7d1f9c1806bc4d661af57 (diff)
Move main_statusbar.h to the top-level directory; none of its routines
use GTK+ data types, so, at least in theory, it could be implemented atop another toolkit. Make statusbar_push_temporary_msg() take a format string and format arguments. Use it instead of simple_status(), and change one call to just take a format string and arguments rather than to take the result of using that format string and arguments with g_strdup_printf() and passing the result to statusbar_push_temporary_msg(). git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@35041 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'gtk/main_statusbar.c')
-rw-r--r--gtk/main_statusbar.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/gtk/main_statusbar.c b/gtk/main_statusbar.c
index 5a55c4e726..eae9b22b20 100644
--- a/gtk/main_statusbar.c
+++ b/gtk/main_statusbar.c
@@ -48,7 +48,6 @@
#include "gtk/recent.h"
#include "gtk/main.h"
-#include "gtk/main_statusbar.h"
#include "gtk/main_statusbar_private.h"
#include "gtk/gui_utils.h"
#include "gtk/gtkglobals.h"
@@ -59,6 +58,8 @@
#include "gtk/keys.h"
#include "gtk/menus.h"
+#include "main_statusbar.h"
+
/*
* The order below defines the priority of info bar contexts.
*/
@@ -231,14 +232,21 @@ statusbar_flash_temporary_msg(gpointer data _U_)
}
/*
- * Push a temporary message onto the statusbar.
+ * Push a formatted temporary message onto the statusbar.
*/
void
-statusbar_push_temporary_msg(const gchar *msg)
+statusbar_push_temporary_msg(const gchar *msg_format, ...)
{
+ va_list ap;
+ gchar *msg;
guint msg_id;
+ va_start(ap, msg_format);
+ msg = g_strdup_vprintf(msg_format, ap);
+ va_end(ap);
+
msg_id = gtk_statusbar_push(GTK_STATUSBAR(info_bar), main_ctx, msg);
+ g_free(msg);
flash_time = TEMPORARY_FLASH_TIMEOUT - 1;
g_timeout_add(TEMPORARY_FLASH_INTERVAL, statusbar_flash_temporary_msg, NULL);