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)
+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)) {
GtkIconTheme *current_theme = NULL;
g_return_val_if_fail (name, NULL);
-
+
+#if 0 /* do we still need this? */
if (g_str_has_suffix (name, ".png")) { /*FIXME: hack*/
pixbuf = gdk_pixbuf_new_from_file (name, &err);
if (!pixbuf) {
}
return pixbuf;
}
-
+#endif /* */
current_theme = gtk_icon_theme_get_default ();
pixbuf = gtk_icon_theme_load_icon (current_theme, name, 26,
GTK_ICON_LOOKUP_NO_SVG,
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 */
gpointer user_data)
{
gchar *chars;
+ GtkWidget *ok_button;
+ GList *buttons;
+ buttons = gtk_container_get_children (GTK_CONTAINER (GTK_DIALOG (user_data)->action_area));
+ ok_button = GTK_WIDGET (buttons->next->data);
+
chars = gtk_editable_get_chars (editable, 0, -1);
g_return_if_fail (chars != NULL);
+
/* Dimm OK button. Do not allow also the "/" */
- if (strlen (chars) == 0 || strchr (chars, '/')) {
- GtkWidget *ok_button;
- GList *buttons;
-
- buttons = gtk_container_get_children (GTK_CONTAINER (GTK_DIALOG (user_data)->action_area));
- ok_button = GTK_WIDGET (buttons->next->data);
+ if (strlen (chars) == 0 || strchr (chars, '/'))
gtk_widget_set_sensitive (ok_button, FALSE);
-
- g_list_free (buttons);
- } else if (g_utf8_strlen (chars,-1) >= 21)
+
+ else 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"));
+ _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);
+
/* Free */
+ g_list_free (buttons);
g_free (chars);
}
/* 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 */
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,
/* 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: */
{
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),