/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-13 20:19:31 UTC
  • mfrom: (0.8.79 main)
  • mto: (0.8.83 merge)
  • mto: This revision was merged to the branch mainline in revision 83.
  • Revision ID: jelmer@samba.org-20060913201931-23adba246d4d6529
Merge main branch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
    pygtk.require("2.0")
23
23
except:
24
24
    pass
25
 
 
26
 
import gtk
27
 
import gtk.glade
 
25
try:
 
26
    import gtk
 
27
    import gtk.glade
 
28
except:
 
29
    sys.exit(1)
28
30
 
29
31
import bzrlib.errors as errors
30
32
 
31
33
class OliveRename:
32
34
    """ Display the Rename dialog and perform the needed actions. """
33
 
    def __init__(self, comm):
 
35
    def __init__(self, gladefile, comm, dialog):
34
36
        """ Initialize the Rename dialog. """
35
 
        self.glade = gtk.glade.XML(gladefile, 'window_rename')
 
37
        self.gladefile = gladefile
 
38
        self.glade = gtk.glade.XML(self.gladefile, 'window_rename')
36
39
        
37
40
        # Communication object
38
41
        self.comm = comm
 
42
        # Dialog object
 
43
        self.dialog = dialog
39
44
        
40
45
        self.window = self.glade.get_widget('window_rename')
41
46
        
58
63
        new_filename = entry.get_text()
59
64
            
60
65
        if old_filename is None:
61
 
            error_dialog(_('No file was selected'),
 
66
            self.dialog.error_dialog(_('No file was selected'),
62
67
                                     _('Please select a file from the list to proceed.'))
63
68
            return
64
69
        
65
70
        if new_filename == "":
66
 
            error_dialog(_('Filename not given'),
 
71
            self.dialog.error_dialog(_('Filename not given'),
67
72
                                     _('Please specify a new name for the file.'))
68
73
            return
69
74
        
76
81
            wt2, path2 = WorkingTree.open_containing(source)
77
82
 
78
83
            if wt1.base != wt2.base:
79
 
                error_dialog(_('Not the same branch'),
 
84
                self.dialog.error_dialog(_('Not the same branch'),
80
85
                                         _('The destination is not in the same branch.'))
81
86
                return
82
87
            wt1.rename_one(source, destination)
83
88
        except errors.NotBranchError:
84
 
            error_dialog(_('File is not in a branch'),
 
89
            self.dialog.error_dialog(_('File is not in a branch'),
85
90
                                     _('The selected file is not in a branch.'))
86
91
            return
87
92