set focus to ok button in delete confirmation dialog(history manager)

This commit is contained in:
Denis Fomin 2011-03-20 00:06:33 +03:00
parent 769ce99f6c
commit 79e9d96b39

View file

@ -570,12 +570,14 @@ class HistoryManager:
self.AT_LEAST_ONE_DELETION_DONE = True self.AT_LEAST_ONE_DELETION_DONE = True
pri_text = i18n.ngettext( pri_text = i18n.ngettext(
'Do you really want to delete logs of the selected contact?', 'Do you really want to delete logs of the selected contact?',
'Do you really want to delete logs of the selected contacts?', 'Do you really want to delete logs of the selected contacts?',
paths_len) paths_len)
dialogs.ConfirmationDialog(pri_text, dialog = dialogs.ConfirmationDialog(pri_text,
_('This is an irreversible operation.'), on_response_ok = (on_ok, _('This is an irreversible operation.'), on_response_ok = (on_ok,
liststore, list_of_paths)) liststore, list_of_paths))
ok_button = dialog.get_children()[0].get_children()[1].get_children()[0]
ok_button.grab_focus()
def _delete_logs(self, liststore, list_of_paths): def _delete_logs(self, liststore, list_of_paths):
paths_len = len(list_of_paths) paths_len = len(list_of_paths)
@ -606,11 +608,13 @@ class HistoryManager:
pri_text = i18n.ngettext( pri_text = i18n.ngettext(
'Do you really want to delete the selected message?', 'Do you really want to delete the selected message?',
'Do you really want to delete the selected messages?', paths_len) 'Do you really want to delete the selected messages?', paths_len)
dialogs.ConfirmationDialog(pri_text, dialog = dialogs.ConfirmationDialog(pri_text,
_('This is an irreversible operation.'), on_response_ok = (on_ok, _('This is an irreversible operation.'), on_response_ok = (on_ok,
liststore, list_of_paths)) liststore, list_of_paths))
ok_button = dialog.get_children()[0].get_children()[1].get_children()[0]
ok_button.grab_focus()
def on_search_db_button_clicked(self, widget): def on_search_db_button_clicked(self, widget):
text = self.search_entry.get_text().decode('utf-8') text = self.search_entry.get_text().decode('utf-8')