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

  • Committer: Jelmer Vernooij
  • Date: 2006-09-27 17:38:39 UTC
  • mto: (0.12.2 olive)
  • mto: This revision was merged to the branch mainline in revision 83.
  • Revision ID: jelmer@samba.org-20060927173839-d584816beceed69a
Start removing dialog context (it's not required).

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
import bzrlib.errors as errors
35
35
from bzrlib.workingtree import WorkingTree
36
36
 
 
37
from dialog import error_dialog
 
38
 
37
39
class OliveCommit:
38
40
    """ Display Commit dialog and perform the needed actions. """
39
 
    def __init__(self, gladefile, wt, wtpath, dialog):
 
41
    def __init__(self, gladefile, wt, wtpath):
40
42
        """ Initialize the Commit dialog. """
41
43
        self.gladefile = gladefile
42
44
        self.glade = gtk.glade.XML(self.gladefile, 'window_commit', 'olive-gtk')
44
46
        self.wt = wt
45
47
        self.wtpath = wtpath
46
48
 
47
 
        # Dialog object
48
 
        self.dialog = dialog
49
 
        
50
49
        # Get some important widgets
51
50
        self.window = self.glade.get_widget('window_commit')
52
51
        self.checkbutton_local = self.glade.get_widget('checkbutton_commit_local')
80
79
    def display(self):
81
80
        """ Display the Push dialog. """
82
81
        if self.notbranch:
83
 
            self.dialog.error_dialog(_('Directory is not a branch'),
 
82
            error_dialog(_('Directory is not a branch'),
84
83
                                     _('You can perform this action only in a branch.'))
85
84
            self.close()
86
85
        else:
151
150
                           local=self.checkbutton_local.get_active(),
152
151
                           specific_files=specific_files)
153
152
        except errors.NotBranchError:
154
 
            self.dialog.error_dialog(_('Directory is not a branch'),
 
153
            error_dialog(_('Directory is not a branch'),
155
154
                                     _('You can perform this action only in a branch.'))
156
155
            return
157
156
        except errors.LocalRequiresBoundBranch:
158
 
            self.dialog.error_dialog(_('Directory is not a checkout'),
 
157
            error_dialog(_('Directory is not a checkout'),
159
158
                                     _('You can perform local commit only on checkouts.'))
160
159
            return
161
160
        except errors.PointlessCommit:
162
 
            self.dialog.error_dialog(_('No changes to commit'),
 
161
            error_dialog(_('No changes to commit'),
163
162
                                     _('Try force commit if you want to commit anyway.'))
164
163
            return
165
164
        except errors.ConflictsInTree:
166
 
            self.dialog.error_dialog(_('Conflicts in tree'),
 
165
            error_dialog(_('Conflicts in tree'),
167
166
                                     _('You need to resolve the conflicts before committing.'))
168
167
            return
169
168
        except errors.StrictCommitFailed:
170
 
            self.dialog.error_dialog(_('Strict commit failed'),
 
169
            error_dialog(_('Strict commit failed'),
171
170
                                     _('There are unknown files in the working tree.\nPlease add or delete them.'))
172
171
            return
173
172
        except errors.BoundBranchOutOfDate, errmsg:
174
 
            self.dialog.error_dialog(_('Bound branch is out of date'),
 
173
            error_dialog(_('Bound branch is out of date'),
175
174
                                     _('%s') % errmsg)
176
175
            return
177
176
        except errors.BzrError, msg:
178
 
            self.dialog.error_dialog(_('Unknown error'), str(msg))
 
177
            error_dialog(_('Unknown error'), str(msg))
179
178
            return
180
179
        
181
180
        self.close()