Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 1.0, 1.0.1, and 1.0.2

shellconf: add option to hide taskbar icon

default is: show it

thgtaskbar.exe needs to be restarted to take effect

Changeset 228fab934a15

Parent 304d8b154a9e

by Adrian Buehlmann

Changes to 2 files · Browse files at 228fab934a15 Showing diff from parent 304d8b154a9e Diff from another changeset...

Change 1 of 5 Show Entire File thgtaskbar.py Stacked
 
93
94
95
96
 
 
 
97
98
99
 
244
245
246
 
247
248
249
250
251
 
 
252
253
254
255
256
 
257
258
259
 
261
262
263
264
265
 
 
266
267
268
 
283
284
285
286
 
287
288
289
 
431
432
433
434
435
 
 
 
 
 
 
 
 
 
 
436
437
438
 
93
94
95
 
96
97
98
99
100
101
 
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
 
261
262
263
264
 
266
267
268
 
 
269
270
271
272
273
 
288
289
290
 
291
292
293
294
 
436
437
438
 
 
439
440
441
442
443
444
445
446
447
448
449
450
451
@@ -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
121
122
 
 
123
124
125
 
133
134
135
 
 
 
136
137
138
 
187
188
189
 
190
191
192
 
196
197
198
 
 
199
200
201
 
206
207
208
 
209
210
211
 
223
224
225
 
226
227
228
 
232
233
234
 
235
236
237
 
120
121
122
123
124
125
126
127
 
135
136
137
138
139
140
141
142
143
 
192
193
194
195
196
197
198
 
202
203
204
205
206
207
208
209
 
214
215
216
217
218
219
220
 
232
233
234
235
236
237
238
 
242
243
244
245
246
247
248
@@ -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: