/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-06-10 15:50:23 UTC
  • mfrom: (195.1.26 browse-remote-branches)
  • Revision ID: szilveszter.farkas@gmail.com-20070610155023-o3moy5a3wrp9o412
Merge browse-remote-branches branch (experimental).

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