static osso_context_t *osso_context = NULL;
static void
-on_modest_conf_update_interval_changed (ModestConf* self, const gchar *key,
- ModestConfEvent event, gpointer user_data)
+on_modest_conf_update_interval_changed (ModestConf* self,
+ const gchar *key,
+ ModestConfEvent event,
+ ModestConfNotificationId id,
+ gpointer user_data)
{
if (strcmp (key, MODEST_CONF_UPDATE_INTERVAL) == 0) {
const guint update_interval_minutes =
/* Make sure that the update interval is changed whenever its gconf key
- * is changed: */
+ * is changed */
+ /* CAUTION: we're not using here the
+ modest_conf_listen_to_namespace because we know that there
+ are other parts of Modest listening for this namespace, so
+ we'll receive the notifications anyway. We basically do not
+ use it because there is no easy way to do the
+ modest_conf_forget_namespace */
ModestConf *conf = modest_runtime_get_conf ();
g_signal_connect (G_OBJECT(conf),
"key_changed",
/* Get the initial update interval from gconf: */
on_modest_conf_update_interval_changed(conf, MODEST_CONF_UPDATE_INTERVAL,
- MODEST_CONF_EVENT_KEY_CHANGED, NULL);
+ MODEST_CONF_EVENT_KEY_CHANGED, 0, NULL);
/* initialize the addressbook */
if (!osso_abook_init (&argc, &argv, osso_context)) {
hildon_banner_show_information (gtk_widget_get_parent (GTK_WIDGET (data)), NULL,
_CS("ckdg_ib_maximum_characters_reached"));
} else {
- gboolean is_valid = FALSE;
-
- if (!text)
- is_valid = FALSE;
- else if (strlen(text) == 0 && g_str_has_prefix (chars, " "))
- is_valid = FALSE;
- else
- is_valid = !g_str_has_prefix(text, " ");
+ GtkWidget *ok_button;
+ GList *buttons;
- /* A blank space is not valid as first character */
- if (is_valid) {
- GtkWidget *ok_button;
- GList *buttons;
-
- /* Show OK button */
- buttons = gtk_container_get_children (GTK_CONTAINER (GTK_DIALOG (data)->action_area));
- ok_button = GTK_WIDGET (buttons->next->data);
- gtk_widget_set_sensitive (ok_button, TRUE);
- g_list_free (buttons);
+ buttons = gtk_container_get_children (GTK_CONTAINER (GTK_DIALOG (data)->action_area));
+ ok_button = GTK_WIDGET (buttons->next->data);
+
+ gtk_widget_set_sensitive (ok_button,
+ modest_text_utils_validate_folder_name (chars));
+ g_list_free (buttons);
- }
-
/* Write the text in the entry */
g_signal_handlers_block_by_func (editable,
(gpointer) entry_insert_text, data);
g_return_if_fail (chars != NULL);
- /* Dimm OK button. Do not allow also the "/" */
- if (strlen (chars) == 0 || strchr (chars, '/'))
- gtk_widget_set_sensitive (ok_button, FALSE);
-
- else if (g_utf8_strlen (chars,-1) >= 21)
+ if (g_utf8_strlen (chars,-1) >= 21)
hildon_banner_show_information (gtk_widget_get_parent (GTK_WIDGET (user_data)), NULL,
_CS("ckdg_ib_maximum_characters_reached"));
- else /* explicitely enable it, because with a previous entry_changed, it might have been turned off */
- gtk_widget_set_sensitive (ok_button, TRUE);
+ else
+ gtk_widget_set_sensitive (ok_button, modest_text_utils_validate_folder_name(chars));
/* Free */
g_list_free (buttons);
{
GtkWidget *widget = modest_folder_view_new (query);
- /* Show all accounts by default */
+ /* Show one account by default */
modest_folder_view_set_style (MODEST_FOLDER_VIEW (widget),
MODEST_FOLDER_VIEW_STYLE_SHOW_ONE);
+
/* Restore settings */
modest_widget_memory_restore (modest_runtime_get_conf(),
G_OBJECT (widget),