/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 20:30:59 UTC
  • mto: (0.12.2 olive)
  • mto: This revision was merged to the branch mainline in revision 83.
  • Revision ID: jelmer@samba.org-20060927203059-85792ae0a81db524
Bunch of small fixes, cleanups and simplifications.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
    import pygtk
21
21
    pygtk.require("2.0")
22
22
except:
23
 
    pass
 
23
        pass
 
24
 
24
25
import gtk
25
26
import gtk.glade
26
27
 
31
32
 
32
33
class OliveRemove:
33
34
    """ Display the Remove file(s) dialog and perform the needed actions. """
34
 
    def __init__(self, comm):
 
35
    def __init__(self):
35
36
        """ Initialize the Remove file(s) dialog. """
36
37
        self.glade = gtk.glade.XML(gladefile, 'window_remove')
37
38
        
57
58
        
58
59
        directory = self.comm.get_path()
59
60
        
60
 
        self.comm.set_busy(self.window)
61
61
        if radio_selected.get_active():
62
62
            # Remove only the selected file
63
63
            filename = self.comm.get_selected_right()
65
65
            if filename is None:
66
66
                error_dialog(_('No file was selected'),
67
67
                                         _('Please select a file from the list,\nor choose the other option.'))
68
 
                self.comm.set_busy(self.window, False)
69
68
                return
70
69
            
71
70
            try:
74
73
            except errors.NotBranchError:
75
74
                error_dialog(_('Directory is not a branch'),
76
75
                                         _('You can perform this action only in a branch.'))
77
 
                self.comm.set_busy(self.window, False)
78
76
                return
79
77
            except errors.NotVersionedError:
80
78
                error_dialog(_('File not versioned'),
81
79
                                         _('The selected file is not versioned.'))
82
 
                self.comm.set_busy(self.window, False)
83
80
                return
84
 
            except:
85
 
                raise
86
81
        elif radio_new.get_active():
87
82
            # Remove added files recursively
88
83
            try:
101
96
                self.comm.set_busy(self.window, False)
102
97
                return
103
98
            wt.remove(file_list)
104
 
        else:
105
 
            # This should really never happen.
106
 
            pass
107
99
        
108
100
        self.close()
109
101
        self.comm.refresh_right()