Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.6, 0.7, and 0.7.1

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.

Changeset dfd591e4cef1

Parent 38bd21f49518

by Peer Sommerlund

Changes to one file · Browse files at dfd591e4cef1 Showing diff from parent 38bd21f49518 Diff from another changeset...

 
387
388
389
390
391
392
393
394
395
396
 
 
 
 
 
397
398
399
 
387
388
389
 
 
 
 
 
 
 
390
391
392
393
394
395
396
397
@@ -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 = []