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

  • Committer: Jelmer Vernooij
  • Date: 2007-01-29 23:27:09 UTC
  • Revision ID: jelmer@samba.org-20070129232709-0yygg83sh9is3xvw
Use decorator for catching and showing bzr-gtk errors graphically. Eventually, this should go away and should be handled by the ui factory.

Show diffs side-by-side

added added

removed removed

Lines of Context:
59
59
        
60
60
        self.window.show_all()
61
61
 
 
62
    @show_bzr_error
62
63
    def rename(self, widget):
63
64
        # Get entry
64
65
        old_filename = self.selected
78
79
        destination = os.path.join(self.wtpath, new_filename)
79
80
        
80
81
        # Rename the file
81
 
        try:
82
 
            wt1, path1 = WorkingTree.open_containing(self.wt.abspath(source))
83
 
            wt2, path2 = WorkingTree.open_containing(self.wt.abspath(source))
 
82
        wt1, path1 = WorkingTree.open_containing(self.wt.abspath(source))
 
83
        wt2, path2 = WorkingTree.open_containing(self.wt.abspath(source))
84
84
 
85
 
            if wt1.basedir != wt2.basedir:
86
 
                error_dialog(_('Not the same branch'),
87
 
                             _('The destination is not in the same branch.'))
88
 
                return
89
 
            wt1.rename_one(source, destination)
90
 
        except errors.NotBranchError:
91
 
            error_dialog(_('File is not in a branch'),
92
 
                         _('The selected file is not in a branch.'))
 
85
        if wt1.basedir != wt2.basedir:
 
86
            error_dialog(_('Not the same branch'),
 
87
                         _('The destination is not in the same branch.'))
93
88
            return
94
 
        except errors.BzrError, msg:
95
 
            error_dialog(_('Unknown bzr error'), str(msg))
96
 
 
 
89
        wt1.rename_one(source, destination)
97
90
        self.close()
98
91
    
99
92
    def close(self, widget=None):