/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/add.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 OliveAdd:
34
34
    """ Display the Add 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 Add file(s) dialog. """
37
37
        self.gladefile = gladefile
38
38
        self.glade = gtk.glade.XML(self.gladefile, 'window_add', 'olive-gtk')
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_add')
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
75
73
            try:
76
74
                bzrlib.add.smart_add([directory + '/' + filename])
77
75
            except errors.NotBranchError:
78
 
                self.dialog.error_dialog(_('Directory is not a branch'),
 
76
                error_dialog(_('Directory is not a branch'),
79
77
                                         _('You can perform this action only in a branch.'))
80
78
                self.comm.set_busy(self.window, False)
81
79
                return
86
84
            try:
87
85
                bzrlib.add.smart_add([directory], True)
88
86
            except errors.NotBranchError:
89
 
                self.dialog.error_dialog(_('Directory is not a branch'),
 
87
                error_dialog(_('Directory is not a branch'),
90
88
                                         _('You can perform this action only in a branch.'))
91
89
                self.comm.set_busy(self.window, False)
92
90
                return