/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/remove.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:
54
54
        """ Display the Remove file(s) dialog. """
55
55
        self.window.show_all()
56
56
        
 
57
    @show_bzr_error
57
58
    def remove(self, widget):
58
59
        radio_selected = self.glade.get_widget('radiobutton_remove_selected')
59
60
        radio_new = self.glade.get_widget('radiobutton_remove_new')
69
70
            
70
71
            fullpath = self.wt.abspath(os.path.join(self.wtpath, filename))
71
72
            
72
 
            try:
73
 
                self.wt.remove(fullpath)
74
 
            except errors.NotBranchError:
75
 
                error_dialog(_('Directory is not a branch'),
76
 
                             _('You can perform this action only in a branch.'))
77
 
                return
78
 
            except errors.NotVersionedError:
79
 
                error_dialog(_('File not versioned'),
80
 
                             _('The selected file is not versioned.'))
81
 
                return
 
73
            self.wt.remove(fullpath)
82
74
        elif radio_new.get_active():
83
75
            # Remove added files recursively
84
76
            added = self.wt.changes_from(self.wt.basis_tree()).added
126
118
        self.vbox.set_spacing(3)
127
119
        self.vbox.show_all()
128
120
        
 
121
    @show_bzr_error
129
122
    def _on_remove_clicked(self, button):
130
123
        """ Remove button clicked handler. """
131
124
        if self._radio_selected.get_active():
137
130
                             _('Please select a file from the list,\nor choose the other option.'))
138
131
                return
139
132
            
140
 
            try:
141
 
                self.wt.remove(os.path.join(self.wtpath, filename))
142
 
            except errors.NotBranchError:
143
 
                error_dialog(_('Directory is not a branch'),
144
 
                             _('You can perform this action only in a branch.'))
145
 
                return
146
 
            except errors.NotVersionedError:
147
 
                error_dialog(_('File not versioned'),
148
 
                             _('The selected file is not versioned.'))
149
 
                return
 
133
            self.wt.remove(os.path.join(self.wtpath, filename))
150
134
        elif self._radio_added.get_active():
151
135
            # Remove added files recursively
152
136
            added = self.wt.changes_from(self.wt.basis_tree()).added