Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 1.1, 1.1.1, and 1.1.2

Merge with stable

Changeset 0fc6460b900b

Parents 5fd32f5a905d

Parents 7591f00c58d6

by Yuki KODAMA

Changes to 5 files · Browse files at 0fc6460b900b Showing diff from parent 5fd32f5a905d 7591f00c58d6 Diff from another changeset...

 
5
6
7
8
 
9
10
11
 
5
6
7
 
8
9
10
11
@@ -5,7 +5,7 @@
  :synopsis: Windows explorer integration    Překryvné ikonky ---------------- +----------------    TortoiseHg poskytuje vizuální vyjádření stavu souborů pomocí překryvných ikonek v okně Průzkumníka Windows. Stejné řešení lze nalézt i u jiných programů Tortoise, jako je TortoiseCVS a TortoiseSVN.  
 
1
2
3
4
5
6
7
 
 
 
 
 
1
2
3
@@ -1,7 +1,3 @@
-.. TortoiseHg documentation master file, created by - sphinx-quickstart on Tue Jul 21 13:14:26 2009. - You can adapt this file completely to your liking, but it should at least - contain the root `toctree` directive.    Vítejte v dokumentaci pro TortoiseHg!  ======================================
 
207
208
209
210
 
211
212
213
 
207
208
209
 
210
211
212
213
@@ -207,7 +207,7 @@
  Do textového pole Petr zapíše průvodní text revize, neboli changesetu: "bim mess 0"   Commit   -.. figure:: images/repos.png +.. figure:: figures/repos.png   :alt: Coordination scheme    Koloběh příkazů mezi repozitáři
 
715
716
717
 
 
 
 
718
719
720
721
 
 
 
722
723
724
 
729
730
731
 
 
732
733
734
 
776
777
778
779
 
780
781
782
 
715
716
717
718
719
720
721
722
 
 
 
723
724
725
726
727
728
 
733
734
735
736
737
738
739
740
 
782
783
784
 
785
786
787
788
@@ -715,10 +715,14 @@
  to False automatically. Default: -1 (last element).   xpad: Number. Override default 'xpad' value.   ypad: Same as 'xpad'. + xhopt: Number. Combination of gtk.EXPAND, gtk.SHRINK or gtk.FILL. + Note that this option is applied with only head element. + Default: gtk.FILL. + yhopt: Same as 'xhopt' except default value. Default: 0.   xopt: Number. Combination of gtk.EXPAND, gtk.SHRINK or gtk.FILL. - Note that This option is applied only body elements, not - header. Default: gtk.FILL|gtk.EXPAND. - yopt: Same as 'xopt' except Default: 0. + Note that this option is applied with only body elements. + Default: gtk.FILL|gtk.EXPAND. + yopt: Same as 'xopt' except default value. Default: 0.   headopts: Dictionary. Override default 'headopts' value.   bodyopts: Same as 'headopts'.   """ @@ -729,6 +733,8 @@
  t.set_property('n-rows', rows + 1)   xpad = kargs.get('xpad', self.xpad)   ypad = kargs.get('ypad', self.ypad) + xhopt = kargs.get('xhopt', gtk.FILL) + yhopt = kargs.get('yhopt', 0)   xopt = kargs.get('xopt', gtk.FILL|gtk.EXPAND)   yopt = kargs.get('yopt', 0)   hopts = kargs.get('headopts', self.headopts) @@ -776,7 +782,7 @@
  first = getwidget(widgets[0], hopts)   if isinstance(first, gtk.Label):   first.set_alignment(1, 0.5) - t.attach(first, 0, 1, rows, rows + 1, gtk.FILL, 0, xpad, ypad) + t.attach(first, 0, 1, rows, rows + 1, xhopt, yhopt, xpad, ypad)   self.headers.append(first)   rest = pack(*(widgets[1:]), **kargs)   t.attach(rest, 1, 2, rows, rows + 1, xopt, yopt, xpad, ypad)
 
254
255
256
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
257
258
259
 
644
645
646
647
 
648
649
650
651
 
 
652
653
654
 
701
702
703
 
 
704
705
706
 
709
710
711
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
712
713
714
 
915
916
917
918
 
 
 
 
919
920
 
921
922
923
924
 
925
926
927
 
983
984
985
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
986
987
988
989
990
 
991
992
993
994
995
996
 
 
997
998
999
 
1007
1008
1009
1010
 
1011
1012
1013
 
1015
1016
1017
1018
 
1019
1020
1021
 
1064
1065
1066
1067
 
1068
1069
1070
1071
1072
1073
1074
 
 
 
 
 
1075
1076
1077
 
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
 
665
666
667
 
668
669
670
671
672
673
674
675
676
677
 
724
725
726
727
728
729
730
731
 
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
 
970
971
972
 
973
974
975
976
977
 
978
979
980
981
 
982
983
984
985
 
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
 
1116
1117
1118
1119
1120
1121
 
1122
1123
1124
1125
1126
 
1134
1135
1136
 
1137
1138
1139
1140
 
1142
1143
1144
 
1145
1146
1147
1148
 
1191
1192
1193
 
1194
1195
1196
1197
1198
 
 
 
1199
1200
1201
1202
1203
1204
1205
1206
@@ -254,6 +254,27 @@
  _('Adjust the coloring style of diff lines in the changeset viewer.'   ' Default: foreground')))   +_font_info = ( + (_('Commit Message'), 'gtools.fontcomment', [], + _('Font used in changeset viewer and commit log text.' + ' Default: monospace 10')), + (_('Diff Text'), 'gtools.fontdiff', [], + _('Font used for diffs in status and commit tools.' + ' Default: monospace 10')), + (_('File List'), 'gtools.fontlist', [], + _('Font used in file lists in status and commit tools.' + ' Default: sans 9')), + (_('Command Output'), 'gtools.fontlog', [], + _('Font used in command output window.' + ' Default: monospace 10'))) + +_font_presets = { + 'win-ja': (_('Japanese on Windows'), { + 'gtools.fontcomment': 'MS Gothic 11', + 'gtools.fontdiff': 'MS Gothic 10', + 'gtools.fontlist': 'MS UI Gothic 9', + 'gtools.fontlog': 'MS Gothic 10'})} +  class PathEditDialog(gtk.Dialog):   _protocols = (('ssh', _('ssh')), ('http', _('http')),   ('https', _('https')), ('local', _('local'))) @@ -644,11 +665,13 @@
  self.add_page(_('Repository Explorer'), 'log', _log_info,   'menulog.ico')   self.add_page(_('Synchronize'), 'sync', _paths_info, 'menusynch.ico', - path=True) + extra=True)   self.add_page(_('Web Server'), 'web', _web_info, 'proxy.ico')   self.add_page(_('Proxy'), 'proxy', _proxy_info, 'general.ico')   self.add_page(_('Email'), 'email', _email_info, gtk.STOCK_GOTO_LAST)   self.add_page(_('Diff'), 'diff', _diff_info, gtk.STOCK_JUSTIFY_FILL) + self.add_page(_('Font'), 'font', _font_info, gtk.STOCK_SELECT_FONT, + extra=True, width=20)     # insert padding of between notebook and common desc frame   mainbox.pack_start(gtk.VBox(), False, False, 2) @@ -701,6 +724,8 @@
  gtklib.set_tortoise_icon(self, 'settings_user.ico')   self.ini = self.load_config(self.rcpath)   self.refresh_vlist() + + # refresh sync frame   self.pathdata.clear()   if 'paths' in self.ini:   for name in self.ini['paths']: @@ -709,6 +734,36 @@
  self.pathdata.append([hglib.toutf(name), safepath,   hglib.toutf(path)])   self.refresh_path_list() + + # refresh preset fonts combo + model = self.presetcombo.get_model() + cpaths = [info[1] for info in _font_info] + defaulfonts = True + for cpath in cpaths: + value = self.get_ini_config(cpath) + if value is not None: + defaulfonts = False + if defaulfonts: + # theme default fonts + self.defaultradio.set_active(True) + self.presetcombo.set_active(0) + else: + for name, (label, preset) in _font_presets.items(): + for cpath in cpaths: + if self.get_ini_config(cpath) != preset[cpath]: + break + else: + # preset fonts + rows = [row for row in model if row[0] == name] + if rows: + self.presetcombo.set_active_iter(rows[0].iter) + self.presetradio.set_active(True) + break + else: + # custom fonts + self.customradio.set_active(True) + self.presetcombo.set_active(0) +   self._btn_apply.set_sensitive(False)   self.dirty = False   @@ -915,13 +970,16 @@
  self._testpathbutton.set_sensitive(repo_available and path_selected)   self._defaultpathbutton.set_sensitive(not default_path and path_selected)   - def fill_path_frame(self, frvbox): + def fill_sync_frame(self, parent, table): + # add table + parent.pack_start(table, False, False) +   # insert padding - frvbox.pack_start(gtk.VBox(), False, False, 2) + parent.pack_start(gtk.VBox(), False, False, 2)     # paths frame   frame = gtk.Frame(_('Remote repository paths')) - frvbox.pack_start(frame, True, True, 2) + parent.pack_start(frame, True, True, 2)   vbox = gtk.VBox()   vbox.set_border_width(4)   frame.add(vbox) @@ -983,17 +1041,86 @@
  self._defaultpathbutton.connect('clicked', self._default_path)   bottombox.pack_start(self._defaultpathbutton, True, True, 2)   + def fill_font_frame(self, parent, table): + # layout table + layout = gtklib.LayoutTable() + parent.pack_start(layout, False, False, 2) + parent.reorder_child(layout, 0) + + # radio buttons + defaultradio = gtk.RadioButton(None, _('Theme default fonts')) + presetradio = gtk.RadioButton(defaultradio, _('Preset fonts:')) + customradio = gtk.RadioButton(defaultradio, _('Custom fonts:')) + self.defaultradio = defaultradio + self.presetradio = presetradio + self.customradio = customradio + + # preset list + presetmodel = gtk.ListStore(str, # internal name + str) # GUI label + presetmodel.append((None, _(' - Select Preset -'))) + for name, (label, preset) in _font_presets.items(): + presetmodel.append((name, label)) + presetcombo = gtk.ComboBox(presetmodel) + cell = gtk.CellRendererText() + presetcombo.pack_start(cell) + presetcombo.add_attribute(cell, 'text', 1) + self.presetcombo = presetcombo + + # layouting + layout.add_row(defaultradio) + layout.add_row(presetradio, presetcombo) + vbox = gtk.VBox() + vbox.pack_start(customradio, False, False) + vbox.pack_start(gtk.VBox()) + layout.add_row(vbox, table, yhopt=gtk.FILL|gtk.EXPAND) + + # signal handlers + def combo_changed(combo): + # configure for each item + model = combo.get_model() + name = model[combo.get_active()][0] # internal name + if name is None: + return + preset = _font_presets[name][1] # preset data + pagenum, info, vbox, widgets = self.pages['font'] + for row, (label, cpath, vals, tip) in enumerate(info): + itemcombo = widgets[row] + itemcombo.child.set_text(preset[cpath]) + presetcombo.connect('changed', combo_changed) + def radio_activated(radio, init=False): + if not radio.get_active(): + return + presetcombo.set_sensitive(presetradio.get_active()) + table.set_sensitive(customradio.get_active()) + if init: + return + if radio == defaultradio: + pagenum, info, vbox, widgets = self.pages['font'] + for row, (label, cpath, vals, tip) in enumerate(info): + itemcombo = widgets[row] + itemcombo.set_active(0) # unspecified + if radio != presetradio: + presetcombo.set_active(0) + defaultradio.connect('toggled', radio_activated) + presetradio.connect('toggled', radio_activated) + customradio.connect('toggled', radio_activated) + + # prepare to show + radio_activated(defaultradio, init=True) +   def set_help(self, widget, event, tooltip):   text = ' '.join(tooltip.splitlines())   self.descbuffer.set_text(text)   - def fill_frame(self, frame, info): + def fill_frame(self, frame, info, build=True, width=32):   widgets = []     table = gtklib.LayoutTable()     vbox = gtk.VBox() - vbox.pack_start(table, False, False) + if build: + vbox.pack_start(table, False, False)     scrolled = gtk.ScrolledWindow()   scrolled.set_policy(gtk.POLICY_NEVER, gtk.POLICY_AUTOMATIC) @@ -1007,7 +1134,7 @@
  combo.connect('changed', self.dirty_event)   combo.child.connect('focus-in-event', self.set_help, tooltip)   combo.set_row_separator_func(lambda model, path: model[path][1]) - combo.child.set_width_chars(32) + combo.child.set_width_chars(width)   if cpath in _pwfields:   combo.child.set_visibility(False)   widgets.append(combo) @@ -1015,7 +1142,7 @@
  table.add_row(label + ':', combo, padding=False)   self.tooltips.set_tip(combo, tooltip)   - return vbox, widgets + return vbox, table, widgets     def refresh_vlist(self):   for page_num, info, vbox, widgets in self.pages.values(): @@ -1064,14 +1191,16 @@
  elif currow:   combo.set_active(currow)   - def add_page(self, label, name, info, icon=None, path=False): + def add_page(self, label, name, info, icon=None, extra=False, width=32):   # setup page   frame = gtk.VBox()   frame.show()   - vbox, widgets = self.fill_frame(frame, info) - if path: - self.fill_path_frame(vbox) + vbox, table, widgets = self.fill_frame(frame, info, not extra, width) + if extra: + func = getattr(self, 'fill_%s_frame' % name, None) + if func: + func(vbox, table)     # add to notebook   pagenum = self.notebook.append_page(frame)