/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: 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 OliveRename:
34
34
    """ Display the Rename dialog and perform the needed actions. """
35
 
    def __init__(self, gladefile, comm, dialog):
 
35
    def __init__(self, gladefile, comm):
36
36
        """ Initialize the Rename dialog. """
37
37
        self.gladefile = gladefile
38
38
        self.glade = gtk.glade.XML(self.gladefile, 'window_rename')
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_rename')
46
44
        
63
61
        new_filename = entry.get_text()
64
62
            
65
63
        if old_filename is None:
66
 
            self.dialog.error_dialog(_('No file was selected'),
 
64
            error_dialog(_('No file was selected'),
67
65
                                     _('Please select a file from the list to proceed.'))
68
66
            return
69
67
        
70
68
        if new_filename == "":
71
 
            self.dialog.error_dialog(_('Filename not given'),
 
69
            error_dialog(_('Filename not given'),
72
70
                                     _('Please specify a new name for the file.'))
73
71
            return
74
72
        
81
79
            wt2, path2 = WorkingTree.open_containing(source)
82
80
 
83
81
            if wt1.base != wt2.base:
84
 
                self.dialog.error_dialog(_('Not the same branch'),
 
82
                error_dialog(_('Not the same branch'),
85
83
                                         _('The destination is not in the same branch.'))
86
84
                return
87
85
            wt1.rename_one(source, destination)
88
86
        except errors.NotBranchError:
89
 
            self.dialog.error_dialog(_('File is not in a branch'),
 
87
            error_dialog(_('File is not in a branch'),
90
88
                                     _('The selected file is not in a branch.'))
91
89
            return
92
90