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

  • Committer: Jelmer Vernooij
  • Date: 2011-03-14 20:12:19 UTC
  • Revision ID: jelmer@samba.org-20110314201219-wo692nzwywu6mevh
Fix formatting, imports.

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
16
16
 
17
 
import time
18
 
 
19
17
try:
20
18
    import pygtk
21
19
    pygtk.require("2.0")
25
23
import gobject
26
24
import gtk
27
25
 
28
 
from bzrlib.osutils import format_date
29
26
from bzrlib.plugins.gtk import _i18n
30
27
from bzrlib.plugins.gtk.branchview.treeview import TreeView
31
28
 
37
34
                                  parent=parent,
38
35
                                  flags=gtk.DIALOG_MODAL,
39
36
                                  buttons=(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL))
40
 
    
 
37
 
41
38
        # Get arguments
42
39
        self.branch = branch
43
 
        
 
40
 
44
41
        # Create the widgets
45
42
        self._button_select = gtk.Button(_i18n("_Select"), use_underline=True)
46
43
        start_revs = [branch.last_revision(),]
47
44
        self.treeview = TreeView(branch, start_revs, None)
48
 
        
 
45
 
49
46
        # Set callbacks
50
47
        self._button_select.connect('clicked', self._on_select_clicked)
51
48
        self.treeview.connect('revision-activated',
52
49
                               self._on_treeview_revision_activated)
53
 
        
 
50
 
54
51
        # Set properties
55
52
        self.set_default_size(600, 400)
56
53
        self.vbox.set_spacing(3)
57
54
        self.treeview.set_property('graph-column-visible', False)
58
55
        self.treeview.set_property('date-column-visible', True)
59
56
        self.treeview.set_property('mainline-only', True)
60
 
        
 
57
 
61
58
        # Construct the dialog
62
59
        self.action_area.pack_end(self._button_select)
63
 
        
 
60
 
64
61
        self.vbox.pack_start(self.treeview, True, True)
65
62
 
66
63
        # Show the dialog
67
64
        self.show_all()
68
65
 
69
 
    
 
66
 
70
67
    def _on_treeview_revision_activated(self, treeview, path, column):
71
68
        """ Double-click on a row should also select a revision. """
72
69
        self._on_select_clicked(treeview)
73
 
    
 
70
 
74
71
    def _on_select_clicked(self, widget):
75
72
        """ Select button clicked handler. """
76
 
        
 
73
 
77
74
        self.selected_revno = self.treeview.get_property('revision-number')
78
75
        self.selected_revid = \
79
76
                    self.treeview.get_property('revision').revision_id