Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.9, 0.9.1, and 0.9.1.1

history: add menu bar to changelog tool

Changeset add157a33441

Parent bfdf40dbaf55

by Steve Borho

Changes to one file · Browse files at add157a33441 Showing diff from parent bfdf40dbaf55 Diff from another changeset...

Change 1 of 7 Show Entire File hggtk/​history.py Stacked
 
93
94
95
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
96
97
98
 
119
120
121
122
 
 
 
 
 
123
124
125
 
127
128
129
130
 
 
131
132
133
 
135
136
137
138
 
139
140
141
 
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
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
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
 
340
341
342
 
 
 
 
343
344
345
 
592
593
594
595
596
597
598
599
600
601
 
602
603
604
 
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
 
141
142
143
 
144
145
146
147
148
149
150
151
 
153
154
155
 
156
157
158
159
160
 
162
163
164
 
165
166
167
168
 
262
263
264
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
265
266
267
 
292
293
294
295
296
297
298
299
300
301
 
548
549
550
 
 
 
 
 
551
 
552
553
554
555
@@ -93,6 +93,28 @@
  tbar += [self.settingtb, gtk.SeparatorToolItem()]   return tbar   + def get_menu_list(self): + col = lambda x, y: self.showcol.get(x, y) + fnc = self.toggle_view_column + return [(_('Columns'), True, False, [ + (_('Graph'), self.toggle_graphcol, [], self.graphcol), + (_('Rev'), fnc, ['rev-column-visible'], col('rev', True)), + (_('Hash ID'), fnc, ['id-column-visible'], col('id', False)), + (_('Branch'), fnc, ['branch-column-visible'], col('branch', False)), + (_('Local Date'), fnc, ['date-column-visible'], col('date', False)), + (_('UTC Date'), fnc, ['utc-column-visible'], col('utc', False)), + (_('Age'), fnc, ['age-column-visible'], col('age', True)), + (_('Tags'), fnc, ['tag-column-visible'], col('tag', False))]), + (_('Features'), True, False, [ + (_('Filter Bar'), self.toggle_show_filterbar, [], + self.show_filterbar), + (_('Compact Graph'), self.toggle_compactgraph, [], + self.compactgraph), + (_('Color by Branch'), self.toggle_branchcolor, [], + self.branch_color), + ]) + ] +   def synch_clicked(self, toolbutton, data):   def sync_closed(dialog):   self.synctb.set_sensitive(True) @@ -119,7 +141,11 @@
  def toggle_view_column(self, button, property):   active = button.get_active()   self.graphview.set_property(property, active) - if property in ('branch-color') and self.ready: + + def toggle_branchcolor(self, button): + active = button.get_active() + if self.branch_color != active: + self.branch_color = active   self.reload_log()     def toggle_graphcol(self, button): @@ -127,7 +153,8 @@
  if self.graphcol != active:   self.graphcol = active   self.reload_log() - self.compactgraph_button.set_sensitive(self.graphcol) + # TODO: this could be tricky + #self.compactgraph_button.set_sensitive(self.graphcol)     def toggle_compactgraph(self, button):   active = button.get_active() @@ -135,7 +162,7 @@
  self.compactgraph = active   self.reload_log()   - def toggle_show_filterbar(self, button, property): + def toggle_show_filterbar(self, button):   self.show_filterbar = button.get_active()   if self.filterbox is not None:   self.filterbox.set_property('visible', self.show_filterbar) @@ -235,81 +262,6 @@
  def repo_invalidated(self, mqwidget):   self.reload_log()   - def view_menu(self): - menu = gtk.Menu() - - button = gtk.CheckMenuItem(_('Show Graph')) - button.connect('toggled', self.toggle_graphcol) - button.set_active(self.graphcol) - button.set_draw_as_radio(True) - menu.append(button) - - button = gtk.CheckMenuItem(_('Compact Graph')) - button.connect('toggled', self.toggle_compactgraph) - button.set_active(self.compactgraph) - button.set_draw_as_radio(True) - button.set_sensitive(self.graphcol) - menu.append(button) - self.compactgraph_button = button - - button = gtk.CheckMenuItem(_('Show Rev')) - button.connect('toggled', self.toggle_view_column, - 'rev-column-visible') - button.set_active(self.showcol.get('rev', True)) - button.set_draw_as_radio(True) - menu.append(button) - button = gtk.CheckMenuItem(_('Show ID')) - button.connect('toggled', self.toggle_view_column, - 'id-column-visible') - button.set_active(self.showcol.get('id', False)) - button.set_draw_as_radio(True) - menu.append(button) - button = gtk.CheckMenuItem(_('Show Tags')) - button.connect('toggled', self.toggle_view_column, - 'tag-column-visible') - button.set_active(self.showcol.get('tag', False)) - button.set_draw_as_radio(True) - menu.append(button) - button = gtk.CheckMenuItem(_('Show Local Date')) - button.connect('toggled', self.toggle_view_column, - 'date-column-visible') - button.set_active(self.showcol.get('date', False)) - button.set_draw_as_radio(True) - menu.append(button) - button = gtk.CheckMenuItem(_('Show UTC Date')) - button.connect('toggled', self.toggle_view_column, - 'utc-column-visible') - button.set_active(self.showcol.get('utc', False)) - button.set_draw_as_radio(True) - menu.append(button) - button = gtk.CheckMenuItem(_('Show Age')) - button.connect('toggled', self.toggle_view_column, - 'age-column-visible') - button.set_active(self.showcol.get('age', True)) - button.set_draw_as_radio(True) - menu.append(button) - button = gtk.CheckMenuItem(_('Show Branch')) - button.connect('toggled', self.toggle_view_column, - 'branch-column-visible') - button.set_active(self.showcol.get('branch', False)) - button.set_draw_as_radio(True) - menu.append(button) - button = gtk.CheckMenuItem(_('Color by Branch')) - button.connect('toggled', self.toggle_view_column, - 'branch-color') - button.set_active(self.branch_color) - button.set_draw_as_radio(True) - menu.append(button) - button = gtk.CheckMenuItem(_('Show Filterbar')) - button.connect('toggled', self.toggle_show_filterbar, - 'show-filterbar') - button.set_active(self.show_filterbar) - button.set_draw_as_radio(True) - menu.append(button) - - menu.show_all() - return menu -   def prepare_display(self):   'Called at end of display() method'   self.ready = True @@ -340,6 +292,10 @@
  self.filterbox.set_property('visible', self.show_filterbar)   self.filterbox.set_no_show_all(True)   + for col in ('rev', 'date', 'id', 'branch', 'utc', 'age', 'tag'): + self.graphview.set_property(col+'-column-visible', + self.showcol[col]) +   # enable MQ panel   self.enable_mqpanel()   @@ -592,13 +548,8 @@
  self.loadallbutton = self.make_toolbutton(gtk.STOCK_GOTO_BOTTOM,   _('Load all'), self.load_all_clicked, tip=_('load all revisions'))   - vmenu = gtk.MenuToolButton('') - vmenu.set_menu(self.view_menu()) - # hide the Button widget; we want to see only Menu button - gobject.idle_add(lambda: vmenu.child.get_children()[0].hide()) -   tbar = self.changeview.get_tbbuttons() - tbar += [sep, self.loadnextbutton, self.loadallbutton, vmenu] + tbar += [sep, self.loadnextbutton, self.loadallbutton]   for tbutton in tbar:   self.toolbar.insert(tbutton, -1)