X-Git-Url: http://git.maemo.org/git/?a=blobdiff_plain;f=src%2Fmaemo%2Fmodest-platform.c;h=602a1750dd548b598da68035cddf971b6d7a2cd5;hb=ebfe51b97a008e49b0d80ed5314f554ecc71ea1e;hp=1e25a46a90fd6d5edec8b7eac3f4d20856983685;hpb=24a63786fb38ec1caa347832efffc33ae1f775da;p=modest diff --git a/src/maemo/modest-platform.c b/src/maemo/modest-platform.c index 1e25a46..602a175 100644 --- a/src/maemo/modest-platform.c +++ b/src/maemo/modest-platform.c @@ -59,9 +59,6 @@ static osso_context_t *osso_context = NULL; -static void folder_name_insensitive_press (GtkWidget *widget, - ModestWindow *window); - static void on_modest_conf_update_interval_changed (ModestConf* self, const gchar *key, ModestConfEvent event, gpointer user_data) @@ -566,18 +563,26 @@ entry_insert_text (GtkEditable *editable, hildon_banner_show_information (gtk_widget_get_parent (GTK_WIDGET (data)), NULL, _CS("ckdg_ib_maximum_characters_reached")); } else { - if (chars_length == 0) { - /* A blank space is not valid as first character */ - if (strcmp (text, " ")) { - 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); + 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, " "); + + /* 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); - } + } /* Write the text in the entry */ @@ -773,10 +778,6 @@ modest_platform_run_folder_name_dialog (GtkWindow *parent_window, /* Add accept button (with unsensitive handler) */ buttons = gtk_container_get_children (GTK_CONTAINER (GTK_DIALOG (dialog)->action_area)); accept_btn = GTK_WIDGET (buttons->next->data); - g_signal_connect (G_OBJECT (accept_btn), "insensitive-press", - G_CALLBACK (folder_name_insensitive_press), - parent_window); - /* Create label and entry */ label = gtk_label_new (label_text); /* TODO: check that the suggested name does not exist */ @@ -823,12 +824,6 @@ modest_platform_run_folder_name_dialog (GtkWindow *parent_window, return result; } -static void -folder_name_insensitive_press (GtkWidget *widget, ModestWindow *window) -{ - hildon_banner_show_information (NULL, NULL, _CS("ckdg_ib_enter_name")); -} - gint modest_platform_run_new_folder_dialog (GtkWindow *parent_window, TnyFolderStore *parent_folder, @@ -1190,17 +1185,13 @@ gboolean modest_platform_set_update_interval (guint minutes) /* Register alarm: */ - /* Get current time: */ - time_t time_now; - time (&time_now); - struct tm *st_time = localtime (&time_now); - - /* Add minutes to tm_min field: */ - st_time->tm_min += minutes; - - /* Set the time in alarm_event_t structure: */ + /* Set the interval in alarm_event_t structure: */ alarm_event_t *event = g_new0(alarm_event_t, 1); - event->alarm_time = mktime (st_time); + event->alarm_time = minutes * 60; /* seconds */ + + /* Set recurrence every few minutes: */ + event->recurrence = minutes; + event->recurrence_count = -1; /* Means infinite */ /* Specify what should happen when the alarm happens: * It should call this D-Bus method: */