Changeset 228fab934a15…
Parent 304d8b154a9e…
by
Changes to 2 files · Browse files at 228fab934a15 Showing diff from parent 304d8b154a9e Diff from another changeset...
@@ -93,7 +93,9 @@ self._DoCreateIcons()
def _DoCreateIcons(self):
- SetIcon(self.hwnd, "hg.ico", add=True)
+ show, highlight = get_config()
+ if show:
+ SetIcon(self.hwnd, "hg.ico", add=True)
# start namepipe server for hg status
self.start_pipe_server()
@@ -244,16 +246,19 @@requests = Queue.Queue(0)
def get_config():
+ show_taskbaricon = True
hgighlight_taskbaricon = True
try:
from _winreg import HKEY_CURRENT_USER, OpenKey, QueryValueEx
hkey = OpenKey(HKEY_CURRENT_USER, r'Software\TortoiseHg')
t = ('1', 'True')
+ try: show_taskbaricon = QueryValueEx(hkey, 'ShowTaskbarIcon')[0] in t
+ except EnvironmentError: pass
try: hgighlight_taskbaricon = QueryValueEx(hkey, 'HighlightTaskbarIcon')[0] in t
except EnvironmentError: pass
except (ImportError, WindowsError):
pass
- return hgighlight_taskbaricon
+ return (show_taskbaricon, hgighlight_taskbaricon)
def update(args, hwnd):
batch = []
@@ -261,8 +266,8 @@ print "got update request %s (first in batch)" % r
batch.append(r)
print "wait a bit for additional requests..."
- highlight = get_config()
- if highlight:
+ show, highlight = get_config()
+ if show and highlight:
SetIcon(hwnd, "hgB.ico")
time.sleep(0.2)
deferred_requests = []
@@ -283,7 +288,7 @@ msg = "processing batch with %i update requests"
print msg % len(batch)
update_batch(batch)
- if highlight:
+ if show and highlight:
SetIcon(hwnd, "hg.ico")
def remove(args):
@@ -431,8 +436,16 @@ # see http://www.jrsoftware.org/iskb.php?mutexsessions
installmutex1 = win32event.CreateMutex(sa, 1, INSTALLMUTEXNAME)
installmutex2 = win32event.CreateMutex(sa, 1, 'Global\\' + INSTALLMUTEXNAME)
- if len(args) >= 1:
- logger.setfile(args[0])
+
+ logfilename = None
+ for arg in args:
+ if arg[0] == '-':
+ pass
+ else:
+ logfilename = arg
+ if logfilename:
+ logger.setfile(logfilename)
+
w=MainWindow()
PumpMessages()
|
@@ -120,6 +120,8 @@ taskbarframe.add(taskbarbox)
hbox = gtk.HBox()
taskbarbox.pack_start(hbox, False, False, 2)
+ self.show_taskbaricon = gtk.CheckButton(_('Show Icon'))
+ hbox.pack_start(self.show_taskbaricon, False, False, 2)
self.hgighlight_taskbaricon = gtk.CheckButton(_('Highlight Icon'))
hbox.pack_start(self.hgighlight_taskbaricon, False, False, 2)
@@ -133,6 +135,9 @@ tips.set_tip(self.lclonly, tooltip)
self.lclonly.connect('toggled', lambda x: self.apply.set_sensitive(True))
+ tooltip = _('Show the taskbar icon (restart needed)')
+ tips.set_tip(self.show_taskbaricon, tooltip)
+ self.show_taskbaricon.connect('toggled', lambda x: self.apply.set_sensitive(True))
tooltip = _('Highlight the taskbar icon during activity')
tips.set_tip(self.hgighlight_taskbaricon, tooltip)
self.hgighlight_taskbaricon.connect('toggled', lambda x: self.apply.set_sensitive(True))
@@ -187,6 +192,7 @@ overlayenable = True
localdisks = False
promoteditems = 'commit'
+ show_taskbaricon = True
hgighlight_taskbaricon = True
try:
from _winreg import HKEY_CURRENT_USER, OpenKey, QueryValueEx
@@ -196,6 +202,8 @@ except EnvironmentError: pass
try: localdisks = QueryValueEx(hkey, 'LocalDisksOnly')[0] in t
except EnvironmentError: pass
+ try: show_taskbaricon = QueryValueEx(hkey, 'ShowTaskbarIcon')[0] in t
+ except EnvironmentError: pass
try: hgighlight_taskbaricon = QueryValueEx(hkey, 'HighlightTaskbarIcon')[0] in t
except EnvironmentError: pass
try: promoteditems = QueryValueEx(hkey, 'PromotedItems')[0]
@@ -206,6 +214,7 @@ self.ovenable.set_active(overlayenable)
self.lclonly.set_active(localdisks)
self.lclonly.set_sensitive(overlayenable)
+ self.show_taskbaricon.set_active(show_taskbaricon)
self.hgighlight_taskbaricon.set_active(hgighlight_taskbaricon)
promoted = [pi.strip() for pi in promoteditems.split(',')]
@@ -223,6 +232,7 @@ def store_shell_configs(self):
overlayenable = self.ovenable.get_active() and '1' or '0'
localdisks = self.lclonly.get_active() and '1' or '0'
+ show_taskbaricon = self.show_taskbaricon.get_active() and '1' or '0'
hgighlight_taskbaricon = self.hgighlight_taskbaricon.get_active() and '1' or '0'
promoted = []
for row in self.topmmodel:
@@ -232,6 +242,7 @@ hkey = CreateKey(HKEY_CURRENT_USER, r"Software\TortoiseHg")
SetValueEx(hkey, 'EnableOverlays', 0, REG_SZ, overlayenable)
SetValueEx(hkey, 'LocalDisksOnly', 0, REG_SZ, localdisks)
+ SetValueEx(hkey, 'ShowTaskbarIcon', 0, REG_SZ, show_taskbaricon)
SetValueEx(hkey, 'HighlightTaskbarIcon', 0, REG_SZ, hgighlight_taskbaricon)
SetValueEx(hkey, 'PromotedItems', 0, REG_SZ, ','.join(promoted))
except ImportError:
|
Loading...