Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.8, 0.8.1, and 0.8.2

taskbar: add "Taskbar"/"Highlight Icon" option

Changeset 857ca9bc6f4d

Parent 6c125b90f701

by Adrian Buehlmann

Changes to 2 files · Browse files at 857ca9bc6f4d Showing diff from parent 6c125b90f701 Diff from another changeset...

 
82
83
84
 
 
 
 
 
 
 
 
 
 
85
86
87
88
89
90
 
 
 
 
 
91
92
93
 
153
154
155
 
156
157
158
 
161
162
163
 
 
164
165
166
 
168
169
170
 
171
172
173
 
175
176
177
 
178
179
180
 
184
185
186
 
187
188
189
 
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
 
168
169
170
171
172
173
174
 
177
178
179
180
181
182
183
184
 
186
187
188
189
190
191
192
 
194
195
196
197
198
199
200
 
204
205
206
207
208
209
210
@@ -82,12 +82,27 @@
  tips.set_tip(check, tooltip)   check.connect('toggled', lambda x: apply.set_sensitive(True))   + taskbarframe = gtk.Frame(_('Taskbar')) + taskbarframe.set_border_width(2) + settingsvbox.pack_start(taskbarframe, False, False, 2) + taskbarbox = gtk.VBox() + taskbarframe.add(taskbarbox) + hbox = gtk.HBox() + taskbarbox.pack_start(hbox, False, False, 2) + self.hgighlight_taskbaricon = gtk.CheckButton(_('Highlight Icon')) + hbox.pack_start(self.hgighlight_taskbaricon, False, False, 2) +   tooltip = _('Enable/Disable the overlay icons globally')   tips.set_tip(self.ovenable, tooltip)   self.ovenable.connect('toggled', self.ovenable_toggled, apply)   tooltip = _('Only enable overlays on local disks')   tips.set_tip(self.lclonly, tooltip)   self.lclonly.connect('toggled', lambda x: 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: apply.set_sensitive(True)) +   self.load_shell_configs()     frame = self.add_page(notebook, _('Event Log')) @@ -153,6 +168,7 @@
  overlayenable = True   localdisks = False   promoteditems = 'commit' + hgighlight_taskbaricon = True   try:   from _winreg import HKEY_CURRENT_USER, OpenKey, QueryValueEx   hkey = OpenKey(HKEY_CURRENT_USER, r'Software\TortoiseHg') @@ -161,6 +177,8 @@
  except EnvironmentError: pass   try: localdisks = QueryValueEx(hkey, 'LocalDisksOnly')[0] in t   except EnvironmentError: pass + try: hgighlight_taskbaricon = QueryValueEx(hkey, 'HighlightTaskbarIcon')[0] in t + except EnvironmentError: pass   try: promoteditems = QueryValueEx(hkey, 'PromotedItems')[0]   except EnvironmentError: pass   except (ImportError, WindowsError): @@ -168,6 +186,7 @@
    self.ovenable.set_active(overlayenable)   self.lclonly.set_active(localdisks) + self.hgighlight_taskbaricon.set_active(hgighlight_taskbaricon)   promoted = [pi.strip() for pi in promoteditems.split(',')]   for cmd, check in self.cmptoggles.iteritems():   check.set_active(cmd in promoted) @@ -175,6 +194,7 @@
  def applyclicked(self, button):   overlayenable = self.ovenable.get_active() and '1' or '0'   localdisks = self.lclonly.get_active() and '1' or '0' + hgighlight_taskbaricon = self.hgighlight_taskbaricon.get_active() and '1' or '0'   promoted = []   for cmd, check in self.cmptoggles.iteritems():   if check.get_active(): @@ -184,6 +204,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, 'HighlightTaskbarIcon', 0, REG_SZ, hgighlight_taskbaricon)   SetValueEx(hkey, 'PromotedItems', 0, REG_SZ, ','.join(promoted))   except ImportError:   pass
Change 1 of 2 Show Entire File thgtaskbar.py Stacked
 
249
250
251
 
 
 
 
 
 
 
 
 
 
 
 
252
253
254
255
256
257
258
 
 
 
259
260
261
 
275
276
277
278
 
 
279
280
281
 
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
 
270
271
272
273
274
275
 
289
290
291
 
292
293
294
295
296
@@ -249,13 +249,27 @@
   requests = Queue.Queue(0)   +def get_config(): + hgighlight_taskbaricon = True + try: + from _winreg import HKEY_CURRENT_USER, OpenKey, QueryValueEx + hkey = OpenKey(HKEY_CURRENT_USER, r'Software\TortoiseHg') + t = ('1', 'True') + try: hgighlight_taskbaricon = QueryValueEx(hkey, 'HighlightTaskbarIcon')[0] in t + except EnvironmentError: pass + except (ImportError, WindowsError): + pass + return hgighlight_taskbaricon +  def update(args, hwnd):   batch = []   r = args[0]   print "got update request %s (first in batch)" % r   batch.append(r)   print "wait a bit for additional requests..." - SetIcon(hwnd, "hgB.ico") + highlight = get_config() + if highlight: + SetIcon(hwnd, "hgB.ico")   time.sleep(0.2)   deferred_requests = []   try: @@ -275,7 +289,8 @@
  msg = "processing batch with %i update requests"   print msg % len(batch)   update_batch(batch) - SetIcon(hwnd, "hg.ico") + if highlight: + SetIcon(hwnd, "hg.ico")    def remove(args):   path = args[0]