X-Git-Url: http://git.maemo.org/git/?a=blobdiff_plain;ds=inline;f=src%2Fmaemo%2Fmodest-platform.c;h=d084d7e8652bfa1696e50b9dcc6954d9486e4aa4;hb=434b44b705e0ba997c93e4d33a0e1cd4b50aed27;hp=4482a9a48d8c3a45b8b5151b2b8c3a8976a9c85e;hpb=0c840c247895663c09915b97c79cfe5993ae7f06;p=modest diff --git a/src/maemo/modest-platform.c b/src/maemo/modest-platform.c index 4482a9a..d084d7e 100644 --- a/src/maemo/modest-platform.c +++ b/src/maemo/modest-platform.c @@ -54,6 +54,8 @@ #define URI_ACTION_COPY "copy:" 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, @@ -588,8 +590,8 @@ entry_changed (GtkEditable *editable, chars = gtk_editable_get_chars (editable, 0, -1); g_return_if_fail (chars != NULL); - /* Dimm OK button */ - if (strlen (chars) == 0) { + /* Dimm OK button. Do not allow also the "/" */ + if (strlen (chars) == 0 || strchr (chars, '/')) { GtkWidget *ok_button; GList *buttons; @@ -742,7 +744,9 @@ modest_platform_run_folder_name_dialog (GtkWindow *parent_window, const gchar *suggested_name, gchar **folder_name) { + GtkWidget *accept_btn = NULL; GtkWidget *dialog, *entry, *label, *hbox; + GList *buttons = NULL; gint result; /* Ask the user for the folder name */ @@ -755,6 +759,11 @@ modest_platform_run_folder_name_dialog (GtkWindow *parent_window, GTK_RESPONSE_REJECT, NULL); + /* 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 */ @@ -798,6 +807,12 @@ 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, _("(empty)")); +} + gint modest_platform_run_new_folder_dialog (GtkWindow *parent_window, TnyFolderStore *parent_folder, @@ -921,26 +936,28 @@ gboolean modest_platform_set_update_interval (guint minutes) st_time->tm_min += minutes; /* Set the time in alarm_event_t structure: */ - alarm_event_t event; - memset (&event, 0, sizeof (alarm_event_t)); - event.alarm_time = mktime (st_time); + alarm_event_t *event = g_new0(alarm_event_t, 1); + event->alarm_time = mktime (st_time); /* Specify what should happen when the alarm happens: * It should call this D-Bus method: */ /* Note: I am surpised that alarmd can't just use the modest.service file * for this. murrayc. */ - event.dbus_path = g_strdup(PREFIX "/bin/modest"); + event->dbus_path = g_strdup(PREFIX "/bin/modest"); - event.dbus_interface = g_strdup (MODEST_DBUS_IFACE); - event.dbus_service = g_strdup (MODEST_DBUS_SERVICE); - event.dbus_name = g_strdup (MODEST_DBUS_METHOD_SEND_RECEIVE); + event->dbus_interface = g_strdup (MODEST_DBUS_IFACE); + event->dbus_service = g_strdup (MODEST_DBUS_SERVICE); + event->dbus_name = g_strdup (MODEST_DBUS_METHOD_SEND_RECEIVE); /* Otherwise, a dialog will be shown if exect_name or dbus_path is NULL, even though we have specified no dialog text: */ - event.flags = ALARM_EVENT_NO_DIALOG; + event->flags = ALARM_EVENT_NO_DIALOG; - alarm_cookie = alarm_event_add (&event); + alarm_cookie = alarm_event_add (event); + + /* now, free it */ + alarm_event_free (event); /* Store the alarm ID in GConf, so we can remove it later: * This is apparently valid between application instances. */