# HG changeset patch
# User Adrian Buehlmann <adr...@cadifra.com>
# Date 1256745984 -3600
# Branch stable
# Node ID a0a26e827c8804e1cdc63d5baa055a12b1b066d8
# Parent  d3d32fce6f9c0f1ab5b0dcbee3893a021b4b29a5
statusbar: do not apply idle text assignments between begin() and end()

Fixes "Running..." text not appearing on Refresh if a patch was applied.

Fixed by introducing a state 'self.started', which is set to True when
begin() is called and reset to False on end().

If set_idle_text is called after begin() but before end(), the
msg is not applied (only saved).

diff --git a/tortoisehg/hgtk/statusbar.py b/tortoisehg/hgtk/statusbar.py
--- a/tortoisehg/hgtk/statusbar.py
+++ b/tortoisehg/hgtk/statusbar.py
@@ -15,6 +15,7 @@ class StatusBar(gtk.HBox):
     def __init__(self, extra=None):
         gtk.HBox.__init__(self)
         self.idle_text = None
+        self.started = False
 
         self.pbar = gtk.ProgressBar()
         self.sttext = gtk.Label("")
@@ -45,9 +46,11 @@ class StatusBar(gtk.HBox):
         self.pbox.set_child_visible(True)
         self.pbox.map()
         self.set_status_text(msg)
+        self.started = True 
         self._timeout_event = gobject.timeout_add(timeout, self._pulse_timer)
 
     def end(self, msg=None, unmap=True):
+        self.started = False 
         gobject.source_remove(self._timeout_event)
 
         t = ''
@@ -67,7 +70,7 @@ class StatusBar(gtk.HBox):
 
     def set_idle_text(self, msg):
         self.idle_text = msg
-        if msg:
+        if msg and not self.started:
             self.set_status_text(msg)
 
     def set_right1_text(self, msg):

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Tortoisehg-develop mailing list
Tortoisehg-develop@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tortoisehg-develop

Reply via email to