/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: 2006-09-27 17:49:18 UTC
  • mto: (0.12.2 olive)
  • mto: This revision was merged to the branch mainline in revision 83.
  • Revision ID: jelmer@samba.org-20060927174918-0e5c331b574d16a3
Don't pass along dialog context everywhere.

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
 
33
33
class OliveRemove:
34
34
    """ Display the Remove file(s) dialog and perform the needed actions. """
35
 
    def __init__(self, gladefile, comm, dialog):
 
35
    def __init__(self, gladefile, comm):
36
36
        """ Initialize the Remove file(s) dialog. """
37
37
        self.gladefile = gladefile
38
38
        self.glade = gtk.glade.XML(self.gladefile, 'window_remove')
39
39
        
40
40
        # Communication object
41
41
        self.comm = comm
42
 
        # Dialog object
43
 
        self.dialog = dialog
44
42
        
45
43
        self.window = self.glade.get_widget('window_remove')
46
44
        
67
65
            filename = self.comm.get_selected_right()
68
66
            
69
67
            if filename is None:
70
 
                self.dialog.error_dialog(_('No file was selected'),
 
68
                error_dialog(_('No file was selected'),
71
69
                                         _('Please select a file from the list,\nor choose the other option.'))
72
70
                self.comm.set_busy(self.window, False)
73
71
                return
76
74
                wt, path = WorkingTree.open_containing(directory + '/' + filename)
77
75
                wt.remove(path)
78
76
            except errors.NotBranchError:
79
 
                self.dialog.error_dialog(_('Directory is not a branch'),
 
77
                error_dialog(_('Directory is not a branch'),
80
78
                                         _('You can perform this action only in a branch.'))
81
79
                self.comm.set_busy(self.window, False)
82
80
                return
83
81
            except errors.NotVersionedError:
84
 
                self.dialog.error_dialog(_('File not versioned'),
 
82
                error_dialog(_('File not versioned'),
85
83
                                         _('The selected file is not versioned.'))
86
84
                self.comm.set_busy(self.window, False)
87
85
                return
92
90
            try:
93
91
                wt, path = WorkingTree.open_containing(directory)
94
92
            except errors.NotBranchError:
95
 
                self.dialog.error_dialog(_('Directory is not a branch'),
 
93
                error_dialog(_('Directory is not a branch'),
96
94
                                         _('You can perform this action only in a branch.'))
97
95
                self.comm.set_busy(self.window, False)
98
96
                return
99
 
            except:
100
 
                raise
101
97
            
102
98
            added = wt.changes_from(wt.basis_tree()).added
103
99
            file_list = sorted([f[0] for f in added], reverse=True)