/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: Szilveszter Farkas (Phanatic)
  • Date: 2006-09-29 09:31:57 UTC
  • mfrom: (0.12.2 olive)
  • mto: (0.14.3 main)
  • mto: This revision was merged to the branch mainline in revision 83.
  • Revision ID: Szilveszter.Farkas@gmail.com-20060929093157-da322bf8ce59c456
Merge from Jelmer Vernooij's integration 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
 
try:
26
 
    import gtk
27
 
    import gtk.glade
28
 
except:
29
 
    sys.exit(1)
 
25
 
 
26
import gtk
 
27
import gtk.glade
30
28
 
31
29
import bzrlib.errors as errors
32
30
 
33
31
class OliveRename:
34
32
    """ Display the Rename dialog and perform the needed actions. """
35
 
    def __init__(self, gladefile, comm, dialog):
 
33
    def __init__(self, comm):
36
34
        """ Initialize the Rename dialog. """
37
 
        self.gladefile = gladefile
38
 
        self.glade = gtk.glade.XML(self.gladefile, 'window_rename')
 
35
        self.glade = gtk.glade.XML(gladefile, 'window_rename')
39
36
        
40
37
        # Communication object
41
38
        self.comm = comm
42
 
        # Dialog object
43
 
        self.dialog = dialog
44
39
        
45
40
        self.window = self.glade.get_widget('window_rename')
46
41
        
63
58
        new_filename = entry.get_text()
64
59
            
65
60
        if old_filename is None:
66
 
            self.dialog.error_dialog(_('No file was selected'),
 
61
            error_dialog(_('No file was selected'),
67
62
                                     _('Please select a file from the list to proceed.'))
68
63
            return
69
64
        
70
65
        if new_filename == "":
71
 
            self.dialog.error_dialog(_('Filename not given'),
 
66
            error_dialog(_('Filename not given'),
72
67
                                     _('Please specify a new name for the file.'))
73
68
            return
74
69
        
81
76
            wt2, path2 = WorkingTree.open_containing(source)
82
77
 
83
78
            if wt1.base != wt2.base:
84
 
                self.dialog.error_dialog(_('Not the same branch'),
 
79
                error_dialog(_('Not the same branch'),
85
80
                                         _('The destination is not in the same branch.'))
86
81
                return
87
82
            wt1.rename_one(source, destination)
88
83
        except errors.NotBranchError:
89
 
            self.dialog.error_dialog(_('File is not in a branch'),
 
84
            error_dialog(_('File is not in a branch'),
90
85
                                     _('The selected file is not in a branch.'))
91
86
            return
92
87