X-Git-Url: http://git.maemo.org/git/?p=modest;a=blobdiff_plain;f=src%2Fhildon2%2Fmodest-platform.c;h=c909a50f839ef102666bac50f4819bd8fc0e0ba6;hp=cba3df52b32e8a3af722294d2996314cfba44d05;hb=eb21ca4b354fede1b81f4f1441b3fa77cf439d12;hpb=87fdab2eef15e510b0df401c2de24d4b94dd756e diff --git a/src/hildon2/modest-platform.c b/src/hildon2/modest-platform.c index cba3df5..c909a50 100644 --- a/src/hildon2/modest-platform.c +++ b/src/hildon2/modest-platform.c @@ -92,6 +92,7 @@ #define COMMON_FOLDER_DIALOG_ENTRY "entry" #define COMMON_FOLDER_DIALOG_ACCOUNT_PICKER "account-picker" #define FOLDER_PICKER_CURRENT_FOLDER "current-folder" +#define MODEST_ALARMD_APPID PACKAGE_NAME static void _modest_platform_play_email_tone (void); @@ -520,7 +521,7 @@ modest_platform_get_icon (const gchar *name, guint icon_size) */ if (!name || strlen(name) == 0) return NULL; - + current_theme = gtk_icon_theme_get_default (); pixbuf = gtk_icon_theme_load_icon (current_theme, name, icon_size, GTK_ICON_LOOKUP_NO_SVG, @@ -703,10 +704,11 @@ folder_chooser_dialog_run (ModestFolderView *original) gtk_container_add (GTK_CONTAINER (GTK_DIALOG (userdata.dialog)->vbox), pannable); gtk_container_add (GTK_CONTAINER (pannable), folder_view); + gtk_widget_set_size_request (pannable, -1, 320); + gtk_widget_show (folder_view); gtk_widget_show (pannable); - gtk_widget_show_all (userdata.dialog); - gtk_widget_set_size_request (pannable, -1, 320); + gtk_widget_show (userdata.dialog); g_signal_connect (G_OBJECT (folder_view), "folder-activated", G_CALLBACK (folder_chooser_activated), (gpointer) &userdata); @@ -1323,7 +1325,7 @@ modest_platform_set_update_interval (guint minutes) /* Delete any existing alarm, * because we will replace it: */ if (alarm_cookie) { - if (alarmd_event_del(alarm_cookie) != 1) + if (alarmd_event_del(alarm_cookie) != 0) g_warning ("%s: alarm %d was not on the queue", __FUNCTION__, (int)alarm_cookie); alarm_cookie = 0; modest_conf_set_int (conf, MODEST_CONF_ALARM_ID, 0, NULL); @@ -1340,6 +1342,7 @@ modest_platform_set_update_interval (guint minutes) alarm_event_t *event = alarm_event_create (); alarm_event_add_actions (event, 1); alarm_action_t *action = alarm_event_get_action (event, 0); + alarm_event_set_alarm_appid (event, MODEST_ALARMD_APPID); event->alarm_time = minutes * 60; /* seconds */ /* Set recurrence every few minutes: */ @@ -1353,7 +1356,7 @@ modest_platform_set_update_interval (guint minutes) action->dbus_interface = g_strdup (MODEST_DBUS_IFACE); action->dbus_service = g_strdup (MODEST_DBUS_SERVICE); action->dbus_name = g_strdup (MODEST_DBUS_METHOD_SEND_RECEIVE); - action->flags = ALARM_ACTION_TYPE_DBUS | ALARM_ACTION_DBUS_USE_ACTIVATION; + action->flags = ALARM_ACTION_WHEN_TRIGGERED | ALARM_ACTION_TYPE_DBUS | ALARM_ACTION_DBUS_USE_ACTIVATION; /* Use ALARM_EVENT_NO_DIALOG: Otherwise, a dialog will be shown if * exec_name or dbus_path is NULL, even though we have specified no dialog text. @@ -1386,11 +1389,13 @@ modest_platform_set_update_interval (guint minutes) void modest_platform_push_email_notification(void) { - gboolean screen_on = TRUE, app_in_foreground; + gboolean screen_on, app_in_foreground; /* Get the window status */ app_in_foreground = hildon_program_get_is_topmost (hildon_program_get_instance ()); + screen_on = modest_window_mgr_screen_is_on (modest_runtime_get_window_mgr ()); + /* If the screen is on and the app is in the foreground we don't show anything */ if (!(screen_on && app_in_foreground)) { @@ -2448,16 +2453,16 @@ modest_platform_create_move_to_dialog (GtkWindow *parent_window, TnyList * modest_platform_get_list_to_move (ModestWindow *window) { + TnyList *list = NULL; + if (MODEST_IS_HEADER_WINDOW (window)) { ModestHeaderView *header_view; header_view = modest_header_window_get_header_view (MODEST_HEADER_WINDOW (window)); - - return modest_header_view_get_selected_headers (header_view); + list = modest_header_view_get_selected_headers (header_view); } else if (MODEST_IS_FOLDER_WINDOW (window)) { ModestFolderView *folder_view; TnyFolderStore *selected_folder; - TnyList *list; list = TNY_LIST (tny_simple_list_new ()); folder_view = modest_folder_window_get_folder_view (MODEST_FOLDER_WINDOW (window)); @@ -2467,7 +2472,18 @@ modest_platform_get_list_to_move (ModestWindow *window) g_object_unref (selected_folder); } return list; + } else if (MODEST_IS_MSG_VIEW_WINDOW (window)) { + TnyHeader *header; + + header = modest_msg_view_window_get_header (MODEST_MSG_VIEW_WINDOW (window)); + if (header) { + list = TNY_LIST (tny_simple_list_new ()); + tny_list_prepend (list, G_OBJECT (header)); + g_object_unref (header); + } } else { - return NULL; + g_return_val_if_reached (NULL); } + + return list; }