Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.4rc1, 0.4rc2, and 0.4rc3

tortoise: new module thgconfig

Changeset 5619cc29cef8

Parent 23351825f299

by Adrian Buehlmann

Changes to 3 files · Browse files at 5619cc29cef8 Showing diff from parent 23351825f299 Diff from another changeset...

 
18
19
20
21
 
22
23
24
 
431
432
433
434
435
436
437
 
 
438
439
440
441
 
442
443
444
 
18
19
20
 
21
22
23
24
 
431
432
433
 
 
 
 
434
435
436
437
438
 
439
440
441
442
@@ -18,7 +18,7 @@
 from mercurial import hg  from mercurial import repo as _repo  from thgutil import * -import iconoverlay +import thgconfig    # FIXME: quick workaround traceback caused by missing "closed"  # attribute in win32trace. @@ -431,14 +431,12 @@
  self._run_dialog('config')     def _config_update_shell(self, parent_window): - # update overlay icons display setting - iconoverlay.get_show_icons() - show_overlay = iconoverlay.show_overlay_icons and 'enabled' or 'disabled' - + thgconfig.read() + show_overlay = thgconfig.show_overlay_icons and 'enabled' or 'disabled'   # feedback   title = "TortoiseHg Shell Settings"   msg = "Shell settings updated:\n\n" - msg += "Overlay icons is " + show_overlay + msg += "Overlay icons are " + show_overlay   win32ui.MessageBox(msg, title, win32con.MB_OK|win32con.MB_ICONINFORMATION)     def _vdiff(self, parent_window):
 
10
11
12
 
13
14
15
 
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
 
97
98
99
100
101
 
102
103
104
 
251
252
253
254
255
256
257
 
 
258
259
260
 
10
11
12
13
14
15
16
 
38
39
40
 
 
 
 
 
 
 
 
 
41
42
43
 
89
90
91
 
 
92
93
94
95
 
242
243
244
 
 
 
 
245
246
247
248
249
@@ -10,6 +10,7 @@
 from mercurial import hg, cmdutil, util  from mercurial import repo as _repo  import thgutil +import thgconfig  import sys    # FIXME: quick workaround traceback caused by missing "closed" @@ -37,15 +38,6 @@
 S_OK = 0  S_FALSE = 1   -# overlay icons display setting -show_overlay_icons = False - -def get_show_icons(): - global show_overlay_icons - overlayicons = ui.ui().config('tortoisehg', 'overlayicons', '') - print "tortoisehg.overlayicons = ", overlayicons - show_overlay_icons = overlayicons != 'disabled' -  def subdirs(p):   oldp = ""   if os.path.isdir(p): @@ -97,8 +89,7 @@
  ]     def GetOverlayInfo(self): - # retrieve overlay icons display settting - get_show_icons() + thgconfig.read()     icon = thgutil.get_icon_path("status", self.icon)   print "icon = ", icon @@ -251,10 +242,8 @@
  print "%s: %s" % (path, status)   return status   - def IsMemberOf(self, path, attrib): - global show_overlay_icons - - if not show_overlay_icons: + def IsMemberOf(self, path, attrib): + if not thgconfig.show_overlay_icons:   return S_FALSE     if self._get_state(path) == self.state:
Change 1 of 1 Show Entire File tortoise/​thgconfig.py Stacked
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
@@ -0,0 +1,14 @@
+# Published under the GNU GPL, v2 or later. +# Copyright (C) 2007 Henry Ludemann <misc@hl.id.au> +# Copyright (C) 2007 TK Soh <teekaysoh@gmail.com> + +from mercurial import ui + +# overlay icons display setting +show_overlay_icons = False + +def read(): + global show_overlay_icons + overlayicons = ui.ui().config('tortoisehg', 'overlayicons', '') + print "tortoisehg.overlayicons = ", overlayicons + show_overlay_icons = overlayicons != 'disabled'