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

history: add function to get filter button by name
* * *

nyaa

Changeset 5af2c369d973

Parent b10eee173dd1

by Yuki KODAMA

Changes to one file · Browse files at 5af2c369d973 Showing diff from parent b10eee173dd1 Diff from another changeset...

 
35
36
37
 
38
39
40
41
 
42
43
44
 
45
46
47
 
48
49
50
 
51
52
53
 
54
55
56
 
57
58
59
 
60
61
62
63
64
 
65
66
67
 
74
75
76
 
77
78
79
 
98
99
100
101
102
103
104
 
106
107
108
 
 
 
109
110
111
 
492
493
494
495
 
496
497
498
 
616
617
618
619
 
620
621
622
 
641
642
643
644
 
645
646
647
 
 
648
649
650
 
681
682
683
684
 
685
686
687
688
689
690
 
691
692
693
 
846
847
848
849
 
850
851
852
 
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
 
1302
1303
1304
 
1821
1822
1823
1824
1825
 
 
1826
1827
1828
 
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
 
83
84
85
86
87
88
89
 
108
109
110
 
111
112
113
 
115
116
117
118
119
120
121
122
123
 
504
505
506
 
507
508
509
510
 
628
629
630
 
631
632
633
634
 
653
654
655
 
656
657
 
 
658
659
660
661
662
 
693
694
695
 
696
697
698
699
700
701
 
702
703
704
705
 
858
859
860
 
861
862
863
864
 
1302
1303
1304
 
 
 
1305
 
 
1306
1307
1308
1309
1310
1311
1312
 
1829
1830
1831
 
 
1832
1833
1834
1835
1836
@@ -35,33 +35,42 @@
  def __init__(self, tooltips, filter_mode, branch_names):   gtklib.SlimToolbar.__init__(self, tooltips)   self.filter_mode = filter_mode + self.buttons = {}     self.all = gtk.RadioButton(None, _('All'))   self.all.set_active(True)   self.append_widget(self.all, padding=0) + self.buttons['all'] = self.all     self.tagged = gtk.RadioButton(self.all, _('Tagged'))   self.append_widget(self.tagged, padding=0) + self.buttons['tagged'] = self.tagged     self.ancestry = gtk.RadioButton(self.all, _('Ancestry'))   self.append_widget(self.ancestry, padding=0) + self.buttons['ancestry'] = self.ancestry     self.parents = gtk.RadioButton(self.all, _('Parents'))   self.append_widget(self.parents, padding=0) + self.buttons['parents'] = self.parents     self.heads = gtk.RadioButton(self.all, _('Heads'))   self.append_widget(self.heads, padding=0) + self.buttons['heads'] = self.heads     self.merges = gtk.RadioButton(self.all, _('Merges'))   self.append_widget(self.merges, padding=0) + self.buttons['only_merges'] = self.merges     self.hidemerges = gtk.CheckButton(_('Hide Merges'))   self.append_widget(self.hidemerges, padding=0) + self.buttons['no_merges'] = self.hidemerges     self.branches = gtk.RadioButton(self.all)   tooltips.set_tip(self.branches, _('Branch Filter'))   self.branches.set_sensitive(False)   self.append_widget(self.branches, padding=0) + self.buttons['branch'] = self.branches     self.branchcombo = gtk.combo_box_new_text()   self.branchcombo.append_text(_('Branches...')) @@ -74,6 +83,7 @@
  tooltips.set_tip(self.custombutton, _('Custom Filter'))   self.custombutton.set_sensitive(False)   self.append_widget(self.custombutton, padding=0) + self.buttons['custom'] = self.custombutton     self.filtercombo = gtk.combo_box_new_text()   self.filtercombo_entries = (_('Rev Range'), _('File Patterns'), @@ -98,7 +108,6 @@
  self.entry = entry   self.append_widget(entrycombo, expand=True, padding=0)   -   def connect(self, detailed_signal, handler, *opts):   '''Connect an external signal handler to an internal widget   Signal format is '[widget_name]_[signal]'.''' @@ -106,6 +115,9 @@
  widget = self.__dict__[widget_name]   widget.connect(signal, handler, *opts)   + def get_button(self, type): + return self.buttons.get(type) +  class GLog(gdialog.GWindow):   'GTK+ based dialog for displaying repository logs'   def init(self): @@ -492,7 +504,7 @@
  return False   self.prevrevid = self.currevid   self.currevid = graphview.get_revid_at_path(path) - self.ancestrybutton.set_sensitive(True) + self.filterbar.get_button('ancestry').set_sensitive(True)   if self.currevid != self.lastrevid:   self.lastrevid = self.currevid   self.changeview.opts['rev'] = [str(self.currevid)] @@ -616,7 +628,7 @@
  opts['user'] = [w.strip() for w in text.split(',')]   else:   return - self.custombutton.set_active(True) + self.filterbar.get_button('custom').set_active(True)   self.filter = 'custom'   self.reload_log(**opts)   @@ -641,10 +653,10 @@
  def update_hide_merges_button(self):   compatible = self.filter in ['all', 'branch', 'custom']   if compatible: - self.hidemerges.set_sensitive(True) + self.filterbar.get_button('no_merges').set_sensitive(True)   else: - self.hidemerges.set_active(False) - self.hidemerges.set_sensitive(False) + self.filterbar.get_button('no_merges').set_active(False) + self.filterbar.get_button('no_merges').set_sensitive(False)   self.no_merges = False     def patch_selected(self, mqwidget, revid, patchname): @@ -681,13 +693,13 @@
    opts = self.opts   if opts['filehist']: - self.custombutton.set_active(True) + self.filterbar.get_button('custom').set_active(True)   self.filter = 'custom'   self.filtercombo.set_active(1)   self.filterentry.set_text(opts['filehist'])   self.filter_entry_activated(self.filterentry, self.filtercombo)   elif self.pats: - self.custombutton.set_active(True) + self.filterbar.get_button('custom').set_active(True)   self.filter = 'custom'   self.filtercombo.set_active(1)   self.filterentry.set_text(', '.join(self.pats)) @@ -846,7 +858,7 @@
    self.cmd_set_sensitive('load-more', len(self.repo)>0)   self.cmd_set_sensitive('load-all', len(self.repo)>0) - self.ancestrybutton.set_sensitive(False) + self.filterbar.get_button('ancestry').set_sensitive(False)   pats = opts.get('pats', [])   self.changeview.pats = pats   self.pats = pats @@ -1290,15 +1302,11 @@
  self.filter_mode,   hglib.getlivebranch(self.repo))   filterbar = self.filterbar - self.ancestrybutton = filterbar.ancestry - self.hidemerges = filterbar.hidemerges - self.branchbutton = filterbar.branches   self.lastbranchrow = None - self.branchcombo = filterbar.branchcombo - self.custombutton = filterbar.custombutton   self.filter_mode = filterbar.filter_mode   self.filtercombo = filterbar.filtercombo   self.filterentry = filterbar.entry + self.branchcombo = filterbar.branchcombo   self.entrycombo = filterbar.entrycombo     fcon = self.filterbar.connect @@ -1821,8 +1829,8 @@
  elif row != self.lastbranchrow:   self.filter = 'branch'   self.lastbranchrow = row - self.branchbutton.set_active(True) - self.branchbutton.set_sensitive(True) + self.filterbar.get_button('branch').set_active(True) + self.filterbar.get_button('branch').set_sensitive(True)   self.reload_log(branch=combo.get_model()[row][0])     def show_goto_dialog(self):