# HG changeset patch
# User Adrian Buehlmann <adr...@cadifra.com>
# Date 1255647267 -7200
# Node ID 25c4f961ddf3d45b245690abc63bf3d4e37feb66
# Parent  edd0dfad77becccd52694486209b4aee7c5a2b5d
history: override gdialog's show_toolbar_on_start

Previously, the toolbar was visisble for a short period on
startup of the dialog even if it must be hidden per the settings.

This eliminates the hackish call to gtklib.idle_add_single_call
in prepare_display.

diff --git a/tortoisehg/hgtk/history.py b/tortoisehg/hgtk/history.py
--- a/tortoisehg/hgtk/history.py
+++ b/tortoisehg/hgtk/history.py
@@ -257,7 +257,7 @@ class GLog(gdialog.GDialog):
 
     def toggle_show_toolbar(self, button):
         self.show_toolbar = button.get_active()
-        self.toolbar.set_property('visible', self.show_toolbar)
+        self._show_toolbar(self.show_toolbar)
 
     def more_clicked(self, button, data=None):
         self.graphview.next_revision_batch(self.limit)
@@ -452,10 +452,6 @@ class GLog(gdialog.GDialog):
             opts['pats'] = self.pats
         self.reload_log(**opts)
 
-        # unfortunately, idle_add is needed here
-        gtklib.idle_add_single_call(self.toolbar.set_property, 
-            'visible', self.show_toolbar)
-
         self.filterbox.set_property('visible', self.show_filterbar)
         self.filterbox.set_no_show_all(True)
         self.syncbox.set_property('visible', self.show_syncbar)
@@ -552,6 +548,9 @@ class GLog(gdialog.GDialog):
         default_co = 'graph rev id branch msg user date utc age tag'
         self.column_order = settings.get('column-order', default_co)
 
+    def show_toolbar_on_start(self):
+        return self.show_toolbar
+
     def refresh_model(self):
         'Refresh data in the history model, without reloading graph'
         if self.graphview.model:

------------------------------------------------------------------------------
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