+2009-01-20 Alejandro G. Castro <alex@igalia.com>
+
+ * src/hildon-time-selector.c,
+ (hildon_time_selector_class_init),
+ (hildon_time_selector_constructor),
+ (hildon_time_selector_init): Overrided the construct function when
+ creating the time selector object. We have moved the minutes model
+ handling code from the init to the new construction function:
+ hildon_time_selector_constructor.
+
2009-01-20 Claudio Saavedra <csaavedra@igalia.com>
* examples/hildon-date-button-example.c: (main): Use the new
};
static void hildon_time_selector_finalize (GObject * object);
+static GObject* hildon_time_selector_constructor (GType type,
+ guint n_construct_properties,
+ GObjectConstructParam *construct_params);
/* private functions */
static GtkTreeModel *_create_hours_model (HildonTimeSelector * selector);
container_class = (GtkContainerClass *) class;
/* GObject */
+ gobject_class->constructor = hildon_time_selector_constructor;
gobject_class->finalize = hildon_time_selector_finalize;
/* GtkWidget */
g_type_class_add_private (object_class, sizeof (HildonTimeSelectorPrivate));
}
+static GObject*
+hildon_time_selector_constructor (GType type,
+ guint n_construct_properties,
+ GObjectConstructParam *construct_params)
+{
+ GObject *object;
+ HildonTimeSelector *selector;
+ HildonTouchSelectorColumn *column;
+
+ object = (* G_OBJECT_CLASS (hildon_time_selector_parent_class)->constructor)
+ (type, n_construct_properties, construct_params);
+
+ selector = HILDON_TIME_SELECTOR (object);
+
+ /* we need initialization parameters in order to create minute models*/
+ selector->priv->minutes_model = _create_minutes_model (selector);
+
+ column = hildon_touch_selector_append_text_column (HILDON_TOUCH_SELECTOR (selector),
+ selector->priv->minutes_model, TRUE);
+ g_object_set (column, "text-column", 0, NULL);
+
+ /* By default we should select the current day */
+ hildon_time_selector_set_time (selector,
+ selector->priv->creation_hours,
+ selector->priv->creation_minutes);
+
+ return object;
+
+}
static void
hildon_time_selector_init (HildonTimeSelector * selector)
_check_ampm_format (selector);
selector->priv->hours_model = _create_hours_model (selector);
- selector->priv->minutes_model = _create_minutes_model (selector);
column = hildon_touch_selector_append_text_column (HILDON_TOUCH_SELECTOR (selector),
selector->priv->hours_model, TRUE);
g_object_set (column, "text-column", 0, NULL);
- column = hildon_touch_selector_append_text_column (HILDON_TOUCH_SELECTOR (selector),
- selector->priv->minutes_model, TRUE);
- g_object_set (column, "text-column", 0, NULL);
if (selector->priv->ampm_format) {
selector->priv->ampm_model = _create_ampm_model (selector);
NULL);
}
- /* By default we should select the current day */
- hildon_time_selector_set_time (selector,
- selector->priv->creation_hours,
- selector->priv->creation_minutes);
-
}
static void