43
43
def __init__(self, gladefile, comm, dialog):
44
44
""" Initialize the Commit dialog. """
45
45
self.gladefile = gladefile
46
self.glade = gtk.glade.XML(self.gladefile, 'window_commit')
46
self.glade = gtk.glade.XML(self.gladefile, 'window_commit', 'olive-gtk')
48
48
# Communication object
51
51
self.dialog = dialog
53
# Get the Commit dialog widget
53
# Get some important widgets
54
54
self.window = self.glade.get_widget('window_commit')
55
self.checkbutton_local = self.glade.get_widget('checkbutton_commit_local')
56
self.textview = self.glade.get_widget('textview_commit')
57
self.file_view = self.glade.get_widget('treeview_commit_select')
56
59
# Check if current location is a branch
87
90
# Create the file list
88
91
self._create_file_view()
90
# Some additional widgets
91
self.checkbutton_local = self.glade.get_widget('checkbutton_commit_local')
92
self.textview = self.glade.get_widget('textview_commit')
95
94
""" Display the Push dialog. """
97
self.dialog.error_dialog('Directory is not a branch',
98
'You can perform this action only in a branch.')
96
self.dialog.error_dialog(_('Directory is not a branch'),
97
_('You can perform this action only in a branch.'))
101
100
from olive.backend.info import is_checkout
112
111
self.file_store = gtk.ListStore(gobject.TYPE_BOOLEAN,
113
112
gobject.TYPE_STRING,
114
113
gobject.TYPE_STRING)
115
self.file_view = self.glade.get_widget('treeview_commit_select')
116
114
self.file_view.set_model(self.file_store)
117
115
crt = gtk.CellRendererToggle()
118
116
crt.set_property("activatable", True)
119
117
crt.connect("toggled", self._toggle_commit, self.file_store)
120
self.file_view.append_column(gtk.TreeViewColumn("Commit",
118
self.file_view.append_column(gtk.TreeViewColumn(_('Commit'),
122
self.file_view.append_column(gtk.TreeViewColumn("Path",
120
self.file_view.append_column(gtk.TreeViewColumn(_('Path'),
123
121
gtk.CellRendererText(), text=1))
124
self.file_view.append_column(gtk.TreeViewColumn("Type",
122
self.file_view.append_column(gtk.TreeViewColumn(_('Type'),
125
123
gtk.CellRendererText(), text=2))
127
for path, _, _ in self.delta.added:
128
self.file_store.append([ True, path, "added" ])
130
for path, _, _ in self.delta.removed:
131
self.file_store.append([ True, path, "removed" ])
133
for oldpath, _, _, _, _, _ in self.delta.renamed:
134
self.file_store.append([ True, oldpath, "renamed"])
136
for path, _, _, _, _ in self.delta.modified:
137
self.file_store.append([ True, path, "modified"])
125
for path, id, kind in self.delta.added:
126
self.file_store.append([ True, path, _('added') ])
128
for path, id, kind in self.delta.removed:
129
self.file_store.append([ True, path, _('removed') ])
131
for oldpath, newpath, id, kind, text_modified, meta_modified in self.delta.renamed:
132
self.file_store.append([ True, oldpath, _('renamed') ])
134
for path, id, kind, text_modified, meta_modified in self.delta.modified:
135
self.file_store.append([ True, path, _('modified') ])
139
137
def _get_specific_files(self):
170
168
local=self.checkbutton_local.get_active(),
171
169
specific_files=specific_files)
172
170
except errors.NotBranchError:
173
self.dialog.error_dialog('Directory is not a branch',
174
'You can perform this action only in a branch.')
171
self.dialog.error_dialog(_('Directory is not a branch'),
172
_('You can perform this action only in a branch.'))
175
173
self.comm.set_busy(self.window, False)
177
175
except errors.LocalRequiresBoundBranch:
178
self.dialog.error_dialog('Directory is not a checkout',
179
'You can perform local commit only on checkouts.')
176
self.dialog.error_dialog(_('Directory is not a checkout'),
177
_('You can perform local commit only on checkouts.'))
180
178
self.comm.set_busy(self.window, False)
182
180
except errors.PointlessCommit:
183
self.dialog.error_dialog('No changes to commit',
184
'Try force commit if you want to commit anyway.')
181
self.dialog.error_dialog(_('No changes to commit'),
182
_('Try force commit if you want to commit anyway.'))
185
183
self.comm.set_busy(self.window, False)
187
185
except errors.ConflictsInTree:
188
self.dialog.error_dialog('Conflicts in tree'
189
'You need to resolve the conflicts before committing.')
186
self.dialog.error_dialog(_('Conflicts in tree'),
187
_('You need to resolve the conflicts before committing.'))
190
188
self.comm.set_busy(self.window, False)
192
190
except errors.StrictCommitFailed:
193
self.dialog.error_dialog('Strict commit failed'
194
'There are unknown files in the working tree.\nPlease add or delete them.')
191
self.dialog.error_dialog(_('Strict commit failed'),
192
_('There are unknown files in the working tree.\nPlease add or delete them.'))
195
193
self.comm.set_busy(self.window, False)
197
195
except errors.BoundBranchOutOfDate, errmsg:
198
self.dialog.error_dialog('Bound branch is out of date',
196
self.dialog.error_dialog(_('Bound branch is out of date'),
200
198
self.comm.set_busy(self.window, False)