X-Git-Url: http://git.maemo.org/git/?a=blobdiff_plain;f=src%2Fgnome%2Fmodest-platform.c;h=3c30170ce61ae6029051973db8822769cd65f351;hb=800a2c925d5b3fbbf2937cd2066a4f694f7cd741;hp=1877709df6b0bb44cba7b0afc8e69e6f7edfdd30;hpb=3e7a3b4e5759d63285d8795435b2ceedaf63b216;p=modest diff --git a/src/gnome/modest-platform.c b/src/gnome/modest-platform.c index 1877709..3c30170 100644 --- a/src/gnome/modest-platform.c +++ b/src/gnome/modest-platform.c @@ -27,18 +27,28 @@ * 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" +#include "gnome/modest-gnome-global-settings-dialog.h" + gboolean -modest_platform_init (void) +modest_platform_init (int argc, char *argv[]) { return TRUE; /* nothing to do */ } +gboolean modest_platform_uninit (void) +{ + return TRUE; /*nothing to do */ +} + + TnyDevice* modest_platform_get_new_device (void) { @@ -77,3 +87,179 @@ 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_activate_file (const gchar *path, const gchar *mime_type) +{ + 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) +{ + GError *err = NULL; + GdkPixbuf* pixbuf; + + g_return_val_if_fail (name, NULL); + + pixbuf = gdk_pixbuf_new_from_file (name, &err); + + if (!pixbuf) { + g_printerr ("modest: error while loading icon '%s': %s\n", + name, err->message); + g_error_free (err); + } + + 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; + gint result; + + /* 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, + const gchar *message) +{ + /* TODO: implement a information dialog */ +} + +gboolean modest_platform_connect_and_wait (GtkWindow *parent_window, TnyAccount *account) +{ + /* 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_connect_and_wait_if_network_account (GtkWindow *parent_window, TnyAccount *account) +{ + /* 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. */ + return FALSE; +} + +void +modest_platform_run_sort_dialog (GtkWindow *parent_window, + ModestSortDialogType type) +{ + /* TODO */ +} + +GtkWidget * +modest_platform_get_global_settings_dialog () +{ + return modest_gnome_global_settings_dialog_new (); +} + + +void +modest_platform_on_new_headers_received (TnyList *header_list) +{ + /* TODO: implement this */ + g_print ("--------------- NEW MESSAGE ARRIVED ---------------\n"); +} + + + +gboolean +modest_platform_show_help (GtkWidget *widget, const gchar *help_id) +{ + return TRUE; /* TODO */ +} + +void +modest_platform_show_search_messages (GtkWindow *parent_window) +{ + modest_runtime_not_implemented (NULL); +} + +GtkWidget * +modest_platform_create_folder_view (TnyFolderStoreQuery *query) +{ + GtkWidget *widget = modest_folder_view_new (query); + + /* Show all accounts by default */ + modest_folder_view_set_style (MODEST_FOLDER_VIEW (widget), + MODEST_FOLDER_VIEW_STYLE_SHOW_ALL); + + return widget; +} + +gboolean +modest_platform_run_alert_dialog (const gchar* prompt, + gboolean is_question) +{ + /* TODO */ + return TRUE; +}