Play sounds with "module-stream-restore.id" set to "x-maemo-system-sound"
[hildon] / hildon / hildon-picker-dialog.c
index 87afb52..0947877 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is a part of hildon
  *
- * Copyright (C) 2005, 2008 Nokia Corporation.
+ * Copyright (C) 2005, 2008, 2009 Nokia Corporation.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -239,6 +239,8 @@ hildon_picker_dialog_init (HildonPickerDialog * dialog)
   dialog->priv->button =
     gtk_dialog_add_button (GTK_DIALOG (dialog), "", GTK_RESPONSE_OK);
   gtk_widget_grab_default (dialog->priv->button);
+  gtk_button_set_focus_on_click (GTK_BUTTON (dialog->priv->button), FALSE);
+  gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE);
 
   dialog->priv->signal_changed_id = 0;
   dialog->priv->signal_columns_changed_id = 0;
@@ -414,9 +416,15 @@ selection_completed (HildonPickerDialog *dialog)
   GList *list;
   gint i, n_cols;
   gboolean all_selected = TRUE;
+  HildonUIMode mode = HILDON_UI_MODE_NORMAL;
 
   priv = HILDON_PICKER_DIALOG_GET_PRIVATE (dialog);
 
+  mode = hildon_touch_selector_get_hildon_ui_mode (HILDON_TOUCH_SELECTOR (priv->selector));
+  if (mode == HILDON_UI_MODE_NORMAL) {
+    return TRUE;
+  }
+
   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);
@@ -542,7 +550,7 @@ _save_current_selection (HildonPickerDialog *dialog)
   }
   if (HILDON_IS_TOUCH_SELECTOR_ENTRY (selector)) {
          HildonEntry *entry = hildon_touch_selector_entry_get_entry (HILDON_TOUCH_SELECTOR_ENTRY (selector));
-         dialog->priv->current_text = g_strdup (hildon_entry_get_text (entry));
+         dialog->priv->current_text = g_strdup (gtk_entry_get_text (GTK_ENTRY (entry)));
   }
 }
 
@@ -588,7 +596,7 @@ _restore_current_selection (HildonPickerDialog *dialog)
   }
   if (HILDON_IS_TOUCH_SELECTOR_ENTRY (selector) && dialog->priv->current_text != NULL) {
     HildonEntry *entry = hildon_touch_selector_entry_get_entry (HILDON_TOUCH_SELECTOR_ENTRY (selector));
-    hildon_entry_set_text (entry, dialog->priv->current_text);
+    gtk_entry_set_text (GTK_ENTRY (entry), dialog->priv->current_text);
   }
   if (dialog->priv->signal_changed_id)
     g_signal_handler_unblock (selector, dialog->priv->signal_changed_id);
@@ -605,10 +613,8 @@ static void
 prepare_action_area (HildonPickerDialog *dialog)
 {
   if (requires_done_button (dialog)) {
-    gtk_dialog_set_has_separator (GTK_DIALOG (dialog), TRUE);
     gtk_widget_show (GTK_DIALOG (dialog)->action_area);
   } else {
-    gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE);
     gtk_widget_hide (GTK_DIALOG (dialog)->action_area);
   }
 }