X-Git-Url: http://git.maemo.org/git/?p=modest;a=blobdiff_plain;f=src%2Fgnome%2Fmodest-platform.c;h=9b80c9000df04ec1f6398dc71a62cdf74d5759dc;hp=de8ae08846b9b62c41c1b1c57a0814e448146a2d;hb=56fd99766e8082e2f9e34c50d209b8410cf1fbf8;hpb=6754695adb4d12d3c2db5f7f819d2d7a78c07334 diff --git a/src/gnome/modest-platform.c b/src/gnome/modest-platform.c index de8ae08..9b80c90 100644 --- a/src/gnome/modest-platform.c +++ b/src/gnome/modest-platform.c @@ -27,11 +27,14 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include #include #include #include +#include "modest-platform.h" +#include "modest-mail-operation-queue.h" +#include "modest-runtime.h" + gboolean modest_platform_init (void) { @@ -78,6 +81,19 @@ modest_platform_get_file_icon_name (const gchar* name, const gchar* mime_type, return icon_name; } +gboolean +modest_platform_activate_uri (const gchar *uri) +{ + modest_runtime_not_implemented (NULL); + return FALSE; +} + +gboolean +modest_platform_show_uri_popup (const gchar *uri) +{ + modest_runtime_not_implemented (NULL); + return FALSE; +} GdkPixbuf* modest_platform_get_icon (const gchar *name) @@ -98,3 +114,86 @@ modest_platform_get_icon (const gchar *name) return pixbuf; } + +const gchar* +modest_platform_get_app_name (void) +{ + return ("Modest"); +} + +gint +modest_platform_run_new_folder_dialog (GtkWindow *parent_window, + TnyFolderStore *parent_folder, + gchar *suggested_name, + gchar **folder_name) +{ + GtkWidget *dialog, *entry; + gboolean finished = FALSE; + gint result; + TnyFolder *new_folder; + ModestMailOperation *mail_op; + + /* Ask the user for the folder name */ + dialog = gtk_dialog_new_with_buttons (_("New Folder Name"), + parent_window, + GTK_DIALOG_MODAL, + GTK_STOCK_CANCEL, + GTK_RESPONSE_REJECT, + GTK_STOCK_OK, + GTK_RESPONSE_ACCEPT, + NULL); + gtk_box_pack_start (GTK_BOX(GTK_DIALOG(dialog)->vbox), + gtk_label_new (_("Please enter a name for the new folder")), + FALSE, FALSE, 0); + + entry = gtk_entry_new_with_max_length (40); + gtk_box_pack_start (GTK_BOX(GTK_DIALOG(dialog)->vbox), + entry, + TRUE, FALSE, 0); + + gtk_widget_show_all (GTK_WIDGET(GTK_DIALOG(dialog)->vbox)); + + result = gtk_dialog_run (GTK_DIALOG(dialog)); + if (result == GTK_RESPONSE_ACCEPT) + *folder_name = g_strdup (gtk_entry_get_text (GTK_ENTRY (entry))); + + gtk_widget_destroy (dialog); + + return result; +} + + +gint +modest_platform_run_confirmation_dialog (GtkWindow *parent_window, + const gchar *msg) +{ + /* 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 */ +} + +gboolean modest_platform_connect_and_wait (GtkWindow *parent_window) +{ + /* TODO: Do something with network-manager? + Otherwise, maybe it is safe to assume that we would already be online if we could be. */ + return TRUE; +} + +gboolean modest_platform_set_update_interval (guint minutes) +{ + /* TODO. */ +} +