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

  • Committer: Jelmer Vernooij
  • Date: 2006-09-27 21:05:19 UTC
  • mto: (0.12.2 olive)
  • mto: This revision was merged to the branch mainline in revision 83.
  • Revision ID: jelmer@samba.org-20060927210519-7bc2662211808af5
Bunch of other small updates, add more items to 
the TODO list.

Show diffs side-by-side

added added

removed removed

Lines of Context:
68
68
    def on_menuitem_branch_missing_revisions_activate(self, widget):
69
69
        """ Branch/Missing revisions menu handler. """
70
70
        
71
 
        self.comm.set_busy(self.comm.window_main)
72
 
        
73
 
        try:
74
 
            import bzrlib
75
 
            
76
 
            local_branch = self.wt.branch
77
 
            
78
 
            other_branch = local_branch.get_parent()
79
 
            if other_branch is None:
80
 
                error_dialog(_('Parent location is unknown'),
81
 
                                         _('Cannot determine missing revisions if no parent location is known.'))
82
 
                return
83
 
            
84
 
            remote_branch = Branch.open(other_branch)
85
 
            
86
 
            if remote_branch.base == local_branch.base:
87
 
                remote_branch = local_branch
88
 
 
89
 
            ret = len(local_branch.missing_revisions(remote_branch))
90
 
 
91
 
            if ret > 0:
92
 
                info_dialog(_('There are missing revisions'),
93
 
                                        _('%d revision(s) missing.') % ret)
94
 
            else:
95
 
                info_dialog(_('Local branch up to date'),
96
 
                                        _('There are no missing revisions.'))
97
 
        finally:
98
 
            self.comm.set_busy(self.comm.window_main, False)
99
 
    
 
71
        import bzrlib
 
72
        
 
73
        local_branch = self.wt.branch
 
74
        
 
75
        other_branch = local_branch.get_parent()
 
76
        if other_branch is None:
 
77
            error_dialog(_('Parent location is unknown'),
 
78
                                     _('Cannot determine missing revisions if no parent location is known.'))
 
79
            return
 
80
        
 
81
        remote_branch = Branch.open(other_branch)
 
82
        
 
83
        if remote_branch.base == local_branch.base:
 
84
            remote_branch = local_branch
 
85
 
 
86
        ret = len(local_branch.missing_revisions(remote_branch))
 
87
 
 
88
        if ret > 0:
 
89
            info_dialog(_('There are missing revisions'),
 
90
                                    _('%d revision(s) missing.') % ret)
 
91
        else:
 
92
            info_dialog(_('Local branch up to date'),
 
93
                                    _('There are no missing revisions.'))
 
94
 
100
95
    def on_menuitem_branch_pull_activate(self, widget):
101
96
        """ Branch/Pull menu handler. """
102
97
        
103
 
        self.comm.set_busy(self.comm.window_main)
104
 
 
105
98
        branch_to = self.wt.branch
106
99
 
107
100
        location = branch_to.get_parent()
209
202
    def on_menuitem_stats_infos_activate(self, widget):
210
203
        """ Statistics/Informations... menu handler. """
211
204
        from info import OliveInfo
212
 
        info = OliveInfo(self.comm)
 
205
        info = OliveInfo(self.wt)
213
206
        info.display()
214
207
    
215
208
    def on_menuitem_stats_log_activate(self, widget):
216
209
        """ Statistics/Log... menu handler. """
217
 
        from log import OliveLog
218
 
        log = OliveLog(self.comm)
219
 
        log.display()
 
210
        from bzrlib.plugins.gtk.viz.branchwin import BranchWindow
 
211
        window = BranchWindow()
 
212
        window.set_branch(self.wt.branch, self.wt.branch.last_revision(), None)
 
213
        window.show()
220
214
    
221
215
    def on_menuitem_view_refresh_activate(self, widget):
222
216
        """ View/Refresh menu handler. """
256
250
        if newdir == None:
257
251
            return
258
252
 
259
 
        self.comm.set_busy(treeview)
260
253
        self.comm.set_path(newdir)
261
254
        self.comm.refresh_right()
262
 
        self.comm.set_busy(treeview, False)
263
255
    
264
256
    def on_treeview_right_button_press_event(self, widget, event):
265
257
        """ Occurs when somebody right-clicks in the file list. """