/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: Szilveszter Farkas (Phanatic)
  • Date: 2007-05-17 16:12:27 UTC
  • mto: This revision was merged to the branch mainline in revision 201.
  • Revision ID: szilveszter.farkas@gmail.com-20070517161227-9e37lj2rm2t0cwj6
Some small modifications to Branch, Checkout and Info to support remote branches.

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")
40
38
        self.branch = branch
41
39
        
42
40
        # Create the widgets
43
 
        self._hbox = gtk.HBox()
44
 
        self._image_loading = gtk.image_new_from_stock(gtk.STOCK_REFRESH, gtk.ICON_SIZE_BUTTON)
45
 
        self._label_loading = gtk.Label(_("Please wait, revisions are being loaded..."))
 
41
        self._label_select = gtk.Label(_("Please select a revision"))
46
42
        self._scrolledwindow = gtk.ScrolledWindow()
47
43
        self._treeview = gtk.TreeView()
48
44
        self._button_select = gtk.Button(_("_Select"), use_underline=True)
56
52
                                        gtk.POLICY_AUTOMATIC)
57
53
        self.vbox.set_spacing(3)
58
54
        self.set_default_size(600, 400)
59
 
        self._label_loading.set_alignment(0.0, 0.5)
60
 
        self._hbox.set_spacing(5)
61
 
        self._hbox.set_border_width(5)
62
55
        
63
56
        # Construct the TreeView columns
64
57
        self._treeview.append_column(gtk.TreeViewColumn(_('Revno'),
78
71
        
79
72
        self._scrolledwindow.add(self._treeview)
80
73
        
81
 
        self._hbox.pack_start(self._image_loading, False, False)
82
 
        self._hbox.pack_start(self._label_loading, True, True)
83
 
        
84
 
        self.vbox.pack_start(self._hbox, False, False)
 
74
        self.vbox.pack_start(self._label_select, False, False)
85
75
        self.vbox.pack_start(self._scrolledwindow, True, True)
86
 
 
87
 
        # Show the dialog
88
 
        self.show_all()
89
76
        
90
77
        # Fill up with revisions
91
78
        self._fill_revisions()
 
79
        
 
80
        # Show the dialog
 
81
        self.vbox.show_all()
92
82
 
93
83
    def _fill_revisions(self):
94
84
        """ Fill up the treeview with the revisions. """
99
89
                                   gobject.TYPE_STRING,
100
90
                                   gobject.TYPE_STRING)
101
91
        self._treeview.set_model(self.model)
102
 
 
103
92
        repo = self.branch.repository
104
93
        revs = self.branch.revision_history()
105
94
        r = repo.get_revisions(revs)
106
95
        r.reverse()
107
 
 
108
96
        for rev in r:
109
97
            if rev.committer is not None:
110
98
                timestamp = format_date(rev.timestamp, rev.timezone)
115
103
                                rev.committer,
116
104
                                timestamp,
117
105
                                rev.revision_id ])
118
 
            while gtk.events_pending():
119
 
                gtk.main_iteration()
120
 
        tend = time.time()
121
 
        
122
 
        # Finished loading
123
 
        self._hbox.hide()
124
106
    
125
107
    def _get_selected_revno(self):
126
108
        """ Return the selected revision's revno. """