/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 logview.py

  • Committer: Daniel Schierbeck
  • Date: 2007-10-30 13:19:33 UTC
  • mto: (326.1.1 dev)
  • mto: This revision was merged to the branch mainline in revision 327.
  • Revision ID: daniel.schierbeck@gmail.com-20071030131933-t04sq9j04grfkzgr
Turned the logview into a notebook.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
from bzrlib.osutils import format_date
24
24
 
25
25
 
26
 
class LogView(gtk.ScrolledWindow):
 
26
class LogView(gtk.Notebook):
27
27
    """ Custom widget for commit log details.
28
28
 
29
29
    A variety of bzr tools may need to implement such a thing. This is a
32
32
 
33
33
    def __init__(self, revision=None, scroll=True, tags=[],
34
34
                 show_children=False):
35
 
        super(LogView, self).__init__()
36
 
        if scroll:
37
 
            self.set_policy(gtk.POLICY_NEVER, gtk.POLICY_AUTOMATIC)
38
 
        else:
39
 
            self.set_policy(gtk.POLICY_NEVER, gtk.POLICY_NEVER)
40
 
        self.set_shadow_type(gtk.SHADOW_NONE)
 
35
        gtk.Notebook.__init__(self)
41
36
        self.show_children = show_children
42
 
        self._create()
 
37
        self._create_general()
 
38
        self._create_relations()
43
39
        self._show_callback = None
44
40
        self._go_callback = None
45
41
        self._clicked_callback = None
156
152
            hbox.pack_start(button, expand=False, fill=True)
157
153
            button.show()
158
154
 
159
 
    def _create(self):
 
155
    def _create_general(self):
160
156
        vbox = gtk.VBox(False, 6)
161
157
        vbox.set_border_width(6)
162
158
        vbox.pack_start(self._create_headers(), expand=False, fill=True)
 
159
        vbox.pack_start(self._create_message_view())
 
160
        self.append_page(vbox, tab_label=gtk.Label("General"))
 
161
        vbox.show()
 
162
 
 
163
    def _create_relations(self):
 
164
        vbox = gtk.VBox(False, 6)
 
165
        vbox.set_border_width(6)
163
166
        vbox.pack_start(self._create_parents(), expand=False, fill=True)
164
167
        if self.show_children:
165
168
            vbox.pack_start(self._create_children(), expand=False, fill=True)
166
 
        vbox.pack_start(self._create_message_view())
167
 
        self.add_with_viewport(vbox)
 
169
        self.append_page(vbox, tab_label=gtk.Label("Relations"))
168
170
        vbox.show()
169
 
 
 
171
        
170
172
    def _create_headers(self):
171
173
        self.table = gtk.Table(rows=5, columns=2)
172
174
        self.table.set_row_spacings(6)