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

thgconfig: remove shell extension configuration tab

Changeset 35da5d117b02

Parent 6647668003e6

by Steve Borho

Changes to one file · Browse files at 35da5d117b02 Showing diff from parent 6647668003e6 Diff from another changeset...

 
55
56
57
58
59
60
61
62
63
64
 
490
491
492
493
494
495
496
497
498
499
500
501
 
524
525
526
527
528
529
530
531
 
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
 
1095
1096
1097
1098
1099
1100
1101
1102
 
55
56
57
 
 
 
 
58
59
60
 
486
487
488
 
 
 
 
 
 
489
490
491
 
514
515
516
 
 
517
518
519
 
774
775
776
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
777
778
779
 
976
977
978
 
 
979
980
981
@@ -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