2009-03-06 Claudio Saavedra <csaavedra@igalia.com>
+ * src/hildon-picker-dialog.c (hildon_picker_dialog_init):
+ add a current_text field to store the text entered in the
+ touch selector entry.
+ (_clean_current_selection): clean up the current text as well.
+ (_save_current_selection), (_restore_current_selection):
+ Save/restore the text in the entry if the selector is a
+ HildonTouchSelectorEntry.
+
+ Fixes: NB#102541 (value entered in the touch selector entry is not
+ shown when opened for second time)
+
+2009-03-06 Claudio Saavedra <csaavedra@igalia.com>
+
* doc/hildon-sections.txt:
* src/hildon-touch-selector-entry.c
(+hildon_touch_selector_entry_get_entry):
#include <libintl.h>
#include "hildon-touch-selector.h"
+#include "hildon-touch-selector-entry.h"
#include "hildon-picker-dialog.h"
#define _(String) dgettext("hildon-libs", String)
gboolean center_on_show;
GSList *current_selection;
+ gchar *current_text;
};
/* properties */
dialog->priv->signal_columns_changed_id = 0;
dialog->priv->center_on_show = TRUE;
dialog->priv->current_selection = NULL;
+ dialog->priv->current_text = NULL;
g_signal_connect (G_OBJECT (dialog),
"response", G_CALLBACK (_on_dialog_response),
g_slist_free (dialog->priv->current_selection);
dialog->priv->current_selection = NULL;
}
+ if (dialog->priv->current_text) {
+ g_free (dialog->priv->current_text);
+ dialog->priv->current_text = NULL;
+ }
}
static void
= g_slist_append (dialog->priv->current_selection,
hildon_touch_selector_get_selected_rows (selector, i));
}
+ 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));
+ }
}
static void
hildon_touch_selector_select_iter (selector, i, &tree_iter, FALSE);
}
}
+ 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);
+ }
if (dialog->priv->signal_changed_id)
g_signal_handler_unblock (selector, dialog->priv->signal_changed_id);
}