98
98
class CommitDialog(gtk.Dialog):
99
99
"""Implementation of Commit."""
101
_question_dialog = question_dialog
101
103
def __init__(self, wt, selected=None, parent=None):
102
104
gtk.Dialog.__init__(self, title="Commit - Olive",
296
300
self._right_pane_table.show()
297
301
self._hpane.pack2(self._right_pane_table, resize=True, shrink=True)
303
def _construct_action_pane(self):
304
self._button_commit = gtk.Button(_("Comm_it"), use_underline=True)
305
self._button_commit.connect('clicked', self._on_commit_clicked)
306
self._button_commit.set_flags(gtk.CAN_DEFAULT)
307
self.action_area.pack_end(self._button_commit)
299
309
def _add_to_right_table(self, widget, weight, expanding=False):
300
310
"""Add another widget to the table
503
513
text_buffer.set_text(message)
504
514
self._last_selected_file = self._files_store.get_path(selection)
517
def _on_commit_clicked(self, button):
518
""" Commit button clicked handler. """
521
def _do_commit(self):
522
buf = self._global_message_text_view.get_buffer()
523
start, end = buf.get_bounds()
524
message = buf.get_text(start, end).decode('utf-8')
527
response = self._question_dialog(
528
_('Commit with an empty message?'),
529
_('You can describe your commit intent in the message.'))
530
if response == gtk.RESPONSE_NO:
531
# Kindly give focus to message area
532
self._global_message_text_view.grab_focus()
535
# if not self.pending:
536
# specific_files = self._get_specific_files()
538
# specific_files = None
540
# if self._is_checkout:
541
# local = self._check_local.get_active()
545
# if list(self._wt.unknowns()) != []:
546
# response = question_dialog(_("Commit with unknowns?"),
547
# _("Unknown files exist in the working tree. Commit anyway?"))
548
# if response == gtk.RESPONSE_NO:
552
specific_files = None
554
rev_id = self._wt.commit(message,
555
allow_pointless=False,
558
specific_files=specific_files)
559
except errors.PointlessCommit:
560
response = question_dialog(_('Commit with no changes?'),
561
_('There are no changes in the working tree.'))
562
if response == gtk.RESPONSE_YES:
563
rev_id = self._wt.commit(message,
564
allow_pointless=True,
567
specific_files=specific_files)
568
self.committed_revision_id = rev_id
569
self.response(gtk.RESPONSE_OK)
507
572
def _rev_to_pending_info(rev):
508
573
"""Get the information from a pending merge."""