From: Jose Dapena Paz Date: Mon, 26 Nov 2007 11:31:11 +0000 (+0000) Subject: These changes are for reenabling build of gnome port. X-Git-Tag: git_migration_finished~2024 X-Git-Url: http://git.maemo.org/git/?p=modest;a=commitdiff_plain;h=2b58f5abfb171a82424c14cd9777ea5ee460db61 These changes are for reenabling build of gnome port. * src/modest-tny-account.[ch]: * New method modest_tny_folder_store_is_remote, coming from a specific maemo modest_platform method. As this does not have any platform specific code, we moved it to a common place. * Use hildon calls only in maemo. * src/modest-platform.h: * Removed method modest_platform_is_network_folderstore, replaced by modest_tny_folder_store_is_remote. * src/modest-tny-platform-factory.c: * As the private area does not have fields, commented it and its initialisation. * src/gnome/modest-main-window-ui.h: * Replaced modest_ui_actions_on_delete with modest_ui_actions_on_delete_message. * src/gnome/modest-account-view-window.c: * Update calls to new api of modest_account_mgr_remove_account. * src/gnome/modest-store-widget.[ch]: * Replaced ModestProtoList with ModestPairList. * Fixed a typo in return types. * src/gnome/modest-address-book.c: * Updated api. * src/gnome/modest-transport-widget.c: * Add auth_protos to the private struct. * src/gnome/modest-msg-edit-window.c: * Use ModestProtoList instead of ModestPairList * Remove references to a msg id. * Update api call to check_names method. * Added implementation of ..._get_child_widget method. * Added stub implementations of reset_modified, toggle_find_toolbar, add_part, redo, offer_attach_file, attach_file_one, set_draft, is_modified, get_clipboard_text, can_redo, can_undo and get_message_uid. * src/gnome/modest-platform.c: * Remove calls to non_implemented method (it does not exists now). * Now show_help method returns void. * Added new methods connect_and_perform, and connect_and_perform_if_network_account. These methods act as it's always connected. * Added stub implementation of remove_new_mail_notification, check_and_wait_for_account_is_online, run_certificate_confirmation_dialog, run_rename_folder_dialog, and show_addressboook. * src/gnome/modest-main-window.c: * Use new TnyMsgView interface based access to msg view. * Prevent a crash as now we initialize the dimming manager. * Added stub implementation for notify_send_receive_initied, send_receive_completed, transfer_mode_enabled, and on_msg_view_window_msg_changed. * src/gnome/modest-gnome-global-settings-dialog.c: * Update internal global settings dialog methods. * src/gnome/modest-icon-names.h: * Add pending icons. * src/gnome/modest-gnome-info-bar.c: * Update progress_change handler api. * src/gnome/modest-msg-view-window.c: * Use modest_ui_actions_on_delete_message instead of ..._on_delete. * Use the TnyMsgView api for accessing the message. * Implementation of modest_msg_view_window_get_header, modest_msg_view_window_get_folder_type. * Stub implementation of last_message_selected, first_message_selected, transfer_mode_enabled, on_transfer_mode, get_attachments, is_search_result and has_headers_model. * src/gnome/modest-account-assistant.c: * Update api calls. * src/widgets/modest-recpt-editor.c: * Protect specific hildon calls with ifdefs. * src/widgets/modest-window.c: * Add a pending include. * src/modest-init.c: * Add a missing gnome vfs include. * Update the stock icons in the list. * src/modest-ui-actions.c: * Remove common dependencies to connection specific smtp window dialog. * Remove all calls to hildon_banner. * Use the new modest_tny_folder_store_is_remote method. * src/maemo/modest-platform.c: * Removed method modest_platform_is_network_folderstore. * src/modest-search.[ch]: * Defined ModestFolderResult and ModestSearchHit here. We provide different structs for dbus. * src/modest-tny-account-store.c: * Use the account settings hash only in maemo. * src/Makefile.am: * Include dbus api only in maemo. * configure.ac: * New conditional for compiling dbus api (which depends on osso, and then, it's maemo speficic). * Makefile.am: * Only compile dbus client if enabled. pmo-trunk-r3810 --- diff --git a/Makefile.am b/Makefile.am index ea22f58..783cd98 100644 --- a/Makefile.am +++ b/Makefile.am @@ -26,7 +26,11 @@ # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -SUBDIRS= src libmodest-dbus-client man po +SUBDIRS= src man po + +if MODEST_HAVE_DBUS_API +SUBDIRS += libmodest-dbus-client +endif if BUILD_TESTS SUBDIRS += tests diff --git a/configure.ac b/configure.ac index be98d12..4461b12 100644 --- a/configure.ac +++ b/configure.ac @@ -92,15 +92,17 @@ have_easysetup=false if test "x$with_platform" == "xgnome"; then PKG_CHECK_MODULES(MODEST_PLATFORM,libtinymail-gnome-desktop-1.0 libnm_glib glib-2.0 >= 2.8 gtk+-2.0 >= 2.10 libnotify) AC_DEFINE_UNQUOTED(MODEST_PLATFORM_GNOME, 1, ["Whether modest is being built for the GNOME platform."]) - AC_MSG_ERROR([The GNOME Build is currently broken; please try the Maemo build instead]) +dnl AC_MSG_ERROR([The GNOME Build is currently broken; please try the Maemo build instead]) else have_easysetup=true + have_dbusapi=true PKG_CHECK_MODULES(MODEST_PLATFORM,libosso conic libtinymail-maemo-1.0 libebook-1.2 microb-engine-nss) AC_DEFINE_UNQUOTED(MODEST_PLATFORM_MAEMO, 1, ["Whether modest is being built for the MAEMO platform."]) AC_DEFINE_UNQUOTED(MODEST_HAVE_EASYSETUP, 1, ["Whether we have the easysetup feature"]) fi AM_CONDITIONAL(MODEST_HAVE_EASYSETUP,test "x$have_easysetup" == "xtrue") +AM_CONDITIONAL(MODEST_HAVE_DBUS_API,test "x$have_dbusapi" == "xtrue") AC_SUBST(MODEST_PLATFORM) diff --git a/src/Makefile.am b/src/Makefile.am index bb9ae88..65922a1 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -137,7 +137,11 @@ modest_LDADD = \ $(MODEST_OGS_LIBS) \ ${easysetupmaybe} \ $(MODEST_PLATFORM)/libmodest-ui.la \ - widgets/libmodest-widgets.la \ - dbus_api/libmodest-dbus-api.la + widgets/libmodest-widgets.la + + +if MODEST_HAVE_DBUS_API +modest_LDADD += dbus_api/libmodest-dbus-api.la +endif EXTRA_DIST=modest-marshal.list diff --git a/src/dbus_api/modest-dbus-callbacks.c b/src/dbus_api/modest-dbus-callbacks.c index 9589b58..5f3eed6 100644 --- a/src/dbus_api/modest-dbus-callbacks.c +++ b/src/dbus_api/modest-dbus-callbacks.c @@ -866,7 +866,7 @@ search_result_to_message (DBusMessage *reply, for (hit_iter = hits; hit_iter; hit_iter = hit_iter->next) { DBusMessageIter struct_iter; - ModestSearchHit *hit; + ModestSearchResultHit *hit; char *msg_url; const char *subject; const char *folder; @@ -876,7 +876,7 @@ search_result_to_message (DBusMessage *reply, gboolean is_unread; gint64 ts; - hit = (ModestSearchHit *) hit_iter->data; + hit = (ModestSearchResultHit *) hit_iter->data; msg_url = hit->msgid; subject = hit->subject; @@ -934,7 +934,7 @@ search_result_to_message (DBusMessage *reply, g_free (hit->folder); g_free (hit->sender); - g_slice_free (ModestSearchHit, hit); + g_slice_free (ModestSearchResultHit, hit); } dbus_message_iter_close_container (&iter, &array_iter); diff --git a/src/gnome/modest-account-assistant.c b/src/gnome/modest-account-assistant.c index 9e0d614..f8692b5 100644 --- a/src/gnome/modest-account-assistant.c +++ b/src/gnome/modest-account-assistant.c @@ -180,7 +180,7 @@ identity_page_update_completeness (GtkEditable *editable, /* FIXME: regexp check for email address */ txt = gtk_entry_get_text (GTK_ENTRY(priv->email)); - if (!modest_text_utils_validate_email_address (txt)) + if (!modest_text_utils_validate_email_address (txt, NULL)) set_current_page_complete (self, FALSE); else set_current_page_complete (self, TRUE); @@ -673,14 +673,13 @@ on_apply (ModestAccountAssistant *self, gpointer user_data) account_name = get_account_name (self); modest_account_mgr_add_account (priv->account_mgr, account_name, + account_name, + get_fullname (self), + get_email (self), + MODEST_ACCOUNT_RETRIEVE_VALUE_HEADERS_ONLY, store_name, transport_name, TRUE); - modest_account_mgr_set_server_account_user_fullname (priv->account_mgr, account_name, - get_fullname (self)); - modest_account_mgr_set_server_account_user_email (priv->account_mgr, account_name, - get_email (self)); - /* Frees */ g_free (store_name); g_free (transport_name); diff --git a/src/gnome/modest-account-view-window.c b/src/gnome/modest-account-view-window.c index bc915f0..710e990 100644 --- a/src/gnome/modest-account-view-window.c +++ b/src/gnome/modest-account-view-window.c @@ -180,8 +180,7 @@ on_remove_button_clicked (GtkWidget *button, ModestAccountViewWindow *self) /* Remove account. If succeeded it removes also the account from the ModestAccountView */ removed = modest_account_mgr_remove_account (account_mgr, - account_name, - FALSE); + account_name); if (removed) { /* Show confirmation dialog ??? */ } else { diff --git a/src/gnome/modest-address-book.c b/src/gnome/modest-address-book.c index e401a51..59d3d39 100644 --- a/src/gnome/modest-address-book.c +++ b/src/gnome/modest-address-book.c @@ -44,7 +44,7 @@ modest_address_book_select_addresses (ModestRecptEditor *editor) } gboolean -modest_address_book_check_names (ModestRecptEditor *editor) +modest_address_book_check_names (ModestRecptEditor *editor, gboolean update_addressbook) { g_message (__FUNCTION__); return TRUE; diff --git a/src/gnome/modest-gnome-global-settings-dialog.c b/src/gnome/modest-gnome-global-settings-dialog.c index a5cbca4..57cb86c 100644 --- a/src/gnome/modest-gnome-global-settings-dialog.c +++ b/src/gnome/modest-gnome-global-settings-dialog.c @@ -225,8 +225,8 @@ create_updating_page (ModestGnomeGlobalSettingsDialog *self) /* Note: This ModestPairList* must exist for as long as the combo * that uses it, because the ModestComboBox uses the ID opaquely, * so it can't know how to manage its memory. */ - ppriv->connected_via_list = _modest_global_settings_dialog_get_connected_via (); - combo = modest_combo_box_new (ppriv->connected_via_list, g_int_equal); + ppriv->connect_via_list = _modest_global_settings_dialog_get_connected_via (); + combo = modest_combo_box_new (ppriv->connect_via_list, g_int_equal); add_to_table (GTK_TABLE (table_update), label, combo); @@ -287,8 +287,8 @@ create_composing_page (ModestGnomeGlobalSettingsDialog *self) /* Note: This ModestPairList* must exist for as long as the combo * that uses it, because the ModestComboBox uses the ID opaquely, * so it can't know how to manage its memory. */ - ppriv->combo_msg_formats_list = _modest_global_settings_dialog_get_msg_formats (); - combo = modest_combo_box_new (ppriv->cmsg_formats_list, g_int_equal); + ppriv->msg_format_list = _modest_global_settings_dialog_get_msg_formats (); + combo = modest_combo_box_new (ppriv->msg_format_list, g_int_equal); add_to_table (GTK_TABLE (table), label, combo); diff --git a/src/gnome/modest-gnome-info-bar.c b/src/gnome/modest-gnome-info-bar.c index b9182e9..13491b7 100644 --- a/src/gnome/modest-gnome-info-bar.c +++ b/src/gnome/modest-gnome-info-bar.c @@ -45,6 +45,7 @@ static void modest_gnome_info_bar_remove_operation (ModestProgressObject *self, ModestMailOperation *mail_op); static void on_progress_changed (ModestMailOperation *mail_op, + ModestMailOperationState *state, ModestGnomeInfoBar *self); static gboolean progressbar_clean (GtkProgressBar *bar); @@ -278,6 +279,7 @@ modest_gnome_info_bar_remove_operation (ModestProgressObject *self, static void on_progress_changed (ModestMailOperation *mail_op, + ModestMailOperationState *state, ModestGnomeInfoBar *self) { ModestGnomeInfoBarPrivate *priv; diff --git a/src/gnome/modest-icon-names.h b/src/gnome/modest-icon-names.h index cd6e090..970839c 100644 --- a/src/gnome/modest-icon-names.h +++ b/src/gnome/modest-icon-names.h @@ -59,6 +59,8 @@ #define MODEST_HEADER_ICON_HIGH_PRIORITY PIXMAP_PREFIX"modest_high_no_attachment.png" #define MODEST_HEADER_ICON_LOW_PRIORITY PIXMAP_PREFIX"modest_low_no_attachment.png" #define MODEST_HEADER_ICON_NORM_PRIORITY PIXMAP_PREFIX"modest_normal_no_attachment.png" +#define MODEST_HEADER_ICON_HIGH PIXMAP_PREFIX"modest_high_no_attachment.png" +#define MODEST_HEADER_ICON_LOW PIXMAP_PREFIX"modest_low_no_attachment.png" /* * */ @@ -90,6 +92,8 @@ /* #define MODEST_TOOLBAR_ICON_PREV PIXMAP_PREFIX "back.png" */ #define MODEST_TOOLBAR_ICON_STOP PIXMAP_PREFIX "stock-stop.png" #define MODEST_TOOLBAR_ICON_FORMAT_BULLETS PIXMAP_PREFIX "qgn_list_gene_bullets" +#define MODEST_TOOLBAR_ICON_BOLD GTK_STOCK_BOLD +#define MODEST_TOOLBAR_ICON_ITALIC GTK_STOCK_ITALIC /* Stock icon names */ #define MODEST_STOCK_MAIL_SEND "modest-stock-mail-send" diff --git a/src/gnome/modest-main-window-ui.h b/src/gnome/modest-main-window-ui.h index 29a4e08..959ade5 100644 --- a/src/gnome/modest-main-window-ui.h +++ b/src/gnome/modest-main-window-ui.h @@ -74,7 +74,7 @@ static const GtkActionEntry modest_action_entries [] = { { "ActionsForward", MODEST_STOCK_FORWARD, N_("_Forward"), NULL, N_("Forward a message"), G_CALLBACK (modest_ui_actions_on_forward) }, { "ActionsBounce", NULL, N_("_Bounce"), NULL, N_("Bounce a message"), NULL }, { "ActionsSendReceive", GTK_STOCK_REFRESH, N_("Send/Receive"), NULL, N_("Send and receive messages"), G_CALLBACK (modest_ui_actions_on_send_receive) }, - { "ActionsDelete", GTK_STOCK_DELETE, N_("Delete message"), NULL, N_("Delete messages"), G_CALLBACK (modest_ui_actions_on_delete) }, + { "ActionsDelete", GTK_STOCK_DELETE, N_("Delete message"), NULL, N_("Delete messages"), G_CALLBACK (modest_ui_actions_on_delete_message) }, { "ActionsFolderNew", NULL, N_("New Folder"), NULL, N_("Create a new folder"), G_CALLBACK (modest_ui_actions_on_new_folder) }, { "ActionsFolderDelete", NULL, N_("Delete Folder"), NULL, N_("Delete the folder"), G_CALLBACK (modest_ui_actions_on_delete_folder) }, { "ActionsFolderRename", NULL, N_("Rename Folder"), NULL, N_("Rename the folder"), G_CALLBACK (modest_ui_actions_on_rename_folder) }, diff --git a/src/gnome/modest-main-window.c b/src/gnome/modest-main-window.c index 09a7541..4491577 100644 --- a/src/gnome/modest-main-window.c +++ b/src/gnome/modest-main-window.c @@ -200,7 +200,8 @@ modest_main_window_init (ModestMainWindow *obj) priv->main_bar); /* msg preview */ - priv->msg_preview = MODEST_MSG_VIEW(modest_msg_view_new (NULL)); + priv->msg_preview = MODEST_MSG_VIEW(tny_platform_factory_new_msg_view + (modest_tny_platform_factory_get_instance ())); if (!priv->msg_preview) g_printerr ("modest: cannot instantiate msgpreiew\n"); @@ -316,7 +317,6 @@ on_account_store_connecting_finished (TnyAccountStore *store, ModestMainWindow * const gchar *icon_name; ModestMainWindowPrivate *priv; - g_return_if_fail (device); g_return_if_fail (self); priv = MODEST_MAIN_WINDOW_GET_PRIVATE(self); @@ -485,8 +485,10 @@ modest_main_window_new (void) priv = MODEST_MAIN_WINDOW_GET_PRIVATE(self); parent_priv = MODEST_WINDOW_GET_PRIVATE(self); + parent_priv->ui_manager = gtk_ui_manager_new(); + parent_priv->ui_dimming_manager = modest_ui_dimming_manager_new (); action_group = gtk_action_group_new ("ModestMainWindowActions"); /* Add common actions */ @@ -729,11 +731,11 @@ get_msg_callback (TnyFolder *folder, GError **err, gpointer user_data) { - if (!(*err)) { + if (!err ||!(*err)) { ModestMsgView *msg_preview; msg_preview = MODEST_MSG_VIEW (user_data); - modest_msg_view_set_message (msg_preview, msg); + tny_msg_view_set_msg (TNY_MSG_VIEW (msg_preview), msg); } /* Frees */ @@ -759,7 +761,35 @@ on_header_selected (ModestHeaderView *header_view, instead in order to get progress info */ tny_folder_get_msg_async (folder, header, - get_msg_callback, + (TnyGetMsgCallback) get_msg_callback, NULL, priv->msg_preview); } + +void +modest_main_window_notify_send_receive_initied (ModestMainWindow *self) +{ + g_message("NOT IMPLEMENTED %s", __FUNCTION__); +} +void +modest_main_window_notify_send_receive_completed (ModestMainWindow *self) +{ + g_message("NOT IMPLEMENTED %s", __FUNCTION__); +} + +gboolean +modest_main_window_transfer_mode_enabled (ModestMainWindow *self) +{ + g_message("NOT IMPLEMENTED %s", __FUNCTION__); + return FALSE; +} + +gboolean +modest_main_window_on_msg_view_window_msg_changed (ModestMsgViewWindow *view_window, + GtkTreeModel *model, + GtkTreeRowReference *row_reference, + ModestMainWindow *self) +{ + g_message("NOT IMPLEMENTED %s", __FUNCTION__); + return FALSE; +} diff --git a/src/gnome/modest-msg-edit-window.c b/src/gnome/modest-msg-edit-window.c index 95cf505..a457227 100644 --- a/src/gnome/modest-msg-edit-window.c +++ b/src/gnome/modest-msg-edit-window.c @@ -61,7 +61,7 @@ struct _ModestMsgEditWindowPrivate { GtkWidget *msg_body; - ModestProtoList *from_field_protos; + ModestPairList *from_field_protos; GtkWidget *from_field; GtkWidget *to_field; @@ -322,7 +322,8 @@ set_msg (ModestMsgEditWindow *self, TnyMsg *msg) ModestWindow * -modest_msg_edit_window_new (TnyMsg *msg, const gchar *account) +modest_msg_edit_window_new (TnyMsg *msg, const gchar *account, + gboolean preserve_is_rich) { ModestMsgEditWindow *self; ModestMsgEditWindowPrivate *priv; @@ -419,7 +420,6 @@ modest_msg_edit_window_get_msg_data (ModestMsgEditWindow *edit_window) data->cc = g_strdup ( gtk_entry_get_text (GTK_ENTRY(priv->cc_field))); data->bcc = g_strdup ( gtk_entry_get_text (GTK_ENTRY(priv->bcc_field))); data->subject = g_strdup ( gtk_entry_get_text (GTK_ENTRY(priv->subject_field))); - data->msg_id = NULL; GtkTextBuffer *buf = gtk_text_view_get_buffer (GTK_TEXT_VIEW (priv->msg_body)); GtkTextIter b, e; @@ -605,7 +605,7 @@ modest_msg_edit_window_select_contacts (ModestMsgEditWindow *window) } gboolean -modest_msg_edit_window_check_names (ModestMsgEditWindow *window) +modest_msg_edit_window_check_names (ModestMsgEditWindow *window, gboolean add_to_addressbook) { g_return_val_if_fail (MODEST_IS_MSG_EDIT_WINDOW (window), FALSE); @@ -640,3 +640,118 @@ modest_msg_edit_window_set_sent (ModestMsgEditWindow *window, priv = MODEST_MSG_EDIT_WINDOW_GET_PRIVATE(window); priv->sent = sent; } + +GtkWidget * +modest_msg_edit_window_get_child_widget (ModestMsgEditWindow *win, + ModestMsgEditWindowWidgetType widget_type) +{ + ModestMsgEditWindowPrivate *priv; + + g_return_val_if_fail (MODEST_IS_MSG_EDIT_WINDOW (win), NULL); + priv = MODEST_MSG_EDIT_WINDOW_GET_PRIVATE (win); + + switch (widget_type) { + case MODEST_MSG_EDIT_WINDOW_WIDGET_TYPE_BODY: + return priv->msg_body; + break; + case MODEST_MSG_EDIT_WINDOW_WIDGET_TYPE_TO: + return priv->to_field; + break; + case MODEST_MSG_EDIT_WINDOW_WIDGET_TYPE_CC: + return priv->cc_field; + break; + case MODEST_MSG_EDIT_WINDOW_WIDGET_TYPE_BCC: + return priv->bcc_field; + break; + case MODEST_MSG_EDIT_WINDOW_WIDGET_TYPE_SUBJECT: + return priv->subject_field; + break; + case MODEST_MSG_EDIT_WINDOW_WIDGET_TYPE_ATTACHMENTS: + return NULL; + break; + default: + return NULL; + } + return NULL; +} + +/* FUNCTIONS NOT IMPLEMENTED YET */ + +void +modest_msg_edit_window_reset_modified (ModestMsgEditWindow *window) +{ + g_message (__FUNCTION__); +} + +void +modest_msg_edit_window_toggle_find_toolbar (ModestMsgEditWindow *window, + gboolean show) +{ + g_message ("NOT IMPLEMENTED %s", __FUNCTION__); +} + +void +modest_msg_edit_window_add_part (ModestMsgEditWindow *window, + TnyMimePart *part) +{ + g_message ("NOT IMPLEMENTED %s", __FUNCTION__); +} + +void +modest_msg_edit_window_redo (ModestMsgEditWindow *window) +{ + g_message ("NOT IMPLEMENTED %s", __FUNCTION__); +} + +void +modest_msg_edit_window_offer_attach_file (ModestMsgEditWindow *window) +{ + g_message ("NOT IMPLEMENTED %s", __FUNCTION__); +} + +void +modest_msg_edit_window_attach_file_one (ModestMsgEditWindow *window, const gchar *file_uri) +{ + g_message ("NOT IMPLEMENTED %s", __FUNCTION__); +} + +void +modest_msg_edit_window_set_draft (ModestMsgEditWindow *window, + TnyMsg *draft) +{ + g_message ("NOT IMPLEMENTED %s", __FUNCTION__); +} + +gboolean +modest_msg_edit_window_is_modified (ModestMsgEditWindow *window) +{ + g_message ("NOT IMPLEMENTED %s", __FUNCTION__); + return TRUE; +} + +const gchar * +modest_msg_edit_window_get_clipboard_text (ModestMsgEditWindow *win) +{ + g_message ("NOT IMPLEMENTED %s", __FUNCTION__); + return NULL; +} + +gboolean +modest_msg_edit_window_can_redo (ModestMsgEditWindow *window) +{ + g_message ("NOT IMPLEMENTED %s", __FUNCTION__); + return FALSE; +} +gboolean +modest_msg_edit_window_can_undo (ModestMsgEditWindow *window) +{ + g_message ("NOT IMPLEMENTED %s", __FUNCTION__); + return FALSE; +} + +const gchar* +modest_msg_edit_window_get_message_uid (ModestMsgEditWindow *window) +{ + g_message ("NOT IMPLEMENTED %s", __FUNCTION__); + return NULL; +} diff --git a/src/gnome/modest-msg-view-window.c b/src/gnome/modest-msg-view-window.c index 68fe792..b7555c9 100644 --- a/src/gnome/modest-msg-view-window.c +++ b/src/gnome/modest-msg-view-window.c @@ -93,7 +93,7 @@ static const GtkActionEntry modest_action_entries [] = { { "ActionsForward", MODEST_STOCK_FORWARD, N_("_Forward"), NULL, N_("Forward a message"), G_CALLBACK (modest_ui_actions_on_forward) }, { "ActionsBounce", NULL, N_("_Bounce"), NULL, N_("Bounce a message"), NULL }, { "ActionsSendReceive", GTK_STOCK_REFRESH, N_("Send/Receive"), NULL, N_("Send and receive messages"), NULL }, - { "ActionsDelete", MODEST_STOCK_DELETE, N_("Delete message"), NULL, N_("Delete messages"), G_CALLBACK (modest_ui_actions_on_delete) }, + { "ActionsDelete", MODEST_STOCK_DELETE, N_("Delete message"), NULL, N_("Delete messages"), G_CALLBACK (modest_ui_actions_on_delete_message) }, /* HELP */ { "HelpAbout", GTK_STOCK_ABOUT, N_("About"), NULL, N_("About Modest"), G_CALLBACK (modest_ui_actions_on_about) }, @@ -179,7 +179,8 @@ init_window (ModestMsgViewWindow *obj, TnyMsg *msg) priv = MODEST_MSG_VIEW_WINDOW_GET_PRIVATE(obj); parent_priv = MODEST_WINDOW_GET_PRIVATE(obj); - priv->msg_view = modest_msg_view_new (msg); + priv->msg_view = GTK_WIDGET (tny_platform_factory_new_msg_view (modest_tny_platform_factory_get_instance ())); + tny_msg_view_set_msg (TNY_MSG_VIEW (priv->msg_view), msg); main_vbox = gtk_vbox_new (FALSE, 6); gtk_box_pack_start (GTK_BOX(main_vbox), priv->menubar, FALSE, FALSE, 0); @@ -203,11 +204,6 @@ modest_msg_view_window_finalize (GObject *obj) priv = MODEST_MSG_VIEW_WINDOW_GET_PRIVATE(obj); - if (priv->msg_uid) { - g_free (priv->msg_uid); - msg_uid = NULL; - } - G_OBJECT_CLASS(parent_class)->finalize (obj); } @@ -242,7 +238,7 @@ modest_msg_view_window_new_for_attachment (TnyMsg *msg, priv->msg_uid = g_strdup (msg_uid); - modest_window_set_active_account (MODEST_WINDOW(obj), account); + modest_window_set_active_account (MODEST_WINDOW(obj), modest_account_name); parent_priv->ui_manager = gtk_ui_manager_new(); action_group = gtk_action_group_new ("ModestMsgViewWindowActions"); @@ -309,16 +305,18 @@ modest_msg_view_window_get_message (ModestMsgViewWindow *self) msg_view = MODEST_MSG_VIEW_WINDOW_GET_PRIVATE(self)->msg_view; - return modest_msg_view_get_message (MODEST_MSG_VIEW(msg_view)); + return tny_msg_view_get_msg (TNY_MSG_VIEW(msg_view)); } const gchar* modest_msg_view_window_get_message_uid (ModestMsgViewWindow *self) { + ModestMsgViewWindowPrivate *priv = MODEST_MSG_VIEW_WINDOW_GET_PRIVATE (self); TnyMsg *msg; TnyHeader *header; const gchar *retval = NULL; + msg = tny_msg_view_get_msg (TNY_MSG_VIEW (priv->msg_view)); msg = modest_msg_view_window_get_message (self); if (!msg) @@ -346,7 +344,7 @@ modest_msg_view_window_new_with_header_model (TnyMsg *msg, actions */ g_message ("partially implemented %s", __FUNCTION__); - return modest_msg_view_window_new_for_attachment (msg, account); + return modest_msg_view_window_new_for_attachment (msg, modest_account_name, msg_uid); } @@ -376,7 +374,99 @@ modest_msg_view_window_save_attachments (ModestMsgViewWindow *window, GList *mim g_message ("not implemented %s", __FUNCTION__); } void -modest_msg_view_window_remove_attachments (ModestMsgViewWindow *window, GList *mime_parts) +modest_msg_view_window_remove_attachments (ModestMsgViewWindow *window, gboolean get_all) { g_message ("not implemented %s", __FUNCTION__); } + +TnyHeader * +modest_msg_view_window_get_header (ModestMsgViewWindow *self) +{ + TnyMsg *msg; + TnyHeader *header = NULL; + + msg = modest_msg_view_window_get_message (self); + if (msg) { + header = tny_msg_get_header (msg); + g_object_unref (msg); + } + return header; +} + +TnyFolderType +modest_msg_view_window_get_folder_type (ModestMsgViewWindow *window) +{ + ModestMsgViewWindowPrivate *priv; + TnyMsg *msg; + TnyFolderType folder_type; + + priv = MODEST_MSG_VIEW_WINDOW_GET_PRIVATE (window); + + folder_type = TNY_FOLDER_TYPE_UNKNOWN; + + msg = tny_msg_view_get_msg (TNY_MSG_VIEW (priv->msg_view)); + if (msg) { + TnyFolder *folder; + + folder = tny_msg_get_folder (msg); + if (folder) { + folder_type = tny_folder_get_folder_type (folder); + g_object_unref (folder); + } + g_object_unref (msg); + } + + return folder_type; +} + +/* NOT IMPLEMENTED METHODS */ + +gboolean +modest_msg_view_window_last_message_selected (ModestMsgViewWindow *window) +{ + g_message ("NOT IMPLEMENTED %s", __FUNCTION__); + return TRUE; +} + +gboolean +modest_msg_view_window_first_message_selected (ModestMsgViewWindow *window) +{ + g_message ("NOT IMPLEMENTED %s", __FUNCTION__); + return TRUE; +} + +gboolean +modest_msg_view_window_transfer_mode_enabled (ModestMsgViewWindow *self) +{ + g_message ("NOT IMPLEMENTED %s", __FUNCTION__); + return FALSE; +} + +gboolean +modest_msg_view_window_toolbar_on_transfer_mode (ModestMsgViewWindow *self) +{ + g_message ("NOT IMPLEMENTED %s", __FUNCTION__); + return FALSE; +} + + +GList * +modest_msg_view_window_get_attachments (ModestMsgViewWindow *win) +{ + g_message ("NOT IMPLEMENTED %s", __FUNCTION__); + return NULL; +} + +gboolean +modest_msg_view_window_is_search_result (ModestMsgViewWindow *window) +{ + g_message ("NOT IMPLEMENTED %s", __FUNCTION__); + return FALSE; +} + +gboolean +modest_msg_view_window_has_headers_model (ModestMsgViewWindow *window) +{ + g_message ("NOT IMPLEMENTED %s", __FUNCTION__); + return FALSE; +} diff --git a/src/gnome/modest-platform.c b/src/gnome/modest-platform.c index 3c30170..03baeba 100644 --- a/src/gnome/modest-platform.c +++ b/src/gnome/modest-platform.c @@ -91,21 +91,21 @@ modest_platform_get_file_icon_name (const gchar* name, const gchar* mime_type, gboolean modest_platform_activate_uri (const gchar *uri) { - modest_runtime_not_implemented (NULL); + g_message ("NOT IMPLEMENTED");; return FALSE; } gboolean modest_platform_activate_file (const gchar *path, const gchar *mime_type) { - modest_runtime_not_implemented (NULL); + g_message ("NOT IMPLEMENTED");; return FALSE; } gboolean modest_platform_show_uri_popup (const gchar *uri) { - modest_runtime_not_implemented (NULL); + g_message ("NOT IMPLEMENTED");; return FALSE; } @@ -232,16 +232,34 @@ modest_platform_on_new_headers_received (TnyList *header_list) -gboolean -modest_platform_show_help (GtkWidget *widget, const gchar *help_id) +void +modest_platform_show_help (GtkWindow *parent_window, const gchar *help_id) +{ + return; /* TODO */ +} + +void +modest_platform_information_banner (GtkWidget *widget, + const gchar *icon_name, + const gchar *text) { - return TRUE; /* TODO */ + g_message ("NOT IMPLEMENTED");; } +GtkWidget * +modest_platform_animation_banner (GtkWidget *widget, + const gchar *icon_name, + const gchar *text) +{ + g_message ("NOT IMPLEMENTED"); + return NULL; +} + + void modest_platform_show_search_messages (GtkWindow *parent_window) { - modest_runtime_not_implemented (NULL); + g_message ("NOT IMPLEMENTED");; } GtkWidget * @@ -263,3 +281,72 @@ modest_platform_run_alert_dialog (const gchar* prompt, /* TODO */ return TRUE; } + +void +modest_platform_connect_and_perform (GtkWindow *parent_window, + 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_account (GtkWindow *parent_window, + 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 (void) +{ + g_message ("NOT IMPLEMENTED %s", __FUNCTION__); +} + +gboolean +modest_platform_check_and_wait_for_account_is_online(TnyAccount *account) +{ + g_message ("NOT IMPLEMENTED %s", __FUNCTION__); + return TRUE; +} + +gboolean +modest_platform_run_certificate_confirmation_dialog (const gchar* server_name, + const gchar *certificate) +{ + g_message ("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_message ("NOT IMPLEMENTED %s", __FUNCTION__); + return GTK_RESPONSE_CANCEL; +} + +void +modest_platform_show_addressbook (GtkWindow *parent_window) +{ + g_message ("NOT IMPLEMENTED %s", __FUNCTION__); +} + diff --git a/src/gnome/modest-store-widget.c b/src/gnome/modest-store-widget.c index 8583343..e1b738b 100644 --- a/src/gnome/modest-store-widget.c +++ b/src/gnome/modest-store-widget.c @@ -49,10 +49,10 @@ struct _ModestStoreWidgetPrivate { GtkWidget *servername; GtkWidget *username; - ModestProtoList *security_protos; + ModestPairList *security_protos; GtkWidget *security; - ModestProtoList *auth_protos; + ModestPairList *auth_protos; GtkWidget *auth; GtkWidget *chooser; @@ -253,7 +253,7 @@ imap_pop_configuration (ModestStoreWidget *self) /* Note: This ModestPairList* must exist for as long as the combo * that uses it, because the ModestComboBox uses the ID opaquely, * so it can't know how to manage its memory. */ - priv->auth_protos = modest_protocol_info_get_auth_protocol_pair_list (; + priv->auth_protos = modest_protocol_info_get_auth_protocol_pair_list (); priv->auth = modest_combo_box_new (priv->auth_protos, g_str_equal); gtk_box_pack_start (GTK_BOX(hbox), priv->auth, FALSE, FALSE, 0); diff --git a/src/gnome/modest-store-widget.h b/src/gnome/modest-store-widget.h index 8944c65..86c0dc8 100644 --- a/src/gnome/modest-store-widget.h +++ b/src/gnome/modest-store-widget.h @@ -66,8 +66,8 @@ const gchar* modest_store_widget_get_username (ModestStoreWidget *se const gchar* modest_store_widget_get_servername (ModestStoreWidget *self); ModestTransportStoreProtocol modest_store_widget_get_proto (ModestStoreWidget *self); gchar * modest_store_widget_get_path (ModestStoreWidget *self); -ModestConnectionProtocol modest_store_widget_get_auth (ModestStoreWidget *self); -ModestAuthProtocol modest_store_widget_get_security (ModestStoreWidget *self); +ModestAuthProtocol modest_store_widget_get_auth (ModestStoreWidget *self); +ModestConnectionProtocol modest_store_widget_get_security (ModestStoreWidget *self); G_END_DECLS diff --git a/src/gnome/modest-transport-widget.c b/src/gnome/modest-transport-widget.c index 73ef807..f1166e9 100644 --- a/src/gnome/modest-transport-widget.c +++ b/src/gnome/modest-transport-widget.c @@ -56,6 +56,7 @@ struct _ModestTransportWidgetPrivate { GtkWidget *remember_pwd; ModestPairList *transport_store_protos; + ModestPairList *auth_protos; }; #define MODEST_TRANSPORT_WIDGET_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE((o), \ MODEST_TYPE_TRANSPORT_WIDGET, \ diff --git a/src/maemo/modest-platform.c b/src/maemo/modest-platform.c index 5fe2b68..4c9af84 100644 --- a/src/maemo/modest-platform.c +++ b/src/maemo/modest-platform.c @@ -1181,39 +1181,6 @@ modest_platform_connect_and_wait_if_network_folderstore (GtkWindow *parent_windo return result; } -gboolean -modest_platform_is_network_folderstore (TnyFolderStore *folder_store) -{ - TnyAccount *account = NULL; - gboolean result = TRUE; - - g_return_val_if_fail(TNY_IS_FOLDER_STORE(folder_store), FALSE); - - if (TNY_IS_FOLDER (folder_store)) { - /* Get the folder's parent account: */ - account = tny_folder_get_account(TNY_FOLDER(folder_store)); - } else if (TNY_IS_ACCOUNT (folder_store)) { - account = TNY_ACCOUNT(folder_store); - g_object_ref(account); - } - - if (account != NULL) { - if (tny_account_get_account_type (account) == TNY_ACCOUNT_TYPE_STORE) { - if (!TNY_IS_CAMEL_POP_STORE_ACCOUNT (account) && - !TNY_IS_CAMEL_IMAP_STORE_ACCOUNT (account)) { - /* This must be a maildir account, which does - * not require a connection: */ - result = FALSE; - } - } - g_object_unref (account); - } else { - result = FALSE; - } - - return result; -} - void modest_platform_run_sort_dialog (GtkWindow *parent_window, ModestSortDialogType type) diff --git a/src/maemo/modest-scroll-area.c b/src/maemo/modest-scroll-area.c index 210216d..90bfb20 100644 --- a/src/maemo/modest-scroll-area.c +++ b/src/maemo/modest-scroll-area.c @@ -148,6 +148,10 @@ modest_scroll_area_new (GtkWidget *sw, GtkWidget *child) G_CALLBACK (g_free), sc); gtk_widget_show_all (sw); + + gtk_widget_set_redraw_on_allocate (GTK_WIDGET(sc->fixed), FALSE); + gtk_widget_set_redraw_on_allocate (GTK_WIDGET(sw), FALSE); + gtk_widget_set_redraw_on_allocate (GTK_WIDGET(child), FALSE); return fixed; } diff --git a/src/modest-init.c b/src/modest-init.c index 619b31e..a4b55c6 100644 --- a/src/modest-init.c +++ b/src/modest-init.c @@ -48,6 +48,7 @@ #include #include "widgets/modest-global-settings-dialog.h" #include "modest-tny-msg.h" +#include #ifdef MODEST_PLATFORM_MAEMO #include "modest-hildon-includes.h" #endif @@ -603,8 +604,8 @@ init_stock_icons (void) { MODEST_STOCK_NEW_MAIL, "new mail", 0, 0, NULL }, /* { MODEST_STOCK_SEND_RECEIVE, "send receive", 0, 0, NULL }, */ { MODEST_STOCK_REPLY, "reply", 0, 0, NULL }, -/* { MODEST_STOCK_REPLY_ALL, "reply all", 0, 0, NULL }, */ -/* { MODEST_STOCK_FORWARD, "forward", 0, 0, NULL }, */ + { MODEST_STOCK_REPLY_ALL, "reply all", 0, 0, NULL }, + { MODEST_STOCK_FORWARD, "forward", 0, 0, NULL }, { MODEST_STOCK_DELETE, "delete", 0, 0, NULL }, /* { MODEST_STOCK_NEXT, "next", 0, 0, NULL }, */ /* { MODEST_STOCK_PREV, "prev", 0, 0, NULL }, */ @@ -621,13 +622,13 @@ init_stock_icons (void) MODEST_TOOLBAR_ICON_NEW_MAIL, /* MODEST_TOOLBAR_ICON_SEND_RECEIVE, */ MODEST_TOOLBAR_ICON_REPLY, -/* MODEST_TOOLBAR_ICON_REPLY_ALL, */ -/* MODEST_TOOLBAR_ICON_FORWARD, */ + MODEST_TOOLBAR_ICON_REPLY_ALL, + MODEST_TOOLBAR_ICON_FORWARD, MODEST_TOOLBAR_ICON_DELETE, /* MODEST_TOOLBAR_ICON_NEXT, */ /* MODEST_TOOLBAR_ICON_PREV, */ /* MODEST_TOOLBAR_ICON_STOP */ - MODEST_TOOLBAR_ICON_FORMAT_BULLETS, +/* MODEST_TOOLBAR_ICON_FORMAT_BULLETS, */ }; registered = TRUE; diff --git a/src/modest-platform.h b/src/modest-platform.h index 745dd5f..2caba01 100644 --- a/src/modest-platform.h +++ b/src/modest-platform.h @@ -259,14 +259,6 @@ gboolean modest_platform_connect_and_wait_if_network_account (GtkWindow *parent_ gboolean modest_platform_connect_and_wait_if_network_folderstore (GtkWindow *parent_window, TnyFolderStore *folder_store); /** - * modest_platform_is_network_folderstore: - * @folder_store: The folder store (folder or account) that needs to - * decide if need a connection in subsequent operations. - * @return value: Whether a connection is necessary for this folder_store. - */ -gboolean modest_platform_is_network_folderstore (TnyFolderStore *folder_store); - -/** * modest_platform_set_update_interval: * @minutes: The number of minutes between updates, or 0 for no updates. * diff --git a/src/modest-search.c b/src/modest-search.c index 32f387f..761598c 100644 --- a/src/modest-search.c +++ b/src/modest-search.c @@ -46,8 +46,6 @@ #include #include -#include - #include "modest-text-utils.h" #include "modest-account-mgr.h" #include "modest-tny-account-store.h" @@ -72,7 +70,7 @@ g_strdup_or_null (const gchar *str) static GList* add_hit (GList *list, TnyHeader *header, TnyFolder *folder) { - ModestSearchHit *hit; + ModestSearchResultHit *hit; TnyHeaderFlags flags; char *furl; char *msg_url; @@ -80,7 +78,7 @@ add_hit (GList *list, TnyHeader *header, TnyFolder *folder) const char *subject; const char *sender; - hit = g_slice_new0 (ModestSearchHit); + hit = g_slice_new0 (ModestSearchResultHit); furl = tny_folder_get_url_string (folder); printf ("DEBUG: %s: folder URL=%s\n", __FUNCTION__, furl); diff --git a/src/modest-search.h b/src/modest-search.h index 81ef569..3a01424 100644 --- a/src/modest-search.h +++ b/src/modest-search.h @@ -59,6 +59,17 @@ typedef enum { } ModestSearchFlags; typedef struct { + gchar *msgid; /* E.g. the URI of the message. */ + gchar *subject; + gchar *folder; /* The name, not the URI. */ + gchar *sender; + guint64 msize; + gboolean has_attachment; + gboolean is_unread; + gint64 timestamp; +} ModestSearchResultHit; + +typedef struct { const gchar *folder; /* The folder to search in */ /* Text to search for in various parts: */ diff --git a/src/modest-tny-account-store.c b/src/modest-tny-account-store.c index 0070ed9..4539336 100644 --- a/src/modest-tny-account-store.c +++ b/src/modest-tny-account-store.c @@ -50,8 +50,6 @@ #include #include #include -#include -#include #include #include @@ -63,6 +61,8 @@ #ifdef MODEST_PLATFORM_MAEMO #include +#include +#include #endif #include @@ -121,7 +121,9 @@ typedef struct _ModestTnyAccountStorePrivate ModestTnyAccountStorePrivate; struct _ModestTnyAccountStorePrivate { gchar *cache_dir; GHashTable *password_hash; +#ifdef MODEST_PLATFORM_MAEMO GHashTable *account_settings_dialog_hash; +#endif ModestAccountMgr *account_mgr; TnySessionCamel *session; TnyDevice *device; @@ -277,11 +279,13 @@ modest_tny_account_store_instance_init (ModestTnyAccountStore *obj) */ priv->password_hash = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free); - + +#ifdef MODEST_PLATFORM_MAEMO /* A hash-map of modest account names to dialog pointers, * so we can avoid showing the account settings twice for the same modest account: */ priv->account_settings_dialog_hash = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL); +#endif /* Respond to volume mounts and unmounts, such * as the insertion/removal of the memory card: */ @@ -497,6 +501,7 @@ on_account_changed (ModestAccountMgr *acc_mgr, g_object_unref (iter); } +#ifdef MODEST_PLATFORM_MAEMO static void on_account_settings_hide (GtkWidget *widget, gpointer user_data) { @@ -511,6 +516,7 @@ on_account_settings_hide (GtkWidget *widget, gpointer user_data) if (modest_account_name) g_hash_table_remove (priv->account_settings_dialog_hash, modest_account_name); } +#endif static void show_password_warning_only () @@ -526,7 +532,7 @@ show_password_warning_only () g_warning ("%s: %s", __FUNCTION__, _("mcen_ib_username_pw_incorrect")); } - +#ifdef MODEST_PLATFORM_MAEMO static void show_wrong_password_dialog (TnyAccount *account) { @@ -594,7 +600,7 @@ show_wrong_password_dialog (TnyAccount *account) gtk_window_present (GTK_WINDOW (dialog)); } } - +#endif static void @@ -690,7 +696,9 @@ get_password (TnyAccount *account, const gchar * prompt_not_used, gboolean *canc ); if (settings_have_password) { /* The password must be wrong, so show the account settings dialog so it can be corrected: */ +#ifdef MODEST_PLATFORM_MAEMO show_wrong_password_dialog (account); +#endif if (cancel) *cancel = TRUE; @@ -819,10 +827,12 @@ modest_tny_account_store_finalize (GObject *obj) priv->password_hash = NULL; } +#ifdef MODEST_PLATFORM_MAEMO if (priv->account_settings_dialog_hash) { g_hash_table_destroy (priv->account_settings_dialog_hash); priv->account_settings_dialog_hash = NULL; } +#endif if (priv->outbox_of_transport) { g_hash_table_destroy (priv->outbox_of_transport); diff --git a/src/modest-tny-account.c b/src/modest-tny-account.c index d1695de..9a53421 100644 --- a/src/modest-tny-account.c +++ b/src/modest-tny-account.c @@ -45,11 +45,13 @@ #include #include #include +#ifdef MODEST_PLATFORM_MAEMO #ifdef MODEST_HAVE_HILDON0_WIDGETS #include #else #include #endif +#endif /* we need these dummy functions, or tinymail will complain */ static gchar * get_pass_dummy (TnyAccount *account, const gchar *prompt, gboolean *cancel); @@ -592,7 +594,7 @@ typedef struct - +#ifdef MODEST_PLATFORM_MAEMO /* Gets the memory card name: */ static void on_modest_file_system_info (HildonFileSystemInfoHandle *handle, @@ -629,9 +631,11 @@ on_modest_file_system_info (HildonFileSystemInfoHandle *handle, g_object_unref (callback_data->account); g_slice_free (GetMmcAccountNameData, callback_data); } +#endif void modest_tny_account_get_mmc_account_name (TnyStoreAccount* self, ModestTnyAccountGetMmcAccountNameCallback callback, gpointer user_data) { +#ifdef MODEST_PLATFORM_MAEMO /* Just use the hard-coded path for the single memory card, * rather than try to figure out the path to the specific card by * looking at the maildir URI: @@ -670,6 +674,7 @@ void modest_tny_account_get_mmc_account_name (TnyStoreAccount* self, ModestTnyAc } /* g_free (uri); */ +#endif } @@ -997,3 +1002,37 @@ modest_tny_account_is_memory_card_account (TnyAccount *self) else return (strcmp (account_id, MODEST_MMC_ACCOUNT_ID) == 0); } + +gboolean +modest_tny_folder_store_is_remote (TnyFolderStore *folder_store) +{ + TnyAccount *account = NULL; + gboolean result = TRUE; + + g_return_val_if_fail(TNY_IS_FOLDER_STORE(folder_store), FALSE); + + if (TNY_IS_FOLDER (folder_store)) { + /* Get the folder's parent account: */ + account = tny_folder_get_account(TNY_FOLDER(folder_store)); + } else if (TNY_IS_ACCOUNT (folder_store)) { + account = TNY_ACCOUNT(folder_store); + g_object_ref(account); + } + + if (account != NULL) { + if (tny_account_get_account_type (account) == TNY_ACCOUNT_TYPE_STORE) { + if (!TNY_IS_CAMEL_POP_STORE_ACCOUNT (account) && + !TNY_IS_CAMEL_IMAP_STORE_ACCOUNT (account)) { + /* This must be a maildir account, which does + * not require a connection: */ + result = FALSE; + } + } + g_object_unref (account); + } else { + result = FALSE; + } + + return result; +} + diff --git a/src/modest-tny-account.h b/src/modest-tny-account.h index 915fe3f..16fbc4e 100644 --- a/src/modest-tny-account.h +++ b/src/modest-tny-account.h @@ -187,6 +187,14 @@ gint modest_tny_folder_store_get_message_count (TnyFolderStore *self); **/ gint modest_tny_folder_store_get_local_size (TnyFolderStore *self); +/** + * modest_tny_folder_store_is_remote: + * @folder_store: The folder store (folder or account) that needs to + * decide if need a connection in subsequent operations. + * @return value: Whether a connection is necessary for this folder_store. + */ +gboolean modest_tny_folder_store_is_remote (TnyFolderStore *self); + /** modest_tny_account_get_parent_modest_account_name_for_server_account: * Get the name of the parent modest account of which the server account is a part. */ diff --git a/src/modest-tny-platform-factory.c b/src/modest-tny-platform-factory.c index 00eba53..838eb63 100644 --- a/src/modest-tny-platform-factory.c +++ b/src/modest-tny-platform-factory.c @@ -66,12 +66,16 @@ enum { LAST_SIGNAL }; -typedef struct _ModestTnyPlatformFactoryPrivate ModestTnyPlatformFactoryPrivate; -struct _ModestTnyPlatformFactoryPrivate {}; +/* PRIVATE area commented as it's empty now. If you enable this again remember to enable also + * private area registration in class init */ + +/* typedef struct _ModestTnyPlatformFactoryPrivate ModestTnyPlatformFactoryPrivate; */ +/* struct _ModestTnyPlatformFactoryPrivate {}; */ + +/* #define MODEST_TNY_PLATFORM_FACTORY_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE((o), \ */ +/* MODEST_TYPE_TNY_PLATFORM_FACTORY, \ */ +/* ModestTnyPlatformFactoryPrivate)) */ -#define MODEST_TNY_PLATFORM_FACTORY_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE((o), \ - MODEST_TYPE_TNY_PLATFORM_FACTORY, \ - ModestTnyPlatformFactoryPrivate)) /* globals */ static GObjectClass *parent_class = NULL; static ModestTnyPlatformFactory *singleton = NULL; @@ -121,7 +125,7 @@ modest_tny_platform_factory_class_init (ModestTnyPlatformFactoryClass *klass) gobject_class->finalize = modest_tny_platform_factory_finalize; gobject_class->constructor = modest_tny_platform_factory_constructor; - g_type_class_add_private (gobject_class, sizeof(ModestTnyPlatformFactoryPrivate)); +/* g_type_class_add_private (gobject_class, sizeof(ModestTnyPlatformFactoryPrivate)); */ } static void diff --git a/src/modest-ui-actions.c b/src/modest-ui-actions.c index 32af30d..97f07ac 100644 --- a/src/modest-ui-actions.c +++ b/src/modest-ui-actions.c @@ -53,6 +53,7 @@ #include "maemo/modest-osso-state-saving.h" #include "maemo/modest-maemo-utils.h" #include "maemo/modest-hildon-includes.h" +#include "maemo/modest-connection-specific-smtp-window.h" #endif /* MODEST_PLATFORM_MAEMO */ #include "widgets/modest-ui-constants.h" @@ -63,7 +64,6 @@ #include #include "widgets/modest-folder-view.h" #include "widgets/modest-global-settings-dialog.h" -#include "modest-connection-specific-smtp-window.h" #include "modest-account-mgr-helpers.h" #include "modest-mail-operation.h" #include "modest-text-utils.h" @@ -215,6 +215,7 @@ gboolean modest_ui_actions_run_account_setup_wizard (ModestWindow *win) { gboolean result = FALSE; +#ifdef MODEST_PLATFORM_MAEMO GtkWindow *dialog, *wizard; gint dialog_response; @@ -255,7 +256,7 @@ modest_ui_actions_run_account_setup_wizard (ModestWindow *win) /* Check whether an account was created: */ result = modest_account_mgr_has_accounts(modest_runtime_get_account_mgr(), TRUE); } - +#endif return result; } @@ -709,6 +710,7 @@ modest_ui_actions_on_accounts (GtkAction *action, #endif /* MODEST_PLATFORM_MAEMO */ } +#ifdef MODEST_PLATFORM_MAEMO static void on_smtp_servers_window_hide (GtkWindow* window, gpointer user_data) { @@ -717,7 +719,7 @@ on_smtp_servers_window_hide (GtkWindow* window, gpointer user_data) MODEST_CONNECTION_SPECIFIC_SMTP_WINDOW (window)); gtk_widget_destroy (GTK_WIDGET (window)); } - +#endif void @@ -1953,7 +1955,7 @@ modest_ui_actions_on_header_activated (ModestHeaderView *header_view, return; if (modest_header_view_count_selected_headers (header_view) > 1) { - hildon_banner_show_information (NULL, NULL, _("mcen_ib_select_one_message")); + modest_platform_information_banner (NULL, NULL, _("mcen_ib_select_one_message")); return; } @@ -2600,7 +2602,7 @@ modest_ui_actions_create_folder(GtkWidget *parent_window, if (proto_str && modest_protocol_info_get_transport_store_protocol (proto_str) == MODEST_PROTOCOL_STORE_POP) { finished = TRUE; - hildon_banner_show_information (NULL, NULL, _("mail_in_ui_folder_create_error")); + modest_platform_information_banner (NULL, NULL, _("mail_in_ui_folder_create_error")); } g_object_unref (account); @@ -2730,7 +2732,7 @@ modest_ui_actions_on_rename_folder (GtkAction *action, if (response != GTK_RESPONSE_ACCEPT || strlen (folder_name) == 0) { do_rename = FALSE; - } else if (modest_platform_is_network_folderstore(folder) && + } else if (modest_tny_folder_store_is_remote(folder) && !tny_device_is_online (modest_runtime_get_device())) { TnyAccount *account = tny_folder_get_account(TNY_FOLDER(folder)); do_rename = modest_platform_connect_and_wait(GTK_WINDOW(main_window), account); @@ -2815,7 +2817,7 @@ delete_folder (ModestMainWindow *main_window, gboolean move_to_trash) if (response != GTK_RESPONSE_OK) { do_delete = FALSE; - } else if (modest_platform_is_network_folderstore(folder) && + } else if (modest_tny_folder_store_is_remote(folder) && !tny_device_is_online (modest_runtime_get_device())) { TnyAccount *account = tny_folder_get_account(TNY_FOLDER(folder)); do_delete = modest_platform_connect_and_wait(GTK_WINDOW(main_window), account); @@ -2874,7 +2876,7 @@ modest_ui_actions_on_move_folder_to_trash_folder (GtkAction *action, ModestMainW static void show_error (GtkWidget *parent_widget, const gchar* text) { - hildon_banner_show_information(parent_widget, NULL, text); + modest_platform_information_banner(parent_widget, NULL, text); #if 0 GtkDialog *dialog = GTK_DIALOG (hildon_note_new_information (parent_window, text)); */ @@ -4428,7 +4430,7 @@ modest_ui_actions_on_main_window_move_to (GtkAction *action, } else if (!TNY_IS_FOLDER (src_folder)) { g_warning ("%s: src_folder is not a TnyFolder.\n", __FUNCTION__); do_xfer = FALSE; - } else if (!online && modest_platform_is_network_folderstore(src_folder)) { + } else if (!online && modest_tny_folder_store_is_remote(src_folder)) { guint num_headers = tny_folder_get_all_count(TNY_FOLDER (src_folder)); TnyAccount *account = tny_folder_get_account (TNY_FOLDER (src_folder)); if (!connect_to_get_msg(MODEST_WINDOW (win), num_headers, account)) @@ -4481,7 +4483,7 @@ modest_ui_actions_on_main_window_move_to (GtkAction *action, } else if (gtk_widget_is_focus (GTK_WIDGET(header_view))) { gboolean do_xfer = TRUE; /* Ask for confirmation if the source folder is remote and we're not connected */ - if (!online && modest_platform_is_network_folderstore(src_folder)) { + if (!online && modest_tny_folder_store_is_remote(src_folder)) { TnyList *headers = modest_header_view_get_selected_headers(header_view); if (!msgs_already_deleted_from_server(headers, src_folder)) { guint num_headers = tny_list_get_length(headers); @@ -4521,7 +4523,7 @@ modest_ui_actions_on_msg_view_window_move_to (GtkAction *action, g_object_unref (header); account = tny_folder_get_account (src_folder); - if (!modest_platform_is_network_folderstore(TNY_FOLDER_STORE(src_folder))) { + if (!modest_tny_folder_store_is_remote(TNY_FOLDER_STORE(src_folder))) { /* Transfer if the source folder is local */ do_xfer = TRUE; } else if (remote_folder_is_pop(TNY_FOLDER_STORE(src_folder))) { diff --git a/src/widgets/modest-attachments-view.c b/src/widgets/modest-attachments-view.c index d2d4b2a..f16d572 100644 --- a/src/widgets/modest-attachments-view.c +++ b/src/widgets/modest-attachments-view.c @@ -93,7 +93,7 @@ GtkWidget* modest_attachments_view_new (TnyMsg *msg) { ModestAttachmentsView *self = g_object_new (MODEST_TYPE_ATTACHMENTS_VIEW, - "resize-mode", GTK_RESIZE_PARENT, + "resize-mode", GTK_RESIZE_QUEUE, NULL); modest_attachments_view_set_message (self, msg); diff --git a/src/widgets/modest-recpt-editor.c b/src/widgets/modest-recpt-editor.c index 6416f62..9e7e06b 100644 --- a/src/widgets/modest-recpt-editor.c +++ b/src/widgets/modest-recpt-editor.c @@ -334,8 +334,10 @@ modest_recpt_editor_instance_init (GTypeInstance *instance, gpointer g_class) priv->text_view = gtk_text_view_new (); /* Auto-capitalization is the default, so let's turn it off: */ +#ifdef MAEMO_CHANGES hildon_gtk_text_view_set_input_mode (GTK_TEXT_VIEW (priv->text_view), HILDON_GTK_INPUT_MODE_FULL); +#endif priv->recipients = NULL; diff --git a/src/widgets/modest-window.c b/src/widgets/modest-window.c index b5c3d8d..c0e7830 100644 --- a/src/widgets/modest-window.c +++ b/src/widgets/modest-window.c @@ -34,6 +34,7 @@ #include "modest-runtime.h" #include "modest-window-mgr.h" #include /* for strcmp */ +#include /* 'private'/'protected' functions */ static void modest_window_class_init (ModestWindowClass *klass);