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

hgtk: introduce a shellconf command

rename taskbarui to shellconf, remove shellconfig.py stub

Changeset d59692733904

Parent 80328fcaac52

by Steve Borho

Changes to 3 files · Browse files at d59692733904 Showing diff from parent 80328fcaac52 Diff from another changeset...

Change 1 of 1 Show Entire File shellconfig.py Stacked
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
@@ -1,31 +0,0 @@
-# configure TortoiseHg shell extension settings - -import os -import sys -import gtk - -from tortoisehg.util.i18n import agettext as _ -from tortoisehg.util import paths -from tortoisehg.hgtk import taskbarui -# import hgtk for signal setup side-effects -from tortoisehg.hgtk import hgtk - -if hasattr(sys, "frozen"): - # Insert PATH to binary installer gtk directory - gtkpath = os.path.join(paths.bin_path, 'gtk') - os.environ['PATH'] = os.pathsep.join([gtkpath, os.environ['PATH']]) - # Give stdout/stderr closed attributes to prevent ui.py errors - sys.stdout.closed = True - sys.stderr.closed = True - -def main(): - dlg = taskbarui.TaskBarUI() - dlg.show_all() - dlg.connect('destroy', gtk.main_quit) - gtk.gdk.threads_init() - gtk.gdk.threads_enter() - gtk.main() - gtk.gdk.threads_leave() - -if __name__=='__main__': - main()
 
30
31
32
33
34
 
 
35
36
37
 
329
330
331
 
 
 
 
 
332
333
334
 
708
709
710
 
 
 
 
 
30
31
32
 
 
33
34
35
36
37
 
329
330
331
332
333
334
335
336
337
338
339
 
713
714
715
716
717
718
719
@@ -30,8 +30,8 @@
 except ImportError:   config_nofork = None   -nonrepo_commands = '''userconfig clone debugcomplete init about help -version thgstatus serve''' +nonrepo_commands = '''userconfig shellconfig clone debugcomplete init +about help version thgstatus serve'''    # Add TortoiseHg signals, hooked to key accelerators in gtklib  for sig in ('copy-clipboard', 'thg-diff', 'thg-parent', 'thg-rename', @@ -329,6 +329,11 @@
  from tortoisehg.hgtk.thgconfig import run   gtkrun(run, ui, *pats, **opts)   +def shellconfig(ui, *pats, **opts): + """Explorer extension configuration editor""" + from tortoisehg.hgtk.shellconf import run + gtkrun(run, ui, *pats, **opts) +  def rename(ui, *pats, **opts):   """rename a single file or directory"""   if not pats or len(pats) > 2: @@ -708,3 +713,7 @@
  ('hgtk archive')),   "^strip": (strip, [], ('hgtk strip [REV]')),  } + +if os.name == 'nt': + # TODO: extra detection to determine if shell extension is installed + table['shellconfig'] = (shellconfig, [], _('hgtk shellconfig'))
Change 1 of 3 Show Entire File tortoisehg/​hgtk/​shellconf.py Stacked
renamed from tortoisehg/hgtk/taskbarui.py
 
1
 
2
3
4
 
10
11
12
13
 
14
15
16
17
18
19
20
 
21
22
23
 
302
303
304
 
 
 
 
 
1
2
3
4
 
10
11
12
 
13
14
15
 
 
 
 
 
16
17
18
19
 
298
299
300
301
302
303
@@ -1,4 +1,4 @@
-# taskbarui.py - User interface for the TortoiseHg shell extension settings +# shellconf.py - User interface for the TortoiseHg shell extension settings  #  # Copyright 2009 Steve Borho <steve@borho.org>  # @@ -10,14 +10,10 @@
 import gobject    from tortoisehg.util.i18n import _ -from tortoisehg.util import hglib, settings, menuthg +from tortoisehg.util import menuthg  from tortoisehg.hgtk import gtklib   -shellcmds = '''about add clone commit datamine init log recovery -shelve synch status thgstatus userconf repoconf remove rename -revert serve update vdiff'''.split() - -class TaskBarUI(gtk.Window): +class ShellConfigWindow(gtk.Window):   'User interface for the TortoiseHg taskbar application'   def __init__(self):   'Initialize the Dialog' @@ -302,3 +298,6 @@
  def ovenable_toggled(self, check):   self.lclonly.set_sensitive(check.get_active())   self.apply.set_sensitive(True) + +def run(ui, *pats, **opts): + return ShellConfigWindow()