2009-02-23 Claudio Saavedra <csaavedra@igalia.com>
+ * src/hildon-picker-dialog.c (+selection_completed): Returns TRUE
+ if all columns in the selector have an item selected.
+ (_on_dialog_response): Stop "response" signal emission if there is
+ any selector column without selected items.
+
+ Fixes: NB#101889 (Picker dialog should not close when nothing is
+ selected in multiple selection list)
+
+2009-02-23 Claudio Saavedra <csaavedra@igalia.com>
+
* src/hildon-font-selection-dialog.c
(hildon_font_selection_dialog_class_init),
(hildon_font_selection_dialog_init): Remove the preview
gtk_dialog_response (GTK_DIALOG (data), GTK_RESPONSE_OK);
}
+static gboolean
+selection_completed (HildonPickerDialog *dialog)
+{
+ HildonPickerDialogPrivate *priv;
+ GList *list;
+ gint i, n_cols;
+ gboolean all_selected = TRUE;
+
+ priv = HILDON_PICKER_DIALOG_GET_PRIVATE (dialog);
+
+ n_cols = hildon_touch_selector_get_num_columns (HILDON_TOUCH_SELECTOR (priv->selector));
+ for (i = 0; i < n_cols; i++) {
+ list = hildon_touch_selector_get_selected_rows (HILDON_TOUCH_SELECTOR (priv->selector), i);
+ if (list == NULL) {
+ all_selected = FALSE;
+ break;
+ }
+ g_list_foreach (list, (GFunc)gtk_tree_path_free, NULL);
+ g_list_free (list);
+ }
+
+ return all_selected;
+}
+
static void
_on_dialog_response (GtkDialog *dialog,
gint response_id,
gpointer data)
{
- if (response_id == GTK_RESPONSE_DELETE_EVENT) {
+ if (response_id == GTK_RESPONSE_OK) {
+ if (selection_completed (HILDON_PICKER_DIALOG (dialog)) == FALSE) {
+ g_signal_stop_emission_by_name (dialog, "response");
+ }
+ } else if (response_id == GTK_RESPONSE_DELETE_EVENT) {
_restore_current_selection (HILDON_PICKER_DIALOG (dialog));
}
}