aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlberto Garcia <agarcia@igalia.com>2009-11-10 13:37:57 +0100
committerClaudio Saavedra <csaavedra@igalia.com>2009-12-07 17:24:59 +0200
commitf9276e297fc8bc3125187c0ee08219549d95bd44 (patch)
treef7371e4776ae98ca8ab851e3e85cc1c7033934e3
parentc331d4e2b4675d73ff2c6fee4a0b1b9226f9ef25 (diff)
Don't emit HildonTouchSelector:changed unless necessary
When a HildonPickerDialog is cancelled, the original selection in its HildonTouchSelector doesn't need to be restored in all cases. If the dialog doesn't have a "Done" button then there's no way to change its selection without closing it, thus it's not necessary to restore anything. This was causing an unnecessary emission of HildonTouchSelector:changed than could confuse the application. Fixes: NB#145156 (HildonPickerDialog: Entered Skype contact name disappears from dialpad input box when call type dialog is opened and cancelled) Signed-off-by: Claudio Saavedra <csaavedra@igalia.com>
-rw-r--r--hildon/hildon-picker-dialog.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/hildon/hildon-picker-dialog.c b/hildon/hildon-picker-dialog.c
index 843f0b6..5466cc0 100644
--- a/hildon/hildon-picker-dialog.c
+++ b/hildon/hildon-picker-dialog.c
@@ -454,12 +454,15 @@ _on_dialog_response (GtkDialog *dialog,
gint response_id,
gpointer data)
{
+ HildonPickerDialog *picker = HILDON_PICKER_DIALOG (dialog);
if (response_id == GTK_RESPONSE_OK) {
- if (selection_completed (HILDON_PICKER_DIALOG (dialog)) == FALSE) {
+ if (selection_completed (picker) == FALSE) {
g_signal_stop_emission_by_name (dialog, "response");
}
} else if (response_id == GTK_RESPONSE_DELETE_EVENT) {
- _restore_current_selection (HILDON_PICKER_DIALOG (dialog));
+ if (requires_done_button (picker)) {
+ _restore_current_selection (picker);
+ }
}
}