# HG changeset patch # User Adrian Buehlmann <adr...@cadifra.com> # Date 1252868628 -7200 # Node ID 91af4e5be161f11c1cdf913abc7ddd0c941d4ee7 # Parent 6337e9dad8998cfcaa13fe7cc1aa381cd56c15ed status: put the MAR!?CI options checkboxes into a new "Status Options" tab
The new tab is the first one in the _right_ pane. So we now have the tabs: | Status Options | Text Diff | Hunk Selection | Preview Selection | Patch Contents | On startup, we switch to the second tab ("Text Diff"). Adding a gtk.Notebook for the left pane while we're at it. This could be useful for future extension and causes no visible change, as its tabs are hidden. diff --git a/tortoisehg/hgtk/status.py b/tortoisehg/hgtk/status.py --- a/tortoisehg/hgtk/status.py +++ b/tortoisehg/hgtk/status.py @@ -286,9 +286,14 @@ class GStatus(gdialog.GDialog): 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.set_show_tabs(False) + self.tree_notebook.append_page(tvbox, gtk.Label(_('Files'))) + 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) @@ -296,6 +301,9 @@ class GStatus(gdialog.GDialog): self.diff_notebook = gtk.Notebook() self.diff_notebook.set_tab_pos(gtk.POS_BOTTOM) + self.diff_notebook.append_page( + self.file_filter(), gtk.Label(_('Status Options'))) + self.difffont = pango.FontDescription(self.fontlist) self.clipboard = None @@ -394,48 +402,58 @@ class GStatus(gdialog.GDialog): self.diff_notebook.connect('switch-page', self.page_switched, sel, difftree) + + page_num = 1 + def set_page(): + self.diff_notebook.set_current_page(page_num) + self.tree_sel_changed(sel, difftree, page_num) + gobject.idle_add(set_page) + return self.diffpane 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 @@ -843,12 +861,12 @@ class GStatus(gdialog.GDialog): row = paths[0] if page_num is None: page_num = self.diff_notebook.get_current_page() - if page_num == 0: + if page_num == 1: buf = self.generate_text_diffs(row) self.diff_text.set_buffer(buf) - elif page_num == 1: + elif page_num == 2: self.update_hunk_model(row, tree) - elif page_num == 2: + elif page_num == 3: self.update_selection_preview() def update_selection_preview(self): ------------------------------------------------------------------------------ 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 Tortoisehg-develop@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tortoisehg-develop