/* TODO implement confirmation dialog */
return GTK_RESPONSE_CANCEL;
}
+
+void
+modest_platform_run_information_dialog (GtkWindow *parent_window,
+ ModestInformationDialogType type)
+{
+ switch (type) {
+ case MODEST_INFORMATION_CREATE_FOLDER:
+ break;
+ case MODEST_INFORMATION_DELETE_FOLDER:
+ break;
+ };
+
+ /* TODO: implement a information dialog */
+}
return response;
}
+
+void
+modest_platform_run_information_dialog (GtkWindow *parent_window,
+ ModestInformationDialogType type)
+{
+ GtkWidget *dialog;
+ gchar *message = NULL;
+
+ switch (type) {
+ case MODEST_INFORMATION_CREATE_FOLDER:
+ message = _("mail_in_ui_folder_create_error");
+ break;
+ case MODEST_INFORMATION_DELETE_FOLDER:
+ message = _("mail_in_ui_folder_delete_error");
+ break;
+ };
+
+ dialog = hildon_note_new_information (parent_window, message);
+
+ gtk_dialog_run (GTK_DIALOG (dialog));
+
+ gtk_widget_destroy (GTK_WIDGET (dialog));
+ g_free (message);
+}
MODEST_CONFIRMATION_DELETE_FOLDER,
} ModestConfirmationDialogType;
+typedef enum _ModestInformationDialogType {
+ MODEST_INFORMATION_CREATE_FOLDER,
+ MODEST_INFORMATION_DELETE_FOLDER,
+} ModestInformationDialogType;
+
/**
* modest_platform_platform_init:
*
ModestConfirmationDialogType type,
gpointer user_data);
+void modest_platform_run_information_dialog (GtkWindow *parent_window,
+ ModestInformationDialogType type);
+
G_END_DECLS
#endif /* __MODEST_PLATFORM_UTILS_H__ */
finished = TRUE;
} else {
ModestMailOperation *mail_op = modest_mail_operation_new ();
- TnyFolder *new_folder;
+ TnyFolder *new_folder = NULL;
modest_mail_operation_queue_add (modest_runtime_get_mail_operation_queue (),
mail_op);
g_printerr ("%s", error->message);
/* TODO: check error and follow proper actions */
/* suggested_name = X; */
+ /* Show error to the user */
+ modest_platform_run_information_dialog (GTK_WINDOW (main_window),
+ MODEST_INFORMATION_CREATE_FOLDER);
}
g_object_unref (mail_op);
}
modest_mail_operation_queue_add (modest_runtime_get_mail_operation_queue (),
mail_op);
modest_mail_operation_remove_folder (mail_op, TNY_FOLDER (folder), move_to_trash);
+
+ /* Show error if happened */
+ if (modest_mail_operation_get_error (mail_op))
+ modest_platform_run_information_dialog (GTK_WINDOW (main_window),
+ MODEST_INFORMATION_DELETE_FOLDER);
+
g_object_unref (G_OBJECT (mail_op));
}