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