Changeset e964c1700832…
Parent a6a6677f570c…
by
Changes to one file · Browse files at e964c1700832 Showing diff from parent a6a6677f570c Diff from another changeset...
@@ -270,6 +270,7 @@ def get_config():
show_taskbaricon = True
hgighlight_taskbaricon = True
+ version2cmenu = False
try:
from _winreg import HKEY_CURRENT_USER, OpenKey, QueryValueEx
hkey = OpenKey(HKEY_CURRENT_USER, r'Software\TortoiseHg')
@@ -278,6 +279,24 @@ except EnvironmentError: pass
try: hgighlight_taskbaricon = QueryValueEx(hkey, 'HighlightTaskbarIcon')[0] in t
except EnvironmentError: pass
+
+ # Upgrade user's context menu, once per major release
+ try: version2cmenu = QueryValueEx(hkey, 'ContextMenuVersion')[0] == '2'
+ except EnvironmentError: pass
+ try:
+ if not version2cmenu:
+ from _winreg import CreateKey, SetValueEx, REG_SZ
+ try: promoted = QueryValueEx(hkey, 'PromotedItems')[0]
+ except EnvironmentError: promoted = ''
+ plist = [i.strip() for i in promoted.split(',')]
+ hkey = CreateKey(HKEY_CURRENT_USER, r'Software\TortoiseHg')
+ if u'log' in plist:
+ idx = plist.index(u'log')
+ plist[idx] = u'workbench'
+ SetValueEx(hkey, 'PromotedItems', 0, REG_SZ, ','.join(plist))
+ SetValueEx(hkey, 'ContextMenuVersion', 0, REG_SZ, '2')
+ except EnvironmentError:
+ pass
except (ImportError, WindowsError):
pass
return (show_taskbaricon, hgighlight_taskbaricon)
|
Loading...