# HG changeset patch
# User Adrian Buehlmann <[email protected]>
# Date 1252844661 -7200
# Node ID de6895d90b88d8bbe43ba2ea09cf57ea50a6ae68
# Parent 60bf6516d1e1acfccbb22e55944ffa5a47794eca
status: put file type checkboxes (MAR!?CI) into a new "Filter" tab in bottom
left pane
using a gtk.Notebook in the bottom left pane with tabs "Files" and "Types"
diff --git a/hggtk/status.py b/hggtk/status.py
--- a/hggtk/status.py
+++ b/hggtk/status.py
@@ -285,10 +285,15 @@ class GStatus(gdialog.GDialog):
button = gtk.Button(_('Remove filter, show root'))
button.connect('pressed', self.remove_filter)
tvbox.pack_start( button, False, False, 2)
+
+ self.tree_notebook = gtk.Notebook()
+ self.tree_notebook.set_tab_pos(gtk.POS_BOTTOM)
+ self.tree_notebook.append_page(tvbox, gtk.Label(_('Files')))
+ self.tree_notebook.append_page(self.file_filter(),
gtk.Label(_('Types')))
tree_frame = gtk.Frame()
tree_frame.set_shadow_type(gtk.SHADOW_ETCHED_IN)
- tree_frame.add(tvbox)
+ tree_frame.add(self.tree_notebook)
diff_frame = gtk.Frame()
diff_frame.set_shadow_type(gtk.SHADOW_ETCHED_IN)
@@ -399,43 +404,46 @@ class GStatus(gdialog.GDialog):
def page_switched(self, notebook, page, page_num, filesel, difftree):
self.tree_sel_changed(filesel, difftree, page_num)
- def get_extras(self):
- table = gtk.Table(rows=2, columns=3)
- table.set_col_spacings(8)
+ def file_filter(self):
+ self._show_checks = {}
- self._show_checks = {}
- row, col = 0, 0
# Tuple: (ctype, translated label)
- checks = (('modified', _('M: modified')),
+ checks = [('modified', _('M: modified')),
('added', _('A: added')),
- ('removed', _('R: removed')))
+ ('removed', _('R: removed'))]
if self.count_revs() <= 1:
- checks += (('deleted', _('!: deleted')),
+ checks += [('deleted', _('!: deleted')),
('unknown', _('?: unknown')),
('clean', _('C: clean')),
- ('ignored', _('I: ignored')))
+ ('ignored', _('I: ignored'))]
+
+ vbox = gtk.VBox()
for ctuple in checks:
check = gtk.CheckButton(ctuple[1])
check.connect('toggled', self.show_toggle, ctuple[0])
- table.attach(check, col, col+1, row, row+1)
+ vbox.pack_start(check, False, False)
self._show_checks[ctuple[0]] = check
- col += row
- row = not row
+ vp = gtk.Viewport()
+ vp.add(vbox)
+
+ scroller = gtk.ScrolledWindow()
+ scroller.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
+ scroller.add(vp)
+
+ return scroller
+
+ def get_extras(self):
self.counter = gtk.Label('')
self.counter.set_alignment(1.0, 0.0) # right up
self.stbar = gtklib.StatusBar()
- rightbox = gtk.VBox()
- rightbox.pack_start(self.counter)
- rightbox.pack_start(self.stbar, False, False)
-
hbox = gtk.HBox()
- hbox.pack_start(table, False, False)
+ hbox.pack_start(self.stbar)
hbox.pack_start(gtk.Label(''), True, True, 2)
- hbox.pack_end(rightbox, False, False, 2)
+ hbox.pack_end(self.counter, False, False, 2)
return hbox
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Tortoisehg-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tortoisehg-develop