From 79e9d96b396ea2051d3fc65a4fab2dbab088a552 Mon Sep 17 00:00:00 2001 From: Denis Fomin Date: Sun, 20 Mar 2011 00:06:33 +0300 Subject: [PATCH] set focus to ok button in delete confirmation dialog(history manager) --- src/history_manager.py | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/src/history_manager.py b/src/history_manager.py index ce8f5841a..c4738185d 100644 --- a/src/history_manager.py +++ b/src/history_manager.py @@ -570,12 +570,14 @@ class HistoryManager: self.AT_LEAST_ONE_DELETION_DONE = True 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 contacts?', - paths_len) - dialogs.ConfirmationDialog(pri_text, - _('This is an irreversible operation.'), on_response_ok = (on_ok, - liststore, list_of_paths)) + 'Do you really want to delete logs of the selected contact?', + 'Do you really want to delete logs of the selected contacts?', + paths_len) + dialog = dialogs.ConfirmationDialog(pri_text, + _('This is an irreversible operation.'), on_response_ok = (on_ok, + 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): paths_len = len(list_of_paths) @@ -606,11 +608,13 @@ class HistoryManager: pri_text = i18n.ngettext( - 'Do you really want to delete the selected message?', - 'Do you really want to delete the selected messages?', paths_len) - dialogs.ConfirmationDialog(pri_text, - _('This is an irreversible operation.'), on_response_ok = (on_ok, - liststore, list_of_paths)) + 'Do you really want to delete the selected message?', + 'Do you really want to delete the selected messages?', paths_len) + dialog = dialogs.ConfirmationDialog(pri_text, + _('This is an irreversible operation.'), on_response_ok = (on_ok, + 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): text = self.search_entry.get_text().decode('utf-8')