/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/move.py

  • Committer: Jelmer Vernooij
  • Date: 2006-09-30 10:21:43 UTC
  • Revision ID: jelmer@samba.org-20060930102143-c0ef64d6ca860c21
Merge some files from Olive and bzr-gtk.

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
 
 
31
from olive import gladefile
 
32
 
33
33
class OliveMove:
34
34
    """ Display the Move dialog and perform the needed actions. """
35
 
    def __init__(self, gladefile, comm, dialog):
 
35
    def __init__(self, comm):
36
36
        """ Initialize the Move dialog. """
37
 
        self.gladefile = gladefile
38
 
        self.glade = gtk.glade.XML(self.gladefile, 'window_move', 'olive-gtk')
 
37
        self.glade = gtk.glade.XML(gladefile, 'window_move', 'olive-gtk')
39
38
        
40
39
        # Communication object
41
40
        self.comm = comm
42
 
        # Dialog object
43
 
        self.dialog = dialog
44
41
        
45
42
        self.window = self.glade.get_widget('window_move')
46
43
        
65
62
        filename = self.comm.get_selected_right()
66
63
            
67
64
        if filename is None:
68
 
            self.dialog.error_dialog(_('No file was selected'),
 
65
            error_dialog(_('No file was selected'),
69
66
                                     _('Please select a file from the list to proceed.'))
70
67
            return
71
68
        
76
73
            wt1, path1 = WorkingTree.open_containing(source)
77
74
            wt2, path2 = WorkingTree.open_containing(destination)
78
75
            if wt1.base != wt2.base:
79
 
                self.dialog.error_dialog(_('Not the same branch'),
 
76
                error_dialog(_('Not the same branch'),
80
77
                                         _('The destination is not in the same branch.'))
81
78
                return
82
79
 
83
80
            wt1.move([source], destination)
84
81
        except errors.NotBranchError:
85
 
            self.dialog.error_dialog(_('File is not in a branch'),
 
82
            error_dialog(_('File is not in a branch'),
86
83
                                     _('The selected file is not in a branch.'))
87
84
            return
88
85