gtranslator r3912 - in trunk: . src



Author: psanxiao
Date: Thu Jan  8 18:31:48 2009
New Revision: 3912
URL: http://svn.gnome.org/viewvc/gtranslator?rev=3912&view=rev

Log:
	* src/statusbar.{ch}:
	* src/window.c:
	Now the statusbar is cleared when the last
	file is closed. (Fixes bug #562129)

Modified:
   trunk/ChangeLog
   trunk/src/statusbar.c
   trunk/src/statusbar.h
   trunk/src/window.c

Modified: trunk/src/statusbar.c
==============================================================================
--- trunk/src/statusbar.c	(original)
+++ trunk/src/statusbar.c	Thu Jan  8 18:31:48 2009
@@ -347,3 +347,16 @@
 					       percentage);
 	}
 }
+
+/**
+ * gtranslator_statusbar_clear_progress_bar:
+ * @statusbar: a #GtranslatorStatusbar
+ *
+ * Clear the progress bar
+ */
+void
+gtranslator_statusbar_clear_progress_bar (GtranslatorStatusbar *statusbar)
+{
+  gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (statusbar->priv->progress_bar),
+				 0.0);
+}

Modified: trunk/src/statusbar.h
==============================================================================
--- trunk/src/statusbar.h	(original)
+++ trunk/src/statusbar.h	Thu Jan  8 18:31:48 2009
@@ -82,6 +82,8 @@
 								 gdouble translated_count,
 								 gdouble messages_count);
 
+void             gtranslator_statusbar_clear_progress_bar       (GtranslatorStatusbar *statusbar);
+
 G_END_DECLS
 
 #endif

Modified: trunk/src/window.c
==============================================================================
--- trunk/src/window.c	(original)
+++ trunk/src/window.c	Thu Jan  8 18:31:48 2009
@@ -2002,7 +2002,17 @@
 				   GTK_WIDGET (tab));
 	if (i != -1)
 		gtranslator_notebook_remove_page (GTR_NOTEBOOK (window->priv->notebook), i);
-	
+
+	/*
+	 * If there is only one file opened, we have to clear the statusbar
+	 */
+	if (i == 0) 
+	  {
+	  gtranslator_statusbar_push (GTR_STATUSBAR (window->priv->statusbar),
+				      0,
+				      " ");
+	  gtranslator_statusbar_clear_progress_bar (GTR_STATUSBAR (window->priv->statusbar));
+	  }
 	set_sensitive_according_to_window (window);
 }
 



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