aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomasz Sterna <tomek@xiaoka.com>2011-11-14 22:43:34 +0100
committerTomasz Sterna <tomek@xiaoka.com>2011-11-14 22:43:34 +0100
commitfdbf48b0e421978739aafcdde3aeb0d35d02c8a9 (patch)
treed76bd8a9af75dcef95fa04cefc3822932bf401a4
parentb30fe1d6a992140d9434774c2afdc52cea68d24a (diff)
Merged hildonuimode.patch
-rw-r--r--hildon/hildon-picker-dialog.c7
-rw-r--r--hildon/hildon-touch-selector-entry.c6
-rw-r--r--hildon/hildon-touch-selector-entry.h2
-rw-r--r--hildon/hildon-touch-selector.c31
-rw-r--r--hildon/hildon-touch-selector.h3
5 files changed, 39 insertions, 10 deletions
diff --git a/hildon/hildon-picker-dialog.c b/hildon/hildon-picker-dialog.c
index bf3ab95..797a549 100644
--- a/hildon/hildon-picker-dialog.c
+++ b/hildon/hildon-picker-dialog.c
@@ -456,8 +456,9 @@ selection_completed (HildonPickerDialog *dialog)
GList *list;
gint i, n_cols;
gboolean all_selected = TRUE;
+#ifdef MAEMO_GTK
HildonUIMode mode = HILDON_UI_MODE_NORMAL;
-
+#endif
priv = HILDON_PICKER_DIALOG_GET_PRIVATE (dialog);
if (HILDON_IS_TOUCH_SELECTOR_ENTRY (priv->selector)) {
@@ -469,12 +470,12 @@ selection_completed (HildonPickerDialog *dialog)
return TRUE;
}
}
-
+#ifdef MAEMO_GTK
mode = hildon_touch_selector_get_hildon_ui_mode (HILDON_TOUCH_SELECTOR (priv->selector));
if (mode == HILDON_UI_MODE_NORMAL) {
return TRUE;
}
-
+#endif
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);
diff --git a/hildon/hildon-touch-selector-entry.c b/hildon/hildon-touch-selector-entry.c
index efc85a1..5e9c9a6 100644
--- a/hildon/hildon-touch-selector-entry.c
+++ b/hildon/hildon-touch-selector-entry.c
@@ -247,7 +247,9 @@ hildon_touch_selector_entry_init (HildonTouchSelectorEntry *self)
{
HildonTouchSelectorEntryPrivate *priv;
GtkEntryCompletion *completion;
+#ifdef MAEMO_GTK
HildonGtkInputMode input_mode;
+#endif
priv = HILDON_TOUCH_SELECTOR_ENTRY_GET_PRIVATE (self);
@@ -255,6 +257,7 @@ hildon_touch_selector_entry_init (HildonTouchSelectorEntry *self)
priv->entry = hildon_entry_new (HILDON_SIZE_FINGER_HEIGHT);
gtk_entry_set_activates_default (GTK_ENTRY (priv->entry), TRUE);
+#ifdef MAEMO_GTK
input_mode = hildon_gtk_entry_get_input_mode (GTK_ENTRY (priv->entry));
/* Disable unsupported input modes. */
@@ -263,6 +266,7 @@ hildon_touch_selector_entry_init (HildonTouchSelectorEntry *self)
input_mode &= ~HILDON_GTK_INPUT_MODE_DICTIONARY;
hildon_gtk_entry_set_input_mode (GTK_ENTRY (priv->entry), input_mode);
+#endif
completion = gtk_entry_completion_new ();
gtk_entry_completion_set_inline_completion (completion, TRUE);
@@ -404,6 +408,7 @@ hildon_touch_selector_entry_get_text_column (HildonTouchSelectorEntry *selector)
return text_column;
}
+#ifdef MAEMO_GTK
/**
* hildon_touch_selector_entry_set_input_mode:
* @selector: a #HildonTouchSelectorEntry
@@ -458,6 +463,7 @@ hildon_touch_selector_entry_get_input_mode (HildonTouchSelectorEntry * selector)
return hildon_gtk_entry_get_input_mode (GTK_ENTRY (priv->entry));
}
+#endif
static void
entry_on_text_changed (GtkEditable * editable,
diff --git a/hildon/hildon-touch-selector-entry.h b/hildon/hildon-touch-selector-entry.h
index a244330..b8bc4f8 100644
--- a/hildon/hildon-touch-selector-entry.h
+++ b/hildon/hildon-touch-selector-entry.h
@@ -79,12 +79,14 @@ hildon_touch_selector_entry_set_text_column (HildonTouchSelectorEntry *selec
gint
hildon_touch_selector_entry_get_text_column (HildonTouchSelectorEntry *selector);
+#ifdef MAEMO_GTK
HildonGtkInputMode
hildon_touch_selector_entry_get_input_mode (HildonTouchSelectorEntry * selector);
void
hildon_touch_selector_entry_set_input_mode (HildonTouchSelectorEntry * selector,
HildonGtkInputMode input_mode);
+#endif
HildonEntry *
hildon_touch_selector_entry_get_entry (HildonTouchSelectorEntry * selector);
diff --git a/hildon/hildon-touch-selector.c b/hildon/hildon-touch-selector.c
index 96d09d8..2a04ead 100644
--- a/hildon/hildon-touch-selector.c
+++ b/hildon/hildon-touch-selector.c
@@ -232,15 +232,18 @@ struct _HildonTouchSelectorPrivate
HildonTouchSelectorPrintFunc print_func;
gpointer print_user_data;
GDestroyNotify print_destroy_func;
-
+#ifdef MAEMO_GTK
HildonUIMode hildon_ui_mode;
+#endif
};
enum
{
PROP_HAS_MULTIPLE_SELECTION = 1,
PROP_INITIAL_SCROLL,
+#ifdef MAEMO_GTK
PROP_HILDON_UI_MODE,
+#endif
PROP_LIVE_SEARCH
};
@@ -437,6 +440,7 @@ hildon_touch_selector_class_init (HildonTouchSelectorClass * class)
TRUE,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
+#ifdef MAEMO_GTK
/**
* HildonTouchSelector:hildon-ui-mode:
*
@@ -463,7 +467,7 @@ hildon_touch_selector_class_init (HildonTouchSelectorClass * class)
HILDON_TYPE_UI_MODE,
HILDON_UI_MODE_EDIT,
G_PARAM_READWRITE));
-
+#endif
g_object_class_install_property (G_OBJECT_CLASS (gobject_class),
PROP_LIVE_SEARCH,
g_param_spec_boolean ("live-search",
@@ -499,9 +503,11 @@ hildon_touch_selector_get_property (GObject * object,
case PROP_INITIAL_SCROLL:
g_value_set_boolean (value, priv->initial_scroll);
break;
+#ifdef MAEMO_GTK
case PROP_HILDON_UI_MODE:
g_value_set_enum (value, priv->hildon_ui_mode);
break;
+#endif
case PROP_LIVE_SEARCH:
g_value_set_boolean (value,
hildon_touch_selector_get_live_search (HILDON_TOUCH_SELECTOR (object)));
@@ -522,10 +528,12 @@ hildon_touch_selector_set_property (GObject *object, guint prop_id,
case PROP_INITIAL_SCROLL:
priv->initial_scroll = g_value_get_boolean (value);
break;
+#ifdef MAEMO_GTK
case PROP_HILDON_UI_MODE:
hildon_touch_selector_set_hildon_ui_mode (HILDON_TOUCH_SELECTOR (object),
g_value_get_enum (value));
break;
+#endif
case PROP_LIVE_SEARCH:
hildon_touch_selector_set_live_search (HILDON_TOUCH_SELECTOR (object),
g_value_get_boolean (value));
@@ -555,8 +563,9 @@ hildon_touch_selector_init (HildonTouchSelector * selector)
selector->priv->hbox = gtk_hbox_new (FALSE, 0);
selector->priv->changed_blocked = FALSE;
-
+#ifdef MAEMO_GTK
selector->priv->hildon_ui_mode = HILDON_UI_MODE_EDIT;
+#endif
gtk_box_pack_end (GTK_BOX (selector), selector->priv->hbox,
TRUE, TRUE, 0);
@@ -684,6 +693,7 @@ hildon_touch_selector_emit_value_changed (HildonTouchSelector *selector,
}
}
+#ifdef MAEMO_GTK
static void
hildon_touch_selector_check_ui_mode_coherence (HildonTouchSelector *selector)
{
@@ -693,6 +703,7 @@ hildon_touch_selector_check_ui_mode_coherence (HildonTouchSelector *selector)
hildon_touch_selector_set_hildon_ui_mode (selector, HILDON_UI_MODE_EDIT);
}
}
+#endif
/**
* default_print_func:
@@ -909,8 +920,12 @@ _create_new_column (HildonTouchSelector * selector,
/* select the first item */
*emit_changed = FALSE;
- if ((gtk_tree_model_get_iter_first (filter, &iter))&&
- (selector->priv->hildon_ui_mode == HILDON_UI_MODE_EDIT)) {
+ if ((gtk_tree_model_get_iter_first (filter, &iter))
+#ifdef MAEMO_GTK
+ && (selector->priv->hildon_ui_mode == HILDON_UI_MODE_EDIT)
+#endif
+ )
+ {
gtk_tree_selection_select_iter (selection, &iter);
*emit_changed = TRUE;
}
@@ -1584,9 +1599,9 @@ hildon_touch_selector_append_column (HildonTouchSelector * selector,
colnum = g_slist_length (selector->priv->columns);
hildon_touch_selector_emit_value_changed (selector, colnum);
}
-
+#ifdef MAEMO_GTK
hildon_touch_selector_check_ui_mode_coherence (selector);
-
+#endif
return new_column;
}
@@ -2754,6 +2769,7 @@ hildon_touch_selector_optimal_size_request (HildonTouchSelector *selector,
+#ifdef MAEMO_GTK
/**
* hildon_touch_selector_get_hildon_ui_mode
* @selector: a #HildonTouchSelector
@@ -2824,6 +2840,7 @@ hildon_touch_selector_set_hildon_ui_mode (HildonTouchSelector *selector,
return TRUE;
}
+#endif
/**
* hildon_touch_selector_get_last_activated_row
diff --git a/hildon/hildon-touch-selector.h b/hildon/hildon-touch-selector.h
index eae1add..b6da8f9 100644
--- a/hildon/hildon-touch-selector.h
+++ b/hildon/hildon-touch-selector.h
@@ -223,12 +223,15 @@ void
hildon_touch_selector_optimal_size_request (HildonTouchSelector *selector,
GtkRequisition *requisition);
+#ifdef MAEMO_GTK
HildonUIMode
hildon_touch_selector_get_hildon_ui_mode (HildonTouchSelector *selector);
gboolean
hildon_touch_selector_set_hildon_ui_mode (HildonTouchSelector *selector,
HildonUIMode mode);
+#endif
+
GtkTreePath*
hildon_touch_selector_get_last_activated_row (HildonTouchSelector *selector,
gint column);