Changeset 35da5d117b02…
Parent 6647668003e6…
by
Changes to one file · Browse files at 35da5d117b02 Showing diff from parent 6647668003e6 Diff from another changeset...
|
@@ -55,10 +55,6 @@ ' commit dialogs.'
' Default: False (show diffs to right of file list)')))
-shellcmds = '''about add clone commit datamine init log merge recovery
-shelve synch status thgstatus userconfig repoconfig guess remove rename
-revert serve update vdiff'''.split()
-
_commit_info = (
(_('Username'), 'ui.username', [],
_('Name associated with commits')),
@@ -490,12 +486,6 @@ self.diff_frame = self.add_page(notebook, _('Diff'))
self.fill_frame(self.diff_frame, _diff_info)
- if os.name == 'nt':
- self.shellframe = self.add_page(notebook, _('Shell Ext'))
- self.fill_shell_frame(self.shellframe)
- self.shellframe.set_sensitive(not configrepo)
- else:
- self.shellframe = None
self.configrepo = configrepo
# Force dialog into clean state in the beginning
@@ -524,8 +514,6 @@ self.rcpath = util.user_rcpath()
self.set_title(_('TortoiseHg Configure User-Global Settings'))
gtklib.set_tortoise_icon(self, 'settings_user.ico')
- if self.shellframe:
- self.shellframe.set_sensitive(not self.configrepo)
self.ini = self.load_config(self.rcpath)
self.refresh_vlist()
self.pathdata.clear()
@@ -786,113 +774,6 @@ text = ' '.join(tooltip.splitlines())
buffer.set_text(text)
- def fill_shell_frame(self, frame):
- 'Fill special tab for shell extension configurations'
- vbox = gtk.VBox()
- frame.add(vbox)
-
- ovframe = gtk.Frame(_('Overlay configuration'))
- ovframe.set_border_width(10)
- vbox.pack_start(ovframe, False, False, 2)
- ovcvbox = gtk.VBox()
- ovframe.add(ovcvbox)
- hbox = gtk.HBox()
- ovcvbox.pack_start(hbox, False, False, 2)
- self.ovenable = gtk.CheckButton(_('Enable overlays'))
- hbox.pack_start(self.ovenable, False, False, 2)
- self.ovenable.connect('toggled', self.ovenable_toggled)
- self.lclonly = gtk.CheckButton(_('Local disks only'))
- hbox.pack_start(self.lclonly, False, False, 2)
-
- cmframe = gtk.Frame(_('Context menu configuration'))
- cmframe.set_border_width(10)
- vbox.pack_start(cmframe, False, False, 2)
- cmcvbox = gtk.VBox()
- cmframe.add(cmcvbox)
-
- descframe = gtk.Frame(_('Description'))
- descframe.set_border_width(10)
- desctext = gtk.TextView()
- desctext.set_wrap_mode(gtk.WRAP_WORD)
- desctext.set_editable(False)
- desctext.set_sensitive(False)
- scrolledwindow = gtk.ScrolledWindow()
- scrolledwindow.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
- scrolledwindow.add(desctext)
- descframe.add(scrolledwindow)
- vbox.pack_start(gtk.Label(), True, True, 2)
- vbox.pack_start(descframe, False, False, 2)
-
- lbl = gtk.Label(_('Promote menu items to the top menu'))
- cmcvbox.pack_start(lbl, False, False, 2)
-
- rows = (len(shellcmds) + 2) / 3
- table = gtk.Table(rows, 3, False)
- cmcvbox.pack_start(table, False, False, 2)
- self.cmptoggles = {}
- for i, cmd in enumerate(shellcmds):
- row, col = divmod(i, 3)
- check = gtk.CheckButton(cmd)
- table.attach(check, col, col+1,
- row, row+1, gtk.FILL|gtk.EXPAND, 0, 4, 3)
- self.cmptoggles[cmd] = check
- tooltip = _('Promote menu item "%s" to top menu') % cmd
- check.connect('toggled', self.dirty_event)
- check.connect('focus-in-event', self.set_help,
- desctext.get_buffer(), tooltip)
-
- tooltip = _('Enable/Disable the overlay icons globally')
- self.ovenable.connect('focus-in-event', self.set_help,
- desctext.get_buffer(), tooltip)
- tooltip = _('Only enable overlays on local disks')
- self.lclonly.connect('toggled', self.dirty_event)
- self.lclonly.connect('focus-in-event', self.set_help,
- desctext.get_buffer(), tooltip)
- self.load_shell_configs()
-
- def load_shell_configs(self):
- overlayenable = True
- localdisks = False
- promoteditems = 'commit'
- try:
- from _winreg import HKEY_CURRENT_USER, OpenKey, QueryValueEx
- hkey = OpenKey(HKEY_CURRENT_USER, r"Software\TortoiseHg")
- t = ('1', 'True')
- try: overlayenable = QueryValueEx(hkey, 'EnableOverlays')[0] in t
- except EnvironmentError: pass
- try: localdisks = QueryValueEx(hkey, 'LocalDisksOnly')[0] in t
- except EnvironmentError: pass
- try: promoteditems = QueryValueEx(hkey, 'PromotedItems')[0]
- except EnvironmentError: pass
- except (ImportError, WindowsError):
- pass
-
- self.ovenable.set_active(overlayenable)
- self.lclonly.set_active(localdisks)
- promoted = [pi.strip() for pi in promoteditems.split(',')]
- for cmd, check in self.cmptoggles.iteritems():
- check.set_active(cmd in promoted)
-
- def save_shell_configs(self):
- overlayenable = self.ovenable.get_active() and '1' or '0'
- localdisks = self.lclonly.get_active() and '1' or '0'
- promoted = []
- for cmd, check in self.cmptoggles.iteritems():
- if check.get_active():
- promoted.append(cmd)
- try:
- from _winreg import HKEY_CURRENT_USER, CreateKey, SetValueEx, REG_SZ
- hkey = CreateKey(HKEY_CURRENT_USER, r"Software\TortoiseHg")
- SetValueEx(hkey, 'EnableOverlays', 0, REG_SZ, overlayenable)
- SetValueEx(hkey, 'LocalDisksOnly', 0, REG_SZ, localdisks)
- SetValueEx(hkey, 'PromotedItems', 0, REG_SZ, ','.join(promoted))
- except ImportError:
- pass
-
- def ovenable_toggled(self, check):
- self.lclonly.set_sensitive(check.get_active())
- self.dirty_event()
-
def fill_frame(self, frame, info):
widgets = []
@@ -1095,8 +976,6 @@ dialog.error_dialog(self, _('Unable to write configuration file'),
str(e))
- if not self.configrepo and os.name == 'nt':
- self.save_shell_configs()
self._btn_apply.set_sensitive(False)
self.dirty = False
return 0
|
Loading...