/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/branch.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:
31
31
 
32
32
class OliveBranch:
33
33
    """ Display branch dialog and perform the needed operations. """
34
 
    def __init__(self, gladefile, comm, dialog):
 
34
    def __init__(self, gladefile, comm):
35
35
        """ Initialize the Branch dialog. """
36
36
        self.gladefile = gladefile
37
37
        self.glade = gtk.glade.XML(self.gladefile, 'window_branch', 'olive-gtk')
38
38
        
39
39
        # Communication object
40
40
        self.comm = comm
41
 
        # Dialog object
42
 
        self.dialog = dialog
43
41
        
44
42
        self.window = self.glade.get_widget('window_branch')
45
43
        
62
60
        entry_location = self.glade.get_widget('entry_branch_location')
63
61
        location = entry_location.get_text()
64
62
        if location is '':
65
 
            self.dialog.error_dialog(_('Missing branch location'),
 
63
            error_dialog(_('Missing branch location'),
66
64
                                     _('You must specify a branch location.'))
67
65
            return
68
66
        
97
95
                br_from.unlock()
98
96
                
99
97
            self.close()
100
 
            self.dialog.info_dialog(_('Branching successful'),
 
98
            info_dialog(_('Branching successful'),
101
99
                                _('%d revision(s) branched.') % revs)
102
100
            self.comm.refresh_right()
103
101
        except errors.NonExistingSource, errmsg:
104
 
            self.dialog.error_dialog(_('Non existing source'),
 
102
            error_dialog(_('Non existing source'),
105
103
                                     _("The location (%s)\ndoesn't exist.") % errmsg)
106
104
            self.comm.set_busy(self.window, False)
107
105
            return
108
106
        except errors.TargetAlreadyExists, errmsg:
109
 
            self.dialog.error_dialog(_('Target already exists'),
 
107
            error_dialog(_('Target already exists'),
110
108
                                     _('Target directory (%s)\nalready exists. Please select another target.') % errmsg)
111
109
            self.comm.set_busy(self.window, False)
112
110
            return
113
111
        except errors.NonExistingParent, errmsg:
114
 
            self.dialog.error_dialog(_('Non existing parent directory'),
 
112
            error_dialog(_('Non existing parent directory'),
115
113
                                     _("The parent directory (%s)\ndoesn't exist.") % errmsg)
116
114
            self.comm.set_busy(self.window, False)
117
115
            return
118
116
        except errors.NonExistingRevision:
119
 
            self.dialog.error_dialog(_('Non existing revision'),
 
117
            error_dialog(_('Non existing revision'),
120
118
                                     _("The revision you specified doesn't exist."))
121
119
            self.comm.set_busy(self.window, False)
122
120
            return
123
121
        except errors.NotBranchError, errmsg:
124
 
            self.dialog.error_dialog(_('Location is not a branch'),
 
122
            error_dialog(_('Location is not a branch'),
125
123
                                     _('The specified location has to be a branch.'))
126
124
            self.comm.set_busy(self.window, False)
127
125
            return