Changeset 5619cc29cef8…
Parent 23351825f299…
by
Changes to 3 files · Browse files at 5619cc29cef8 Showing diff from parent 23351825f299 Diff from another changeset...
@@ -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,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:
|
|
@@ -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'
|
Loading...