Don't show url combo if there is just one target
Created originally on Bitbucket by schlamar (Marc Schlaich)
The url combo in the sync toolbar is really annoying if you have only one push/pull target.
I already tried to hide it with the following patch but it seems that setVisible
is ignored:
#!patch
diff -r 2ac7865e2e6d tortoisehg/hgqt/workbench.py
--- a/tortoisehg/hgqt/workbench.py Sun May 12 21:15:29 2013 +0900
+++ b/tortoisehg/hgqt/workbench.py Tue May 14 11:58:22 2013 +0200
@@ -379,6 +379,11 @@
'repository has been switched, fill urlCombo with URLs'
aliases = [hglib.tounicode(alias)
for alias, path in repo.ui.configitems('paths')]
+ if len(aliases) == 1:
+ self.urlCombo.setVisible(False)
+ return
+
+ self.urlCombo.setVisible(True)
if 'default' in aliases:
aliases.remove('default')
aliases.insert(0, 'default')
I have no PyQt experience so far, but if someone can put me in the right direction I might be able to do it on my own.
A further enhancement would be to make this configurable with three options:
- auto hide it if only 1 target
- on
- off