/b-gtk/fix-viz

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/b-gtk/fix-viz

« back to all changes in this revision

Viewing changes to viz/branchwin.py

Commit messages never contain config options

Show diffs side-by-side

added added

removed removed

Lines of Context:
78
78
        self.accel_group = Gtk.AccelGroup()
79
79
        self.add_accel_group(self.accel_group)
80
80
 
81
 
        if getattr(Gtk.Action, 'set_tool_item_type', None) is not None:
82
 
            Gtk.Action.set_tool_item_type(Gtk.MenuToolButton)
83
 
 
84
81
        self.prev_rev_action = Gtk.Action("prev-rev", "_Previous Revision", "Go to the previous revision", Gtk.STOCK_GO_DOWN)
85
82
        self.prev_rev_action.set_accel_path("<viz>/Go/Previous Revision")
86
83
        self.prev_rev_action.set_accel_group(self.accel_group)
137
134
    def construct_paned(self):
138
135
        """Construct the main HPaned/VPaned contents."""
139
136
        if self.config.get_user_option('viz-vertical') == 'True':
140
 
            self.paned = Gtk.HPaned()
 
137
            self.paned = Gtk.Paned.new(Gtk.Orientation.HORIZONTAL)
141
138
        else:
142
 
            self.paned = Gtk.VPaned()
 
139
            self.paned = Gtk.Paned.new(Gtk.Orientation.VERTICAL)
143
140
 
144
141
        self.paned.pack1(self.construct_top(), resize=False, shrink=True)
145
142
        self.paned.pack2(self.construct_bottom(), resize=True, shrink=False)
374
371
    def construct_bottom(self):
375
372
        """Construct the bottom half of the window."""
376
373
        if self.config.get_user_option('viz-wide-diffs') == 'True':
377
 
            self.diff_paned = Gtk.VPaned()
 
374
            self.diff_paned = Gtk.Paned.new(Gtk.Orientation.VERTICAL)
378
375
        else:
379
 
            self.diff_paned = Gtk.HPaned()
 
376
            self.diff_paned = Gtk.Paned.new(Gtk.Orientation.HORIZONTAL)
380
377
        (width, height) = self.get_size()
381
378
        self.diff_paned.set_size_request(20, 20) # shrinkable
382
379
 
481
478
        else:
482
479
            parent_id = parents[0]
483
480
 
484
 
        self.show_diff(revision.revision_id, parent_id)
 
481
        if revision is not None:
 
482
            self.show_diff(revision.revision_id, parent_id)
 
483
        else:
 
484
            self.show_diff(NULL_REVISION)
485
485
        self.treeview.grab_focus()
486
486
 
487
487
    def _back_clicked_cb(self, *args):
545
545
        dialog = SearchDialog(index)
546
546
 
547
547
        if dialog.run() == Gtk.ResponseType.OK:
548
 
            self.set_revision(dialog.get_revision())
 
548
            revid = dialog.get_revision()
 
549
            if revid is not None:
 
550
                self.set_revision(revid)
549
551
 
550
552
        dialog.destroy()
551
553
 
571
573
        old = self.paned
572
574
        self.vbox.remove(old)
573
575
        self.vbox.pack_start(
574
 
            self.construct_paned(), True, True, True, 0)
 
576
            self.construct_paned(), True, True, 0)
575
577
        self._make_diff_paned_nonzero_size()
576
578
        self._make_diff_nonzero_size()
577
579
 
655
657
            return width, height
656
658
        return None
657
659
 
658
 
    def show_diff(self, revid=None, parentid=NULL_REVISION):
 
660
    def show_diff(self, revid, parentid=NULL_REVISION):
659
661
        """Open a new window to show a diff between the given revisions."""
660
662
        from bzrlib.plugins.gtk.diff import DiffWindow
661
663
        window = DiffWindow(parent=self)