From a28df9dda5d8babca7cdfc792a5a3920f5fe91a0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Alejandro=20Pi=C3=B1eiro?= Date: Wed, 3 Sep 2008 10:59:48 +0000 Subject: [PATCH] 2008-09-03 Alejandro Pinheiro * src/hildon-touch-selector.c (hildon_date_touch_selector_get_selected): fix the selection mode check, in order to allow use this function on multiple row selection mode if the column is different that the first one Fixes: NB#88047 --- ChangeLog | 8 ++++++++ src/hildon-touch-selector.c | 17 +++++++++++------ 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 29009fa..03bb98e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2008-09-03 Alejandro Pinheiro + + * src/hildon-touch-selector.c + (hildon_date_touch_selector_get_selected): fix the selection mode check, + in order to allow use this function on multiple row selection mode if + the column is different that the first one + Fixes: NB#88047 + 2008-09-03 Claudio Saavedra * src/hildon-time-selector.c: (_custom_print_func): Change the logical ids diff --git a/src/hildon-touch-selector.c b/src/hildon-touch-selector.c index d01ba2d..4ad3cc3 100644 --- a/src/hildon-touch-selector.c +++ b/src/hildon-touch-selector.c @@ -894,12 +894,13 @@ hildon_touch_selector_get_print_func (HildonTouchSelector * selector) * @column: the column number we want to get the element * @iter: #GtkTreeIter currently selected * - * Sets @iter to the currently selected node on the nth-column, if selection is set to - * %HILDON_TOUCH_SELECTOR_SINGLE. @iter may be %NULL if you just want to test if selection - * has any selected items. + * Sets @iter to the currently selected node on the nth-column, if selection is + * set to %HILDON_TOUCH_SELECTOR_SINGLE or %HILDON_TOUCH_SELECTOR_MULTIPLE with + * a column different that the first one. @iter may be %NULL if you just want to + * test if selection has any selected items. * * This function will not work if selection is in - * %HILDON_TOUCH_SELECTOR_MULTIPLE mode. + * %HILDON_TOUCH_SELECTOR_MULTIPLE mode and the column is the first one. * * See gtk_tree_selection_get_selected() for more information. * @@ -911,12 +912,16 @@ hildon_touch_selector_get_selected (HildonTouchSelector * selector, { GtkTreeSelection *selection = NULL; SelectorColumn *current_column = NULL; + HildonTouchSelectorSelectionMode mode; g_return_val_if_fail (HILDON_IS_TOUCH_SELECTOR (selector), FALSE); - g_return_val_if_fail (hildon_touch_selector_get_column_selection_mode (selector) - == HILDON_TOUCH_SELECTOR_SELECTION_MODE_SINGLE, FALSE); g_return_val_if_fail (column < hildon_touch_selector_get_num_columns (selector), FALSE); + mode = hildon_touch_selector_get_column_selection_mode (selector); + g_return_val_if_fail + ((mode == HILDON_TOUCH_SELECTOR_SELECTION_MODE_SINGLE) || + ((mode == HILDON_TOUCH_SELECTOR_SELECTION_MODE_MULTIPLE)&&(column>0)), + FALSE); current_column = g_slist_nth_data (selector->priv->columns, column); -- 1.7.9.5