/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 olive/frontend/gtk/viz/diffwin.py

  • Committer: Szilveszter Farkas (Phanatic)
  • Date: 2006-09-11 02:56:58 UTC
  • mto: (0.14.1 main) (93.1.1 win32.bialix)
  • mto: This revision was merged to the branch mainline in revision 83.
  • Revision ID: Szilveszter.Farkas@gmail.com-20060911025658-997cf3a305b9f1da
A better implementation for the drive selection. (OptionMenu didn't work on Win32)

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
 
32
32
import gtk
33
33
import pango
 
34
import sys
34
35
 
35
36
try:
36
37
    import gtksourceview
70
71
 
71
72
    def construct(self):
72
73
        """Construct the window contents."""
73
 
        hbox = gtk.HBox(spacing=6)
74
 
        hbox.set_border_width(0)
75
 
        self.add(hbox)
76
 
        hbox.show()
77
 
 
 
74
        # The   window  consists  of   a  pane   containing:  the
 
75
        # hierarchical list  of files on  the left, and  the diff
 
76
        # for the currently selected file on the right.
 
77
        pane = gtk.HPaned()
 
78
        self.add(pane)
 
79
        pane.show()
 
80
 
 
81
        # The file hierarchy: a scrollable treeview
78
82
        scrollwin = gtk.ScrolledWindow()
79
83
        scrollwin.set_policy(gtk.POLICY_NEVER, gtk.POLICY_AUTOMATIC)
80
84
        scrollwin.set_shadow_type(gtk.SHADOW_IN)
81
 
        hbox.pack_start(scrollwin, expand=False, fill=True)
 
85
        pane.pack1(scrollwin)
82
86
        scrollwin.show()
83
87
 
84
88
        self.model = gtk.TreeStore(str, str)
96
100
        column.add_attribute(cell, "text", 0)
97
101
        self.treeview.append_column(column)
98
102
 
99
 
 
 
103
        # The diffs of the  selected file: a scrollable source or
 
104
        # text view
100
105
        scrollwin = gtk.ScrolledWindow()
101
106
        scrollwin.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
102
107
        scrollwin.set_shadow_type(gtk.SHADOW_IN)
103
 
        hbox.pack_start(scrollwin, expand=True, fill=True)
 
108
        pane.pack2(scrollwin)
104
109
        scrollwin.show()
105
110
 
106
111
        if have_gtksourceview:
185
190
 
186
191
        s = StringIO()
187
192
        show_diff_trees(self.parent_tree, self.rev_tree, s, specific_files)
188
 
        self.buffer.set_text(s.getvalue())
 
193
        self.buffer.set_text(s.getvalue().decode(sys.getdefaultencoding(), 'replace'))