# HG changeset patch
# User Peer Sommerlund <[EMAIL PROTECTED]>
# Date 1228859205 -3600
# Node ID dfd591e4cef1f25a4ce13fd02808ff861de7dd4f
# Parent  38bd21f4951809f5d685e1576c4e71e3dc9164be
thgconfig: Disable Test button when configuring user preferences

Previously, the button pops up a warning when trying the operation
without a repository. By disabling the button when it will not work,
the user is spared a frustration.

diff -r 38bd21f49518 -r dfd591e4cef1 hggtk/thgconfig.py
--- a/hggtk/thgconfig.py        Tue Dec 09 22:46:45 2008 +0100
+++ b/hggtk/thgconfig.py        Tue Dec 09 22:46:45 2008 +0100
@@ -387,13 +387,11 @@
 
     def refresh_path_list(self):
         """Update sensitivity of buttons"""
-        if ( len(self.pathdata) 
-        and self.pathtree.get_selection().count_selected_rows() ):
-            self._delpathbutton.set_sensitive(True)
-            self._testpathbutton.set_sensitive(True)
-        else:
-            self._delpathbutton.set_sensitive(False)
-            self._testpathbutton.set_sensitive(False)
+        path_selected = ( len(self.pathdata) > 0
+            and self.pathtree.get_selection().count_selected_rows() > 0)
+        repo_available = self.root is not None
+        self._delpathbutton.set_sensitive(path_selected)
+        self._testpathbutton.set_sensitive(repo_available and path_selected)
 
     def fill_frame(self, frame, info):
         widgets = []

------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
Tortoisehg-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tortoisehg-develop

Reply via email to