[easytag] Small improvements to status bar handling



commit 7cfbe6e00e264566297a3b249abd04bc9023c1d0
Author: David King <amigadave amigadave com>
Date:   Fri Feb 15 20:58:46 2013 +0000

    Small improvements to status bar handling
    
    Use more appropriate parameter types for Statusbar_Message(). Use
    G_SOURCE_REMOVE. Use g_timeout_add_seconds() rather than
    g_timeout_add().

 src/bar.c |   14 ++++++--------
 src/bar.h |    2 +-
 2 files changed, 7 insertions(+), 9 deletions(-)
---
diff --git a/src/bar.c b/src/bar.c
index 6cfdffc..2930459 100644
--- a/src/bar.c
+++ b/src/bar.c
@@ -422,14 +422,16 @@ static gboolean
 Statusbar_Stop_Timer (void)
 {
     gtk_statusbar_pop(GTK_STATUSBAR(StatusBar),StatusBarContext);
-    return FALSE;    /* Stop the timer */
+    return G_SOURCE_REMOVE;
 }
 
 static void
 Statusbar_Start_Timer (void)
 {
     Statusbar_Remove_Timer ();
-    StatusbarTimerId = g_timeout_add(4000,(GSourceFunc)Statusbar_Stop_Timer,NULL);
+    StatusbarTimerId = g_timeout_add_seconds (4,
+                                              (GSourceFunc)Statusbar_Stop_Timer,
+                                              NULL);
 }
 
 static void
@@ -447,17 +449,13 @@ Statusbar_Remove_Timer (void)
  *  - with_timer: if TRUE, the message will be displayed during 4s
  *                if FALSE, the message will be displayed up to the next posted message
  */
-void Statusbar_Message (gchar *message, gint with_timer)
+void
+Statusbar_Message (const gchar *message, gboolean with_timer)
 {
     gchar *msg_temp;
 
     g_return_if_fail (StatusBar != NULL);
 
-    /* Validate UTF8 */
-    /*if (!g_utf8_validate(message, -1, NULL))
-        msg_temp = convert_to_utf8(message);
-    else
-        msg_temp = g_strdup(message);*/
     msg_temp = Try_To_Validate_Utf8_String(message);
     
     /* Remove a running timer */
diff --git a/src/bar.h b/src/bar.h
index 635a5bc..c2b4306 100644
--- a/src/bar.h
+++ b/src/bar.h
@@ -160,7 +160,7 @@ struct _Action_Pair {
 
 void       Create_UI           (GtkWidget **menubar, GtkWidget **toolbar);
 GtkWidget *Create_Status_Bar   (void);
-void       Statusbar_Message   (gchar *message, gint with_timer);
+void Statusbar_Message (const gchar *message, gboolean with_timer);
 GtkWidget *Create_Progress_Bar (void);
 
 void Check_Menu_Item_Update_Browse_Subdir  (void);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]