+ return TRUE;
+}
+
+void
+modest_platform_connect_and_perform (GtkWindow *parent_window,
+ gboolean force,
+ TnyAccount *account,
+ ModestConnectedPerformer callback,
+ gpointer user_data)
+{
+ if (callback)
+ callback (FALSE, NULL, parent_window, account, user_data);
+}
+
+void
+modest_platform_double_connect_and_perform (GtkWindow *parent_window,
+ gboolean force,
+ TnyFolderStore *folder_store,
+ DoubleConnectionInfo *connect_info)
+{
+ if (connect_info->callback)
+ connect_info->callback (FALSE, NULL, parent_window, TNY_ACCOUNT (folder_store), connect_info->data);
+}
+
+void
+modest_platform_connect_and_perform_if_network_account (GtkWindow *parent_window,
+ gboolean force,
+ TnyAccount *account,
+ ModestConnectedPerformer callback,
+ gpointer user_data)
+{
+ if (callback)
+ callback (FALSE, NULL, parent_window, account, user_data);
+}
+
+void
+modest_platform_connect_and_perform_if_network_folderstore (GtkWindow *parent_window,
+ TnyFolderStore *folder_store,
+ ModestConnectedPerformer callback,
+ gpointer user_data)
+{
+ if (callback)
+ callback (FALSE, NULL, parent_window, NULL, user_data);
+}
+
+
+void
+modest_platform_remove_new_mail_notifications (gboolean only_visuals, const gchar *acc_name)
+{
+ g_warning ("NOT IMPLEMENTED %s", __FUNCTION__);
+}
+
+gboolean
+modest_platform_check_and_wait_for_account_is_online(TnyAccount *account)
+{
+ g_warning ("NOT IMPLEMENTED %s", __FUNCTION__);
+ return TRUE;
+}
+
+gboolean
+modest_platform_run_certificate_confirmation_dialog (const gchar* server_name,
+ const gchar *certificate)
+{
+ g_warning ("NOT IMPLEMENTED %s", __FUNCTION__);
+ return TRUE;
+}
+
+gint
+modest_platform_run_rename_folder_dialog (GtkWindow *parent_window,
+ TnyFolderStore *parent_folder,
+ const gchar *suggested_name,
+ gchar **folder_name)
+{
+ g_warning ("NOT IMPLEMENTED %s", __FUNCTION__);
+ return GTK_RESPONSE_CANCEL;
+}
+
+void
+modest_platform_show_addressbook (GtkWindow *parent_window)
+{
+ g_warning ("NOT IMPLEMENTED %s", __FUNCTION__);
+}
+
+GtkWidget *
+modest_platform_get_account_settings_dialog (ModestAccountSettings *settings)
+{
+ ModestAccountSettingsDialog *dialog = modest_default_account_settings_dialog_new ();
+
+ modest_account_settings_dialog_load_settings (dialog, settings);
+ return GTK_WIDGET (dialog);
+}
+
+GtkWidget *
+modest_platform_get_account_settings_wizard (void)
+{
+ GtkWidget *widget = modest_account_assistant_new (modest_runtime_get_account_mgr ());
+ return widget;
+}
+
+
+
+gboolean modest_platform_check_memory_low (ModestWindow *win,
+ gboolean visuals)
+{
+ g_debug ("%s not implemented", __FUNCTION__);
+ return FALSE;
+}
+
+void
+modest_platform_run_folder_details_dialog (GtkWindow *parent_window,
+ TnyFolder *folder)
+{
+ GtkWidget *dialog;
+
+ /* Create dialog */
+ dialog = modest_details_dialog_new_with_folder (parent_window, folder);
+
+ /* Run dialog */
+ modest_window_mgr_set_modal (modest_runtime_get_window_mgr (),
+ GTK_WINDOW (dialog),
+ parent_window);
+ gtk_widget_show_all (dialog);
+
+ g_signal_connect_swapped (dialog, "response",
+ G_CALLBACK (gtk_widget_destroy),
+ dialog);
+}
+
+void
+modest_platform_run_header_details_dialog (GtkWindow *parent_window,
+ TnyHeader *header,
+ gboolean async_get_size,
+ TnyMsg *msg)
+{
+ GtkWidget *dialog;
+
+ /* Create dialog */
+ dialog = modest_details_dialog_new_with_header (parent_window, header, TRUE);
+
+ /* Run dialog */
+ modest_window_mgr_set_modal (modest_runtime_get_window_mgr (),
+ GTK_WINDOW (dialog),
+ parent_window);
+ gtk_widget_show_all (dialog);
+
+ g_signal_connect_swapped (dialog, "response",
+ G_CALLBACK (gtk_widget_destroy),
+ dialog);
+}
+
+GtkWidget*
+modest_platform_create_move_to_dialog (GtkWindow *parent_window,
+ GtkWidget **folder_view)
+{
+ GtkWidget *dialog, *folder_view_container;
+
+ dialog = gtk_dialog_new_with_buttons (_("mcen_ti_moveto_folders_title"),
+ GTK_WINDOW (parent_window),
+ GTK_DIALOG_MODAL | GTK_DIALOG_NO_SEPARATOR |
+ GTK_DIALOG_DESTROY_WITH_PARENT,
+ _("mcen_bd_dialog_ok"), GTK_RESPONSE_OK,
+ _("mcen_bd_new"), MODEST_GTK_RESPONSE_NEW_FOLDER,
+ _("mcen_bd_dialog_cancel"), GTK_RESPONSE_CANCEL,
+ NULL);
+
+ /* Create folder view */
+ *folder_view = modest_platform_create_folder_view (NULL);
+
+ /* Create pannable and add it to the dialog */
+ folder_view_container = gtk_scrolled_window_new (NULL, NULL);
+ gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (folder_view_container),
+ GTK_POLICY_AUTOMATIC,
+ GTK_POLICY_AUTOMATIC);
+ gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), folder_view_container);
+ gtk_container_add (GTK_CONTAINER (folder_view_container), *folder_view);
+
+ gtk_window_set_default_size (GTK_WINDOW (dialog), 300, 300);
+
+ return dialog;
+}
+
+TnyList *
+modest_platform_get_list_to_move (ModestWindow *window)
+{
+ TnyList *list = NULL;
+
+ /* If it's a main window then it could be that we're moving a
+ folder or a set of messages */
+ if (MODEST_IS_MAIN_WINDOW (window)) {
+ ModestHeaderView *header_view = NULL;
+ ModestFolderView *folder_view = NULL;
+
+ folder_view = (ModestFolderView *)
+ modest_main_window_get_child_widget (MODEST_MAIN_WINDOW (window),
+ MODEST_MAIN_WINDOW_WIDGET_TYPE_FOLDER_VIEW);
+ header_view = (ModestHeaderView *)
+ modest_main_window_get_child_widget (MODEST_MAIN_WINDOW (window),
+ MODEST_MAIN_WINDOW_WIDGET_TYPE_HEADER_VIEW);
+
+ /* Get folder or messages to transfer */
+ if (gtk_widget_is_focus (GTK_WIDGET (folder_view))) {
+ TnyFolderStore *src_folder;
+
+ src_folder = modest_folder_view_get_selected (folder_view);
+ if (src_folder) {
+ list = tny_simple_list_new ();
+ tny_list_prepend (list, G_OBJECT (src_folder));
+ g_object_unref (src_folder);
+ }
+ } else if (gtk_widget_is_focus (GTK_WIDGET(header_view))) {
+ list = modest_header_view_get_selected_headers(header_view);
+ }
+ } else if (MODEST_IS_MSG_VIEW_WINDOW (window)) {
+ TnyHeader *header = NULL;
+
+ /* We simply return the currently viewed message */
+ header = modest_msg_view_window_get_header (MODEST_MSG_VIEW_WINDOW (window));
+ if (header) {
+ list = tny_simple_list_new ();
+ tny_list_prepend (list, G_OBJECT (header));
+ g_object_unref (header);
+ }
+ } else {
+ g_return_val_if_reached (NULL);
+ }
+
+ return list;