diff options
Diffstat (limited to 'mail')
137 files changed, 0 insertions, 87133 deletions
diff --git a/mail/.cvsignore b/mail/.cvsignore deleted file mode 100644 index 3206dd1426..0000000000 --- a/mail/.cvsignore +++ /dev/null @@ -1,29 +0,0 @@ -.deps -.libs -.pure -Makefile -Makefile.in -evolution-mail -evolution-mail.pure -mail-config.gladep -test-mail -test-sources -test-thread -*.bb -*.bbg -*.da -*.gcov -GNOME_Evolution_Mail*.server -GNOME_Evolution_Mail*.server.in -Spell-common.c -Spell-skels.c -Spell-stubs.c -Spell.h -Mailer-common.c -Mailer-skels.c -Mailer-stubs.c -Mailer.h -evolution-mail-upgrade -evolution-mbox-upgrade -em-marshal.c -em-marshal.h diff --git a/mail/ChangeLog b/mail/ChangeLog deleted file mode 100644 index a5672b100f..0000000000 --- a/mail/ChangeLog +++ /dev/null @@ -1,3091 +0,0 @@ -2003-12-06 JP Rosevear <jpr@ximian.com> - - * Makefile.am: Remove hard coded disable deprecated flags - -2003-12-05 Rodney Dawes <dobey@ximian.com> - - * em-folder-tree.c (render_display_name): Remove the extra || unread - check in the conditional in the g_object_set () call - -2003-12-05 Rodney Dawes <dobey@ximian.com> - - Fixes bug #51482 - - * em-folder-tree.c (render_display_name): Don't hardcode colors - for the folder tree, instead use bold for unread, as in 1.4 - -2003-12-05 Radek Doulik <rodo@ximian.com> - - * em-html-stream.c (emhs_sync_flush): use new gtk_html_flush - method instead of forcing processing of all gtk events - -2003-12-04 Jeffrey Stedfast <fejj@ximian.com> - - * em-folder-tree-model.c (em_folder_tree_model_remove_folders): - Make sure folder_path is non-NULL ("Loading..." nodes will have a - NULL path). Fixes bug #51731. - -2003-12-04 Jeffrey Stedfast <fejj@ximian.com> - - * mail-ops.c (empty_trash_empty): Get the proper local folders - store uri (it's not file:/ anymore). Fixes bug #51618. - -2003-12-04 Jeffrey Stedfast <fejj@ximian.com> - - Fixes bug #51605. - - * em-folder-selector.c (emfs_response): Handle creating a new - folder (pop up a create-folder-selector dialog). - - * em-folder-tree.c (emft_popup_new_folder_response): Moved all the - logic into em_folder_tree_create_folder(). - (em_folder_tree_create_folder): New function to create a folder. - -2003-12-04 Radek Doulik <rodo@ximian.com> - - * em-junk-filter.c (pipe_to_sa): add new err_retval parameter, - which specifies which value to return if something went wrong - (like failed to exec, ...). update all calls by that. actual junk - check has err_retval = 0 to avoid marking false spam - non-zero - retval means junk. - - * em-folder-view.c: set junk toolbar buttons pixmaps - - * mail-session.c: monitor gconf key - /apps/evolution/mail/junk/check_incoming and keep session junk - flag uptodate - - * em-mailer-prefs.c (em_mailer_prefs_construct): added junk - preferences - -2003-12-03 Jeffrey Stedfast <fejj@ximian.com> - - * mail-config.c (uri_to_evname): Updated to add use mail subdirs. - (mail_config_uri_renamed): Updated cachenames[] - (mail_config_folder_to_cachename): Fixed to use the correct path. - - * em-folder-browser.c (emfb_create_view_menus): Updated the - galview path to point to the evo-1.5 location. - (emfb_set_folder): Update the galview view_instance. - (emfb_create_view_instance): Split out from - emfb_create_view_menus() - (emfb_create_view_menus): Reduced code, call - emfb_create_view_instance(). - - * em-folder-selector.c (emfs_create_name_activate): Emit the OK - response, not the CREATE_NEW response. Also, - g_signal_emit_by_name() does not take a GQuark detail argument, so - don't pass one. Fixes bug #51661. - -2003-12-03 Jeffrey Stedfast <fejj@ximian.com> - - * em-folder-view.c (emfv_set_folder): Sync the folder before - replacing it with the new folder. - - * em-folder-tree.c (em_folder_tree_set_selected): Need to prepend - a "/" to path if the path is the url fragment. Also fixed to - select the store node if path == "/". - (emft_popup_rename_folder): Set oldpath and newpath to the proper - values. Fixes bug #51656. - - * em-folder-selector.c (em_folder_selector_get_selected_uri): - Fixed a FIXME by using the CamelProvider url flags to determine if - the url used url->fragment or url->path as the folder path. - (em_folder_selector_get_selected_path): Don't allow path strings - to start with "//". - -2003-12-03 JP Rosevear <jpr@ximian.com> - - * em-folder-tree.c (em_folder_tree_destroy): remove the source - before saving - -2003-12-03 Jeffrey Stedfast <fejj@ximian.com> - - * em-folder-tree.c (em_folder_tree_save_state): Set the - save_state_id to 0 or we will never get a chance to run again. - -2003-12-03 Ettore Perazzoli <ettore@ximian.com> - - * mail-vfolder.c: Do not #include "evolution-shell-component.h". - - * Makefile.am (libevolution_mail_la_SOURCES): Don't compile - mail-importer.[ch] for now. - - * mail-component-factory.c: Do not #include - <evolution-shell-client.h>. - * mail-config.c: Likewise. - - * mail-vfolder.h: Do not #include <evolution-storage.h> or - <evolution-shell-component.h>. - - * mail.h: Do not #include <evolution-storage.h>. - - * mail-ops.h: Do not #include <evolution-storage.h>. - (mail_scan_subfolders): Remove prototype. - (mail_update_subfolders): Likewise. - -2003-12-03 JP Rosevear <jpr@ximian.com> - - * em-folder-tree.c (em_folder_tree_destroy): save the state - immediately if there is a timeout set - (em_folder_tree_save_state): be true GSourceFunc and just return - FALSE to remove the source - -2003-12-03 Not Zed <NotZed@Ximian.com> - - * mail-autofilter.c (rule_match_thread): changed to setup the rule - part properly, it could never have worked. Bug #51601. - - * em-popup.c (emp_uri_popup_address_add): implement. - - * em-folder-view.c (emfv_popup_add_sender): implement. - (emfv_add_sender_addressbook): hook up to above func. - - * em-utils.c (em_utils_add_address): implementation to add an - email address to the addressbook. - (emu_add_address_cb): callback required for funny api. Bug - #51321. - -2003-12-02 Jeffrey Stedfast <fejj@ximian.com> - - * em-folder-tree-model.c (drop_uid_list): Moved here. - (drop_folder): Moved here. - (import_message_rfc822): Moved here. - (drop_message_rfc822): Moved here. - (drop_text_uri_list): Moved here. - (model_drag_data_received): Moved the logic from em-folder-tree.c - into here. - (model_row_drop_possible): Same. - (model_row_draggable): Same. - (drag_text_uri_list): Moved here. - (model_drag_data_get): Moved logic here. - (model_drag_data_delete): Moved logic here. - - * em-folder-tree.c (drag_data_get_cb): Pass the full_name to - camel_store_get_folder() rather than the path. - (drag_data_received_cb): Same. - (drop_uid_list): Removed. - (drop_folder): Removed. - (import_message_rfc822): Removed. - (drop_message_rfc822): Removed. - (drop_text_uri_list): Removed. - (drag_data_received_cb): Removed. - (row_drop_possible_cb): Removed. - (row_draggable_cb): Removed. - (drag_text_uri_list): Removed. - (drag_data_get_cb): Removed. - (drag_data_delete_cb): Removed. - (em_folder_tree_enable_drag_and_drop): Don't connect to any of the - drag & drop signals, they don't exist anymore. - - * mail-component.c (impl_createControls): Enable drag-and-drop. - - * em-folder-tree.c (em_folder_tree_new_with_model): Connect to the - loading row signal. - (loading_row_cb): Expand the path if needed. - (em_folder_tree_destroy): Disconnect from the loading-row signal. - (em_folder_tree_enable_drag_and_drop): New function to enable - drag-and-drop. - (em_folder_tree_new): Remove drag-and-drop setup code. - - * em-folder-tree-model.c (em_folder_tree_model_class_init): Define - the loading-row signal. - (em_folder_tree_model_set_folder_info): emit the loading-row signal. - -2003-12-02 Jeffrey Stedfast <fejj@ximian.com> - - * em-folder-tree.c (em_folder_tree_new): Fixed to pass the - evolution dir into em_folder_tree_model_new(). - (model_save_state): Removed. - (em_folder_tree_save_state): Moved all the saving logic into - em_folder_tree_model_save_expanded(). - - * em-folder-tree-model.c (em_folder_tree_model_new): Load the - expanded state off disk. - (em_folder_tree_model_save_expanded): New function to save - expanded state. - (em_folder_tree_model_get_expanded): new function to get if a node - should be expanded. - (em_folder_tree_model_set_expanded): new function to set the - expanded state of a node. - - * mail-component.c (mail_component_init): Pass the evo dir to - em_folder_tree_model_new() which now requires it. - -2003-12-02 Rodney Dawes <dobey@ximian.com> - - * Makefile.am: Version the schemas - * evolution-mail.schemas: Removed - * evolution-mail.schemas.in.in: Added - -2003-12-02 Not Zed <NotZed@Ximian.com> - - * mail-config-druid.c (mail_config_druid_new): moved the - gtk_widget_show_all to before we add the pages, otherwise it can - override per-page logic. Bug #50790. - - * message-list.c (message_list_create_extras): setup another image - (followup completed) to flag status list. - (states_pixmaps[]): added flag_for_followup_done. - (ml_tree_value_at): return 0,1 or 2 for completed icon. also use - the real ints, these shouldn't have been true/false. Bug #43514. - - * evolution-mail.schemas: Added empty_trash prompt key. - - * em-utils.c (em_utils_prompt_user): changed to take the gconf - 'prompt again' key directly. Fixed callers. - (em_utils_expunge_folder): prompt the user with an expunge - specific message. - (em_utils_empty_trash): have an empty-trash specific message for - prompting confirm. - (emu_confirm_expunge): removed, no longer needed. Bug #38613. - (em_utils_expunge_folder): remove most line feeds, let the label - wrap them. - (em_utils_empty_trash): ditto. - - * em-subscribe-editor.c (sub_folder_subscribed): update the ui - selection state after we're done. maybe we should listen on the - model but this is easier. Bug #50861. - - * em-message-browser.c (emmb_activate): hook up our own verb list. - (emmb_message_verbs[], emmb_close): implement the close verb. - Bug #51558. - - * em-format-html-display.c (efhd_attachment_popup): duh, actually - add the menu list we create. Bug #49902. - - * em-format.c (d): turn off debug, committed by accident. - -2003-12-01 Ettore Perazzoli <ettore@ximian.com> - - * mail-mt.c (do_op_status): Use data->activity_id, not local - activity_id. - -2003-12-01 Ettore Perazzoli <ettore@ximian.com> - - * mail-mt.c (struct _mail_msg_priv): Remove member "activity". - (mail_operation_status): Un-#if 0 the code. - - * mail-component.c (struct _MailComponentPrivate): New member - activity_handler. - (mail_component_init): Initialize. - (impl_dispose): Unref. - (mail_component_peek_activity_handler): New. - (impl_createControls): Create an ETaskBar, attach it to the - ActivityHandler, and return it to the caller as the statusbar - control. - -2003-12-01 Ettore Perazzoli <ettore@ximian.com> - - * mail-component.c (impl_createControls): Pass a label for the - status bar control for now. - -2003-12-01 Jeffrey Stedfast <fejj@ximian.com> - - * mail-config.c (mail_config_signature_run_script): Use fcntl() to - set FD_CLOEXEC on each fd rather than close()ing it. Apparently - Linux's older pthread implementations use sockets and so this - fouls threading up. GO LINUX! GO! - -2003-12-01 Rodney Dawes <dobey@ximian.com> - - * GNOME_Evlution_Mail.server.in.in: - * em-account-prefs.c: - * em-composer-prefs.c: - * em-mailer-prefs.h: - * mail-component-factory.c: - * mail-config-factory.c: - * mail-font-prefs.h: - * importers/*.server.in.in: - * importers/elm-importer.c: - * importers/evolution-mbox-importer.c: - * importers/evolution-outlook-importer.c: - * importers/netscape-importer.c: - * importers/pine-importer.c: Use BASE_VERSION for repo_ids and OAFIIDs - -2003-12-01 Jeffrey Stedfast <fejj@ximian.com> - - * em-folder-tree.c (em_folder_tree_get_folder_info__got): Updated - to call em_folder_tree_model_set_folder_info(). - (folder_subscribed_cb): Removed. - (folder_unsubscribed_cb): Removed. - (folder_created_cb): Removed. - (folder_deleted_cb): Removed. - (folder_renamed_cb): Removed. - - * em-folder-tree-model.c (em_folder_tree_store_set_folder_info): - New function to replace tree_store_set_folder_info() which had - been in em-folder-tree.c - (em_folder_tree_model_remove_uri): Made private. - (em_folder_tree_model_remove_store_info): Made private. - (em_folder_tree_model_remove_folders): New function to replace - remove_folders() from em-folder-tree.c - (em_folder_tree_model_new): No longer takes any args. - - * em-folder-tree.c (em_folder_tree_new): Updated. - - * mail-component.c (add_store): Add the store to the model rather - than the treeview. - (impl_createControls): create a new treeview based on the - already-instantiated model. - (mail_component_init): Create a new tree model. - (mail_component_remove_store): Remove the store from the model - directly. - (mail_component_get_tree_model): Updated. - - * em-folder-tree.c (folder_unsubscribed_cb): Call - em_folder_tree_model_remove_folders() rather than the deprecated - internal remove_folders() function. - (folder_renamed_cb): Same. - (em_folder_tree_remove_store): Removed. - (em_folder_tree_add_store): Removed. - (remove_folders): Removed. - -2003-12-01 Jeffrey Stedfast <fejj@ximian.com> - - * em-composer-utils.c (composer_get_message): rfc2047 encode the - Organization header value. - - * em-folder-tree.c (em_folder_tree_get_folder_info__got): Make - sure our parent folder hasn't been unsubscribed or else we get a - segfault here if it has. - -03-11-28 Dave Camp <dave@ximian.com> - - * em-folder-tree.c (render_pixbuf): Set the pixbuf renderer - invisible for stores. - -2003-11-25 Jeffrey Stedfast <fejj@ximian.com> - - * mail-config.c (mail_config_get_account_by_uid): New function. - - * em-folder-tree.c (tree_store_set_folder_info): Expand the tree - node if the saved state tells us it was expanded the previous - session. - (em_folder_tree_load_state): Load the saved state. - (em_folder_tree_add_store): Conditionally expand the store node. - (em_folder_tree_new_with_model): Expand all the nodes that should - be expanded. - -2003-12-01 Radek Doulik <rodo@ximian.com> - - * em-folder-tree.c (render_pixbuf): use CAMEL_VTRASH_NAME, - CAMEL_VJUNK_NAME - -2003-11-28 Radek Doulik <rodo@ximian.com> - - * em-folder-tree.c (render_pixbuf): added junk icon to folder - icons - -2003-12-01 Not Zed <NotZed@Ximian.com> - - * em-folder-browser.c (emfb_edit_cut, emfb_edit_copy) - (emfb_edit_paste): override the em-folder-view impl, and handle - the search bar properly. For #48746. - - * mail-security.glade: added some padding to the security details - frames. - - * em-format-html-display.c (efhd_xpkcs7mime_validity_clicked): - some cosmetic layout changes. - -2003-11-27 Charles Zhang <charles.zhang@sun.com> - - * mail-account-editor.c (construct): connect "changed" signal. - (mail_account_editor_changed): change signal handler. - Fixes bug #48998. - -2003-11-30 Ettore Perazzoli <ettore@ximian.com> - - * mail-offline-handler.c: Remove all the syncFolder stuff since - it's not in the Component interface anymore. - - * mail-mt.c: Remove declaration for global_shell_client. #if 0 - all the code that uses that. - - * mail-component-factory.c: Remove declaration for - global_shell_client. - - * mail-vfolder.c: Remove declaration for global_shell_client. - -2003-11-26 JP Rosevear <jpr@ximian.com> - - * Makefile.am: turn on deprecated Gtk stuff - -2003-11-24 Jeffrey Stedfast <fejj@ximian.com> - - * em-folder-tree.c (em_folder_tree_save_state): New function to - save tree expanded state. - (em_folder_tree_queue_save_state): New function to queue saving of - the expanded state. - (em_folder_tree_construct): Connect to the row-collapsed signal. - (tree_row_collapsed): Queue a save-state. - (tree_row_expanded): Queue a save state. - (em_folder_tree_get_folder_info__got): Queue a save-state. - -2003-11-25 Not Zed <NotZed@Ximian.com> - - * em-folder-view.c (em_folder_view_print): set session on print - formatter for signatures to work. - - * em-message-browser.c (emmb_destroy): kill warning. - - * em-format-html.c (efh_output_secure): same as - efhd_output_secure, output the security bar, but for - printing/plain html. - (efh_application_xpkcs7mime): use output_secure. - (em_format_html_multipart_signed_sign): removed, output_secure - does what this did. - - * em-format-html-display.c (smime_sign_table, - smime_encrypt_table): Added a short description for the mail - display. - (efhd_xpkcs7mime_button): only good/bad signature at this point, - if only encrypted, then display 'bad' icon. - (efhd_output_secure): output the security bar/button and handle - multi-level enveloping properly. - (efhd_application_xpkcs7mime): just call output_secure to do - the security bar. - (efhd_multipart_signed): same. - (efhd_signature_button): removed, no longer used. - (efhd_signature_check): removed, no longer used. - -2003-11-24 Radek Doulik <rodo@ximian.com> - - * em-format-html.c (efh_text_plain): use new colors - (efh_text_html): ditto - - * em-format-html-display.c (efhd_gtkhtml_realise): set new colors - according to style - - * em-format-html.c (efh_init): init new colors - - * em-format-html.h: added frame and content colors - - * em-format.c (emf_multipart_mixed): do not use horizonal rule, - attachment content is now inside simple frame - - * em-format-html.c (efh_text_plain): add 6 points around text - plain content and frame it - (efh_text_html): frame text/html - (efh_format_do): fix body tag, set bgcolor - (em_format_html_format_headers): do not put headers into own - table, content body is framed now instead - (efh_format_message): update for headers/body changes - - * em-format-html-display.c (efhd_format_attachment): put - additional vertical space around attachment button - -2003-11-22 Jeffrey Stedfast <fejj@ximian.com> - - * em-folder-tree-model.c (model_drag_data_received) - (model_row_drop_possible, model_row_draggable) - (model_drag_data_get, model_drag_data_delete): Swap the retval - varargs value to the last argument instead of the first. - -2003-11-20 Jeffrey Stedfast <fejj@ximian.com> - - * mail-config.c (mail_config_uri_deleted): Removed call to - mail_tool_delete_meta_data(). Fixes bug #51236. - - * mail-component.c (impl_handleURI): Implemented. - (mail_component_class_init): Overload the handleURI method. - -2003-11-20 Jeffrey Stedfast <fejj@ximian.com> - - Fixes bug #51012. - - * em-folder-tree.c (emft_popup_rename_folder): Fixed a FIXME to - not use the OS-specific g_path_*() stuff. - (em_folder_tree_set_selected): For the case where the tree has - already loaded enough subfolders to include the path we need to - select, exopand the nodes to that path as well. For the case that - the tree hasn't loaded enough of the folder nodes, load them and - then have the node selected/expanded to. - -2003-11-19 Jeffrey Stedfast <fejj@ximian.com> - - * em-folder-selector.c (emfs_create_name_activate): Emit the - response signal with the RESPONSE_NEW value. - (emfs_create_name_changed): Sanity check the entry text and set OK - sensitivity. - (folder_selected_cb): If there is an entry widget, then call - name_changed() to decide sensitivity, else set OK to be sensitive. - - * em-utils.c (em_utils_selection_set_urilist): Same. - - * em-format-html-display.c (efhd_drag_data_get): Same as below. - - * em-folder-tree.c (drag_text_uri_list): Terminate each url of a - text/uri-list with a \r\n. - -2003-11-19 Ettore Perazzoli <ettore@ximian.com> - - * GNOME_Evolution_Mail.server.in.in: Add an - "evolution:uri_schemas" attribute. - -2003-11-19 Not Zed <NotZed@Ximian.com> - - * mail-component.c (em_uri_to_camel): if we're setting the - fragment, strip leading /'s. - - * mail-tools.c (mail_tool_get_meta_data) - (mail_tool_delete_meta_data, meta_data_key): old stuff killed. - (mail_tool_uri_to_folder): handle email: uri's specially. this is - a bit of a hack, the filter callbacks should manage this itself - since filters are the only bits which use those uri's. - -2003-11-18 Jeffrey Stedfast <fejj@ximian.com> - - * em-migrate.c (em_migrate_dir): Don't leak the message objects. - - * em-folder-tree.c (em_copy_folders): Execute asynchronously by - queueing the copy in another thread. - (em_copy_folders__copy): Moved the original logic here. - -2003-11-18 Jeffrey Stedfast <fejj@ximian.com> - - * em-folder-tree.c (tree_row_expanded): Queue the - camel_store_get_folder_info() call in another thread. - (em_folder_tree_get_folder_info__got): Moved all the logic of - tree_row_expanded here. - -2003-11-17 Jeffrey Stedfast <fejj@ximian.com> - - * em-folder-tree.c (tree_row_expanded): Fixed to check fi->child - as well (since mbox does it right). - (emft_popup_new_folder_response): Fixed to subscribe to the - correct folder. - (emft_popup_delete_folders): Fixed to use the full_name rather - than the path. - - * em-folder-selection-button.c (set_contents): Fixed to not - include leading '/' in the folder name in the label. - - * em-folder-tree.c (emft_popup_new_folder_response): Implemented - error reporting via gtk dialogs. - (emft_popup_copy_folder_selected): Same. - -2003-11-17 Jeffrey Stedfast <fejj@ximian.com> - - * em-folder-tree.c (emft_popup_new_folder_response): Use a - folder_name rather than a path as the name argument to - camel_store_create_folder(), fixes creation of IMAP folders. - -2003-11-17 Not Zed <NotZed@Ximian.com> - - * em-folder-selection-button.c (set_contents): handle an - unparsable url without crashing. - - * mail-tools.c (mail_tool_get_local_inbox): thin wrapper on - mail_component_get_local_inbox. - - * mail-component.c (mail_component_get_local_inbox): helper to get - the default local inbox. - - * mail-ops.c (fetch_mail_fetch): if we can't get the inbox, make - sure we still unref the filter driver here by using hte same exit - code. Fixes a crash. - -2003-11-14 Jeffrey Stedfast <fejj@ximian.com> - - * em-folder-tree.c (emft_popup_new_folder_response): We can't use - a uri to do a lookup of a store-info on the store_hash, we have to - get a CamelStore first. - (row_draggable_cb): validate the iter before using it. - (row_drop_possible_cb): Same. - (drag_data_received_cb): Here too. - (drag_data_get_cb): Same. - (drag_data_delete_cb): Again here. - (tree_store_set_folder_info): Recursively add nodes if fi->child - is non-NULL rather than adding a dummy node. - (folder_renamed_cb): Implemented. - -2003-11-14 Jeffrey Stedfast <fejj@ximian.com> - - * mail-mt.c (set_stop): Removed most of the code. This is - basically now a nop. Need to somehow get the uic and fix this. - - * folder-browser-factory.[c,h]: Removed. - - * mail-component.c (folder_selected_cb): Don't create a new view - anymore, simply set the new folder uri on the folder browser. This - makes the mailer use a lot less memory than in 1.x - (view_control_activate_cb): Moved here from - folder-browser-factory.c - (impl_createControls): Connect to the activate signal on the view - control. - -2003-11-14 Jeffrey Stedfast <fejj@ximian.com> - - * em-folder-selection.c (folder_selected_cb): Only set OK to - sensitive if the selected node is not a store node. - - * em-folder-tree-model.c: Moved the store_hash and uri_hash from - EMFolderTreePrivate into here instead. - - * em-folder-tree.c: Updated for above changes. - -2003-11-14 Jeffrey Stedfast <fejj@ximian.com> - - * em-folder-view.c (emfv_popup_move): Updated. - (emfv_popup_copy): Updated. - - * em-folder-tree.c (emft_popup_copy): Updated. - (emft_popup_move): Updated. - - * em-folder-selection.c (create_dialog): New convenience function - to construct the dialog contents for all three public functions. - (em_folder_selection_run_dialog): Now longer takes a caption arg. - (em_folder_selection_run_dialog_uri): Same. - (em_select_folder): Here too. - -2003-11-13 Jeffrey Stedfast <fejj@ximian.com> - - * mail-component.c (mail_component_get_tree_model): Use - em_folder_tree_get_model() since an emft is not a GtkTreeView. - - * em-folder-tree.c (em_folder_tree_get_model): New function to get - the tree model. - -2003-11-13 Jeffrey Stedfast <fejj@ximian.com> - - * em-folder-selection.c: Rewritten to use EMFolderTRee. - - * mail-vfolder.c (vfolder_load_storage): Updated for function name - changes in mail-component.c - - * mail-offline-handler.c: Updated for function name changes in - mail-component.c - - * mail-account-gui.c (add_new_store): Fixed to not use EStorage. - (mail_account_gui_save): Updated for function name changes. - - * em-account-prefs.c (account_delete_clicked): Updated for - function name changes. - (account_able_clicked): Same. - (account_able_toggled): Same. - - * mail-component.c: Renamed mail_component_*storage*() functions - to mail_component_*store*() since we are no longer dealing with - storages, but instead with CamelStore's. - (create_view_widget): If the user selects a store node, don't try - to open it as a folder. - -2003-11-13 Ettore Perazzoli <ettore@ximian.com> - - * mail-component.c (impl_sendAndReceive): New, implementation for - Evolution.Component.sendAndReceive. - (mail_component_class_init): Install. - -2003-11-13 Jeffrey Stedfast <fejj@ximian.com> - - * mail-vfolder.c (context_rule_removed): Modified to not use - EStorage* functions. I don't even think it *needs* to remove the - folder from the mail-component, the mail-component should just - pick it up automagically via CamelStore events. - - * em-folder-tree.[c,h]: New folder-tree widget that replaces the - shell's folder-tree widget. - - * em-folder-tree-model.[c,h]: New source files subclassing - GtkTreeStore for handling the mess that is drag&drop. - - * em-folder-selection-button.c: Ported to use EMFolderTree. - - * em-folder-selection.c: Ported to use EMFolderTree. - - * em-folder-selector.c: Ported to use EMFolderTree. - - * mail-component.c: Ported to use EMFolderTree. - - * mail-offline-handler.c (storage_go_online): Updated to not pass - a storage argument. - - * mail-folder-cache.c: Removed storage stuff. - - * mail-send-recv.c (receive_update_got_store): Don't do EStorage* - stuff anymore. - -2003-11-13 Ettore Perazzoli <ettore@ximian.com> - - * mail-component.c (impl__get_userCreatableItems): New, - implementation for the Component.userCreatableItems attribute. - (impl_requestCreateItem): New, implementation for the - Component.requestCreateItem() method. - (mail_component_class_init): Install. - -2003-11-13 Radek Doulik <rodo@ximian.com> - - * em-junk-filter.c (em_junk_sa_is_available): new helper function, - use it before any call to spamassassin, spamc and sa-learn - (em_junk_sa_test_spamd): first test if spamassassin is available - (em_junk_sa_test_spamd): rename em_junk_sa_spamd_tested to - em_junk_sa_tested, always set em_junk_sa_tested - - * mail-folder-cache.c (folder_changed): don't call - CAMEL_IS_VJUNK_FOLDER, it was added by mistake - -2003-11-13 Not Zed <NotZed@Ximian.com> - - * em-format-html.c (em_format_html_add_pobject): use malloc0 for - the pobject memory. - -2003-11-12 Not Zed <NotZed@Ximian.com> - - * mail-account-gui.c (smime_sign_key_select) - (smime_encrypt_key_select, smime_encrypt_key_selected) - (smime_sign_key_selected): implement the key selector popup using - e-cert-selector. - -2003-11-11 Not Zed <NotZed@Ximian.com> - - * em-format-html.c (efh_application_xpkcs7mime): output icons of - the status. - (em_format_html_add_pobject): Changed to take a size specificier, - return the pobject, and re-ordered args to be more consistent with - puri stuff. - (em_format_html_remove_pobject): handle the free callback if set. - - * em-format.c (emf_application_xpkcs7mime): moved this to - em-format-html since it needs to do icon stuff. - - * mail-security.glade: new glade file for security related stuff. - - * mail-config.glade: removed the message security dialogue, it - gets opened automatically by the config code :( - -2003-11-10 Ettore Perazzoli <ettore@ximian.com> - - * GNOME_Evolution_Mail.server.in.in: Set an - "evolution:component_alias" property with a value of "mail". - -2003-11-10 Not Zed <NotZed@Ximian.com> - - * em-format-html.c (em_format_html_multipart_signed_sign): changed - for cipher context api changes. - * em-format.c (emf_multipart_signed): ditto. - -2003-11-07 Not Zed <NotZed@Ximian.com> - - * mail-config.glade: added security_information_dialog (probably - temporarily in this file). - - * em-format.c (em_format_is_attachment): also treat pkcs7-mime as - non-attachment. - (emf_application_xpkcs7mime): no longer need to worry about - scanning the part. - -2003-11-07 Dan Winship <danw@ximian.com> - - * message-list.c: Don't #include e-name-western.h, since the code - that uses it is commented out, and we want to remove the local - copy, but we don't want to make the mailer depend on the e-d-s - copy if it's not even going to be using it. - -2003-11-07 JP Rosevear <jpr@ximian.com> - - * Makefile.am: build the marshall files right at the beginning - -2003-11-11 Not Zed <NotZed@Ximian.com> - - * mail-security.glade: new glade file for security related stuff. - - * mail-config.glade: removed the message security dialogue, it - gets opened automatically by the config code :( - -2003-11-10 Ettore Perazzoli <ettore@ximian.com> - - * GNOME_Evolution_Mail.server.in.in: Set an - "evolution:component_alias" property with a value of "mail". - -2003-11-10 Not Zed <NotZed@Ximian.com> - - * em-format-html.c (em_format_html_multipart_signed_sign): changed - for cipher context api changes. - * em-format.c (emf_multipart_signed): ditto. - -2003-11-07 Not Zed <NotZed@Ximian.com> - - * mail-config.glade: added security_information_dialog (probably - temporarily in this file). - - * em-format.c (em_format_is_attachment): also treat pkcs7-mime as - non-attachment. - (emf_application_xpkcs7mime): no longer need to worry about - scanning the part. - -2003-11-07 Dan Winship <danw@ximian.com> - - * message-list.c: Don't #include e-name-western.h, since the code - that uses it is commented out, and we want to remove the local - copy, but we don't want to make the mailer depend on the e-d-s - copy if it's not even going to be using it. - -2003-11-07 JP Rosevear <jpr@ximian.com> - - * Makefile.am: Make sure the marshal files are listed above other - sources - -2003-11-06 Jeffrey Stedfast <fejj@ximian.com> - - * em-migrate.c (em_migrate_filter_file): Call em_migrate_uri() - instead of em_uri_from_camel(). - (em_migrate_uri): Special-case file: uri's by converting them into - email://local@local/ uri's since these folders will have been - migrated to the newer mbox tree structure. - -2003-11-06 Jeffrey Stedfast <fejj@ximian.com> - - * mail-vfolder.c (mail_vfolder_delete_uri): User vfolder rules - should be in ${evolution_dir}/mail/vfolders.xml rather than - ${evolution_dir}/vfolders.xml - (mail_vfolder_rename_uri): Same. - (store_folder_deleted): Here too. - (store_folder_renamed): And here. - (vfolder_load_storage): Again here. - (vfolder_editor_response): Same. - (edit_rule_response): And here. - (new_rule_clicked): Here too. - - * mail-session.c (main_get_filter_driver): User filter rules - should be in ${evolution_dir}/mail/filters.xml rather than - ${evolution_dir}/filters.xml - - * mail-autofilter.c (filter_gui_add_from_message): Same. - (mail_filter_rename_uri): And here. - (mail_filter_delete_uri): Here too. - - * em-utils.c (filter_editor_response): Again here. - (em_utils_edit_filters): Same. - - * em-migrate.c (em_migrate_filter_file): Same (also for - vfolders.xml) - -2003-11-05 Jeffrey Stedfast <fejj@ximian.com> - - * em-migrate.[c,h]: New source files to migrate from the old mail - directory to the new mail directory. - - * mail-component.c (mail_component_init): Changed to use - ~/.evolution and added code to migrate the old mail folders over - if ~/.evolution/mail does not yet exist. - -2003-11-03 Ettore Perazzoli <ettore@ximian.com> - - * GNOME_Evolution_Mail.server.in.in: Use "evolution2:config_item" - properties for the config item instead of "evolution:config_item" - ones. - -2003-11-01 Jeffrey Stedfast <fejj@ximian.com> - - * em-folder-view.c: setup filter-on-thread and vfolder-on-thread. - - * mail-autofilter.c (rule_from_message): handle AUTO_THREAD - (rule_match_thread): new function to setup a filter on a msgid - -2003-10-31 Not Zed <NotZed@Ximian.com> - - * mail-config.glade: Rearranged smime config slightly, and added - encrypt key preference. - - * mail-account-gui.c (mail_account_gui_save, - mail_account_gui_new): enable smime always if have_nss. Added new - options in glade file and handle changed names. - (smime_changed, smime_sign_key_select, smime_sign_key_clear) - (smime_encrypt_key_select, smime_encrypt_key_clear): Add a bunch - of mostly dummy UI behaviour management stuff. - -2003-10-30 Not Zed <NotZed@Ximian.com> - - * em-format.c (em_format_is_inline): show application/x-pkcs7-mime - inline always by default. - -2003-10-30 Not Zed <NotZed@Ximian.com> - - * em-format.c (emf_multipart_signed): handle - application/x-pkcs7-signature. - -2003-10-29 Not Zed <NotZed@Ximian.com> - - * em-format-html.c (em_format_html_multipart_signed_sign): handle - application/x-pkcs7-signature. - - * em-format.c (emf_application_xpkcs7mime): Handle - application/x-pkcs7-mime. - -2003-10-29 Jeffrey Stedfast <fejj@ximian.com> - - * em-account-prefs.h: Changed the OAFIID. - - * em-composer-prefs.h: Changed the OAFIID. - - * em-mailer-prefs.h: Changed the OAFIID. - - * GNOME_Evolution_Mail.server.in.in: Changed OAFIIDs for the prefs - controls. - -2003-10-29 Jeffrey Stedfast <fejj@ximian.com> - - * GNOME_Evolution_Mail.server.in.in: Nuked the MailConfig - interface stuff. - - * Mailer.idl: Removed. None of the interfaces are needed/used - anymore. - - * folder-info.[c,h]: Removed. The summary was the only thing that - needed/used this code and it has been nuked into oblivion, so - these interfaces are no longer needed. - - * mail-config.c: Removed old crufty CORBA interface snot that is - no longer needed or used. - -2003-10-27 Jeffrey Stedfast <fejj@ximian.com> - - * Fixes bug #49816 - - * em-popup.c (emp_part_popup_reply_sender): No need to pass a - parent window arg anymore. - (emp_part_popup_reply_list): Same. - (emp_part_popup_reply_all): Here too. - (emp_part_popup_forward): Same. - (emp_uri_popup_address_send): Here too. - - * em-folder-browser.c (emfb_mail_compose): No need to pass a - parent window arg anymore. - (emfb_mail_post): Same. - - * em-folder-view.c (emfv_message_reply): Don't pass a parent - window argument anymore. - (emfv_popup_forward): Same. - (emfv_popup_resend): Same here. - (em_folder_view_open_selected): Same. - (emfv_message_forward_attached): Here too. - (emfv_message_forward_inline): And here. - (emfv_message_forward_quoted): Same. - (emfv_message_redirect): Here too. - (emfv_message_post_reply): And here. - (emfv_format_link_clicked): ANd finally here. - - * em-utils.c (create_new_composer): Don't set_transient_for() - anymore. - (em_utils_compose_new_message): No longer takes a parent window - argument. - (em_utils_forward_attached): No longer takes a parent window arg. - (em_utils_forward_inline): Same. - (em_utils_forward_quoted): Same. - (em_utils_forward_message): Same. - (em_utils_forward_messages): Here too. - (redirect_get_composer): Don't set_transient_for() here either. - (em_utils_redirect_message): No longer takes a parent window arg. - (em_utils_redirect_message_by_uid): Same. - (reply_get_composer): Don't set_transient_for() here. - (em_utils_reply_to_message): No longer takes a parent window arg. - (em_utils_reply_to_message_by_uid): Same. - (post_reply_to_message): Don't set_transient_for() here. - (em_utils_post_reply_to_message_by_uid): No longer takes a parent - window arg. - (em_utils_compose_new_message_with_mailto): Don't - set_transient_for() here. - (em_utils_post_to_url): Same. - (em_utils_edit_message): No longer takes a parent window arg. - (em_utils_edit_messages): Same. - -2003-10-24 Jeffrey Stedfast <fejj@ximian.com> - - * em-account-prefs.[c,h]: Re-Namespaced mail-accounts.c - - * em-composer-prefs.[c,h]: Re-Namespaced mail-composer-prefs.c - - * em-mailer-prefs.[c,h]: Re-Namespaced mail-preferences.c - - * mail-accounts.[c,h]: Removed. - - * mail-composer-prefs.[c,h]: Removed. - - * mail-preferences.[c,h]: Removed. - - * mail-account-editor.c: Updated. - - * mail-account-gui.c: Updated. - - * mail-config-factory.c: Updated. - - * mail-component-factory.c: Updated. - -2003-10-22 Ettore Perazzoli <ettore@ximian.com> - - * GNOME_Evolution_Mail.server.in.in: Add an - "evolution:button_icon" attribute. - -2003-10-22 Ettore Perazzoli <ettore@ximian.com> - - * GNOME_Evolution_Mail.server.in.in: Add an - "evolution:button_sort_order" attribute. - -2003-10-22 Jeffrey Stedfast <fejj@ximian.com> - - * mail-component.c (parse_uid_list): Removed, use - em_utils_selection_get_uidlist() instead. - (drop_uid_list): Use em_utils_selection_get_uidlist() to parse the - x-uid-list selection data and use mail_tool_uri_to_folder() - directly since we have the uri (originally we expected the first - component of the selection data to be the e-storage-set-view - folder path rather than the uri). - (folder_receive_drop_cb): Call gtk_drag_finish() here. - - * message-list.c: s/x-evolution-message/x-uid-list/ - - * em-utils.c: Same. - -2003-10-22 Ettore Perazzoli <ettore@ximian.com> - - * mail-component.c (impl_createControls): Use - e_storage_browser_peek_widget_scrolled() to retrieve the scrolled - window that the EStorageSetView is contained in. - -2003-10-22 Ettore Perazzoli <ettore@ximian.com> - - * GNOME_Evolution_Mail.server.in.in: Add an - "evolution:button_label" attribute to the Component for use in the - shell. - -2003-10-22 Not Zed <NotZed@Ximian.com> - - * mail-component.c (em_copy_folders): handle destination of "" - properly. - (emc_popup_copy_folder_selected): handle url->path properly, strip - leading /. - (em_copy_folders): if we just created a new folder on a - subscribable store, subscribe to it. - (em_copy_folders): handle nonselectable folders specially. - -2003-10-21 Jeffrey Stedfast <fejj@ximian.com> - - * mail-component.c (drag_text_uri_list, folder_dragged_cb) - (drop_uid_list, drop_folder, import_message_rfc822) - (drop_message_rfc822, drop_text_uri_list, folder_receive_drop_cb): - New functions to handle drag & drop to/from the folder tree. - (impl_createControls): Setup drag & drop support. - - * em-format.c (emf_multipart_mixed): Put an <hr> between parts of - a multipart. - -2003-10-21 Not Zed <NotZed@Ximian.com> - - * mail-component.c (emc_popup_properties): implement. - (emc_popup_properties_got_folder): builds dynamic - folder-properties dialogue. - (emc_popup_properties_response): set the properties on the folder - on an ok response. - (emc_popup_properties_free): free the properties working data. - - * mail-folder-cache.c (unset_folder_info): unhook from the right - function for message_changed. - -2003-10-20 Not Zed <NotZed@Ximian.com> - - * mail-component.c (emc_popup_new_folder): pass the right object - to set_selected(). Fixes a new real bug. Undid reformatting. - -2003-10-17 Jeffrey Stedfast <fejj@ximian.com> - - * mail-component.c: General compile fixes. - (emc_popup_new_folder): Fixed to not shadow a parameter. Fixes a - real bug. - - * mail-component.h: Added some prototypes. - -2003-10-13 Not Zed <NotZed@Ximian.com> - - * em-popup.c (em_popup_create_menu_once): only hookup target free - if we have a target set. - - * mail-component.c (load_accounts): removed debug i accidentally - left in. - (emc_tree_right_click): handle right-click context menu, using an - EMPopup table. - (emc_popup_*): setup empty popup handlers. - -2003-10-13 Not Zed <NotZed@Ximian.com> - - * em-folder-selection.c (em_select_folder): asynchornous folder - selection call. - (emfs_folder_selected): callback for folder selected. - - * em-folder-view.c (emfv_popup_move): implement. - (emfv_popup_copy): " - (emfv_popup_move_cb): async folder select callback to run it. - -2003-10-10 Not Zed <NotZed@Ximian.com> - - * mail-account-gui.c - (mail_account_gui_folder_selector_button_new): use - em_folder_selection_button. - (mail_account_gui_new): " - (folder_selected): " - - * em-folder-selection-button.c: Make this use camel uri's rather - than camelfolders. - (set_selection): removed, redundant. - (impl_dispose): removed, not needed. - - * em-folder-selection-button.h: change the selected signal not to - actually return the selection, which must get retrieved later. - - * mail-component.c (em_uri_from_camel): create an evo mail uri - from a camel one. - (em_uri_to_camel): the reverse. - - * mail-signature-editor.c (mail_signature_editor): up the version - of the gtkhtml editor. - -2003-10-09 Not Zed <NotZed@Ximian.com> - - * em-folder-selection-button.c (set_selection): always set - selected_folder, otherwise we don't unset it properly. - - * em-folder-selection.c (em_folder_selection_run_dialog): fix a - small memleak. - (em_folder_selection_run_dialog_uri): do the same as run_dialog - but take, and return physical uri's. - - * mail-component-factory.c (factory): removed some fixme's, and - re-hookedup the composer. - -2003-10-09 Frederic Crozat <fcrozat@mandrakesoft.com> - - * em-icon-stream.c (emis_sync_close): Use - gnome-thumbnail_scale_down_pixbuf if available, for better - performance. - -2003-10-08 Jeffrey Stedfast <fejj@ximian.com> - - * em-folder-view.c: Add a hide_mask to the - create-rule-from-message bars so that we don't segfault when we - right click with a multi-selection. - -2003-10-08 Chris Toshok <toshok@ximian.com> - - * em-utils.c (em_utils_camel_address_to_destination): EDestination - => EABDestination, and e_destination => eab_destination. - (reply_get_composer): same. - (post_reply_to_message): same. - - * em-composer-utils.c (ask_confirm_for_unwanted_html_mail) - EDestination => EABDestination, and e_destination => - eab_destination. - (composer_get_message):same. - -2003-10-08 Not Zed <NotZed@Ximian.com> - - * mail-component.c (mail_component_peek): setup vfolders once we - hve the component, since its setup will call mail_component_peek, - fun recursion. - -2003-10-08 Not Zed <NotZed@Ximian.com> - - * mail-component.c (setup_local_folder): removed. - (setup_local_store): setup various needed globals properly. - (setup_account_storages): renamed to load_accounts. - (go_online): turn on interactivity as well as onlinedness. - - * GNOME_Evolution_Mail.server.in.in: point the preferences pages - to the right factory. - -2003-10-07 Not Zed <NotZed@Ximian.com> - - * mail-component.[ch]: Fix copyrights. - -2003-10-06 Jeffrey Stedfast <fejj@ximian.com> - - * mail-config-druid.c (identity_prepare): Fixed. - - * mail-ops.c (fetch_mail_fetch): Always save the uid cache no - matter what. - -2003-10-03 Frederic Crozat <fcrozat@mandrakesoft.com> - - * mail-config-druid.c (identity_prepare), (config_wizard_new): - Convert real name to UTF-8 if needed. - -2003-10-03 Jeffrey Stedfast <fejj@ximian.com> - - * em-folder-browser.c (emfb_set_folder): Disable the selection of - the first unread message for now. This is actually annoying the - fuck out of me, Radek, and a few other people. - -2003-10-02 Not Zed <NotZed@Ximian.com> - - * mail-component.c (add_storage): Add the storage to the hash - after we've initialised it. - (mail_component_evomail_uri_from_folder): hardcode "local" account - pseudo-id for local folders. - (mail_component_get_folder_from_evomail_uri): handle the "local" - account case. - -2003-10-02 Not Zed <NotZed@Ximian.com> - - * mail-component.c (setup_local_store): use mbox:/path rather than - mbox:///path - the mbox code is 'wrong', but this is easier to - fix. fixes local unread counts. maybe the provider url-compare - should address this too. - -2003-10-02 Suresh Chandrasekharan <suresh.chandrasekharan@sun.com> - - * mail-config-druid.c: Fix for 40917 "Backspace shouldn't - highlight the whole remaining string in Setup Assistant". - (identity_changed): Removed repeated focussing per keystroke. - functions - (source_changed): Same. - (transport_changed): Here too. - (management_changed): And here. - (identity_prepare): Removed the initial highlighting for Full - Name, also the unneeded intial grab_focus. - -2003-10-02 Not Zed <NotZed@Ximian.com> - - * em-format-html.c (efh_format_timeout): zero out last_part if - we're clearing. Uh, this fixes, but shouldn't, part of #49034. - The problem is the 'last part' logic is based on the address, - which can quite easily be repeated for different messages. - - * em-folder-view.c (emfv_list_message_selected): reverted jeff's - patch for #48618, use a much simpler method. - - * em-message-browser.c (emmb_destroy): hook onto destroy handler, - we need to destroy the messagelist ourselves, since we dont attach - it to any parent window. - -2003-10-01 Not Zed <NotZed@Ximian.com> - - * em-format-html.c (efh_init): turn off blocking writes. - (efh_format_timeout): don't do a htmlbegin on the page yet, it'll - be handled by em-html-stream when it has data, to reduce flicker. - (efh_format_do): close the main gtkhtml stream as soon as we're - done writing the body. any sub-jobs should be using frames etc. - (efh_text_plain): dont write a table around the text, try to - reduce flickering. layout may be out now though. - - * em-html-stream.c (emhs_sync_write): if we have no html_stream - yet, begin a new one. - -2003-09-30 Rodney Dawes <dobey@ximian.com> - - * em-format-html-print.c: Use "Sans Regular" instead of "Helvetica" - Fixes bug #47878 - -2003-09-30 Not Zed <NotZed@Ximian.com> - - * em-format-html.c (efh_init): remove gconf stuff. - (em_format_html_set_xmailer_mask): new method to set the xmailer mask. - - * em-folder-view.c (emfv_display_keys[]): Added charset key to - monitor/retrieve, and xmailer_mask. - (emfv_setting_notify): Monitor charset setting, pass onto the - formatter, as well as xmailer_mask. - - * mail-preferences.c (mail_preferences_construct): use the new - charset key. - (mail_preferences_apply): use the new charset key. - - * evolution-mail.schemas: Moved the mail/format/charset to - mail/display/charset. 1. it makes more sense, and 2. it makes - notification update easier in em-folder-view.c - - * em-format.c (emf_init): remove the gconf charset stuff, for bug - #48791, and also actually fixes the fixme that jeff thought he - fixed. - (em_format_format_text): use default charset as fallback. - (em_format_set_default_charset): New method to set the default charset. - (gconf_charset_changed): removed. - -2003-09-29 Jeffrey Stedfast <fejj@ximian.com> - - * em-format.c (emf_init): Oops, put the arguments in the right order. - -2003-09-29 Ettore Perazzoli <ettore@ximian.com> - - * mail-component.c: New member local_store in - MailComponentPrivate. - (impl_dispose): Unref. - (mail_component_load_storage_by_uri): Return the CamelStore. - (setup_local_folder): New. - (setup_local_store): New. - (mail_component_init): Call it. - (mail_component_peek_storage_set): New. - (mail_component_get_folder_from_evomail_uri): New. - (mail_component_evomail_uri_from_folder): New. - - * em-folder-selection-button.c: New. - * em-folder-selection-button.h: New. - - * em-folder-selection.c: New. - * em-folder-selection.h: New. - - * em-marshal.list: Add NONE:POINTER. - -2003-09-25 Jeffrey Stedfast <fejj@ximian.com> - - * mail-account-gui.c (mail_account_gui_save): Allow any file: uri - to point to a sent or drafts folder. - -2003-09-25 Rodney Dawes <dobey@ximian.com> - - * mail-send-recv.c: Make the dialog more HIG-compliant by fixing - widget alignment/spacing issues, and removing separators - -2003-09-24 Jeffrey Stedfast <fejj@ximian.com> - - * mail-preferences.c (mail_preferences_construct): Same as below. - - * mail-composer-prefs.c (mail_composer_prefs_construct): gconf can - return empty string if the charset has not been set, so if the - charset string is empty, default the charset to the user's locale - charset. Partial fix for bug #47638. - -2003-09-23 Ettore Perazzoli <ettore@ximian.com> - - * mail-component.c (add_storage): Remove unused arg "uri". - (mail_component_add_store): Likewise. - (add_storage): Don't set the "Connecting..." node. - (mail_component_init): Set up local store at - ~/.evolution/mail/local. - - * evolution-mbox-upgrade.c (get_local_store): Remove a double - xmlFree() that was causing it to crash. - - -2003-09-23 Ettore Perazzoli <ettore@ximian.com> - - * mail-component.c (add_storage): Note the new store. - - * mail-component-factory.c: Don't include "mail-callbacks.h" - anymore. - - * em-format-html.c (em_format_html_get_type): Get the base - directory with mail_component_peek_base_directory(). - * em-utils.c (filter_editor_response): Likewise. - (em_utils_edit_filters): Likewise. - - * em-folder-browser.c (emfb_init): Get the search context through - mail_component_peek_search_context(). - -2003-09-23 Jeffrey Stedfast <fejj@ximian.com> - - * evolution-mbox-upgrade.c (get_local_store): Don't xmlFree (name) - until after we've g_strdup'd it. - (em_migrate_dir): If the metadata file doesn't exist, don't even - bother trying subfolers (the shell just ignores them so we should - too). - -2003-09-23 Jeffrey Stedfast <fejj@ximian.com> - - Fix for bug #48791 (and also fixes a FIXME) - - * em-format.c (emf_init): Setup a gconf listener for changes to - the charset setting. - (gconf_charset_changed): Update the cached gconf charset value. - (emf_finalise): Free the EMFormatPrivate data, unref the gconf - client, disconnect the charset notify id, and free the cached - gconf charset value. - (em_format_format_text): Use the cached gconf charset value. - -2003-09-22 Not Zed <NotZed@Ximian.com> - - ** See bug #32996 - - * mail-folder-cache.c (real_flush_updates): don't just pass TRUE - to the 'can work offline' parameter of new shell folder. - - ** See bug #39410 - - * mail-ops.c (prep_offline_do): sync all messages, not just - unread or flagged ones. - -2003-09-22 Not Zed <NotZed@Ximian.com> - - * em-popup.c (emp_uri_popup_link_copy): removed, moved to - em-folder-view, for now, it has access to an invisible. - - * em-folder-view.c (emfv_setting_notify): honour the load_http - setting, at least the all setting. - (emfv_format_popup_event): setup the popup menu item for copy link - location here. - -2003-09-22 Jeffrey Stedfast <fejj@ximian.com> - - * mail-preferences.c (mail_preferences_construct): Connect to - "value-changed" rather than "changed" for spin buttons. - -2003-09-21 Not Zed <NotZed@Ximian.com> - - * mail-session.c (ms_thread_msg_new): implement, we hook into the - mail progress reporting stuff by overriding the CamelOperation - member with one from a dummy mail_msg. - (ms_thread_msg_free): handle freeing. - - * mail-mt.c (mail_msg_free): mute the camel-operaiton when we free - it so we no longer get updates. - -2003-09-19 Jeffrey Stedfast <fejj@ximian.com> - - * em-message-browser.c (emmb_set_message): Set the window title to - be that of the message subject. Fixes bug #48617. - -2003-09-19 Jeffrey Stedfast <fejj@ximian.com> - - Fix for bug #48618. - - * em-folder-view.c (emfv_list_message_selected): See if we have - already loaded the message uid that has just been selected, if so - - don't bother re-loading it. - (emfv_list_done_message_selected): Update loaded_uid and - loading_uid. - -2003-09-18 Radek Doulik <rodo@ximian.com> - - * em-format-html.c (efh_init): use gtkhtml's blocking - -2003-09-18 Jeffrey Stedfast <fejj@ximian.com> - - * em-inline-filter.c: updated for CamelTransferEncoding namespace - changes - - * em-inline-filter.h: updated for CamelTransferEncoding namespace - changes - - * mail-ops.c: updated for CamelTransferEncoding namespace changes - -2003-09-18 Jeffrey Stedfast <fejj@ximian.com> - - * component-factory.c: updated for camel namespace changes - - * em-folder-view.c: updated for camel namespace changes - - * em-format-html-display.c: updated for camel namespace changes - - * em-format-html-quote.c: updated for camel namespace changes - - * em-format.c: updated for camel namespace changes - - * em-popup.c: updated for camel namespace changes - - * em-utils.c: updated for camel namespace changes - - * mail-autofilter.c: updated for camel namespace changes - - * mail-ops.c: updated for camel namespace changes - - * mail-session.c: updated for camel namespace changes - - * message-list.c: updated for camel namespace changes - - * message-tag-followup.c: updated for camel namespace changes - - * importers/evolution-mbox-importer.c: updated for camel namespace - changes - -2003-09-18 Jeffrey Stedfast <fejj@ximian.com> - - * em-popup.c (emp_standard_menu_factory): Don't forget to - initialise/increment 'i' when using it as an object id in the - for-loop. - - * em-format.c (em_format_format_text): Initialise charset to NULL - or it may be used uninitialised. Also include - gnome-vfs-mime-handlers.h for gnome_vfs_mime_type_get_description(). - - * Makefile.am: Added $(MARSHALL_GENERATED) to $(BUILT_SOURCES) so - that em-marshal.[c,h] were autogenerated. - -2003-09-17 Not Zed <NotZed@Ximian.com> - - * folder-browser.c, folder-browser.h, folder-browser-ui.c - folder-browser-ui.h, mail-callbacks.c, mail-callbacks.h - mail-display.c, mail-display.h, mail-display-stream.c - mail-display-stream.h, mail-format.c, mail-format.h - mail-identify.c, mail-search.c, mail-search.h message-browser.c, - message-browser.h, subscribe-dialog.c subscribe-dialog.h, - mail-font-prefs.c, mail-font-prefs.h: cvs removed. - - * Makefile.am: Removed mail-font-prefs.[ch], hasn't been built for - ages. - - * em-*.c: killed a bunch of printfs. - - * em-format-html-display.c (efhd_html_button_press_event): update - for html object api chagnes. - - ** Merge in mail-refactor-2 branch. - -2003-09-17 Jeffrey Stedfast <fejj@ximian.com> - - * evolution-mbox-upgrade.c: New source file to migrate from the - old mbox structure to the new mbox structure. - -2003-09-08 Ettore Perazzoli <ettore@ximian.com> - - * mail-folder-cache.c (mail_note_store): Allow NULL storage in - precondition. - - * mail-component.c (mail_component_init): Remove debugging - message. - -2003-08-22 Not Zed <NotZed@Ximian.com> - - * mail-format.c (write_date): translate the local time format. - -2003-08-20 David Woodhouse <dwmw2@infradead.org> - - * mail-format.c (write_date): Use e_utf8_strftime() to generate - localised time; avoid gratuitous extra translation and array of - day names, and the autoconf magic which made Not Zed dislike the - inclusion of the timezone name. - -2003-08-18 Ettore Perazzoli <ettore@ximian.com> - - * GNOME_Evolution_Mail.server.in.in: Rename - GNOME_Evolution_Mail_Component2 to - GNOME_Evolution_Mail_Component_2 and GNOME_Evolution_Mail_Factory2 - to GNOME_Evolution_Mail_Factory_2. - * mail-component-factory.c: Update accordingly. - -2003-08-18 Jeffrey Stedfast <fejj@ximian.com> - - * mail-session.c (main_get_filter_driver): Removed the - new-mail-notification mess. - - * mail-folder-cache.c (notify_idle_cb): New idle callback to alert - the user about new mail. - (notify_type_changed): New function to intercept user changes to - his/her notification settings changes. - (real_flush_updates): Initialise new mail notification if not yet - initialised and setup an idle callback if none is already set. - (update_1folder): Now takes an additional argument `new' which - states whether or not the fodler got any new mail so that we may - handle notify the user (if needed). - (folder_changed): Pass in the number of new messages received. - -2003-08-19 Not Zed <NotZed@Ximian.com> - - * mail-callbacks.c (mail_generate_reply): Added a comment for - translators. - -2003-08-19 David Woodhouse <dwmw2@infradead.org> - - * mail-callbacks.c (mail_generate_reply): Add a timezone offset to - the attribution string. - -2003-08-19 Not Zed <NotZed@Ximian.com> - - * mail-format.c (write_date): Added translation for day and - localtime strings. Also removed the tz_zone stuff, and just use - 'localtime' always. - -2003-08-15 David Woodhouse <dwmw2@infradead.org> - - * mail-format.c (write_date): Show date in localtime too. - -2003-08-19 Harry Lu <harry.lu@sun.com> - - ** For #45348 - - * mail-display.c (mail_display_render): Change "%P" to "%p" so - that strftime() can work under solaris. - -2003-08-14 Jeffrey Stedfast <fejj@ximian.com> - - * mail-ops.c (mail_send_message): Don't abort at the first failure - after sending (filtering, appending to Sent, syncing). Instead, - keep a running tab of exceptions and then set a culmulative - exception at the end to report to our caller. Also, if we fail to - append to the account Sent folder, try again with the local Sent - folder. Fixes bug #46512. - -2003-08-13 Suresh Chandrasekharan <suresh.chandrasekharan@sun.com> - - * e-searching-tokenizer.c (searcher_next_token): Fix for 45818 ( - i18n mail messages search only produces '[?]'). Now multibyte - character selection works correctly. But due to associated gtkhtml - bug, the find button functionallity for multibyte characters is - broken. - -2003-08-12 Jeffrey Stedfast <fejj@ximian.com> - - * mail-tools.h: Removed unused function prototype. - -2003-08-11 Jeffrey Stedfast <fejj@ximian.com> - - * mail-session.c (remove_timeout): Removed. - (register_timeout): Removed. - -2003-08-09 Ettore Perazzoli <ettore@ximian.com> - - * mail-component.c (storage_go_online): Pass NULL for the - operation pointer to mail_note_store(), to sync with Michael's - changes. - -2003-08-05 Jeffrey Stedfast <fejj@ximian.com> - - * mail-format.c (handle_multipart_encrypted): Updated for - CamelMimePart::content_type changes. - - * mail-ops.c (save_part_save): Use - camel_data_wrapper_decode_to_stream() here. - - * mail-display.c (drag_data_get_cb): Updated for - CamelMimePart::content_type changes. - (do_attachment_header): Same. - -2003-07-31 Jeffrey Stedfast <fejj@ximian.com> - - * mail-format.c (mail_format_raw_message): Updated to pass FALSE - as the 'decode' param to - mail_format_data_wrapper_write_to_stream(). - (mail_format_data_wrapper_write_to_stream): Now takes a boolean - arg telling whether to decode or not. Also reworked the charset - logic now that camel doesn't handle this for us any longer. - (mail_format_get_data_wrapper_text): Updated. - (handle_text_plain): Same. - (handle_text_enriched): Here too. - - * mail-display.c (do_attachment_header): Call decode_to_stream - here instead of write_to_stream. - (do_external_viewer): Same. - (on_url_requested): Same. Also updated for - mail_format_data_wrapper_write_to_stream(). - (try_part_urls): Call decode_to_stream. - (drag_data_get_cb): Same. - -2003-08-05 Not Zed <NotZed@Ximian.com> - - ** See bug #32732 - - * message-list.c (mail_regen_list): use thread_new. - - * mail-local.c (reconfigure_response): use thread_new. - - * mail-display.c (stream_write_or_redisplay_when_loaded): use - thread_new. - - * mail-config.c (mail_config_check_service): use thread_new rather - than queue. - - * mail-callbacks.c (view_msg): change to use mail_get_messages(), - fixes FIXME. - (do_view_messages): handle get_messages callback. - (do_view_message): removed. - - * mail-ops.c (mail_get_folderinfo): Use a new thread thread - semantic. - (mail_save_part): " - (mail_store_set_offline): " - (mail_sync_folder): use queued_slow thread queue. - (mail_expunge_folder): " - (mail_empty_trash): " - - ** See bug #47224. Hook onto clicked rather than button_pressed, - so that dnd works. - - * mail-display.c (inline_toggle): toggle a part inline. - (button_press): change back to only handle button clicked events, - renamed to inline_button_clicked. - (do_attachment_header): hook onto clicked rather than - button_press_event, and move key_press_event to - inline_button_pressed. - (do_signature): Same. - (inline_button_pressed): handle inline button key press event - explicitly. - -2003-07-29 Not Zed <NotZed@Ximian.com> - - * mail-folder-cache.c (mail_note_store): add a CamelOperation for - overriding status handler. - - * mail-send-recv.c (receive_update_got_store): Pass our own cancel - handle to get_folderinfo and mail_note_store. - (mail_send_receive, mail_receive_uri): Same for get_store. - - * mail-ops.c (mail_get_store, mail_get_folderinfo): Add a - CamelOperation argument, for overriding the status handler. Fixed - most calles to pass NULL to use the default. - -2003-09-15 Not Zed <NotZed@Ximian.com> - - * em-folder-browser.c (emfb_activate): remove warning about folder - not being loaded yet - it basically never is. - - * em-popup.c (emp_standard_menu_factory): dont setup any global - select menu's yet. they're all handled by folderview atm. - -2003-09-11 Not Zed <NotZed@Ximian.com> - - * em-format-html.c (efh_finalise, efh_format_timeout): Use a - proper hash free func, otherwise it dont work. - -2003-09-11 Not Zed <NotZed@Ximian.com> - - * em-inline-filter.[ch]: A new class which implements an inline - snooper via a mime filter, so it is fully streamable. contents - merely passes through the filter. - - * em-format-html.c (efh_finalise): free text substitute parts - table. - (efh_text_plain): transform a text part into a multipart, scanning - for inline data. Keep the multipart around for redraws. - (efh_format_timeout): clear the text substitute parts table. - -2003-09-10 Not Zed <NotZed@Ximian.com> - - * em-format-html-display.c (efhd_init): hook onto realise so we - get the real theme-applied style. - (efhd_gtkhtml_realise): get the theme data for colour defaults. - Tweak the colour selection to make it work better with dark - themes. - - * em-format-quote.c (emfq_format_source): we need to implement - this. - (emfq_format_error): we need not to call parent, it doesn't - implement it. - - * message-list.c (message_list_select_uid): don't emit - changedhere, let it go through the table cursor change. - - * em-folder-browser.c (em_folder_browser_show_preview): use - folderview.preview_active for this state. - (em_folder_browser_show_preview): clear the current message when - we turn off the message view, and load the current one when turn it on. - - * em-folder-view.c (emfv_destroy): zero out preview + list. - (emfv_list_message_selected): check preview_active before doing - anything. - (emfv_edit_cut): - (emfv_edit_copy): only run if preview active. - - * em-format-html.c (efh_format_do): output the proper html - headers, etc. - -2003-09-10 Jeffrey Stedfast <fejj@ximian.com> - - * mail-account-gui.c (mail_account_gui_save): Allow the user to - select any fodler for his/her Drafts and Sent folders. Fixes bug - #45412. - -2003-09-09 Not Zed <NotZed@Ximian.com> - - * em-utils.c (forward_non_attached): implement forward quoted. - - * em-format-quote.[ch]: New class, em-format-html-quote wont cut - it. Sigh. - - * em-format-html-quote.c (efhq_base_init): move type init stuff - here. - (efhq_complete): remove, this is a signal. - (efhq_multipart_related): we need to override the base class, we - don't want to output any attachment html. - - * em-format-html-print.c (efhp_base_init): move builtin type init - to here. - - * em-format-html.c (efh_init): get xmailer mask from gconf (sigh). - (efh_format_header): inmplement most of xmailer mask thing. - rupert icon not done yet, probably needs to be done as part of - em-format-html-display, sigh. - (type_builtin_table[]): add image/svg to supported image formats. - (efhd_base_init): move type init to here. - (efh_text_enriched): write to the filtered_stream, not stream. - - * em-format.c (em_format_format_text): oops, actually use any - supplied charset. - (emf_base_init): move hashtable init into base_init, so we get a - new copy for each derived class too. - - * mail-send-recv.c (build_dialogue): use an eclippedlabel for - status. Fixed all uses. - -2003-09-08 Not Zed <NotZed@Ximian.com> - - * em-format-html.h (EMFormatHTML): added a simple_headers option, - only output headers in basic format. Added hide_headers option, - to disable all header output. - - * em-format-html-quote.c (efhq_format_message): blockquote the - contnet, thats how you cite it! - (efhq_init): turn on simple headers for html output. - (efhq_format_message): output headers and part directly, bypassing - parent format_message. - (efhq_format_message): implement hide_headers. - - * em-format-html.c (efh_busy): implement busy. - (efh_format_message): implement simple_headers option. - (efh_format_text_header): implement simple_headers option. - (efh_format_message): move the header formatting stuff into - exported em_format_html_format_headers. - (efh_format_message): only output headers if not hidden. - - * em-format.c (emf_busy): base implementation of a new virtual - method, returns TRUE if the object is still busy - rendering/downloading stuff. - - * em-utils.c (em_utils_message_to_html): renamed from - em_utils_quote_message. Also make sure the html conversion is - complete before getting the data. - (em_utils_part_to_html): similar, but for parts. - (composer_set_body): put in David Woodhouse's timezone in - attribution patch. - (composer_set_body): we want to quote the part (content), we don't - want message headers. - (em_utils_message_to_html): add a 'show headers' argument. - - * folder-browser-factory.c (control_activate): removed. - (control_deactivate): removed. - - * mail-identify.c: - * folder-browser.[ch], folder-browser-ui.[ch]: - * mail-callbacks.[ch], mail-search.[ch]: - * mail-display.[ch], mail-format.[ch], mail-display-stream.[ch]: - * message-browser.[ch]: Removed, fixed all users. - - * component-factory.c (factory): change callbacks to em_utils - ones. - (configure_folder_popup): comment out some of the reconfigure - stuff. Wont have it in 1.6? - (handle_external_uri_cb): use em_utils stuff. - (user_create_new_item_cb): " - (owner_unset_cb): " - - * em-composer-utils.c (composer_send_cb): rename to - em_utils_composer_send_cb, and export, sigh, needed for factory. - (composer_save_draft_cb): Same. - -2003-09-05 Not Zed <NotZed@Ximian.com> - - * em-format.c (type_builtin_table[]): Add a fallback multipart/* - for other types (e.g. multipart/report) - (em_format_fallback_handler): fix some bad logic. - - * em-folder-browser.c: track the pane size if the user changes it. - (emfb_set_folder): Added a bit of a mess that will select the - first unread message the first time you visit a folder. - (emfb_destroy): impelment. clear up outstanding signal handlers. - (emfb_list_built): Select the first unread message. this isn't - entirely reliable as yet, and not configurable at all. - - * em-format-html-display.c (em_format_html_display_set_animate) - (em_format_html_display_set_caret_mode): guess? :) - (efhd_attachment_button): dont desensitise the button, just dont - hook onto it, otherwise it looks fugly. - - * em-folder-view.c (emfv_list_done_message_selected): dont lookup - gconf values every time. use g_timeout_add rather than - gtk_timeout, remove fixme's. - (emfv_setting_notify): listner for gconf changes, reflect - internally. - (emfv_setting_setup): setup listner for gconf, and read initial - settings. - (emfv_activate): use local copy of settings rather than snooping - gconf. - (emfv_caret_mode): propagate caret-mode to display - - * em-format-html-quote.c (efhq_format_message): remove gconf - stuff, our parent already has citation colour. - - * em-format-html.c (efh_format_timeout): remove gconf stuff. - (em_format_html_set_load_http, em_format_html_set_mark_citations): - set options on formatter, re-renders if required. - (type_builtin_table[]): text/* should go to text/plain, not - text/enriched. - -2003-09-04 Not Zed <NotZed@Ximian.com> - - * em-utils.c (confirm_expunge): rename it to emu_confirm_expunge - and remove leading whitespace before function. - (em_utils_expunge_folder): we want to expunge the folder, not - empty the trash. Jeff didn't even run this once ... - - * em-popup.c: Lots of new features, 'global' popup menu's on a - per-selection type, via factories, popup selections (targets), a - standard factory for many menu items. - (emp_apps_open_in): duh, fix uri using logic - (emp_standard_menu_factory): only add apps to app list if - !requires_terminal. - - * em-format-html-display.c (efhd_open_in, efhd_popup_free_items): - moved to em-popup.c - (efhd_popup_save_attachment, efhd_popup_save_message) - (efhd_popup_reply_sender, efhd_popup_reply_list) - (efhd_popup_reply_all, efhd_popup_forward): (re)moved to em-popup.c - (efhd_attachment_popup): use enew popu stuff. - (efhd_attachment_button): Scale the icons for mime-type icons. - - * em-folder-view.c (em_folder_view_disable_mask): removed - ... moved to em-popup. - (em_folder_view_get_popup_target): new method, get the selection - target for the folder view. - (emfv_html_popup_saveas, emfv_html_popup_link_open) - (emfv_html_popup_link_copy, emfv_html_popup_address_send) - (emfv_html_popup_address_add, emfv_format_popup_free_items): moved - to em-popup.c - (emfv_format_popup_event): use new popup stuff. - (emfv_popup): use new popup stuff, but still just use all local - menu's. - -2003-09-03 Not Zed <NotZed@Ximian.com> - - * em-folder-view.c (emfv_format_popup_event): implement, a popup - menu for right-clicking on links and images. - (emfv_html_popup_link_copy): implement. - (emfv_init): setup an invisible for selection stuff. - (emfv_destroy): free invisible - - * em-utils.c (em_utils_get_proxy_uri): utility to get the current - system proxy setting. - (emu_set_proxy): implementation. - - * em-camel-stream.[ch]: removed. - - * em-format-html.c (efh_url_requested, efh_format_timeout): use - em_html_stream rather than em_camel_stream. - (emfh_gethttp): set the system proxy on the new stream. - (emfh_multipart_related_check): use puri rather than purin inside - the loop - duh. - (emfh_multipart_related_check): removed 'unrelated part' warning, - they can be (and normally are) added by the callbacks. - - * em-format-html.h (EMFormatHTMLJob): s/estream/stream/ - - * em-html-stream.[ch]: New subclass of emsyncstream, replacement - for em-camel-stream. - -2003-09-04 Jeffrey Stedfast <fejj@ximian.com> - - * em-folder-browser.c (emfb_folder_expunge): Call - em_utils_expunge_folder instead. - - * em-utils.c (em_utils_expunge_folder): New function. - (confirm_expunge): Make private. - -2003-09-04 Jeffrey Stedfast <fejj@ximian.com> - - * em-folder-browser.c (emfb_folder_expunge): Confirm hat the user - wants to expunge. - (emfb_empty_trash): Implemented. - - * em-utils.c (em_utils_prompt_user): Make public (used to be - e_question). - (em_utils_confirm_expunge): New function to confirm that the user - wants to expunge. - (em_utils_empty_trash): New function to empty all Trash folders. - - * em-composer-utils.c: Get rid of e_question and use em-utils' - em_utils_prompt_user() function instead. - - * em-format-html-quote.[c,h]: New formatter for quoting - replies/forwards/etc. - - * em-utils.c (em_utils_quote_message): New function. - (composer_set_body): Use the new em_utils_quote_message() - function. - (em_utils_temp_save_part): Only g_free mfilename if it was - malloc'd. - - * mail-tools.c (mail_tool_quote_message): Removed. - (mail_tool_forward_message): Removed. - -2003-09-03 Jeffrey Stedfast <fejj@ximian.com> - - * em-format.c (em_format_class_remove_handler): New function to - remove a mime-type handler from a class. - - * em-format-html.c (efh_init): Set the CITATION bit for the - default html flags. - - * em-format-html-display.c: Fixed some compiler warnings by adding - appropriate includes. - (efhd_multipart_signed): Don't write "inlined signature...". - -2003-09-03 Not Zed <NotZed@Ximian.com> - - * em-icon-stream.[ch]: New subclass of emsyncstream, write camel - stream one side, creates an icon on the other. - - * em-sync-stream.[ch]: New file, an abstract class for creating - write-any-thread-act-gui-thread stuff. 'em-camel-stream' will - subclass this. - - * em-format-html-display.c (efhd_attachment_button): setup a job - to write out an icon if the type is an image type, otherwise try - and get the icon directly. no caching yet. the system icons - aren't scaled properly either. - (efhd_write_icon_job): async job to write out image content. - -2003-09-02 Not Zed <NotZed@Ximian.com> - - * em-format-html.c (emfh_new_job): renamed to - em_format_html_job_new and made public. - (emfh_queue_job): renamed to em_format_html_job_queue, and made - public. - - * em-format-html.h: Made EMFormatHTMLJob a public structure. - -2003-09-02 Not Zed <NotZed@Ximian.com> - - * em-folder-view.h (struct _EMFolderView): track the uicomponent - while we're activated. - - * em-message-browser.c (em_message_browser_window_new): kill - warning. - (emmb_init, emmb_finalise): kill printf - - * em-format-html.c (efh_format_header): Converted code from head - from David Woodhouse <dwmw2@infradead.org>'s timezone display - patch. - (efh_format_text_header): support new flag, HEADER_HTML - header - alredy in html format. - - * em-format-html-print.c (em_format_html_print_print): only ref - print_config if != NULL. - - * em-folder-browser.c (emfb_tree_key_press): handle - space/backspace in messagelist to scroll the message view. - (emfb_create_view_menus): setup view menu's, this should probably - live in message-list. - (emfb_init): setup the folderbrowser enable map into the list. - (emfb_enable_map): folder browser enable map - - * em-utils.c (em_utils_adjustment_page): new helper to scroll an - adjustment up/down 1 page. - - * em-folder-view.c (emfv_list_double_click): implement, open - window. - (emfv_list_key_press): implement keybinding overrides. Enhance - delete key to undelete if everything is already deleted. - (emfv_build_enable_mask): separate out enable mask creation. - (emfv_popup): use above to get mask. - (emfv_enable_menus): enable/sensitize menus, use the same disable - mask system as used for the popups. - (emfv_destroy): change to use g_source_remove on seen_id. - (emfv_finalise): free up folders, clean up async event thing. - (emfv_init): setup an async event handler - (emfv_set_folder): handle hook/unhook of folder_changed events. - (emfv_folder_changed): proxy folder changed to main thread, ignore - the details of what changed. - (emfv_gui_folder_changed): update the menu's to reflect any folder - changes. - (emfv_build_disable_mask): added CAN_THREADED. - (em_folder_view_disable_mask): make public (rename from - emfv_build_disable_mask). - (emfv_enable_menus): changed to work on a list of arrays of - enablers, so they can be subclassed. - (emfv_init): add our enable map to the ui. - (em_folder_view_disable_mask): added support for can hidden (there - are hidden messages). - -2003-09-01 Not Zed <NotZed@Ximian.com> - - * em-popup.c: New, simple menu-merging popup menu implementation. - NOTE: should be temporary, but needs something that has similar - merging facilities. - - * em-folder-view.c (emfv_popup*): added popup callbacks, implement - a popup menu, using em_popup. - (emfv_message_*): replaced a whole bunch of one-line, or simple - functions with macro's to map to the popup implementation. - (emfv_tools_vfolder*, emfv_tools_filter*): map to popup - equivalents. - (emfv_init): drop printf - - * em-format-html-display.c (efhd_attachment_popup): use the - em_popup stuff to build a dynamic menu. - - * em-utils.c (em_utils_temp_save_part): change assignment order ot - kill warning. - (emu_get_save_filesel): handle null/empty name by appending / to - the filename. - -2003-08-30 Not Zed <NotZed@Ximian.com> - - * mail-search.glade: forgot to add this yesterday. - - * em-utils.h: don't include stuff we dont need to. - - * em-folder-view.c (emfv_message_forward): just call - em_utils_forward_messages. - - * em-format-html-display.c (em_format_html_display_search): - removed unused. - (efhd_drag_data_get): cleanup, use em_utils_temp_save_part. - (efhd_attachment_popup): quick hack, setup a bunch more menu - items, for forwarding inline messages, hook up saving parts, and - messages, and hook up the 'open in' menu. - (efhd_open_in): implement. - - * em-utils.c (em_utils_save_message): Renamed to - em_utils_save_part. - (em_utils_filesel_prompt): removed, it just makes things more - complex than having a single response handler. - (em_utils_save_part): move dialog stuff here, it also creates a - name based on the type of part its given. - (emu_get_save_filesel): new method to create a fileselector with - standard options. - (emu_save_part_response): handle file selector response for save - part. - (can_save): renamed to emu_can_save - (em_utils_save_messages): use get_save_filesel - (emu_can_save): handle the path="" case - (em_utils_save_part): Add a prompt argument. - (filesel_ok_cb): removed. - (emu_update_save_path): update the gconf save_dir setting. - (em_utils_forward_messages): helper to forward using default - style. - (forward_non_attached): remove uids argument. - (em_utils_forward_message): helper to forward a message using the - default forward style. - (forward_non_attached): removed folder argument. - (em_utils_temp_save_part): helper to save a part to a temporary - file, e.g. for dnd, app launch, etc. - -2003-08-29 Not Zed <NotZed@Ximian.com> - - * em-folder-view.c: set 'outgoing' properly. - - * em-folder-browser.c (emfb_tools_subscriptions): enforce a single - instance of the subscribe editor. - (emfb_subscribe_editor_destroy): clear subscribe editor handle. - -2003-08-29 Not Zed <NotZed@Ximian.com> - - * em-camel-stream.c (em_camel_stream_new): Added some optional - logging code. - (stream_close): and here. - (stream_write): and here. - - * em-folder-browser.c (emfb_init): remove fixme about search bar, - its there now. also fixme's about dnd/selection, they are handled - in lower-level widgets. - (em_folder_browser_show_preview): dont exit if show preview set, - but only if it hasn't changed. - (emfb_view_hide_selected, emfb_view_show_all) - (emfb_view_hide_read): removed some spurious printfs. - - * Makefile.am (glade_DATA): Added mail-search.glade. FIXME: - should all glade files be merged into 1? - - * em-format-html-display.c (efhd_format_clone): remove search - match count code from here - wont be finished rendering at this - point anyway. - (em_format_html_display_search): new api for running an - interactive search popup. - (efhd_update_matches, efhd_update_search) - (efhd_search_entry_activate, efhd_search_case_toggled) - (efhd_search_response): helpers/callbacks for search popup. - (efhd_class_init): hook into complete signal on EMFormat. - (efhd_complete): complete rendering handler, update match count. - - * em-folder-view.c: removed fixme about api's - yes, do need two - set_folder api's. - (emfv_edit_cut, emfv_edit_copy): removed printfs - (emfv_edit_paste): removed commented call to html_paste, we never - want to do that. - -2003-08-29 Jeffrey Stedfast <fejj@ximian.com> - - * em-folder-view.c (emfv_message_mark_unread): If there is a - mark-as-read timeout handler registered, unregister it here. - (emfv_tools_filter_mlist): Implemented. - (emfv_tools_filter_recipient): Implemented. - (emfv_tools_filter_sender): Implemented. - (emfv_tools_filter_subject): Implemented. - (emfv_tools_vfolder_mlist): Implemented. - (emfv_tools_vfolder_recipient): Implemented. - (emfv_tools_vfolder_sender): Implemented. - (emfv_tools_vfolder_subject): Implemented. - -2003-08-28 Not Zed <NotZed@Ximian.com> - - * em-folder-browser.c (emfb_search_menu_activated) - (emfb_search_config_search, emfb_search_search_activated) - (emfb_search__query_changed): Implement search-bar callbacks. - (emfb_init): setup search bar. - -2003-08-28 Not Zed <NotZed@Ximian.com> - - * em-folder-view.c (emfv_message_reply): common reply code entry - point, also implement simple reply-to-highlighted text (currently - disabled). - (emfv_activate): disable resend message on non-sent folders. - (emfv_message_reply_all, emfv_message_reply_list) - (emfv_message_reply_sender): use message_reply for common code. - (em_folder_view_open_selected): in drafts or outbox, edit the - message instead. - (emfv_activate): force a sync on deactivate. - - * em-utils.c (em_utils_selection_get_mailbox): get mailbox - (message/rfc822?) selection data. - (em_utils_read_messages_from_stream): helper to move stuff from a - mbox stream to a folder. - (em_utils_folder_is_drafts, em_utils_folder_is_sent) - (em_utils_folder_is_outbox): from folder browser helpers for - customising the user experience. - - * message-list.c (message_list_construct): hook onto dnd stufd. - (ml_tree_drag_data_get): implement drag sending. - (ml_tree_drag_data_received): implement drag recieving. - - * em-format-html-display.c (efhd_drag_data_get): implemented. - (efhd_drag_data_delete): implemented. - (efhd_attachment_button): setup dnd callbacks. - -2003-08-28 Jeffrey Stedfast <fejj@ximian.com> - - * em-folder-view.c (emfv_destroy): override the destroy method for - GtkObject - unregister the mark-as-seen timeout if one is - currently registered. - (emfv_list_done_message_selected): Add the mark-as-seen timeout - functionality here. - (emfv_format_link_clicked): Implemented. - -2003-08-27 Jeffrey Stedfast <fejj@ximian.com> - - * em-utils.c (get_reply_list): Implemented. - -2003-08-27 Not Zed <NotZed@Ximian.com> - - * em-message-browser.c (emmb_activate): disable Edit->Paste menu - always. - - * em-folder-browser.c (emfb_edit_paste): do a message-list paste, - not a html one. - (emfb_edit_cut, emfb_edit_copy, emfb_edit_paste): Moved to folder-view. - - * message-list.c (message_list_paste): trigger a paste action. - (message_list_set_folder): added a uri argument, and save it - internally, fixed all callers. - (message_list_finalise): free the folder uri. - - * em-utils.c (em_utils_selection_set_mailbox): New helper to set - the current selection as text in a berkely mailbox format. - (em_utils_write_messages): helper to write stuff to a stream in - mbox format. - -2003-08-27 Not Zed <NotZed@Ximian.com> - - * message-list.c (on_selection_changed_cmd): own/deown the primary - selection when it changes. - (message_list_init): init private data and invisible for - selection. - (message_list_destroy): free invisible. - (message_list_finalise): free private data. - (get_selected_cb): removed. - (message_list_copy): new method to do copy and cut. cut/copy to - the clipboard. - (ml_selection_clear_event): clear the right selection when - requested. - (message_list_has_primary_selection): helper to find out if the - message-list has the selection. is there a gtk way for this? - -2003-08-26 Not Zed <NotZed@Ximian.com> - - * mail-local.c (mlf_meta_set, mlf_meta_get): proxy meta-data stuff - to subservient folder. - -2003-08-23 Not Zed <NotZed@Ximian.com> - - * em-folder-view.c (emfv_init): init preview here always. - -2003-08-25 Jeffrey Stedfast <fejj@ximian.com> - - * em-folder-view.c (em_folder_view_print): Use - e_dialog_set_transient_for(). - (emfv_message_delete): Fixed a FIXME. - - * em-folder-browser.c (emfb_edit_cut): Implemented. - (emfb_edit_copy): Implemented. - (emfb_edit_paste): Implemented. - - * em-format-html-display.c (em_format_html_display_cut): New function. - (em_format_html_display_copy): New. - (em_format_html_display_paste): New. - -2003-08-25 Jeffrey Stedfast <fejj@ximian.com> - - * em-utils.c (em_utils_flag_for_followup): Use - e_dialog_set_transient_for(). - (em_utils_filesel_prompt): Same. - (post_reply_to_message): Here too. - (em_utils_edit_filters): Same. - (create_new_composer): And here. - (em_utils_compose_new_message_with_mailto): Here too. - (em_utils_post_to_url): " - (redirect_get_composer): Same. - (reply_get_composer): Again... - - * em-folder-browser.c (emfb_tools_filters): Implemented. - - * em-utils.c (em_utils_edit_filters): New function to open the - filter editor dialog. - -2003-08-22 Jeffrey Stedfast <fejj@ximian.com> - - * em-utils.c (em_utils_flag_for_followup): Implemented. - (em_utils_flag_for_followup_clear): Implemented. - (em_utils_flag_for_followup_completed): Implemented. - - * em-folder-view.c (emfv_message_followup_flag): Implemented. - (emfv_message_followup_clear): Implemented. - (emfv_message_followup_completed): Implemented. - -2003-08-22 Not Zed <NotZed@Ximian.com> - - * em-camel-stream.c (em_camel_stream_new): now take the gtkhtml - too, and hook onto it's destroy so we don't try writing anymore - after its gone. - (stream_write, stream_flush, stream_close, emcs_gui_received): - NOOP if the gtkhtml has been destroyed. - (emcs_gtkhtml_destroy): null out the stream when the gtkhtml gets - destroyed, it is no longer valid. - (emcs_gui_received): dont try to soak all outstanding events, it - always runs synchronous anyway, just get one and exit. - - * em-format-html.c (efh_gtkhtml_destroy): if the gtkhtml gets - destroyed, abort any pending timeouts/processing. - (efh_format_source): fixed implementation to write out all - headers. - (efh_multipart_related, emfh_multipart_related_check): separate - checking for unused parts into a separate job, which is run after - previous ones are executed. keep track of visibility tree level - in job, etc. - -2003-08-22 Jeffrey Stedfast <fejj@ximian.com> - - * em-folder-browser.c (emfb_mail_compose): Implemented. - (emfb_mail_post): Implemented. - - * em-utils.c (em_utils_compose_new_message): New function. - (em_utils_compose_new_message_with_mailto): New. - (em_utils_post_to_url): New. - -2003-08-21 Not Zed <NotZed@Ximian.com> - - * subscribe-dialog.glade: removed the text in the progress thing. - It never showed up anyway and caused weird resizing stuff when the - progress bar was active. - - * em-subscribe-editor.c: Found the correct version of the new - subscribe code (on branch, duh!), and integrated it. - (sub_selection_changed): Sensitise buttons based on selection. - - * em-format-html.c (efh_text_plain, efh_text_enriched) - (efh_write_text_html): Use format_text for text output. - (efh_write_image): use explicit image writer. - (emfh_gethttp): added some progress stuff. - (efh_format_do): maintain the accessible uri tree during jobs. - (efh_url_requested): store the current uri accessibility tree node - in the job, so it can be properly set for sub-jobs. - (emh_multipart_related): moved here, can't use super-class version - as it doesn't know about async jobs. - (type_buildin_table[]): Added image/jpg and image/jpeg for the - brokenmailers out there and to reduce the whinge. - - * em-format.c (em_format_format_content): For text parts, perform - default charset/charset snooping/decoding. No longer closes the - stream once complete. - (emf_write_related): close stream ourselves. - -2003-08-21 Jeffrey Stedfast <fejj@ximian.com> - - * em-folder-view.c (emfv_message_forward): Implemented. - (emfv_message_forward_attached): Implemented. - (emfv_message_forward_inline): Implemented. - (emfv_message_forward_quoted): Implemented. - (emfv_message_redirect): Implemented. - (emfv_message_post_reply): Implemented. - (emfv_message_reply_all): Implemented. - (emfv_message_reply_list): Implemented. - (emfv_message_reply_sender): Implemented. - (emfv_message_resend): Implemented. - (emfv_message_saveas): Implemented. - - * em-composer-utils.c: New source file containing all the composer - send/draft callback mess. - - * em-utils.c (em_utils_uids_copy): New convenience function to - copy a list of uids. - (em_utils_uids_free): New convenience function to free a list of - uids. - (em_utils_save_message): New function to save a CamelMimeMessage - (prompts the user for a location to save). - (em_utils_save_messages): New function to save a list of messages - (given a folder and list of uids). - (em_utils_configure_account): Configure a new account... - (em_utils_check_user_can_send_mail): Make sure the user has a - transport setup. - (em_utils_edit_message): New function to edit a message object. - (em_utils_edit_messages): New function to open a composer to edit - each message. - (em_utils_forward_attached): New function to forward messages as - an attachment, - (em_utils_forward_inline): Forward a bunch of messages inline. - (em_utils_forward_quoted): Forward a bunch of messages quoted. - (em_utils_redirect_message): Redirect a message object. - (em_utils_redirect_message_by_uid): Redirect a message given a - folder and uid. - (em_utils_reply_to_message): Reply to a message object. - (em_utils_reply_to_message_by_uid): Reply to a message given a - folder and uid. - (em_utils_post_reply_to_message_by_uid): Post a reply to a message - given a folder and uid. - - * mail-ops.c (filter_folder_free): Use em_utils_uids_free(). - (transfer_messages_free): Same. - (get_messages_free): Here too. - (save_messages_free): Same. - -2003-08-20 Not Zed <NotZed@Ximian.com> - - * em-subscribe-editor.[ch]: new widget, a dialog for editing - subscriptions. - - * em-format-html.c (efh_format_done): emit a complete when done. - - * em-format.c (emf_class_init): Added a 'complete' signal, so that - printing knows when to print. - - * em-format-html-print.c (em_format_html_print_print): Changed to - take the message and source formatter too. Runs an async render - then prints. - -2003-08-19 Not Zed <NotZed@Ximian.com> - - * em-*.c: stacks more changes, added some bonobo menu setup, and - implemented the trivial functions. - - * em-message-browser.[ch]: New message browser, inherits from - em-folder-view. Basically works. - - * message-list.c (message_list_select_uid): if we're selecting - while still loading, setup a pending select. - (regen_list_free): Check for a pending select, and select the - message if we're now idle. - - * em-folder-view.c (em_folder_view_set_message, - em_folder_view_set_folder): Make virtual macro's. - (emfv_control_activate): added hook to enable bonobo state when setup. - - * em-format.c (emf_format_clone): base implementation, just clears - state data. - - * em-format.h: change ::format to ::format_clone. Make - em_format_format_clone a macro/virtual method. - - * mail-mt.c (em_channel_setup): new function to setup i/o - channels, so we can control the recursive flag. leave off for - now. - (mail_msg_init): setup MsgPort channels using above. - - * em-format-html.c (efh_format): serialise/de-recursify formatting - via a timeout function. - (efh_format_timeout): keep polling to find out if cancellation is - complete, then kick off a new render. - -2003-08-18 Not Zed <NotZed@Ximian.com> - - * em-*.c: more updates, incl threaded formatting queue. - -2003-08-18 Jeffrey Stedfast <fejj@ximian.com> - - * em-format-html-display.c (em_format_html_display_zoom_in): New - method to zoom-in on the gtkhtml contents. - (em_format_html_display_zoom_out): Same but for zoom-out - (em_format_html_display_zoom_reset): You get the idea. - -2003-08-12 Jeffrey Stedfast <fejj@ximian.com> - - * mail-callbacks.c (invert_selection): Use - message_list_invert_selection(). - (select_thread): Use message_list_select_thread(). - (select_all): Use message_list_select_all(). - - * message-list.c (message_list_select_all): New function. - (message_list_select_thread): New function. - (message_list_invert_selection): New function. - -2003-08-12 Jeffrey Stedfast <fejj@ximian.com> - - * mail-session.c: Synced up with HEAD. - - * component-factory.c: - - * mail-folder-cache.[c,h]: - - * mail-tools.h: - - * mail-ops.[c,h]: - - * mail-send-recv.c: - - * mail-format.[c,h]: - - * mail-display.c: - - * mail-account-gui.c: - - * mail-local.c: - - * mail-offline-handler.c: - - * subscribe-dialog.c: - -2003-08-12 Jeffrey Stedfast <fejj@ximian.com> - - * em-format-html-display.c: Fixed some compiler warnings. - - * em-format.c: Updated for new mime-parser changes made to HEAD. - - * em-folder-view.c: Fixed some compiler warnings. - - * em-format-html.c: Fixed some compiler warnings. - -2003-08-06 Not Zed <NotZed@Ximian.com> - - * em-format-html-display.c (efhd_format_attachment): Added bonobo - embeddables. - -2003-08-01 Harry Lu <harry.lu@sun.com> - - *Fix for bug #6951 - - * mail-display.c (launch_cb): Bypass the new added menu item. - (save_all_parts_cb): New function. Do the real save-all work. - (save_all_parts): New function. Get the directory to save to. - (save_all_cb): New function. The call-back function for the new - added menu item. - (pixmap_press): Add the new menu item "Save All Attachment...". - (ptr_array_free_notify): A simple wrapper function to free the - pointer array. - (do_attachment_header): Save attachment pointer in an array for - "Save All Attachment" use. - -2003-08-01 Yuedong Du <yuedong.du@sun.com> - - * message-browser.c (on_key_press): close mail message window - using 'ESC' key, fix bug #47087 - -2003-07-28 Jeffrey Stedfast <fejj@ximian.com> - - * mail-crypto.c: Removed smime functions as they were stale. - -2003-07-25 Jeffrey Stedfast <fejj@ximian.com> - - * message-browser.c (message_browser_new): Handle our own Delete - key presses. Fixes bug #45597. - -2003-07-25 Ettore Perazzoli <ettore@ximian.com> - - * mail-callbacks.c (do_view_message): No need to pass a shell - argument to message_browser_new() anymore. - - * message-browser.c (message_browser_new): Removed arg shell. No - need to pass it to folder_browser_new() either. - - * mail-component.c (create_view_callback): No need to pass a shell - arg to folder_browser_factory_new_control() anymore. - - * folder-browser-factory.c (folder_browser_factory_new_control): - Removed arg shell; folder_browser_browser_new() doesn't need it - anymore. - - * folder-browser.c (folder_browser_destroy): No need to unref - ->shell anymore. - (folder_browser_new): Removed shell arg. - (folder_browser_gui_init): Removed a const qualifier that was not - supposed to be there. - - * folder-browser.h: Removed member shell from struct - FolderBrowser. - -2003-07-25 Ettore Perazzoli <ettore@ximian.com> - - * folder-browser.c (folder_browser_gui_init): Get the search - context through mail_component_peek_search_context(), since it's - no longer a global variable. - (folder_browser_gui_init): Cleaned up an extra unneeded if() - statement. - - * mail-component.c: New member search_context in struct - MailComponentPrivate. - (mail_component_peek_search_context): New. - (setup_search_context): New function to initialize the - search_context, based on the old code in component-factory.c. - (mail_component_init): Call it here. - (impl_dispose): Unref the rule_context. - - * mail-component-factory.c: Removed global variable - search_context. - -2003-07-25 Ettore Perazzoli <ettore@ximian.com> - - * mail-component.c (browser_page_switched_callback): New callback - for the "page_switched" signal on EStorageBrowser; deactivate the - previous page, activate the new one. - (impl_createControls): Connect. - -2003-07-24 Ettore Perazzoli <ettore@ximian.com> - - * mail-mt.c (do_op_status): Pass "evolution-mail" as the ID to - evolution_activity_client_new(). [This is just a temporary thing - to avoid the fact that we don't have component-factory.h anymore. - Eventually we'll just get rid of the activity client stuff.] - - * mail-component-factory.c: Added to the build. Also, finished - implementing and moving the factory over from component-factory.c. - - * component-factory.c: Removed from the build. - * component-factory.h: Removed from the build. - - * mail-component.c: Removed some debugging messages. - -2003-07-23 Ettore Perazzoli <ettore@ximian.com> - - * subscribe-dialog.c: Converted to use EStorages instead of - EvolutionStorages and the new MailComponent object. - - * mail.h: Nuked a bunch of stuff. This will go away when I am - done refactoring. - - * mail-offline-handler.c: Use the new MailComponent object. - - * mail-folder-cache.c, mail-folder-cache.h: Converted to use - EStorages instead of EvolutionStorages. - - * mail-display.c: Use g_timeout and g_source functions instead of - gtk_timeout functions. - - * mail-send-recv.c: Use g_timeout and g_source functions instead - of gtk_timeout functions. - (receive_update_got_store): Updated for the new mail_note_store(). - - * mail-session.c: Use g_timeout and g_source functions instead of - gtk_timeout functions. - - * mail-config-factory.c (factory): Removed. - - * folder-browser.c (folder_browser_destroy): Use GLib - timeout/source functions instead of the deprecated GTK ones. - (done_message_selected): Likewise. - (folder_browser_gui_init): Protect against fb->search being NULL. - - * mail-account-gui.c (add_new_store): Use new MailComponent object - and EStorages instead of EvolutionStorages. - (mail_account_gui_save): Likewise. - - * mail-accounts.c (account_delete_clicked): Use new MailComponent - object and EStorages instead of EvolutionStorages. - (account_able_clicked): Likewise. - (account_able_toggled): Likewise. - - * mail-autofilter.c: Use mail_component_peek_base_directory() - instead of the evolution_dir global. - * mail-callbacks.c: Likewise. - * mail-config.c (uri_to_evname): Likewise. - (mail_config_get_signature_list): Likewise. - (delete_unused_signature_file): Likewise. - * mail-display.c (mail_display_class_init): Likewise. - * mail-importer.c (mail_importer_make_local_folder): Likewise. - * mail-local.c (mlf_getv): Likewise. - * mail-ops.c (uid_cachename_hack): Likewise. - * mail-summary.c (generate_folder_summaries): Likewise. - * mail-tools.c (mail_tool_get_local_inbox): Likewise. - (mail_tools_folder_to_url): Likewise. - * mail-vfolder.c (mail_vfolder_delete_uri): Likewise. - (mail_vfolder_rename_uri): Likewise. - (context_rule_removed): Likewise. - (store_folder_deleted): Likewise. - (store_folder_renamed): Likewise. - (vfolder_load_storage): Likewise. - (vfolder_editor_response): Likewise. - (edit_rule_response): Likewise. - (new_rule_clicked): Likewise. - (vfolder_gui_add_rule): Likewise. - * mail-session.c (main_get_filter_driver): Likewise. - (mail_session_forget_password): Likewise. - (mail_session_init): Get a base_directory arg. - - * component-factory.c, component-factory.h: Disabled a bunch of - stuff to get it to compile in the new configuration. These files - will eventually go away when I am done refactoring this. - - * Makefile.am: Do not build importers, compile generate - skels/stubs for Evolution. - - * GNOME_Evolution_Mail.server.in.in: Rename control factory to - OAFIID:GNOME_Evolution_Mail_Factory2. Add new component - GNOME_Evolution_Mail_Component2. - - * mail-component-factory.c: New file implementing the Bonobo - factory. - - * mail-component.c, mail-component.h: New files implementing the - new mail component, using the new Evolution::Component IDL. - -2003-07-23 Jeffrey Stedfast <fejj@ximian.com> - - * mail-format.c (mail_format_data_wrapper_write_to_stream): Revert - prior changes. - -2003-07-23 Dan Winship <danw@ximian.com> - - * folder-browser.c (message_list_drag_data_get): Fix type warnings - (folder_browser_toggle_caret_mode): Remove unused variable. - - * folder-browser-ui.c (basename): remove unused function - - * mail-account-gui.c (mail_account_gui_build_extra_conf): Fix - warnings - - * mail-callbacks.c (empty_trash): Remove unused variable. - - * mail-display.c: #include gal/widgets/e-gui-utils.h for - e_auto_kill_popup_menu_on_selection_done - - * mail-importer.c: #include e-util/e-path.h for e_path_to_physical - - * mail-session.c (main_play_sound): don't declare filename to be - const and then free it. - - * mail-vfolder.c (vfolder_edit_rule, vfolder_gui_add_rule): Fix - casts - - * message-list.c (build_flat_diff): Fix a typo in the - non-BROKEN_ETREE code - -2003-07-16 Jeffrey Stedfast <fejj@ximian.com> - - * mail-format.c (handle_multipart_encrypted): We don't have - camel_pgp_mime_is_rfc2015_encrypted() anymore so just look at the - protocol for now. - (mail_format_data_wrapper_write_to_stream): Updated for the new - way camel handles content objects. - -2003-07-15 Federico Mena Quintero <federico@ximian.com> - - * folder-browser.c (message_list_drag_data_received): Handle - invalid URIs, or more likely, the last empty element in a URI list - --- g_strsplit() will yield { "uri1", "", NULL }. Fixes #46398. - - * component-factory.c (destination_folder_handle_drop): Likewise. - -2003-07-15 Yuedong Du <yuedong.du@sun.com> - - * mail-config.c: (config_write_style), (mail_config_init): remove - the use of caret mode widget style. - * mail-display.c: (display_notify), (mail_display_new): use new - gtkhtml api to set caret mode. - -2003-07-11 Antonio Xu <antonio.xu@sun.com> - - * folder-browser-ui.c: Change the EditPaste mask to IS_0MESSAGE so - that it is always activatable. Fixes bug #46018. - -2003-07-04 Maxx Cao <maxx.cao@sun.com> - - ** For bug #41839 - - * mail-display.c (do_attachment_header): Attachment buttons made - accessable with keyboard (focusable). "Inline" button is disabled - when attachment can't be viewed inline. - (do_signature): Signature button made accessable with keyboard - (focusable). - (button_press): Function changed to an event callback (originally - gtkbutton signal callback). - (popup_menu_placement_callback): Function added to place popup - menu (of attachment) beside button when activated by keyboard. - -2003-07-10 Yuedong Du <yuedong.du@sun.com> - - * evolution-mail.schemas: add a gconf key corresponding to newly - introduced caret mode of gtkhtml widget. - - * folder-browser-ui.c: new verb handling, corresponding the new menu - entry for the caret mode flag. - - * folder-browser.h: declaration of new verb handler to the menu entry - that turn caret mode on/off. The function just set the new introduced - gconf key. - - * folder-browser.c: ditto - - * mail-config.c: lstione to the new gconf key, and when caret mode - flag is set/unset,change the style of gtkhtml widget. see bug - #44607. - -2003-07-09 Jeffrey Stedfast <fejj@ximian.com> - - * mail-crypto.h: Removed camel-pgp-mime.h, it no longer exists. - - * mail-format.c: Remove camel-pgp-mime.h - -2003-07-07 Jeffrey Stedfast <fejj@ximian.com> - - * mail-callbacks.c (mail_generate_reply): Use - camel_strcase_hash/equal. - - * upgrade-mailer.c: Updated to use the camel-file-utils version of - mkdir. - -2003-07-02 Jeffrey Stedfast <fejj@ximian.com> - - * mail-tools.c (mail_tool_forward_message): Strip the signature - from the body text. Fixes bug #45523. While we're here, also fix - the code to quote exactly the same way as the - mail_tool_quote_message() function. - (mail_tool_quote_message): The last arg should not be - 'want_plain', because that arg is for whether or not the body - should be quoted. - - * folder-browser.c (message_list_drag_data_get): Apply a - From-filter when dragging as a test/uri-list and - message/rfc822. Fixes bug #45617. Also free the uids ptrarray for - the text/uri-list case. - -2003-07-01 Dan Winship <danw@ximian.com> - - * mail-display.c (pixbuf_for_mime_type): Gone - (pixbuf_gen_idle): Use e_icon_for_mime_type instead. - -2003-06-27 Jeffrey Stedfast <fejj@ximian.com> - - * message-list.c (filter_date): Use the newer utf8 versions of the - e_strftime*() functions since our format strings are all now in - UTF-8. - - * mail-display.c (mail_display_render): Use the newer - e_utf8_strftime_fix_am_pm(). - - * mail-callbacks.c (mail_generate_reply): Use e_utf8_strftime(), - otherwise we can end up with invalid utf-8. - -2003-06-25 Radek Doulik <rodo@ximian.com> - - * mail-config.c (config_write_style): provide hardcoded default - (red) spell error color - -2003-06-24 Jeffrey Stedfast <fejj@ximian.com> - - Might fix bug #45368 but I wouldn't bet on it. - - * message-browser.c (message_browser_new): Record the signal id - for folder_loaded. - (message_browser_folder_loaded): disconnect by id rather than - searching for the handler. Save the id of the message_list_built - signal handler. - (message_browser_message_list_built): Disconnect the handler by - id. - (message_browser_destroy): Disconnect the signal handlers by id. - -2003-06-20 Not Zed <NotZed@Ximian.com> - - ** See bug #43887 - - * mail-format.c (mail_get_message_body): handle text/enriched and - text/richtext explictly, and dont treat them as text/plain. - -2003-06-23 Radek Doulik <rodo@ximian.com> - - * mail-config.c (config_write_style): add - EvolutionMailPrintHTMLWidget style assignment - - * mail-callbacks.c (do_mail_print): set printing widget name - -2003-06-23 Dan Winship <danw@ximian.com> - - * message-list.c (on_selection_changed_cmd): Save the idle_id - -2003-06-23 Larry Ewing <lewing@ximian.com> - - * folder-browser.c (do_message_selected): make sure not to strcmp - a possibly NULL string. - -2003-06-19 Not Zed <NotZed@Ximian.com> - - ** See bug #45063 - - * folder-browser.c (do_message_selected): dont re-load if the same - message gets selected again as one we've already shown. Etree - sends out selection changed events even when when it hasn't. - -2003-06-18 Jeffrey Stedfast <fejj@ximian.com> - - * message-list.c (hide_save_state): Only save state if we have a - folder reference. Fixes some warnings about casting a NULL object - to a CamelFolder. - -2003-06-16 Jeffrey Stedfast <fejj@ximian.com> - - * message-list.c (ml_tree_value_at): Don't display an unread icon - for a parent message status if it has unread children but has been - read itself. Instead, show that we have unread children by just - making the message test bold (which it was already doing, so - yay... this was easy). Fixes bug #42630. - -2003-06-16 Not Zed <NotZed@Ximian.com> - - ** See bug #44609 - - * mail-vfolder.c (vfolder_edit_rule): put the ok/cancel buttons in - the stupid gnome 2 order. - - ** See bug #33593 - - * message-list.c (on_selection_changed_cmd): also listedn to - selection changed events, since the etable api has changed. - (get_selected_cb): helper for above. - (message_list_construct): hook to selection change signal. - - * mail-callbacks.c (composer_send_queued_cb): Unref the composer - to match the ref composer_send_cb(); - - ** See bug #44519 - - * message-browser.c (message_browser_message_list_built): We want - to disconnect from the messagelist, not folderbrowser signal. - -2003-06-11 Jeffrey Stedfast <fejj@ximian.com> - - * mail-format.c (format_mime_part): We only really want to use - mail_identify_mime_part() if the content-type is - application/octet-stream - any other type (if it doesn't have a - handler) should just force the user to save to disk. - (handle_text_plain): Only pay attention to format=flowed if the - mime-type is text/plain (handle_text_plain is the generic text - handler, so we might be processing parts that are not really - text/plain, thus the format param may have different meaning for - those other textual types). - -2003-06-11 Larry Ewing <lewing@ximian.com> - - * mail-format.c (mail_lookup_handler): free the application list - if we are bailing. - - * mail-send-recv.c (free_folder_info): free the info structure as - well. - -2003-06-06 Jeffrey Stedfast <fejj@ximian.com> - - * message-tag-followup.c (get_week_start_day): Use mail-config's - gconf client. - (target_date_new): Same. - - * message-list.c (message_list_set_folder): Use mail-config's - gconf client. - (mail_regen_list): Same. - - * mail-tools.c (mail_tool_quote_message): Use mail-config's gconf - client. - (mail_tool_forward_message): Same. - - * mail-session.c (main_get_filter_driver): Use mail-config's gconf - client. - - * mail-preferences.c (mail_preferences_init): Use mail-config's - gconf client. - (mail_preferences_finalise): Don't unref the gconf client. - - * mail-format.c (write_headers): Use mail-config's gconf client. - (mail_format_data_wrapper_write_to_stream): Same. - (handle_text_plain): And here. - - * mail-display.c (save_data_cb): Use mail-config's gconf client. - (save_part): Same. - (on_url_requested): Here too. - (mail_text_write): And here. - (mail_display_init): And here. - (mail_display_destroy): Here too. - (mail_display_new): Again here. - - * mail-composer-prefs.c (sig_add_cb): Use mail-config's gconf - client. - (mail_composer_prefs_construct): Same. - - * mail-callbacks.c (ask_confirm_for_unwanted_html_mail): Use - mail-config's gconf client. - (ask_confirm_for_empty_subject): Same. - (ask_confirm_for_only_bcc): Here too. - (composer_get_message): And here. - (create_msg_composer): Again here. - (mail_generate_reply): Same. - (forward): And here. - (transfer_msg_done): " - (delete_msg): " - (confirm_expunge): " - - * component-factory.c (owner_unset_cb): Use mail-config's gconf - client. - - * folder-browser-ui.c (folder_browser_ui_add_message): Use the - mailer's gconf client. - (folder_browser_ui_add_list): Same. - (folder_browser_ui_add_global): Here too. - - * folder-browser.c (save_cursor_pos): Use the mailer's gconf - client. - (folder_browser_set_message_preview): Same. - (folder_browser_toggle_preview): Here too. - (folder_browser_toggle_threads): And here. - (folder_browser_toggle_hide_deleted): Here as well. - (folder_browser_set_message_display_style): And here. - (fb_resize_cb): Here. - (paned_realised): And here. - (done_message_selected): And everywhere... - - * mail-account-gui.c (sig_add_new_signature): Use the mailer gconf - client. - - * mail-config.c (mail_config_get_gconf_client): New function to - return the global GConfClient used by the mailer. - (mail_config_write_on_exit): On exit, free our objects and such. - (mail_config_signature_run_script): Use config->gconf. - -2003-06-04 Jeffrey Stedfast <fejj@ximian.com> - - * mail-callbacks.c (invert_selection): Get rid of the if-focused - code, that will always prevent the etree from getting the - selection inverted because the menu item will always have focus at - this time. Fix for bug #43972. - -2003-06-11 Not Zed <NotZed@Ximian.com> - - ** See bug #22542 - - * component-factory.c (storage_create_folder): If we're creating a - folder on a vstore, popup a vFolder editor rather than failing. - -2003-06-05 Not Zed <NotZed@Ximian.com> - - ** Part of #42691. - - * importers/Makefile.am (BUILT_SOURCES): added server_DATA. - - * Makefile.am (%.server.in): create a proper implicit rule for - temporary .in file. - -2003-06-04 Not Zed <NotZed@Ximian.com> - - ** See bug #43974 - - * mail-tools.c (mail_tool_do_movemail): use a proper CamelURL to - decode the uri, not hacky strcmp stuff. - - * mail-account-gui.c (extract_values): if we have an conf_entry, - ignore username, hostname, and path ones, as these are handled - implicitly in the url itself. Came about because of the fix for - #42838. - -2003-06-03 Federico Mena Quintero <federico@ximian.com> - - * mail-search.c (mail_search_construct): Put the buttons in HIG - order; don't replace the label of the stock Find button. Also, - add Escape as a keybinding for the Close button (see why GTK+ is - on crack on b.g.o #74221 and #101293). - diff --git a/mail/ChangeLog.pre-1-4 b/mail/ChangeLog.pre-1-4 deleted file mode 100644 index 5933f09baa..0000000000 --- a/mail/ChangeLog.pre-1-4 +++ /dev/null @@ -1,24750 +0,0 @@ -2003-06-02 Not Zed <NotZed@Ximian.com> - - ** This and jeffs patch for #43862. - - * mail-folder-cache.c (store_online_cb): If the store is still - around, then flow on to a get folderinfo update, otherwise just - clear up. - - * mail-ops.c (mail_store_set_offline): return the msgid of this so - it can be cancelled. - -2003-05-30 Jeffrey Stedfast <fejj@ximian.com> - - * mail-folder-cache.c (mail_note_store): If the session is - 'online' and we are noting a CamelDiscoStore, make sure that it is - changed to online status and call mail_get_folderinfo(). - -2003-05-30 Jeffrey Stedfast <fejj@ximian.com> - - * mail-local.c (load_metainfo): Stat the XML file before trying to - parse it to make sure it exists. - -2003-05-29 Not Zed <NotZed@Ximian.com> - - * Makefile.am (BUILT_SOURCES): added server_DATA (*.server) so - make clean works. For #42691. - -2003-05-30 Radek Doulik <rodo@ximian.com> - - * mail-config.c (config_write_style): use %02x instead of %2x when - formatting color for rc file - -2003-05-29 Jeffrey Stedfast <fejj@ximian.com> - - Fixes bug #43805. - - * mail-session.c (session_system_beep): Proxy the gdk_beep() call - to the main thread. - (session_play_sound): Proxy the gnome_sound_play() call to the - main thread. - -2003-05-27 Not Zed <NotZed@Ximian.com> - - * message-tag-editor.c (message_tag_editor_init): set the default - open size to something reasonable. For #43410. - - * mail-signature-editor.c (d): turn off debugging. - - * mail-config.c (mail_config_signature_add): save new signature in - signature list. For #43688. - -2003-05-21 Radek Doulik <rodo@ximian.com> - - * mail-signature-editor.c (menu_file_save_cb): set signature html - flag even if it's newly signature, we don't set it in - format_html_cb as sig could be "live" (when it's not new one) - -2003-05-20 Jeffrey Stedfast <fejj@ximian.com> - - * mail-importer.c: Updated copyright years. - - * mail-callbacks.c (ask_confirm_for_empty_subject): Fixed the - logic a bit - if the gconf key *isn't* set, we want to return - TRUE. - - * mail-search.c (mail_search_finalise): We need to weak_unref() - the mail-display here. Fixes bug #43392. - -2003-05-21 Larry Ewing <lewing@ximian.com> - - * mail-config.glade: remove link hilighting option that isn't - attached to anything. - -2003-05-20 Larry Ewing <lewing@ximian.com> - - * mail-display.c: filter notification events to keep the redisplay - count down. - - * mail-composer-prefs.c: remove references to gtkhtml property - manager. Connect to missing settings. - - * mail-preferences.c: remove references to gtkhtml property - manager. Connect to missing settings. - - * mail-config.glade: remove keybinding setting. - - * mail-display.c (mail_display_destroy): remove notification. - (display_notify): set animate and redisplay. We have to redisplay - because the citation color may have changed. - - * evolution-mail.schemas: add composer and display gconf entries. - -2003-05-19 Jeffrey Stedfast <fejj@ximian.com> - - * mail-account-gui.c (mail_account_gui_save): Only re-add the - store to the folder-tree if the account is enabled. Oops. Fixes - bug #43214. - -2003-05-20 Larry Ewing <lewing@ximian.com> - - * mail-config-factory.c: remove references to font prefs. - - * component-factory.c: Remove stale refernces the the font prefs. - (make_factory): remove unused variables. - - * mail-config.c (mail_config_init): add a notify callback to the - spelling color. - (config_write_style): rename and write out the spell color as - well. - -2003-05-20 Not Zed <notzed@lostzed.mmc.com.au> - - ** See bug #43234 - - * mail-display.c (mail_display_set_message): if we've been - destroyed, noop. - -2003-05-16 Dan Winship <danw@ximian.com> - - * mail-ops.c (mail_empty_trash): New async "empty trash" op. - - * mail-callbacks.c (empty_trash): Use it rather than requiring - that mail_tool_get_vtrash() work without blocking. #43091 - -2003-05-16 Radek Doulik <rodo@ximian.com> - - * mail-callbacks.c (footer_info_new): gnome_font_get_descender - returns negative value - -2003-05-17 Larry Ewing <lewing@ximian.com> - - * GNOME_Evolution_Mail.server.in.in: remove font prefs server from - the list. - -2003-05-17 Jeremy Katz <katzj@redhat.com> - - * mail-offline-handler.c: Add #include to fix warning. - - * mail-mt.c (mail_msg_new): Use glib macros for pointer/int - conversions. - (mail_msg_free): Likewise. - (mail_msg_cancel): Likewise. - (mail_msg_wait): Likewise. - (mail_msg_active): Likewise. - * mail-session.c (main_register_timeout): Likewise. - (register_timeout): Likewise. - (main_remove_timeout): Likewise. - (remove_timeout): Likewise. - * message-list.c (ml_value_to_string): Likewise. - - * mail-identify.c: Add #include to fix warning. - - * mail-config.c (config_write_fonts): Don't pass extra arguments - to g_warning. - - * mail-callbacks.c: Add #include to fix warning. - -2003-05-15 Not Zed <NotZed@Ximian.com> - - ** See bug #42838. - - * mail-account-gui.c (mail_account_gui_build_extra_conf): always - add the extra entry to the hash table, most paths wouldn't. - -2003-05-14 Jeffrey Stedfast <fejj@ximian.com> - - * component-factory.c: Disabled some debugging messages. - -2003-05-14 JP Rosevear <jpr@ximian.com> - - * mail-local.h: add proto - - * mail-local.c (storage_listener_startup): don't listen for - destruction, because we have a ref and it'll never happen - (mail_local_storage_shutdown): release and unref the local storage - - * mail-display.c (retrieve_shell_view_interface_from_control): - return a new copy every time - (set_status_message): release and unref the shell view - - * folder-browser.c (folder_browser_destroy): guard for multiple - destroys - - * folder-browser-factory.c (control_activate): release and unref - the shell view - (control_destroy_cb): just remove the control from the list - (folder_browser_factory_new_control): don't weak ref the folder - browser - - * component-factory.c (owner_unset_cb): shutdown local storage - -2003-05-13 Ettore Perazzoli <ettore@ximian.com> - - * component-factory.c (segv_redirect): Removed. - (make_factory): No need to set up the SIGSEGV redirect handler - here, since it's already done in the shell now, and it's in-proc. - - * folder-browser-ui.c (folder_browser_ui_rm_all): Only do the - bonobo_ui_component() stuff if the component does have a - container. - -2003-05-08 Ettore Perazzoli <ettore@ximian.com> - - * mail-session.c (mail_session_set_interactive): Set the - password_dialog pointer to NULL. Prevents a crash that could - happen if the shell would quit with the password dialog still up. - -2003-05-07 Jeffrey Stedfast <fejj@ximian.com> - - * mail-display.c (mail_display_render): Make sure that we haven't - been destroyed before we start writing to the html engine. Fixes - bug #42333. - -2003-05-07 Not Zed <NotZed@Ximian.com> - - ** See bug #42456 - - * mail-composer-prefs.c (spell_language_button_press): set the - enable/disable button to the right text when we toggle a column. - Added a fixme about the weird code in the whole routine. - -2003-05-07 Jeremy Katz <katzj@redhat.com> - - * evolution-mail.schemas - (/schemas/apps/evolution/mail/display/mime_types): Correct - default for list. - -2003-05-06 Not Zed <NotZed@Ximian.com> - - ** See bug #42400 - - * mail-tools.c (meta_data_key): protect against getting an - unparsable uri. - -2003-05-05 Not Zed <NotZed@Ximian.com> - - ** See bug #42294. - - * mail-config.c (config_write_fonts): Also set the custom font - style for *BonoboPlug*GtkHTML. - -2003-05-05 Ettore Perazzoli <ettore@ximian.com> - - * mail-session.c (request_password): Set OK as the default - response for the password_dialog. - -2003-04-30 Jeffrey Stedfast <fejj@ximian.com> - - * mail-callbacks.c (mark_as_unseen): To be consistant with the - message-list envelope toggle, undelete the message when we unmark - the Seen flag here as well. Fixes bug #42118. - -2003-04-30 Jeffrey Stedfast <fejj@ximian.com> - - * message-list.c (ml_tree_value_at): Fixed to return the correct - values (swapped) in order to fix bug #42120. - -2003-04-30 Jeffrey Stedfast <fejj@ximian.com> - - * message-list.c (regen_list_regened): Save the tree state before - we tear down the tree and then load it back again. yay. Fixes bug - #42170 and #40074. - -2003-04-30 Not Zed <NotZed@Ximian.com> - - ** See bug #41748 - - * mail-send-recv.c (build_dialogue): make sure we dont add any - SEND_SEND types to the receive table. When we add the SEND_SEND - type, key it on a fixed string SEND_URI_KEY. - (receive_done): if it is a SEND_SEND type, use SEND_URI_KEY to - remove it from the active list. - (mail_receive_uri): make sure we never add a SEND_SEND type to the - receive list. - (mail_send): key the send info on SEND_URI_KEY not transport url. - -2003-04-29 Jeremy Katz <katzj@redhat.com> - - * folder-browser-ui.c (fbui_sensitise_item): Don't just blindly - cast an int to gpointer, use the proper glib magic instead. - -2003-04-29 Jeffrey Stedfast <fejj@ximian.com> - - * importers/netscape-importer.c - (netscape_add_priority_workaround_filters): Updated for API change - in the filter code. - -2003-04-29 Not Zed <NotZed@Ximian.com> - - ** See bug #41972 - - * message-list.c (ml_tree_value_at): fix (void *) casts on trinary - ops. - - * folder-browser.c (on_right_click): Store the label tag in the - label callback data, not the translated name. - - * mail-config.c (label_defaults[]): Initialise with the tag - values. - (config_clear_labels): free tag field. - (config_cache_labels): setup the tag field based on the position - of the label name. - (mail_config_get_label_color_by_name): Lookup colour by the - untranslated TAG, not the translated/customisable tag. - - * mail-config.h (MailConfigLabel): Add a tag field, we were using - the translated name as the label(!). - -2003-04-29 Dan Winship <danw@ximian.com> - - * mail-format.c (write_xmailer_header): Remove preceding whitespace - -2003-04-28 Ettore Perazzoli <ettore@ximian.com> - - * mail-session.c (mail_session_forget_passwords): Forget all - passwords again. [#41817] - -2003-04-25 Jeffrey Stedfast <fejj@ximian.com> - - * mail-config.glade: Made toplevel container widgets set a - border-width (including toplevel widgets within frames), set the - table/hbox/vbox spacings, set the spacing between an image and the - description text in hboxes to 12pts (as suggested by the HIG), - Changed Add/Delete buttons to the stock Add/Remove buttons, etc - -2003-04-24 Jeffrey Stedfast <fejj@ximian.com> - - Fix for bug #41789 - - * mail-config.c (mail_config_init): Cache the allowable - mime-types. - (mail_config_get_allowable_mime_types): New public function to get - an array of allowable mime-types. - - * mail-format.c (mail_lookup_handler): Only allow a - bonobo-component handler if the mime-type is something handled by - evolution or the user has specifically chosen that type as - available for viewing with a bonobo component in the gconf - database. - (mime_type_uses_evolution_component): New convenience function. - (mime_type_can_use_component): Checks gconf to see if the user has - allowed the mime-type to be viewed by a component. - -2003-04-24 Radek Doulik <rodo@ximian.com> - - * mail-display.c (html_button_press_event): as below - (update_active): as below - - * folder-browser.c (html_button_press_event): update for changed - coordinates in gtk-2 - -2003-04-23 Not Zed <NotZed@Ximian.com> - - * mail-send-recv.c (get_receive_type): pass an exception to - get_provider, to silence some warnings/get a valid result. - -2003-04-22 Jeffrey Stedfast <fejj@ximian.com> - - * mail-callbacks.c (composer_get_message): Only add the - Organization: header if it is non-empty. Fixes bug #41730. - -2003-04-18 Jeffrey Stedfast <fejj@ximian.com> - - * mail-composer-prefs.c (spell_set_ui): Protect against a NULL - strv result from parsing the language list string. - -2003-04-17 Jeffrey Stedfast <fejj@ximian.com> - - Fixes for bug #41142. - - * mail-search.c (dialog_response_cb): Handle a GTK_RESPONSE_CLOSE - response. - (mail_search_construct): Changed the Cancel button into a Close - button. - -2003-04-18 Rodney Dawes <dobey@ximian.com> - - * Makefile.am: - * folder-browser-ui.c: - * mail-signature-editor.c: - * message-browser.c: - Use PREFIX instead of EVOLUTION_DATADIR for bonobo_ui_util_set_ui (). - Fixes bug #21499. - -2003-04-17 Not Zed <NotZed@Ximian.com> - - * mail-signature-editor.c (menu_help): remove the help menu item - handling, as the help menu is removed. Clean up of #38927. - -2003-04-16 Not Zed <NotZed@Ximian.com> - - * importers/Makefile.am (%.server.in): Remove COMPONENTDIR and set - BINDIR and VERSION instead. - - * (importers/GNOME_Evolution_Mail_Pine_Intelligent_Importer.server.in.in, - importers/GNOME_Evolution_Mail_Mbox_Importer.server.in.in, - importers/GNOME_Evolution_Mail_Outlook_Importer.server.in.in, - importers/GNOME_Evolution_Mail_Netscape_Intelligent_Importer.server.in.in, - importers/GNOME_Evolution_Mail_Elm_Intelligent_Importer.server.in.in:) : - Convert the type back to exe, and point to the main evolution - executable. Fixes #41164. - -2003-04-16 Jeremy Katz <katzj@redhat.com> - - * evolution-mail.schemas: schema keys can't be directories (#41419) - -2003-04-15 Jeffrey Stedfast <fejj@ximian.com> - - * mail-config-druid.c (config_wizard_set_page): Fixed a logic - error that was the cause of bug #41389. - -2003-04-15 Not Zed <NotZed@Ximian.com> - - * For bug #41199. - - * subscribe-dialog.glade: New interface from Anna. Setup the - wigdet names and add a progress bar, and set the default opening - size to something reasonable. - - * subscribe-dialog.c (subscribe_dialog_construct): changes to - match the glade file chagnes. remove the search stuff. hide the - progress bar by default. - (sc_activity_cb): show the progress bar when we're active, hide - it when inactive. dont set any status. - (struct _SubscribeDialogPrivate): Remove the appbar. - -2003-04-15 Hans Petter Jansson <hpj@ximian.com> - - * mail-mt.c (mail_msg_check_error): Free the temporary error text. - -2003-04-14 Jeffrey Stedfast <fejj@ximian.com> - - * mail-vfolder.c (vfolder_gui_add_rule): Set the correct border - width and vbox spacing to be HIG compliant. Fixes bug #41209. - (vfolder_edit_rule): Same here. - - * local-config.glade: Updated to comply with the HIG. Fixes bug - #41244. - -2003-04-14 Not Zed <NotZed@Ximian.com> - - * mail-send-recv.c (build_dialogue): create a stock cancel button - with a cancel all text. - (build_dialogue): Create stock-like cancel buttons with no - accelerators. A workaround for #41043. - - * message-list.c (ml_tree_value_at): if the node is the root node, - do nothing. etable shouldn' really be searching the root node if - it isn't visible ...? For #41190. - -2003-04-14 Larry Ewing <lewing@ximian.com> - - * evolution-mail.schemas: add proper defaults for the fonts - settings. - -2003-04-11 Jeffrey Stedfast <fejj@ximian.com> - - Fixes bug #41243. - - * message-tag-followup.c (construct): Change the window border - width and packing to comply with the HIG. - - * message-tags.glade: Updated to comply with the HIG. - -2003-04-11 Jeffrey Stedfast <fejj@ximian.com> - - * mail-session.c (request_password): Add padding around the - entry/checkbox and change the border width of the dialog window to - comply with the HIG. Fixes bug #41004. - -2003-04-10 Jeffrey Stedfast <fejj@ximian.com> - - * mail-search.c (mail_search_construct): Change the action button - ordering and also change the padding to comply with the HIG. Fixes - bug #41046 and at least part of bug #41142 (except for the - s/Search/OK/ thing, which has not been agreed upon yet). - - * mail-send-recv.c (build_dialogue): Change the padding to comply - with the GNOME HIG. Fixes bug #41001. - -2003-04-09 Not Zed <NotZed@Ximian.com> - - ** See bug #40921 - - * subscribe-dialog.c (subscribe_dialog_finalise): add a finalise - funciton which actually free's resources. - (get_short_folderinfo_got): dont call activity callback implicitly - here, do it from the callers callback. - (subscribe_get_short_folderinfo): dont call activity callback - here. - (fe_got_children): check implicitly if we were cancelled. also - add back the node sort, and also call the activity callback from - here instead of breaking layers of abstraction as above. - (folder_etree_cancel_all): new method, force a cancel of all ops, - but dont free anything. - (store_data_free): dont unref the widget anymore, not needed. - call cancel all on the ftree if its still active. - (sc_close_pressed): destroy the subscribe dialogue as well as the - app, it doesn't seem to get destroyed otherwise. - (sc_activity_cb): do nothing if we have been cancelled. - (subscribe_dialog_destroy): trigger a cancel of all outstanding - ops. only free most data in the finalise method. - (subscribe_dialog_class_init): hook onto finalise. - (store_data_get_widget): dont ref the widget. - - * mail-callbacks.c (manage_subscriptions): sink the dialog. - -2003-04-09 Larry Ewing <lewing@ximian.com> - - * mail-preferences.c (font_share_changed): set sensitivity of - font pickers based on share setting. - (mail_preferences_construct): initialize font prefs. - (mail_preferences_apply): set the font prefs. - (font_changed): add gnome-font-picker changed function. - - * mail-preferences.h: add font pref widgets. - - * mail-config.c (mail_config_init): add notify to on fonts dir. - (config_write_fonts): write out a gtkrc that overrides the gtkhtml - fonts settings based on the gconf keys. - - * mail-config.glade: move display font setttings to mail prefs. - - * evolution-mail.schemas: add font settings. - -2003-04-08 Jeffrey Stedfast <fejj@ximian.com> - - * mail-callbacks.c (do_view_message): Add a check for a NULL uid - here. Don't see how it can happen, but it seems to have for - Aaron. Anyways, this should fix bug #40904. - -2003-04-08 Dan Winship <danw@ximian.com> - - * mail-config.glade: Remove color specs from the druid so it will - use the theme colors - - * importers/GNOME_Evolution_Mail_Elm_Intelligent_Importer.server.in.in: - * importers/GNOME_Evolution_Mail_Netscape_Intelligent_Importer.server.in.in: - * importers/GNOME_Evolution_Mail_Pine_Intelligent_Importer.server.in.in: - Fix bad XML noticed by Not Zed - -2003-04-08 Not Zed <NotZed@Ximian.com> - - * mail-vfolder.c (vfolder_gui_add_rule): swap button order. For - #40900. - -2003-04-07 Jeffrey Stedfast <fejj@ximian.com> - - * message-list.c (ml_tree_value_at): For string columns, never - return NULL - always return "" if the value is empty. Fixes bug - #40728. - - * mail-composer-prefs.c (sig_add_script_cb): Set the "script" data - on the GtkEntry to NULL. - (sig_add_script_response): If the "script" data on the GtkEntry - object is non-NULL, then we are editing an existing signature, so - just change the values in place and don't add it to the signature - db. - (sig_edit_cb): If sig->script is non-NULL, then we are editing a - script signature, so pop up the script dialog instead. Fixes bug - #38929. - -2003-04-07 Radek Doulik <rodo@ximian.com> - - * mail-composer-prefs.c (spell_load_values): use e_iconv_locale_language - -2003-04-07 Dan Winship <danw@ximian.com> - - * GNOME_Evolution_Mail.server.in.in: Clean up server names - - * importers/GNOME_Evolution_Mail_Elm_Intelligent_Importer.server.in.in: - Likewise, and fix evolution-mail location - - * importers/GNOME_Evolution_Mail_Mbox_Importer.server.in.in: - Likewise - - * importers/GNOME_Evolution_Mail_Netscape_Intelligent_Importer.server.in.in: - Likewise - - * importers/GNOME_Evolution_Mail_Outlook_Importer.server.in.in: - Likewise - - * importers/GNOME_Evolution_Mail_Pine_Intelligent_Importer.server.in.in: - Likewise - - * importers/Makefile.am (%.server.in): Fix this for evolution-mail - being a shlib. - -2003-04-03 Not Zed <NotZed@Ximian.com> - - ** Bug 40536 - - * component-factory.c (send_receive_cb): run the warning dialogue - asynchronously. Also, set the mail send/receive dialogue to - transient for parent. - - * mail-send-recv.c (mail_send_receive): return the dialogue for - send/receive. - -2003-04-02 Rodrigo Moya <rodrigo@ximian.com> - - * importers/evolution-mbox-importer.c (load_file_fn): - * importers/evolution-outlook-importer.c (load_file_fn): added - "folder_type" parameter to EvolutionImporterLoadFileFn. - - * importers/elm-importer.c (elm_import_file): pass empty string for - "folder_type" argument to GNOME_Evolution_Importer_loadFile. - * importers/pine-importer.c (pine_import_file): ditto. - * importers/netscape-importer.c (netscape_import_file): ditto. - -2003-04-01 Jeffrey Stedfast <fejj@ximian.com> - - * mail-display.c (save_part): Don't allow the 'prefix' argument to - make_safe_filename() be NULL. If we don't yet have a save_dir in - gconf, use $HOME, etc. Fixes bug #40608. - -2003-04-02 Not Zed <NotZed@Ximian.com> - - * mail-session.c (mail_session_forget_passwords): Only clear the - Mail passwords. - - * component-factory.c (interactive_cb): Call - composer_check_autosave if we're going interactive, to check for - unsaved files. Fixes #40300. - -2003-04-01 Not Zed <NotZed@Ximian.com> - - * mail-display.c (mail_display_redisplay): if we're called and the - idle handler is set, remove it, so we dont go and redisplay it - again. Fixes #40522. - -2003-03-31 Jeffrey Stedfast <fejj@ximian.com> - - * message-list.c (regen_list_regened): Save tree state and then - after building the new tree, re-load the tree state. Finishes the - fix for bug #40074. - - * mail-session.c: Properly init message_list. Fixed a type-o that - initialized it to the password_list. - -2003-03-31 Not Zed <NotZed@Ximian.com> - - * mail-session.c (pass_response): need to check for config_service - != NULL, not service != NULL before calling set_save_password. - Fix for #40472. - -2003-03-28 Not Zed <NotZed@Ximian.com> - - * folder-browser-ui.c: include e-meta.h - - * folder-browser.c (on_right_click): remove unused var. - -2003-03-28 Jeffrey Stedfast <fejj@ximian.com> - - * subscribe-dialog.c (fe_check_for_children): Declare a prototype - for this function prior to fe_got_children() so that - fe_got_children() can call us. - -2003-03-26 Dan Winship <danw@ximian.com> - - * mail-format.c (write_address): remove extra arg to - camel_url_encode - -2003-03-27 Not Zed <NotZed@Ximian.com> - - * folder-browser.c (folder_browser_gui_init): dont set the paned - initial size here, but hook onto the realize signal. - (paned_realised): set the paned size once we're realised. Fixes - #37084, its a bit of a hack, but it seems to work. - -2003-03-26 Jeffrey Stedfast <fejj@ximian.com> - - Fixes bug #40074. - - * folder-browser-factory.c (control_deactivate): Save message-list - state. - - * message-list.c (message_list_save_state): Save the various - states. - -2003-03-26 Jeffrey Stedfast <fejj@ximian.com> - - Fixes for bug #39870 - - * message-browser.c (transfer_msg_done): Close the - message-browser. Since the message doesn't exist anymore, we - should close it. - (message_browser_delete): New callback to handle deletion in the - message-browser window. - -2003-03-26 Jeffrey Stedfast <fejj@ximian.com> - - * subscribe-dialog.c (fe_got_children): If the CamelFolderInfo - node doesn't have \NoInferriors set, then check for - subfolders. Fixes bug #40314. - -2003-03-26 Not Zed <NotZed@Ximian.com> - - * mail-display.c (popup_window_destroy_cb): Undo jeff's patch - below for #40275, the destroy timeout is already removed in - popup_info_free. Unref the widget 'w' when we're done with it. - (popup_info_free): Move everything in here to popup_window_destroy - and remove, since nothing else uses it. - (make_popup_window): Ref the widget so it doesn't go away before - we're finished with it. Really fixes bug #40275/40188. - -2003-03-25 Jeffrey Stedfast <fejj@ximian.com> - - * mail-display.c (popup_window_destroy_cb): Remove the - timeout. Should fix bug #40275. - - * subscribe-dialog.c: Remove search entry which never worked right - (and can't work as users expect anyway, since we don't do - namespace stripping). Fixes bug #40083. - (ftree_node_new): Ignore \NoSelect as far as marking it - "subscribable". Fixes bug #40124. - -2003-03-25 Dan Winship <danw@ximian.com> - - * mail-account-editor.c: Update for e_notice move - (apply_changes): Pass a parent_window to e_notice - - * mail-account-gui.c: Update for e_notice move. - (mail_account_gui_save): Pass a parent_window to e_notice - - * mail-callbacks.c: Update for e_notice move - * mail-local.c: Likewise - * mail-signature-editor.c: Likewise - * mail-vfolder.c: Likewise - - * component-factory.c (interactive_cb): Update prototype - -2003-03-25 Not Zed <NotZed@Ximian.com> - - * mail-tools.c (meta_data_key): strdup the key before freeing the - url as it is probably pointing there. - -2003-03-25 Not Zed <NotZed@Ximian.com> - - * component-factory.c (got_folder): remove a debug printf that - made it in a commit. - - * folder-browser-ui.c (folder_browser_ui_add_global): Load - per-folder setting of show_preview from meta data. - (folder_browser_ui_add_list): Same, for thread_list. - - * mail-tools.c (mail_tool_get_meta_data) - (mail_tool_delete_meta_data): helpers to lookup/delete meta data. - - * mail-config.c (mail_config_uri_deleted): delete the meta-data - for the folder. - - * folder-browser.c (folder_browser_reload): dont reload the uri if - we're in the process of loading it still. - (folder_browser_new): load the folder meta data before loading the - folder. - (folder_browser_toggle_preview): - (folder_browser_toggle_threads): save change to meta-data. - (got_folder): Load the metadata if we have a folder to set, and - the meta-data has changed from initislisation. - -2003-03-23 Chris Toshok <toshok@ximian.com> - - * mail-callbacks.c (ask_confirm_for_unwanted_html_mail): pass - FALSE for e_destination_get_textrep's include_email arg. - -2003-03-21 Jeffrey Stedfast <fejj@ximian.com> - - * mail-format.c (mail_format_data_wrapper_write_to_stream): - Default to the charset provied in the MimePart's Content-Type over - that of the user's mailer charset. Fixes bug #39204. - -2003-03-21 Jeffrey Stedfast <fejj@ximian.com> - - * mail-composer-prefs.c (spell_load_values): "en_us" should not be - translated. Fixes bug #40088. - -2003-03-21 Larry Ewing <lewing@ximian.com> - - * mail-display.c (pixbuf_gen_idle): remember to disconnect the - destroy handler if whenever the loader is shut down. - -2003-03-20 Jeffrey Stedfast <fejj@ximian.com> - - * component-factory.c (owner_set_cb): Change the message_destroy - callback to just gtk_widget_destroy. No need to have a callback - simply to call this function. - (warning_response): Removed (see above). - - * mail-composer-prefs.c (sig_add_script_response): Don't forget to - add the signature to the signature list if it is a valid script. - - * mail-config.c (mail_config_signature_unregister_client): Make - sure we can find the registered handler before trying to remove it - from the list. - - * mail-session.c (do_user_message): Make the 5th argument to - gtk_message_dialog_new() "%s" and move the m->prompt to arg 6 so - that we are safe if the prompt string contains any %'s. Also - connect to the response signal for the user_msg dialog and set the - callback to gtk_widget_destroy so that the user can actually close - the dialog. We also need to g_object_weak_ref() the dialog so that - we can set the global message_dialog pointer back to NULL when it - gets destroyed. Fixes bug #40043. - -2003-03-20 Dan Winship <danw@ximian.com> - - * mail-ops.c (build_from): Remove this since there's a function in - CamelMimeMessage to do it now. - (save_messages_save): Use camel_mime_message_build_mbox_from. - -2003-03-21 Not Zed <NotZed@Ximian.com> - - ** for mail part of bug #38461. - - * importers/evolution-outlook-importer.c (load_file_fn): dont pass - in create flag to uri_to_folder, the folder must already exist. - - * importers/evolution-mbox-importer.c (folder_created_cb): - Removed, we now force the caller to create the destination folder - first. - (load_file_fn): Dont try and create a folder if it doesn't exist. - Also, use the uri directly as the destination uri, so we can - import into any folder. - (process_item_fn): If we dont have a folder, thats just an error, - return BAD_FILE. - - * importers/netscape-importer.c (netscape_import_file): As below - for elm_import_file. - (import_next): similarly as for pine import_next. - (importer_cb): just record result. - (importer_timeout_fn): removed. - - * importers/pine-importer.c (import_next): Similar to below for - the elm import_next. - (pine_import_file): As below for elm_import_file. - (importer_timeout_fn): removed. - (importer_cb): just record the result, and exit. - (import_next): change around to behave more like the elm importer, - cleaning up when we're done. - - * importers/elm-importer.c (elm_import_file): Create the - destination folder ourselves, dont pass it onto the mbox importer. - Simplify logic, just do the import within a while loop, polling - the g main loop as necessary, remove need for idle callbacks and - other crap. - (import_next): If elm_import_file fails, then just go straight to - the next folder, stops it falling in a heap. - (import_item_idle): removed. - (importer_cb): just record result/exit. - - * mail-importer.c (mail_importer_create_folder): removed. - (mail_importer_make_local_folder): new function to create a - local-only folder from a path. It runs synchronously by using a - recursive main loop. - (folder_created_cb): callback for make_local_folder. - -2003-03-19 Jeffrey Stedfast <fejj@ximian.com> - - * mail-config-druid.c (mail_config_druid_new): Revert ettore's - broken patch. - - * mail-search-dialogue.c: Removed - nothing uses this. - -2003-03-19 Ettore Perazzoli <ettore@ximian.com> - - * importers/GNOME_Evolution_Mail_Mbox_Importer.server.in.in: - Replace "evolution:menu-name" prop with "evolution:menu_name". - [#39692] - * importers/GNOME_Evolution_Mail_Outlook_Importer.server.in.in: - Likewise. - -2003-03-19 Ettore Perazzoli <ettore@ximian.com> - - * mail-config-druid.c (mail_config_druid_new): Give the druid the - DIALOG hint. [#39741 and friends.] - -2003-03-19 Radek Doulik <rodo@ximian.com> - - * mail-composer-prefs.c (spell_load_values): changed default - language to en_us instead of en - (spell_language_button_press): new handler, ported from 1.2 - (spell_setup): use spell_language_enable and - spell_language_button_press - -2003-03-18 Jeffrey Stedfast <fejj@ximian.com> - - * mail-callbacks.c (composer_get_message): - e_msg_composer_get_subject() now returns a const char *, so update - appropriately. - -2003-03-18 Larry Ewing <lewing@ximian.com> - - * mail-callbacks.c (do_mail_print): fix leak, cleanup variable - name, and call gtk_window_set_transient_for with a parent that is - actually a GtkWindow. - (mark_as_unseen): use g_source_remove. - -2003-03-18 Jeffrey Stedfast <fejj@ximian.com> - - * mail-config-druid.c (mail_config_druid_new): Set the type hint - to DIALOG so that Metacity shows this window on top. Fixes bug - #39914. - -2003-03-18 Not Zed <NotZed@Ximian.com> - - * mail-vfolder.c (new_rule_clicked): validate rule & rule is - unique. Workaround for #39464. Should this just use - rule_context_add_rule_gui?? - - * mail-search.c (mail_search_destroy): unhook from the html engine - signals here, before we redisplay the message. Also make sure - this processing only happens once. For #39759. - (mail_search_finalise): dont unhook from signals here. - -2003-03-12 Not Zed <NotZed@Ximian.com> - - * mail-callbacks.c (expunge_folder): use a hack to find out if the - message-list was focussed before we desensitise it. - (expunged_folder): If the message-list was focussed before, - re-grab the focus. For bug #29564. - -2003-03-17 Ettore Perazzoli <ettore@ximian.com> - - * mail-signature-editor.c (mail_signature_editor): Give the editor - the GDK_WINDOW_TYPE_HINT_DIALOG hint. [#38926] - -2003-03-17 Jeffrey Stedfast <fejj@ximian.com> - - * mail-display.c (pixbuf_gen_idle): If we fail to load the pixbuf, - don't use it (stops some g_warnings). - - Part of a fix for bug #39809 - - * mail-vfolder.c (vfolder_edit): Don't add the cancel button here. - - * mail-callbacks.c (filter_edit): Don't add the cancel button here. - -2003-03-17 Jeffrey Stedfast <fejj@ximian.com> - - * mail-display.c (do_external_viewer): Lookup the handler for the - type. If we don't have a registered handler or if the registered - handler is not meant to be handled via a bonobo component, don't - use a bonobo component. - - * mail-format.c (mail_lookup_handler): If we register a new - handler that is to be handled by a bonobo component, set - handler->is_bonobo to TRUE. - -2003-03-14 Dan Winship <danw@ximian.com> - - * component-factory.c (storage_connect, storage_connected): Update - for EvolutionStorage change - -2003-03-12 Jeffrey Stedfast <fejj@ximian.com> - - * mail-signature-editor.c (menu_file_save_cb): Rewritten to do the - same as the composer's build_message() code. - -2003-03-11 Jeffrey Stedfast <fejj@ximian.com> - - * mail-accounts.c (account_add_clicked): Use - gtk_window_set_transient_for() on the druid with the settings - dialog as the parent window. - -2003-03-10 Jeffrey Stedfast <fejj@ximian.com> - - * mail-signature-editor.c (do_exit): Remove the yes/no - buttons. Fixes bug #39382. - - * mail-accounts.c (account_able_toggled): New callback function to - handle the checkbox getting toggled. - (mail_accounts_treeview_new): Save the toggle renderer so we can - later connect to it's toggled signal. - (mail_accounts_tab_construct): Connect to the toggle-cell's - toggled signal. Fixes bug #39325. - -2003-03-11 Not Zed <NotZed@Ximian.com> - - * mail-vfolder.c (vfolder_editor_response): Fix the response code, - because some bastard changed the filter/* code and didn't fix the - callers. Partial fix for #39165. - -2003-03-10 Not Zed <NotZed@Ximian.com> - - * Makefile.am (libevolution_mail_la_SOURCES): removed main.c from - the build. - - * component-factory.c (component_factory_init): Remove, not used - anymore, causes linking problems some places. - (factory): Removed the debug printf. Added a case for the - composer. Part of fixing #39256. - -2003-03-07 Jeffrey Stedfast <fejj@ximian.com> - - All this snot just to fix bug #38925 and an attempt to fix bug - #38926 (but it seems no matter what I do, I can't work around the - bonoboness/modality/whatever of the shell's preferences dialog). - - * mail-account-gui.c (sig_add_new_signature): Get the toplevel - parent GtkWindow and pass that along to - mail_composer_prefs_new_signature() so that window layering can be - done correctly. - - * mail-composer-prefs.c (mail_composer_prefs_new_signature): - Simplify. We don't want to add the signature to the list until - after they have saved. - (sig_edit_cb): Pass FALSE as the is_new argument to - mail_signature_editor(). - (sig_event_client): Listen for signatures being added. - (mail_composer_prefs_new_signature): Now takes a GtkWindow arg as - the first arg rather than a MailComposerPrefs arg since we don't - really need it to be a MailComposerPrefs object. We'd rather use - the first arg as the parent GtkWindow so that we can set - transience for the editor window. - - * mail-signature-editor.c (mail_signature_editor): Now takes a - 'parent' argument (so we can set transient_for()) and a 'is_new' - argument specifying whether the editor is editing a new signature - or not. If it is, when the user saves, it will be added to the - signature list. otherwise it won't. - (sig_name_changed): Only use the mail_config_signature_set_name() - interface if it is *not* a new signature. - (menu_file_save_cb): If is_new, then save the signature to the - config - otherwise do what we did before and set the modifications - to it and emit the CHANGED event. - - * mail-config.c (mail_config_signature_new): Renamed from - mail_config_signature_add(). We no longer immediately add the - signature to the list of saved signatures. - (mail_config_signature_add): New function which adds the signature - and emits the SIG_ADDED event. - -2003-03-07 Jeffrey Stedfast <fejj@ximian.com> - - * mail-display.c (on_url_requested): If the part url is a text - part, use mail_format_data_wrapper_write_to_stream(). This should - fix bug #39204. - - * mail-format.c (mail_format_data_wrapper_write_to_stream): Make public. - -2003-03-06 Ettore Perazzoli <ettore@ximian.com> - - * mail-accounts.c (mail_accounts_treeview_new): Set the - shadow_type of the scrlled window to GTK_SHADOW_IN. - -2003-03-06 Ettore Perazzoli <ettore@ximian.com> - - * mail-config.glade: Add some spacing to the buttons. [#38227] - -2003-03-06 Ettore Perazzoli <ettore@ximian.com> - - * importers/evolution-mbox-importer.c (IN): Use G_GNUC_FUNCTION - instead of __FUNCTION__. - (OUT): Likewise. - * importers/netscape-importer.c (netscape_import_file): Likewise. - * mail-send-recv.c (receive_done): Likewise. - * mail-summary.c (SUMMARY_OUT): Likewise. - (SUMMARY_IN): Likewise. - (folder_changed_cb): Likewise. - (message_changed_cb): Likewise. - -2003-03-06 Jeffrey Stedfast <fejj@ximian.com> - - * folder-browser-factory.c: #include <string.h> - - * e-searching-tokenizer.c (camel_utf8_getc): Don't use __inline__ - as not all platforms/compilers support this keyword. - (g): Same. - -2003-03-06 Not Zed <NotZed@Ximian.com> - - * component-factory.c (owner_unset_cb): remove debug printf. - -2003-03-05 Not Zed <NotZed@Ximian.com> - - * component-factory.c (idle_quit): Removed old quit code. - (owner_unset_cb): Make this call synchronous. Wont cover all - cases but should be ok most of the time. - -2003-03-04 Jeffrey Stedfast <fejj@ximian.com> - - * mail-search.c: Prototype some functions to shut the compiler up. - - * mail-callbacks.c (composer_get_message): Go back to using - e_destination_get_address() but use the camel-address parser on - the strings to make sure they are non-empty. Fixes bug #37854. - -2003-03-03 Jeffrey Stedfast <fejj@ximian.com> - - * mail-signature-editor.c (menu_file_save_cb): Use 'filename' when - creating the uri rather than using the uninitialised 'uri' - variable to create itself. Fixes bug #38864. - -2003-03-03 Not Zed <NotZed@Ximian.com> - - * mail-session.c (do_user_message): Do the same as below for - request_password, so we dont leave a mainloop lying around. - -2003-03-03 Jeffrey Stedfast <fejj@ximian.com> - - * mail-session.c (request_password): Don't connect to the response - signal if we are in the main thread - instead just use the return - value from gtk_dialog_run and then call pass_response() with the - response value. - -2003-03-03 Not Zed <NotZed@Ximian.com> - - * subscribe-dialog.c (fe_got_children): Remove the - e_tree_memory_sort_node, currently it crashes inside gal, the root - node seems to get free'd under it. - -2003-02-26 Jeffrey Stedfast <fejj@ximian.com> - - * mail-preferences.c: Reverted back to using e-iconv - - * mail-composer-preferences.c: Same. - -2003-02-26 Dan Winship <danw@ximian.com> - - * GNOME_Evolution_Mail.server.in.in: add a repo_id and a priority - level to the startup wizard - -2003-02-25 Jeffrey Stedfast <fejj@ximian.com> - - * mail-format.c: Reverted back to using e-iconv instead of - camel-iconv. - -2003-02-25 Dan Winship <danw@ximian.com> - - * mail-config-druid.c: Update for new EvolutionWizard interfaces. - -2003-02-25 Dan Winship <danw@ximian.com> - - * mail-config-druid.c: Redo this to not use the CORBA interfaces - in the local case (in preparation for redoing the CORBA - interfaces). - (mail_config_druid_new): Remove unused "shell" arg - - * mail-account-gui.c (mail_account_gui_transport_complete): Don't - crash if there's no transport selected at all. - (mail_account_gui_new): Don't try to set cc_addrs/bcc_addrs if - they're NULL. - - * mail-accounts.c (account_add_clicked): Don't need to pass shell - to mail_config_druid_new. - - * mail-callbacks.c (configure_mail): Don't need to pass shell to - mail_config_druid_new. - -2003-02-24 Jeffrey Stedfast <fejj@ximian.com> - - * mail-session.c (request_password): Make sure m->config_service - is non-NULL before using m->config_service->save_passwd since PGP - stuff will not have a config_service. Fixes bug #38149. - - * mail-account-gui.c (mail_account_gui_save): - s/e_account_list_changed/e_account_list_change - otherwise we get - an undefined symbol and we crash :-) - - * mail-composer-prefs.c (mail_composer_prefs_new_signature): Don't - always append "[script]" to the signature name. Also cleaned up - some memory leakage. - -2003-02-20 Not Zed <NotZed@Ximian.com> - - * mail-preferences.c (mail_preferences_apply): fix the g_snprintf - stuff. - - * mail-config.c (mail_config_add_account): Use new - e_account_list_add. - (mail_config_remove_account): Use new e_account_list_remove. - (mail_config_set_default_account): Similarly for - e_account_list_set_default. - (mail_config_get_default_account): Same for - e_account_list_get_default. - (mail_config_get_account_by_name): Use e_account_list_find. - - * mail-account-gui.c (mail_account_gui_save): use new - e_account_list_changed call instead of manual signalling. - -2003-02-23 Jeffrey Stedfast <fejj@ximian.com> - - * mail-local.c: Set the local provider description field to a - string rather than NULL to prevent a segfault on solaris. Fixes - bug #38418. - -2003-02-23 Jeffrey Stedfast <fejj@ximian.com> - - * mail-format.c (write_text_header): bitwise-or in - CAMEL_MIME_FILTER_TOHTML_CONVERT_SPACES to fix bug #38499. - - * mail-search.c (mail_search_destroy): New overloaded virtual - method, does what dialog_destroy_cb was trying to do. - (mail_search_construct): Connect to the "response" signal rather - than "clicked" to correspond to the GtkDialog API - (instead og the old GnomeDialog API). - (dialog_response_cb): Changed the function name and made it check - button == GTK_RESPONSE_ACCEPT to search, any other button - closes. Fixes bug #37947. - -2003-02-21 Hans Petter Jansson <hpj@ximian.com> - - * component-factory.c (factory): Don't try to get a FontPrefs control. - - * mail-config-factory.c (mail_config_control_factory_cb): Just return - NULL if a FontPrefs control was requested. - - * mail-config.c (mail_config_get_default_account): If no accounts - are defined, don't try to set the default account. - -2003-02-21 Dan Winship <danw@ximian.com> - - * Makefile.am (libevolution_mail_la_LIBADD): Remove libebook's - dependencies. - - * importers/Makefile.am (libevolution_pine_importer_la_LIBADD): - Likewise. - -2003-02-21 Dan Winship <danw@ximian.com> - - * mail-account-gui.c (mail_account_gui_build_extra_conf): Use - tables instead of vboxes, so that groups of label/entry pairs (as - in Connector's config page) can line up nicely. - - * mail-config.glade: Turn extra_vbox and extra_mailcheck_vbox into - tables. - - * mail-config-druid.c (get_fn): s/extra_vbox/extra_table/ - - * Makefile.am (libevolution_mail_la_LIBADD): - s/libcomposer.a/libcomposer.la/ - -2003-02-20 Jeffrey Stedfast <fejj@ximian.com> - - * mail-callbacks.c (mark_all_as_seen): Use - camel_folder_free_uids(). - - * mail-format.c (write_headers): Use - camel_charset_canonical_name() here instead of - e_iconv_charset_name(). - - * mail-preferences.c (mail_preferences_construct): Same as below. - (mail_preferences_apply): Again here. - - * mail-composer-prefs.c (mail_composer_prefs_construct): Use - camel_charset_locale_name() here instead of - e_iconv_locale_charset(). - (mail_composer_prefs_apply): Same. - -2003-02-20 Dan Winship <danw@ximian.com> - - * Makefile.am (libevolution_mail_la_LIBADD): - s/libemiscwidgets.a/libemiscwidgets.la/ and likewise for - libefilterbar - -2003-02-18 Jeffrey Stedfast <fejj@ximian.com> - - * mail-callbacks.c (mark_all_as_seen): Fixed a memory leak - make - sure to free all uids. - - * mail-config.c (uri_to_key): Removed. - (lookup_signature): Removed. - (xml_get_int): Removed. - (xml_get_bool): Removed. - (mail_config_get_time_24hour): Removed. - - * evolution-mail.schemas: s/long/int/g and change default_account - to be a string instead of an int. - - * mail-config.c (mail_config_get_default_account): default_account - now uses the account uid, so change the code a bit to match uid - strings rather than use an index. - (mail_config_remove_account): Same here. simplifies the code a - bunch. - (mail_config_set_default_account): Here too. - - * folder-browser-ui.c (folder_browser_ui_setup_view_menus): Update - the GalView path. - -2003-02-14 Jeffrey Stedfast <fejj@ximian.com> - - * mail-session.c (do_get_pass): Change the logic here - slightly. Instead of only reprompting the user if the cache is - empty, also reprompt the user if the backend is forcing a - reprompt. - (request_password): If we have a cached passwd string for the - account, fill-in the GtkEntry box with that value by - default. This, together with the camel changes, fixes the - "Evolution forgets my POP passwd if it gets a -ERR response during - the login phase" bug. - -2003-02-13 Jeffrey Stedfast <fejj@ximian.com> - - * e-searching-tokenizer.c: #include <stdio.h> - - * mail-config-factory.c: #include <string.h> - - * mail-config-druid.c (identity_prepare): Use - gtk_editable_select_region() since gtk_entry_select_region() has - been deprecated. - (construct): Use gtk_window_set_resizable() instead of - gtk_window_set_policy(). - (wizard_free): account_destroy() is no longer around, use - g_object_unref() instead. (how did this even compile before?) - - * mail-account-gui.c (mail_account_gui_build_extra_conf): Use - gtk_label_set_text_with_mnemonic() instead of - gtk_label_parse_uline() as the latter has been deprecated. - -2003-02-12 Jeffrey Stedfast <fejj@ximian.com> - - * importers/netscape-importer.c: Removed unused variables. - - * importers/pine-importer.c: Removed unused variables. - (parse_address): Removed - it's unused and we have CamelAddress - available to us anyway. - - * importers/elm-importer.c: Removed unused variables. - - * importers/evolution-mbox-importer.c (load_file_fn): Removed an - unused variable. - -2003-02-11 Jeffrey Stedfast <fejj@ximian.com> - - * mail-account-editor.c (construct): Use - gtk_window_set_resizable() instead of gtk_window_set_policy(). - - * mail-config.c: Fix a bunch of warnings. - (mail_config_signature_write): Removed. - - * mail-callbacks.c: Removed unused variables. - - * mail-accounts.c (mail_accounts_tab_class_init): Register a - destroy virtual method. - (mail_accounts_tab_destroy): Set mail_display->destroyed = TRUE. - - * message-list.c (message_list_destroy): Set - mail_display->destroyed = TRUE. This is a workaround for the - GTK_OBJECT_DESTROYED() macro that we used to use before. - - * mail-display.c (mail_display_destroy): Set - mail_display->destroyed = TRUE. This is a workaround for the - GTK_OBJECT_DESTROYED() macro that we used to use before. - -2003-02-10 Jeffrey Stedfast <fejj@ximian.com> - - * message-list.c (build_tree): Use g_signal_emit() rather than - gtk_signal_emit(). - (build_flat): Same here. - - * mail-signature-editor.c: #include <string.h> - - * mail-vfolder.c: #include <string.h> - - * mail-session.c: #include <string.h> - - * mail-search.c: #include <string.h> - - * mail-mt.c: #include <string.h> - - * mail-ops.c (save_part_save): Use strcasecmp() instead of - g_strcasecmp(). - - * mail-local.c: #include <string.h> - (reconfigure_folder_reconfigured): Use a GtkDialog instead of - gnome_error_dialog(). - - * mail-format.c (find_preferred_alternative): Use g_ascii_strdown - since g_strdown is deprecated. - (fake_mime_part_from_data): Removed, no longer used it seems. - (destroy_part): Also removed. - - * mail-display.c (make_popup_window): Replace call to - gtk_window_set_polociy() with gtk_window_set_resizable() instead. - (popup_size_allocate_cb): Use gtk_window_set_position() with - GTK_WIN_POS_MOUSE instead of calculating the position to put it - in. - -2003-02-10 Ettore Perazzoli <ettore@ximian.com> - - * importers/Makefile.am: Split the ORBit IDL compilation rules to - work properly with parallel makes. - (BUILT_SOURCES): Add this. - (CLEANFILES): Add this. - - * Makefile.am: Split the ORBit IDL compilation rules to work - properly with parallel makes. - (BUILT_SOURCES): Add $(IDL_GENERATED) here. - (CLEANFILES): Remove from here. - -2003-02-10 Rodney Dawes <dobey@ximian.com> - - * importers/Makefile.am: Add LDFLAGS to ported libs - -2003-02-10 Larry Ewing <lewing@ximian.com> - - * mail-display.c (save_url): look in the http cache for images - when saving - (image_save_as): remove random warning. - (do_external_viewer): remove unused variable. - (do_attachment_header): use g_ascii_strdown - -2003-02-07 Larry Ewing <lewing@ximian.com> - - * mail-display.c (save_data_cb): don't use random memory as a - gconf client. - -2003-02-06 Chris Toshok <toshok@ximian.com> - - * importers/pine-importer.c (import_addressbook): track change to - e_book_load_uri type. - -2003-02-06 Ettore Perazzoli <ettore@ximian.com> - - * folder-browser.c (on_right_click): Use - e_auto_kill_popup_menu_on_selection_done() instead of - e_auto_kill_popup_menu_on_hide(). - -2003-02-06 Dan Winship <danw@ximian.com> - - * Makefile.am (INCLUDES): add EVOLUTION_PRIVDATADIR. Fix - EVOLUTION_ICONSDIR - - * component-factory.c (owner_set_cb): Use EVOLUTION_PRIVDATADIR - * mail-autofilter.c (filter_gui_add_from_message): Likewise - (mail_filter_rename_uri): Likewise - (mail_filter_delete_uri): Likewise - * mail-callbacks.c (filter_edit): Likewise. - * mail-search-dialogue.c (mail_search_dialogue_construct): - Likewise - * mail-session.c (main_get_filter_driver): Likewise - * mail-summary.c (generate_folder_summaries): Likewise - * mail-vfolder.c (vfolder_load_storage): Likewise - -2003-02-06 Dan Winship <danw@ximian.com> - - * Makefile.am: Remove *dir defs that are in configure.in now - (INCLUDES): clean up using new *dir variables - (libevolution_mail_la_LDFLAGS): remove -export-dynamic, add - -module - - * main.c (main): s/PACKAGE/GETTEXT_PACKAGE/ in gettext init - - * importers/Makefile.am (INCLUDES): change EVOLUTION_DATADIR to - EVOLUTION_PRIVDATADIR - - * importers/netscape-importer.c (netscape_import_filters): use - EVOLUTION_PRIVDATADIR - -2003-02-06 Larry Ewing <lewing@ximian.com> - - * mail-session.c (pass_activate): add an activate handler to the - entry so that hitting return will return an OK response. - -2003-02-05 Dan Winship <danw@ximian.com> - - * main.c (main): s/glade_gnome_init/glade_init/ - -2003-02-05 Not Zed <NotZed@Ximian.com> - - * importers/netscape-importer.c: update from ../../importers/. - (main): Removed. - (mail_importer_module_init): Setup module init fn. - (factory_fn): api changes. - (is_dir_empty): deprecated changes, and clean up logic. - (importer_cb): pulse progress bar, use idle function for - processing next item. - (import_next): Remove link before recursing, also fix memleak, and - api changes. - (netscape_import_file): dont release importer. - (*): gconf'ify - - * importers/elm-importer.c (elm_factory_fn): Track the - evolution_intelligent_importer, so we can unref it when done. - (*): gconf'ify. - - * importers/pine-importer.c (parse_line): use gobject stuff rather - than gtkobject. - (import_addressfile): close down 'properly' when finished. - (importer_timeout_fn): Do most processing decisions here, either - from a timeout or idle function. This prevents us getting 1 stack - frame per message and per folder. Close down properly also. - (importer_cb): Add a timeout, ignore the callback, or add an idle - function to process the next item. - (pine_import_file): dont release the importer if we can't load it, - its released elsewhere, i think. - (import_addressfile): step the progress bar as we go. - (factory_fn): Track the evolution_intelligent_importer, so we can - unref when done. - (*): gconf'ify - -2003-01-31 Not Zed <NotZed@Ximian.com> - - * importers/elm-importer.c (elm_can_import): g_file_exists -> - lstat, and g_build_filename api changes. - - * importers/pine-importer.c: moved from - ../../importers/pine-importer.c - (factory_fn): oaf->bonobo_activation - (mail_importer_module_init): setup factory. - (main): Removed. - (*): REemove bonobo config stuff. - (factory_fn): destroy signal -> weak ref. - (pine_destroy_cb): Fix signature for weak ref notify. - (import_addressfile): use new glib filename stuff. - (import_addressbook): same. - (pine_can_import): and here. - (import_next): and here. - (scan_dir): and here - (pine_create_structure): And here. - (pine_can_import): g_file_exists -> lstat. - (importer_cb): If there are more items, use an idle handler to - drop back a few stack frames rather than recursing for each - message. - (import_next): unlink data from dir_list before recursing, and fix - leak. - -2003-01-30 Not Zed <NotZed@Ximian.com> - - * importers/elm-importer.c (elm_destroy_cb): Change for weak ref - setup. - (elm_factory_fn): destroy -> weak ref. - -2003-01-29 Not Zed <NotZed@Ximian.com> - - * importers/elm-importer.c (importer_cb): Pass processItem off to - an idle handler, so we dont blow our stacks. Also update to use - progress_bar_pulse(). - (import_item_idle): Get the next message here instead. - (import_next): Fix a glist leak. Unlink the file before we import - it too. And close the dialogue and clean up when we've run out of - folders to import. - -2003-01-17 Not Zed <NotZed@Ximian.com> - - * importers/elm-importer.c (elm_create_structure): use/free elmdir - rather than double-free maildir. - -2003-01-16 Not Zed <NotZed@Ximian.com> - - * importers/elm-importer.c: update from ../importers/elm-importer.c - -2003-02-03 Jeffrey Stedfast <fejj@ximian.com> - - * message-list.c (mail_regen_list): Get the thread_subject setting - here instead of in regen_list_regen since that function will be - called in another thread and we can't make corba calls in anything - but the main thread. - (regen_list_regen): Don't make CORBA calls here! (shame on me). - - * mail-identify.c (mail_identify_mime_part): Just use - gnome_vfs_get_mime_type_from_name() so we can forget all the crap - I implemented before. - -2003-02-01 Jeffrey Stedfast <fejj@ximian.com> - - * mail-display.c (on_link_clicked): Pass in the *address* of the - GError to gnome_url_show(), otherwise bad things happen :-) - -2003-01-31 Jeffrey Stedfast <fejj@ximian.com> - - * mail-config.c (mail_config_get_labels): New function to return a - cached list of labels. - (mail_config_get_label_color_by_name): New convenience function to - search the cached labels. - (mail_config_get_label_color_by_index): Same. - (mail_config_init): Cache the labels and also listen for changes - to them in the gconf db. - (config_cache_labels): Internal function to cache the labels. - - * folder-browser.c (on_right_click): Fixed the label colours in - the menu by using the cached linked list of labels. - - * mail-preferences.c (colorpicker_set_color): Now takes a string - argument allowing us to get rid of converting a string into an rgb - guint32 all over the place when trying to set defaults, since we - now store colors in gconf as strings. - (mail_preferences_construct): Use the cached labels (they are - already parsed for us). - -2003-01-27 Jeffrey Stedfast <fejj@ximian.com> - - * component-factory.c (storage_remove_folder): Change - strcmp(fi->path, path) to strcmp(fi->name, name) and now the - execution takes the right path. My patch base on Callie's patch - for bug #33525. - - * mail-identify.c (mail_identify_mime_part): Fixed a #warning by - converting a local path into a file: uri before feeding it to - gnome-vfs. - - * message-list.c (message_list_set_folder): Removed a FIXME that - I've decided is no longer needed. - -2003-01-22 Jeffrey Stedfast <fejj@ximian.com> - - * mail-config.c (mail_config_add_account): Emit the account-added - event. - (mail_config_remove_account): Emit the account-removed event. - - * mail-account-gui.c (mail_account_gui_save): Emit the changed - event on the account-list for the changed account. - -2003-01-24 Jeffrey Stedfast <fejj@ximian.com> - - * folder-browser-ui.c (folder_browser_ui_add_global): Set the - paned_size here. - - * folder-browser.c (folder_browser_gui_init): Don't bother - connecting to the hide-deleted, message-display-style, paned-size, - nor show-preview gconf notifications anymore, since we can just - set them when the view becomes active again in - folder-browser-ui.c. Cuts down on extra overhead. - (folder_browser_destroy): No need to disconnect from those - notifications anymore either. - -2003-01-24 Ettore Perazzoli <ettore@ximian.com> - - * Makefile.am (iconsdir): Remove, this is now defined in - configure.in. - -2002-12-07 leon.zhang <leon.zhang@sun.com> - - * component-factory.c (user_create_new_item_cb): transfer the - current acount info, which will be regarded as the sender of - new composer, to send_to_url(). - - * mail-callbacks.h (send_to_url): Add a new parameter for parent - folder uri. - - * mail-callbacks.c (send_to_url): Create composer base on source - account info from parent folder physical uri. - (post_to_url): create composer based on current account from - parent folder physical uri. - - * mail-display.c (on_link_clicked): Apply new format of function: - send_to_url. - - Fixes bug #35123 #35289 - -2003-01-24 Not Zed <NotZed@Ximian.com> - - * mail-local.c (non_equal): We do actually need to check they are - file url's, otherwise, all url's match. - -2003-01-23 Rodney Dawes <dobey@ximian.com> - - * folder-browser.c (fb_resize_cb): Use button_release instead of - size_allocate, and get the position from the Paned widget to prevent - calling CORBA all the time for GConf stuff - -2003-01-23 Ettore Perazzoli <ettore@ximian.com> - - * Makefile.am (componentdir): Removed definition; this is now - defined in configure.in. - -2003-01-22 Jeffrey Stedfast <fejj@ximian.com> - - * mail-config.c (mail_config_get_thread_list): Removed. - (mail_config_set_thread_list): Removed. - (mail_config_uri_renamed): No longer needs to change threaded - state for each url either. - (mail_config_write_on_exit): Updated. - - * folder-browser-ui.c (folder_browser_ui_add_list): Get the - threaded state via gconf. - - * folder-browser.c (folder_browser_toggle_threads): Save the - threaded state. - -2003-01-22 Ettore Perazzoli <ettore@ximian.com> - - * folder-browser-ui.c (folder_browser_ui_setup_view_menus): Use - EVOLUTION_GALVIEWSDIR. - - * message-browser.c (set_bonobo_ui): Get - evolution-mail-messagedisplay.xml from EVOLUTION_UIDIR. - - * mail-signature-editor.c (mail_signature_editor): Get - evolution-signature-editor.xml from EVOLUTION_UIDIR. - - * folder-browser-ui.c (ui_add): Get the evoluiton-mail* XML files - from EVOLUTION_UIDIR. - - * Makefile.am (INCLUDES): Define EVOLUTION_GALVIEWSDIR; update - EVOLUTION_IMAGESDIR to include the $(BASE_VERSION). - (gladedir): Version using $(BASE_VERSION). - (etspecdir): Likewise. - (iconsdir): Likewise. - (buttonsdir): Likewise. - (etspecdir): Likewise. - - * component-factory.c (owner_set_cb): Look for vfoldertypes.xml in - the new version-aware location. - * mail-summary.c (generate_folder_summaries): Likewise. - * mail-search-dialogue.c (mail_search_dialogue_construct): Likewise. - * mail-vfolder.c (vfolder_load_storage): Likewise. - - * mail-autofilter.c (filter_gui_add_from_message): Look for - filtertypes.xml in the new version-aware location. - (mail_filter_rename_uri): Likewise. - (mail_filter_delete_uri): Likewise. - * mail-session.c (main_get_filter_driver): Likewise. - * mail-callbacks.c (filter_edit): Likewise. - -2003-01-22 Radek Doulik <rodo@ximian.com> - - * mail-callbacks.c (do_mail_print): put unrealized html widget - into top level widget (gtk window) before realizing it - destroy temporary widgets (w, html) - -2003-01-21 Jeffrey Stedfast <fejj@ximian.com> - - * mail-config.c (mail_config_remove_account): Don't unref the - account object, e_list_remove() apparently handles this for us. - - * mail-accounts.c (account_delete_clicked): Don't unref the - confirm dialog, it was already destroyed. - -2003-01-20 Jeffrey Stedfast <fejj@ximian.com> - - * evolution-mail.schemas: Default to hiding deleted - messages. Fixes bug #35929. - - * mail-preferences.c (entry_changed): Removed. - (toggle_button_toggled): Removed. - (settings_changed): New callback that replaces the two above. No - need to have multiple callback functions when the signature is the - same. - - * folder-browser.c (folder_browser_toggle_hide_deleted): Don't - !atoi (state) for the message_list_set_hidedeleted() call. - -2003-01-18 Larry Ewing <lewing@ximian.com> - - * mail-callbacks.c (save_msg_ok): e_question returns a boolean, - don't test for a specific value. - - * mail-display.c (html_button_press_event): make the event - handlers return FALSE so that gtkhtml can process the events. - (on_link_clicked): call gnome_url_show with all its arguments so - that it actually does something. Also pass news and nntp urls to - gnome_url_show so that they can be handled properly. - -2003-01-17 Larry Ewing <lewing@ximian.com> - - * mail-format.c (handle_text_enriched): wrap eriched entries with - a table so that they get proper indentation. - -2003-01-17 Jeffrey Stedfast <fejj@ximian.com> - - * mail-session.c (do_get_pass): Updated. - (request_password): Same. - - * mail-send-recv.c (mail_send): Fixed to use EAccountService. - - * mail-config-druid.c (make_account): Updated to use EAccount and - friends. - - * mail-account-gui.c (service_check_supported): Updated to use - EAccountService. - (mail_account_gui_new): Ref the account passed in and also update - to use EAccount objects. - (save_service): Updated to use an EAccountService. - (add_new_store): Updated to use an EAccount. - (mail_account_gui_save): Updated to use EAccounts. - (setup_signatures): Updated because the new account->id->def_sig - is now an int and not a structure pointer. - - * mail-account-editor.c (construct): Updated. - (mail_account_editor_new): Now takes an EAccount object as an - argument instead of a MailConfigAccount. - - * mail-crypto.c (mail_crypto_get_pgp_cipher_context): Updated to - use EAccounts. - - * subscribe-dialog.c (populate_store_foreach): Removed. - (populate_store_list): Can't use populate_store_foreach here - because of the change to EAccountList so do it manually. - - * mail-vfolder.c (uri_is_ignore): Rewrote to use EAccountList and - EIterator and all that fun. - - * mail-send-recv.c (build_dialogue): Updated to use EAccountList - and EAccount object stuff. *ugh* - (mail_send_receive): Here too. - (mail_autoreceive_setup): Same. - - * mail-callbacks.c (check_send_configuration): Updated. - (composer_get_message): Updated. - (compose_msg): " - (list_add_addresses): " - (guess_me): " - (guess_me_from_accounts): Same. - (forward_get_composer): Here too. - (mail_generate_reply): Same. - (redirect_get_composer): " - (empty_trash): And finally here. - - * mail-accounts.c (account_edit_clicked): Updated. - (account_delete_clicked): Same. - (account_default_clicked): Here too. - (account_able_clicked): " - (account_cursor_change): " - (mail_accounts_load): Again here. - - * folder-browser.c (folder_browser_is_drafts): Updated to use - EAccountList and EAccount stuff. - (folder_browser_is_sent): Same. - - * component-factory.c (mail_load_storages): Updated to use - EAccount and EAccountList stuff. - (owner_set_cb): Same. - (send_receive_cb): Here too. - - * mail-config.c: Rewritten to use EAccount and EAccountList - objects. - -2003-01-16 Jeffrey Stedfast <fejj@ximian.com> - - * mail-config-druid.c (get_fn): Connect to the toggled event on - the transport_needs_auth toggle button so if the user turns this - off after having deleted the username field, the Next button - becomes re-enabled. Fixes bug #36862. - -2003-01-16 Jeffrey Stedfast <fejj@ximian.com> - - * mail-composer-prefs.c (sig_fill_clist): Same as below. - - * mail-account-gui.c (sig_fill_options): - mail_config_get_signature_list() now returns a GSList instead of a - GList. - - * mail-config.c (signature_new_from_xml): New function to parse a - signature xml blob into a MailConfigSignature structure. - (config_read_signatures): Rewritten to use above function. - (signature_to_xml): New function to write a signature to xml. - (config_write_signatures_num): Removed. - (config_write_signature): Removed. - (config_write_signatures): Rewritten to use signature_to_xml and - gconf. - -2003-01-16 Dan Winship <danw@ximian.com> - - * mail-config.h (MailConfigAccount): Add a UID field (to match - EAccount), which never changes and can be used by gconf watchers - to distinguish an account rename from a deletion and creation. - - * mail-config.c (account_copy): Create a new UID on the new - account. - (account_new_from_xml): Read the UID. (If it doesn't have one, - make one.) - (account_to_xml): Write the UID. - - * mail-config-druid.c (make_account): add a UID to each account - -2003-01-15 Not Zed <NotZed@Ximian.com> - - * mail-accounts.c (account_able_clicked): Change the - enable/disable button when the state changes. - -2003-01-15 Jeffrey Stedfast <fejj@ximian.com> - - * mail-local.c (save_metainfo): Back to using e_xml_save_file(). - -2003-01-14 Ettore Perazzoli <ettore@ximian.com> - - * message-tag-editor.c (message_tag_editor_init): Make dialog - Cancel/OK to match HIG. - - * mail-signature-editor.c (do_exit): Make confirmation dialog - Discard/Cancel/Save to match the HIG. - - * mail-composer-prefs.c (mail_composer_prefs_construct): Make - dialog Cancel/OK to match HIG. - - * mail-account-editor.c (construct): Make the dialog - Apply/Close/OK to match HIG. - -2003-01-14 Jeffrey Stedfast <fejj@ximian.com> - - * mail-account-gui.c (mail_account_gui_save): Call - mail_config_save_accounts (). - - * mail-config.c (mail_config_save_accounts): New function to save - accounts without having to re-load them. - -2003-01-14 Radek Doulik <rodo@ximian.com> - - * folder-browser.c (etree_key): use gtk_scrolled_window_* - functions for mail_display->scroll - - * mail-display.c (mail_display_new): use gtk_scrolled_window_* - functions - - * mail-display.h: use GtkScrolledWindow instead of EScrollFrame - -2003-01-14 Jeffrey Stedfast <fejj@ximian.com> - - * mail-display.c (pixmap_press): Change the user_data argument to - be of type gpointer instead of EScrollFrame, since, well, it's not - an EScrollFrame anymore. - -2003-01-14 Ettore Perazzoli <ettore@ximian.com> - - * Makefile.am (libevolution_mail_la_SOURCES): Add mail-format.h. - (EXTRA_DIST): Add $(schema_DATA). - -2003-01-14 Rodney Dawes <dobey@ximian.com> - - * Makefile.am: Make the component be unversioned as a shlib - -2003-01-14 Rodney Dawes <dobey@ximian.com> - - * folder-browser.c: Use GtkPaned instead of EPaned - -2003-01-13 Jeffrey Stedfast <fejj@ximian.com> - - * mail-config.c (account_new_from_xml): Perform some sanity - checking on the auto-check-timeout value. - - * folder-browser.c (folder_browser_copy): Correctly create the - clipboard buffer by using a nul to delimit the uri and the list of - uids. - - * folder-browser-ui.c (folder_browser_ui_add_message): Check the - state of message_style in gconf and set the menus accordingly. - - * folder-browser.c (folder_browser_destroy): Remove listener for - message_style change notification. - (folder_browser_gui_init): Connect a listener for changes to - message_style. - - * mail-config.c (account_to_xml): Save the auto-check timeout - value. - (account_new_from_xml): Load the auto-check-timeout value. - -2003-01-13 Dan Winship <danw@ximian.com> - - * folder-info.c: s/BonoboXObject/BonoboObject/ - - * mail-config.c: Likewise - - * mail-offline-handler.c: Likewise - -2003-01-13 Not Zed <NotZed@Ximian.com> - - * mail-mt.c (mail_msg_check_error): hook onto destroy to remove - dialogue from active table. - (error_response): Just destroy on any response, dont unref either. - -2003-01-11 Jeffrey Stedfast <fejj@ximian.com> - - * mail-format.c (mail_format_data_wrapper_write_to_stream): - g_strdup the md->charset otherwise we'll get memory corruption - later. This may be why non-usascii text is displaying incorrectly. - -2003-01-10 Jeffrey Stedfast <fejj@ximian.com> - - * folder-browser-ui.c (folder_browser_ui_add_list): We also need - to call message_list_set_hidedeleted() here so that any - deactivated folder controls will change to the currently set state - when re-activated. - (folder_browser_ui_add_global): Same for show_preview. - - * folder-browser.c (hide_deleted_changed): Don't call - message_list_set_hidedeleted() here. - (folder_browser_toggle_hide_deleted): Instead, call it here. This - way we get a faster "response time". Also, this will make it so - that not all folder controls will regen their message-list at the - same time. - (folder_browser_toggle_preview): Same idea as the hide-deleted - changes. - (show_preview_changed): See above. - - * mail-config-druid.c (make_account): Default the new account to - enabled. - (wizard_finish_cb): Don't set enabled here. - -2003-01-10 Jeffrey Stedfast <fejj@ximian.com> - - * folder-browser.c (hide_deleted_changed): New callback for when - the HideDeleted state changes. - (folder_browser_gui_init): Listen for changes to hide_deleted so - we can update the menu state. - (folder_browser_destroy): Remove the hide_deleted notify handler. - (folder_browser_toggle_hide_deleted): When saving the setting, - remember that it is !atoi (state) rather than atoi (state) because - show vs hide. yea. - - * mail-session.c (main_get_filter_driver): notify-type is a int, - not a bool. Duh. - -2003-01-10 Jeffrey Stedfast <fejj@ximian.com> - - * component-factory.c (factory): Updated for function rename. - - * mail-config-factory.c (mail_config_control_factory_cb): - Namespaced the function name. - - * folder-browser-ui.c (folder_browser_ui_add_global): Don't add - the listener for show_preview here, it was moved into - folder-browser.c so we could detach the listener when the - folder-browser is destroyed. Also prevents a listener being added - multiple times (which was possible? before). - - * folder-browser.c (folder_browser_destroy): Remove the gconf - notify handler for show_preview. - (show_preview_changed): Moved here from folder-browser-ui.c - - * component-factory.c (storage_remove_folder): Fixed a situation - in which we could notify the shell listener twice. - -2003-01-10 Not Zed <NotZed@Ximian.com> - - * folder-browser.c (folder_browser_gui_init): Save the paned_size - notify handle. - (folder_browser_destroy): Remove gconf notify handler. - -2003-01-09 Chris Toshok <toshok@ximian.com> - - * mail-config-druid.c (wizard_finish_cb): enable the account - before attempting to saving it. - - * mail-accounts.c (account_delete_clicked): need to show the - buttons added to the dialog. - -2003-01-10 Not Zed <NotZed@Ximian.com> - - * mail-config.glade: Remove info.png from a couple of images, the - image is set via code at runtime. Removes some annoying runtime - warnings. - - * mail-send-recv.c (dialogue_response): dont unref the dialogue. - (dialog_destroy_cb): null out the send_recv_dialogue after destroy. - (build_dialogue): show the stop button - -2003-01-09 Chris Toshok <toshok@ximian.com> - - * folder-info.c (evolution_folder_info_notify_ready): pass bag to - bonobo_pbclient_set_boolean. - -2003-01-09 Ettore Perazzoli <ettore@ximian.com> - - * component-factory.c (owner_set_cb): Don't call - mail_config_register_factory() or - evolution_mail_config_wizard_init(). - -2003-01-09 Not Zed <NotZed@Ximian.com> - - * mail-config-druid.c: Added druidpagestart1 to the pages list. - (construct): Change the limits on the page initialisation, and - widget_show_all on the page rather than the content. - - * GNOME_Evolution_Mail.server.in.in: Make Mail a shlib component. - - * folder-info.c (evolution_folder_info_factory_init): Removed. - (evolution_folder_info_factory_fn): renamed to evolution_folder_info_new(). - - * mail-config-druid.c (evolution_mail_config_wizard_factory_fn): - Renamed to evolution_mail_config_wizard_new(). - (evolution_mail_config_wizard_init): Removed. - - * mail-config-factory.c (mail_config_register_factory): Remove. - (config_control_factory_cb): make this public. - - * Makefile.am: setup evolution-mail as a shared library. - - * component-factory.c (make_factory): implement the bonobo-plugin - factory for shlib operation. Also, preliminary work to setup mailer-specific - (factory): Implement the factory which starts various components. - - * mail-config.c (xml_get_prop): g_free->xmlFree - (account_to_xml): copy xml memory to glib memory when adding the 0 - on the end of the string. - (accounts_save): Use slightly different logic with appending to - the tail of the list, we can't use the &node trick with gslists. - (accounts_changed): Same here. - -2003-01-08 Ettore Perazzoli <ettore@ximian.com> - - * Makefile.am: Images are now in $(datadir)/evolution/images - instead of $(datadir)/images/evolution. - -2003-01-08 Jeffrey Stedfast <fejj@ximian.com> - - * folder-browser-ui.c (folder_browser_ui_add_global): Call - folder_browser_set_message_preview(). - - * mail-config.c (mail_config_get_show_preview): Removed. - (mail_config_set_show_preview): Removed. - - * folder-browser.c (folder_browser_toggle_preview): Simply set the - gconf show_preview setting and let the code in folder-browser-ui.c - detect it and update the UI. - - * folder-browser-ui.c (folder_browser_ui_add_global): Listen for - changed events on the show_preview setting. - - * mail-config.c (mail_config_set_default_account): Save the - setting via gconf. - (mail_config_add_account): Immediately save the list of accounts. - (mail_config_remove_account): Same. - (mail_config_signature_run_script): g_free the charset value and - use the composer's charset rather than the display charset. - (mail_config_get_default_account_num): Removed. - -2003-01-07 Jeffrey Stedfast <fejj@ximian.com> - - * folder-browser.c (save_cursor_pos): Use gconf to get the paned - size. - (folder_browser_set_message_preview): Same. - (folder_browser_toggle_hide_deleted): Use gconf to set the - hide-deleted state. - (folder_browser_set_message_display_style): Same but for the - message_display_style. - (fb_resize_cb): Save the paned_size via gconf. - (paned_size_changed): Callback for when the paned_size gets - changed. Change the folder-browser's paned size to the new - setting. - (folder_browser_gui_init): Listen to changes to the paned_size and - also get the initial size from gconf. - - * message-list.c (message_list_set_folder): Use gconf. - (regen_list_regen): Use gconf. - - * message-browser.c (transfer_msg_done): Use gconf to get the - hide_deleted setting. - - * mail-account-gui.c (sig_add_new_signature): Use gconf. - - * folder-browser-ui.c (folder_browser_ui_add_list): Use gconf. - - * folder-browser.c (save_cursor_pos): Use gconf. - (folder_browser_set_message_preview): Same. - (folder_browser_toggle_hide_deleted): Here too. - (folder_browser_set_message_display_style): And here. - (folder_browser_gui_init): Here too. - (done_message_selected): And here. - - * mail-config.c (mail_config_get_thread_subject): Removed. - (mail_config_set_thread_subject): Removed. - (mail_config_get_empty_trash_on_exit): Removed. - (mail_config_set_empty_trash_on_exit): Removed. - (mail_config_get_last_filesel_dir): Removed. - (mail_config_set_last_filesel_dir): Removed. - (mail_config_get_hide_deleted): Removed. - (mail_config_set_hide_deleted): Removed. - (mail_config_get_paned_size): Removed. - (mail_config_set_paned_size): Removed. - (mail_config_get_send_html): Removed. - (mail_config_set_send_html): Removed. - (mail_config_get_confirm_unwanted_html): Removed. - (mail_config_set_confirm_unwanted_html): Removed. - (mail_config_get_citation_highlight): Removed. - (mail_config_set_citation_highlight): Removed. - (mail_config_get_citation_color): Removed. - (mail_config_set_citation_color): Removed. - (mail_config_get_do_seen_timeout): Removed. - (mail_config_set_do_seen_timeout): Removed. - (mail_config_get_mark_as_seen_timeout): Removed. - (mail_config_set_mark_as_seen_timeout): Removed. - (mail_config_get_prompt_empty_subject): Removed. - (mail_config_set_prompt_empty_subject): Removed. - (mail_config_get_prompt_only_bcc): Removed. - (mail_config_set_prompt_only_bcc): Removed. - (mail_config_get_confirm_expunge): Removed. - (mail_config_set_confirm_expunge): Removed. - (mail_config_get_confirm_goto_next_folder): Removed. - (mail_config_set_confirm_goto_next_folder): Removed. - (mail_config_get_goto_next_folder): Removed. - (mail_config_set_goto_next_folder): Removed. - (mail_config_get_http_mode): Removed. - (mail_config_set_http_mode): Removed. - (mail_config_get_default_forward_style): Removed. - (mail_config_set_default_forward_style): Removed. - (mail_config_get_default_reply_style): Removed. - (mail_config_set_default_reply_style): Removed. - (mail_config_get_message_display_style): Removed. - (mail_config_set_message_display_style): Removed. - (mail_config_get_default_charset): Removed. - (mail_config_set_default_charset): Removed. - (mail_config_get_x_mailer_display_style): Removed. - (mail_config_set_x_mailer_display_style): Removed. - - * subscribe-dialog.c (populate_store_list): Use the list of - accounts. We can't get the list of sources anymore. - (populate_store_foreach): Updated. - - * mail-callbacks.c (guess_me_from_accounts): Use account->enabled. - (mail_generate_reply): Same. - (empty_trash): Here too. - - * mail-accounts.c (account_delete_clicked): Use account->enabled - rather than source->enabled. - (account_able_clicked): Same. - (account_cursor_change): Here too. - (mail_accounts_load): And here. - - * component-factory.c (owner_unset_cb): Use gconf empty-on-exit - settings. - (mail_load_storages): Use account->enabled rather than - account->source->enabled. The struct changed. - - * mail-composer-prefs.c (sig_add): Get the send_html pref from gconf. - - * message-tag-followup.c (target_date_new): Use gconf. - - * mail-config.c (mail_config_get_week_start_day): Removed. - - * mail-tools.c (mail_tool_quote_message): Use gconf here too, but - we don't need to parse the colour - just use it as a raw string. - (mail_tool_forward_message): Use gconf. - - * mail-format.c (mail_format_data_wrapper_write_to_stream): Use gconf. - (write_headers): Use gconf. - (handle_text_plain): Same. - - * mail-display.c (mail_text_write): Updated to use gconf and parse - GdkColour strings. - (on_url_requested): Updated to use gconf. - - * mail-callbacks.c (ask_confirm_for_unwanted_html_mail): Use gconf - rather than the old mail-config APIs which will be removed. - (ask_confirm_for_empty_subject): Same. - (ask_confirm_for_only_bcc): Here too. - (composer_get_message): And here. - (create_msg_composer): Same. - (transfer_msg_done): Again here. - (delete_msg): Here too. - (confirm_expunge): And finally here. - - * mail-config.c (mail_config_write): Use gconf. - (mail_config_get_sources): Removed. - - * mail-account-gui.c (mail_account_gui_save): No need to save - enabled-state anymore for a source. - - * mail-config-druid.c (wizard_finish_cb): Instead of setting - account->source->enabled to TRUE, just set account->enabled to - TRUE. The structures changed a bit. - - * mail-send-recv.c (mail_send_receive): Get the list of accounts - instead of sources, and pass them along to build_dialogue. I'm - trying to get rid of the mail_config_get_sources() api. - (mail_autoreceive_setup): Here too. - - * mail-config.c (mail_config_get_filter_log): Removed. - (mail_config_set_filter_log): Removed. - (mail_config_get_filter_log_path): Removed. - (mail_config_set_filter_log_path): Removed. - (mail_config_get_new_mail_notify): Removed. - (mail_config_set_new_mail_notify): Removed. - (mail_config_get_new_mail_notify_sound_file): Removed. - (mail_config_set_new_mail_notify_sound_file): Removed. - - * mail-session.c (main_get_filter_driver): Updated to use the - gconf settings. - -2003-01-07 Dan Winship <danw@ximian.com> - - * mail-account-gui.c (mail_account_gui_auto_detect_extra_conf, - mail_account_gui_build_extra_conf): Don't translate the conf - strings. Camel already did it. - -2003-01-06 Dan Winship <danw@ximian.com> - - * Makefile.am: remove idldir definition. (It's defined in - configure.in now) - -2003-01-04 Jeffrey Stedfast <fejj@ximian.com> - - * mail-callbacks.c (composer_get_message): Use - e_destination_get_email() instead of e_destination_get_address() - when checking that we have a list of valid recipients to send the - message to because get_email() returns the addr-spec portion of - the address, which is what we care about. if that doesn't exist, - then the address is useless. This does all we can do mailer-side - for the recent "SMTP Problem" thread. - -2003-01-03 Jeffrey Stedfast <fejj@ximian.com> - - * mail-display.c: Fixed some build issues. - - * mail-search.c: Same. - - * mail-callbacks.c (save_draft_done): Use - g_signal_handlers_disconnect_by_func(). - (manage_subscriptions): Use a weak_ref instead of connecting to - the destroy event. - -2002-12-17 Jeffrey Stedfast <fejj@ximian.com> - - ...And a whole bunch more build fixes. - - * mail-vfolder.c (mail_vfolder_delete_uri): Don't use - g_string_sprintfa() anymore since it is apparently deprecated. - - * mail-session.c (main_get_filter_driver): Don't use - g_string_sprintfa() anymore since it is apparently deprecated. - - * mail-ops.c (build_from): Don't use g_string_sprintfa() anymore - since it is apparently deprecated. - - * mail-callbacks.c (ask_confirm_for_unwanted_html_mail): Don't use - g_string_sprintfa() anymore since it is apparently deprecated. - - * mail-autofilter.c: Don't use g_string_sprintfa() anymore since - it is apparently deprecated. - - * folder-browser.c: Don't use g_string_sprintfa() anymore since it - is apparently deprecated. - - * mail-search.c (mail_search_set_subject): Remove the unnecessary - g_strdup()'age as well as fix a possible buffer overrun. - - * mail-local.c (mail_local_folder_construct): Use - g_path_get_basename(). - - * mail-config-druid.c (make_account): Don't use e_utf8_* - functions. - -2002-12-16 Jeffrey Stedfast <fejj@ximian.com> - - * mail-format.c #define a STANDARD_ISSUE_TABLE_OPEN string used - for wrapping textual message parts to keep them being fully-left - justified. - (mail_format_raw_message): Wrap the content with a table so that - text isn't fully left-justified. - (write_hr): Use it here too. - (handle_text_plain): And finally here. - -2002-12-16 Jeffrey Stedfast <fejj@ximian.com> - - * mail-display.c (mail_error_printf): Use camel_text_to_html() - instead of e_text_to_html(). - (mail_text_write): Write the content directly to gtkhtml through - an html stream filter. - - * mail-format.c (attachment_header): Use camel_text_to_html() - instead of e_text_to_html(). - (write_text_header): Same. - (write_address): Here too. - (mail_get_message_rfc822): And here. - (mail_get_message_body): And finally here. - -2002-12-16 Jeffrey Stedfast <fejj@ximian.com> - - * mail-format.c (handle_text_plain): Re-implemented to use - streams. Also no need to check for html since - camel-mime-part-utils.c now does this for us and will re-tag the - mime-type as text/html thus the UI can be completely ignorant of - this process. - (handle_text_plain_flowed): Removed. - (write_one_text_plain_chunk): Removed. - (try_uudecoding): Removed. - (try_inline_binhex): Removed. - (handle_text_enriched): Re-implemented to use streams too. - -2002-12-15 Jeffrey Stedfast <fejj@ximian.com> - - * mail-format.c (write_text_header): Change the order of the args - to be consistant with other write functions. - (write_date): Same. - (write_field_row_begin): Here too. - (write_headers): Here too. - (write_one_text_plain_chunk): Don't strdup just to pass it to - mail_text_write() so that it can dup it yet again into html text - and dup it yet a 3rd time into a GByteArray. Instead just write it - to gtkhtml. - (handle_*): Fixed arguments to take a MailDisplayStream instead of - a GtkHTML widget and a GtkHMLStream. - - * mail-display.c (mail_display_render): Create a MailDisplayStream - to pass to mail_format_mime_message() and - mail_format_raw_message(). - - * mail-display-stream.[c,h]: New stream to replace - mail-stream-gtkhtml.c - - * mail-stream-gtkhtml.[c,h]: Removed. - -2002-12-13 Jeffrey Stedfast <fejj@ximian.com> - - * mail-callbacks.c (check_send_configuration): Make sure the - folder-browser is not NULL or we'll crash. - - * mail-preferences.c (mail_preferences_construct): Fix the colour - code to get a guint32 rgb correctly (I think - can't test because - the shell keeps crashing, yay). - - * message-tag-followup.c (construct): Don't re-use cell renderers - - I'm not sure this is actually safe to do. - - * mail-session.c: Get rid of unneeded CamelObject casts. - (user_message_response): Don't unref the dialog object after we've - destroyed it. - - * mail-display.c (write_data_to_file): Don't unref the dialog - object after we've destroyed it. - - * mail-callbacks.c: Same here. - - * component-factory.c: Here too. - - * message-tag-editor.c: Added MESSAGE_TAG_EDITOR_GET_CLASS macros. - -2002-12-12 Jeffrey Stedfast <fejj@ximian.com> - - * mail-accounts.c (mail_accounts_tab_construct): Setup - double-click here. - -2002-12-12 Jeffrey Stedfast <fejj@ximian.com> - - * mail-accounts.c (account_delete_clicked): Get rid of the ETable - #ifdef's - we won't ever be using ETable. - (account_default_clicked): Same. - (account_able_clicked): Here too. - (mail_accounts_load): And here. - (mail_accounts_treeview_new): Renamed from etable_new since we - won't ever be using an etable. - (mail_accounts_tab_construct): And finally here. - -2002-12-12 Not Zed <NotZed@Ximian.com> - - * folder-browser.c (my_folder_browser_init): cast a-warning a-way. - - * mail-composer-prefs.c (spell_setup): Terminate list_store_set - with -1. - - * mail-accounts.c (mail_accounts_etable_new): clist -> gtktreeview - stuff. Yes, this is not an etable. - (mail_accounts_tab_construct): Same. - (mail_accounts_load): Same. - (account_cursor_change): Same. - (account_able_clicked): And this. - (account_default_clicked): Same. - (account_delete_clicked): Guess? - (account_edit_clicked): And here too. - -2002-12-11 Jeffrey Stedfast <fejj@ximian.com> - - * mail-format.c (mail_format_data_wrapper_write_to_stream): New - function to handle a lot of the filtering/etc that was done in - mail_format_get_data_wrapper_text(). This is the first step toward - getting rid of e-text-to-html crap and using my tohtml stream - filter instead. - (mail_format_get_data_wrapper_text): Use the new function. - (mail_format_raw_message): Use camel streams to write the content - to gtkhtml rather than using get_data_wrapper_text() and then - converting that to html and then writing it to the gtkhtml stream. - -2002-12-10 Not Zed <NotZed@Ximian.com> - - * mail-composer-prefs.c (mail_composer_prefs_construct): language - is a treeview now. Not sure what to do with it yet, but get rid - of one warning anyway. - (mail_composer_prefs_construct): Same for sig_clist, but setup - model. - (sig_fill_clist): Change to use a gtktreeview instead of a clist. - (sig_selection_changed): New method to handle signature selection - changes with the new widgets. - (sig_delete): clist -> treeview. - (mail_composer_prefs_new_signature): Same. - (sig_edit): ditto. - (sig_current_sig): removed. - (sig_row_unselect): Removed. - (sig_row_select): Removed, now redundant. - (spell_select_lang): Removed, redundant. - (spell_set_ui_language): New implementation using list model more - effectively. - (spell_get_language_str): Same here. - (spell_set_ui_language): Removed this too, merged into - spell_set_ui, it was just wasting stack space. - (spell_language_selection_changed): renemd from - spell_language_select_row, converted to gtktreeview, etc. - (spell_language_unselect_row): Removed. - (spell_language_enable): Redone to use tree model. - (spell_language_button_press): Removed, i dont think this is - needed anymore. - (spell_setup): dont hook onto redundant signals. - - * mail-config-factory.c (config_control_factory_cb): ignore - mail-font-prefs in a different way (so we dont assert) - -2002-12-09 Chris Toshok <toshok@ximian.com> - - * mail-session.c (pass_response): pass "Mail" to e_passwords_*. - (do_get_pass): same. - (main_forget_password): same. - (mail_session_get_password): same. - (mail_session_remember_password): same. - (mail_session_forget_password): same. - - * mail-config.c (mail_config_write_on_exit): pass "Mail" to - e_passwords_*. - - * main.c (main): e_passwords_init is gone. - -2002-12-03 Jeffrey Stedfast <fejj@ximian.com> - - * mail-callbacks.c (guess_me_from_accounts): Use the same logic as - mail_generate_reply(). Fixes bug #34882 - - Fixes bug #34315 - - * component-factory.c (message_rfc822_dnd): Return TRUE if we - successfully handled all messages in the mbox stream, or FALSE - otherwise. - (destination_folder_handle_drop): For TEXT_URI_LIST, use the - retval from message_rfc822_dnd() rather than relying on an - exception, because one will not always necessarily be set. For - MESSAGE_RFC822, also use the retval from message_rfc822_dnd(). - -2002-12-03 Not Zed <NotZed@Ximian.com> - - * folder-browser.c (folder_browser_finalise/destroy): frobbed - around with these till it exits without crashing. - - * message-list.c (message_list_destroy): made a destroy - handler again (was dispose). Frobbed around with this and - finalise till it can destroy without crashing. - - * message-browser.c (message_browser_new): ref/sink the - folderbrowser. - -2002-11-25 Radek Doulik <rodo@ximian.com> - - * mail-preferences.c (mail_preferences_construct): magic_check --> - magic_links_check - -2002-11-27 Not Zed <NotZed@Ximian.com> - - * message-tag-followup.c (construct): gnome_pixmap -> gtkimage. - (construct): gtk_clist -> gtk_tree_view, setup columns. They dont - size well :-/ - (message_tag_followup_append_message): Append using model, remove - clist stuff. - (construct): Show date edit (glade bugs?) - - * folder-browser.c (folder_browser_class_init): gtk_marshal -> g_cclosure_marshal - (setup_popup_icons): gnome_pixmap -> gtk_image. - (on_right_click): gtk_pixmap -> gtk_image. - - * mail-accounts.c (account_delete_clicked): removed #if 0'd out code. - - * mail-send-recv.c (receive_done): remove FIXME and extra unref. - - * mail-session.c (request_password): Removed #if 0'd out stuff. - - * mail-vfolder.c (new_rule_clicked): proper cast for g_object_get_data. - - * mail-local.c (reconfigure_response): cast for g_object_get_data. - - * mail-account-editor.c (construct): GNOME_DIALOG -> GTK_DIALOG. - - * *.[ch]: re-ran fix.sh for e_notice change - - * mail-callbacks.c (save_msg_ok): g_object_get_data + - gtk_object_remove_no_notify -> g_object_steal_data. - (find_socket): gtk_container_children -> - gtk_container_get_children - (edit_msg): gnome_*_dialog -> gtk_message_dialog. - (resent_msg): " - (search_msg): " - (confirm_goto_next_folder): gtkmessagedialogised (even if not - used). - (confirm_expunge): gtkmessagedialogised - (filter_edit): " - (do_mail_print): e_notice -> gtk_message_dialog. - (are_you_sure): removed e_gnome_ok_cancel_dialog crap, replaced - with a gtk dialog. - (are_you_sure): gtkmessagedialogised. - (edit_msg_internal): Dont free uids array, are_you_sure() free's - it. - (resend_msg): Same. - (check_send_configuration): Use e_notice for stuff. Sigh, here we - go again ...! - (e_question): A utility function to ask a question, potentially - with 'dont ask again' as well. - (configure_mail): use e_question to save code. Here we go again, - again ... - (ask_confirm_for_unwanted_html_mail): " - (ask_confirm_for_only_bcc): " - (ask_confirm_for_only_bcc): " - (composer_get_message): Use e_notice. - (composer_save_draft_cb): Use e_question - (edit_msg): use e_notice, & change to an ERROR. - (resend_msg): same. - (save_msg_ok): Properly initialise ret to OK, and use e_question, - and use access() to determine existance/write access rather than - stat, display an error if we can't write to a file that exists, - and print the filename in all dialogues. - (confirm_goto_next_folder): Use e_question. - (confirm_expunge): use e_question. - (filter_edit): Use e_notice. - (do_mail_print): use e_notice. - -2002-11-26 Not Zed <NotZed@Ximian.com> - - * mail-vfolder.c (vfolder_gui_add_rule): clicked->response signal - for gtk dialogue. - (new_rule_clicked): Dont unref after destroy (duh, idiot again). - (edit_rule_response): Same here. - (mail_vfolder_delete_uri): Connect response signal to - gtk_widget_destroy directrly using g_signal_connect_swapped. - (close_dialogue): Removed, as no longer needed. - - * message-list.c (get_normalised_string): Duh idiot, "un-fixed" - the memleak i added. - - * mail-callbacks.c (composer_get_message): Set parent window in - message dialogue & DESTROY_WITH_PARENT flag. - (composer_save_draft_cb): - (configure_mail): - (check_send_configuration): Add DESTROY_WITH_PARENT flag to - gtk_message_dialog's - (local_configure_done): remove some unecessary/wrong casts. - (empty_trash_expunged_cb): " - (do_mail_print): use gtk_window_set_transient_for instead of - e_dialog_set_parent. - -2002-11-26 Not Zed <NotZed@Ximian.com> - - * mail-account-editor.c (mail_account_editor_new): - gtk_widget_set_parent_window -> gtk_window_set_transient_for. - - * mail-callbacks.c (composer_send_queued_cb): dont unref composer. - - * message-browser.c (message_browser_destroy): moved back from - finalise. - -2002-11-25 Not Zed <NotZed@Ximian.com> - - * message-list.c (message_list_dispose): move saving tree state - here. - (message_list_finalise): And take it from here. - - * mail-display.c (mail_display_destroy): @#$@# gtk. changed this - around a bit. - (mail_display_init): Fix prototype, its a gobject. - (mail_display_init): ref/sink the invisible gtkobject. - -2002-11-22 Not Zed <NotZed@Ximian.com> - - * mail-callbacks.c (ask_confirm_for_unwanted_html_mail): removed - e_messagebox, and use gtk_message_dialog directly. - (ask_confirm_for_empty_subject): and here. - (ask_confirm_for_only_bcc): And here too. - (msgbox_destroy_cb): Removed, since no longer needed. - -2002-11-15 Harry Lu <harry.lu@sun.com> - - * mail-display.c (write_data_to_file): Show file name when prompt - to user for overwrite. Fixes bug #34180. - -2002-11-21 Harry Lu <harry.lu@sun.com> - - * mail-display.c (do_attachment_header): Enable dragging of all - attachments. For bug #34327. - -2002-11-21 Jeffrey Stedfast <fejj@ximian.com> - - * mail-preferences.c (mail_preferences_construct): Since the - GSList returned from gconf needs to be free'd by us, we don't need - to strdup the values. Also make sure we don't leak the GSList - itself. - (mail_preferences_apply): Don't leak our GSList data. - -2002-08-30 Radek Doulik <rodo@ximian.com> - - * mail-display.c (mail_display_render): don't set margins for raw - message view - - * mail-format.c (mail_format_raw_message): as below - (handle_text_plain_flowed): as below - (mail_format_raw_message): don't use data_urls - - * mail-display.c (mail_text_write): put text in iframe, so it has - margins and should not be placed in table which changes wrapping - behavior - -2002-11-20 Jeffrey Stedfast <fejj@ximian.com> - - * mail-composer-prefs.c (mail_composer_prefs_construct): gconfify. - (mail_composer_prefs_apply): gconfify this also. - - * mail-preferences.c (mail_preferences_construct): - gconf_client_get_string() probably returns an allocated buffer. - -2002-11-20 Not Zed <NotZed@Ximian.com> - - * importers/Makefile.am (%.server.in): provide a proper implicit - rule for building .server.in from .server.in.in. The other one - just copied the first target to all destinations(!). - - * importers/evolution-outlook-importer.c (outlook_factory_fn): - destroy -> weak ref. - -2002-11-19 Jeffrey Stedfast <fejj@ximian.com> - - * mail-preferences.c (mail_preferences_apply): Save the settings - via gconf. - (mail_preferences_construct): Load the values from gconf. - -2002-11-19 Radek Doulik <rodo@ximian.com> - - * mail-composer-prefs.c (sig_load_preview): use - gtk_html_begin_content to specify utf-8 - -2002-11-19 Not Zed <NotZed@Ximian.com> - - * importers/evolution-mbox-importer.c (mail_importer_module_init): - fix warning message, outlook->mbox. - - * importers/Makefile.am: fix serverdir to point to - $libdir/bonobo/servers. - - * mail-callbacks.c (addrbook_sender): add type to - bonobo_widget_set_property. - - * mail-vfolder.c (vfolder_editor_response): dont unref after destroy. - - * mail-session.c (pass_response): dont unref aftrer destroy. - - * mail-local.c (reconfigure_response): dont unref after destroy. - - * mail-display.c (launch_cb): dont unref after destroy. - (launch_cb): " - (drag_data_get_cb): " - (html_button_press_event): add type to bonobo_widget::set_property - - * mail-config.c (mail_config_check_service): dont unref after - destroy. - - * component-factory.c (send_receive_cb): dont unref after destroy. - (request_quit): " - - * mail-signature-editor.c (mail_signature_editor): Use version 3.0 - of gtkhtml editor interfaces. - (do_exit): dont unref after destroy. - (format_html_cb): Add type to bonobo_widget::set_property. - -2002-11-18 Radek Doulik <rodo@ximian.com> - - * mail-composer-prefs.c (spell_setup_check_options): check - exception state and take care when exception raised - -2002-11-18 Jeffrey Stedfast <fejj@ximian.com> - - * mail-accounts.c (mail_accounts_load): Specify the default - account. Also, don't need to use e_utf8_to_gtk_string() here. - -2002-11-18 Not Zed <NotZed@Ximian.com> - - * Makefile.am (evolution_mail_LDADD): Added back - libevolution-importer stuff. - (SUBDIRS): Added back importers. - - * importers/evolution-mbox-importer.c (load_file_fn): build the - uri without deprecated funcs. - (load_file_fn): dont free/alloc a camel_exception for no obvious - purpose. - (mbox_factory_fn): use weak_ref rather than destroy. - (importer_destroy_cb): fix signature for weak ref notify. - (mbox_factory_fn): add cid param. - - * importers/*.[ch]: ran fix script over everything. - - * importers/*.server.in.in: Added bonobo activation files. Moved - evolution-mail to @LIBEXEC@ as below. - - * importers/Makefile.am: oaf->bonobo activation stuff. - - * importers/evolution-outlook-importer.c (outlook_factory_fn): Add - component id to callback. - -2002-11-15 Ettore Perazzoli <ettore@ximian.com> - - * Makefile.am: Add rules to substitute @LIBEXEC@ in - GNOME_Evolution_Mail.server.in.in and install evolution-mail in - $(libexecdir) instead of $(bindir). - - * GNOME_Evolution_Mail.server.in.in: Replaced evolution-mail with - @LIBEXECDIR@/evolution-mail. - -2002-11-15 Rodney Dawes <dobey@ximian.com> - - * component-factory.c: Use bonobo_main_quit instead of gtk - -2002-11-15 Jeffrey Stedfast <fejj@ximian.com> - - * mail-composer-prefs.c (sig_edit): Correctly spell Advanced. - -2002-11-15 Not Zed <NotZed@Ximian.com> - - * mail-summary.c (create_summary_view): weak notify -> ref. - - * mail-send-recv.c (build_dialogue): weak notify -> ref. - - * mail-accounts.c (account_edit_clicked): weak notify -> ref, i - presume this is what jeff meant, 'cause it dont compile otherwise. - -2002-11-14 Jeffrey Stedfast <fejj@ximian.com> - - * mail-accounts.c (account_edit_clicked): Use g_object_weak_ref - rather than connecting to destroy. - (account_add_clicked): Same. - - * mail-callbacks.c (addrbook_sender): Make this use - g_object_weak_notify also. - (subscribe_dialog_destroy): Add NULL guards here since I think we - really do want to connect to the "destroy" signal in the function - that connects us to that signal. - - * mail-config-factory.c (config_control_factory_cb): Same. - - * mail-display.c (save_part): Here too. - (make_popup_window): And here. - - * mail-send-recv.c (build_dialogue): Same here. - - * mail-summary.c (create_summary_view): Use g_object_weak_notify - instead of connecting to the destroy signal. - -2002-11-14 Ettore Perazzoli <ettore@ximian.com> - - * component-factory.c (owner_set_cb): Want a (GWeakNotify) cast - here, not (GWeakNotify *). - - * subscribe-dialog.c (fete_init): g_object_set() instead of - gtk_object_set(). - (populate_store_list): Likewise. - (menu_item_selected): g_object_get_data() instead of - gtk_object_get_data(). - - * message-list.c (message_list_create_extras): g_object_set() - instead of gtk_object_set(). - - * message-browser.c (message_browser_message_list_built): - g_object_get_data() instead of gtk_object_get_data(). - - * mail-vfolder.c (edit_rule_response): g_object_get_data() instead - of gtk_object_get_data(). - - * mail-summary.c (generate_folder_summaries): g_object_unref() the - context instead of gtk_object_destroy(). - - * mail-local.c (reconfigure_response): g_object_get_data() instead - of gtk_object_get_data(). - - * mail-display.c (pixbuf_gen_idle): g_object_unref() the GdkPixbuf - loader instead of gtk_object_destroy(). - (pixbuf_gen_idle): Likewise. - (embeddable_destroy_cb): Likewise. - - * mail-config-druid.c (mail_config_druid_destroy): No need to - gtk_object_destroy() the GladeXML object. - (construct): g_object_set() instead of gtk_object_set(). - - * folder-browser.c (folder_browser_gui_init): g_object_get_data() - instead of gtk_object_get_data(). - -2002-11-14 Not Zed <NotZed@Ximian.com> - - * component-factory.c (create_view): shell client objref. - (mail_add_storage): " - (mail_remove_storage): " - -2002-11-13 Joe Shaw <joe@ximian.com> - - * Makefile.am: Remove a couple backslashes that were causing - automake to complain, even though they were on lines that were - -commented out-. Sigh. - -2002-11-13 Ettore Perazzoli <ettore@ximian.com> - - * folder-info.c (evolution_folder_info_factory_fn): Use - g_object_new() instead of gtk_type_new(). - * folder-browser.c (folder_browser_new): Likewise. - * mail-account-gui.c - (mail_account_gui_folder_selector_button_new): Likewise. - * mail-font-prefs.c (mail_font_prefs_new): Likewise. - -2002-11-13 Ettore Perazzoli <ettore@ximian.com> - - * mail-format.c: Do not #include <libgnome/gnome-defs.h>. - * mail-importer.c: Likewise. - * mail-mt.c: Likewise. - * mail-ops.c: Likewise. - * mail-search-dialogue.c: Likewise. - * mail-session.c: Likewise. - * mail-vfolder.c: Likewise. - * message-tag-followup.c: Likewise. - * main.c: Likewise, and <libgnomeui/gnome-init.h>. - - * mail-callbacks.c: Do not #include <libgnome/gnome-paper.h>. - (do_mail_print): Remove the GnomePaper local variable. - -2002-11-13 Not Zed <NotZed@Ximian.com> - - * component-factory.c (owner_set_cb): destroy->weak ref. - (owner_set_cb): shell client changes. - - * mail-signature-editor.c (mail_signature_editor): bonobo api changes. - - * mail-local.c (save_metainfo): go back to using xmlSaveFile. - - * Makefile.am: Removed libevolution-importer from mail. - -2002-11-13 Not Zed <NotZed@Ximian.com> - - * GNOME_Evolution_Mail.server.in.in: Added to cvs. Currently - contains no configurable stuff, but maybe it will one day. - - * Makefile.am (server_DATA): change oaf stuff to server stuff for - bonobo activation. - - * mail-preferences.c (mail_preferences_apply): handle const entry text. - - * mail-composer-prefs.c (url_requested): Fixed typo. - (mail_composer_prefs_construct): gnomepixmap->gtkimage. - - * mail-callbacks.c (configure_mail): destroy dialogue before dealing - with response. - (mail_generate_reply): Fix a typo. - (popup_listener_cb): fix prototype. - (tag_editor_response): Handle gtk dialog response. - (flag_for_followup): Change gnome dialog to gtk dialog stuff. - (tag_editor_destroy_cb): - (tag_editor_cancel): - (tag_editor_ok): Removed, handled in _response(). - (filter_editor_response): renamed from _clicked, handle gtk - dialogue signal. - (filter_editor_destroy): Removed. - (footer_info_new): gnome font api changes. - (do_mail_print): port to gnome print 2. - - * mail-autofilter.c (mail_filter_delete_uri): message_dialog uses - a specific button enum, not the stock ones. - - * mail-accounts.c (mail_accounts_tab_get_type): gobjectify. - (account_delete_clicked): gdkdialogise. - - * mail-account-gui.c (mail_account_gui_setup): Hack around font - metric determination code. - - * mail-account-editor.c (mail_account_editor_get_type): - gobjectise. - (mail_account_editor_new): "" - - * folder-info.c (evolution_folder_info_notify_ready): use pbclient - interface. - - * folder-browser-factory.c (control_destroy_cb): fix a typo. - (folder_browser_factory_new_control): More typos. - - * folder-browser.c (on_right_click): cast around const warning. - (context_menu_position_func): fix for api change. - - * e-searching-tokenizer.c (e_searching_tokenizer_finalise): - Changed from destroy since it only frees memory. - (e_searching_tokenizer_get_type): glibify. - - * component-factory.c (request_quit): gtkdialogise. - (send_receive_cb): " - (create_component): gdk_pixbuf api. - (component_factory_init): bonobo activation stuff. - (warning_response): renamed from warning_clicked. - (owner_set_cb): gtkdialogise. - -2002-11-12 Jeffrey Stedfast <fejj@ximian.com> - - * Makefile.am: Added files I've ported. - - * mail-config.c: Remove gnome-defs.h, this header no longer exists - in GNOME2. - -2002-11-13 Not Zed <NotZed@Ximian.com> - - * Makefile.am: Commented out stuff that doesn't build yet. Also - fixed idl build rule. importers still not built. - - * main.c (main): bonobactivationise. remove push visual/colormap. - (main): no longer activate activation, let bonobo_init do it. - - * mail-signature-editor.c (menu_help): Change help api. - - * mail-session.c (user_message_destroy_noreply): removed. Not - used? - - * mail-local.c (load_metainfo): xml root->children. - - * mail-format.c (g_string_append_len): Removed, it exists now. - -2002-11-12 Not Zed <NotZed@Ximian.com> - - * subscribe-dialog.c: gnome2ised, use gtkdialog. - (subscribe_get_global_extras): use a weak ref rather than destroy - signal. - - * message-tag-followup.c: gnome2ised. - - * message-tag-editor.c: gnome2ised & converted to gtkdialog. - - * message-list.c: gnome2ised. - (message_list_finalise): From destroy method. maybe should be - destroy still. - - * message-browser.c: port to gnome2 - (message_browser_finalise): renamed from destroy method. - - * mail-stream-gtkhtml.c: removed redundant - camel_class_get_global_classfuncs() call. - - * mail-signature-editor.c: gtkdialogised, & bonobo api changes. - - - * mail-search-dialogue.c: gtkdialogised. - - * mail-folder-cache.c: cleaned up camel ref/hook casts. - - * mail-composer-prefs.c (mail_composer_prefs_get_type): convert to - gtype. - - * mail-font-prefs.c (mail_font_prefs_destroy): from finalise. - - * mail-config.c: s/bonobo_config/e_config_listener/ Added - /apps/Evolution prefix to the evolution keys. Changed to use - e_config_listener, etc. - (mail_config_init): remove bonobo_config stuff. - (mail_config_check_service): gtk dialogise. - (check_response): from check_cancelled. - - * mail-config-druid.c (mail_config_druid_destroy): renamed from - _finalize, turned into destroy handler. - (construct): set type to toplevel, GTK_WINDOW_DIALOG no longer - exists. - - * mail-config-factory.c (mail_config_register_factory): bonobo api - changes. - - * mail-crypto.c (mail_crypto_get_pgp_cipher_context): cleaned up - unref casts. - - * mail-display.c (write_data_to_file): gnome->gtkdialog. - (on_link_clicked): use ascii_str*cmp on url. - (save_part): g_path stuff. - (launch_cb): gtk dialog. - (pixmap_press): de-oafify. - (pixbuf_for_mime_type): gnome-vfs api changes. - (do_attachment_header): Change the pixmap to a gtkimage. - (do_signature): " - (pixbuf_gen_idle): " - (do_attachment_header): ascii_str*cmp - (do_attachment_header): gnome pixmap->gtkimage. - (mail_display_destroy): protect against gtk mentalness. - (html_button_press_event): ascii_str*cmp - (drag_data_get_cb): added comment for translators of filename. - - * mail-format.c (component_supports): de-oafise. - (is_anonymous): ascii_strncmp - (attachment_header): remove utf8<>locale stuff, and gnomevfs api - changes. - (format_mime_part): fix g_strdown call. - (write_field_row_begin): kill utf8->gtk stuff. - (write_address): " - (default_header_index): ascii_strcasecmp - (handle_text_plain): " - (handle_text_enriched): " - (handle_multipart_encrypted): remove utf/gtk stuff. - (handle_message_external_body): ascii_str*cmp - - * mail-identify.c (mail_identify_mime_part): - (identify_by_magic): gnome vfs api changes. - - * mail-importer.c: Converted. - - * mail-local.c (load_metainfo): xml childs -> children. - (mls_get_folder): g_strerror. - (mls_delete_folder): g_strerror. - (reconfigure_got_folder): Gnome->GtkDialog - (reconfigure_response): from reconfigure_clicked. - - * mail-mt.c (mail_msg_check_error): gnome -> gtk dialog - (error_response): renmae from error_gone. destroy widget on any - response. - - * mail-offline-handler.c (impl_finalise): renamed from - impl_destroy since thats what it should be anyway. - - * mail-ops.c: removed utf8 widget conversion & camel_object_un/ref - casts. - - * mail-preferences.c (mail_preferences_get_type): glib2'ised. - - * mail-search.c (mail_search_finalise): renmaed from destroy & - properly chain. - (mail_search_get_type): glib2 & make gtkdialog parent. - (entry_run_search): run search when entry activated. not sure if - gtkdialog has anohter way to do this on an arbitrary widget. - - * mail-send-recv.c (dialogue_response): renamed from clicked. Use - gtkdialog. - - * mail-session.c (request_password_deleted): removed, redundant. - (pass_response): rename from pass_got, changed for gtkdialog. - (user_message_destroy): Removed, redundant. - (user_message_response): Renamed from user_message_clicked. - -2002-11-11 Not Zed <NotZed@Ximian.com> - - * mail-stream-gtkhtml.c (mail_stream_gtkhtml_class_init): dont use - get_global_classfuncs, just get the type - - * mail-tools.c: converted gnome2 api's. - - * mail-vfolder.c (vfolder_editor_response): clicked->response. - (vfolder_editor_destroy): Removed. - (vfolder_edit): gtk dialog api - (edit_rule_response): clicked->response. - (vfolder_edit_rule): gnomedialog->gtkdialog. - (vfolder_gui_add_rule): " - (new_rule_clicked): clicked->response - -2002-11-11 Jeffrey Stedfast <fejj@ximian.com> - - * mail-callbacks.c: Half way ported. I'll finish the rest later. - - * mail-autofilter.c: Ported. - - * mail-account-gui.c: Ported. - - * mail-account-editor.c: Ported. - - * folder-browser-ui.c: Ported. - - * folder-browser-factory.c: Ported. - - * folder-browser.c: Ported. - - * e-searching-tokenizer.c: Roughly ported. - -2002-11-10 Jeffrey Stedfast <fejj@ximian.com> - - * *.glade: Converted to libglade-2's format. - -2002-11-08 Jeffrey Stedfast <fejj@ximian.com> - - * mail-composer-prefs.c: Ported. - -2002-10-28 Jeffrey Stedfast <fejj@ximian.com> - - * folder-browser.c (folder_browser_query_changed): No longer need - to check for a CLEAR_ID. - -2002-10-28 Larry Ewing <lewing@ximian.com> - - * mail-format.c (handle_multipart_mixed): instead of bailing with - an assertion dump the body. - -2002-10-27 Larry Ewing <lewing@ximian.com> - - * mail-display.c (fetch_next): don't queue the action until we've - added ourselves to the active list, because the fetch_done - callback can fire immediately and we'll end up queueing something - that has already been destroyed. - -2002-10-24 Jeffrey Stedfast <fejj@ximian.com> - - Update the upgrade script to handle the new url format introduced - with NotZed's most recent commits. - - * upgrade-mailer.c (mailer_upgrade): Save an encoded version of - the namespace too, for use later. - (si_free): Free the encoded namespace too. - (imap_url_upgrade): Use the encoded namespace when creating the - new url. - (shortcuts_upgrade_xml_file): Upgrade the default: urls. Fixes bug - #32127. - -2002-10-25 Not Zed <NotZed@Ximian.com> - - * mail-config.c (mail_config_uri_renamed): Always strdup the new - key in the threaded/preview hash/always free the working copy. - For #32799. - -2002-10-24 Jeffrey Stedfast <fejj@ximian.com> - - * mail-display.c (write_data_to_file): Use the mode 0666 when - creating a new file and let the user's umask handle permissions. - - * folder-browser.c (message_list_drag_data_get): When using open() - with the O_CREAT flag, we need to pass a mode argument. Also use - O_EXCL. - -2002-10-24 Not Zed <NotZed@Ximian.com> - - * subscribe-dialog.c (fe_got_children): Use a hashtable to only - insert nodes we dont have already, rather than relying on the - scanning logic. Also, only re-sort this tree level once done - rather than on each insert. - (folder_etree_init): Setup hash to track nodes setup. - (folder_etree_clear_tree): Reset hash. - (fe_destroy): Free hash. - -2002-10-23 Jeffrey Stedfast <fejj@ximian.com> - - * folder-browser.c (folder_browser_query_changed): Only perform - the search if it is either a clear or advanced search. - -2002-10-22 Mike Kestner <mkestner@ximian.com> - - * mail-callbacks.c (transfer_msg): pass fb->uri to the folder - selection dialog so the current folder is selected on display. - "fixes" 15966. - -2002-10-21 Dan Winship <danw@ximian.com> - - * upgrade-mailer.c (mailer_upgrade): Fix the transport URL on any - Exchange accounts. Fixes #30209, which is to say that it fixes - #28490 correctly. - -2002-10-17 Jeffrey Stedfast <fejj@ximian.com> - - * mail-tools.c (mail_tool_quote_message): Strip the signature from - the body-text. Fixes bug #5529. - -2002-10-16 Jeffrey Stedfast <fejj@ximian.com> - - * mail-format.c (handle_multipart_signed): Don't need to pass a - path to camel_gpg_context_new () anymore. - (mail_get_message_body): Same here. - (handle_multipart_encrypted): Use camel_gpg_context_new () instead - of mail_crypto_get_pgp_cipher_context (). - - * mail-preferences.c (mail_preferences_construct): There's no - security tab anymore. - (mail_preferences_apply): No need to save any pgp config data, - there's nothing to configure! - - * mail-crypto.c (mail_crypto_get_pgp_cipher_context): Updated to - not pass a pgp path into camel_gpg_context_new (). - - * mail-config.c (mail_config_clear): No need to free a pgp_path - variable anymore, we don't need one. - (config_read): Don't read in a pgp-path or pgp-type anymore. - (mail_config_write_on_exit): Don't save a pgp-path or pgp-type - anymore, we don't use them. - (pgpopen): Removed. - (pgpclose): Removed. - (mail_config_pgp_type_detect_from_path): Removed. - (auto_detect_pgp_variables): Removed. - (mail_config_get_pgp_type): Removed. - (mail_config_set_pgp_type): Removed. - (mail_config_get_pgp_path): Removed. - (mail_config_set_pgp_path): Removed. - -2002-10-16 Jeffrey Stedfast <fejj@ximian.com> - - * mail-callbacks.c (mail_generate_reply): If mode == REPLY_LIST - and the mlist is "" (we only checked NULL before), change the mode - to REPLY_ALL so that we don't accidently reply to the user's - address. Fixes bug #28735 - -2002-10-12 Jeffrey Stedfast <fejj@ximian.com> - - * mail-callbacks.c (mail_generate_reply): If we are trying to - reply to a list, first check that we can by getting the mlist - token (makes it easier to fix the mem leak). If not, then change - the mode to REPLY_ALL. If we can reply to list, the make sure we - free the CamelMessageInfo when we're done so we don't leak. - -2002-10-15 Jeffrey Stedfast <fejj@ximian.com> - - * mail-session.c (main_get_filter_driver): Add the new-mail-notify - rule to the filter driver before adding the user defined filter - rules so that we can be sure that the new-mail-notify rule gets - invoked. Fixes bug #32328. - - * mail-composer-prefs.c (mail_composer_prefs_new_signature): Make - sure that name[0] cannot ever be NULL. Should maybe fix bug - #32230. - -2002-10-15 Dan Winship <danw@ximian.com> - - * upgrade-mailer.c (shortcuts_upgrade_xml_file): Change the type - in LDAP shortcuts from "ldap-contacts" to "contacts/ldap". Rewrite - this to use libxml since that was easier than trying to make the - old code do both kinds of changes at once. - -2002-10-10 Jeffrey Stedfast <fejj@ximian.com> - - * mail-config-druid.c (management_prepare): Only set an account - name if one doesn't already exist. Also use the - e_utf8_gtk_entry_get/set_text functions since account names are - supposed to be in UTF8. Fixes bug #31891. - -2002-10-09 Jeffrey Stedfast <fejj@ximian.com> - - * folder-browser.c (main_folder_changed): Don't do anything if the - message_list is NULL (this means the FolderBrowser has been - destroyed). Fixes bug #32002. - -2002-10-08 Jeffrey Stedfast <fejj@ximian.com> - - * component-factory.c (storage_remove_folder): The CamelFolderInfo - that we get back has nodes for all parent folders, so do not - delete all folders that have nodes in the returned tree. Instead, - descend into the tree until we find the folder we want to delete - and start deleting from there. - -2002-10-08 Jeffrey Stedfast <fejj@ximian.com> - - * mail-signature-editor.c (mail_signature_editor): Mark a string - for translation, fixes bug #31942. Thanks to kmaraas@gnome.org for - this patch. - - * mail-offline-handler.h: Don't #include config.h here. Fixes bug - #31941. - -2002-10-07 Jeffrey Stedfast <fejj@ximian.com> - - * mail-composer-prefs.c (spell_load_values): Don't mark "en" for - translation. Fixes bug #31788. - - * mail-config.glade: Removed a "xxxxxxxxxxx" string so that - translators don't need to translate it. It was only a filler - string. Fixes bug #31789. - -2002-10-02 Jeffrey Stedfast <fejj@ximian.com> - - * mail-callbacks.c (mail_generate_reply): Don't default 'me' to - the source account until after we've tried to detect the account - based on recipients. When adding accounts to the account hash, if - any accounts have identical email addresses, the ones that are - enabled take precedence over ones that aren't. This will hopefully - make everyone happy with reply account picking. Fixes bug #31693. - -2002-10-01 Larry Ewing <lewing@ximian.com> - - * mail-display.c (drag_data_get_cb): add support for dragging the - content type directly. - (do_attachment_header): add the target for the mime type to the - drag source. - (drag_data_get_cb): silence warning. - -2002-10-01 Jeffrey Stedfast <fejj@ximian.com> - - * mail-config-druid.c (get_fn): Connect to the changed signal for - the reply_to entry box. Fixes bugs #31553 and #31554. - - * mail-composer-prefs.c (spell_setup): Only setup the languages if - the language_seq is not CORBA_OBJECT_NIL. Fixes bug #31559 - (presumably at least). - - * mail-account-gui.c (mail_account_gui_new): Use - e_utf8_gtk_entry_set_text for the email address and reply-to - fields. Fixes bug #31555. - - * mail-format.c (mail_get_message_body): Handle a - multipart/encrypted part. Fixes bug #31547. - - * upgrade-mailer.c: Shut up some compiler warnings. - - * importers/evolution-mbox-importer.c (process_item_fn): Use the - camel_message_info_new/free functions rather than g_new0 and - g_free. Also, if we fail to parse a message make sure we don't - later try to use that message object. - (get_info_from_mozilla): Use camel_message_info_new and strtoul - instead of string_to_int. - -2002-09-30 Jeffrey Stedfast <fejj@ximian.com> - - * subscribe-dialog.c (fe_node_to_shell_path): Removed (useless). - -2002-10-01 Ettore Perazzoli <ettore@ximian.com> - - [Fix #24732] - - * importers/evolution-mbox-importer.c (process_item_fn): Set - deleted to FALSE when not having Mozilla status headers. Before - it was being left uninitialized and so there was a pretty good - chance that its value would be nonzero and hence the message would - not be imported... - -2002-10-01 Not Zed <NotZed@Ximian.com> - - * folder-browser.c (on_cursor_activated): cursor activated on - etable is required to know when the selection changes on a single - row, update selection changed info with this signal too. Sounds - like an etable bug to me, but this fixes #29808. - (folder_browser_gui_init): Hook onto above signal. - -2002-09-30 Aaron Weber <aaron@ximian.com> - - * mail-signature-editor.c (mail_signature_editor): change - string to "Enter a name for this signature" on line 372. - - * mail-callbacks.c (ask_confirm_for_unwanted_html_mail): change - HTML-mail warning on 255 - - * component-factory.c (component_factory_init): change - "Evolution's foo" to "the Evolution foo" in string on 1078 - -2002-09-30 Not Zed <NotZed@Ximian.com> - - * mail-session.c (request_password): translate prompt from utf8 to - gtk widget. #31365. - -2002-09-27 Jeffrey Stedfast <fejj@ximian.com> - - * e-searching-tokenizer.c: #include <stdlib.h> for alloca - (searcher_next_token): Changed slightly to make sure that m is not - NULL before dereferencing it. Also initialise m to NULL so that it - can't be used uninitialised (NULL is a safe initialised value - here). - (build_trie): Same, but for n. - -2002-09-26 Dan Winship <danw@ximian.com> - - * mail-config.c (impl_GNOME_Evolution_MailConfig_addAccount, - impl_GNOME_Evolution_MailConfig_removeAccount): Set a timeout to - call mail_config_write() in 2 seconds. Otherwise changes made by - this interface would not be saved to disk unless the user also - changed some other preference. - (mail_config_write_on_exit): If there's a config_write_timeout - pending, call mail_config_write() too. - -2002-09-25 Dan Winship <danw@ximian.com> - - * mail-display.c (mail_display_render): Add a margin around the - "flag for followup" table so it lines up with everything else. - Also, don't add "at your earliest convenience" after the flag if - there's no date set, since that doesn't make any sense for half of - the flags. ("For Your Information at your earliest convenience"). - -2002-09-25 Dan Winship <danw@ximian.com> - - * component-factory.c (folder_types): add "mail/public". Leave - "vtrash" as it is rather than renaming it to "mail/vtrash", - because we want it to behave differently from normal mail folders - more often than we want it to behave the same. - (type_is_mail, type_is_vtrash): utility funcs - (create_view, create_folder, remove_folder, xfer_folder, - populate_folder_context_menu, unpopulate_folder_context_menu, - destination_folder_handle_drop, storage_create_folder): Use - type_is_mail/type_is_vtrash. - (create_component): Register "New Post" with "mail/public" instead - of "mail" so it becomes the default New icon for it. (29024) - - * mail-callbacks.c (transfer_msg): Use "mail/*" for allowed type. - - * message-browser.c (transfer_msg): Likewise. - - * mail-account-gui.c (mail_account_gui_new): Use "mail/*" instead - of "mail" here for sent/drafts allowed type. (?) - -2002-09-25 Jeffrey Stedfast <fejj@ximian.com> - - * upgrade-mailer.c (imap_url_upgrade): NULL-check si->folders - before passing it into find_folder so we don't crash. Fixes bug - #30915. - -2002-09-24 Jeffrey Stedfast <fejj@ximian.com> - - * folder-browser-ui.c: Allow users to delete already deleted - messages, fixes bug #30827. - -2002-09-24 Not Zed <NotZed@Ximian.com> - - * folder-browser.c (folder_browser_query_changed): Always do a - search if the query changed. For #31060 & #29625. - -2002-09-23 Radek Doulik <rodo@ximian.com> - - * mail-config.c (mail_config_signature_run_script): pass name of - the script as 1st parameter - - * mail-composer-prefs.c (sig_add_script_add): fix entry's glade - name - -2002-09-23 Dan Winship <danw@ximian.com> - - * mail-signature-editor.c (exit_dialog_cb): Fix non-ANSI switch - statement. - - * mail-account-gui.c (mail_account_gui_auto_detect_extra_conf): - Likewise. - - * mail-composer-prefs.c (spell_load_values): add some dummy - typedefs to avoid empty macro arguments, which have undefined - behavior. - - * mail-importer.c: #include <sys/types.h> for OS X - -2002-09-23 Jeffrey Stedfast <fejj@ximian.com> - - * mail-ops.c (save_part_save): Use 0666 as the create mode so that - the user's umask is used to it's fullest. - -2002-09-23 Dan Winship <danw@ximian.com> - - * Makefile.am (idldir, idl_DATA): add these and install Mailer.idl - -2002-09-20 Jeffrey Stedfast <fejj@ximian.com> - - * mail-preferences.c (mail_preferences_construct): Connect signal - handlers to the GtkHTML preferences so that when the widgets - change we can update the OK/Apply buttons. Also removed the - omenuShortcutsType widget reference since this was not being used? - Fixes bug #30731. - -2002-09-19 Jeffrey Stedfast <fejj@ximian.com> - - * mail-callbacks.c (do_edit_messages): Unset the changed bit on - the composer and also drop any undo operations (since we loaded - the message into the composer). Fixes bug #30580. - -2002-09-19 Not Zed <NotZed@Ximian.com> - - * mail-session.c (main_get_filter_driver): Fix for filter driver - api change. - -2002-09-18 Not Zed <NotZed@Ximian.com> - - * mail-config-druid.c (wizard_back_cb): If going back from a page - past our end (i.e. the final page), jump to the last page we know - of. For #29293. - - * component-factory.c (notify_listener_exception): helper to map a - camel excpeiton to a listener result. - (storage_create_folder): Use above to return more meaningful error. - (storage_remove_folder): " - (storage_xfer_folder): ". For #28209. - -2002-09-17 Jeffrey Stedfast <fejj@ximian.com> - - * mail-display.c (mail_display_render): Use e_strftime_fix_am_pm - here which fixes locale issues as well as working around systems - that don't support %P (afaik). - - * mail-ops.c (prep_offline_do): Cache important messages too. - - * mail-composer-prefs.c (d): Disable debugging printf's - - * mail-ops.c: fixed a comment - -2002-09-13 Dan Winship <danw@ximian.com> - - * folder-browser.c (fb_resize_cb): If the vpaned isn't realized, - don't call mail_config_set_paned_size. Fixes a problem with the - saved pane size being repeatedly lost (#29933) - -2002-09-13 Dan Winship <danw@ximian.com> - - * Mailer.idl: rename this from "Mail.idl" so that the generated .h - file won't overwrite "mail.h" on Mac OS X. Remove some - never-implemented IDL and add MailConfig_removeAccount. - - * Makefile.am: Update for IDL rename - - * mail-config.c: #include Mailer.h, not Mail.h - (impl_GNOME_Evolution_MailConfig_removeAccount): Implement. - - * folder-info.c: #include Mailer.h, not Mail.h - - * message-list.c: Remove Mail.h include. - -2002-09-12 Jeffrey Stedfast <fejj@ximian.com> - - * main.c (main): Ignore SIGXFSZ to fix bug #30269. - - * upgrade-mailer.c (cache_upgrade_and_free): The new callback - function for the g_hash_table_foreach which both upgrades the - cache for that store and then free's the struct _storeinfo - afterwards. - (cache_upgrade): Upgrade a cached folder by moving the old cache - folder into the appropriate new location. - -2002-09-11 Jeffrey Stedfast <fejj@ximian.com> - - * folder-browser.c (folder_browser_query_changed): Only abort if - the user selected ADVANCED_SEARCH, not the other way around. Any - other menu item and we are supposed to perform an actual - search. Fixes bug #30183. - - * mail-display.c (pixbuf_for_mime_type): check the new gnome-vfs - icon_filename key. If that fails, fall back to checking - icon-filename. Also don't leak the fm_icon string and rearranged - some code. - -2002-09-11 Not Zed <NotZed@Ximian.com> - - * component-factory.c (configure_folder_popup): Handle file uri's - too. - - * mail-callbacks.c (configure_folder): clear message list before - calling configure folder. - (local_configure_done): completion callback to reset message list - when done. - - * mail-local.c (mail_local_reconfigure_folder): changed args to - accept uri, and done callback. - (reconfigure_got_folder): moved code to callback which presents - the configure uri once we have the folder. - -2002-09-10 Not Zed <NotZed@Ximian.com> - - * component-factory.c: Handle file: as well as vfolder: uri's. - Pass both to the normal configure_folder callback. For #20849. - - * folder-browser.c (got_folder): If we already have a folder, make - sure we unref/unhook from it. Fixes a crash on exit. - - * message-list.c (message_list_hide_clear): clear thread tree - cache if set. - (message_list_set_search): Same. For bug #28834. - -2002-09-09 Jeffrey Stedfast <fejj@ximian.com> - - * folder-browser-ui.c (folder_browser_ui_scan_selection): Make - sure that fb->message_list is non-NULL before checking - fb->message_list->threaded? I guess this'll fix bug #29965. - - * mail-callbacks.c (composer_save_draft_cb): NULL-check the ccd - before reffing it. - (composer_send_cb): Same. - - * upgrade-mailer.c (shortcuts_upgrade_xml_file): Don't look for an - end quote, instead look for </item> to terminate the uri. - (shortcuts_upgrade_uri): Hex decode the imap folder name after - we've constructed the final version of it. - -2002-09-08 Dan Winship <danw@ximian.com> - - * upgrade-mailer.c (exchange_url_upgrade): Don't modify the URL if - the path doesn't start with "exchange". (Means it's already a 1.2 - URL.) - (shortcuts_upgrade_uri): Need to hex-decode exchange URLs here too. - (shortcuts_upgrade_xml_file): Fix an off-by-one error here (twice) - so it actually works instead of always claiming shortcuts.xml - doesn't need to be upgraded. - (mailer_upgrade): Check the size of the accounts hash rather than - imap_sources since we have work to do if the user has an exchange - account but no imap accounts. - -2002-09-06 Jeffrey Stedfast <fejj@ximian.com> - - * upgrade-mailer.c (upgrade): Sync the database after upgrading - mailer stuff. - (imap_url_upgrade): Since we need 'p' if we fail to find the - folder, don't g_free it until later. - (hex_encode): Don't forget to increment inptr after hex encoding a - character. - (exchange_url_upgrade): Apprently exchange uri's are rebelious and - do not want to be hex encoded like every other url, so hex decode - the folder names here before concatenating them onto the base url. - -2002-09-05 Jeffrey Stedfast <fejj@ximian.com> - - All this snot is to fix bug #29930. What I think was happening was - that the composer's destroy callback got fired off before the - async callback did. - - * mail-callbacks.c (ccd_new): New convenience function to malloc a - new ccd. - (ccd_ref): ccd is now ref_counted (it needs to be) so we now have - this. - (ccd_unref): And we need this now too of course. - (composer_destroy_cb): composer's new destroy callback function - - unref's the ccd. - (composer_send_queued_cb): unref the ccd. - (composer_send_cb): ref the ccd here. - (save_draft_done): unref the ccd. - (composer_save_draft_cb): ref the ccd. - -2002-09-05 Jeffrey Stedfast <fejj@ximian.com> - - * upgrade-mailer.c (imap_url_upgrade): Hex decode the folder names - when searching for them in the memory buffer, and re-hex encode - them when combining them with the rst of the URL. - (mailer_upgrade): Instead of reading in the storeinfo file as raw - binary data, use the camel-file-utils to correctly parse it. - -2002-09-05 Anna Marie Dirks <anna@ximian.com> - - * GNOME_Evolution_Mail.oaf.in: Changed the descriptions of the - fonts, mail, accounts and composer pages of the settings dialog to be - hopefully more descriptive and less confusing. - -2002-09-04 Ettore Perazzoli <ettore@ximian.com> - - * upgrade-mailer.c (upgrade): Return FALSE here. - (get_base_url): Add a cast. - - * component-factory.c (storage_xfer_folder): Removed unused - variables. - - * Makefile.am: Rename upgrade-mailer to evolution-mail-upgrade. - -2002-09-04 Jeffrey Stedfast <fejj@ximian.com> - - * Makefile.am: Add upgrade-mailer.c to the build. - - * upgrade-mailer.c: New program to upgrade configuration files - from 1.0 to 1.2. - -2002-09-04 Jeffrey Stedfast <fejj@ximian.com> - - * mail-callbacks.c (mail_generate_reply): Made sure - account->id->address is not NULL before adding it to the hash - table. This is to prevent bug #29877 from crashing, although it is - still an invalid error condition. - -2002-09-04 Dan Winship <danw@ximian.com> - - * folder-info.c (get_prop): Remove the "Get!" printf. - (set_prop): Likewise for "Set!" - -2002-09-04 Ettore Perazzoli <ettore@ximian.com> - - * mail-account-gui.c (mail_account_gui_save): Remove unused - variable. - - * component-factory.c (unpopulate_folder_context_menu): New. - (create_component): Pass it to evolution_shell_component_new(). - -2002-09-03 Jeffrey Stedfast <fejj@ximian.com> - - * folder-browser.c (mark_as_seen_cb): - (mark_as_unseen_cb): - (mark_as_important_cb): - (mark_as_unimportant_cb): New callback functions that wrap the - mail-callbacks versions of mark_as_<whatever>. Thanks to Owen - Taylor for this fix. - -2002-09-04 Not Zed <NotZed@Ximian.com> - - * component-factory.c (storage_xfer_folder): Dont translate / to - dir_sep anymore, we always use /. - -2002-08-29 Peter Williams <peterw@ximian.com> - - * folder-browser-ui.c: Add HAS_FLAGS to a few miscellaneous commands - that don't use IS_xMESSAGE. - -2002-08-28 Dan Winship <danw@ximian.com> - - * GNOME_Evolution_Mail.oaf.in: Add an - evolution:shell_component_launch_order and rename - evolution:shell_component_icon. - -2002-08-28 Jeffrey Stedfast <fejj@ximian.com> - - * mail-display.c (make_safe_filename): Fix some broken logic here, - `p = strrchr (path, '/') + 1` will *never* be NULL!! If the - strrchr returns NULL, then that expression will evaluate to 0x1!! - - * main.c (main): We now always need to init gconf for our later - call to e_proxy_init() which initialises the proxy settings for - soup to use. - -2002-08-28 Peter Williams <peterw@ximian.com> - - * folder-browser-ui.c (default_ui_nodes): Add some new flags for - sensitizing nodes based on the flags of the currently selected - messages. - (folder_browser_ui_add_message): Reset the sensitivity cache when - we re-add UI items. - (folder_browser_ui_add_list): Same. - (folder_browser_ui_add_global): Same. - (fbui_sensitise_item): Only cache the sensitivity in the hash - table if we actually change it. - (folder_browser_ui_scan_selection): New function, getting the bulk - of the contents of folder_browser_ui_set_selection_state. Now - with code to iterate over the currently selected messages and - check their flags so we can sensitize based on them. - (folder_browser_ui_set_selection_state): Now just set the - selection state if necessary and pass off to _scan_selection. Don't - skip of we're trying to go from SELSTATE_SINGLE to SELSTATE_SINGLE, - eg, as the flags of the selected messages may have changed. - - * folder-browser-ui.h: Prototype folder_browser_ui_scan_selection. - - * folder-browser.c (main_folder_changed): Call - folder_browser_ui_scan_selection as the flags on a selected - message may have just changed. - -2002-08-28 Peter Williams <peterw@ximian.com> - - * mail-format.c (component_supports): Also check that the component - has PersistStream. - (mail_lookup_handler): Get a list of all components and go with the - first matching one. - -2002-08-27 Jeffrey Stedfast <fejj@ximian.com> - - * message-list.c (regen_list_regen): Pass - mail_config_get_thread_subject() as the third argument to - camel_folder_thread_messages_new(). - - * mail-config.c (config_read): Read in the thread_by_subject - config option. - (mail_config_write_on_exit): Save the thread_by_subject config - option. - (mail_config_get_thread_subject): New function to get the - thread_subject value. - (mail_config_set_thread_subject): New function to set the - thread_subject value. - -2002-08-27 Radek Doulik <rodo@ximian.com> - - * mail-signature-editor.c: removed tip frame - -2002-08-27 Jeffrey Stedfast <fejj@ximian.com> - - Fixes for bug #4480 - - * folder-browser-factory.c (control_activate): Call - folder_browser_reload() instead of refreshing the folder - ourselves. - - * folder-browser.c (folder_browser_reload): New convenience - function. If the folder-browser's folder is already loaded, - refresh the contents, otherwise if the folder has not been loaded - - try loading the folder again (it may have failed to open last - time for some reason?). - -2002-08-27 Peter Williams <peterw@ximian.com> - - * mail-format.c (handle_text_plain_flowed): Fix bug #29493. - -2002-08-26 Peter Williams <peterw@ximian.com> - - * mail-callbacks.c (toggle_flags): Logic change for when untoggling - a message from deleted-dom. - -2002-08-26 Peter Williams <peterw@ximian.com> - - * mail-ops.c (transfer_messages_transfer): Enforce the mailer policy - that deleted messages are marked as seen. Fixes 29448. This could - go in camel_folder_transfer_messages_to, but I don't think we - necessarily want to enforce that policy for Camel in general. - -2002-08-23 Peter Williams <peterw@ximian.com> - - Address most of bug #4940. Fails on the last page of the add account - dialog as called from the prefs dialog due to EvolutionWizard being - weird. - - * mail-config-druid.c (goto_next_page): New function, little - wrapper around wizard_next_cb. Also potential place to work around - EvolutionWizard weirdness in the future. - (identity_activate_cb): New function, calls goto_next_page if - identity page is complete. - (source_activate_cb): Analogous. - (transport_activate_cb): Analogous. - (management_activate_cb): Analogous. - (get_fn): Hook up the activate signals of the various GtkEntries - to the correct callbacks above. - (management_check): Return the result of the check so that - management_activate_cb can use it. - -2002-08-22 Jeffrey Stedfast <fejj@ximian.com> - - * mail-tools.c (mail_tool_restore_xevolution_headers): Reset the - X-Evolution-PostTo header. - (mail_tool_remove_xevolution_headers): Remove the - X-Evolution-PostTo header. - -2002-08-21 Jeffrey Stedfast <fejj@ximian.com> - - * mail-folder-cache.c (ping_store): Spawn a new thread to ping the - server but only if it is connected. - (ping_cb): This needs to return TRUE so the timeout keeps getting - called. - -2002-08-21 Jeffrey Stedfast <fejj@ximian.com> - - * mail-session.c (class_init): Don't bother overloading the - timeout virtual methods since they don't exist anymore. - - * mail-folder-cache.c (mail_note_store): Register a ping timeout - callback to ping each store to keep the connections alive. - -2002-08-20 Radek Doulik <rodo@ximian.com> - - * mail-callbacks.c (do_mail_print): be sure that widget is - realized so that e_utf8_from_gtk_string works properly - (footer_print_cb): save/restore - -2002-08-20 Mike Kestner <mkestner@ximian.com> - - * folder-browser-ui.c (folder_browser_ui_setup_view_menus): guard - against the view_instance disappearing during earlier CORBA work. - -2002-08-20 Peter Williams <peterw@ximian.com> - - * message-list.c (search_func): Once we hit the target node, - update the cursor_uid if it's set. Fixes #29085. - -2002-08-19 Jeffrey Stedfast <fejj@ximian.com> - - * mail-preferences.c (mail_preferences_apply): Fix a - copy/paste-o. Use the pgp_path GnomeFileEntry widget rather than - the notify_sound_file GnomeFileEntry widget for the pgp path stuff - :-) - -2002-08-19 Dan Winship <danw@ximian.com> - - * mail-account-gui.c (mail_account_gui_setup): source_type_changed - may try to change the transport optionmenu (incorrectly in this - case), so don't call gtk_option_menu_set_history on it until after - emitting "activate" on the source type menuitem. - (mail_account_gui_save): Fix the saving of STORE_AND_TRANSPORT - transports and add a comment so it doesn't get mistakenly unfixed - again. - -2002-08-09 Peter Williams <peterw@ximian.com> - - * subscribe-dialog.c: Change this into a GnomeApp so we get a - statusbar and the dialog is a little more comprehensible. - - * subscribe-dialog.c: (struct _FolderETree): Add members for - tracking activity callback information. - (get_short_folderinfo_got): Notify the activity callback. - (subscribe_get_short_folderinfo): Here too. - (folder_etree_init): Initialize the activity level to 0. - (folder_etree_construct): Take new parameters of our activity - callback and user_data. - (folder_etree_new): Here too. - (store_data_get_widget): Take the parameters here and pass them - on. - (sc_close_pressed): New callback for when close button is pressed. - (sc_activity_timeout): New timeout to move the activity bar when - folders are being scanned. - (sc_activity_cb): If activity_level > 0, start the progressbar - moving and set the status. - (menu_item_selected): Pass the callback to store_data_get_widget. - (subscribe_dialog_construct): Load some more widgets and adapt to - some changes in the XML. Also connect the close button signal and - initialize the progress bar's settings. - - * mail-callbacks.c (manage_subscriptions): Don't call - gnome_dialog_set_close on it anymore since it's no longer a gnome - dialog. - -2002-08-14 Dan Winship <danw@ximian.com> - - * mail-config.glade: Add a "don't sign meeting requests" option to - the security pane, since some versions of Outlook won't recognize - pgp-signed meeting requests. Sigh. - - * mail-config.c (account_copy, config_read, mail_config_write): - Handle pgp_no_imip_sign. - - * mail-account-gui.c (mail_account_gui_new, - mail_account_gui_save): Setup/save "don't sign meeting requests" - button. - -2002-08-13 Jeffrey Stedfast <fejj@ximian.com> - - * mail-callbacks.c (forward_message): Removed an unused variable. - - * mail-account-editor.c (construct): Set the focus on the Account - Name entry widget. Fixes bug #10350. - -2002-08-12 Dan Winship <danw@ximian.com> - - * mail-display.c (on_url_requested): Replace no-longer-existent - e_book_query_address_locally with e_book_query_address_default. - -2002-08-12 Jeffrey Stedfast <fejj@ximian.com> - - * mail-callbacks.c (forward_message): Use mail_get_messages() - instead of mail_get_message(). - (do_forward_non_attached): Fixed to work as a callback from - mail_get_messages(). - (do_edit_messages): Only set the drafts_folder and drafts_uid if - the folder-browser is a drafts folder. Fixes bug #28863. - -2002-08-09 Jeffrey Stedfast <fejj@ximian.com> - - * mail-callbacks.c (save_draft_done): If the ccd is NULL, create a - new ccd, disconnect the old signal handlers, and then reconnect - the signal handlers using the non-NULL ccd as the user_data. - (composer_send_queued_cb): Same, but only if the queue append - operation failed. - -2002-08-09 Dan Winship <danw@ximian.com> - - * mail-callbacks.c (composer_send_queued_cb, save_draft_done): - Handle the fact that ccd may be NULL (if the composer was created - via CORBA). Quick temporary fix for sending meeting requests. - -2002-08-09 Peter Williams <peterw@ximian.com> - - * mail-config.c (mail_config_uri_renamed): When a URI is changed, - try to copy over threaded view settings, preview pane shown - settings, headers, hide state, tree expansion, and GAL view files. - (uri_to_evname): New utility function. - -2002-08-08 Jeffrey Stedfast <fejj@ximian.com> - - * mail-account-gui.c (mail_account_gui_save): Instead of comparing - old/new CamelStore objects, just compare their account urls since - changing params would still result in the same CamelStore - object. Fixes bug #18539. - - * mail-callbacks.c (delete_msg): Don't check permanent_flags for - the CAMEL_MESSAGE_DELETED bit here, if we are gonna check to see - if the folder supports the permanent flag then there are better - places to check this. Besides, it was the cause for bug #28038. - -2002-08-08 Not Zed <NotZed@Ximian.com> - - * folder-browser.c (folder_browser_toggle_threads): Force a - refresh of the menu sensitivity when the thread state changes. - -2002-08-07 Not Zed <NotZed@Ximian.com> - - * folder-browser-ui.c: Added EditSelectThread to only enable - threaded mode if threaded is on. For #19941. Added some macro's - to simplify the table. - (folder_browser_ui_set_selection_state): Implement IS_THREADED - mask. - -2002-08-07 Jeffrey Stedfast <fejj@ximian.com> - - * mail-callbacks.c (composer_send_queued_cb): Delete the Draft - item that this was edited from if that is the case as well as - setting any replied flags if we need to. Fixes bug #18171. - (save_draft_done): Not only delete the previously saved draft, but - also set any PostSendData on the message being replied to or - whatever. Fixes bug #20224. - (compose_msg): Create an empty callback data struct which is now a - MUST. - (mail_reply): Fill in the new post_send_data info and also move - the creation of the post_send_data to AFTER the creation of the - composer widget so we don't leak on fail. - (forward_get_composer): Pass an empty post_send_data structure as - the user_data to the signal callbacks. - (send_to_url): Same. - (post_to_url): Here too. - (redirect_get_composer): And here. - (do_edit_messages): We no longer use the evil kludge of setting - data on the composer object to denote the drafts_uid etc, this is - now part of the post_send_data struct. - -2002-08-07 Peter Williams <peterw@ximian.com> - - * component-factory.c (request_quit): If outbox_folder is NULL, - don't try and get its message count (this should never happen, but - has.) - -2002-08-06 Jeffrey Stedfast <fejj@ximian.com> - - * mail-local.c (save_metainfo): No need to save a temporary file - first anymore since I updated e_xml_save_file() to do this for us. - -2002-08-07 Not Zed <NotZed@Ximian.com> - - * folder-browser-ui.c: Enable the view type menu's always. See - #20901. - - * message-tag-followup.c (target_date_new): Set the week start day - from the calendar prefs, do same for 24 hour format. See #23423. - - * mail-config.c (config_read): Added week_start_day from - Calendar/Display config. Also time_24hour format. - (mail_config_get_week_start_day): - (mail_config_get_time_24hour): And read-only accessors. - -2002-08-06 Jeffrey Stedfast <fejj@ximian.com> - - * mail-local.c (save_metainfo): Save to a temporary file first - using e_xml_save_file rather than xmlSaveFile, if the save - completes successfully then rename it to the real filename. Make - sure that errno is saved. - (mls_get_folder): save_metainfo doesn't return -1 on fail, it - returns FALSE. - -2002-08-06 Not Zed <NotZed@Ximian.com> - - * folder-browser.c (folder_browser_search_menu_activated): Set the - rule name to include the search string, for #10979. - - * message-list.c (message_list_hidden): Only count hidden messages - which are in the folder. Should probably maintain hidden table - better. For #4334. - - * mail-ops.c (filter_folder_filter): Unref the driver before - returning to main thread, so any closing operations are handled - async (as in fetch_mail_fetch()), for #28072. - (fetch_mail_fetch): Check driver != NULL, if folder_filter freed - it already. - - ** fixes for #24605. - - * mail-vfolder.c (vfolder_gui_add_from_mlist): Removed. - - * folder-browser.c (filter_type_uid,vfolder_type_uid): Changed to - accept args directly. Fixed callers. - (filter_mlist_uid,vfolder_mlist_uid): Use filter_type_uid instead - of mlist variant. - (vfolder_type_current): new function to handle setup of vfolders - from the main menu. It now uses the vfolder_type_uid function the - same as the popup. - (vfolder_subject, vfolder_sender, vfolder_recipient, - vfolder_mlist): Changed to use vfolder_type_current. - (filter_type_current): Similar for filters. - (filter_subject, filter_sender, filter_recipient, - filter_mlist): Changed to use filter_type_current. - - * mail-autofilter.c (rule_from_message): Handle AUTO_MLIST type. - (rule_from_mlist): - (vfolder_rule_from_mlist): - (filter_rule_from_mlist): Removed. - (filter_gui_add_from_mlist): Removed. - - * mail-autofilter.h: Added AUTO_MLIST type. - -2002-08-05 Jeffrey Stedfast <fejj@ximian.com> - - * mail-mt.c (mail_msg_check_error): If we are not in interactive - mode, don't display error dialogs. - - * component-factory.c (interactive_cb): Updated to use the new - function mail_session_set_interactive(). - (owner_unset_cb): Same here. - - * mail-session.c (mail_session_set_interactive): Renamed from - mail_session_enable_interaction(). - (mail_session_get_interactive): New function to get the - interactive state. - -2002-08-01 Peter Williams <peterw@ximian.com> - - * mail-offline-handler.c (struct _sync_info): Add a GHashTable pointer - so we can remove the info once the operation is done. - (sync_done): Remove the info from the hash table. - (impl_syncFolder): Save the table to which the info was added. - -2002-08-05 Jeffrey Stedfast <fejj@ximian.com> - - * component-factory.c (user_create_new_item_cb): Updated to call - post_to_url if the id is "post". - - * mail-callbacks.c (post_to_url): New function so that we don't - need a FolderBrowser to post a new message. - (post_message): Call post_to_url since they shared so much code. - -2002-08-05 Dan Winship <danw@ximian.com> - - * mail-callbacks.c (mail_reply): Only reply to all or reply to - list, set CAMEL_MESSAGE_ANSWERED_ALL too. - -2002-08-02 Jeffrey Stedfast <fejj@ximian.com> - - * message-tag-followup.c (construct): Set the default flag to - Follow-Up. - - * mail-display.c (mail_display_render): Updated to use the new - Follow-Up tags. Instead of storing a string containing the - follow-up tag value, we now have to store the CamelMessageInfo. - (mail_display_destroy): Unref the folder and the message-info. - - * folder-browser.c (followup_tag_complete): No longer needed. - (on_right_clicked): Use the individual follow-up tags to decide - whether or not to enable something. - - * message-list.c (ml_tree_value_at): Update to use the new - Follow-Up tags. - - * mail-callbacks.c (flag_for_followup): Update to use the new - MessageTagEditor API. - (tag_editor_ok): Update this too. - (flag_followup_completed): Updated this too. - (flag_followup_clear): Set all the follow-up tag values to "". - -2002-08-01 Ettore Perazzoli <ettore@ximian.com> - - * component-factory.c (create_component): Use - "post-message-16.png" as the icon for the "New Message Post" item. - -2002-08-01 Jeffrey Stedfast <fejj@ximian.com> - - * mail-account-gui.c (mail_account_gui_save): If we are editing an - account, then get the CamelStore associated with the old account - info and save it in a struct that we will pass along as user_data - to mail_get_store() for the new account url. - (add_new_store): If the old account and new account stores are - identical, then don't remove the old store from the folder - tree. If they are not the same, then remove the old store and add - the new store to the folder tree. - -2002-07-31 Peter Williams <peterw@ximian.com> - - * mail-folder-cache.c: Add another bitfield "unsub" - (real_flush_updates): If unsubscribing, manually remove the folder - from the shell. - (unset_folder_info): Add another parameter which is used to set - the unsub member. - (store_folder_unsubscribed): Pass true for @unsub. - (unset_folder_info_hash): Pass false for @unsub. - - * subscribe-dialog.c (fe_done_subscribing): Don't notify the shell - here. The folder cache does it now, and it was broken to make the - CORBA call in another thread anyway. - -2002-08-01 Jeffrey Stedfast <fejj@ximian.com> - - * mail-format.c (setup_mime_tables): Don't setup a handler for - multipart/digest. - (handle_multipart_digest): Removed. - -2002-07-31 Jeffrey Stedfast <fejj@ximian.com> - - * Makefile.am: Removed folder-browser-window from the build. - - * folder-browser-window.[c,h]: Removed. - - * mail-callbacks.c (view_digest): Removed. - - * mail-display.c (mail_display_digest_clicked): Removed. - (on_link_clicked): Don't handle digest: urls anymore. - -2002-07-31 Ettore Perazzoli <ettore@ximian.com> - - * component-factory.c (create_component): Put "New Mail Message" - before "New Message Post" instead of vice versa. - -2002-07-31 Ettore Perazzoli <ettore@ximian.com> - - * component-factory.c (create_component): Pass "mail" as - @folder_type to - evolution_shell_component_add_user_creatable_item(). - -2002-07-31 Not Zed <NotZed@Ximian.com> - - * mail-display.c: Added global cameldatacache for managing remote - image cache. - (fetch_remote): Lookup data in cache first, use that if available, - or setup a new cache item. - (fetch_data): Write any retrieved data to cache as well as html - stream. - (fetch_free): Unref cache stream. - (fetch_done): - (fetch_cancel): If failed/cancelled, remove cache items so they - dont foul the result. Probably need a header in cache items to - guarantee this, but this is ok for now. - (mail_display_class_init): Setup cache structure. Also ensure - globals are initialised at-most once. - -2002-07-30 Radek Doulik <rodo@ximian.com> - - * mail-config.c (mail_config_signature_set_name): save signature - here to remember the changed name - -2002-07-30 Jeffrey Stedfast <fejj@ximian.com> - - * mail-format.c (write_date): Use camel_medium_get_header to get - the date header rather than getting the time_t and converting it - into a string. - -2002-07-29 Not Zed <NotZed@Ximian.com> - - * mail-display.c (mail_display_init): setup private data. - (mail_display_destroy): cancel any outstanding fetches, and free - private data. - (mail_display_set_message): Cancel any outstanding fetches. - (fetch_cancelled): - (fetch_next): - (fetch_remote): - (fetch_data): - (fetch_free): - (fetch_cancel): - (fetch_done): Implement, used to use soup to download remote - images. - (load_http): Removed. - (on_url_requested): When requesting a http* url, use the - fetch_remote call above. - - * mail-display.h (struct _MailDisplay): Added priv(ate) member. - -2002-07-29 Ettore Perazzoli <ettore@ximian.com> - - * mail-session.c (request_password): Left-align the check button's - label. - -2002-07-29 Jeffrey Stedfast <fejj@ximian.com> - - * mail-account-gui.c (mail_account_gui_new): Get the "Reset - Defaults" folders button and connect to the clicked signal. - (default_folders_clicked): Set the default uris on for the Drafts - and Sent folders. - -2002-07-26 Peter Williams <peterw@ximian.com> - - * mail-offline-handler.c (storage_go_online): Call mail_note_store - to get the folders to be updated and new ones to be inserted into - the tree. - -2002-07-29 Ettore Perazzoli <ettore@ximian.com> - - * mail-session.c (request_password): Add an accelerator for the - "Remember this password" checkbox. - -2002-07-26 Jeffrey Stedfast <fejj@ximian.com> - - * mail-ops.c (mail_execute_shell_command): No real need for this - to be an async function sync we are going to call - gnome_execute_async anyway. - - * component-factory.c (create_component): Add a new menu item for - posting to the New toolbar button thing. - (destination_folder_handle_drop): Don't use a NULL exception when - we already have one to use anyway. - (got_folder): Move the *fp = folder; to before the check to make - sure folder != NULL, this makes it so that if getting a folder - fails at least have have a known value to look out for (NULL) - rather than some random garbage. - -2002-07-25 Jeffrey Stedfast <fejj@ximian.com> - - * mail-config-druid.c (create_label): Make the gtk label line-wrap - instead of us forcing \n's in the label, that was just - wrong. Fixes bug #10320. - - * mail-callbacks.c (composer_send_cb): Make sure that the url - isn't an empty string and also make sure to free it when we're - done with it. Also check that we got the folder - if it is NULL, - then just abort. - -2002-07-24 Jeffrey Stedfast <fejj@ximian.com> - - * mail-config.c (mail_config_folder_to_safe_url): Use - mail_tools_folder_to_url(). - - * mail-tools.c (mail_tools_folder_to_url): New convenience - function to take a CamelFolder and return the URL associated with - it. - - * mail-callbacks.c (composer_get_message): Pass in a 'post' - argument so we know whether or not we can ignore a NULL set of - recipients. - (composer_send_cb): Default send->send to TRUE unless we are in - Post-To mode, in which case set send->send to FALSE (since we'll - have nothing to send). Also, if we are in Post-To mode, append to - the folder the user wants to post to rather than appending to - Outbox. - (composer_send_queued_cb): Only queue a send thread if send->send - is TRUE (ie, the composer was not in Post mode - if it was in Post - mode, then the message post has already been saved in the correct - folder so there is nothing to do). - (post_message): New function to create an empty composer widget in - Post mode. - (post_reply): New function that calls mail_reply with the new mode - of REPLY_POST. - (mail_generate_reply): If the mode is REPLY_POST, create a Post - composer widget otherwise create a normal composer widget. - -2002-07-25 Jeffrey Stedfast <fejj@ximian.com> - - * mail-ops.c (mail_execute_shell_command): Update to take argc and - argv arguments since this is the new definition for the - CamelFilterDriverShellFunc. - - * mail-session.c (main_get_filter_driver): Updated for the renamed - function. - - * mail-display.c (link_open_in_browser): Make sure that the - html->pointer_url is non-NULL. Should fix bug #28159 (this seems - to be the only questionable way for a NULL url to be passed into - on_link_clicked). - -2002-07-24 Peter Williams <peterw@ximian.com> - - * mail-callbacks.c (do_mail_fetch_and_print): Check for whether - current_message is NULL as well as preview_shown (if we tried to - load the message and failed, as may happen in offline mode.) - (done_message_selected): Only print if we actually got the message. - - * folder-browser.c (folder_browser_query_changed): New function, - use this on the query_changed signal. Don't run the search if - they only changed the dropdown. - -2002-07-23 Peter Williams <peterw@ximian.com> - - * mail-ops.c (get_store_get): Call camel_session_get_service - instead of camel_session_get_store, as _get_store calls - _get_service_connected which is not what we want to do on startup. - (set_offline_do): Rework the logic here. It was failing when - trying to go online with a disco store that couldn't work offline. - - * mail-folder-cache.c (mail_note_store): If we're using an offline - (well, non-online) disco store that cannot work offline, don't get - the folderinfo as that will fail. - -2002-07-24 Radek Doulik <rodo@ximian.com> - - * mail-composer-prefs.c (sig_add): use - mail_config_get_send_html for html format flag - - * mail-account-gui.c (sig_add_new_signature): use - mail_config_get_send_html for html format flag - -2002-07-24 Not Zed <NotZed@Ximian.com> - - * mail-folder-cache.c (real_flush_updates): Propagate name changes - or removes to the mail config. #15951. Doesn't enitrely work for - local folders, because they are never renamed only removed and - added thanks to the shell's api. - - * mail-config.c (mail_config_uri_renamed): If a store folder is - renamed, this checks for any config that needs updating, so far - sent and drafts folders. - (mail_config_uri_deleted): Same, for deleted folders. - -2002-07-24 Jeffrey Stedfast <fejj@ximian.com> - - * mail-format.c (handle_multipart_encrypted): Commit a fix that I - thought I committed a while ago: - - * mail-format.c (handle_multipart_encrypted): Pass the correct - pointer into camel_multipart_encrypted_decrypt(). - - * mail-ops.c (mail_send_message): Rework the logic a bit. If we - find an account, use that to set the sent_folder_uri and the - transport_url, otherwise use the X-Evolution-Transport and - X-Evolution-Fcc headers. - -2002-07-23 Jeffrey Stedfast <fejj@ximian.com> - - * message-tag-followup.c (message_tag_followup_decode): Don't pass - the length of the tag name into strncmp, instead use the length up - to the first ':' in the value string. - -2002-07-22 Peter Williams <peterw@ximian.com> - - * folder-browser.c (folder_browser_gui_init): Also perform a search - on the query_changed signal, which is what gets emitted when the - Search menu is used. - -2002-07-24 Not Zed <NotZed@Ximian.com> - - * component-factory.c (owner_set_cb): Initialise the standard - uri's before doing anything else. - - * mail-vfolder.c (uri_is_ignore): Return true if the uri is any - sent, drafts or outbox folder uri. - (mail_vfolder_add_uri): Dont automagically add any - sent/outbox/drafts folder with "local" or "remote" etc rules, only - add sent folders if explictly listed as folder rules. Maintain - the remote/local folders list accordingly. - (vfolder_adduri_do): dont check against sent_folder, drafts_folder - or outbox_folder, this is checked by above code. For #14863. - - * mail-display.c (drag_data_delete_cb): use uri_list before we set - "uri-list" to NULL, which will automagically free it for us, so - dont free it either. Found with vagrind. - -2002-07-23 Not Zed <NotZed@Ximian.com> - - * message-browser.c (message_browser_destroy): Disconnect from - folderbroser signals when we unref it, so we dont get signals - later on if someone else has a ref on it (causing crash). - -2002-07-22 Jeffrey Stedfast <fejj@ximian.com> - - * mail-config.c (mail_config_signature_run_script): Check to make - sure the script output is valid UTF-8, if not then attempt to - convert it into UTF-8. Fixes bug #28086. - -2002-07-22 Not Zed <NotZed@Ximian.com> - - * message-list.c (regen_list_regened): Remove the assert, and - always copy over the threadtree which represents the current view, - unreffing the old one if set. For #28021. Haven't tested this a - lot, but i guess it cant be worse than what is there. - - * mail-vfolder.c (store_folder_renamed): When renaming, use - full_name to set the folder, not name, so the path is preserved. - -2002-07-20 Larry Ewing <lewing@ximian.com> - - * mail-format.c (mail_get_message_body): recognize urls in plain - text reply quoting logic (bug #27908). - -2002-07-19 Not Zed <NotZed@Ximian.com> - - * mail-callbacks.c: Try including gtkhtml/gtkhtml.h instead. Test - really is a 4 letter word obviously. - -2002-07-18 Ettore Perazzoli <ettore@ximian.com> - - * mail-folder-cache.c: Removed bogus static pre-declaration. - - * e-searching-tokenizer.c (e_searching_tokenizer_end): Removed - unused variables. - - * mail-callbacks.c: #include <gtkhtml.h>. - - * folder-info.h (evolution_folder_info_get_type): Add prototype. - -2002-07-18 Peter Williams <peterw@ximian.com> - - * mail-format.c (handle_multipart_digest): Change the HTML to - make this a little prettier. - - * folder-browser-window.c (folder_browser_window_new): Load the - messagedisplay XML file as a base for the UI, so that things - appear. Don't add the global UI items as they don't make sense - here. - (fb_window_close): New function, used to ... close the window, - suprisingly. - -2002-07-18 Not Zed <NotZed@Ximian.com> - - * main.c (main): Put the mcheck stuff back in, which was removed - without a changelog entry. - -2002-07-08 Peter Williams <peterw@ximian.com> - - * Makefile.am: Reference the new libefilterbar.a. - -2002-07-17 Radek Doulik <rodo@ximian.com> - - * mail-callbacks.c (save_draft_done): use "saved" gtkhtml command - -2002-07-17 Jeffrey Stedfast <fejj@ximian.com> - - * component-factory.c (add_storage): Oops, Don't comment out the - mail_note_store call. - -2002-07-16 Jeffrey Stedfast <fejj@ximian.com> - - * mail-accounts.c (account_able_clicked): Re-enable some #if 0'd code. - - * mail-vfolder.c (vfolder_load_storage): Updated to not pass TRUE - for an auto_connect argument since that argument no longer exists. - - * mail-account-gui.c (add_new_store): Updated to not pass an - auto_connect argument. - - * component-factory.c (add_storage): Don't ever auto-connect here. - (mail_add_storage): No longer takes an auto_connect argument. - (mail_load_storages): Only load the account storages that are - enabled. - -2002-07-15 Jeffrey Stedfast <fejj@ximian.com> - - * mail-callbacks.c (composer_send_cb): Pass 'info' into - mail_append_mail(), seems I created the info but forgot to pass it - in. - (composer_send_queued_cb): If the message is successfully queued, - we destroy the composer, otherwise we unref it. Don't ever destroy - and then unref it. - -2002-07-15 Radek Doulik <rodo@ximian.com> - - * mail-callbacks.c: use new save_header_state flag - -2002-07-15 Peter Williams <peterw@ximian.com> - - * mail-offline-handler.c (service_is_relevant): Account for the - case that when a disco store is "online" but actually offline and - we're going online, we should actually connect it. - - * component-factory.c (mail_load_storages): Always set - auto_connect to FALSE, same reason as below. - - * mail-session.c (mail_session_init): Initialize our session to - not be online, since the shell will tell us to go online if we - need to. - -2002-07-10 Peter Williams <peterw@ximian.com> - - * Makefile.am (importerdir): Define this in terms of the new - privlibdir, again resulting in a new directory name. - - * importers/Makefile.am (importersdir): Here too. - -2002-07-15 Not Zed <NotZed@Ximian.com> - - * message-list.c (ml_tree_value_at): Lookup the label colour based - on the label token, not an integer. - - * folder-browser.c (on_right_click): Lookup the label name from - the filter type. Sigh, a bunch of other code should do similar - but i'm going to leave it as integers. - (set_msg_label): Set the label directly. - - * mail-vfolder.c (vfolder_editor_clicked): Set the vfolder_editor - variable to null before we close the dialogue, otherwise the close - destroys it and reverts the file. - - * component-factory.c (populate_folder_context_menu): Oops, - accidentally checked in some unfinished, unworking code. - Reverted. - -2002-07-10 Not Zed <NotZed@Ximian.com> - - ** fixes for #10781 - - * mail-callbacks.c (filter_edit): Add back a cancel button. We - dont need to do anything special to 'undo' here, as the rules are - loaded every time they're used. - - * mail-vfolder.c (vfolder_editor_clicked): If ok wans't clicked, - revert the ruleset. - (vfolder_editor_destroy): Fake a button of -1 if we get destroyed - with no click. - (context_rule_removed): Unref the folder after we delete it. If - we're the last ref to the folder, unrefing it means it no longer - exist,s which means no delte processing occurs ... - -2002-07-04 Not Zed <NotZed@Ximian.com> - - * mail-accounts.c (news_add_destroyed): Pass teh autoconnect flag, - whcih shoudlnt' exist anyeway. - -2002-07-03 Not Zed <NotZed@Ximian.com> - - * component-factory.c (populate_folder_context_menu): If this is a - file url, look up its component, if we have it, then use the - mail-callback reconfigure call. - - * folder-browser-factory.c (folder_browser_factory_get_browser): - Util to get the folder browser from a uri. - -2002-07-11 Jeffrey Stedfast <fejj@ximian.com> - - * mail-display.c (pixmap_press): Rename "Save to disk..." to "Save - Attachment..." - -2002-07-10 Jeffrey Stedfast <fejj@ximian.com> - - * folder-browser-ui.c: Modified to use a single list of UI node - elements with an enable-mask rather than split into groups. This - allows much more control and easier modification to get the - desired enable/disable effects. - - * mail-display.c (mail_display_set_message): If we unref'd a - current_message, clear the datalist. Don't bother connecting to - the message's finalise signal because something else may own a ref - to the original message when we replace it with a new one. - (mail_display_destroy): Only clear the datalist if we have a - current_message, otherwise it's safe to assume that it is already - cleared. - -2002-07-08 Peter Williams <peterw@ximian.com> - - * Makefile.am (INCLUDES): Add -I flags to get the ebook headers. - -2002-07-10 Ettore Perazzoli <ettore@ximian.com> - - * subscribe-dialog.c (recursive_add_folder): Pass zero as - @sorting_priority to evolution_storage_new_folder(). - - * mail-folder-cache.c (real_flush_updates): Pass zero as - @sorting_priority to evolution_storage_new_folder(). - -2002-07-09 Ettore Perazzoli <ettore@ximian.com> - - * subscribe-dialog.c (recursive_add_folder): Pass NULL for - @custom_icon_name to evolution_storage_new_folder(). - - * mail-folder-cache.c (real_flush_updates): Pass NULL for - @custom_icon_name to evolution_storage_new_folder(). - -2002-07-08 Jeffrey Stedfast <fejj@ximian.com> - - * mail-callbacks.c (redirect): Don't ever use the mail-display's - current_message, this can cause problems. - - * mail-ops.c (get_message_free): Unref the gotten message. All of - the callers seemed to think that they didn't have to unref the - message. - - * mail-display.c (mail_display_set_message): Now refs the message. - (mail_display_destroy): Unref the current_message if we still have - ownership of it. - -2002-07-05 Jeffrey Stedfast <fejj@ximian.com> - - * mail-callbacks.c (composer_send_queued_cb): Only queue a send - operation if we are in Online mode, otherwise don't bother wasting - our time. - -2002-07-05 Jeffrey Stedfast <fejj@ximian.com> - - * main.c (main): No longer need to pass a postpone_cb function - into the composer factory_init. - - * mail-send-recv.c (get_receive_type): If the provider is a - transport, return SEND_SEND. - - * mail-config.c (mail_config_get_default_transport): If the - default account doesn't have a transport, find the first account - that does. - - * mail-callbacks.c (append_mail_cleanup): Don't bother freeing the - appended_uid here. - (composer_send_internal): New helper function that does all the - similar work that composer_send_cb and composer_postpone_cb did. - (composer_send_cb): Append the message to Outbox and in the async - callback, queue a message send operation. - (composer_postpone_cb): Removed. - (composer_send_queued_cb): The new async callback for - composer_send_cb(). If the append is successful, queue a message - send operation and destroy the composer otherwise re-show the - composer. - (save_draft_done): g_strdup the appended uid. - (compose_msg): Don't connect to the postpone signal anymore as it - no longer exists. - (send_to_url): Same. - (mail_reply): Here too. - (forward_get_composer): And here. - (redirect_get_composer): Again here. - (do_edit_messages): And finally here. - - * mail-ops.c (append_mail_free): Free the appended uid. - -2002-07-04 Jeffrey Stedfast <fejj@ximian.com> - - * mail-account-editor-news.[c,h]: Removed. - - * mail-accounts.c: Removed special-case code for NNTP support. - - * mail-account-gui.c (mail_account_gui_setup): Allow configuration - of both mail and news accounts. - - * component-factory.c (mail_load_storages): No longer need the - is-account argument. - - * subscribe-dialog.c (populate_store_list): Don't special-case - news accounts anymore. - - * mail-config.c (mail_config_get_default_news): Removed. - (mail_config_get_news): Removed. - (mail_config_add_news): Removed. - (mail_config_remove_news): Removed. - -2002-07-03 Jeffrey Stedfast <fejj@ximian.com> - - * mail-vfolder.c (vfolder_load_storage): Pass TRUE as the - auto_connect argument to mail_load_storage_from_uri(). - - * mail-account-gui.c (add_new_store): Pass FALSE as the - auto_connect value to mail_load_storage_from_uri(). - - * mail-format.c (handle_multipart_encrypted): Pass the correct - pointer into camel_multipart_encrypted_decrypt(). - - * component-factory.c (mail_add_storage): Now takes an - auto-connect argument which it passes along to add_storage(). - (mail_load_storage_from_uri): Same. - (add_storage): Only call mail_note_store() if we plan on - auto-connecting. - -2002-07-02 Jeffrey Stedfast <fejj@ximian.com> - - * folder-browser.c (on_right_click): Increase the size of the - escapped mlist buffer, we can't assume that there can only ever be - a single '_' in the mlist name afaik. - (filter_type_uid): Ugh, we need to copy the fdata->source here. - - Fixes bug #27263. - - * folder-browser.c (filter_subject): Decide the filter source type - based on the folder we are in (Sent/Outbox folders use - FILTER_SOURCE_OUTGOING). - (filter_sender): Same. - (filter_recipient): Here too. - (filter_mlist): And here. - (on_right_click): Set the fdata->source. - (filter_type_got_message): Pass fdata->source into - filter_gui_add_from_message(). - (filter_mlist_uid): Same. - - * mail-autofilter.c (filter_gui_add_from_message): Now takes a - source argument so that we don't always add incoming rules. - (filter_gui_add_from_mlist): Same. - - * mail-tools.c (mail_tool_make_message_attachment): Remove Bcc - headers too. Fixes bug #27302. - -2002-07-02 Ettore Perazzoli <ettore@ximian.com> - - * folder-browser.c (folder_browser_gui_init): Don't connect - folder_browser_search_do_search to "query_changed" since we don't - want the search to happen unless the user clicks "Find Now", for - consistency. - -2002-07-02 Ettore Perazzoli <ettore@ximian.com> - - * component-factory.c (create_component): Pass a tooltip to - evolution_shell_component_add_user_creatable_item. - -2002-07-02 Sean Atkinson <sean@cantab.net> - - * mail-preferences.c: remove dependency on removed file - camel/camel-pgp-context.h - -2002-07-01 Jeffrey Stedfast <fejj@ximian.com> - - * mail-format.c (handle_multipart_related): Make sure that cid is - non-NULL. - -2002-07-01 Not Zed <NotZed@Ximian.com> - - * mail-folder-cache.c (folder_deleted): Removed. The - folder's deleted event isn't needed since we're listening to the - store's folder_deleted signal. Also, the code was wrong, it - cleared the folder without disconnecting events, etc. See #16486, - and probably others. - (mail_note_folder): Dont hook onto deleted anymore. - (unset_folder_info): Or unhook from it. - -2002-06-28 Jeffrey Stedfast <fejj@ximian.com> - - * component-factory.c (mail_load_storages): Don't skip over - disabled accounts - put them in the folder tree too. - -2002-06-28 Jeffrey Stedfast <fejj@ximian.com> - - Fixes bug #27055. - - * mail-accounts.c (account_add_finished): Unref the main accounts - widget. - (account_add_clicked): Ref the main accounts widget. - (account_edit_finished): Unref the main accounts widget. - (account_edit_clicked): Ref the main accounts widget. - -2002-06-27 Jeffrey Stedfast <fejj@ximian.com> - - * component-factory.c (storage_remove_folder): Recursively delete - any subfolders. - -2002-06-26 Jeffrey Stedfast <fejj@ximian.com> - - * mail-config.c (config_read): Don't allow the pgp type to be - anything except NONE or GPG. - - * mail-preferences.c (mail_preferences_apply): Don't allow someone - to use anything other than GnuPG. - - * mail-crypto.c (mail_crypto_get_pgp_cipher_context): No need to - handle pgp5 or pgp6 types anymore since we are no longer - supporting them. Ding dong the witch is dead! - - * mail-format.c (handle_multipart_encrypted): Rewritten to use - camel_multipart_encrypted_decrypt. - - * mail-crypto.c (mail_crypto_pgp_mime_part_verify): Removed. - (mail_crypto_pgp_mime_part_encrypt): Removed. - (mail_crypto_pgp_mime_part_decrypt): Are we seeing a trend yet? - -2002-06-25 Jeffrey Stedfast <fejj@ximian.com> - - * mail-display.c (on_url_requested): Also handle https urls. - - * component-factory.c (mail_add_storage): Some compiler warning - fixes. - - * mail-crypto.c (mail_crypto_pgp_mime_part_sign): Removed. - (mail_crypto_get_pgp_cipher_context): New convenience function to - construct a pgp cipher context. - (mail_crypto_pgp_mime_part_verify): Use the new - get_pgp_cipher_context function. - (mail_crypto_pgp_mime_part_encrypt): Same. - (mail_crypto_pgp_mime_part_decrypt): Here too. - - * mail-account-gui.c (mail_account_gui_new): Initialise the - pgp_always_trust checkbox. - (mail_account_gui_save): Get whether or not to always_trust the - user's pgp keys. - - * mail-config.c (account_copy): Copy over the pgp_always_trust - option. - (config_read): Read in the always_trust option. - (mail_config_write): Save the always_trust option. - -2002-06-21 Jeffrey Stedfast <fejj@ximian.com> - - * mail-crypto.c (mail_crypto_pgp_mime_part_verify): If the pgp - type is gpg, then use the gpg context. - (mail_crypto_pgp_mime_part_sign): Same. - (mail_crypto_pgp_mime_part_encrypt): Same. - (mail_crypto_pgp_mime_part_decrypt): Same. - - * mail-format.c (handle_multipart_signed): Use the new gpg cipher - context. - -2002-06-18 Jeffrey Stedfast <fejj@ximian.com> - - * message-list.c (message_list_change_first_visible_parent): New - convenience function to find the first parent node that is visible - and emit a changed signal on it. - (main_folder_changed): If a message changed, call - change_first_visible_parent() in case we are in a collapsed thread - so that our first visible parent gets updated as well. Fixes bug - #26263. - - * component-factory.c (storage_remove_folder): Simplify the error - checking. - -2002-06-17 Jeffrey Stedfast <fejj@ximian.com> - - * message-list.c (get_normalised_string): New convenience function - to get a cached normalised string. - (subject_compare): Removed, as we strip Re:'s when normalising the - subject strings now. - (ml_tree_value_at): Added support for the normalised columns (used - for a sorting optimisation). - (message_list_init): Initialise normalised_hash. - (message_list_destroy): Destroy normalised_hash. - (message_list_create_extras): Removed subject_compare. - (main_folder_changed): De-cache normalised strings for any removed - uids. - -2002-06-17 Not Zed <NotZed@Ximian.com> - - * message-list.c (regen_list_regen): If we dont support searching, - dont try to. - -2002-06-11 Jeffrey Stedfast <fejj@ximian.com> - - * message-list.c (regen_list_regen): Move m->complete = TRUE; to - within the cancel-check block, this way complete only ever gets - set to TRUE if we weren't cancelled. I assume this is how it was - supposed to work. - -2002-06-11 Not Zed <NotZed@Ximian.com> - - * folder-info.c (do_get_info): If we dont get a folder, dont try - and get details off it. Should get rid of most of those annoying - summary warnings, but not the cause of them. - -2002-06-10 Jeffrey Stedfast <fejj@ximian.com> - - * mail-accounts.c (account_able_clicked): Comment out the code to - add/remove the store to the folder-tree when it gets - enabled/disabled. - - * mail-callbacks.c (mail_generate_reply): If we are doing - Reply-to-All, do not include any of the user's email accounts in - the To: field. If, after this, the To: field is empty - then - promote the first recipient in the Cc: list to the To: field. - -2002-06-07 Radek Doulik <rodo@ximian.com> - - * mail-config.c (mail_config_write_account_sig): call - mail_config_init to be sure we have the db, save auto_signature as - well - - * mail-composer-prefs.c (sig_add_script_cancel): hook this to - cancel button in signature script dialog - - * mail-signature-editor.c (mail_signature_editor): fix some typos, - set label usize to 500, -2 - (menu_help): added help link to Help menu - -2002-06-06 Jeffrey Stedfast <fejj@ximian.com> - - * mail-account-gui.c (mail_account_gui_save): If this account is - not a completely new account (ie, it is an edited account), then - remove any trace of it from the shell storages. If the new account - belongs in the folder-tree, add it to the list of storages. - - * component-factory.c (mail_add_storage): New function to add a - single storage. - -2002-06-06 Radek Doulik <rodo@ximian.com> - - * mail-composer-prefs.c (mail_composer_prefs_construct): disable - edit and delete when there are no signatures defined - -2002-06-06 Not Zed <NotZed@Ximian.com> - - * message-list.c (mail_regen_list): Keep track of the regeneration - request in a list. - (regen_list_free): Remove the request from the regenreation list. - (message_list_set_folder): If there are any outstanding - regneration requests, cancel them. - (regen_list_regened): If we were cancelled, do nothing. - (regen_list_regen): If we were cancelled, shortcut processing. - This is all for #23571. - - * message-list.c (regen_list_regen): Change the way we calculate - the hide deleted messages and tree view options. Do it based on a - search and uid's rather than a summary. - (regen_list_regened): Handle changes to tree storage. - (mail_regen_list): The tree is now stored between updates, so we - can update the tree structure incrementally. This blows out - memory use some however. We need an etree that uses this as its - model directly? - (message_list_destroy): Free the thread tree. - (message_list_set_folder): Clear the thread tree when changing - folder. - -2002-06-05 Jeffrey Stedfast <fejj@ximian.com> - - * mail-format.c (mail_get_message_rfc822): Don't forget to free - the date string buffer. - -2002-06-05 Radek Doulik <rodo@ximian.com> - - * mail-composer-prefs.c (sig_fill_clist): use gtk string instead - of utf8 one - -2002-06-04 Jeffrey Stedfast <fejj@ximian.com> - - The following changes take a great leap toward fixing bug #1042. - - * mail-display.c (mail_display_push_content_location): New - function to push a Content-Location value onto the MailDisplay. - (mail_display_get_content_location): Gets the current - Content-Location CamelURL value. - (mail_display_pop_content_location): Pop the Content-Location off - the stack. - - * mail-format.c (get_location): Do URL merging if the - Content-Location isn't a full URL. If the Content-Location doesn't - exist, pretend the URL is actually the Content-Location URL of our - parent multipart (assuming it exists). If that doesn't exist, then - yes - return NULL. - (handle_multipart_related): Push the Content-Location header value - of the multipart/related so that we can do URL merging in - get_location() as we process each of the subparts. When we're - done, pop it back off the stack. - -2002-06-04 Christopher James Lahey <clahey@ximian.com> - - * message-list.etspec: Added priorities. - -2002-06-04 Christopher James Lahey <clahey@ximian.com> - - * folder-browser-ui.c (folder_browser_ui_setup_view_menus): Set - the title of our GalViewCollection. - -2002-06-04 Not Zed <NotZed@Ximian.com> - - * mail-accounts.c (mail_accounts_tab_construct): Duh, we want to - set the news_edit/delete buttons for the news page, not overwrite - the mail ones! That would've saved a bit of angst ... - - * mail-config-druid.c (extra_prepare): dont call build_extra_conf, - otherwise it blows away any settings with defaults. - -2002-06-04 Jeffrey Stedfast <fejj@ximian.com> - - * mail-account-gui.c (mail_account_gui_save): Write the signature - after the account has been added. - (sig_new_html): Don't write the signatures at this time. - (sig_new_text): Same. - -2002-06-03 Jeffrey Stedfast <fejj@ximian.com> - - * mail-accounts.c (account_delete_clicked): Correctly get the - GtkWindow ancestor of the prefs widget. - -2002-06-03 Not Zed <NotZed@Ximian.com> - - * mail-callbacks.c (composer_get_message): Changed to check - everything from the composer before the message is requested. - Otherwise we could end up signing/encrypting it twice, etc. - - * mail-format.c (handle_multipart_signed): removed some dead wood. - -2002-06-03 Jeffrey Stedfast <fejj@ximian.com> - - * component-factory.c (request_quit): Prompt the user to see if he - really wants to quit when there are queued messages in the Outbox. - -2002-06-01 Not Zed <NotZed@Ximian.com> - - * mail-local.c (mlf_getv): Implement, return a text description of - the localfolder. - - * message-list.c (ml_duplicate_value): - (ml_free_value): - (ml_initialize_value): - (ml_value_is_empty): - (ml_value_to_string): - (ml_tree_value_at): Implement COL_LOCATION, original location of - message (useful for vfolder). - -2002-06-02 Larry Ewing <lewing@ximian.com> - - * mail-tools.c (mail_tool_quote_message): make these citations as - well. - - * mail-format.c (handle_text_plain_flowed): make these blockquotes - into citations. - -2002-05-31 Not Zed <NotZed@Ximian.com> - - * mail-format.c (handle_multipart_signed): Changed to handle new - multipart-signed type. - -2002-05-30 Jeffrey Stedfast <fejj@ximian.com> - - * mail-send-recv.c (mail_send_receive): Noop if we are in offline - mode. - - * component-factory.c (mail_remove_storage): If the store is not - in the storage hash, then it must not have ever been added. Fixes - bug #25456. - - * mail-callbacks.c (view_msg): Oops, create a message-browser - window here, not a folder-browser-window window. - -2002-05-29 Radek Doulik <rodo@ximian.com> - - * mail-composer-prefs.c: moved spell checking options to separate - page, updated UI by Anna's design - - * mail-accounts.c (mail_accounts_load): use _ instead of U_ for - clist - (mail_accounts_tab_construct): justify marks column to right - -2002-05-28 Jeffrey Stedfast <fejj@ximian.com> - - * folder-browser-window.c (folder_browser_window_new): Revert a - failed idea. - -2002-05-24 Radek Doulik <rodo@ximian.com> - - * mail-composer-prefs.c (mail_composer_prefs_construct): ops, - revert array size - -2002-05-24 Jeffrey Stedfast <fejj@ximian.com> - - * mail-callbacks.c (mail_generate_reply): If we can't find the - mailing list address in the recipients list, just Reply-to-All - instead. - -2002-05-23 Jeffrey Stedfast <fejj@ximian.com> - - * folder-browser-window.c (folder_browser_window_new): Set the ui - to be the evolution-mail-global.xml file thingy. Still broken but - oh well. I give up. bonobo-ui sucks. - - * message-browser.c (set_bonobo_ui): Fixed to not crash. - -2002-05-23 Jeffrey Stedfast <fejj@ximian.com> - - * folder-browser-window.c (folder_browser_window_new): If the - folder-browser has a parent, reparent it. - - * message-browser.[c,h]: Revert back to the old broken - implementation since that's what users want. They're not happy - unless it's broken. - -2002-05-23 Radek Doulik <rodo@ximian.com> - - * mail-composer-prefs.c: be more careful about language_str{_orig} - (mail_composer_prefs_construct): add auto smiley check button - -2002-05-21 Jeffrey Stedfast <fejj@ximian.com> - - * mail-account-gui.c (sig_fill_options): Only clear the text/html - signature menus if they are non-NULL. - - * mail-composer-prefs.c (spell_save_values): Use a new macro, - STR_EQUAL, to tell if the 2 values are equal or not rather than - using strcmp since one or both strings could be NULL. - -2002-05-21 Not Zed <NotZed@Ximian.com> - - * folder-browser.c (folder_browser_config_search): Split the - search word up for a body search and add it to the tokeniser to - highlight. - -2002-05-18 Not Zed <NotZed@Ximian.com> - - * e-searching-tokenizer.c - (e_searching_tokenizer_add_primary_search_string): - (e_searching_tokenizer_add_secondary_search_string): New functions - to add additional search strings one at a time. Maybe it should - just split the word itself? - (all): Basically, entirely rewritten. Now implements the - Aho-Corasick multiple pattern search algorithm and handles - multiple search strings and only ever has to decode any utf8 - character once, etc etc. - -2002-05-20 Jeffrey Stedfast <fejj@ximian.com> - - * mail-format.c (mail_get_message_body): Only get the contents of - a mime part if it is marked as "inline". Fixes bug #7527. - - * mail-display.c (mail_display_render): Fixed the "Overdue:" - string to not contain any HTML tags. - -2002-05-20 Ettore Perazzoli <ettore@ximian.com> - - * subscribe-dialog.c (recursive_add_folder): Pass TRUE for - @sync_offline to evolution_storage_new_folder(). - - * mail-folder-cache.c (real_flush_updates): Pass TRUE for - @sync_offline to evolution_storage_new_folder(). - -2002-05-20 Ettore Perazzoli <ettore@ximian.com> - - * mail-callbacks.c (composer_sent_cb): Always unref the composer - [even when we are destroying it], otherwise we leak it and we get - the nasty bug where you can't quit. - -2002-05-16 Jeffrey Stedfast <fejj@ximian.com> - - * message-list.c (ml_tree_value_at): Check for a label tag when - doing a lookup on the COLOR column. - - * mail-config.c (mail_config_get_label_color_string): Return the - colour in string format. - - * folder-browser.c (set_msg_label): Replaces colourise_msg and - sets the "label" tag rather than the "colour" tag. - - * mail-preferences.c (mail_preferences_apply): Call - mail_config_write() so that the settings get synced to disk. - -2002-05-16 Ettore Perazzoli <ettore@ximian.com> - - * component-factory.c (request_quit): New. - (create_component): Pass it as the @request_quit_fn to - evolution_shell_component_new(). - -2002-05-15 Ettore Perazzoli <ettore@ximian.com> - - * component-factory.c (create_component): Pass NULL as - @request_quit_fn. - -2002-05-15 Not Zed <NotZed@Ximian.com> - - * mail-ops.c (prep_offline_do): - (prep_offline_done): - (prep_offline_free): - (mail_prep_offline): Implement prep_offline for an individual - folder. - (set_offline_do): Only call disco_store_set_status or disconnect - for the store, dont do any offline prep stuff. - - * mail-offline-handler.c: Applied patch from Ettore to hook in - extra offline interfaces. - (impl_destroy): Dont free listener here anymore, its removed, but - free sync table. - (mail_offline_handler_init): Same for setup. - (impl_syncFolder): Implement. - (sync_done): handles finalising synchronisation of 1 folder. - (sync_status): progress reporting, camel side. - (sync_timeout): progress reporting, gmainloop side. - (impl_cancelSyncFolder): Implement. - (impl_goOffline, storage_go_offline, went_offline): Dont copy the - listener to our struct - its an argument, not a member, so give - each thread its own copy. - -2002-05-15 Jeffrey Stedfast <fejj@ximian.com> - - * message-list.c (ml_tree_value_at): Instead of g_assert()ing that - the msg_info is not NULL, if it is NULL just return NULL. This - fixes a crash when ETree requests the value at a root node (I - don't understand why it needs to do that??). - -2002-05-14 Jeffrey Stedfast <fejj@ximian.com> - - * folder-info.h: Added. - -2002-05-14 Christopher James Lahey <clahey@ximian.com> - - * component-factory.c: Added #include "folder-info.h". - - * folder-browser-window.c (folder_browser_window_new), - mail-account-editor.c (apply_changes), mail-account-gui.c - (mail_account_gui_save), message-tag-editor.c: Removed some unused - variables. - - * folder-info.c: Added #include "folder-info.h". Removed static - declaration of evolution_folder_info_get_type. - - * folder-info.c (destroy), mail-callbacks.c - (confirm_goto_next_folder, find_current_folder, - find_next_folder_r, find_next_folder, - do_evil_kludgy_goto_next_folder_hack), mail-composer-prefs.c - (sig_name_changed): Commented out these unused functions. - - * mail-config.c (add_new_storage): Removed this unused function. - - * mail-local.c (mlf_init): Fix the declaration of this function to - match the required signature. - -2002-05-13 Christopher James Lahey <clahey@ximian.com> - - * message-list.etspec: Added search="string" where appropriate. - -2002-05-13 Dan Winship <danw@ximian.com> - - * (various places): Update for camel_folder_append_message / - camel_folder_transfer_messages_to API change. - - * mail-ops.c (mail_append_mail): Pass the appended_uid to the - callback. - - * mail-callbacks.c (composer_save_draft_cb, save_draft_done, - do_edit_messages): Take advantage of the append_message change to - keep track of the UID of the saved draft so that we can delete the - old copy of the draft each time we save a new one. Remove the - FIXME suggesting we should do that, since we're doing it now. :) - -2002-05-10 Jeffrey Stedfast <fejj@ximian.com> - - * mail-callbacks.c (do_view_message): Update for the new - message-browser api. - - * message-browser.c (message_browser_new): A brand new - implementation that just shows the message, none of that next/prev - crap that always caused problems anyway. - - * mail-config.c (mail_config_add_account): Don't add any shortcuts - here. - (mail_config_remove_account): And don't remove them here. This - code has never worked properly. - - * mail-ops.c (save_part_save): Use the exception enum names rather - than '1' since it makes the code clearer. - -2002-05-10 Dan Winship <danw@ximian.com> - - * mail-ops.c (transfer_messages_transfer): Simplify. Use - transfer_messages_to instead of picking between copy and move. - Remove vtrash special-casing since it's all in - camel-vtrash-folder.c now. Remove duplicate source == dest check. - - * mail-local.c (mail_local_folder_reconfigure): Use - transfer_messages_to instead of copy_messages_to. - -2002-05-09 Jeffrey Stedfast <fejj@ximian.com> - - * mail-account-gui.c (mail_account_gui_save): Make sure that even - if the new source url is NULL, that we preserve the enabledness of - the source. - -2002-05-09 Ettore Perazzoli <ettore@ximian.com> - - * component-factory.c (add_storage): Pass %FALSE as - @has_shared_folders to evolution_storage_new(). - -2002-05-09 JP Rosevear <jpr@ximian.com> - - * Makefile.am: dist Spell.idl - -2002-05-08 Radek Doulik <rodo@ximian.com> - - * mail-composer-prefs.c: implemented (c'n'p-ed and updated) spell - checking settings - -2002-05-08 Iain Holmes <iain@ximian.com> - - * component-factory.c (owner_set_cb): Tell the folder info listeners - that they're ready. - - * folder-info.c: Add a property bag to the CORBAObject. - (do_get_info): Remove a load of cruft. Add some error checks. - (do_free_info): Unref the listener. - (destroy): Unref the propertybag. - (set_prop): Set the property. - (get_prop): Get the property. - (evolution_folder_info_factory_fn): Create a propertybag. - (evolution_folder_info_notify_ready): Notify all the listeners that - the folder info is ready for querying. - -2002-05-08 Not Zed <NotZed@Ximian.com> - - * mail-autofilter.c (mail_filter_rename_uri): Changed for - rule_context_rename_uri api changes. - (mail_filter_delete_uri): Same. Also, popup a dialogue similar to - vfolder deleted dialogue to notify the user something has - changed. Partial fix for #18826. - -2002-05-06 Jeffrey Stedfast <fejj@ximian.com> - - * mail-ops.c (filter_folder_free): Flush the filter log to make - Tuomas happy :-) - - * mail-session.c (mail_session_flush_filter_log): New convenience - function to flush the session's filter log file. - - * mail-callbacks.c (mail_reply): Set the Seen flag as well since - it's safe to assume that if the user has replied to an email - message that he has read it. Not always true, but usually ;-) - - * folder-browser.c (on_right_click): If we are in a - Sent/Drafts/Outbox folder, don't show the "Add Sender to - Addressbook" menu item. - -2002-05-06 Not Zed <NotZed@Ximian.com> - - * component-factory.c (idle_quit): Check all threads are idle as - well, using new e_thread_busy call. Should fix #22553? Also - sleep a little bit, to let the other threads run. - -2002-05-01 Jeffrey Stedfast <fejj@ximian.com> - - * mail-account-gui.c (sig_new_text): Update the code to actually - work. - (sig_new_html): Same. - - * mail-composer-prefs.c (mail_composer_prefs_new_signature): Allow - 'prefs' to be NULL. - - * folder-browser.c (on_right_click): Fix the filter_menu static - array to use the E_POPUP_MENU_CC macros since we plan on using - custom closures for this. - (on_right_click): Fixed so that you can "Edit as New" for any Sent - folder and not just the local Sent folder. - -2002-05-01 Not Zed <NotZed@Ximian.com> - - * folder-browser.h (FOLDER_BROWSER_IS_DESTROYED): Also check - folder!=NULL. Fixes race where folder isn't setup yet, and - neither is bonobo menu status (because its delayed), and we get a - menu event before we're setup yet. For bug #21939. - -2002-04-30 Dan Winship <danw@ximian.com> - - * mail-callbacks.c (delete_msg): If the folder's permanent_flags - don't include CAMEL_MESSAGE_DELETED, don't do anything. (In - particular, don't move the cursor.) - -2002-04-29 Jeffrey Stedfast <fejj@ximian.com> - - * message-tag-followup.c (message_tag_followup_append_message): - Convert UTF-8 to gtkstrings since we are using a clist and not an - E-widget that takes UTF-8. - - * mail-display.c (mail_display_add_url): If the data-urls is NULL, - add a data-urls hash to the datalist. This finishes up bug #90. - - * mail-account-gui.c (save_service): Strip leading/trailing - whitespace from the username because users sometimes accidently - add extra spaces here and there. Fixes bug #24009 (along with a - number of other "bugs"). - (mail_account_gui_auto_detect_extra_conf): Use a CamelURL instead - of a GHashTable *settings. Also parse out the port # from the - hostname. - -2002-04-29 Larry Ewing <lewing@ximian.com> - - * mail-composer-prefs.c (mail_composer_prefs_construct): clean up - propmanager initialization code. - - * mail-preferences.c (mail_preferences_construct): small clean - ups to propmanager code. - - * mail-config-factory.c (config_control_factory_cb): handle - requests for the font manager control. - - * mail-config.glade: add fonts tabs and reorder composer options - to match the new dialogs from anna. - - * GNOME_Evolution_Mail.oaf.in: add font manager control definition. - - * mail-composer-prefs.c (mail_composer_prefs_construct): hook to - the gtkhtml propmanager. - (mail_composer_prefs_apply): apply propmanager changes. - (mail_composer_prefs_finalise): unref the propmanager. - - * mail-composer-prefs.h: add propmanager member. - - * mail-font-prefs.c: initialize gui properly. - - * mail-preferences.c (mail_preferences_construct): hook to - gtkhtml's propmanager. - (mail_preferences_apply): apply propmanager changes. - (mail_preferences_finalise): unref the propmanager. - - * mail-preferences.h: add propmanager member. - - * Makefile.am (evolution_mail_SOURCES): add mail-font-prefs.[ch] - to the build. - - * mail-tools.c (mail_tool_quote_message): use the html reply logic - even for plain parts so that we can test out the new gtkhtml cite logic. - - * importers/evolution-mbox-importer.c (process_item_fn): add const - to silence warning. - - * mail-display.c: add gtkhtml.h include so to pick up the - object_relative prototype. - -2002-04-26 Larry Ewing <lewing@ximian.com> - - * mail-font-prefs.c: Add the font config dialog. - - * mail-font-prefs.h: add font config dialog headers. - -2002-04-26 Jeffrey Stedfast <fejj@ximian.com> - - * Makefile.am: Don't link with libibex anymore, it's been - deprecated. - - * mail-callbacks.c (next_unread_msg): Do away with the - goto-next-folder stuff, it's very annoying. - - * mail-config-druid.c (extra_prepare): After building the extra - config options into a Gtk form, auto-detect any values that we can - and populate them by calling - mail_account_gui_auto_detect_extra_conf. - - * mail-account-gui.c (mail_account_gui_auto_detect_extra_conf): - New function to auto-detect the extra config options for a source. - -2002-04-24 Jeffrey Stedfast <fejj@ximian.com> - - * mail-account-gui.c (mail_account_gui_build_extra_conf): Allow - providers to override text entry boxes too. - (source_type_changed): Remove the logic to decide upon default - paths, these paths can now be set by the provider. - -2002-04-24 Jeffrey Stedfast <fejj@ximian.com> - - * folder-browser.c (label_menu): Update to use - E_POPUP_MENU_PIXMAP_WIDGET_ITEM_CC so that our callback gets - called without per-item closure rather than being called with NULL - and causing a segfault. - - * mail-account-gui.c (mail_account_gui_build_extra_conf): Set the - default Username label and handle the new - CAMEL_PROVIDER_CONF_LABEL enum allowing the provider to setup a - label. - -2002-04-23 Jeffrey Stedfast <fejj@ximian.com> - - * mail-accounts.c: Added back the checkmark icon for enabled - accounts. - (account_able_clicked): Don't reload the accounts list, that was - just lame. - -2002-04-22 Jeffrey Stedfast <fejj@ximian.com> - - * mail-display.c (mail_display_render): Plug-in Anna's html for - the flag-for-followup stuff. Finishes up bug #90. - -2002-04-19 Jeffrey Stedfast <fejj@ximian.com> - - * folder-browser.c (folder_browser_finalise): Free the - loading/pending/new/loaded_uid string buffers. - - * mail-config.c (config_read_signature): Free some temporary path - buffers. - - * mail-display.c (stream_write_or_redisplay_when_loaded): Ref the - html object here, this is an async handler so it's possible for - our caller (or someone else) to unref the html object before we - finish. - (load_content_free): Unref the async handler's ref of the html - object here. - (mail_display_new): Ref the html widget here so that we can be - sure that so long as the mail-display is "alive", so is the html - object. See bug #22328 for details. Basically, the message-browser - is being closed before the message gets loaded and so the html - object was being destroyed but the mail-display was still alive. - (mail_display_destroy): Unref the html object when the - mail-display is destroyed. - -2002-04-19 Anna Marie Dirks <anna@ximian.com> - - * mail-config.glade: Added yet more accelerators for the new config - dialog--this time for the composer pages - -2002-04-19 Anna Marie Dirks <anna@ximian.com> - - * mail-config.glade: Added a bunch of accelerators for the new config - dialog - -2002-04-18 Jeffrey Stedfast <fejj@ximian.com> - - * mail-callbacks.c (redirect_get_composer): Removed all - Delivered-To headers before redirecting. Fixes bug #23635. - -2002-04-18 Radek Doulik <rodo@ximian.com> - - * mail-callbacks.c (do_mail_print): use default paper name in case - of wrong translation - -2002-04-15 Not Zed <NotZed@Ximian.com> - - * mail-identify.c (mail_identify_mime_part): Turn off the code - which downloads the part if we can't identify it. See discussion - in #11778. - -2002-04-17 Christopher James Lahey <clahey@ximian.com> - - * folder-browser.c, mail-display.c: Updated these to match the new - EPopupMenu. - -2002-04-17 Jeffrey Stedfast <fejj@ximian.com> - - * mail-format.c (handle_multipart_signed): Handle broken - multipart/signed parts such as where the signature part is not the - last part (as it should be). Fixes bug #23583. - - * folder-browser.c (message_list_drag_data_get): Free the temp - GByteArrays. - -2002-04-17 Jeffrey Stedfast <fejj@ximian.com> - - * mail-local.c (mail_local_folder_construct): Just use g_basename. - (mlf_finalize): Free the real_path. - - * folder-browser.c (on_right_click): Unref the GdkGC so we don't - leak it. - -2002-04-16 Jeffrey Stedfast <fejj@ximian.com> - - * mail-tools.c (mail_tool_destroy_xevolution): Free the format - string. - - * mail-config.c (config_write_signature): Don't leak the path - strings here. - - * mail-signature-editor.c (menu_file_save_cb): Free the dirname - string. - - * mail-config-factory.c (config_control_factory_cb): Ref the prefs - widget here since we unref in the destroy callback. Caught this - thanks to purify. - -2002-04-13 Jeffrey Stedfast <fejj@ximian.com> - - * mail-accounts.c: Build fixes for --enable-nntp. - -2002-04-13 Christophe Merlet <redfox@eikonex.org> - - * mail-config.glade: Little typo. s/IS0/ISO/ - -2002-04-12 Jeffrey Stedfast <fejj@ximian.com> - - * mail-composer-prefs.c (mail_composer_prefs_construct): Make it - so that unchecking the "Enable Advanced Options" in the signature - tab disables the advanced settings and vise versa. - - * mail-accounts.c (mail_accounts_tab_construct): Setup News - preferences too if it is enabled. - - * mail-account-gui.c (mail_account_gui_new): Set the text of the - reply-to. - (mail_account_gui_save): Get the reply-to text here. - (mail_account_gui_identity_complete): If there is text in the - reply-to widget make sure it's valid. - - * mail-config.c (identity_copy): Copy the reply-to. - (config_read): Read in the reply-to for all the accounts. - (mail_config_write): Save the reply-to. - (impl_GNOME_Evolution_MailConfig_addAccount): Get the reply-to. - (identity_destroy): Free the reply-to. - -2002-04-11 Jeffrey Stedfast <fejj@ximian.com> - - * message-list.etspec: s/Sent/Date. This fixes bug #11159. - -2002-04-10 Jeffrey Stedfast <fejj@ximian.com> - - * mail-callbacks.c (confirm_expunge): Set the 'No' button as the - default. - -2002-04-10 Dan Winship <danw@ximian.com> - - * mail-config.c (config_read, mail_config_write, - mail_config_get_x_mailer_display_style, - mail_config_set_x_mailer_display_style): Handle the X-Mailer - display style. (There is currently no GUI for configuring this.) - - * mail-format.c (write_headers, write_xmailer_header): Show - X-Mailer/User-Agent (and Rupert's stamp of approval) as - appropriate. - -2002-04-09 Jeffrey Stedfast <fejj@ximian.com> - - * mail-account-gui.c (setup_service): Kludge around the brokeness - that is GtkOptionMenu just like we kludge around it for the - authtype option menu. - -2002-04-09 Dan Winship <danw@ximian.com> - - * component-factory.c (create_view): Add view_info arg, but don't - do anything with it. - -2002-04-08 Not Zed <NotZed@Ximian.com> - - * mail-send-recv.c (receive_update_got_folderinfo): Argh! - get_folder_info owns and frees its *OWN* folder info, it shouldn't - be free'd here! See mail-ops.c:get_folderinfo_free. - This should fix #17259 and friends. - -2002-04-08 Jeffrey Stedfast <fejj@ximian.com> - - * mail-signature-editor.c (menu_file_save_cb): Simplify a bit and - write to a temp file first and then rename() it to the real - filename. This protects against losing data if the drive is full - too. Also use a real mode, not 0, so that we can actually - save/read the content ;-) - - * GNOME_Evolution_Mail.oaf.in: Re-added the config wizard - interfaces. Ettore accidently removed them thinking they were - duplicates of the new mail-config interfaces. - - * mail-config.glade: Remove the OK, Apply, Cancel buttons from the - keyboard shortcut tab in the composer_prefs dialog. - - * mail-account-gui.c: No need to check gui->source before using - gui->source->url, since gui->source *has* to exist. - -2002-04-06 JP Rosevear <jpr@ximian.com> - - * GNOME_Evolution_Mail.oaf.in: add config_item:type - -2002-04-04 Dan Winship <danw@ximian.com> - - * mail-account-gui.c (mail_account_gui_new): Make the drafts and - sent folder buttons be EvolutionFolderSelectorButtons. Remove the - code to deal with drafts_folder_name and sent_folder_name, since - they were only used to construct the button and aren't needed now. - (mail_account_gui_save): Remove drafts/sent name references. - (mail_account_gui_destroy): Likewise - (folder_selected): Handle the "selected" signal on the folder - selector button by updating the URI in the MailAccountGui. - (mail_account_gui_folder_selector_button_new): Glade custom widget - constructor. - - * mail-callbacks.c (transfer_msg): Update for - evolution_shell_client_user_select_folder change. - - * message-browser.c (transfer_msg): Likewise. (Sigh. Why is this - cut+pasted?) - - * mail-config.glade: Make the drafts/sent folder buttons custom - widgets. - - * mail-config.c (account_copy): Remove drafts/sent folder name - handling. - (account_destroy): Likewise. - (config_read): Likewise. - (mail_config_write): Likewise. - - * Mail.idl (MailConfig:Account): remove drafts_folder_name and - sent_folder_name. - -2002-04-03 Jeffrey Stedfast <fejj@ximian.com> - - * message-tag-followup.c (construct): Set the window title/icon - here instead. - - * message-tag-editor.c (message_tag_editor_init): Don't set the - title or window icon here, this is a generic class. - - * mail-format.c (handle_multipart_signed): Replace - get_url_for_icon with the new mail_display_get_url_for_icon - function. - (handle_multipart_digest): Here too. - (get_cid): Use mail_display_add_url instead. - (get_location): Same. - (handle_text_enriched): Here too. - (handle_multipart_signed): And here. - - * message-tag-followup.c (message_tag_followup_i18n_name): Use the - U_() macro, not the _() macro as it is what we really want. - - * mail-ops.c (mail_send_message): Don't cast the message into a - CamelMedium before sending anymore. - - * mail-callbacks.c (expunge_folder): Set the followup argument to - NULL here. - (done_message_selected): Get the followup value here and pass it - to the mail-display here. - (do_mail_fetch_and_print): Again with the NULL followup here. - - * folder-browser.c (folder_browser_set_message_preview): Update to - pass in NULL as the followup since we are setting the message to - NULL here. - (done_message_selected): Get and set the appropriate followup - value here. - (do_message_selected): Update to pass in NULL as the followup - since we are setting the message to NULL here. - - * mail-display.c (mail_display_set_message): Now takes a followup - tag value. - (mail_display_init): Set md->followup to NULL. - (mail_display_destroy): Free md->followup. - (mail_display_add_url): New: replaces the static add_url function - originally in mail-format.c - (mail_display_get_url_for_icon): New: replaces get_url_for_icon - which was originally in mail-format.c - -2002-04-03 Dan Winship <danw@ximian.com> - - * mail-account-gui.c: Changes to allow combined store/transport - providers (like exchange and nntp). You can only select the - transport if the account is also using that provider for the - source. - (source_type_changed): If changing away from a combined - store/transport type, disable that provider on the transport page. - If change to a combined store/transport type, enable and select - that provider on the transport page. - (mail_account_gui_setup): Do some additional bookkeeping here to - make the above stuff work. - (transport_type_changed): If the provider is a combined - store/transport type, pretend it doesn't need any additional URL - configuration. - (mail_account_gui_transport_complete): if the transport provider - is also a store provider, then as long as it matches the source - for the account, it's considered complete. - (mail_account_gui_save): If the selected transport is a combined - store/transport provider, use the source page's information to - fill in the transport url. - - * mail-local.c (mail_local_provider_init): Don't set up - service_cache. - -2002-04-02 Jeffrey Stedfast <fejj@ximian.com> - - * mail-callbacks.c (do_edit_messages): Pass the UID of the message - being edited to the save-draft signal handler. - (composer_save_draft_cb): Pass the old draft uid to our async - append_message function and let the append_message callback worry - about deleting the old draft message on success. - (save_draft_done): Delete the old draft message if we successfully - appended the new draft message. - -2002-04-01 Jeffrey Stedfast <fejj@ximian.com> - - * folder-browser-ui.c: Removed an unused pixmap from - Tools/Settings to avoid a big nasty bonobo warning. - - * mail-composer-prefs.c (mail_composer_prefs_construct): - Re-Implemented the signature editor stuff (mostly just copy/paste - from Radeks original code). - - * mail-signature-editor.c (mail_signature_editor): Use the right - oafiid for the html editor control. - -2002-04-01 Dan Winship <danw@ximian.com> - - * importers/Makefile.am (liboutlook_la_LDFLAGS, - libmbox_la_LDFLAGS): Use -avoid-version -module. (From Max Horn - <max@quendi.de>) - -2002-03-29 Ettore Perazzoli <ettore@ximian.com> - - * GNOME_Evolution_Mail.oaf.in: Added priorities for all the - configuration pages [evolution:config_item:priority]. - -2002-03-29 Jeffrey Stedfast <fejj@ximian.com> - - * mail-preferences.c (colorpicker_get_color): Don't shift the r, g - and b values here either. - - * mail-composer-prefs.c (colorpicker_get_color): Don't shift the - r, g, b values. - - * mail-preferences.c (mail_preferences_construct): Restore the - labels & colours options from the grave. - (mail_preferences_apply): Save these labels & colours options. - -2002-03-29 Jeffrey Stedfast <fejj@ximian.com> - - * mail-composer-prefs.c (mail_composer_prefs_construct): Same - here. - - * mail-preferences.c (mail_preferences_construct): Do some gtk - hackery action so we can detect if a option menu has changed. - -2002-03-29 Ettore Perazzoli <ettore@ximian.com> - - * GNOME_Evolution_Mail.oaf.in: Cleaned up a bunch [removing - duplicates ;-)], set up icons for all the configuration pages. - -2002-03-28 Jeffrey Stedfast <fejj@ximian.com> - - * mail-accounts.c: Use a GtkCList instead of an ETable, for some - reason the etable was getting into some infinite resize loop or - something. I probably did something wrong but I can't figure out - what so I'm using a clist for now. - (account_cursor_change): Make sure that event is non-NULL here. - -2002-03-27 Ettore Perazzoli <ettore@ximian.com> - - * mail-accounts.c (mail_accounts_tab_construct): Use - gtk_container_add() to put the toplevel in the parent widget, - instead of just gtk_widget_set_parent(). - * mail-preferences.c (mail_preferences_construct): Likewise. - * mail-composer-prefs.c (mail_composer_prefs_construct): Likewise. - -2002-03-27 Jeffrey Stedfast <fejj@ximian.com> - - * mail-callbacks.c (mail_generate_reply): Updated to respect the - new mail-config options for default reply style that NotZed had - started to implement before there was a gui. - -2002-03-27 Dan Winship <danw@ximian.com> - - * mail-display.c (do_attachment_header): unset GTK_CAN_FOCUS on - the button so that it can't grab focus when you click it. - (do_signature): Likewise on the signature button. #3904 - -2002-03-26 Jeffrey Stedfast <fejj@ximian.com> - - Sync with yet-another-mail-config branch. - - * mail-composer-prefs.c: Updated to get the right widgets and - whatnot. Also updated to tell the evolution-config-control that - stuff has changed. - - * mail-preferences.c: Updated to get the right widgets and - whatnot. Also updated to tell the evolution-config-control that - stuff has changed. - - * mail-accounts.etspec: New file needed by mail-accounts.c - -2002-03-26 Not Zed <NotZed@Ximian.com> - - * mail-callbacks.c (addrbook_sender): Changed to get the address - from the messageinfo of the current selected message rather than - from the current_message. - (requeue_mail_reply): Only re-queue if we got a message, could - potentially cause an infinite loop trying to get a message it - can't. - (reply_to_sender, reply_to_list, reply_to_all): Always pass NULL - as the msg to mail_replay, this forces mail_reply to always load - the message anew. Fixes FIXME's and popup behaviour. Basically - this and stuff below fixes #8542. Its probably not the nicest - way, but it works. - (mark_as_important): Use the flags properly, we can set all flags - to any combination of on or off as we want, so we just need to - call set_flags once, thats why its set flags and not set_option. - (toggle_flags): Fixed the logic here also, so we dont have to call - set_message_flags more than once, and also implement a true toggle - for any number of simultaneous flags (whilst simplifying code). - - * mail-vfolder.c (vfolder_gui_add_from_mlist): Removed the 'msg' - parameter, its not used, fixed callers. - - * folder-browser.c (on_right_click): Lookup the mlist from - messageinfo, and change the 'no selected' logic slightly, fixes - most of #8542. - (filter_data_free): Free filter data struct. - (vfolder_type_got_message): Actually create vfolder once we have - the message we need to use for it. Code could probably be changed - to use messageinfo instead. - (vfolder_type_uid): Lookup a message based on uid, and use that to - create a vfolder based on type. - (vfolder_subject_uid, vfolder_sender_uid, vfolder_receipient_uid, - vfolder_mlist_uid): Callbacks for the popup menu, used to create - rules based on the uid rather than the message, which it loads as - required. - (filter_type_got_message, filter_*_uid): Similar to vfolder - stuff above. - (filter_menu[]): Changed callbacks to popup specific ones, not - folderbrowser specific ones used by bonobo. - (on_right_click): Initialise callback data for the filter submenu - so it can look up messages for callback implementation. - - * local-config.glade: New version from anna, with fixed widget - names. - -2002-03-20 Ettore Perazzoli <ettore@ximian.com> - - * folder-browser.c: Reorder folder_browser_search_menu_items - according to #16246. - -2002-03-24 Ettore Perazzoli <ettore@ximian.com> - - * mail-send-recv.c: Remove member current_folder from struct - _send_data. - (build_dialogue): Remove arg @current_folder. - (mail_send_receive): Likewise. - (free_send_data): No need to refresh the current folder here. - [Well, hopefully, at least.] - - * component-factory.c (send_receive_callback): New. - (create_component): Connect. - - * mail-callbacks.c (send_receive_mail): Removed. - - * folder-browser-ui.c: Remove "MailGetSend" verb. - -2002-03-22 Jeffrey Stedfast <fejj@ximian.com> - - * GNOME_Evolution_Mail.oaf.in: Add info about the new config - controls. - - * mail-config-factory.c: New file to handle the creation/etc of - the config controls. - - * mail-accounts.c: - - * mail-preferences.c: - - * mail-composer-prefs.c: No longer handle their own bonobo control - creation. - -2002-03-22 Jeffrey Stedfast <fejj@ximian.com> - - * mail-account-gui.c (sig_new_text): Temporarily #if 0 this - function out. - (sig_new_html): Same. - - * mail-config.c (config_read): Read in the default reply style - setting. - (mail_config_write_on_exit): Same the default reply style. - (mail_config_get_default_reply_style): New function to get the - default reply style. - (mail_config_set_default_reply_style): New function to set the - default reply style. - - * folder-browser-ui.c: There is no longer a Tools/Mail Settings - menu item. - - * mail-account-gui.c: Updated the widget types for the - MailAccountsDialog->MailAccountsTab change. - - * mail_account_editor.c: Same. - - * mail-callbacks.c (providers_config): Removed. - - * mail-composer-prefs.c: New file that implements the composer - preferences tab of anna's new config design. - -2002-03-21 Jeffrey Stedfast <fejj@ximian.com> - - * mail-accounts.c: Reimplemented. This time we only have to worry - about accounts. Also this now implements Annas config gui changes. - - * mail-preferences.c: Implements the mailer's Preferences tab in - Anna's new config GUI. - -2002-03-19 Larry Ewing <lewing@ximian.com> - - * mail-display.c: add missing NULL closure data to popup menu - initialization. - -2002-03-19 Dan Winship <danw@ximian.com> - - * Makefile.am (evolution_mail_LDADD): s/libversit.la/libversit.a/ - -2002-03-18 Ettore Perazzoli <ettore@ximian.com> - - * main.c (main): Report a message before entering bonobo_main() to - simplify debugging. - -2002-03-18 Ettore Perazzoli <ettore@ximian.com> - - * folder-browser.c: Remove E_FILTERBAR_RESET menu entry. - -2002-03-15 Jeffrey Stedfast <fejj@ximian.com> - - * folder-browser.c (on_right_click): Draw colour rectangles for - each of the colour items and set a closure on each. - (colourise_msg): colourise the message, yo. - -2002-03-15 Jeffrey Stedfast <fejj@ximian.com> - - * mail-callbacks.c (colour_msg): New callback to set a colour on a - message. - - * folder-browser.c (on_right_click): Setup our popup icons and - stuff. Also add a submenu for Labels. - - * mail-display.c (pixmap_press): Sync up with the new EPopupMenu - API. Note: This code can probably now be fixed to use per-item - closures - yay! - - * mail-accounts.c (construct): Connect to the label GtkEntry's and - GnomeColorPickers and also to the Restore Defaults button. - - * mail-config.c (mail_config_get_label_name): New function to get - a label's name. - (mail_config_set_label_name): New function to set the label name. - (mail_config_get_label_color): New function to get the label - color. - (mail_config_set_label_color): New function to set the label - color. - (config_read): Read in the config options for the labels and their - colors. - (mail_config_write_on_exit): Save the label options. - -2002-03-15 Larry Ewing <lewing@ximian.com> - - * mail-display.c: expand the relative urls of the object at the - point so that relative images can be saved correctly. - - * folder-browser.c: add a closing quote in a comment. - -2002-03-15 Ettore Perazzoli <ettore@ximian.com> - - * folder-browser-factory.c (control_activate): Set the UI - component on the search bar. - -2002-03-14 Dan Winship <danw@ximian.com> - - * component-factory.c (folder_types): Remove "mailstorage", since - it's not needed any more. - (storage_activate): Gone, although some of it is moved to - storage_connect. - (create_view): Remove mailstorage code. - (add_storage): Connect to the storage's open_folder signal. - Instead of creating a "mailstorage" folder, call - evolution_storage_has_subfolders to let the shell know we haven't - finished filling it in yet. - (storage_connect): Handler for the storage's asyncOpenFolder - signal. Call mail_note_store() to try to connect. - (storage_connected): Callback for above. If the connection attempt - failed, call evolution_storage_has_subfolders again to make the - shell re-close the storage. - - * mail-folder-cache.c (update_folders): Remove a piece of - mailstorage legacy code from here. - -2002-03-14 Radek Doulik <rodo@ximian.com> - - * mail-config.c (get_new_signature_filename): create new signature - file - (delete_unused_signature_file): be more careful about signature - file path before unlinking - -2002-03-14 Jeffrey Stedfast <fejj@ximian.com> - - * mail-callbacks.c (next_thread): Implemented. - - * message-list.c (message_list_select_next_thread): New function - to select the next thread. - -2002-03-13 Jeffrey Stedfast <fejj@ximian.com> - - * folder-browser-window.c (folder_browser_window_new): Set a - default size of the window, so we don't get this itty-bitty window - the size of a quarter on the screen when it first gets shown. - -2002-03-12 Jeffrey Stedfast <fejj@ximian.com> - - * mail-display.c (on_link_clicked): Handle digest: urls. - - * mail-format.c (setup_mime_tables): Add a handler for - multipart/digest. - (handle_multipart_digest): Handle multipart/digest parts. - -2002-03-12 Jeffrey Stedfast <fejj@ximian.com> - - * folder-browser.c (folder_browser_set_folder): Set the folder on - a folder-browser object. - - * folder-browser-window.c (folder_browser_window_new): Simple - window to display a folder-browser. - - * mail-callbacks.c (view_digest): New callback to open a - folder-browser-window with a digest folder. - -2002-03-08 Radek Doulik <rodo@ximian.com> - - * mail-signature-editor.c (menu_file_save_cb): truncate stream - before saving - - * mail-config.c (mail_config_signature_set_html): new function - - * mail-accounts.c (sig_event_client): watch for HTML changed event - - * mail-signature-editor.c: added HTML check menu item to Format - menu - -2002-03-08 Dan Winship <danw@ximian.com> - - * mail-config-druid.c (management_prepare): Rewrite this to not - use stpcpy, which isn't portable. - -2002-03-08 Radek Doulik <rodo@ximian.com> - - * mail-accounts.c (sig_event_client): handle name changed event - (sig_load_preview): don't run script before each reload - (sig_script_activate): run script only if script entry is - activated - - * mail-signature-editor.c (mail_signature_editor): added signature - name entry - -2002-03-07 Jeffrey Stedfast <fejj@ximian.com> - - * mail-config-druid.c (management_changed): Re-focus the account - name entry widget. - (identity_prepare): If a name is not set, try and get the user's - full name for them and set the text on the entry widget. - (management_prepare): If the account name is already taken, - generate a unique one by appending " (%d)". - -2002-03-07 Radek Doulik <rodo@ximian.com> - - * mail-account-gui.c (sig_new_html): make edit button sensitive - after new signature is created - (sig_new_text): ditto - -2002-03-07 Anna Marie Dirks <anna@ximian.com> - - * folder-browser.c: Made all the acclerators in the context menu - on a message work. (There are 22 different menu items here, so - picking a unique accelerator for each label was tricky, and some - of the choices I made are different from the ones I would have - made if there weren't so many stinking menu items.) - -2002-03-07 Jeffrey Stedfast <fejj@ximian.com> - - * mail-config.c (config_import_old_signatures): Don't use an - uninitialized 'id'. - -2002-03-07 Radek Doulik <rodo@ximian.com> - - * mail-signature-editor.c: notify accounts dialog about signature - content change - - * mail-accounts.c (run_script): run script only if file regular - file exists and has x flag - - * mail-signature-editor.c (mail_signature_editor): set initial - focus to editor - (do_exit): use hasUndo to avoid question dialog when content is - unchanged - -2002-03-07 Dan Winship <danw@ximian.com> - - * component-factory.c (add_storage): Update for storage changes: - explicitly create a root folder. - -2002-03-06 Dan Winship <danw@ximian.com> - - * mail-display.c (mail_display_render): Fix the "don't scroll back - to the top of the HTML widget when opening an attachment" hack - again by moving it here from mail_display_redisplay(). (It has to - happen after the gtk_html_begin.) - (mail_display_redisplay): Pass reset_scroll arg to - mail_display_render. - - * mail-callbacks.c (do_mail_print): Pass reset_scroll (TRUE) to - mail_display_render. - -2002-03-05 Dan Winship <danw@ximian.com> - - * folder-browser-ui.c: Don't try to set pixmap for - /Toolbar/MailCompose, since it doesn't exist any more. - -2002-03-05 Jeffrey Stedfast <fejj@ximian.com> - - * mail-account-gui.c (save_service): "use_ssl" can now be 3 - options, modify the code to handle this. - (setup_service): Toggle the correct ssl option. - (source_type_changed): Show/hide the ssl hbox container widget. - (transport_type_changed): Same. - -2002-03-05 Dan Winship <danw@ximian.com> - - * mail-folder-cache.c (mail_note_store): Pull up assertion change - from evolution-1-0-branch to allow external storages. - -2002-03-04 Jeffrey Stedfast <fejj@ximian.com> - - * mail-accounts.c (mail_unselect): If the clicked column was - column 0, enable/disable it. - (mail_select): Same. - - * mail-display.c (load_http): Added more debugging code to help - figure out why a certain image isn't loading - looks like - gnome-vfs is getting a premature EOF? - - * folder-browser.c (my_folder_browser_init): Connect to the - focus-in/out events on the message-list so that we can disable the - EditInvertSelection and EditSelectThread menu items when the - message-list is not in focus. - - * folder-browser-ui.c (folder_browser_ui_message_list_unfocus): - New function to de-sensitize some items if the message-list is not - in focus. - (folder_browser_ui_message_list_focus): New function to sensitize - some items if the message-list is not in focus. - - * mail-callbacks.c (invert_selection): Only invert the selection - of the message-list if it is the widget in focus. - - * message-list.c (message_list_select): Do not explicitly grab the - focus here. - -2002-03-04 Ettore Perazzoli <ettore@ximian.com> - - [Fix #19303.] - - * mail-ops.c (mail_send_message): Set X-Mailer to say "Ximian - Evolution", not just "Evolution". - -2002-03-01 Jeffrey Stedfast <fejj@ximian.com> - - * mail-callbacks.c (forward_message): Forward all selected - messages. Fixes bug #21190. - -2002-02-26 Jeffrey Stedfast <fejj@ximian.com> - - * mail-format.c (handle_text_html): Get the Content-Base if the - header exists and use gtk_html_set_base to set this base url. - - * mail-display.c (on_link_clicked): No longer need to calculate - the full url. This is now handled by GtkHTML. - (on_set_base): Removed. - (on_url_requested): No longer need to calculate the full url. - (mail_display_initialize_gtkhtml): Don't connect to the set_base - signal anymore. We don't care. - - * mail-display.h: No longer need base_url (it was broken anyway). - -2002-02-26 Not Zed <NotZed@Ximian.com> - - * mail-display.c (on_url_requested): If a related part is - requested, remove it from the related undisplayed list. - - * mail-format.c (handle_multipart_related): Check if related parts - are displayed, if not, remove them. For #2741. - -2002-02-24 Chris Toshok <toshok@ximian.com> - - * folder-browser.c (folder_browser_search_do_search): rename - folder_browser_search_query_changed to this. - (folder_browser_gui_init): hook both query_changed and - search_activated up to folder_browser_search_do_search, preserving - current behavior. - -2002-02-22 Jeffrey Stedfast <fejj@ximian.com> - - * message-list.c (on_message_list_built): Removed, this wasn't - working as intended and seemed to break other features. - -2002-02-21 Ettore Perazzoli <ettore@ximian.com> - - * component-factory.c (create_component): Add an icon for the "New - message" user creatable item. - -2002-02-21 Jeffrey Stedfast <fejj@ximian.com> - - * message-list.c (on_message_list_built): Connect to our own - message_list_built signal. Focus the list and select the first - unread message (or frst message depending). Fixes bug #3900. - -2002-02-20 Anna Marie Dirks <anna@ximian.com> - - * message-tag-editor.c (message_tag_editor_init): Gave the editor - window a title and an icon. - -2002-02-20 Anna Marie Dirks <anna@ximian.com> - - * message-tags.glade: Changed the policy for table2 so that it - does not expand/fill. This was necessary to allow the message list - as much growing room as possible. (And besides, there's no reason for - table2 to expand/fill; its child widgets can't change size. - -2002-02-19 Jeffrey Stedfast <fejj@ximian.com> - - * mail-callbacks.c (confirm_goto_next_folder): Prompt the user to - find out if he/she wants to go to the next folder with unread mail - in it. - (find_current_folder): Find a given CamelFolderInfo node based on - a given uri. - (find_next_folder_r): Recursively look for a CamelFOlderInfo node - which has unread messages. - (find_next_folder): Given a currently selected CamelFolderInfo - node, look for the next node containing unread messages. - (do_evil_kludgy_goto_next_folder_hack): Find the currently - selected folder and then find the very next folder after it that - contains unread messages and then select it via a CORBA call to - the shell. - (next_unread_msg): If we fail to find an unread message in the - message-list, prompt the user to find out if we should jump to the - next fodler containing unread messages. If so, call - do_evil_kludgy_goto_next_folder_hack(). - - * message-list.c (message_list_select): Return a boolean value - based on whether the call was successfull or not. - - * mail-config.c (mail_config_get_confirm_goto_next_folder): - (mail_config_set_confirm_goto_next_folder): - (mail_config_get_goto_next_folder): - (mail_config_set_goto_next_folder): All new functions, yay. - (config_read): Read in the confirm_goto_next_folder and - goto_next_folder config options. - (mail_config_write_on_exit): Same the options here. - -2002-02-15 Jeffrey Stedfast <fejj@ximian.com> - - * mail-account-gui.c (basename_from_uri): Ack, strip off the - leading '/' char and also only translate if it is a local uri, - imap folders and other external folders will be named by the user - so no need to translate those. - - * mail-display.c (do_attachment_header): Don't display a - down-arrow if the attachment is undisplayable. Fixes bug #6919. - (launch_cb): Some programs are buggy when it comes to parsing - file: uris, so make sure we do file://%s. Fixes bug #20456. - -2002-02-14 Jeffrey Stedfast <fejj@ximian.com> - - * mail-account-gui.c (basename_from_uri): Replacement for using - g_basename and also translates the basename string to fix bug - #7160. - (mail_account_gui_save): Use basename_from_uri(). - (folder_picker_clicked): Here too. - - * mail-callbacks.c (mail_generate_reply): Default the from-account - to the source account. If that fails, then guess the from-account - based on the recipients. Fixes bug #20479. - -2002-02-13 Jeffrey Stedfast <fejj@ximian.com> - - * mail-display.c (drag_data_get_cb): Implement. - (drag_data_delete_cb): Implement. - (do_attachment_header): Setup Drag & Drop. This implements - bugzilla bug #1066. - - * folder-browser-ui.c: Set the followup icon to use the new flag - icon rather than the exclamation mark icon. - - * mail-callbacks.c (flag_for_followup): Append the selected - messages to the clist in the followp editor. - - * message-list.c: Include the new flag-for-followup icon. - - * message-tag-followup.c (message_tag_followup_append_message): - New method to add a message to the message-list. - (construct): Get the message_list widget and load the flag icon - pixmap. - -2002-02-12 Jeffrey Stedfast <fejj@ximian.com> - - * message-tag-followup.c (set_widget_values): Fixed a bug. - - * mail-callbacks.c (flag_for_followup): If only 1 message is - selected and it happens to already be marked for follow-up, set - the value of the flag on the editor so the settings are restored. - - * folder-browser-ui.c: Set the pixmaps on MarkAsRead, MarkAsUnread - and MarkAsImportant bonobo verbs. Also connect to - flag-for-followup verb. - (folder_browser_ui_set_selection_state): Added MessageFollowUpFlag - verb to the array of verb strings. - - * folder-browser.c: Set key accelerators on the follow-up - right-click menu items to match Outlook. - -2002-02-12 Jeffrey Stedfast <fejj@ximian.com> - - * mail-callbacks.c (create_msg_composer): No longer need to call - e_msg_composer_show_sig_file(). This gets handled auto-magically - by a signal emition when the default From address chooser gets - created. - (do_forward_non_attached): No longer need to call it here either - because e_msg_composer_set_body_text() now makes sure to re-show - the signature. - -2002-02-12 Jeffrey Stedfast <fejj@ximian.com> - - * mail-callbacks.c (do_forward_non_attached): Show the signature. - -2002-02-11 Jeffrey Stedfast <fejj@ximian.com> - - * message-list.c (ml_tree_value_at): Get followup-up message-list - values. Also highlight the message in red if the due-by date is - past due (this is what Outlook does). - (ml_duplicate_value): Handle follow-up columns. - (ml_free_value): Same. - (ml_initialize_value): Here too. - (ml_value_is_empty): And here. - (ml_value_to_string): And finally here. - - * message-tag-followup.c (message_tag_followup_i18n_name): New - convenience function. - -2002-02-11 Radek Doulik <rodo@ximian.com> - - * mail-callbacks.c (create_msg_composer): unset changed, drop - editor undo - (mail_generate_reply): drop editor undo - (do_forward_non_attached): ditto - (do_forward_attach): ditto - (do_redirect): ditto - -2002-02-11 Jeffrey Stedfast <fejj@ximian.com> - - * folder-browser.c (followup_tag_complete): Implemented. - (on_right_click): Do better enabling/hiding of unwanted - flag-for-followup options. - -2002-02-09 Jeffrey Stedfast <fejj@ximian.com> - - * message-tag-followup.c (set_widget_values): Set the correct - drop-down menu item. - (message_tag_followup_encode): Return NULL if the type is NONE. - (clear_clicked): Set the drop-down menu to None. - (type_changed): Hide the None menu item. - (construct): Create a None menu item and set it as the default. - -2002-02-08 Jeffrey Stedfast <fejj@ximian.com> - - * message-tag-followup.[c,h]: New flag-for-followup tag editor - dialog. - - * mail-callbacks.c (flag_for_followup): New callback that pops up - a flag-for-followup editor dialog. - (flag_followup_completed): Marks all flag-for-followup'd messages - as 'complete'. - (flag_followup_clear): Clears all flag-for-followup tags from the - selected messages. - - * message-tags.glade: glade file for tag editors. - -2002-02-08 Jeffrey Stedfast <fejj@ximian.com> - - * message-tag-editor.[c,h]: Base class for a message tag editor. - - * folder-browser.c (on_right_click): Setup the hide/enable masks - for "Flag for Follow-up" - - * mail-callbacks.c (confirm_expunge): Instead of hiding deleted - messages and then expunging, disable the use of the message-list - completely during the expunge operation. - (expunged_folder): Re-enable the use of the message-list widget - here. - -2002-02-07 Radek Doulik <rodo@ximian.com> - - * mail-callbacks.c (mail_generate_reply): call set_body later to - allow ignored words to be sent to gtkhtml control ahead - -2002-02-07 JP Rosevear <jpr@ximian.com> - - * component-factory.c (create_component): remove "New" from user - creatable menu item - -2002-02-07 Christopher James Lahey <clahey@ximian.com> - - * folder-browser.c, folder-browser.h, folder-browser-ui.c, - folder-browser-ui.h - (folder_browser_ui_setup_view_menus, - folder_browser_ui_discard_view_menus): Changed this to use the new - GalViewMenus stuff. Made these exported functions. - - * mail-callbacks.c, message-browser.c: Changed these to not pass - the now removed row parameter to message_list_select. - - * mail-config.c, mail-config.h (mail_config_folder_to_safe_url): - Refactored this out of mail_config_folder_to_cachename. - - * message-list.c, message-list.h (message_list_select): Removed - the row argument. Changed this to use the new function in ETree - for finding the next cursor row that matches a test. - (message_list_construct): Handle a failed construction of the - ETree here. - (message_list_setup_etree, save_tree_state): Don't load or save - the header state. folder-browser-ui.c deals with this now. - -2002-02-06 Jeffrey Stedfast <fejj@ximian.com> - - * mail-account-gui.c (mail_account_gui_new): Rearranged the #if - checks so that we don't ever try to access any smime widgets - (since they are now being destroyed) if smime isn't enabled. - (mail_account_gui_save): Same here. - - * message-list.c: Removed references to NEEDS_REPLY. - - * mail-callbacks.c (mark_as_needing_reply): Removed. - (mark_as_not_needing_reply): Removed. - (toggle_need_reply): Removed. - - * folder-browser.c (on_right_click): Remove CAN_MARK_NEEDS_REPLY - stuff, this is going to be implemented in an entirely different - way. - - * mail-format.c (handle_text_plain): Look for DOCTYPE XML comments - too to decide if the message content is really HTML. - -2002-02-06 Not Zed <NotZed@Ximian.com> - - * mail-callbacks.c (mail_generate_reply): Dont double-free the - text body data. - -2002-01-31 Not Zed <NotZed@Ximian.com> - - * mail-callbacks.c (mail_generate_reply): Add attachments after - we've seen if the composer object is valid. - (mail_generate_reply): Support new flag REPLY_NO_QUOTE - if set, - then dont quote any of the message in the reply. - -2002-02-02 Ettore Perazzoli <ettore@ximian.com> - - * mail-account-gui.c (mail_account_gui_new): Destroy the S/MIME - frame if not available, instead of just graying it out. [I would - just hide it, but it looks like there is a show_all somewhere so - that doesn't work.] - -2002-02-02 Ettore Perazzoli <ettore@ximian.com> - - * mail-config.glade: Some touchups from me and Anna. - -2002-01-31 Jeffrey Stedfast <fejj@ximian.com> - - * mail-callbacks.c (composer_get_message): Don't bother setting - the auto-cc/bcc recipients here. I'm moving the code to add them - in the GUI in the composer so they will already be in the - recipient list by this point. - -2002-01-31 Radek Doulik <rodo@ximian.com> - - * mail-callbacks.c (mail_generate_reply): ignore spell checking of - words in addresses, move set_body_text after all ignored words are - set so we don't have to spell check whole document again - (mail_ignore_address): helper function - (mail_ignore): ditto - -2002-01-30 Jeffrey Stedfast <fejj@ximian.com> - - * mail-accounts.c (mail_edit): Pass the parent window to - mail_account_editor_new(). - - * mail-account-editor.c (mail_account_editor_new): Set the parent - window here because construct() inadvertantly - gtk_widget_show_all's the editor. - - * mail-account-gui.c (mail_account_gui_save): Use g_basename() - rather than strrchr for '/' especially since the strrchr code - wasn't doing any NULL checks. - -2002-01-30 Radek Doulik <rodo@ximian.com> - - * mail-format.c (handle_text_plain_flowed): print quoted text in - italic - -2002-01-30 Not Zed <NotZed@Ximian.com> - - * component-factory.c (create_component): re-enable popup menu. - (populate_folder_context_menu): If we're on a vfolder, and its not - UNMATCHED, create a change properties item, and set it up - approriately. - (change_prop_popup): Callback to edit the vfolder rule. For - #3358. - -2002-01-29 Dave West <kat@unleashed.org> - - * mail-callbacks.c (create_msg_composer): Changed the function - signature so that we can pass in whom we want to compose as. - Should fix bug #10391. - (compose_msg): Get the current profile account and pass it along - to create_msg_composer. - (send_to_url): Pass in a NULL profile account to cause - create_msg_composer to use the default account. - -2002-01-29 Jeffrey Stedfast <fejj@ximian.com> - - * mail-ops.c (mail_send_message): Make X-Evolution-Account take - priority over X-Evolution-Transport. Should we just get rid of - X-Evolution-Transport? Anyways, this ought to fix a number of - complaints. - - * mail-accounts.c (construct): Don't pass NULL text to - gtk_entry_set_text. Maybe this will fix bug #18971. - -2002-01-29 Jeffrey Stedfast <fejj@ximian.com> - - * mail-callbacks.c (redirect): New function that implements the - Redirect feature. - - * mail-ops.c (mail_send_message): If we are redirecting a message, - get the Resent-* recipients otherwise get the normal To/Cc/Bcc - recipients and use them in the CamelTransport::send_to() method. - - * mail-session.c (main_get_filter_driver): Set the beep_func to - the beep_cb, not the play_sound_func. Oops ;-) - - * folder-browser-ui.c: Add Redirect bonobo verb thingy here. - (folder_browser_ui_set_selection_state): Add MessageRedirect to - the proper string arrays. - -2002-01-29 Radek Doulik <rodo@ximian.com> - - * mail-callbacks.c (do_mail_print): initialize line to 0 to make - everybody happy ;-) - ops, set local_font to NULL - (do_mail_print): get rid of static global variables, as they are - not thread safe (thanks to clahey for pointing this out) - (footer_info_free): unref footer font - -2002-01-28 Jeffrey Stedfast <fejj@ximian.com> - - * mail-callbacks.c (composer_get_message): Don't bother checking - for invalid recipients anymore. If a recipient is invalid, the - transport error message will specify that now. - -2002-01-28 Radek Doulik <rodo@ximian.com> - - * mail-callbacks.c (do_mail_print): print footer - (footer_print_cb): print page number and number of pages - -2002-01-27 Ettore Perazzoli <ettore@ximian.com> - - * importers/Makefile.am: Use IMPORTERS_CFLAGS. - -2002-01-25 Jeffrey Stedfast <fejj@ximian.com> - - * mail-account-gui.c (delete_event_cb): We need to return a value - here. I think FALSE is fine (I hope). - - * mail-display.c (save_data_cb): Save the pathname. - (save_part): Use the new mail_config cruft to get the last used - save pathname. - - * mail-config.c (config_read): Read in last_filesel_dir string. - (mail_config_write_on_exit): Save the last_filesel_dir setting. - (mail_config_get_last_filesel_dir): New - (mail_config_set_last_filesel_dir): New - - * component-factory.c (destination_folder_handle_motion): Do some - NULL checking on the url before using it. - (destination_folder_handle_drop): Make sure the uri is non-NULL - before freeing. - -2002-01-24 Ettore Perazzoli <ettore@ximian.com> - - * Makefile.am: s/MAILER_CFLAGS/EVOLUTION_MAIL_CFLAGS/, - s/MAILER_LIBS/EVOLUTION_MAIL_LIBS/. - -2002-01-24 Jeffrey Stedfast <fejj@ximian.com> - - * mail-session.c (session_system_beep): This wrapper for gdk_beep(). - - * mail-account-gui.c (is_email): Don't bother trying to see if the - domain looks like a FQDN. - - * mail-callbacks.c (select_all): If the mail-display is in focus, - then select-all in the mail display rather than the - message-list. Fixes bug #19126. - -2002-01-23 Ettore Perazzoli <ettore@ximian.com> - - * component-factory.c (create_component): Pass a NULL icon to - `evolution_shell_component_add_user_creatable_item()'. - -2002-01-23 Jeffrey Stedfast <fejj@ximian.com> - - Implements bug #15692 - - * folder-browser.c (html_button_press_event): New callback that - checks to make sure that the mouse isn't over a link or image in - the html view and then calls the on_right_click handler after - getting the appropriate args. - (my_folder_browser_init): Connect to the button_press_event here. - -2002-01-23 Dan Winship <danw@ximian.com> - - * Makefile.am (INCLUDES): Define CAMEL_PROVIDERDIR to be the - configure.in-defined camel_providerdir. (Was supposed to have been - committed a month ago... oops.) - -2002-01-22 Jeffrey Stedfast <fejj@ximian.com> - - * mail-ops.c (mail_filter_folder): Now takes a boolean notify - argument. If this is *not* set, then remove the sound-notify - filter rule that mail-session adds. Kinda kludgy, but good enough - for the moment. - - * mail-callbacks.c (guess_me): Simplified. - -2002-01-21 Jeffrey Stedfast <fejj@ximian.com> - - * mail-format.c (handle_text_plain): If the first "token" in the - body is "<html>", then treat this as a text/html part rather than - a text/plain part. Fixes bug #16817. - - * component-factory.c (destination_folder_handle_drop): Removed - some unused variables. - -2002-01-17 Jeffrey Stedfast <fejj@ximian.com> - - * mail-format.c (try_uudecoding): Update to match new uudecode - interface (ie, no longer need a uulen state variable). - -2002-01-15 Jeffrey Stedfast <fejj@ximian.com> - - * mail-display.c (on_set_base): New callback to handle the - set_base signal. - (on_url_requested): If the base_url is set, prepend it to the data - url (we don't want to do this for cid urls or part urls tho). - (mail_display_init): Initialize md->base_url to NULL. - (mail_display_destroy): Free the base_url. - (mail_display_initialize_gtkhtml): Connect to the set_base signal. - (on_link_clicked): If the base_url is set, prepend it to the url - string passed to us from gtkhtml. - -2002-01-10 Jeffrey Stedfast <fejj@ximian.com> - - * mail-callbacks.c (do_edit_messages): Don't remove any - X-Evolution* headers here, the composer already knows to ignore - these. Besides, it needs to know the X-Evolution-Format header. - -2002-01-08 Jeffrey Stedfast <fejj@ximian.com> - - * mail-callbacks.c (composer_save_draft_cb): Do proper refcounting - on the draft folder. - - * message-list.c (message_list_select): When performing a - wraparound, check to see if the first (or last depending on - direction) message fits the selection criteria before telling - etable to find the next/previous matching node. - - * mail-account-gui.c (mail_account_gui_new): When connecting to - the transport username changed event, pass the gui->transport not - the gui->source. - -2002-01-08 Iain Holmes <iain@ximian.com> - - * importers/evolution-mbox-importer.c (string_to_int): Takes a hex - string and converts it to an int. - (get_info_from_mozilla): Creates a CamelMessageInfo structure from - the X-Mozilla-Status header. - (process_item_fn): Check for the X-Mozilla-Status header and if it - is present call get_info_from_mozilla. If get_info_from_mozilla - returns that the message was marked as deleted but never expunged - it isn't imported. - - * importers/mozilla-status-headers.h: Stuff Evolution cares about - from the mozilla header. - -2002-01-07 Jeffrey Stedfast <fejj@ximian.com> - - * mail-config.c (mail_config_set_new_mail_notify_sound_file): Renamed. - (mail_config_get_new_mail_notify_sound_file): Renamed. - - * mail-accounts.c (notify_radio_toggled): Replace EXEC with - PLAY_SOUND. - (construct): renamed the exec_command stuff to play_sound. - - * main.c (main): Init and shutdown gnome_sound. - - * mail-ops.c (fetch_mail_fetch): Don't do any new-mail - notification here. - (filter_folder_filter): call camel_filter_driver_flush. - - * mail-session.c (main_get_filter_driver): Set the filter-driver - exec_func here instead. - - * mail-ops.c (mail_fetch_mail): Don't set the filter-driver - exec_func here. - -2002-01-03 Jeffrey Stedfast <fejj@ximian.com> - - * mail-callbacks.c (composer_get_message): Add an Organization - header. - -2002-01-02 Jeffrey Stedfast <fejj@ximian.com> - - * mail-callbacks.c (list_add_addresses): Simplified. Also no - longer needs an "ignore_addr" argument as far as I can tell so - that has been removed. - (mail_generate_reply): Don't pass an ignore_addr argument to - list_add_addresses and also change to use g_strcase_hash and - g_strcase_equal since addresses are not case snesitive - (mostly). Also, Reply-To can contain multiple addresses, so handle - this case too. - -2002-01-02 JP Rosevear <jpr@ximian.com> - - * mail-callbacks.c: remove e_gnome_dialog util functions and use - e-util ones instead - -2001-12-21 Jeffrey Stedfast <fejj@ximian.com> - - The idea here is that if we consistantly name the movemail file - between Send&Receive sessions that if the user cancells the - "download" of a mbox spool that the next Send&Receive will not - "lose" mail that didn't finish the previous session. Fixes bug - #17759. Well, mostly. If you have 200 messages and cancel after - the first 100, say, then the next time you hit Send&Receive, it - will start over from 1 so you'll end up duplicating the first 100 - messages, but at least you won't "lose" mail. - - * mail-tools.c (mail_tool_get_local_movemail_path): Now a static - internal function, takes a char *uri argument and no longer - generates movemail.%d filenames... they are now based on the uri - provided. - (mail_tool_do_movemail): Pass along the source_uri. - -2001-12-20 Jon Trowbridge <trow@ximian.com> - - * message-list.c (on_click): Makes the auto-undelete behavior when - changing message flags a bit more sane. (Fixes #17634) - -2001-12-20 Ettore Perazzoli <ettore@ximian.com> - - [Fixes #17377, Evolution doesn't work on multi-depth displays.] - - * main.c (main): Push GdkRGB visual and colormap. - -2001-12-19 Jeffrey Stedfast <fejj@ximian.com> - - * mail-callbacks.c (composer_get_message): Add the auto-cc/bcc - recipients here. The problem with setting them in the composer is - that what if the user changes which account he wants to use? We'd - either have to clear the cc/bcc lists *or* we'd have to leave them - alone. Either way is bad. We can't just clear the entries because - the user may have added addresses since the composer was - opened. We don't want to leave any old auto-cc/bcc addresses there - because that isn't desirable either. So we give up and add them - here after the user has already hit the send button. - - * mail-config.c (account_copy): Update to copy the always-[b]cc - options. - (account_destroy): Update to destroy the above options. - (config_read): Update to read in those values. - (mail_config_write): Save those options. - - * mail-account-gui.c (mail_account_gui_new): Setup Always Cc/Bcc - widgets. - (mail_account_gui_save): Get the user-entered values for the - always-cc/bcc stuff. - -2001-12-19 Jeffrey Stedfast <fejj@ximian.com> - - * mail-account-gui.c (setup_service): If the provider is NULL, - don't do anything. - - * mail-accounts.c (construct): Oops, no wonder the exec command - thing never stuck around... I wasn't getting the right widget from - libglade. Also connect to the GtkEntry's changed event since a - GnomeFileEntry doesn't have that signal in its ancestry. - -2001-12-18 Jeffrey Stedfast <fejj@ximian.com> - - * mail-ops.c (filter_folder_free): Argh, don't notify about new - mail here. - (fetch_mail_fetch): Notify about new mail here instead. - - * mail-accounts.c (construct): Setup the new-mail-notification - widgets. - (notify_command_changed): Update the command-line for new mail - notification. - (notify_radio_toggled): Update the new-mail-notification type. - - * mail-ops.c (filter_folder_free): See if we got any new mail and - "sound the alarm" if we did. - -2001-12-17 Jon Trowbridge <trow@ximian.com> - - * mail-format.c (handle_text_plain_flowed): Set citation color to - black when we are printing. - - * mail-format.c (attachment_header): Avoid embedding <object> tags - when we are printing. - (handle_multipart_signed): Don't do the click-for-info signature - stuff when we are printing. - (handle_via_bonobo): Don't embed an <object> tag if we are - printing. - - * folder-browser.c: Changed context_menu[] array so that we can - print when the preview pane is closed. - -2001-12-14 Jeffrey Stedfast <fejj@ximian.com> - - * mail-ops.c (mail_fetch_mail): Set the filter driver's shell-exec - callback. - -2001-12-12 Jeffrey Stedfast <fejJ@ximian.com> - - * mail-config.c (mail_config_check_service): Connect to the - destroy signal on the popup dialog. - -2001-12-12 Jeffrey Stedfast <fejj@ximian.com> - - * mail-format.c (handle_text_plain): Make sure i != num_specials - after we check for any special text markers. Fixes bug #12265. - -2001-12-14 Jeffrey Stedfast <fejj@ximian.com> - - * mail-callbacks.c (compose_msg): Connect to the save-draft signal. - (send_to_url): Here too. - (mail_reply): And here... - (forward_get_composer): Same. - (do_edit_messages): And finally here. - - * mail-format.c (try_inline_pgp): - (try_inline_pgp_sig): Start reiplementing The Right Way and not - danw's fucking half-assed kludge that doesn't work. - -2001-12-12 Jeffrey Stedfast <fejj@ximian.com> - - * mail-config.c (mail_config_set_new_mail_notification_command): - set the new-mail-notify command. - (mail_config_get_new_mail_notification_command): get the - new-mail-notify command. - (mail_config_set_new_mail_notification): set the - new-mail-notification action. - (mail_config_get_new_mail_notification): get the - new-mail-notification action. - (mail_config_write_on_exit): save the new-mail-notification - settings. - (config_read): Read in the new-mail-notification settings. - - * mail-ops.c (mail_execute_shell_command): New function to execute - a shell command async. Will be used for playing sounds on new mail - or whatever. - -2001-12-11 Jon Trowbridge <trow@ximian.com> - - * mail-identify.c (mail_identify_mime_part): Fixed for - mail_content_loaded's new signature. - - * mail-format.c (attachment_header): Don't convert URLs, etc. if - we are printing. - (write_address): Don't convert addresses to mailto: links if we - are printing. - (write_one_text_plain_chunk): Add a printing flag, that we pass - along to mail_text_write. - (handle_text_plain): Pass our printing flag to - write_one_text_plain_chunk. - (mail_get_message_rfc822): Don't unneccesarily convert URLs. - (mail_content_loaded): Add a GtkHTML parameter. - - * mail-display.c (mail_display_initialize_gtkhtml): Added. Breaks - all of the signal hookups out of mail_display_new. - (mail_display_new): Call mail_display_initialize_gtkhtml. - (mail_text_write): Don't convert URLs, etc., if we are printing. - Lots of other changes to pass around GtkHTML/GtkHTMLStream objects. - - * mail-callbacks.c (do_mail_print): Call - mail_display_initialize_gtkhtml on our GtkHTML object. - - * folder-browser.c (update_status_bar): Make the status bar more - useful when you have a large number of hidden messages. - - * message-list.etspec: Add ETable magic for our new "Needs Reply" - column. (The next few entries are for bug #90) - - * message-list.h: Add COL_NEED_REPLY. - - * message-list.c: Move mail_need_reply_xpm to the end of - states_pixmaps. - (ml_duplicate_value): Handle COL_NEED_REPLY. - (ml_free_value): Handle COL_NEED_REPLY. - (ml_initialize_value): Handle COL_NEED_REPLY. - (ml_value_is_empty): Handle COL_NEED_REPLY. Added - needs_reply_map[] array. - (ml_value_to_string): Handle COL_NEED_REPLY. - (ml_tree_value_at): Fix magic numbers, undoing my changes from the - otehr day. Add handler for COL_NEED_REPLY. - (message_list_create_extras): Attach icons for COL_NEED_REPLY. - (on_click): Undo my previous changes to display need-reply status - in COL_MESSAGE_STATUS. Add handing for COL_NEED_REPLY. - - * mail.h: Change mail_format_mime_message, mail_format_raw_message - and the MailMimeHandlerFn typedef to take GtkHTML and - GtkHTMLStream args, as per our changes in mail-format.c. - - * mail-format.c: Giant refactoring. Remove the assumption - throughout that we will always want to render into the GtkHTML - object contained in the MailDisplay. Instead, always pass in the - GtkHTML and GtkHTMLStream that we want to write to. Also, ignore - theme work-arounds if the printing flag is set. (This and what - follows fixes bug #82) - - * mail-display.h: Remove GtkHTMLStream *stream from MailDisplay. - We don't need it anymore. - - * mail-display.c (mail_display_render): Added. Breaks the code - that renders the message into the GtkHTML object out of - mail_display_redisplay. - (mail_display_redisplay): Call mail_display_render. - (mail_display_init): Remove reference to ->stream. - (mail_display_new): Remove reference to ->stream. - - * mail-callbacks.c (do_mail_print): Create a new GtkHTML to render - our printed version into (via the new function - mail_display_render. Set the MailDisplay's printing flag to TRUE - before we render, and set it back to FALSE afterwards. - (do_mail_fetch_and_print): If the preview pane isn't open when we - try to print, fetch the message before printing. - (print_msg): Call do_mail_fetch_and_print. - (print_preview_msg): Call do_mail_fetch_and_print. - - * folder-browser-ui.c: Remove "PrintMessage" and - "PrintPreviewMessage" from message_pane_enables... these now work - when the preview pane is closed. Disable printing if multiple - messages are selected. - -2001-12-10 Jeffrey Stedfast <fejj@ximian.com> - - * mail-ops.c (filter_folder_filter): Don't expunge when we sync - anymore, this fixes bug #4472. - -2001-12-04 Jeffrey Stedfast <fejj@ximian.com> - - * mail-autofilter.c (rule_from_message): Make sure that the - message subject is non-NULL beforetrying to base a vfolder rule - off it. Fixes bug #16284. - -2001-12-07 Jeffrey Stedfast <fejj@ximian.com> - - * mail-accounts.c (construct): Connect to the dialog's "destroy" - event and close any druids/editors that may be open when that - signal is caught. Fixes bug #16501. - - * mail-vfolder.c (vfolder_edit): Set the window title to "Virtual - Folders". Fixes bug #16695. - -2001-12-05 Radek Doulik <rodo@ximian.com> - - * mail-callbacks.c (do_mail_print): set paper size to - _("US-Letter"), use gtk_html_print_set_master - -2001-12-08 Dan Winship <danw@ximian.com> - - * mail-display.c (on_object_requested): Don't just assume all of - the GtkHTMLEmbedded's fields are filled in, since HTML messages - may have <object>s in them that we're not expecting. - -2001-12-07 Dan Winship <danw@ximian.com> - - * mail-send-recv.c (mail_send_receive): Add a "current_folder" - arg. - (build_dialogue): Remember the current_folder - (free_send_data): If current_folder is set, refresh it so it's - guaranteed to be synced with the folder tree. Fixes #14770. - - * mail-callbacks.c (send_receive_mail): Pass current_folder to - mail_send_receive(). - -2001-12-04 Jeffrey Stedfast <fejj@ximian.com> - - * mail-display.c (stream_write_or_redisplay_when_loaded): Check - that the mail-display hasn't been destroyed. - (mail_display_redisplay): Same here. - -2001-12-07 Dan Winship <danw@ximian.com> - - * mail-send-recv.c (receive_update_got_store): If updating a store - that we don't have an associated storage for, just request a - folder tree and then free it. (For the Connector) - - * mail-callbacks.h: Add missing part of Jeff's 12-03 patch so this - actually compiles. - -2001-12-06 Jeffrey Stedfast <fejj@ximian.com> - - * mail-ops.c (mail_send_message): s/PREVIEW_RELEASE/VERSION_COMMENT - -2001-12-03 Jeffrey Stedfast <fejj@ximian.com> - - * mail-ops.c (mail_send_message): Don't append "(Preview Version)" - at the end of the version string. Use the PREVIEW_RELEASE #define - instead. - -2001-12-03 Jeffrey Stedfast <fejj@ximian.com> - - * folder-browser-ui.c: Setup the UI for the AddSenderToAddressbook - ui verb thingy. - - * mail-callbacks.c (add_sender_to_addrbook): New bonobo-ui - callback that adds a sender to the addressbook. - -2001-12-04 Jon Trowbridge <trow@ximian.com> - - * folder-browser-ui.c (folder_browser_ui_set_selection_state): - Allow 'n' and 'p' to work when multiple messages are selected. - Fixes #12062. - -2001-11-28 Jeffrey Stedfast <fejj@ximian.com> - - * mail-callbacks.c (save_msg_ok): If the path exists, make sure - it's a regular file (or we can't possibly save to it). Fix for - #14127. - -2001-11-28 Jeffrey Stedfast <fejj@ximian.com> - - * message-list.c (message_list_select): Cleaned up the code. - - * mail-callbacks.c (previous_unread_msg): Pass wraparound as TRUE. - -2001-11-24 Jeffrey Stedfast <fejj@ximian.com> - - * mail-config.c (pgpopen): Fix the boolean check to be && and not - ||. - -2001-11-20 Not Zed <NotZed@Ximian.com> - - * folder-browser-ui.c: Disable search if no message - loaded/viewed. Also for #14348. - - * folder-browser.c: Disable "Add sender to addressbook" if we dont - have a message loaded (it wont work). For #14348. - -2001-11-20 Jeffrey Stedfast <fejj@ximian.com> - - * mail-display.c (load_content_loaded): Make sure the mail-display - object is still "alive" before accessing any of it's data. - -2001-11-14 Zbigniew Chyla <cyba@gnome.pl> - - * mail-autofilter.c (rule_match_recipients, rule_from_message, - rule_from_mlist): s/_/U_/ (filter_rule_set_name requires UTF-8 string) - -2001-11-14 Dan Winship <danw@ximian.com> - - * main.c (segv_redirect): Instead of doing pthread_exit() after - redirecting the SEGV, try to lock a mutex we know is already - locked. This will hopefully help debug a bunch of bugs where the - crashed thread seems to be missing from the bug-buddy report. - -2001-11-13 Jeffrey Stedfast <fejj@ximian.com> - - * mail-session.c (pass_got): Call e_passwords_remember_password() - for account passwords if the user set the "remember password" - checkbox. - -2001-11-12 Jeffrey Stedfast <fejj@ximian.com> - - * mail-vfolder.c (vfolder_load_storage): Add a NULL check for - rule->name. - (mail_vfolder_add_uri): Same here. - -2001-11-09 Jeffrey Stedfast <fejj@ximian.com> - - * mail-callbacks.c (forward_message): If we already have the - message loaded in the mail-display, don't bother re-loading. This - happens to fix bug #14848. - -2001-11-08 Jeffrey Stedfast <fejj@ximian.com> - - * mail-tools.c (mail_tools_x_evolution_message_parse): Was - x_evolution_message_parse from folder-browser.c. A space char is - no longer used to separate the folder URI and the first uid, - instead this is now done with a nul-char so update to parse the - newer/better format. - - * component-factory.c (destination_folder_handle_drop): Update to - parse the new/better format. - - * folder-browser.c (x_evolution_message_parse): Moved to - mail-tools.c - (message_list_drag_data_get): Instead of placing a space char - after the folder URI, instead use a nul-char. - -2001-11-06 Jeffrey Stedfast <fejj@ximian.com> - - * mail-accounts.c (pgp_path_changed): Call - mail_config_pgp_type_detect_from_path() instead of doing our own - lame auto-detection that didn't even work ;-) - - * mail-config.c (auto_detect_pgp_variables): Execute the pgp - binary and look at it's version string if we have a version string - to compare to. - (mail_config_pgp_type_detect_from_path): New function that takes a - pgp path and attempts to figure out what pgp version it is. - -2001-11-07 Jeffrey Stedfast <fejj@ximian.com> - - * mail-format.c (try_inline_pgp): Add a "x-inline-pgp-hack=true" - paramter to the multipart's content-type. - -2001-11-05 Jeffrey Stedfast <fejj@ximian.com> - - * mail-account-editor.c (construct): Don't make the account editor - modal either. - - * mail-accounts.c (mail_add): Use the new global account druid - variable so that we can avoid having more than a single druid at a - time. If a druid already exists, bring it to the top. - (mail_edit): Same idea only for the account editor this time. - (mail_editor_destroyed): Set the global editor to NULL. - (mail_add_finished): Set the global druid to NULL. - (mail_delete): Don't allow any deletes if an account editor is - opened (we don't want to be able to delete the account we are - editing...) - (news_edit): Same thing for the news editor. - (news_editor_destroyed): Set the news editor to NULL. - (news_add): And again for the news add. - - * mail-account-gui.c (service_check_supported): Updated to pass a - GtkWindow argument to mail_config_check_service(). - - * mail-config.c (mail_config_check_service): Now takes a GtkWindow - argument so we can set our parent window. Also, don't make this - dialog modal either. - - * mail-config-druid.c (construct): Don't make this druid modal. - -2001-11-05 <NotZed@Ximian.com> - - * message-browser.c (set_bonobo_ui): Override the Move/Copy - handlers setup by the folder_browser_ui code, and use our own, - because we need to pass it a live window which we can't. - (transfer_msg): Our own version of mail-callbacks.c:transfer_msg, - so we can properly pass the parent to the user_select_folder. - (transfer_msg_done): Also copy this so we can pass it diff args. - All fix #13919. - - * mail-callbacks.c (transfer_msg): Set physical/uri to NULL before - calling, because althought he shell client api call is supposed to - null these out, it doesn't with its stupid assertion checks on - entry. Also free physical to plug a memleak. Bugs exposed by - #13919. - -2001-11-01 Jeffrey Stedfast <fejj@ximian.com> - - * mail-display.h (mail_html_write): Renamed from - mail_html_write_string. - - * mail-display.c (mail_text_write): Don't bother with varargs - since nothing used them, we were only passing strings anyway... - (mail_error_printf): Renamed from mail_error_write, this makes - more sense. - (mail_html_write): Removed. - - * mail-format.c: Updated to use gtk_html_stream_printf directly - and s/mail_html_write_string/mail_html_write. - (mail_lookup_handler): Don't use %.*s here either... - (handle_text_enriched): Same. - (write_one_text_plain_chunk): And finally here (also update for - new mail_text_write api). - (handle_multipart_signed): Update for new mail_text_write api. - (format_mime_part): Update for new mail_error_text/printf name - change. - (handle_multipart_encrypted): Same. - - * mail-tools.c (mail_tool_generate_forward_subject): Same as - mail_generate_reply. - - * mail-callbacks.c (mail_generate_reply): Don't use %.*s in any - *printf* functions. - -2001-11-02 Christopher James Lahey <clahey@ximian.com> - - * message-list.c (ml_tree_value_at): Use GINT_TO_POINTER here for - platforms where simply casting an int to void * won't work. - (build_flat_diff, main_folder_changed): Call - e_tree_model_pre_change here. - -2001-11-02 <NotZed@Ximian.com> - - * message-browser.c (message_browser_message_list_built): - Disconnect from the message_list_built function so we dont do it - every time the list is rebuilt. - - * mail-callbacks.c (composer_send_cb): Disable autosave when we're - sending mail. - (composer_sent_cb): Re-enable autosave. - - * folder-browser-ui.c (fbui_sensitize_timeout): Make sure we reset - any data we're using on the folderbrowser before doing anything - 'cause things could vanish while we're doing it, and also - ref/unref the folderbrowser so it doesn't vanish while w'ere - working. - - * folder-browser.c (folder_browser_set_ui_component): If we are - changing the ui comp, remove any pending timeouts. For #13719. - -2001-11-01 Larry Ewing <lewing@ximian.com> - - * folder-browser.c (folder_browser_copy): fix cut & paste from the - message body. - -2001-11-01 Dan Winship <danw@ximian.com> - - * mail-format.c (handle_multipart_signed): Write out the url - before callind add_url since add_url may free it. Fixes #13839. - Remove debug printf. - - * mail-display.c (on_object_requested): Remove debug printf. - -2001-10-31 Jeffrey Stedfast <fejj@ximian.com> - - * mail-callbacks.c (list_add_addresses): Don't use a - case-sensitive comparison. - -2001-10-31 Dan Winship <danw@ximian.com> - - * mail-format.c (try_inline_pgp_sig): Make this work again. - -2001-10-30 Larry Ewing <lewing@ximian.com> - - * mail-account-gui.c (delete_event_cb): add delete_event_handler. - (menu_file_save_close_cb): add save and close command. - (launch_signature_editor): initial the editor as having changed - and attach the delete event handler. - -2001-10-30 <NotZed@Ximian.com> - - * message-browser.c (d): Turn it off. - - * mail-mt.c: Added exception strings to some of the op logging. - - * mail-format.c (elide_quotes): Remove, uh, what was this for, its - not used anywhere? Also loops the instant it had a ", good one - trow! :) - (write_address): Remove name_arg/email_arg, these aren't used - anywhere. - - * mail-mt.c (mail_msg_received): If we have a cancellation setup, - destroy it immediately, to save fd's. - (mail_msg_cancel): Check cancel != NULL. - (mail_msg_free): Same. - - * folder-info.c: Comment out the Folder: and you've got mail - prints. - - * mail-config-druid.c (wizard_next_cb): If we have a next - function, honour if it tells us its going to set the page, and - dont set it, otherwise, set it to the next page, unless we're at - the end of our pages, and let the wizard do it itself. - (wizard_back_cb): Same for going back. Rest of fix for #12127, - see e-shell-startup-wizard for the rest. - (next_func): If we're not on the last page, tell the druid we're - gonna handle the next button, so we can sync properly with it, - needed for above changes. - (back_func): Similarly for going back past page 0. - (wizard_listener_event): We want to set the page to the actual one - asked for not, pagenum-1. - - * mail-local.c (mls_rename_folder): Oops, dont use the url storage - path to offset the folder name we're renaming/opening, etc. - - * subscribe-dialog.c (fe_cancel_op_foreach): Argh!!! Dont free the - async op data here, the async op is still running and will access - it! Just try to cancel it and mark it as cancelled (id == -1) - (fe_done_subscribing): Only remove outselves from the hash table - if we're not cancelled. The handle should always be set here, - since this code runs in the gui thread. - - * message-list.c (on_cursor_activated_idle): If nothing - selected/cursor not activated, then select no message. - - * mail-folder-cache.c (update_1folder): Make the trash count - optional on EVOLUTION_COUNT_TRASH, becuase some lusers are just - too stupid to understand what its for. - - * component-factory.c (storage_xfer_folder): Return slightly - better error codes for copying folders, since its not implemented - yet. - - * mail-vfolder.c, mail-local.c, mail-folder-cache.c, - message-list.c component-factory.c, mail-ops.c, - subscribe-dialog.c, mail-session.c: d() out some debug printfs, - w() out some warnings. - - * folder-browser-ui.c (folder_browser_ui_add_message): Fix typo, - Resent->Resend. - -2001-10-29 Jeffrey Stedfast <fejj@ximian.com> - - * mail-ops.c (transfer_messages_transfer): Don't warn the user if - the source and destination folders are the same. - -2001-10-29 Dan Winship <danw@ximian.com> - - * mail-format.c (handle_multipart_signed): add some debug spew re - 13839. - - * mail-display.c (on_object_requested): here too - -2001-10-29 Christopher James Lahey <clahey@ximian.com> - - * e-searching-tokenizer.c (search_info_set_match_size_increase): - Fixed a warning by #if 0ing out this function. - - * folder-browser.c, folder-browser.h (on_selection_changed): - Update status bar in an idle call. Fixes Ximian bug #13929. - - * mail-folder-cache.c (folder_renamed, store_folder_renamed): - Fixed some warnings here. - -2001-10-29 Dan Winship <danw@ximian.com> - - * folder-browser.c (folder_browser_copy): Fix the focus check. - It's not fb->message_list that has focus, it's one of its - children. #13616. - -2001-10-29 <NotZed@Ximian.com> - - * mail-folder-cache.c (store_folder_renamed): Sort the folder - updates first, since we dont seem to get them in the right order, - or infact in any tree representation whatsoever when using IMAP - ...? get_folder_info bugs? - - Unrelated note to self, the subscribe dialogue may interfere with - the folder cache. - - * mail-vfolder.c (rule_changed): Copy the folder's full_name - before trying to use it to rename. - (vfolder_edit_rule): Set 'orig' to be a reference of the original - rule. - (edit_rule_clicked): Dont lookup orig by name, copy it over - instead. - - * folder-browser.c (got_folder): oops, emit signal before - unreffing object, incase we got killded during getting folder. - (got_folder): Reset get_id. - (folder_browser_new): Set get_id of the get_folder task. - (folder_browser_init): Init get_id. - (folder_browser_destroy): IF we have outstanding 'get folder' op, - cancel it. - -2001-10-28 Jeffrey Stedfast <fejj@ximian.com> - - * mail-account-gui.c (mail_account_gui_save): Call - mail_autoreceive_setup() instead of - mail_autoreceive_setup_account() since that code was completely - broken anyway. - - * mail-send-recv.c (mail_autoreceive_setup_account): Removed. - - * mail-callbacks.c (transfer_msg_done): Move the message-list - cursor to the next message. - (transfer_msg): If we are moving messages, then pass - transfer_msg_done() to mail_transfer_messages() so when it - finishes it can move the cursor to the next undeleted message. - - * mail-format.c (try_inline_pgp): Check that the special PGP lines - begin and end with \n so as to avoid matching against quoted PGP - lines. - -2001-10-28 <NotZed@Ximian.com> - - * mail-callbacks.c (mark_all_as_seen): fb = user_data, not fb = - fb!, fixes 13844. - - * mail-local.c (mlf_rename): add the folder name to the path when - passing down to the subordinate folder. - - * folder-browser-ui.c (fbui_sensitize_timeout): Remove uic, kill - dumb warning. - - * mail-autofilter.c (mail_filter_rename_uri): Implement function - for filters to keep track of uri's being renamed. - (mail_filter_delete_uri): Similarly for deleting uri's. Note that - these functions are just noops though. - -2001-10-28 Jeffrey Stedfast <fejj@ximian.com> - - * folder-browser.c: Deactivate the Print right-click menu option - if the message isn't loaded. Fixes bug #10346. - -2001-10-28 <NotZed@Ximian.com> - - * mail-vfolder.c (mail_vfolder_rename_uri): Implemented. - (mail_vfolder_rename_uri): We do want to check renamed uri's from - vstores. - (mail_vfolder_delete_uri): Same. - (store_folder_renamed): Fix the folder hash at the same time. - - * mail-folder-cache.c (real_flush_updates): Pass the rename event - to vfolder rename uri. - (real_flush_updates): Also rename and delete uri's from filters. - - * mail-local.c (mail_local_folder_reconfigure): Change the store - path to be same as parent + mbox to be full path. - (mls_delete_folder): Change store path to be parent path, and mbox - to be full path. - (mail_local_folder_reconfigure): Fix a leak of tmpname. - (mls_delete_folder): Unref the store when done. - (mls_rename_folder): Fix implementation, shell already created - destination folder, so we can't just rename :( - - * component-factory.c (xfer_folder): Only do a rename if we have - remove set, cleaned up logic a bit. - (idle_quit): Put the components still active check last last of - all. - (storage_create_folder): IF we have a fragment, use that as part - part for parent. - (xfer_folder): Manually call rename code, since the shell will do - a remove/add later on, AND there's no way we can determine the new - path from the crock of an api we have to work with. - -2001-10-27 Jeffrey Stedfast <fejj@ximian.com> - - * mail-format.c (mail_format_get_data_wrapper_text): Allow the - user to shoot him/herself in the foot when overriding message - charsets. Permanantly fixes bug #921. - -2001-10-26 Dan Winship <danw@ximian.com> - - * folder-browser.c (etree_key): Work around something that we - think is a GtkHTML bug, where sometimes the adjustments have - slightly bogus values and scrolling ends up working backwards. - (Ximian 4939) - - * mail-display.c (do_signature, do_attachment_header): Set the - icon to be 24x24 here so that (assuming it's not a thumbnail), no - resizes will have to be queued later. (There's still a bug with - the text to the left of the button being drawn twice for some - reason though.) - - * mail-callbacks.c (delete_msg): Fix a bug here that makes - deleting multiple messages cause a gratuitous message body fetch. - (Ximian 12355) - -2001-10-25 Jeffrey Stedfast <fejj@ximian.com> - - * mail-callbacks.c (providers_config): Set the GdkWindow of the - FolderBrowser, not the GtkWindow... - -2001-10-26 <NotZed@Ximian.com> - - * mail-local.c (mlf_set_folder): Changed to open the source store - from '/', so we can do renames across directories. Of course, - this doesn't quite work with different filesystems, but we'll - assume this isn't a problem we're going to have. - (mail_local_folder_get_type): Setup parent_class. - (mlf_rename): Implement folder rename call, rename internal data. - - Is this a security issue? Well, not really, no more than anything - else. - - * mail-folder-cache.c (mail_note_store): Listen to rename event. - (store_folder_renamed): Function to handle it, empty. - (mail_note_store_remove): Unhook from rename event. - (mail_note_folder): Hook onto renamed event. - (unset_folder_info): Unhook from renamed event. - (folder_finalised): Lock around update. - (folder_deleted): Lock around update. - (real_flush_updates): If we have a path to remove remove it. - (rename_folders): Scan folderinfo's, if we can find ones renamed, - rename them, otherwise add them. - - * component-factory.c (owner_unset_cb): Use a timeout not an idle - handler. - (storage_xfer_folder): Implementation of xfer_folder signal - handler, so we can rename imap/vfolders/etc. - - * component-factory.c (owner_unset_cb): Use a timeout not an idle - handler. - - * mail-callbacks.c (providers_config): Only set the parent window. - - * mail-accounts.c (mail_edit): Set the parent on the account editor. - -2001-10-25 <NotZed@Ximian.com> - - * openpgp-utils.c (openpgp_verify): s/iconv/e_iconv/. - -2001-10-25 Jeffrey Stedfast <fejj@ximian.com> - - * mail-ops.c (send_mail_free): Don't forget to unref the filter - driver here. - -2001-10-25 <NotZed@Ximian.com> - - * folder-browser-ui.c (fbui_sensitize_timeout): So apparently the - uicomp can just 'vanish' while we're using it. Joy. Take care of - that case here, fixes #13482. - (fbui_sensitise_item): Check here too just for kicks. - - * mail-folder-cache.c (store_finalised): If we can't destroy our - async event, then queue another one to do it. - (store_finalised_finish): And handle it here, until we can, then - free it. - (mail_note_store): Queue an async event to get folderinfo, dont - use mail_get_folderinfo. - (update_folders_get): thread-async event to retrieve the - folderinfo, and build it, then queues gui-async event to update - the gui. - (add_unmatched_info): Taken from mail-ops, adds unmatched if - required. - (add_vtrash_info): From mail-ops, add trash if required. - (update_folders): Thread async event to update gui. - (mail_note_store): Ref the store and storage when created. - (update_1folder): Changed to assume we have info_lock, and store - updates in an updates list. - (setup_folder): Same. - (folder_changed): Changed to call update_1folder directly. - (real_folder_changed): Removed. - (mail_note_folder): Changed to call update_1folder directly. - (real_note_folder): Removed. - (store_folder_subscribed): Call setup_folder directly. - (real_folder_created): Removed. - (real_flush_update): Function that actually does the updates in - the gui thread. - (mail_note_store): Go back to using mail_get_folderinfo. - (update_folders): Fixed upf ro changed api's. - (unset_folder_info): Changed to queue pending updates. - (real_folder_deleted): Removed. - (store_folder_unsubscribed): Do the removal work directly. - (mail_note_store): Dont link to finalised event of store - we now - ref it. - (mail_note_store_remove): If we have any pending updates, clear - them out. Also cancel any pending folderinfo retrieve operations. - (update_folders): Remove our update from the storeinfo list, if it - still exists. - (update_1folder): Make 'sent folder shows all counts' optional via - an environmental variable EVOLUTION_COUNT_SENT for all those - bloody whinging lusers out there. - (mail_note_store_remove): Unref the storage when done. - - * mail-mt.c (mail_async_event_emit): If we're in main and have a - gui task, set it to run via an idle function. - (idle_async_event): Wrapper for calling do_async_event from idle - function, and freeing the message when done. - (idle_async_event): Call mail_msg_free not free on the finished - message. - - * component-factory.c (mail_remove_storage): Destroy the storage - async. - (store_disconnect): This does the work. - (free_storage): Un-note the store when we remove it, so the store - noting code can unref things properly. - (idle_quit): Return false when done, dont loop. - -2001-10-24 <NotZed@Ximian.com> - - * component-factory.c (owner_set_cb): Setup an async_event - handler. - (idle_quit): Try to destroy the async_event, or keep dropping out - if it can't (deadlock). - - * mail-mt.c (do_async_event): Set the threadid of the thread we're - running in so we know its running/which thread its in. - (mail_async_event_emit): Added new argument 'type' which is the - type of thread to execute against, gui or another one. Fixed all - callers. - (mail_async_event_destroy): Return -1 if this operation will fail - (deadlock possibility). If we're in the thread of the task - we're going to wait for, then return a failure (since we will - deadlock). - (mail_async_event_emit): Changed to use MailAsyncFunc type as the - function type, which just takes 3 void args, change args to suit. - - * mail-folder-cache.c (mail_note_store): Record the pending update - events in a pending list. We should really be able to use an - async event for this, but that doesn't return to the gui loop when - done :-/ - (update_folders): Remove from pending update when done. - -2001-10-25 Jeffrey Stedfast <fejj@ximian.com> - - * mail-send-recv.c (get_receive_type): Check for a NULL provider. - (build_dialogue): Check for invalid source urls. - (mail_receive_uri): Same. - -2001-10-24 Jeffrey Stedfast <fejj@ximian.com> - - * mail-callbacks.c (mail_generate_reply): No longer need to pass a - settext argument. - (do_forward_non_attached): Same. - - * mail-format.c (mail_get_message_body): Fix to not always return - NULL for html parts, doh!. - -2001-10-24 <NotZed@Ximian.com> - - * folder-browser-ui.c (ui_add): - (fbui_sensitize_timeout): Same. - - * folder-browser-factory.c (control_activate): Comment out freeze/thaw. - (control_deactivate): - -2001-10-24 Jon Trowbridge <trow@ximian.com> - - * mail-search.c (mail_search_construct): Fixed some weird casting - crack that got in here somehow, removed superfluous box-packing - that was generating a gtk warning. - -2001-10-23 Jeffrey Stedfast <fejj@ximian.com> - - * component-factory.c (owner_unset_cb): Unref the global - search_context. - (owner_set_cb): create the global search_context. - - * folder-browser.c (folder_browser_gui_init): Pass along the - global search_context to the e_filter_bar_new call. - -2001-10-24 <NotZed@Ximian.com> - - * message-browser.c (message_browser_message_loaded): Call - ui_message_loaded when we are. - - * folder-browser-factory.c (control_activate): Freeze/thaw around - all updates. - (control_deactivate): Freeze/thaw around all updates. - - * folder-browser.c (folder_browser_init): Setup a hashtable to - keep track of *our* sensitise state, so we can optimise pushes to - bonobo. - (folder_browser_finalise): Free hash here. - (folder_browser_set_message_preview): Call a ui_message_loaded, - even though it isn't, so it updates sensitivities right. - (done_message_selected): Call ui_message_loaded when it really is, - rather than the very fucked up idea of reversing the loaded_uid - check. - - * folder-browser-ui.c (folder_browser_ui_set_selection_state): - Dont enable the message-enabled options if the message display is - hidden, e.g. print, view headers, etc. - (folder_browser_ui_rm_all): Forget sensitise state. - (fbui_sensitise_item): Sensitise items via a current-state table, - so we dont have to do bonobo calls every time. - (folder_browser_setup_property_menu): Call sensitise_item. - (folder_browser_ui_add_message): - (folder_browser_ui_add_global): Leave current set_prop "sensitive" - for the stop button, so it doesn't get lost by the stuff in - mail-mt.c - (fbui_real_sensitize_items): Removed. - (fbui_sensitize_timeout): Cleaned up, use sensitise_item to do - work. - (folder_browser_ui_message_loaded): Setup sensitive based on - preview_shown too. - (folder_browser_ui_set_selection_state): And here too. - -2001-10-23 Jeffrey Stedfast <fejj@ximian.com> - - * mail-account-gui.c (service_check_supported): Don't allow an - auth-type to be set when saving the service. - (mail_account_gui_new): Initialize the source and transport - provider_type's here so we don't forget to do it when it matters. - (mail_account_gui_setup): Don't bother setting the provider_type's - here, they are already set in mail_account_gui_new() now. - -2001-10-23 <NotZed@Ximian.com> - - * mail-display.c (mail_display_destroy): Remove the idle_id when - we're destroyed so the idle func doesn't run on an invalid object. - - * message-list.c (regen_list_regened): Dont do anything if we're - destroyed #13021. - - * mail-mt.c (mail_user_message): - (mail_get_password): Removed, all functionality moved to - mail-session. - - * mail-config.c (mail_config_write_on_exit): Check - threaded/preview hash is null before using it, its setup on demand - so itmight nto be initialised here. - - * mail-session.c (request_password): Remove password_current - stuff. - (alert_user): Redont, similar to get_pass. Do things as async as - possible, and dont even wait for a response if we're not asking - for the cancel button (this may or may not be right behaviour - - need to check). mail_user_message() code replaced from the stuff - in mail-mt.c - (MailSession): Added a lock field. - (init): Setup lock. - (finalise): fRee lock. - (register_timeout): Redone. We now allocate our own 'timeoutid's, - and <> to the real things asynchronously. Use async_event's so we - can make sure we have no outstanding ones after shutdown. - (mail_session_enable_interaction): If interaction has been - disabled, and we have either a message-box open, or a password - request open and/or any pending message boxes/passwords, blow 'em - away. - (main_register_timeout): If we have pending remove of this same - timeout, dont do anything. - (timeout_timeout): Properly honour the result, remove the timout - if it returns false. - (do_user_message): Setup the message_destroy_id when we setup the - destroy handler so it doesn't get called twice. - -2001-10-23 Jeffrey Stedfast <fejj@ximian.com> - - * mail-callbacks.c (reply_to_sender): Make sure the fb and it's - message-list exist. - (reply_to_list): same. - (reply_to_all): And here... - (forward_message): Here too. - (forward_attached): Again here. - (transfer_msg): Here too. - (apply_filters): Same. - (select_all): Yet again here... - (select_thread): And here. - (invert_selection): Same. - (flag_messages): Here too. - (mark_as_unseen): and here... - (mark_all_as_seen): ... - (zoom_in): - (zoom_out): - (zoom_reset): - (search_msg): - (load_images): - (save_msg): - (next_msg): - (next_flagged_msg): - (next_unread_msg): - (previous_msg): - (previous_unread_msg): - (expunge_folder): - (configure_folder): - (empty_trash): - -2001-10-23 <NotZed@Ximian.com> - - * mail-mt.c: Added missing errno.h - (mail_msg_new): Fix the logic a bit, dont try to open the log file - unless logging is actually requested. - (mail_enable_stop, mail_disable_stop, do_set_busy, - mail_operation_statys): Dont bother propagating events if - global_shell_client isn't up yet. - -2001-10-23 Dan Winship <danw@ximian.com> - - * mail-mt.c (mail_msg_new): If the fopen() fails (eg, because - evolution-mail was started by oafd with PWD=/), don't try to use - the NULL file handle. - -2001-10-23 <NotZed@Ximian.com> - - * mail-session.c (get_password): Completely re-done. We now hae a - completely async dialogue when requested from antoehr thread, and - dont use gtk_main() if we can avoid it (which is normally the - case). This stuff is only partially finished, and will mena the - removal of the same from mail-mt.c, and the mail_user_message() - code will be moved here and changed to work in a similar way. - - * mail-callbacks.c (empty_trash): Dont try and connect to remote - stores just to get the trash. Also, always run empty trash async, - and make sure we unref the trash. - (empty_trash): Hmm, dont unref the trash, causes a problem on - exit, i suspect something else is doing funky unrefs on it. - - * mail-tools.c (mail_tool_get_trash): Pass a 'connect' arg, tell - it whether it should tryand connect or not to the parent service, - if it isn't already connected. - - * component-factory.c (owner_unset_cb): Dont try wait_all here, - could potentially deadlock. - (idle_quit): Keep returning TRUE if we have outstanding - processing. Note that this may busy-wait during exit processign - with busy tasks :( - (idle_quit): Keep calling ourselves till we no longer get called - (i.e. gtk_main really quits). - - * mail-mt.c (mail_msg_active): New function, returns TRUE if - events are still active/outstanding. - (do_op_status): @$@$#@@!#@!! didn't unlock the mail_msg_lock if - data->activity was NULL and we had no global_shell_client anymore! - Also shortcut processing if this is going to be the case. - (mail_msg_init): Setup a temporary other gui_port for redoing with - new semantics password, user message and progress reporting. - (mail_get_password): #ifdef'd out all this code temporarily, till - it gets fully moved to mail-session.c - -2001-10-22 <NotZed@Ximian.com> - - * component-factory.c (owner_set_cb): Dont call enable_interaction - here. - (interactive_cb): But here instead, let the shell tell us when its - ok to go interactive. - -2001-10-22 Jeffrey Stedfast <fejj@ximian.com> - - * mail-format.c (write_one_text_plain_chunk): Oops, revert my - change to this function. - - * mail-display.h (mail_html_write_string): New fun macro. - - * mail-format.c (write_one_text_plain_chunk): Use gtk_html_write - instead of mail_html_write so we avoid strdup'ing the text. - (handle_text_plain_flowed): Use the mail_html_write_string macro. - (handle_message_rfc822): Here too. - (mail_format_raw_message): We can do it here also... - (attachment_header): We can do it a little bit here... - (write_address): A microscopic bit here... - (write_hr): same. - -2001-10-22 Anna Marie Dirks <anna@ximian.com> - - * mail-config.glade: Added several new accelerators to the edit account - dialog, and fixed the focus targets on all existing accelerators. I - was hoping that since the widgets used in the account editor are also - used in the first-time start-up druid and them mail-config druid, - that this would fix all accelerator problems for those druids as well, - but there is something wrong with Bonobo which is preventing - the druids from responding to their accelerators. Sigh. Anyway, - most accelerators in the edit account dialog work correctly - now, though there are few (such as _Full Name) which fail to - do anything. I don't know why. - -2001-10-22 Jeffrey Stedfast <fejj@ximian.com> - - * mail-stream-gtkhtml.c (mail_stream_gtkhtml_new): New class that - wraps writing to a GtkHTML stream so that we don't have to write - to an intermediate GByteArray. - - * mail-display.c (on_url_requested): Use the new Camel->GtkHTML - stream - this means we don't have to chew up nearly as much - memory...yay! - (try_part_urls): Here too. - -2001-10-22 Ettore Perazzoli <ettore@ximian.com> - - * mail-mt.c (do_op_status): Don't free `clientid' as it's - uninitialized. - -2001-10-22 Christopher James Lahey <clahey@ximian.com> - - * message-list.etspec (Score): disable this column. Fixes Ximian - bug #12381. - -2001-10-22 Ettore Perazzoli <ettore@ximian.com> - - * mail-mt.c: #include "component-factory.h". - (do_op_status): Pass the component ID instead of the msg ID. - - * component-factory.h (COMPONENT_ID): #define here instead of - `component-factory.c'. - (SUMMARY_FACTORY_ID): Likewise. - -2001-10-22 Jeffrey Stedfast <fejj@ximian.com> - - * mail-format.c (format_mime_part): Don't wrap error text with - <blockquote>, this is done inside mail_error_write. - (handle_multipart_encrypted): If we get an exception trying to - decrypt the mime part, display an error rather than trying to - treat it as multipart/mixed. - - * mail-callbacks.c (empty_trash): Confirm expunge. - - * folder-browser.c (folder_browser_destroy): Move the folder sync - code along with a few other things from folder_browser_finalise() - into here instead. - (folder_browser_finalise): Moved some cleanup functions into - destroy. - -2001-10-22 Dan Winship <danw@ximian.com> - - PGP verification UI changes to make it not HTML spoofable. - - * mail-format.c (handle_application_pgp): Remove this unused - hack. - (mail_format_mime_message): Initialize a fourth hash table, used - to keep track of fake MIME parts. - (mail_part_set_default_displayed_inline): New routine to set the - default disposition of a part (doesn't change it if the user has - already overridden it). - (format_mime_part): Wrap a blockquote around the error text (moved - here from mail_error_write since it doesn't apply in other cases). - (write_hr): Write a <hr> with appropriate padding between MIME - parts. - (write_one_text_plain_chunk): Write some plain text with - appropriate margins. - (handle_text_plain): Use write_one_text_plain_chunk. Update for - inline specials handler API change. - (fake_mime_part_from_data): Use the "fake_parts" hash to avoid - recreating the same fake parts again if the message is - redisplayed. Lets you toggle the shown/hiddenness of uudecode - parts, and do the new pgp verification thing for inline pgp - signatures. - (try_inline_pgp): Don't do any actual PGP handling here: Just - rewrite as a multipart/encrypted. - (try_inline_pgp_sig): Likewise, just do a multipart/signed (with - the x-inline-pgp-hack parameter set). - (try_uudecoding, try_inline_binhex): Update for API changes. - (handle_multipart_signed): Exciting and new. Use <object> to - create a button which the user must click to do the - verification. Change the formatting of the gpg output text a bit. - - * mail-display.c (on_link_clicked): Remove x-evolution-decode-pgp - hack, which is no longer used. - (pixbuf_gen_idle): Add a hack for the PGP verification button. - (do_attachment_header, do_external_viewer): Split out of - on_object_requeested for clarity. - (do_signature): New routine to do the PGP verification button. - (on_object_requested): Now just dispatches to - do_attachment_header, do_external_viewer, or do_signature. - (mail_error_write): Don't do <blockquote> here. Fixed the problem - that was trying to fix elsewhere. - -2001-10-22 Dan Winship <danw@ximian.com> - - * mail-callbacks.c (transfer_msg): Fix these functions so they - don't crash evolution-mail. Too bad it still crashes in the - shell. - -2001-10-21 Jeffrey Stedfast <fejj@ximian.com> - - * mail-display.c (on_url_requested): Use - mail_format_get_data_wrapper_text for text parts so we get free - charset conversion. - - * mail-format.c (mail_format_get_data_wrapper_text): Renamed from - get_data_wrapper_text and now returns a GByteArray. - (handle_text_plain): Updated to use the new get_data_wrapper_text. - (handle_application_pgp): Same. Wow...also fixed a mem leak and - made a bit more efficient by doing so. - (handle_text_enriched): Here too. Also use string->len instead of - strlen (string->str). - (mail_format_raw_message): Same. - -2001-10-22 <NotZed@Ximian.com> - - * mail-callbacks.c (mark_all_as_seen): Instead of select_all() - then using the tree's selected nodes to iterate, just do it on the - folder which keeps the current selection. Fixes #3658. - -2001-10-21 Jeffrey Stedfast <fejj@ximian.com> - - * folder-browser.c: Call the new move/copy_msg_cb's - - * mail-callbacks.c (move_msg_cb): Renamed from move_msg. - (copy_msg_cb): Renamed from copy_msg. - (move_msg): The bonobo-ui-component callback. - (copy_msg): Same. - -2001-10-21 <NotZed@Ximian.com> - - * mail-vfolder.c (mail_vfolder_shutdown): Clear variables once - done, for debugging. - (mail_vfolder_add_uri, mail_vfolder_delete_uri): Dont do anything - if we're shutdown (context == NULL). - - * component-factory.c (idle_quit): Move mail_vfolder_shutdown - here, it should be one of the last things shutdown. - - * mail-format.c (handle_text_plain): Dont use (if (!p++), and then - check p!= later, since its now 1, oops. Fixes #13106, thought it - was a start of uuencoded stuff! - - * folder-browser.c (on_right_click): Escape _'s before adding them - to menu from mailing list name, also remove some dead code that - someone forgot to remove when refactoring. #11307. - (folder_browser_is_drafts): Use the store's uri_cmp function to - compare to the drafts uri's. - (folder_browser_is_sent): Same. Slight cleanup for #11351. - -2001-10-21 Dan Winship <danw@ximian.com> - - * mail-callbacks.c (mail_generate_reply): Update for - e_msg_composer_add_messages_attachments arg change. - (do_forward_non_attached): Likewise. - -2001-10-20 Jon Trowbridge <trow@ximian.com> - - * mail-display.c (mail_display_new): Don't leak our - ESearchingTokenizer. - -2001-10-20 Larry Ewing <lewing@ximian.com> - - * folder-browser-ui.c: hook up zoom functions. - - * mail-callbacks.h: add prototypes. - - * mail-callbacks.c (zoom_in): added. - (zoom_out): added. - (zoom_reset): added. - -2001-10-19 Jeffrey Stedfast <fejj@ximian.com> - - * mail-callbacks.c (transfer_msg): Allow copy/move to/from vTrash - folders as well. - - * component-factory.c (destination_folder_handle_drop): Properly - handle local vTrash folders. - -2001-10-19 <NotZed@Ximian.com> - - * mail-account-gui.c (build_auth_menu): Dont translate camel strings. - (mail_account_gui_setup): " - -2001-10-19 Ettore Perazzoli <ettore@ximian.com> - - * component-factory.c (destination_folder_handle_motion): Get - @folder_type here too [to match the changes in the - EvolutionShellComponentDnd interface]. Also, remove a debugging - message. - (destination_folder_handle_drop): Likewise. - -2001-10-19 Jeffrey Stedfast <fejj@ximian.com> - - * mail-callbacks.c (mail_generate_reply): Update to reflect API - changes to e_msg_composer_add_message_attachments(). - (do_forward_non_attached): Same. - (providers_config): Oops, pass a GdkWindow instead of a GtkWindow. - -2001-10-19 <NotZed@Ximian.com> - - * mail-folder-cache.c (store_finalised): Free folders_uri. - (real_folder_deleted): If folder is deleted, remove it from the - hashtables. - -2001-10-18 <NotZed@Ximian.com> - - * subscribe-dialog.c (get_short_folderinfo_get): Remove the - register/unregister, they're already done above us. - - * mail-vfolder.c (vfolder_adduri): Added remove flag - its not - adduri, its removeuri, its less typing than creating a removeuri. - (vfolder_adduri_do): Implement the remove flag. - (mail_vfolder_remove_uri): Changed to mail_vfolder_delte_uri, to - indicate its actually been deleted. - (mail_vfolder_add_uri): Added remove flag. - (rule_changed): When adding existing folders to a new rule, strdup - the list data. - (mail_vfolder_delete_uri): Dont do any work to remove the actual - folder from the vfolder (we'd have to look it up first), let the - vfolder remove it itself. Just update the rules. - - * mail-folder-cache.c (store_finalised): Unhook from all events - when done. - (mail_note_store_remove): Remove a store from being noted. - (free_folder_info): Also if we have a folder, unhook all events. - Also remove the uri from vfolders. - (mail_note_folder): Remove warning about adding folders to stores - that aren't added yet - we might actually be removing the store. - - * component-factory.c (mail_remove_storage): Call - mail_note_store_remove when we remove the storage. - -2001-10-18 Jeffrey Stedfast <fejj@ximian.com> - - * mail-callbacks.c (providers_config): Don't make the mail - settings dialog modal. - -2001-10-17 Ettore Perazzoli <ettore@ximian.com> - - * mail-account-gui.c (folder_picker_clicked): Pass the toplevel to - `evolution_shell_client_user_select_folder()'. - * mail-callbacks.c (transfer_msg): Likewise. - -2001-10-18 <NotZed@Ximian.com> - - * mail-send-recv.c (build_dialogue): call setup_send_data *after* - we've setup the global dialogue thingy. - (mail_send_receive): Instead of using static local to check for - re-running of dialogue, use a global, setup by build_dialogue. - These fix #12335. - (mail_send_receive): Dont assert dialogue is realized, it might - still be being built, so only show if it is realized. - -2001-10-18 Dan Winship <danw@ximian.com> - - * mail-mt.c (mail_call_main): Use G_VA_COPY to make this compile - on ppc again. - (do_call): Here too. - -2001-10-17 <NotZed@Ximian.com> - - * mail-folder-cache.c (store_folder_subscribed): Clone the - folderinfo before passing to async event. - (real_folder_created): Free when done. - (store_folder_unsubscribed): - (real_folder_deleted): And same here. - - * mail-ops.c (mail_expunge_folder): Use the queued thread for - expunging folders. - -2001-10-17 Jeffrey Stedfast <fejj@ximian.com> - - * mail-ops.c (mail_send_message): No longer need to copy the - description now that camel-exceptions have been fixed. - - * subscribe-dialog.h (subscribe_dialog_show): Helper macro. - - * subscribe-dialog.c (subscribe_dialog_run_and_close): Removed. - - * mail-callbacks.c (check_send_configuration): Don't use - gnome_dialog_run_and_close() here, we can easily get away with - just using a gtk_widget_show(). - (providers_config): Don't use a gnome_dialog_run_and_close() here - either. No longer need to use e_gnome_dialog utils. - (manage_subscriptions): Don't run_and_close(). - -2001-10-17 <NotZed@Ximian.com> - - * mail-callbacks.c (empty_trash): Only empty trash on enabled - accounts, fixes #12821. - -2001-10-17 Dan Winship <danw@ximian.com> - - * mail-format.c (write_default_header): Make Reply-To bold too - since no one ever figures out why it's not currently. - -2001-10-17 Iain Holmes <iain@ximian.com> - - * importers/evolution-mbox-importer.c: Fix the typo. - -2001-10-16 Jeffrey Stedfast <fejj@ximian.com> - - * mail-ops.c (uid_cachename_hack): Lets put the UID cache in - ~/evolution/mail/pop3 as this makes more sense than ~/mail/config - does. Perform checking to see what flavor cache-path the user is - on and compensate. - - * message-list.c (on_cursor_activated_idle): Check that the - cursor_uid is non-NULL before emitting a "message_selected" - signal. Fixes bug #6015. - -2001-10-16 Jon Trowbridge <trow@ximian.com> - - * e-searching-tokenizer.c (e_searching_tokenizer_begin): Always - explicitly clear out the SearchInfo. - -2001-10-16 <NotZed@Ximian.com> - - * mail-folder-cache.c: Added an async_event handler to store_info. - (mail_note_store): Setup async event handler here. - (store_finalised): Flush out async events here. - (folder_changed): Use async event handler to emit event. - (mail_note_folder): Chagned, do most of the work in the calling - context, only do the corba stuff in main. - (store_folder_subscribed): Use async event, and do more work locally. - (store_folder_unsubscribed): Same. - (store_folder_deleted): Call store_folder_unsubscribed if we have - to do any work. - (store_folder_created): Call store_folder_subscribed if we have to - do any work. - (store_folder_unsubscribed): Ref store while busy. - (real_folder_deleted): And unref here. - (store_folder_subscribed): Reg store while busy. - (real_folder_created): Unref here. - (mail_note_folder): Ref folder while busy. - (real_note_folder): And unref here. - (mail_note_folder): Hook onto folder_deleted event. - (folder_deleted): Just mark this folder as no longer available. - - * mail-session.c (register_timeout): Use mail_call_main instead of - proxy_event. - (remove_timeout): Same here. - - * folder-browser.c (folder_changed): use the new mail_async_event - stuff. - (folder_changed_main): Remove old async event handling stuff. - (FOLDER_BROWSER_LOCK/UNLOCK): Removed. - (FolderBrowserPrivate): Removed too, sigh. - (folder_browser_set_message_preview): Return do nothing if we're - destroyed (message_list == NULL). - (folder_browser_search_query_changed): " - (folder_browser_toggle_preview): " - (folder_browser_toggle_threads): " - (folder_browser_toggle_hide_deleted): " - (folder_browser_set_message_display_style): " - (folder_browser_charset_changed): " All for #12613. - - * mail-mt.c (mail_async_event_new, mail_async_event_emit, - mail_async_event_destroy): New functions to handle async events. - (mail_proxy_event, mail_proxy_event_id): Removed old functions for - async events. - (do_call): Add suport for MAIL_CALL_p_pp. - (mail_msg_free): Use mail_async_event instead of proxy_event. - - * message-list.c (message_changed): Promote the message_changed to - a folder_changed and use main_folder_changed to process it. - (main_message_changed): Remove.d - (message_list_init): Setup async event handler. - (message_list_destroy): Remove async handler. - (folder_changed): Use async hanler to emit event in main loop. - (message_changed): Same. - - * mail-mt.c (mail_proxy_event_id): New function to return the id - of the currently executing proxied event. - - * folder-browser.h: Added private field. - - * folder-browser.c (folder_changed): Keep track of tasks - outstanding in the tasks list, locked access. - (FOLDER_BROWSER_LOCK, UNLOCK): Macros to lock the folder browser - for poking about in diff threads. - (folder_browser_finalise): Wait for any outstanding takss to - finish before cleaning ourself up. - (folder_browser_destroy): Move the seen_id handling to finalise, - also add a loading_id handling code. - (main_folder_changed): Remove our running task when done. - -2001-10-15 Larry Ewing <lewing@ximian.com> - - * mail-display.c (mail_error_write): don't write strings longer - than they actually are. - -2001-10-15 Jeffrey Stedfast <fejj@ximian.com> - - * folder-browser.c (folder_browser_destroy): Remove the mark_seen - timeout. - -2001-10-15 Larry Ewing <lewing@ximian.com> - - * mail-callbacks.c (mail_generate_reply): don't apply the body - text in replys since we will just replace it anyway. - -2001-10-15 Jeffrey Stedfast <fejj@ximian.com> - - * component-factory.c (owner_unset_cb): Call - mail_vfolder_shutdown. - - * mail-vfolder.c (mail_vfolder_shutdown): Unref all of our - VFolders. - - * mail-folder-cache.c (real_note_folder): Remember to unref the - folder before returning if we have already noted this folder. - -2001-10-15 <NotZed@Ximian.com> - - * mail-session.c (get_password): Proxy get-password call to main - thread. - (forget_password): same for forget_password. - (get_filter_driver): and same for get_filter_driver, since it uses - gtk objects. - - * mail-mt.c (mail_call_main): new generic interface for calling - stuff/proxying in the gui thread. - -2001-10-14 Jon Trowbridge <trow@ximian.com> - - * e-searching-tokenizer.c (e_searching_tokenizer_clone): Share - more state between the parent and its clones, so that our multiple - tokenizers don't get out of sync when we are rendering frames and - iframes. (Bug #11638) - -2001-10-13 Jon Trowbridge <trow@ximian.com> - - * e-searching-tokenizer.c (search_info_compare): Bad hacker! - Don't implicitly assume that utf8 characters are one byte in size! - (Bug #9520) - (e_searching_tokenizer_begin): As long as I'm touching those code: - don't increase the size of search matches. I'll fix the colors - later. (part of bug #11589) - -2001-10-13 Dan Winship <danw@ximian.com> - - * mail-callbacks.c (create_msg_composer): Don't emit a gtk warning - if the composer creation fails. - -2001-10-12 Dan Winship <danw@ximian.com> - - * message-list.c, message-list.h, message-list.etspec: Revert the - change to remove the Score column until Chris can fix ETable so - it's possible to remove a column without breaking everyone's - exisiting settings. - -2001-10-12 Iain Holmes <iain@ximian.com> - - * importers/evolution-mbox-importer.c (load_file_fn): Don't ever create - the folder here. Wait until the shell has created it. Otherwise we get - loads of race conditions where the mailer can create a subfolder before - the shell has registered the parent. - -2001-10-12 Chris Toshok <toshok@ximian.com> - - * main.c (main): call e_passwords_init and e_passwords_shutdown. - - * mail-session.h: add prototypes for - mail_session_{get,add}_password. - - * mail-session.c (init): empty this out - we use e_passwords - instead of a local hashtable. - (get_password): use e_passwords_get_password and - e_passwords_add_password. - (forget_password): use e_passwords_forget_password. - (mail_session_remember_password): use - e_passwords_remember_password. - (mail_session_forget_password): use e_passwords_forget_password. - (mail_session_get_password): new function, use - e_passwords_get_password. - (mail_session_add_password): same, use e_passwords_add_password. - (mail_session_forget_passwords): use e_passwords_forget_passwords. - - * mail-config.c (mail_config_write_on_exit): fix this up so it - works as desired with the e_passwords stuff. - -2001-10-12 Jeffrey Stedfast <fejj@ximian.com> - - * mail-display.c (mail_error_write): Convert URLS so we can get - clickable links. - - * message-list.c: Removed score stuff. - -2001-10-12 Jon Trowbridge <trow@ximian.com> - - * mail-display.c (html_button_press_event): Store our listener id. - (popup_info_free): Disconnect our listener when we free the popup. - (Bug #11040) - -2001-10-11 Jon Trowbridge <trow@ximian.com> - - * mail-callbacks.c (addrbook_sender): Listen for "destroy" events - from the control, so that we don't leave stray windows laying - around. (Bug #9101) - -2001-10-11 <NotZed@Ximian.com> - - * local-config.glade: Added a checkbox for body indexing. - - * mail-local.c (mail_local_reconfigure_folder): Get index_body - widget. - (mail_local_folder_reconfigure): Add an 'index_body' argument & - implement. Dont do anything if nothing changed. - - * openpgp-utils.c (openpgp_verify): Use e_iconv_open. - -2001-10-11 Jeffrey Stedfast <fejj@ximian.com> - - * mail-callbacks.c (do_forward_non_attached): Attach the message - attachments. Fixes bug #5439. - -2001-10-11 Dan Winship <danw@ximian.com> - - * mail-folder-cache.c (update_1folder): No longer need to pass - folder display name to storage update_folder methods. - (setup_folder, free_folder_info): Meaning we no longer need to - keep track of it. - - * evolution-outlook-importer.[ch], evolution-mbox-importer.[ch]: - These copies are cruft. The real ones are in importers/. - -2001-10-11 Jeffrey Stedfast <fejj@ximian.com> - - * component-factory.c (free_storage): Make sure the - service/storage are non-NULL. - - * mail-callbacks.c (e_gnome_dialog_parent_destroyed): Call - gtk_main_quit. - (send_receive_mail): Don't use e_gnome stuff since this doesn't - need to be run using gnome_dialog_run_and_close(). - (composer_send_cb): Same. - (edit_msg): Here too. - (resend_msg): And here. - (search_msg): Same. - (filter_edit): Here too. - (filter_edit): Don't use e_gnome_dialog_set_parent() because we - don't do gnome_dialog_run_and_close on this dialog. - (e_gnome_error_dialog_parented): Removed. - (e_gnome_ok_dialog_parented): Removed. - -2001-10-10 Dan Winship <danw@ximian.com> - - * mail-config.c (new_source_created): Fix up the logic here. - -2001-10-10 Larry Ewing <lewing@ximian.com> - - * mail-callbacks.c (mail_generate_reply): use new function to copy - the attachments from the source message. This still isn't perfect - but it should avoid the problems with headers being transfered. - This makes images in replies work again. - - * mail-display.c (save_url): copy the data. We can't ref the byte - array and we can't free it so we have to copy it. - -2001-10-10 <NotZed@Ximian.com> - - * mail-ops.c (transfer_messages_transfer): IF the source and - destination folders are the same, do nothing. Oh, and return an - error, otherwise the shell goes and removes it anyway. Fixes a - rather serious bug with dnd of folders onto their current - location. - -2001-10-09 Larry Ewing <lewing@ximian.com> - - * mail-display.c (save_part): ref the part. - (save_destroy_cb): new function to unref the part when we have - closed the dialog. - (save_url): fake a mime part so that we can save data urls without - extra effort. This is less sucky than it seems since it handles - filenames and ref counting with minimal fuss. - -2001-10-09 <NotZed@Ximian.com> - - * component-factory.c (owner_unset_cb): Disconnect from all the - signals we were listening to, so we dont try and do shit twice on - exit (one on unset_cb, one on destroy). - (create_component): Setup the signal handlers using a table, so - they're easier to disconnect on finish. - - * mail-folder-cache.c (folder_changed): Ref folder so it hangs - around till we're done with it. - (real_folder_changed): Unref folder when we are done with it. - Should fix #11981. - -2001-10-09 Jeffrey Stedfast <fejj@ximian.com> - - * folder-browser.c (done_message_selected): Make sure the - mail-display is non-NULL. - -2001-10-09 <NotZed@Ximian.com> - - * mail-local.c (mlf_search_by_uids): Implement. - -2001-10-09 Jeffrey Stedfast <fejj@ximian.com> - - * folder-browser-ui.c (folder_browser_ui_add_message): Create a - chaqrset picker submenu in the View menu. - - * mail-format.c (mail_format_raw_message): Pass the mail-display - to get_data_wrapper_text. - (get_data_wrapper_text): Use the user's override charset if one is - provided, otherwise user the user's default charset. - (handle_text_plain): Pass along the mail-display to - get_data_wrapper_text. - (handle_application_pgp): Same. - (handle_text_enriched): Here too. - (mail_get_message_body): Pass NULL as the mail-display to - get_data_wrapper_text since we don't have access to a - mail-display. - - * mail-display.c (mail_display_set_charset): New function to set a - charset on the maildisplay. Once set, the message is redisplayed - using the new charset. - (mail_display_destroy): Free the charset. - - * folder-browser.c (folder_browser_charset_changed): New callback - for when a user overrides the message charset. - -2001-10-09 Dan Winship <danw@ximian.com> - - * mail-callbacks.c (e_gnome_dialog_set_parent): Use - gtk_signal_connect_while_alive here so - e_gnome_dialog_parent_destroyed doesn't get called on an - already-destroyed dialog. - - * mail-config-druid.c (*_prepare): Record which page we're - currently in. - (*_changed): Only update the druid buttons if we're the current - page. Fixes a problem that could make it impossible to get beyond - the first page of the setup wizard. - - * mail-callbacks.c (mail_generate_reply): Revert the change to use - e_msg_composer_new_with_message. That has unwanted side effects. - (This commit re-breaks replying to HTML messages with inline - images.) - -2001-10-08 Dan Winship <danw@ximian.com> - - * mail-local.c (mlf_set_folder, mlf_unset_folder): Update for - folder_flags. - - * folder-browser-ui.c (folder_browser_ui_add_list): Check - CAMEL_FOLDER_IS_TRASH flag rather than checking - CAMEL_IS_VTRASH_FOLDER. - - * folder-browser.c (folder_browser_toggle_hide_deleted): Likewise - - * message-list.c (message_list_set_folder): Likewise. - (message_list_set_hidedeleted): Remove redundant trash check. - -2001-10-08 Jon Trowbridge <trow@ximian.com> - - * mail-format.c (write_default_header): Write out the Bcc: header - when applicable. Fixes bug #5823. - -2001-10-08 Jeffrey Stedfast <fejj@ximian.com> - - * mail-format.c (attachment_header): Convert the htmlinfo into - utf8. Fixes bug #11966. - -2001-10-08 Dan Winship <danw@ximian.com> - - * component-factory.c (create_view): For mailstorage folders, - connect to the control's "activate" signal, and don't try to - connect to the store. - (storage_activate): Instead, do it here, so if the connection - fails, or the user cancels, or whatever else, he can try again - later. - -2001-10-07 Dan Winship <danw@ximian.com> - - * mail-tools.c (mail_tool_do_movemail): Remove #ifndef - MOVEMAIL_PATH code, since the setting of that variable has been - meaningless for a while now, and the rest of the code DTRT whether - that code executes or not. - -2001-10-05 Jeffrey Stedfast <fejj@ximian.com> - - * mail-mt.c (pass_got): Fix a merge-conflict leftover. - -2001-10-05 <NotZed@Ximian.com> - - * folder-browser.c: reformatted the menu tables so they're a bit - more bloody readable. - - * mail-folder-cache.c (mail_note_store): Hook into - subscribed/unsubscribed events. Only 'add/remove' folders from - the add/removed events if we aren't subscribed, otherwise use the - subscribed events. Rest of fix for #11831 - -2001-10-05 Jon Trowbridge <trow@ximian.com> - - * mail-config.glade: Add toggle button to config menu to turn the - "confirm sending unwanted HTML" dialog on/off. (Bug 10794) - - * mail-accounts.c (construct): Make said toggle button actually - work. - -2001-10-05 Jeffrey Stedfast <fejj@ximian.com> - - * mail-callbacks.c (e_gnome_dialog_set_parent): New convenience - function that not only sets the gnome-dialog's parent window but - also makes sure that the gnome-dialog closes when it's parent - closes. - (e_gnome_warning_dialog_parented): New conmvenience wrapper around - the libgnomeui version that also does the same thing as - e_gnome_dialog_set_parent. - (e_gnome_error_dialog_parented): Same. - (e_gnome_ok_dialog_parented): And again... - (e_gnome_ok_cancel_dialog_parented): And once again. - -2001-10-05 Larry Ewing <lewing@ximian.com> - - * mail-callbacks.c (mail_generate_reply): use - e_msg_composer_new_with_message rather than e_msg_composer_new. - This way we bring in all the attachment of the message we are - replying to. - -2001-10-05 Christopher James Lahey <clahey@ximian.com> - - * message-list.c (message_list_setup_etree): Turn on - "uniform_row_height" argument. - -2001-10-04 <NotZed@Ximian.com> - - * folder-browser.c (update_status_bar): Show "nn sent" as total in - sent folder, rather than just 'total'. - - * mail-folder-cache.c (update_1folder): Also show total message - count for sent_folder. - - * folder-browser-ui.c (folder_browser_setup_property_menu): Do a - better job of setting up the name. Also de-sensitise when we - can't configure the folder. - -2001-10-04 Jeffrey Stedfast <fejj@ximian.com> - - * mail-callbacks.c (providers_config): Set the parent window as - the fb. This fixes bug #11723. - (filter_edit): Do the same thing here too and also to the warning - dialog. - (edit_msg): Set the parent on the warning dialog. - (resend_msg): And here. - (search_msg): Here too. - (confirm_expunge): Set the parent window on the dialog here too. - (save_msg_ok): Same here. - - * mail-accounts.c (images_radio_toggled): Ignore the signal if the - radio button is not "on". This fixes bug #10532 because the on/off - signals don't always come in the off->on order. - - * mail-ops.c (mail_send_message): Reduced some redundancy. - -2001-10-04 Dan Winship <danw@ximian.com> - - * mail-format.c (write_address): Fix so that an email address with - no name is once again just "foo@bar.com", not "<foo@bar.com>". - -2001-10-04 Iain Holmes <iain@ximian.com> - - * importers/evolution-mbox-importer.c (load_file_fn): Only pass - CAMEL_STORE_FOLDER_CREATE when the shell will be creating the - folder. - -2001-10-04 <NotZed@Ximian.com> - - * mail-callbacks.c (configure_folder): If we're accessing a - vfolder uri, then popup the vfolder editor instead of trying the - mail local one. - - * mail-vfolder.c (vfolder_edit_rule): Edit a vfolder by name. - -2001-10-04 Jeffrey Stedfast <fejj@ximian.com> - - * mail-account-gui.c (mail_account_gui_save): Added some more NULL - checks. - -2001-10-04 <NotZed@Ximian.com> - - * component-factory.c (storage_remove_folder): Do the url - fragment/path -> folder name hack. Removing vfolders from shell - works now? - -2001-10-03 <NotZed@Ximian.com> - - * mail-send-recv.c (build_dialogue): Only build destination data - if we have destination != NULL. Fixes crash of bug #10835. - - * folder-browser.c (folder_browser_config_search): Set 'to' -> - 'recipient' data for search object. #6199. - - * mail-local.c (local_storage_new_folder_cb): Handle vtrash case, - emit 'folder_created' event for the folder-cache to work, etc. - -2001-10-03 Jeffrey Stedfast <fejj@ximian.com> - - * mail-format.c (mail_write_authenticity): Don't use the wax-seal - icons for the pgp stuff anymore, use Jimmac's new icons instead. - -2001-10-03 <NotZed@Ximian.com> - - * mail-folder-cache.c (folder_changed): Dont wait for event to - finish before returning. This could however mean we process it - after things have vanished below us? Fixes another case of ctrl-d - deadlock. - - * folder-browser.c (update_status_bar): If we have hide deleted - set, then dont count deleted messages in the 'total' messages - count. Fixes #6591. - - * mail-ops.c (add_vtrash_info): If we have a fragment, override - that, rather than the path. Fixes #5251. - (remove_folder_get): Freeze/thaw around deleting all messages in - folder. - -2001-10-03 Rodrigo Moya <rodrigo@ximian.com> - - * importers/Makefile.am: add $BONOBO_GNOME_CFLAGS to make it work - with latest Bonobo - -2001-10-02 Jeffrey Stedfast <fejj@ximian.com> - - * mail-callbacks.c (transfer_msg): Pass an empty flags argument to - mail_transfer_messages - destination folder should already be - created by this point. - - * folder-browser.c (message_list_drag_data_received): Pass an - empty flags argument to mail_transfer_messages. - (selection_received): Same. - - * component-factory.c (xfer_folder): Pass the CREATE flag to - mail_transfer_messages() so that the dest folder gets created. - (destination_folder_handle_drop): Update for mail-ops API change. - - * mail-ops.c (mail_transfer_messages): Now takes a dest_flags - argument that it passes along to mail_tool_uri_to_folder when - opening the destination folder. - -2001-10-02 Jeffrey Stedfast <fejj@ximian.com> - - * mail-vfolder.c (vfolder_setup_do): Pass an empty flags argument - to mail_tool_uri_to_folder. - (vfolder_adduri_do): Same. - - * mail-session.c (get_folder): Pass an empty flags argument to - mail_tool_uri_to_folder. - - * mail-send-recv.c (receive_get_folder): Pass an empty flags - argument to mail_tool_uri_to_folder. - - * mail-ops.c (get_folder_get): Pass the flags to - mail_tool_uri_to_folder. - (mail_get_folder): Now takes a flags argument. - (remove_folder_get): Pass an empty flags argument to - mail_tool_uri_to_folder. - (mail_send_message): Pass an empty argument flag to - mail_tool_uri_to_folder. - (transfer_messages_transfer): Same. Destination folder should - already be created by this time. - - * folder-info.c (do_get_info): Pass an empty flags argument to - mail_tool_uri_to_folder. - - * importers/evolution-mbox-importer.c (folder_created_cb): Pass - the CREATE flag here too. - (load_file_fn): And here. - (load_file_fn): And here too. - - * importers/evolution-outlook-importer.c (load_file_fn): Pass the - CREATE flag to mail_tool_uri_to_folder. - - * folder-browser.c (folder_browser_new): Pass an empty flags - argument. - (x_evolution_message_parse): Pass an empty flags argument to - mail_tool_uri_to_folder. - - * component-factory.c (create_folder): Pass a CREATE flag to - mail_get_folder here too. - (owner_set_cb): And here. - (xfer_folder): Shouldn't need the CREATE flag here, so not passing - any flags. - (destination_folder_handle_drop): Same. - - * mail-local.c (mail_local_store_add_folder): Pass a CREATE flag - to mail_get_folder. - (reconfigure_folder_reconfigure): Pass an empty flags argument to - mail_tool_uri_to_folder. - - * mail-tools.c (mail_tool_uri_to_folder): Take a flags argument. - (mail_tool_get_local_inbox): Pass an empty flags argument to - mail_tool_uri_to_folder. - -2001-10-02 Ettore Perazzoli <ettore@ximian.com> - - * mail-account-gui.c (launch_signature_editor): Use - `bonobo_ui_component_new_default()', not - `bonobo_ui_component_new()'. - -2001-10-01 Jon Trowbridge <trow@ximian.com> - - * mail-display.c (on_url_requested): Make sure we aren't dealing - with a pathological message w/o a From: header. - (ebook_callback): Properly check that the address we queried - matches the address on the current message. (Bug #10038) - -2001-10-01 Iain Holmes <iain@ximian.com> - - * component-factory.c (component_factory_init): Check for errors. - - * mail.h: Change prototype for evolution_folder_info_factory_init. - - * folder-info.c (evolution_folder_info_factory_init): Return TRUE - or FALSE. - - * mail-config.c (evolution_mail_config_factory_init): Return TRUE or - FALSE. - - * mail-config.h: Change prototype for above. - -2001-10-01 Jeffrey Stedfast <fejj@ximian.com> - - * mail-vfolder.c (mail_vfolder_remove_uri): replace my_list_find() - == NULL with my_list_find() != NULL. - -2001-10-01 Dan Winship <danw@ximian.com> - - * component-factory.c (mail_load_storage_by_uri): create storages - for providers that are STORAGE and aren't EXTERNAL, rather than - "(STORAGE and REMOTE) or spool, maildir, or vfolder". - (mail_remove_storage_by_uri): Use the same rule here (which makes - it possible now to remove maildir and spool stores now, which - weren't properly special-cased before). Remove some CamelException - misuse. - - * mail-config.c (new_source_created): Fix up the broken INBOX- - shortcut-generating assumption a little by only assuming that if - you call camel_store_get_inbox(), that its full_name is the same - as its path. (This happens to always be true for inboxes now, and - will be always true by definition at some point in the future.) - Now maildir stores get working Inbox shortcuts. - - * mail-send-recv.c (get_receive_type): If PROVIDER_IS_STORAGE - then use SEND_UPDATE, if not, use SEND_RECEIVE. - - * mail-local.c (local_provider): The local provider is EXTERNAL. - (The shell creates it.) - (mail_local_reconfigure_folder): Allow reconfiguring between - IS_LOCAL providers. - - * mail-accounts.c (news_delete): Don't need to check the provider - flags here... we know nntp is a STORAGE. - -2001-10-01 Dan Winship <danw@ximian.com> - - * mail-local.c (mail_local_reconfigure_folder): Don't use - mail_tool_get_folder_name here since that function only existed to - be clever in a certain case that this is not. - (reconfigure_folder_free): Remove the dialog from the hash table - here so that it gets removed in the successfully-reconfigured case - too. Don't unref folder_out if it never got set. - (reconfigure_clicked): Remove the hash table code from here; it's - in reconfigure_folder_free now. - - * mail-tools.c (mail_tool_get_folder_name): No longer used by - anything. - (mail_tool_get_folder_from_urlname): Also not used anywhere. - -2001-10-01 Jeffrey Stedfast <fejj@ximian.com> - - * mail-tools.c (mail_tool_uri_to_folder): Don't pass the CREATE - flag, we shouldn't ever need this... - -2001-10-01 Larry Ewing <lewing@ximian.com> - - * mail-identify.c (mail_identify_mime_part): if gnome-vfs returns - application/octet-stream with the magic check, use the filename - check instead since it at least has a chance of being useful. - -2001-09-28 Dan Winship <danw@ximian.com> - - * folder-browser-ui.c (fbui_sensitize_timeout): wrap a - bonobo_ui_component_freeze/thaw around all of the set_props so - they all update at once. - -2001-09-28 Jeffrey Stedfast <fejj@ximian.com> - - * mail-accounts.c (construct): Don't create checkboxes for global - Threaded or Preview options as they are now removed. - -2001-09-28 <NotZed@Ximian.com> - - * component-factory.c (owner_set_cb): Setup vfolder storage before - all others. - - * mail-local.c (mail_local_store_remove_folder): Emit - folder_deleted event. - (remove_find_path): Fix, compare against path, not full_name. - - * mail-tools.c (mail_tool_uri_to_folder): Dont - vfolder_register_source anymore. - - * mail-vfolder.c (rule_changed): Changed to access - mail_fodler_cahce to find out if the folder exist yet before - trying to open them, also use the cache as a cache so we dont have - to open the folder if its already been opened. - (vfolder_register_source, register_source): Removed. - (source_finalise): Removed, - (check_source): Removed. All handled through diff mechanism. - (mail_vfolder_add_uri): New function, records uri's of available - folders, and adds them to any active vfolders if required. - (mail_vfolder_remove_uri): New function, removes a uri from - available folders, and checks any rules to see fi they need - updating. - (vfolder_adduri): New async function to add a uri to all vfolders - that need it. - (store_folder_deleted): oops! free user, not rule!! - - * mail-folder-cache.c: Add uri->folderinfo hashtable, and the - store from which they come into the store info struct. - Add uri to the folder_info. - (setup_folder): Store the uri in the folderinfo. - (setup_folder): And the uri in the folder_uri hashtable. - (mail_note_store): Store the store in the storeinfo, and setup the - folders_uri hashtable via the store's hash functions. - (setup_folder): Call mail_vfolder_add_uri to note this newly setup - folder uri. - (store_folder_deleted): Proxy call to main thread. - (real_folder_deleted): And tell the vfolder to remove this uri - from its folder list. - (setup_folder): Dont call vfolder_add_uri if noselect is set on - the uri. - -2001-09-27 <NotZed@Ximian.com> - - * mail-vfolder.c: Removed vfolder_info struct, vfolder_storage. - Neither used anymore. - -2001-09-28 Jeffrey Stedfast <fejj@ximian.com> - - * mail-config.c (mail_config_get_account_by_transport_url): Use - Camel to compare the urls rather than using e_url_equal which does - all sorts of funky shit that may not work in every case. - -2001-09-28 Jeffrey Stedfast <fejj@ximian.com> - - * mail-local.c (mail_local_provider_init): Setup the url_hash and - url_equal functions for the local provider. - - * mail-account-gui.c (mail_account_gui_save): Add code here to - check to make sure that the Drafts and Sent folders are pointing - to valid urls. This is kinda nasty and only really solves the case - where the user changes, say, his imap server or - something. Unfortunately we still have the problem where if - account A's sent/drafts folders point to account B's store and the - user changes the url for account B. - - * mail-config.c (mail_config_get_account_by_source_url): Use Camel - to compare the urls rather than using e_url_equal which does all - sorts of funky shit that may not work in every case. - -2001-09-28 Dan Winship <danw@ximian.com> - - * mail-mt.c (pass_got): Don't call - mail_config_service_set_save_passwd if we didn't find a service. - -2001-09-27 Ettore Perazzoli <ettore@ximian.com> - - * mail-config.c (add_shortcut_entry): Just add the shortcut to the - first group. - -2001-09-28 Jeffrey Stedfast <fejj@ximian.com> - - * folder-browser-ui.c (folder_browser_ui_add_list): Call - folder_browser_toggle_threads() here after setting the value. This - should fix bug #6415 and if it doesn't, then this whole deal is - just a lost cause. - - * mail-mt.h: Added mail_msg_cleanup() prototype. - -2001-09-28 Dan Winship <danw@ximian.com> - - * mail-format.c (get_data_wrapper_text): Deal with - camel_mime_filter_charset_new_convert returning NULL. (Every other - call to it does, and something's wrong with iconv on the Sun right - now so it keeps failing.) - -2001-09-27 Ettore Perazzoli <ettore@ximian.com> - - * mail-mt.c (do_user_message): Always make the Cancel button the - last one. - -2001-09-27 <NotZed@Ximian.com> - - * mail-folder-cache.c (real_note_folder): No such event finalized! - Its finalize. - (mail_note_store): " - - Fixed dan's comment a bit, info != NULL for folder_created, info== - NULL for changed. - -2001-09-26 <NotZed@Ximian.com> - - * mail-local.c (mlf_set_message_flags): Proxy the - set_message_flags call too. Doesn't fix the 'local folder counts - dont update' problem, but its more correct. - -2001-09-27 Jeffrey Stedfast <fejj@ximian.com> - - * mail-session.c (mail_session_remember_password): Perform a - NULL-check. Hopefully fixes bug #7874. - -2001-09-27 Dan Winship <danw@ximian.com> - - * mail-offline-handler.c (service_is_relevant): A service needs to - be disconnected if it's remote, not already offline, and either - connected OR connecting. - (storage_go_offline): Don't put non-relevant stores offline. (Eg, - don't force an IMAP store which you hadn't already connected to to - connect and sync.) - (storage_go_online): Likewise, don't "reconnect" stores that - weren't connected before. - - * mail-ops.c (set_offline_desc): Fix the message to say - "reconnecting" instead of "disconnecting" when appropriate. - (mail_store_set_offline): If offline is TRUE, call - camel_service_cancel_connect on the store. (We do this here - because we don't want the cancel_connect request to get queued up - behind a hanging connection attempt.) - -2001-09-26 Anna Marie Dirks <anna@ximian.com> - - * mail-config.glade: Added a "Description:" label and moved - the source_description and transport_description labels to - a more appropriate place. - -2001-09-26 Christopher James Lahey <clahey@ximian.com> - - * message-list.c (mlfe_callback): Check for the root node here. - Fixes Ximian bug #11029. - -2001-09-26 Jeffrey Stedfast <fejj@ximian.com> - - * mail-mt.c (do_get_pass): Change the wording of the password - dialog if we are getting a pgp passphrase so that users don't - misinterpret it to mean saving the passphrase forever. - -2001-09-26 Jon Trowbridge <trow@ximian.com> - - * mail-callbacks.c (composer_get_message): strdup our "This - message contains invalid recipients" string, since it gets freed - later. And then don't leak the message string. (Bug #10877) - - * mail-format.c (write_address): Use camel_address_format, - not camel_address_encode. - - * mail-display.c (html_button_press_event): Decode our URL before - extracting the address to pop up contact info. - - * mail-format.c (write_address): When writing out a mailto: link, - make sure we construct a valid URL w/ correct encoding. Make sure - our address is properly quoted, if necessary. - -2001-09-26 Dan Winship <danw@ximian.com> - - * mail-folder-cache.c: Add a big comment explaining unread message - counts so no one can mess them up again in the future. :-) - (update_1folder): If info->unread_message_count is -1, don't do - anything. - - * component-factory.c (component_factory_init): warn and exit if - oaf_active_server_register returns OAF_REG_ALREADY_ACTIVE. - -2001-09-26 Jeffrey Stedfast <fejj@ximian.com> - - * mail-config.c (config_read): Oops, translate the fake account - name to UTF-8. - -2001-09-26 Christopher James Lahey <clahey@ximian.com> - - * message-list.c (message_list_foreach): Use - e_tree_selected_path_foreach instead of - e_tree_selected_row_foreach here. - -2001-09-27 Michael Meeks <michael@ximian.com> - - * mail-config.c (mail_config_init): report the - exception on failure and abort quickly instead of hitting - a strange assert later. - -2001-09-25 Jeffrey Stedfast <fejj@ximian.com> - - * mail-format.c (decode_pgp): Update to not send the - remember-passphrase option to the context, it doesn't need it - anymore. - (try_inline_pgp_sig): Same. - - * mail-accounts.c (construct): The remember-passphrase option is - no longer there. This can now be set on the passphrase prompt - dialog. - (construct): Add confirm expunge options. - - * mail-config.c (config_read): We no longer read-in the - remember-passphrase state because we no longer need it. - (mail_config_write_on_exit): We no longer save it either. - (mail_config_get_remember_pgp_passphrase): Removed. - (mail_config_set_remember_pgp_passphrase): Removed. - - * mail-crypto.c (mail_crypto_pgp_mime_part_sign): No longer do we - need to send the remember passphrase state to the pgp context. - (mail_crypto_pgp_mime_part_verify): Same. - (mail_crypto_pgp_mime_part_encrypt): Here too. - (mail_crypto_pgp_mime_part_decrypt): And here. - -2001-09-25 Ettore Perazzoli <ettore@ximian.com> - - [Patch for Automake 1.5 compatibility pointed out by Richard - Boulton <richard@tartarus.org>, as per #9258.] - - * Makefile.am (CLEANFILES): Assign directly, not with `+='. - -2001-09-25 Jeffrey Stedfast <fejj@ximian.com> - - * mail-folder-cache.c (update_1folder): The folder-info needs to - take priority over the folder because of the way IMAP works (which - is that it doesn't actually update the folders until you SELECT - them and so when you do get_folder_info(), it doesn't actually - SELECT the folders, it just STATUS's them). - -2001-09-25 <NotZed@Ximian.com> - - * folder-browser.c (folder_browser_destroy): Deal with destroy vs - finalise semantics. Only destroy widgets here. - (folder_browser_finalise): object finalise function, actually - unref/free all other objects here. - (folder_browser_class_init): Init the finalise hook. - (got_folder): Check if message_list == NULL -> we've been - destroyed before the thread got a chance to finish loading the - folder. - (folder_browser_is_drafts): Dont use a g_return_if_fail to return - in what could be a valid state of the object. - (folder_browser_is_sent): Likewise. - (folder_browser_copy): Do nothing if message_list == NULL. - - * main.c (main): call mail_msg_cleanup() before leaving threads. - - * component-factory.c (owner_unset_cb): Wait for all outstanding - operations to finish before setting up to quit. - (idle_quit): Wait for all outstanding ops to finish before - cleanup. - (unref_standard_folders): NULL out the standard folder before - unreffing it. - - * mail-mt.c (mail_msg_wait_all): New function to wait for all - outstanding thread operations. - (mail_msg_cleanup): Destroy the io channels before we're - finished. Also wait for all outstanding threads first. Made - public. - (mail_msg_init): Dont call mail_msg_cleanup atexit automatically. - - -2001-09-25 Jeffrey Stedfast <fejj@ximian.com> - - * mail-format.c (get_data_wrapper_text): If the data wrapper - contains raw text, treat the contents as if they were in the - user's default charset and convert them to UTF-8. - - * component-factory.c (owner_set_cb): Throw up a warning dialog if - we suspect the config database is corrupt. - - * mail-config.c (config_read): If the account name is NULL, then - we have a corrupt config database most likely - so generate a fake - account name and set the corrupt but to TRUE. - (mail_config_is_corrupt): New function to find out if the config - is suspected of being corrupted. - -2001-09-25 Iain Holmes <iain@ximian.com> - - * mail-config.c (impl_GNOME_Evolution_MailConfig_addAccount): - Check if the transport is NULL. - -2001-09-25 Iain Holmes <iain@ximian.com> - - * mail-display.c (link_menu): Remove the Save Link as (FIXME) - item. - -2001-09-25 Jeffrey Stedfast <fejj@ximian.com> - - * mail-mt.c (pass_got): Only cache the password for the service if - it has an entry in the account database. Fixes bug #10875. - -2001-09-24 Christopher James Lahey <clahey@ximian.com> - - * message-list.c (filter_date): Use e_strftime_fix_am_pm instead - of strftime. - -2001-09-24 <NotZed@Ximian.com> - - * mail-local.c (mls_get_folder): Removed unused variables. - - * component-factory.c (storage_create_folder): Remove unused - variable. - - * mail-format.c (write_default_header): Used to write a header - that we know about/normally print. Use a static header table to - index these. - (write_header): removed. - (default_header_index): Return the index of the default header. - (write_headers): Changed the way it writes headers a bit. Use - write_default_header or write_text_header directly. Also try and - use the header charset as a fallback if the header can't be - decoded using the locale charset. - -2001-09-23 Jeffrey Stedfast <fejj@ximian.com> - - * mail-mt.c (pass_got): Always cache POP and IMAP passwords, even - if the user didn't tell us to. Fixes bug #10569. - -2001-09-21 <NotZed@Ximian.com> - - * mail-mt.c (mail_msg_check_error): If we have an operation that - failed before, dont show the dialogue for the the new error. Also - use gtk_widget_show rather than invoking another main loop. Fix - for lazy people who like to leave their mailers running and go - home. - -2001-09-21 Jeffrey Stedfast <fejj@ximian.com> - - * mail-ops.c (mail_send_message): Use the mail-tools convenience - functions to remove and restore the X-Evolution headers. - (mail_update_subfolders): Removed. - -2001-09-21 <NotZed@Ximian.com> - - * mail-callbacks.c (mail_storage_create_folder, folder_created, - create_folders): All made redundant by new mail-folder-cache - code. - (delete_folders, folder_deleted): Uh, code that isn't used - anywhere. Removed. - - * component-factory.c (storage_create_folder): Dont call - folder_created, let the folder_created event handle the update. - - * mail-local.c (mail_local_store_add_folder): Use url path as - full_name, not shell path. - (mail_local_folder_construct): Remove path argument, and use the - full_name instead. - (mls_get_folder): Dont lookup folderinfo in cache. Like duh the - shell hasn't told me its there yet, smaaaart. - - * mail-folder-cache.c (mail_note_store): Take a new argument - 'done' that can callback when complete. Fixed callers - appropriately. - - * mail-ops.c (mail_update_subfolders): Removed. Isn't used - anymore. - (mail_scan_subfolders): Remove, no longer used. - - * mail-send-recv.c (receive_update_got_store): Remove call to - mail_update_subfolders. - -2001-09-20 <NotZed@Ximian.com> - - * mail-vfolder.c (check_source): Dont let drafts/outbox/sent be - added via a generic 'all local folders' rule. - - * component-factory.c (got_folder): trigger a folder changed - event, so the folderinfocache stuff has a chance to see if this is - the outbox_folder or not. - - * mail-folder-cache.c (update_1folder): If we have -1 unread - count, pass that as 0 to the shell so it doesn't go bolding. - (setup_folder): Same. - -2001-09-20 Jeffrey Stedfast <fejj@ximian.com> - - * mail-account-gui.c (mail_account_gui_save): Only add the account - if it doesn't already exist in the config db. - - * mail-config.c (mail_config_find_account): New convenience - function. - - * mail-config-druid.c (wizard_finish_cb): Do not add the account - here as this is taken care of in mail_account_gui_save() since it - has to be able to set the default account. - - * mail-config.c (mail_config_set_default_account): Don't allow the - index to become invalid. - - * mail-account-gui.c (mail_account_gui_save): Add the account - before setting it as the default. - -2001-09-20 <NotZed@Ximian.com> - - * folder-browser.c (folder_browser_set_shell_view): Update the - status bar here, assuming we've just been activated. - - * mail-ops.c (add_vtrash_info): Scan whole list, rather than - missing the last one. Also dont assume its always the last, - otherwise we could lose following folders. - -2001-09-20 Jeffrey Stedfast <fejj@ximian.com> - - * mail-tools.c (mail_tool_uri_to_folder): Don't "note" the folder - if we failed to get it. - -2001-09-20 Iain Holmes <iain@ximian.com> - - * mail-account-gui.c (mail_account_gui_new): Set the sensitivity - of the edit buttons correctly. - -2001-09-20 <NotZed@Ximian.com> - - * mail-vfolder.c (vfolder_register_source): Lock around - hashtable/list manipulation. Also dont try scan vfolder_hash if - it hasn't been setup yet. - (source_finalise): Lock around list access. - (rule_changed): Lock around hash access. - (context_rule_added): Lock around hash access. - (context_rule_removed): " - (rule_changed): Lock around list access. - (all): d(x) out debug printfs - - * mail-local.c (storage_listener_startup): Fix for api change. - (local_storage_new_folder_cb): Dont skip over leading / in path. - (local_storage_removed_folder_cb): ditto. - - * mail-folder-cache.c (create_folders): No longer pass prefix - between recursive calls - we have the path in the folderinfo. - (setup_folder): No longer take path arg, we get it from - folderinfo. - (mail_note_folder): No longer take path arg, we use - folder->full_name to key the folder table. - (mail_note_store): Consolidate note_store interface, pass storage - or corba_storage to it. - (mail_note_local_store): Removed. - (update_1folder): If its a vtrash folder, or the outbox_folder, - and we have a folder, then make the 'count' the total message - count, not unread messages count. - -2001-09-20 Jeffrey Stedfast <fejj@ximian.com> - - * mail-local.c (mail_local_store_add_folder): Set the folder info - path. - -2001-09-20 <NotZed@Ximian.com> - - * mail-tools.c (mail_tool_uri_to_folder): Register vfolder sources - here. - - * folder-browser.c (got_folder): Dont register vfolder sources - here. - - * mail-ops.c (mail_get_folder): Add thread parameter. Fix callers. - (add_unmatched_info): Scan for unmatched name and re-title. - - * mail-vfolder.c (vfolder_setup): Use the 'slow' queue for setting - up vfolders. - - * mail-mt.c (mail_msg_init): Limit the maximum number of threads - on the 'new' thread to 10. - (mail_msg_init): Create a new queue 'slow' for doing slow - operations. - -2001-09-20 Iain Holmes <iain@ximian.com> - - * mail-display.c (mail_error_write): Add a <blockquote> to make - the error message look better. - -2001-09-20 <NotZed@Ximian.com> - - * mail-tools.c (mail_tool_uri_to_folder): Dont special case file: - url's anymore. - - * mail-local.c: Add real_path to MailLocalFolder. - (mail_local_folder_construct): Added path argument, setup - full_name == path, and real_path == full_name. - (mls_get_folder): First lookup folderinfo to confirm this folder - exists, then use that to properly construct the folder paths. - (mail_local_folder_reconfigure): Use real_path not full_name to - create the store uri. - (mlf_set_folder): Use real_path not folder_name to get real uri - path. - -2001-09-19 <NotZed@Ximian.com> - - * mail-folder-cache.c (setup_store): Use the wrong spelling of - finalised for the event hook. - (real_note_folder): Use the wrong spelling of finalised for the - event hook. - (free_folder_info): Free the full_name parameter. - (setup_folder): - (real_note_folder): Key the folderinfo table on full_name, not - path. - -2001-09-20 Jeffrey Stedfast <fejj@ximian.com> - - * mail-ops.c (save_messages_save): Convert all textual parts to - 8bit before saving. Fixes bug #10388. - - * mail-callbacks.c (ask_confirm_for_unwanted_html_mail): Oops, - don't free memory that we don't own. - -2001-09-20 Dan Winship <danw@ximian.com> - - * mail-config.c (evolution_mail_config_factory_init): No need to - have g_warnings here. If it's done properly, therapeutically, - there's no danger involved. - -2001-09-19 Jon Trowbridge <trow@ximian.com> - - * mail-callbacks.c (mail_generate_reply): Truncate extremely long - subjects. (inspired by bug #9158) - - * mail-tools.c (mail_tool_generate_forward_subject): Truncate - extremely long subjects. (bug #9158) - -2001-09-19 Jeffrey Stedfast <fejj@ximian.com> - - * mail-send-recv.c (receive_update_got_store): Here too. - - * component-factory.c (create_view): Call mail_note_store() - instead of mail_scan_subfolders() here so that these folders get - hooked up with the unread count code. - -2001-09-12 Iain Holmes <iain@ximian.com> - - * importers/evolution-mbox-importer.c (load_file_fn): Fix memory - leak. - -2001-09-19 Jeffrey Stedfast <fejj@ximian.com> - - * mail-callbacks.c (ask_confirm_for_unwanted_html_mail): Convert - the names to the locale charset. - -2001-09-19 Dan Winship <danw@ximian.com> - - * mail-callbacks.c (create_folders): Pass the actual unread - message count, not just whether or not it's > 0. Fixes ximian - 9089. - -2001-09-19 <NotZed@Ximian.com> - - * component-factory.c: Added missing header. - - * mail-local.c (mail_local_store_add_folder): Async load the - folder we just added, so it can update the folder counts in the - display. We just discard the folder afterwards? - - * mail-ops.c (mail_get_folder): Use the queued thread to get - folders. - - * General cleanup of mail debug printfs. - - * mail-folder-cache.[ch]: Completely rewritten. Removed all calls - to the old code everywhere they were used. Nuff said. - - * folder-browser.h: Add shell_view to folder_browser & api to set - it. - - * folder-browser-factory.c (control_activate): Set the shell-view - on the folder_browser. - (control_deactivate): And clear it here. - - * folder-browser.c (folder_browser_destroy): Unhook from changed - events on the folder before giving it away. - (got_folder): Hook onto the folder-changed events. - (folder_changed): Event hook proxy for folder_changed events - (main_folder_changed): And the main code version. - (update_status_bar): And the one that actually does the work. - (on_selection_changed): Also call update_status_bar() to update - the selection count. - (folder_browser_set_shell_view): Implement function to set the - shell_view on the folder_browser. - (folder_browser_destroy): Release the shell_view here too. - - * mail-tools.c (mail_tool_uri_to_folder): Dont 'note' the new - folder if its from a file: url, this is handled by hte local store - (yeeruughck). - - * mail-local.c (mls_init): - (free_info): - (mls_finalise): Setup init/finalise funcs for the folderinfo hash. - (local_storage_removed_folder_cb): re-enable. - -2001-09-18 <NotZed@Ximian.com> - - * mail-local.c (MailLocalStore): Add a hash table to store - uri<>folderinfo data. - (mail_local_store_add_folder): Add a new folderinfo to our hash. - (mail_local_store_remove_folder): Remove a folder by uri. - (storage_listener_startup): Add this store to those monitored by - the folder tree. - -2001-09-18 Jeffrey Stedfast <fejj@ximian.com> - - * mail-mt.c (do_get_pass): Make the title translatable, and also - use the account name when possible. Sorta fixes bug #6277. - -2001-09-17 <NotZed@Ximian.com> - - * mail-send-recv.c (get_receive_type): Function to get the real - receive tpe for ag iven url. IMAP/SPOOL/MAILDIR types just update - their info, dont download. - (build_dialogue): - (mail_receive_uri): Use function above to get the right receive - type. - -2001-09-18 Jeffrey Stedfast <fejj@ximian.com> - - * mail-tools.c (mail_tool_remove_xevolution_headers): Oops, forgot - about X-Evolution-Format. - (mail_tool_restore_xevolution_headers): Same. - -2001-09-18 Dan Winship <danw@ximian.com> - - * folder-browser.c (folder_browser_set_uri): Merged into - folder_browser_new: nothing ever changes the URI of an existing - folder browser any more. - (folder_browser_new): Make this take a uri argument and do the - work folder_browser_set_uri used to do, except that we set fb->uri - right away, so that if the folder browser's control is activated - before got_folder() gets called, then folder_browser_ui_add_list() - will have access to the correct uri for purposes of setting - ViewThreaded, etc. Fixes #4913. - (got_folder): Don't set fb->uri here since it will already have - been set. Don't call message_list_set_threaded, since it should be - a noop now (and if it's not, it would make the message list not - match the menu item). - - * folder-browser-ui.c (folder_browser_ui_add_list): Remove some - code that was failing to work around the problems above. - - * message-browser.c (message_browser_new): Pass uri to - folder_browser_new, remove call to set_uri. - - * folder-browser-factory.c (folder_browser_factory_new_control): - Likewise. Also fix a s/destroy/unref/ in an error cleanup. - -2001-09-18 Jeffrey Stedfast <fejj@ximian.com> - - * mail-session.c (get_password): Pass a 'cache-me' argument to - mail_get_password. - - * mail-mt.c (pass_got): Make less confusing... - (mail_get_password): Now takes an argument 'cache' that allows our - caller to determine if the user wanted to cache his/her password - or not. - (pass_got): Set the cache option. - -2001-09-18 Dan Winship <danw@ximian.com> - - * mail-format.c (mail_format_raw_message): Call - mail_content_loaded here rather than blocking if the message data - isn't available. - -2001-09-17 <NotZed@Ximian.com> - - * mail-ops.c (mail_get_folderinfo): Get folderinfo 1 at a time - rather than all at once. - -2001-09-17 Jeffrey Stedfast <fejj@ximian.com> - - * component-factory.c (storage_remove_folder): Unsubscribe from - the folder before deleting it. Also, use the url's path instead of - the shell's path since IMAP doesn't necessarily have to use "/" as - the dir sep. - - * mail-ops.c (remove_folder_get): If the store supports - subscriptions, make sure to unsubscribe from the folder before - deleting it. - -2001-09-17 <NotZed@Ximian.com> - - * mail-local.c (storage_listener_startup): Setup global - corba_storage variable. - (mls_get_folder): Set 'update lstorage' on the newly opened - folder. - -2001-09-17 Jeffrey Stedfast <fejj@ximian.com> - - * mail-display.c (invisible_selection_get_callback): Do nothing if - the selection is NULL? Maybe this is the cause of bug #6817. - - * mail-config.c (mail_config_folder_to_cachename): Go back to - generating the cachename ourselves, but continue doing it the way - the dfault implementation of camel_folder_get_uri worked. - -2001-09-16 Christopher James Lahey <clahey@ximian.com> - - * message-list.c (ml_get_node_by_id): Made save_id const here. - -2001-09-16 Jeffrey Stedfast <fejj@ximian.com> - - * mail-display.c (pixbuf_gen_idle): Don;t destroy the pixbuf - loader, unref it instead. - - * mail-config.c (mail_config_folder_to_cachename): Use - camel_folder_get_uri(). - -2001-09-15 <NotZed@Ximian.com> - - * mail-vfolder.c: Major rewrite of most of the guts, handle - changes based on signals and events, etc. Use the main storage - handling code that imap uses, etc. - - * mail-tools.c (mail_tool_uri_to_folder): Dont special case - vfolder: anymore. - - * component-factory.c (owner_set_cb): use vfolder_load_storage(), - new function to setup vfolder storage, after interaction has been - enabled only. This might need some tweaking ... - (storage_remove_folder): Removed all the folder lookup stuff. - Just delete the folder based on the path passed in. There should - be no reason this wouldn't work, right? - -2001-09-14 <NotZed@Ximian.com> - - * mail-ops.c (get_folderinfo_get): Only add vtrash folder info, if - store supports vtrash. - - * component-factory.c (mail_load_storage_by_uri): Let 'vfolder' - stores show up too. - -2001-09-13 <NotZed@Ximian.com> - - * mail-vfolder.c (vfolder_uri_to_folder): Open a vfolder then set - its expression, since name?query open method is removed. - -2001-09-14 Jeffrey Stedfast <fejj@ximian.com> - - * subscribe-dialog.c (fe_root_value_at): Return the cached value - of camel_service_get_name so that we don't leak memory. - (fe_real_value_at): Don't strdup the node's name. - (folder_etree_construct): Set the service_name. - (fe_destroy): Free the service_name. - - * mail-ops.c (add_vtrash_info): Free the temporary path variable - here. - - * subscribe-dialog.c (store_data_new): Added a refcount variable - so set the refcount to 1. - (sd_got_store): Unref the store-data. - (store_data_async_get_store): Ref the store-data. - (store_data_ref): New function. - (store_data_unref): New function. - (subscribe_dialog_destroy): Instead of freeing the store-data - here, unref it instead. We may just have an async function - running. Set the callback function to NULL so that when the - (remaining) async functions finish, they become no-ops. - - * mail-send-recv.c (build_dialogue): Revert my bar_destroy code - and replace it with dialog_destroy instead. - - * mail-ops.c (mail_send_message): Append a message to any - exception we get appending to any folders after having sent the - message successfully saying that the message was sent successfully - so the user doesn't misinterpret the error. - -2001-09-13 Jon Trowbridge <trow@ximian.com> - - * mail-callbacks.c (composer_get_message): Fixed double-freeing of - EDestination vector when sending html mail to people who don't - necessarily want it. Fixes bug #9848. - -2001-09-13 Jeffrey Stedfast <fejj@ximian.com> - - * subscribe-dialog.c (get_short_folderinfo_desc): - (get_short_folderinfo_get): - (get_short_folderinfo_got): - (get_short_folderinfo_free): - (subscribe_get_short_folderinfo): Modified to take a FolderETree - instead of a CamelStore (since the CamelStore is inside the - FolderETree anyway) so that we could ref the ETree to prevent a - race condition. Should fix bug #9827. - - * mail-format.c (try_inline_pgp_sig): Make sure that the - charset_filter is non-NULL before using it since iconv may fail. - -2001-09-13 Larry Ewing <lewing@ximian.com> - - * mail-tools.c (mail_tool_quote_message): free the credits string. - -2001-09-12 <NotZed@Ximian.com> - - * mail-vfolder.c (vfolder_remove_cb): Fixed the remove callback - prototype, and return the result properly using the listener. - (vfolder_uri_to_folder): Always use the same store uri, so we dont - create a new store for each folder. - -2001-09-12 Jeffrey Stedfast <fejj@ximian.com> - - * mail-config.c (mail_config_write_on_exit): Save transport - passwords too. This fixes bug #3020. - -2001-09-11 Dan Winship <danw@ximian.com> - - * mail-folder-cache.c (mail_folder_cache_note_folderinfo): Don't - set the folderinfo's unread count to 0 when camel reports -1, - since that may overwrite a valid unread count from before. - (get_folder_info): Do it here instead when first creating a new - folderinfo structure. - Should fix bug #1756. - -2001-09-11 Larry Ewing <lewing@ximian.com> - - * mail-account-gui.c (menu_file_save_cb): call menu_file_save_error - when there is an exception while saving. - (menu_file_save_error): pop up a dialog telling the user the file - has not been saved. - -2001-09-10 <NotZed@Ximian.com> - - * mail-local.c (mail_local_reconfigure_folder): Dynamically create - the folder type list from camel. - (reconfigure_clicked): And change code to handle changes. - -2001-09-10 <NotZed@Ximian.com> - - * merged mail_local patch from peterw. Many changes. - -2001-09-10 Iain Holmes <iain@ximian.com> - - * mail-config.c (impl_GNOME_Evolution_MailConfig_addAccount): Add a - none account if the url is empty. - -2001-09-10 Jeffrey Stedfast <fejj@ximian.com> - - * mail-callbacks.c (mail_generate_reply): Don't use - new_with_sig_file, that function no longer exists. - (forward_get_composer): Same here. - -2001-09-10 Zbigniew Chyla <cyba@gnome.pl> - - * mail-config.c - (add_shortcut_entry): Marked string for translation. - (new_source_created): Ditto. - - * mail-send-recv.c - (format_url): Marked strings for translation. - (build_dialogue): Ditto. - -2001-09-10 Jeffrey Stedfast <fejj@ximian.com> - - * mail-account-gui.c (mail_account_gui_new): Hide the S/MIME frame - if we don't support S/MIME. - - * mail-send-recv.c (build_dialogue): Attach to the destroy event - for each progressbar using bar_destroyed as the callback. - (bar_destroyed): New callback to unregister the timeout and set - the send-info's bar member to NULL so we don't try to update a - destroyed progressbar. - - * mail-callbacks.c (mail_generate_reply): Pass along the right - string, this fixes bug #9518. - - * mail-account-gui.c (save_service): Don't save the authmech if - the username doesn't exist. Fixes bug #9474. - - * mail-callbacks.c (do_edit_messages): Remove some mailer-set - headers. Fixes bug #9462. - -2001-09-10 Dan Winship <danw@ximian.com> - - * mail-callbacks.c (composer_get_message): Fix obvious dumb - mistake in previous commit that made it *always* complain you had - invalid recipients. - -2001-09-09 Jon Trowbridge <trow@ximian.com> - - * mail-callbacks.c (composer_get_message): Complain if we are - trying to send to invalid recipients. (Bug #8875) - -2001-09-09 Jeffrey Stedfast <fejj@ximian.com> - - * mail-config-druid.c (evolution_mail_config_wizard_factory_fn): - We need to initialize all of the struct fields or else god knows - what will happen later when we try to use 'em. Also set a destroy - function for the MailConfigWizard so we don't leak it. - -2001-09-08 Jon Trowbridge <trow@ximian.com> - - * mail-callbacks.c (ask_confirm_for_unwanted_html_mail): Added. - Shows a (hopefully) informative dialog warning you that some - recipients might not want HTML mail (who are listed), and gives - the option to cancel sending. (FIXME: The wording of this dialog - could use some work.) - (composer_get_message): Check if we are sending HTML to someone - who might not want it, and raise the dialog if we are. Use our - new destination-vector based api when talking to the composer. - Touch our destinations here, boosting their use scores. This is - the right place for this to happen --- closer to the end of the - sending process, where incorrect/artificial use score inflation is - less likely to occur. - - * mail-config.c (config_read): Added - /Mail/Format/confirm_unwanted_html key. This flag determines - whether or not we want to see the warning dialog when we send HTML - mail to contacts who don't want it. Default is TRUE. - (mail_config_write_on_exit): Write out the confirm_unwanted_html - key. - (mail_config_get_confirm_unwanted_html): Added. - (mail_config_set_confirm_unwanted_html): Added. - -2001-09-08 Dan Winship <danw@ximian.com> - - * mail-display.c (mail_display_destroy): Unref the invisible, - don't just destroy it. - -2001-09-07 Jeffrey Stedfast <fejj@ximian.com> - - * mail-format.c (mail_write_authenticity): Give the full path of - the wax-seal icons. - (try_inline_pgp_sig): Convert the charset from UTF-8 to whatever - charset it should be. Now takes a CamelMimePart argument as well. - (try_uudecoding): Now takes a part argument as well. - (try_inline_pgp): Here too. - (try_binhex): And finally here. - (handle_text_plain): Pass along the mime part to the try_* - functions. - -2001-09-06 Chris Toshok <toshok@ximian.com> - - * component-factory.c (notify_listener): new function, to notify - the bonobo listener in remove_folder/create_folder. - (storage_create_folder): match EvolutionStorage create_folder - signal's signature. - (storage_remove_folder): match EvolutionStorage remove_folder - signal's signature. - -2001-09-06 Dan Winship <danw@ximian.com> - - Fix a bunch of replying/forwarding-related formatting bugs. - - 2749 - Message text not included in reply, but html attachment is - 4294 - "forward inline" should quote the same headers as the - normal mail display - 6100 - Reply to a forwarded email displays email headers - 7255 - Replying to HTML message - 7527 - replying to forwarded message w/ attachments does the wrong - thing - - * mail-format.c (mail_get_message_rfc822): New function to get - message headers and body together, for inline forwards, or replies - containing attached messages. - (mail_get_message_body): Redo this to always return HTML, but keep - the "want_plain" flag, to decide whether to return HTML that looks - like HTML or HTML that looks like plain text. Use - mail_get_message_rfc822 to handle attached message/rfc822 parts. - Don't include the text of vcard or icalendar attachments. Don't - fail to include text parts just because we found an HTML part. - (Since we're always returning HTML now, this doesn't cause - problems any more.) - - * mail-tools.c (mail_tool_quote_message): Simplify greatly. - mail_get_message_body always returns HTML now, and we let it take - care of prepending "> "s too. We then let GtkHTML deal with - converting the HTML to plain text if the user wants to reply in - plain text. - (mail_tool_forward_message): Simplify this a ton too: parts of it - are moved into mail_get_message_rfc822 and parts are now - unnecessary. - - * mail-callbacks.c (do_forward_non_attached): Call - mail_tool_forward_message here always, and let it do the "> " - quoting in the "quoted" case, so that we get the headers too when - forwarding quoted. Related to bug #4294. - -2001-09-05 Dan Winship <danw@ximian.com> - - * mail-display.c (launch_cb): the "command" of a - GnomeVFSMimeApplication can include arguments as well. Deal with - that. Fixes support for CodeWeavers' CrossOver Plugin. - -2001-09-05 Jeffrey Stedfast <fejj@ximian.com> - - * mail-config.c (mail_config_remove_account): Adjust the - default_account index correctly. - -2001-09-05 Jeffrey Stedfast <fejj@ximian.com> - - * mail-config.c (mail_config_get_accounts): Added a g_assert to - make sure that config wasn't NULL. This is meant to help debug bug - #4911 and friends. - - * component-factory.c (owner_set_cb): Do not mail_config_init() - here as we've already called this in main() in main.c. - -2001-09-05 Ettore Perazzoli <ettore@ximian.com> - - [Fix #958, ShellComponents should not be created by factories, for - the mailer case.] - - * GNOME_Evolution_Mail.oaf.in: Remove the - GNOME_Evolution_Mail_ShellComponentFactory. - - * component-factory.c: Changed to not use a factory. - (COMPONENT_FACTORY_ID): Removed. - (COMPONENT_ID): New. - (idle_quit): Don't unref the component_factory. - (create_component): Renamed from `component_fn'. Take no args. - (component_factory_init): Create the component with - `create_component' and register it on OAF. - -2001-09-06 Radek Doulik <rodo@ximian.com> - - * everywhere updated for new mail_content_loaded definition - (prototype) - -2001-09-05 Radek Doulik <rodo@ximian.com> - - * mail-display.c (mail_display_redisplay): increase - redisplay_counter - (try_part_urls): new helper function - (try_data_urls): ditto - (load_content_loaded): if it has stream handle available and if - it's still valid, it writes to this stream instead of - redisplaying, uses try_part_urls and try_data_urls - - * mail-display.h: added redisplay_counter to MailDisplay, I use - it in load_content_loaded to be sure that there wasn't any - redisplay and that remembered handle is still valid - - * mail-display.c (on_url_requested): don't end stream with error - if part is not loaded yet - (on_url_requested): don't end stream in cases when we are going to - load image using http - (stream_write_or_redisplay_when_loaded): new helper function, - which is extracted from mail_display_redisplay_when_loaded. it's - extended to handle gtkhtml stream writting - (mail_display_redisplay_when_loaded): use - stream_write_or_redisplay_when_loaded - (mail_display_stream_write_when_loaded): new function, uses - stream_write_or_redisplay_when_loaded - struct _load_content_msg: added handle, url and redisplay_counter - fields - - * mail-format.c (mail_content_loaded): added redisplay, url and - handle parameter for case when we are loading image content and - want it write to stream instead of redisplaying - -2001-09-05 Ettore Perazzoli <ettore@ximian.com> - - * message-browser.c (message_browser_new): s/Evolution/Ximian - Evolution/. - -2001-09-04 Ettore Perazzoli <ettore@ximian.com> - - [Fix #7542, "Crash Afer Closing".] - - * component-factory.c (owner_unset_cb): NULL the - global_shell_client as the first thing here. Otherwise we might - get into a slight race that causes the shell to crash. [Still, of - course the shell shouldn't crash, but I haven't been able to track - that down yet.] - -2001-09-04 Zbigniew Chyla <cyba@gnome.pl> - - Fixes #7251 - - * mail-ops.c (add_vtrash_info): Mark "Trash" with U_(), not _(). - -2001-09-04 Jeffrey Stedfast <fejj@ximian.com> - - * mail-ops.c (fetch_mail_fetch): Unref the source folder here - because it might be a POP folder. We do this because on store - finalize, we now try to disconnect cleanly which means that we may - block. - - * mail-send-recv.c (build_dialogue): Fix capitalization. Fixes bug - #7486. - -2001-09-04 Peter Williams <peterw@ximian.com> - - * mail-local.c (mlf_init): Remove accidentally left-in "choke on - this" preprocessor thingie. - (mail_local_folder_reconfigure): Instead of creating our own local - exception, just assert that ex != NULL. - (*): Staticize everything that can be and remove some obnoxious - prototypes. - -2001-08-31 Peter Williams <peterw@ximian.com> - - * mail-local.c (mail_local_reconfigure_folder): Use (NULL, NULL) - as the arguments to g_hash_table_new instead of g_direct_foo. - Instead of checking the URI, check MAIL_IS_LOCAL_FOLDER (fb->folder) - to check whether we can reconfigure the folder. Instead of - gnome_dialog_run_and_close, use gnome_dialog_run... - (reconfigure_clicked): And deal with removing the hash table - elements here. - (local_storage_new_folder_cb): Set the folder's name to the - displayName to i18nize correctly (after shell patch is applied). - -2001-08-30 Peter Williams <peterw@ximian.com> - - * mail-local.c: Rewrite as a more complete CamelStore. - - * component-factory.c (create_folder): We can now chuck out most - of this function and just call mail_get_folder. - (xfer_folder_done): If we succeeded in moving the messages, now - delete the source folder as we should be. - (xfer_folder): In order to do so, create a new xfer_folder_data - struct that records the value of 'remove_source' Fix a leak by - unreffing the source folder. - - * mail-ops.[ch]: We no longer need the mail_new_folder operation. - - * folder-browser.[ch]: Don't need the 'reconfigure' member - anymore, because the loaded folder's URL doesn't change. - (do_message_selected): Don't check it - (on_right_click): Same. - (folder_browser_set_uri): Same. - (got_folder): Same. - -2001-08-31 Zbigniew Chyla <cyba@gnome.pl> - - * mail-vfolder.c (vfolder_create_storage): Marked string for - translation (with U_). - -2001-08-28 Zbigniew Chyla <cyba@gnome.pl> - - * message-list.c (e_mail_address_compare): Use g_utf8_collate - instead of g_strcasecmp for comparing names. - (subject_compare): Replaced g_strcasecmp, isspace, var++ with - UTF-8 counterparts. - -2001-08-30 Iain Holmes <iain@ximian.com> - - * importer/evolution-mbox-importer.c (load_file_fn): Check if it's - a folder, if so, create a folder. - (process_item_fn): If it was a folder created, just finish up - importing - -2001-08-29 Iain Holmes <iain@ximian.com> - - * importers/evolution-mbox-importer.c: Turn off debugging, remove - spewage. - (process_item_fn): Notify the importer if the folder isn't opened - or created yet. - (load_file_fn): Allow the function to continue if the folder is - being created. - -2001-08-30 Peter Williams <peterw@ximian.com> - - Due to the introduction of mail_folder_cache_remove(), we can no - longer assume that mail_folder_info's always exist, so we need to - robustify a lot of this. - - * mail-folder-cache.c (folder_browser_destroyed): New - function. Called when the folder browser is destroyed -- analogous - to camel_folder_finalized. - (mail_folder_cache_note_fb): Hook it up here. - (struct _mail_folder_info): Add a member, mail_info_id, that - records the get_mail operation's id, so that we can cancel it if - we need to. - (get_folder_info): Initialize it here. - (get_mail_info_reply): Clear it here. - (mail_folder_cache_remove_folder): If necessary, cancel it here. - (mail_folder_cache_note_folder): Check it here before starting a - new operation, just in case. - (update_message_counts_main): Take a URI instead of a - mail_folder_info *, in case the MFI has gotten destroyed. - (update_message_counts): Take a quark of the URI instead of a - mail_folder_info *, for the same reason. We use a quark instead of - an allocated gchar * because figuring out when to free the string - gets tricky. Then go from quark -> URI string -> MFI. Return if - the folder is no longer valid, because this indicates that the MFI - was removed before this signal got called. Pass a string to - update_message_counts_main instead of an MFI. - (camel_folder_finalized): Don't bother unhooking the signals here. - Same change as above, but don't bother checking for a valid folder - because we're about to make it invalid anyway. - (message_list_built): Analogous to the above, except with the - FolderBrowser instead of the CamelFolder. - (selection_changed): As above. - (folder_browser_destroyed): As above. - (struct get_mail_info_msg): Instead of taking a mail_folder_info - *, take a URI, for reasons explained above. - (get_mail_info_receive): Go from URI -> MFI before doing anything. - (get_mail_info_reply): Same. - (get_mail_info_destroy): Free the URI. - (get_mail_info): Take a URI and return the message id so that it - can be cancelled if necessary. - (mail_folder_cache_remove_folder): Disconnect from signals and - events before removing. - (mail_folder_cache_note_folder): Use a GQuark instead of the - mail_folder_info * as the user_data. - (mail_folder_cache_note_fb): Same. - (mail_folder_cache_note_folderinfo): Little formatting change. - -2001-08-30 Jeffrey Stedfast <fejj@ximian.com> - - * message-browser.c (message_browser_message_loaded): Fixed a - memory leak. - (message_browser_new): Added a comment as to why , after - reparenting, we do not unref the mail_display. - (message_browser_destroy): Don't call gtk_widget_destroy() on the - message_list here. - -2001-08-30 Peter Williams <peterw@ximian.com> - - * mail-ops.c (remove_folder_get): Instead of removing the folder - from the folder cache here... - (remove_folder_got): ... do it here, in the main thread. - -2001-08-29 Jon Trowbridge <trow@ximian.com> - - * mail-callbacks.c (composer_get_message): When calling - e_msg_composer_get_message, pass in TRUE for the 'sending' arg. - (Part of the fix for bug #8332) - -2001-08-29 Peter Williams <peterw@ximian.com> - - * folder-browser-ui.c: Fix the pixmap for /commands/MessageUndelete. - - * component-factory.c (owner_set_cb): Toss in a call to - mail_config_init () cause it might contribute to solving - bug 4911, and it won't hurt. - -2001-08-28 Peter Williams <peterw@ximian.com> - - * component-factory.c (owner_unset_cb): Disable interaction once - the shell has quit. - (create_view): Instead of - folder_browser_factory_new_control ("", corba_shell) when looking - at a mailstorage folder, use create_noselect_control(). - -2001-08-27 Ettore Perazzoli <ettore@ximian.com> - - * mail-local.c: Match the studlyCapsification of - shell/Evolution*.idl. - - * mail-config-druid.h: Change type of `event_source' from - `Bonobo_EventSource *' to `Bonobo_EventSource'. - - * mail-accounts.c (mail_delete): Remove unused local variable - `label'. - - * folder-info.c (do_get_info): `#if 0' unused variables. - -2001-08-27 Jon Trowbridge <trow@ximian.com> - - * mail-callbacks.c (mail_generate_reply): Check if we are trying - to reply to a message with no From: field, and try to do something - graceful in that case. (Bug #7028) - - * mail-display.c (ebook_callback): Add paranoid checks for the - case of a message with a From: field. (Also maybe bug #7028) - -2001-08-27 Iain Holmes <iain@ximian.com> - - * mail-config-druid.c (druid_finish): Free the list and hash table. - (druid_cancel): Free the list and hash table. - -2001-08-27 Jeffrey Stedfast <fejj@ximian.com> - - * mail-account-gui.c (mail_account_gui_new): Set the source and - transport description labels. - (transport_type_changed): Set the transport description label. - (source_type_changed): Set the source description label. - - * mail-tools.c (mail_tool_make_message_attachment): Remove - X-Evolution* headers. - (mail_tool_remove_xevolution_headers): New function to convenience - removing the X-Evolution headers. - (mail_tool_restore_xevolution_headers): New convenience function - to restore the X-Evolution headers. - (mail_tool_destroy_xevolution): New function to cleanup the - structure. - (mail_tool_forward_message): Remove and restore the X-Evolution - headers here too. - -2001-08-26 Jeffrey Stedfast <fejj@ximian.com> - - * mail-send-recv.c (receive_update_got_store): If the store is not - connected, scan it's subfolders first. - - * mail-ops.c (report_status): Call va_end() so LinuxPPC doesn't - have a caniption. - -2001-08-24 Jeffrey Stedfast <fejj@ximian.com> - - * mail-display.c (launch_cb): Use the new e_mkdtemp function. - - * folder-browser.c (message_list_drag_data_get): Use the new - e_mkdtemp function. - -2001-08-24 Ettore Perazzoli <ettore@ximian.com> - - [Fix #8024, Empty strings marked for translation.] - - * component-factory.c: Don't mark empty strings for translation. - Rather, give descriptions and display names to types "mailstorage" - and "vtrash". - -2001-08-24 Peter Williams <peterw@ximian.com> - - * mail-ops.c (remove_folder_get): Save the folder's full_name, - unref it, and *then* unref the store, so that the folder has been - closed before it gets deleted. - -2001-08-24 Peter Williams <peterw@ximian.com> - - * mail-config.c (add_shortcut_entry): Instead of using the length - of the shortcuts list as the index for the shortcut, use -1, which - means "last". - - * mail-config-druid.c (druid_finish): Remove the account adding - stuff since that happens in wizard_finish now. - - * mail-config.c (add_new_storage): New function. Add a - MailConfigAccount to the shell as a storage. - (maybe_add_shortcut): Renamed to new_source_created. - (new_source_created): Call add_new_storage here. - - * component-factory.c (mail_remove_storage_by_uri): Don't warn if - the storage isn't remote... no point in making the caller do extra - work. - -2001-08-24 Jeffrey Stedfast <fejj@ximian.com> - - * mail-config.c (mail_config_set_thread_list): Don't let the uri - be an empty string (how the fuck is this even happening in the - first place??). - (mail_config_get_thread_list): Same. - (mail_config_set_show_preview): And here. - (mail_config_get_show_preview): And finally here. - -2001-08-23 Larry Ewing <lewing@ximian.com> - - * mail-search.c (mail_search_construct): attach to the destroy - handler to reset the tokenizer. - (dialog_destroy_cb): reset the tokenizer here so that destroying - the dialog with the window manager still clears the hilighted - items. - -2001-08-23 Peter Williams <peterw@ximian.com> - - * mail-account-gui.c (mail_account_gui_save): Eek, let the user create - new accounts if old_account == NULL. - -2001-08-23 Jeffrey Stedfast <fejj@ximian.com> - - * component-factory.c (destination_folder_handle_drop): Check to - make sure we actually have drag data. - - * folder-browser.c (message_list_drag_data_received): Check to - make sure we have valid data. - -2001-08-21 Christopher James Lahey <clahey@ximian.com> - - * Revert fix for Ximian bug #6995. - -2001-08-23 Peter Williams <peterw@ximian.com> - - * mail-folder-cache.c (maybe_update): Record the timeout_id so we - can cancel it if the mail_folder_info is later freed. Also obviates - the use of the _UPDATE_QUEUED flag. - (mail_folder_cache_remove_folder): Cancel the timeout if we need to. - Lock around the hash table operations. Free mfi itself. Add debugging - spew. - (get_folder_info): Initialiae the timeout_id to 0. - -2001-08-22 Jon Trowbridge <trow@ximian.com> - - * mail-callbacks.c (ask_confirm_for_only_bcc): Provide alternative - text for this dialog for the case when a message has only Bcc - recipients because of a hidden contact list's addresses being - moved from To/Cc to Bcc. - (composer_get_message): Try to detect when our message has only - Bcc recipients because of moving addresses around due to a hidden - contact list, and show the dialog with the revised wording in this - case. - -2001-08-22 Jeffrey Stedfast <fejj@ximian.com> - - * component-factory.c (create_view): Don't blindly make all vtrash - folder types have a uri of vtrash:file:/, instead only make it use - vtrash:file:/ if it's a file: uri, else use physical_uri. - -2001-08-22 jacob berkman <jacob@ximian.com> - - * mail-display.c: rework how the e-card-popup thing has its life - managed. we now hide the window on the Hide event and destroy it - on the Destroy event emitted from its event source - -2001-08-22 Peter Williams <peterw@ximian.com> - - * mail-send-recv.c (set_send_status): We don't need to escape this - for printf'ing. - -2001-08-22 Peter Williams <peterw@ximian.com> - - Prevent the user from creating two accounts with the same name. - - * mail-config.c (impl_GNOME_Evolution_MailConfig_addAccount): - Abort if the account has the same name as another account. - - * mail-account-gui.c (mail_account_gui_save): Don't let the user - save if the account has the same name as another account. - - * mail-config-druid.c (management_check): Disable the next button - if the account name is the same as a preexisting account. - (construct): The only part of 'pages' that was being used was the - name. 'wizard_pages' now has the callbacks, while 'pages' is just - an array of char *'s. - (wizard_finish_cb): Save the account first because that's the - right way, and try to honor mail_account_gui_save's return value. - - * mail-config.glade: Add a label noting that you're not allowed to - create two accounts with the same name. - -2001-08-22 Peter Williams <peterw@ximian.com> - - * folder-browser-ui.c (fbui_sensitize_timeout): Check for NULL uic - here as well. - (fbui_sensitize_items): Up the timeout interval to 110 ms. - -2001-08-21 Peter Williams <peterw@ximian.com> - - * mail-account-editor.c (apply_changes): Honor the return value of - mail_account_gui_save. - - * mail-ops.c (sync_folder_desc): Say which folder is getting - saved. - -2001-08-21 Dan Winship <danw@ximian.com> - - * mail-identify.c (mail_identify_mime_part): Don't trust gnome-vfs - when it says "text/plain" if gnome_vfs_mime_type_from_name says - something different. Fixes a problem with recognizing icalendar - attachments labeled "application/octet-stream". Also, don't bother - asking gnome-vfs about winmail.dat attachments, since it will - often claim that they're MPEGs due to some mis-magic. - -2001-08-21 Jeffrey Stedfast <fejj@ximian.com> - - * mail-session.c (mail_session_forget_password): zero-ize the - password before freeing. - (forget_password): Same. - -2001-08-21 Peter Williams <peterw@ximian.com> - - * message-list.c (message_list_set_folder): Don't sink the extras - since _set_folder can get called more than once (on reconfigure.) - (message_list_destroy): So just unref the extras here. - - * mail-send-recv.c (build_dialogue): Treat the spool provider like - IMAP: update instead of performing an explicit receive. - -2001-08-21 Peter Williams <peterw@ximian.com> - - * folder-browser-ui.c (fbui_sensitize_items): Rename to - fbui_real_sensitize_items. Now we queue a change and set up a - timeout, making sure weed out redundant changes, fixing flicker. - (fbui_sensitize_timeout): New function. The timeout. - (fbui_real_sensitize_items): Semi-new function. Rename of old - fbui_sensitize_items. - (folder_browser_ui_set_selection_state): Pass the FB instead of - only the UIC to sensitize_items. - (folder_browser_ui_message_loaded): Same. - - * folder-browser.c (folder_browser_destroy): Kill the new timeout - if it is registered. - - * folder-browser.h: Add some members to FolderBrowser for keeping - track of the queue of changes. - -2001-08-20 Iain Holmes <iain@ximian.com> - - * mail-config.druid: Fix the jumping around. - -2001-08-20 Peter Williams <peterw@ximian.com> - - * mail-ops.c (remove_folder_get): Fix double-unref of the store. - -2001-08-20 Jeffrey Stedfast <fejj@ximian.com> - - * component-factory.c (create_folder): Modify the url and set the - protocol to mbox rather than hacking it and prepending mbox: to - the uri. - - * mail-local.c (get_folder): Don't prepend the folder_name with - the store's path because the hash key is folder_name, not - /folder_name. - -2001-08-20 Iain Holmes <iain@ximian.com> - - * mail-config-druid.c: Change some of the text labels. - (create_label): Make a label instead of a GtkHTML widget. - -2001-08-18 Iain Holmes <iain@ximian.com> - - * mail-account-gui.c (mail_account_gui_setup): Stop hiding the source - and transport frames. - -2001-08-20 Ettore Perazzoli <ettore@ximian.com> - - * folder-browser-ui.c (folder_browser_setup_property_menu): - Updated as ChangeFolderProperties is now in the - ComponentPlaceholder. - -2001-08-20 Peter Williams <peterw@ximian.com> - - * mail-accounts.c (mail_able): Whoops, make sure that the account - has a source before removing it or what-have-you. - - * subscribe-dialog.c: Add a few comments. - -2001-08-20 Damon Chaplin <damon@ximian.com> - - * folder-browser-ui.c: use new small trash icon for Delete command. - -2001-08-20 Ettore Perazzoli <ettore@ximian.com> - - * mail-ops.c (sync_folder_desc): s/Synchronising/Synchronizing/. - -2001-08-20 Jeffrey Stedfast <fejj@ximian.com> - - * component-factory.c (storage_create_folder): - camel_folder_create_folder can now return a heirachial tree so - subscribe to down the tree. - -2001-08-20 Damon Chaplin <damon@ximian.com> - - * folder-browser-ui.c: use new Cut/Copy/Paste icons. - -2001-08-19 Ettore Perazzoli <ettore@ximian.com> - - * component-factory.c: Update the folder list to include a display - name and a description. - -2001-08-19 Jeffrey Stedfast <fejj@ximian.com> - - * mail-mt.c (do_op_status): Allow the activity to be NULL if there - isn't a global_shell_client so that we don't try and report status - updates when the shell is destroyed. - - * mail-config.c (add_shortcut_entry): Return if there isn't a - global_shell_client. - - * component-factory.c (owner_set_cb): set the global_shell_client - here and connect to the destroy signal. - - * mail-vfolder.c (vfolder_create_storage): Use an extern - global_shell_client. - -2001-08-19 Christopher James Lahey <clahey@ximian.com> - - * mail-callbacks.c (delete_msg): Made delete make the cursor go - backwards if the user is sorting by descending date. Fixes Ximian - bug #6995. (Reverted.) - -2001-08-19 Jeffrey Stedfast <fejj@ximian.com> - - Note: The following changes were based on Zbigniew Chyla's fixes. - - * mail-callbacks.c (mail_generate_reply): Convert the date string - to UTF-8. - (do_forward_non_attached): Same here. - -2001-08-05 Zbigniew Chyla <cyba@gnome.pl> - - * folder-info.c: Added missing #include <config.h>. (applied by Damon) - -2001-08-18 Jeffrey Stedfast <fejj@ximian.com> - - * mail-config.c (config_read): Change the default values for - "always-sign" to false. - - * mail-callbacks.c (open_msg): if the folder is Outbox, let the - user edit the message(s) too I guess. - -2001-08-18 Ettore Perazzoli <ettore@ximian.com> - - * folder-browser-ui.c: Hook the new `delete-message.png' up. - -2001-08-17 Damon Chaplin <damon@ximian.com> - - * mail-display.c (pixmap_press): stop signal emission so the GtkButton - class method doesn't mess up the popup menu. Hopefully fixes bug #1828. - -2001-08-17 Zbigniew Chyla <cyba@gnome.pl> - - * mail-search.c (mail_search_construct): Put _() instead of N_() - around of the "Search" string, gnome_dialog_constructv doesn't - translate button names. - -2001-08-17 Jeffrey Stedfast <fejj@ximian.com> - - * mail-format.c (mail_write_authenticity): We want wax-seal.png - instead, since I added the png files to cvs and renamed it to - wax-seal.png. - -2001-08-17 Iain Holmes <iain@ximian.com> - - * importers/evolution-mbox-importer.c (load_file_fn): Fix - warnings. - -2001-08-17 JP Rosevear <jpr@ximian.com> - - * component-factory.c (owner_set_cb): don't init the config here - - * main.c (main): init the config here - -2001-08-17 JP Rosevear <jpr@ximian.com> - - * mail-config-druid.c: remove dead structure - -2001-08-17 Jeffrey Stedfast <fejj@ximian.com> - - * mail-config.c (mail_config_write): Save the always-sign options - for pgp and smime. - (config_read): Read in the always-save options for pgp and smime. - -2001-08-17 Christopher James Lahey <clahey@ximian.com> - - * message-list.etspec: Made the default values for column - expansions here more reasonable. - -2001-08-16 Iain Holmes <iain@ximian.com> - - * GNOME_Evolution_Mail.oaf.in: Add the Wizard stuff. - - * component-factory.c (component_fn): Init the Wizard factory. - (mail_load_storages): Check service isn't NULL before it's been - dereferenced. - - * mail-account-gui.c (mail_account_gui_setup): Only show the top level - widget is it's not NULL. - Change the gtk_widget_set_usizes to gtk_widget_hides. - - * mail-config-druid.c: Rewrite to use the EvolutionWizard stuff. - - * mail-config-druid.h: Add stuff to the MailConfigDruid struct. - - * mail-config.c (mail_config_get_default_account): Init the config if - it's not been inited. - -2001-08-16 Jason Leach <jleach@ximian.com> - - * mail-tools.c (mail_tool_quote_message): Only starting cutting - the signature out when we match "-- \n", so "--\n" in the middle - of a mail won't omit the rest for a quoted reply. Bug #7454. - -2001-08-16 Jeffrey Stedfast <fejj@ximian.com> - - * mail-callbacks.c (confirm_expunge): Respect the user's desire to - be prompted to confirm that he wants to expunge the blasted - folder. Also, don't set the usize - that's just an evil hack and - you may find it will cut off text once the label has been - translated. - (create_msg_composer): In order for the security options to be - checked when composing a new message, we must set the from account - explicitly even though the composer hdrs sets the default from - account and emits the signal because at that stage the composer - hasn't yet connected to the signals and thus the bonobo menu items - don't get set. - - * mail-config.c (mail_config_set_confirm_expunge): New. - (mail_config_get_confirm_expunge): New. - -2001-08-16 Peter Williams <peterw@ximian.com> - - * subscribe-dialog.c (fe_got_children): Sort the nodes here... - (fe_sort_folder): ... using this function. - - * folder-browser-ui.c (folder_browser_ui_message_loaded): Check - for uic == NULL. I'm not sure how this could happen, but... - -2001-08-16 Peter Williams <peterw@ximian.com> - - * folder-browser-ui.c (folder_browser_ui_set_selection_state): - Disable "Search Message" when more or less than exactly one - message is selected. - - * subscribe-dialog.c (fe_done_subscribing): Instead of hackfully - getting the path, use a CamelURL so that escaping is - handled. Silly me. -- See below -- - (fe_node_to_shell_path): Use node->name and node->full_name to - generate the the shell path of this item. Don't need to escape the - URL, and handle cases when dir_sep != '/' - (fe_done_subscribing): Use fe_node_to_shell_path instead of the - CamelURL. Third time's the charm... * folder-browser-ui.c - (folder_browser_ui_set_selection_state): Disable "Search Message" - when more or less than exactly one message is selected. - - * subscribe-dialog.c (fe_done_subscribing): Instead of hackfully - getting the path, use a CamelURL so that escaping is - handled. Silly me. -- See below -- - (fe_node_to_shell_path): Use node->name and node->full_name to - generate the the shell path of this item. Don't need to escape the - URL, and handle cases when dir_sep != '/' - (fe_done_subscribing): Use fe_node_to_shell_path instead of the - CamelURL. Third time's the charm... - -2001-08-15 Jeffrey Stedfast <fejj@ximian.com> - - * mail-display.c (save_part): Remember the filename is in utf8, so - use the e_utf8 functions to set the filename in the file selection - dialog. - -2001-08-15 Peter Williams <peterw@ximian.com> - - * message-list.c (on_cursor_activated_idle): Always remove the - idle and return FALSE, instead of returning TRUE if more than one - message is selected. - -2001-08-15 Jason Leach <jleach@ximian.com> - - * mail-tools.c (mail_tool_quote_message): Stop building the quote - after a sigdash, hence, omitting the signature from a - reply/forward. Bug #5529. - -2001-08-15 Anna Marie Dirks <anna@ximian.com> - - * mail-callbacks.c (expunge-folders): Re-added, at Ettore's - request, the confirm-expunge dialog. - -2001-08-15 Jason Leach <jleach@ximian.com> - - * message-list.c (message_list_init): Use ALWAYS for scroll frame - policy because ETable acts lame with AUTOMATIC. Bug #6925. - -2001-08-16 Not Zed <NotZed@Ximian.com> - - * mail-callbacks.c (expunge_folder): Don't confirm expunge. - -2001-08-15 Not Zed <NotZed@Ximian.com> - - * mail-local.c (register_folder_register): Remove operation - registration/etc. Handled by mail-mt.c - - * message-list.c (regen_list_regen): Remove camel operation - registration/etc. - -2001-08-14 Jeffrey Stedfast <fejj@ximian.com> - - * mail-accounts.c (load_accounts): Convert the UTF-8 account name - string into a gtk-string before using it in the GtkCList. - -2001-08-14 Peter Williams <peterw@ximian.com> - - * mail-callbacks.c (previous_unread_msg): Make previous unread - wrap around too. - - * mail-accounts.c (load_accounts): If the account is enabled, - set a checkmark pixmap instead of a strange plus sign. - (mail_accounts_dialog_init): Load the pixmap here. - (mail_accounts_dialog_finalise): Free it here. - - * mail-accounts.h: Prototype it here. - -2001-08-14 Dan Winship <danw@ximian.com> - - * folder-browser.c (message_list_drag_data_get): Fix the fix for - #6722. - - * mail-ops.c (save_messages_save): Likewise. - (save_part_save): Deal with the possibility that - camel_mime_filter_charset_new_convert will return NULL (bad - charset name). Fixes #6611. - -2001-08-13 Jon Trowbridge <trow@ximian.com> - - * mail-search.c (mail_search_construct): Disable the "search - forward/backward" option in the search dialog. Why? Well, it - doesn't work properly (bug #4869), and the reason it doesn't work - is because of some scary stuff deep inside of gtkhtml that I don't - understand at all. So since I'm paranoid, and since the GUI - freeze is tomorrow, and since it isn't really an important feature - at all, I'm #if 0-ing it out. If the gtkhtml stuff gets sorted - out, we can slip it back in for 1.1. - -2001-08-13 Peter Williams <peterw@ximian.com> - - * component-factory.c (user_create_new_item_cb): New function, - handle "user creatable items". - (component_fn): Tell the shell that we're capable of creating - mail messages. - -2001-08-13 Jason Leach <jleach@ximian.com> - - * mail-local.c (get_folder): Fix this so it can actually get - folders from the hash of folders on the local store (it was - looking up plain @folder_name, which is typically "mbox", instead - of the full URI, /home/jleach/evolution/local/Foo/mbox). - - * component-factory.c (do_remove_folder): Rename to - remove_folder_done, more fitting for it's purpose. - (do_xfer_folder): Similar name change. - (do_create_folder): Similar name change. - (remove_folder): Don't notifyResult for the component here, we - will notify with our result in remove_folder_done. - (xfer_folder): Ditto. - - * mail-vfolder.c (vfolder_refresh): Create new folders with unread - counts of "0" instead of #FALSE (which just happens to be #defined - as zero). - -2001-08-13 Peter Williams <peterw@ximian.com> - - * mail-send-recv.c (mail_autoreceive_setup): Break most of the - functionality into a separate function. - (autoreceive_setup_list): Rename of mail_autoreceive_setup that is - passed a list of accounts. - (mail_autoreceive_setup_account): New function. Set up a single - account using autoreceive_setup_account. - - * mail-send-receive.h: Prototype mail_autoreceive_setup_account. - - * mail-account-gui.c (mail_account_gui_save): Instead of setting - up all accounts, set up only this source with the new - mail_autoreceive_setup_account. - - * mail-config-druid.c (druid_finish): ... which means we can call - mail_config_add_account() after the MailConfigAccount has been - created by mail_account_gui_save() because we no longer need the - account to be in the list for mail_autoreceive_setup() - - * mail-config.c (mail_config_add_account): ... which means we can - possibly add a shortcut to the account's sources's Inbox here. - (maybe_add_shortcut): New function. If the store is a storage, add - a shortcut to its inbox. Hope that /INBOX exists. - (add_shortcut_entry): New function. Creates a shortcut if it doesn't - yet exist. - -2001-08-13 Peter Williams <peterw@ximian.com> - - * mail-account-gui.c (service_complete): Take account of the fact that - service->path may be NULL (if service is a transport.) - - * mail-config-druid.c (druid_finish): Bleah, bugfix in case the - account has no source. - -2001-08-13 Anna Marie Dirks <anna@ximian.com> - - * mail-config.glade: Changed all instances of "Wizard" and "Druid" - to "Assistant". - - * mail-config-druid.c: Ditto. - -2001-08-13 Anna Marie Dirks <anna@ximian.com> - - * mail-accounts.c: Changed the title of the Mail Settings - dialog from "Evolution Account Manager" to "Mail Settings" . - -2001-08-13 Jeffrey Stedfast <fejj@ximian.com> - - * message-list.c (get_message_uid): Do some g_assert() - action. Make sure that the node passed in is non-NULL and also - make sure that the CamelMessageInfo gotten from the ETree is - non-NULL. - (get_message_info): Same here. - - * mail-callbacks.c (expunge_folder): Confirm that the user really - wants to expunge. - (save_msg_ok): Set the parent window here. - -2001-08-13 Peter Williams <peterw@ximian.com> - - * mail-config.c (remove_account_shortcuts): Remove the shortcuts - corresponding to an account (they all point to - evolution:/accountname/..) - (mail_config_remove_account): When deleting the account, remove - its shortcuts. - -2001-08-10 Peter Williams <peterw@ximian.com> - - * mail-config-druid.c (druid_finish): Whoa, fatal typo. Sorry. - -2001-08-13 Jason Leach <jleach@ximian.com> - - * mail-local.c (init_trash): Tell folder cache the path for our - Trash is /Trash, because that's what Shell needs to hear for - updating folders. - -2001-08-11 Jason Leach <jleach@ximian.com> - - * mail-offline-handler.c (impl_goOnline): Set the session as - online so auto mail checking (and the composer) will be doing the - right things when you go online. Bug #6343 and #4601. - - * folder-browser.c: Make the right click "Resend..." into "Edit as - New Message...", bug #6838. - - * mail-accounts.h: Remove unecessary #include <camel.h> - - * mail.h: Removed a prototype for a non-existant - mail_view_create(). - -2001-08-10 Jeffrey Stedfast <fejj@ximian.com> - - * mail-account-gui.c (build_auth_menu): Fix bug #4523 for good. - (save_service): If service->authitem is NULL, then the user tried - to enable authentication but the provider doesn't actually support - it. - -2001-08-10 Jon Trowbridge <trow@ximian.com> - - * folder-browser.c: Set our ESearchBarItems subitems to NULL. - -2001-08-10 Jeffrey Stedfast <fejj@ximian.com> - - * mail-callbacks.c (transfer_msg): Prepend the uri with evolution: - to fix bug #6916. - -2001-08-10 Jason Leach <jleach@ximian.com> - - * folder-browser.c: Make the context menu for the Sent folder have - "Resend..." instead of "Resend", to clarify that it will bring up - a dialog needing your input rather than just blindly sending the - message again. Also give it the 'e' accelerator. Bug #6838. - - * mail-callbacks.c (next_unread_msg): Since 'N' keypresses go - through here now, use wrap-around selecting. - (previous_unread_msg): Same for 'P' here. - - * message-list.c (on_cursor_activated_idle): Stop this idle timer - when we have multiple items selected, this keeps it from loading - and then marking the last item in your selection list as read. - Bug #4693. - -2001-08-10 Peter Williams <peterw@ximian.com> - - * mail-accounts.c (mail_delete): Don't remove the account from the - tree if it's not enabled. - -2001-08-10 Jason Leach <jleach@ximian.com> - - * mail-ops.c (remove_folder_get): Remove all the messages from a - folder that's being deleted before actually doing the - camel_store_delete_folder, so it won't leave behind an mbox file - that's going to prevent the actual directory from being deleted, - and strange effects like new folders with the same name being made - in it's place. Bug #5618. - - * mail-folder-cache.c (mail_folder_cache_remove_folder): New - function, a way to get something out of the folder cache, like - folders being deleted. Bug #6878. - -2001-08-10 Peter Williams <peterw@ximian.com> - - * mail-accounts.c (news_add_destroyed): Whoops, compile fix. - -2001-08-10 Jason Leach <jleach@ximian.com> - - * mail-callbacks.c (mark_as_unseen): If marking messages as - unread, remove the automatic mark-as-read timer. Bug #4153. - -2001-08-08 Peter Williams <peterw@ximian.com> - - * component-factory.c (mail_load_storages): Don't load the storage - if it isn't enabled. - (mail_remove_storage_by_uri): New function. Goes through the - gymnastics of getting a CamelStore from the URI and calling - mail_remove_storage. Copied from mail_delete(). - (mail_load_storage_by_uri): Break out the storage-loading part of - mail_load_storages into a single function. - (mail_load_storages): Just call mail_load_storage_by_uri several - times. - - * mail.h: Prototype our new _by_uri functions. - - * mail-accounts.c (news_add_destroyed): Instead of hacking around - mail_load_storages, call mail_load_storage_by_uri. - (mail_delete): Move this chunk of code into - mail_remove_storage_by_uri. - (mail_able): Add or remove the storage as necessary, with our - new _by_uri functions. - - * mail-config-druid.c (druid_finish): See news_add_destroyed above. - -2001-08-10 Jeffrey Stedfast <fejj@ximian.com> - - * mail-config.c (mail_config_get_show_preview): Free dbkey if we - don't use it. - - * folder-browser.c (on_right_click): Added a comment about leaking - memory here, but we seem to not even use the 2 strings we - strdup...is this code still under construction? - - * mail-ops.c (mail_send_message): Free the sent_folder_uri at the - bottom of the function (ironically enough we were freeing it if we - encountered an error but never free'd it on success :-) - (get_folderinfo_got): Fixed a memory leak...this one would have - gone away once we got rid of the debug g_warning though. - -2001-08-10 Not Zed <NotZed@Ximian.com> - - * mail-ops.c (mail_transfer_messages): Dont want it to keep on - running if it got bad arguments, want it to bloody well crash. - (mail_append_mail): Same here. - -2001-08-09 Jeffrey Stedfast <fejj@ximian.com> - - * message-list.c (mlfe_callback): Added a g_assert_not_reached() - - I'm hoping this will help us track down the "can't delete message - sometimes" (ie bug #6637 and friends) bugs that users have been - reporting. If herein lies the problem, then we can expect some - crashes and some good backtraces, hopefully. - -2001-08-09 Peter Williams <peterw@ximian.com> - - * folder-browser.c (on_key_press): The bonobo menu items now - handle 'n' and 'p'. - (on_key_press): 'q' as well. - - * message-list.c (message_list_select): Fix inline documentation. - -2001-08-09 Anna Marie Dirks <anna@ximian.com> - - Fixes bug #6918 - - * folder-browser.c: Changed the "Store search as vFolder" menu - item to "Create vFolder from Search". - -2001-08-09 Jeffrey Stedfast <fejj@ximian.com> - - Fixes bug #6722 - - * mail-ops.c (save_messages_save): Don't set the default perms - here, let the user's umask deal with permissions. - - * folder-browser.c (message_list_drag_data_get): Don't set any - default perms. - -2001-08-09 Jeffrey Stedfast <fejj@ximian.com> - - * mail-account-gui.c (mail_account_gui_save): Save the pgp and - smime always-sign options. - - * mail-config.c (account_copy): Copy the always-sign options over - too. - -2001-08-08 Not Zed <NotZed@Ximian.com> - - * mail-ops.c (send_mail_send): Dont double-register this - operation, mail-mt will do it for us. - (get_folderinfo_get): " - (get_folder_get): " - (get_store_get): " - (create_folder_get): " - (remove_folder_get): " - (sync_folder_sync): " - (get_message_get): " - - * message-list.c (message_list_setup_etree): Free the etstate - object after we're done using it. - -2001-08-08 Peter Williams <peterw@ximian.com> - - * subscribe-dialog.c (sc_selection_changed): New function. Set the - sensitivity of the subscribe buttons based on whether any folders - are selected. - (menu_item_selected): If getting the widget for the first time, - hook up sc_selection_changed. - -2001-08-08 Peter Williams <peterw@ximian.com> - - * mail-ops.c (mail_update_subfolders): Change this gtk_object_ref - on the storage to a bonobo_object_ref. - - * component-factory.c (mail_lookup_storage): And here. - - * mail-vfolder.c (mail_vfolder_get_vfolder_storage): And here. - -2001-08-07 Ettore Perazzoli <ettore@ximian.com> - - * message-browser.c (set_bonobo_ui): Remove the "Customize - Toolbar" thing. - -2001-08-07 Not Zed <NotZed@Ximian.com> - - * mail-config.c (mail_config_get_thread_list): Free the dbkey if - we found the config option. - - * mail-send-recv.c (build_dialogue): Free the pretty_url after - we've used it. - (free_send_info): Free the 'what' string. - (receive_done): Use free_send_info to make sure we free - everything. - - * mail-ops.c (send_queue_free): Unref the filter driver when done. - (send_queue_send): Unref the driver here too, force any long - taking operations to run in our thread. - -2001-08-07 Peter Williams <peterw@ximian.com> - - * Revert Jeff's changes to subscribe-dialog.[ch]. It's not a widget, - it's an object from which you can obtain a widget. - -2001-08-07 Jeffrey Stedfast <fejj@ximian.com> - - * mail-callbacks.c (manage_subscriptions): Hide the app->window. - (do_mail_print): Set the parent of the gnome-dialog to be the - folder-browser so that when evolution is closed, the print dialog - gets destroyed. Should fix bug #4781. - - * subscribe-dialog.c (subscribe_dialog_new): This should return a - GtkWidget not a GtkObject. - - * mail-session.c (get_filter_driver): Update to use user's logging - preferences. - - * mail-accounts.c (filter_log_toggled): New. - (filter_log_path_changed): New. - (construct): Get and attach signals to the filter logging option - widgets. - - * mail-config.c (config_read): Read in filter logging options. - (mail_config_write_on_exit): Save filter logging options. - (mail_config_set_filter_log_path): Implemented. - (mail_config_get_filter_log_path): Implemented. - (mail_config_set_filter_log): Implemented. - (mail_config_get_filter_log): Implemented. - -2001-08-07 Peter Williams <peterw@ximian.com> - - * subscribe-dialog.c (folder_etree_construct): Move - fe_create_root_node farther down, so we can check for its children - without problems. - - * mail-callbacks.c (folder_created): Use bonobo_object_unref on - the storage since it's a bonobo object. - (mail_storage_create_folder): Same. - (folder_deleted): Same. - - * mail-send-recv.c (receive_update_got_store): Same. - - * mail-ops.c (do_update_subfolders): Same. - - * subscribe-dialog.c (fe_destroy): Unref the e_storage since - lookup_store gives us a ref. - -2001-08-07 Peter Williams <peterw@ximian.com> - - * subscribe-dialog.c (folder_etree_construct): Move - fe_create_root_node farther down, so we can check for its children - without problems. - (storage_tree_path): Removed, this was broken. - (subscribe_get_short_folderinfo): Use the queued thread instead of - the new thread. - (subscribe_do_subscribe_folder): Same. - (ftree_node_new_root): Don't create the path anymore; it was - broken and there's a better way to get it now. - (fe_got_children): Remove some debugging output. - (fe_check_for_children): Here too. - (fe_done_subscribing): Get the path from the URI instead of the - ftree_node. - (_SubscribeDialogPrivate): Add all of our useful widgets as - members. - (sc_refresh_pressed): Don't clear the search... that makes no - sense now. - (sc_search_activated): Don't set the filter radio button as active - now; we use sensitivity instead. - (sc_all_toggled): Make the search entry insensitive. - (sc_filter_toggled): Make the search entry sensitive. - (kill_default_view): New function. Gets rid of the default view - stuff and makes all the widgetry sensitive. - (menu_item_selected): Check if we moved off of the default view - and, if so, call kill_default_view(). - (subscribe_dialog_construct): Initialize our new private widget - members, and by default insensitize most of the buttons because - they make no sense in the default view. - -2001-08-06 Jeffrey Stedfast <fejj@ximian.com> - - * mail-config.glade: Added key accelerators to a bunch of the - config options and moved the Bcc and empty-subject checkboxes to - the composer tab where they belong. - - * mail-callbacks.c (providers_config): Raise the dialog if it - exists already. - (manage_subscriptions): Raise the dialog if it already exists. - (main_select_first_unread): Removed (we haven't needed this code - in ages). - (select_first_unread): Same. - (save_msg_ok): If the path is empty, just return. - - * mail-local.c (mail_local_reconfigure_folder): Raise the dialog - if it already exists. - -2001-08-06 Jeffrey Stedfast <fejj@ximian.com> - - * mail-callbacks.c (expunge_folder): Set the message-display - message to NULL if we can't get an info too. - -2001-08-06 Jason Leach <jleach@ximian.com> - - * mail-callbacks.c (create_folders): Make vtrash folders on other - storages with a "vtrash" type, so they get the little trashcan - icon. - -2001-08-06 Peter Williams <peterw@ximian.com> - - * subscribe-dialog.[ch]: Reimplement to be asynchronous and pretty, - with progressive folder loading and all sorts of wonderful - improvements. - - * mail-callbacks.c (manage_subscriptions): Change to reflect API - update. - - * Makefile.am (etspec_DATA): Add subscribe-dialog.etspec. - (glade_DATA): And the glade file. - - * subscribe-dialog.etspec: New file, break out the specification - from inside the subscribe-dialog.c - - * subscribe-dialog.glade: Update this, actually use it now. - -2001-08-06 Jeffrey Stedfast <fejj@ximian.com> - - * mail-callbacks.c (empty_trash): Yuck. Special case whether or - not we want to expunge all the trash folders syncronously or - asyncronously based on whether or not we are doing Empty-On-Exit - or emptying trash by user request respectively. - -2001-08-06 Jason Leach <jleach@ximian.com> - - * mail-folder-cache.c (make_folder_name): Removed this function, - it's not needed anymore. - (mail_folder_cache_note_folderinfo): Initialize mfi->unread to 0 - always, so the shell won't get sent a random int for vtrash or - potentially other folders. - - * message-list.c (message_list_select): Fix a minor glitch with - how it started a backwards wraparound at the 2nd to last message, - skipping the very last message. - -2001-08-06 Jeffrey Stedfast <fejj@ximian.com> - - * mail-config.glade: s/character set/character encoding - -2001-08-05 Ettore Perazzoli <ettore@ximian.com> - - * message-browser.c (message_browser_message_loaded): Make the - title of the window "subject - Message" instead of just "subject". - Also, display "(No subject)" if the subject is NULL. - - [Fix #6399, 8-bit characters are not displayed in window title.] - - * message-browser.c (message_browser_message_loaded): Convert the - subject from UTF-8 to GTK. - -2001-08-05 Ettore Perazzoli <ettore@ximian.com> - - [Revert the previous changes, there seems to be something wrong - with it.] - - * component-factory.c (component_factory_init): Back to using - `bonobo_generic_factory_new()'. - (component_fn): Updated accordingly. - -2001-08-04 Ettore Perazzoli <ettore@ximian.com> - - * component-factory.c (component_factory_init): Use - `e_bonobo_generic_factory_multi_display_new()' instead of just - `bonobo_generic_factory_new()'. - (component_fn): Added @component_id arg. - -2001-08-04 Jeffrey Stedfast <fejj@ximian.com> - - * mail-format.c (mail_part_is_inline): Add yet another - special-case hack for application/pgp. - -2001-08-04 Jason Leach <jleach@ximian.com> - - * message-list.c (message_list_select): Add a @wraparound - argument, so the 'n' and 'p' keypresses (or anything else that - wants to) can wrap around to find the next unread. - - * folder-browser.c (on_key_press): Tell it to wrap around here. - - * mail-callbacks.c (delete_msg): Don't wrap around here (or the - other callbacks in this file). - -2001-08-03 Jason Leach <jleach@ximian.com> - - * mail-folder-cache.c (update_idle): Updates for EvolutionStorage - API changes. - - * mail-importer.c (mail_importer_create_folder): Ditto. - - * mail-local.c: Same here. - -2001-08-03 Jeffrey Stedfast <fejj@ximian.com> - - * mail-account-gui.c (build_auth_menu): Try to restore the choice - the user had chosen before hitting the "Check Supported Types" - button. - - * mail-format.c (write_headers): Removed a no-longer-needed - g_warning. - -2001-08-03 Not Zed <NotZed@Ximian.com> - - * mail-session.c (get_password): return the source url for - popb4smtp auth request. - -2001-08-02 Jon Trowbridge <trow@ximian.com> - - * mail-ops.c (filter_folder_describe): Added. Provide - description for filter_folder_op. - (fetch_mail_describe): Added. Provide description for - fetch_mail_op. - - * message-list.c (regen_list_describe): Added. Provide - description for regen_list_op. - - * mail-config.c (check_service_describe): Added. Provide - description for check_service_op. - - * folder-info.c (do_describe_info): Added. Provide description - for get_info_op. - -2001-08-02 Larry Ewing <lewing@ximian.com> - - * mail-send-recv.c (format_url): handle null paths in the dialog - so that we avoid printing NULL strings - -2001-08-02 Jeffrey Stedfast <fejj@ximian.com> - - * mail-callbacks.c (filter_edit): Raise the filter-editor window - if it's already created. - - * folder-browser.c (message_list_drag_data_received): I obviously - can't spell recieved, er, received...uh, yea. - -2001-08-02 Jason Leach <jleach@ximian.com> - - * mail-config.glade: Set history_id's for the sig and html sig - gnome file entry boxes so it can persist history, also add titles - to the dialogs that popup when you click the "Browse..." button. - Bug #5595. - -2001-08-02 Jeffrey Stedfast <fejj@ximian.com> - - * mail-vfolder.c (vfolder_create_storage): Connect to the - folder_remove signal on the storage. - (vfolder_remove): New function to remove a vfolder. - (vfolder_edit): Raise the window if it already exists. - -2001-08-02 Not Zed <NotZed@Ximian.com> - - * Makefile.am (INCLUDES): Add EVOLUTION_BUTTONSDIR to get to some - different icons. - - * mail-ops.c (mail_sync_folder): Queue the folder sync operation, - rather than running it in parallel. - - * mail-send-recv.c: applies anna's patch for prettier send-recv - dialogue. - (parse_url): Renamed to format_url, fixed callers. - (format_url): Use camel_url_free instead of g_free, also handle - case where we have no host (use path instead). - (build_dialogue): Cleaned up some whitespace. - (build_dialogue): Create the label directly with the right text, - dont set any text in the progress bar, and save the label into the - info struct for later updating. - (struct _send_info): Added 'status' the label with the status - string. - (operation_status_timeout): - (receive_done): - (receive_cancel): Set the status label, not the progress format - text. - (hide_send_info): NULL out status too. - (mail_receive_uri): Init status. - (free_folder_info): Initiate a folder sync here, so we can ... - (free_send_data): ... Remove the awful hack of iterating through - bonobo controls to sync all open folders. - (free_send_data): Initiate a sync of the inbox too. - (build_dialogue): Remove set_alignment on the icon, its not a - gtkmisc object. - -2001-08-01 Jeffrey Stedfast <fejj@ximian.com> - - * folder-browser.c (folder_browser_copy): Do the Right Thing (tm) - if the message list is not the widget in focus (which is to copy - the text selected in the html viewer instead). Fixes bug #5868. - -2001-08-01 Jason Leach <jleach@ximian.com> - - * folder-browser-ui.c: Use the new Save As and Message Search - icons from Jakub. - - * mail-callbacks.c (delete_msg): Don't move cursors around when - deleting last message and Hide Deleted Messages isn't enabled. - Bug #5928. - -2001-07-31 Anna Marie Dirks <anna@ximian.com> - - * mail-mt.c (do_get_pass): Changed the title of this dialog - to "Enter Password". - -2001-07-30 Jeffrey Stedfast <fejj@ximian.com> - - * mail-mt.c (do_get_pass): We are not guarenteed to have a - non-NULL service (ie. PGP) thus check for it. - (pass_got): And again here. - (mail_get_password): And of course here too. - - * mail-format.c (decode_pgp): When writing out a CamelException to - the HTML stream, be sure to translate it first. - (handle_message_external_body): Convert to UTF8 here too - I know - this function is basically a dead end right now but eventually we - will want to do something. I mostly did this because param values - are UTF8 encoded so we should avoid mixing and matching UTF with - non UTF8. - (format_mime_part): Avoid writing non-UTF8 to the HTML stream. - - * mail-tools.c (mail_tool_make_message_attachment): Convert - translated strings to UTF8 here too. - (mail_tool_forward_message): Here too. - -2001-07-23 Zbigniew Chyla <cyba@gnome.pl> - - * mail-format.c (attachment_header, write_address, decode_pgp, - mail_write_authenticity): - Convert translated strings to UTF8 before calling mail_html_write. - - I modified the patch slightly and cleaned up bits of code around - it as well. For example, we probably want to avoid having HTML - tags in the strings to be translated. -- fejj - -2001-07-30 Jeffrey Stedfast <fejj@ximian.com> - - * mail-account-gui.c (mail_account_gui_new): Restore old security - settings from the saved configuration. Fixes bug #5710. - -2001-07-30 Not Zed <NotZed@Ximian.com> - - * mail-session.c (do_register_timeout): Actually add the timeout, - this time in the gtk thread. - (do_remove_timeout): And same for remove. - (register_timeout): - (remove_timeout): Proxy the gtk calls to the main thread, and - wait for them to execute synchronously. - (register_timeout): Instead of return with fail for a too small - timeout, just increase the timeout. - -2001-07-27 Zbigniew Chyla <cyba@gnome.pl> - - * component-factory.c (populate_folder_context_menu): Added (unused) - table with strings intended to be translated (i18n tools can't extract - strings from XML data inside .c file). - -2001-07-27 Jeffrey Stedfast <fejj@ximian.com> - - * mail-mt.c (focus_on_entry): Don't need this anymore. - (do_get_pass): Since we already have the entry widget, no need to - do the nasty focus_on_entry hack. - -2001-07-26 Peter Williams <peterw@ximian.com> - - * mail-mt.c (do_get_pass): Figure out whether we're getting the - password for the source or the transport, and get the toggle - button accordingly. - (pass_got): Same. - - * mail-config.c (mail_config_get_account_by_transport_url): New - function. Cut + paste + search + replace of _by_source_url. - - * mail-config.h: Prototype here. - -2001-07-26 Jeffrey Stedfast <fejj@ximian.com> - - * folder-browser.c (message_list_drag_data_get): If we don't have - any messages selected, break out. This fixes bug #5612. - - * component-factory.c (xfer_folder): Fixed a strstr (url, - "noselect=yes") brokenness. - (destination_folder_handle_motion): Same. - (destination_folder_handle_drop): And again here. - - * mail-format.c (handle_application_pgp): Implemented. - (setup_mime_tables): Setup the application/pgp handler to use - handle_application_pgp instead of handle_text_plain. - (handle_text_plain): Remove special-case hacks for application/pgp - types. - - * mail-config.glade: beautification. - -2001-07-26 Peter Williams <peterw@ximian.com> - - * mail-mt.c (do_get_pass): Use magic to make the password - remembering checkbutton come after the entry, visually. - -2001-07-26 Jeffrey Stedfast <fejj@ximian.com> - - * mail-format.c (write_headers): Respect Gtk theme colors for the - fonts and calculate a new table gbcolor based on gtk theme - preferences. - - * mail-config.glade: Label the enabled field. - -2001-07-26 Peter Williams <peterw@ximian.com> - - * message-list.etspec: Make the date column smaller and the - subject column larger, relatively. - - * mail-folder-cache.c (make_folder_status): Don't display "0 - hidden". - - * folder-browser.c (on_key_press): Make 'q' a toggle, not one-way. - - * message-list.etspec: Rename "Date" column to "Sent". - -2001-07-25 Anna Marie Dirks <anna@ximian.com> - - * mail-config.glade: fixed a mis-spelling of "Fashion" in the mail - accounts window. (See bug 5433) - -2001-07-25 Jeffrey Stedfast <fejj@ximian.com> - - * mail-session.c (make_key): Don't make the key url:item if we - have the url, just make it url. This fixes bug #5339. - (mail_session_set_password): Removed. - -2001-07-25 Peter Williams <peterw@ximian.com> - - * folder-browser.c (etree_key): Make it so Enter always opens the - message in another window. - -2001-07-25 Peter Williams <peterw@ximian.com> - - * mail-mt.c (mail_get_password): Now take a CamelService parameter - (as passed by Camel). Allows us to have a "remember password" - checkbox that is set correctly and whose settings can be - propagated back to the proper MailConfigService. - (do_get_pass): Add a checkbutton allowing the user to change - whether the password is remembered or not. - (pass_got): Apply the setting of the "remember password" - checkbutton (if not cancelled.) - - * mail-mt.h: Update the prototype here. - - * mail-config.c (mail_config_service_set_save_passwd): New - function, pretty bland. - - * mail-config.h: Prototype our bland new function. (Get it? It's a - pun!) - - * mail-session.c (get_password): Pass the service as well. - -2001-07-25 Jeffrey Stedfast <fejj@ximian.com> - - * mail-account-gui.c (build_auth_menu): Now takes a - check_supported gboolean argument saying whether or not to disable - non-supported authtypes. - (source_type_changed): Update for build_auth_menu. - (transport_type_changed): Same. - (service_check_supported): Pass in TRUE for the disable - non-supported authtypes to build_auth_menu and also disable - check-supported button and the authtype menu if we get a NULL - supported auth list. - - * mail-callbacks.c (mail_generate_reply): Initialize `me' to NULL. - (forward_attached): If we are only forwarding a single message, - pass the message along as the callback data, else pass NULL. - (do_forward_attach): Updated for changes to - forward_get_composer(). - (do_forward_non_attached): Same. - (forward_get_composer): Try to guess which account to forward the - message from if the message passed in is non-NULL. - -2001-07-24 Peter Williams <peterw@ximian.com> - - * mail-config.c (mail_config_write): Um, write the HTML signature - settings in the right place. Whoops. - -2001-07-24 Jason Leach <jleach@ximian.com> - - * mail-callbacks.c (delete_msg): If we're deleting the last - message, select the previous, not next, which actually selects - nothing. Fixes #5323. - -2001-07-24 Jeffrey Stedfast <fejj@ximian.com> - - * mail-ops.c (save_part_save): Pass the O_TRUNC flag to open so - that we don't leave trailing garbage at the end of the file if the - new file content is shorter than the old file content. - - * component-factory.c (create_view): Fix for bug #5174. - -2001-07-24 Jason Leach <jleach@ximian.com> - - * mail-config.c (config_read): Match the prefix for the - "remember_passphrase" setting with where it's being saved to - (/Mail/Prompts), so the setting gets loaded correctly. Fixes - #5351. - -2001-07-24 Jeffrey Stedfast <fejj@ximian.com> - - * mail-format.c (handle_text_plain): check_specials if this is an - application/pgp type as well. - - * mail-ops.c (add_vtrash_info): When dumping the CamelURL to a - string, hide all the params. - -2001-07-24 Jeffrey Stedfast <fejj@ximian.com> - - * mail-callbacks.c (guess_me): Do a case-insensitive comparison. - (mail_generate_reply): Only resort to the source account's - identity if we can't find out which identity to use based on the - recipients of the message first. - - * mail-config.c (mail_config_get_default_account): Make sure to - return the 0th account if we don't have a default. We don't want - to return NULL. - - * mail-callbacks.c (empty_trash): Use mail_tool_get_trash for the - remote store trash folders. - - * mail-tools.c (mail_tool_get_trash): New convenience function. - -2001-07-24 Jason Leach <jleach@ximian.com> - - * mail-config.c (config_read): get_boolean_with_default for the - "Mark as read" timeout, not get_long_with_default. Fixes #5176. - -2001-07-24 Peter Williams <peterw@ximian.com> - - * mail-folder-cache.c (make_folder_name): Don't display "(0 unsent)" if - the outbox is empty. - - * mail-local.c (init_trash): Set up the local trash in the folder - cache. - - * mail-folder-cache.c (update_idle): Make the error reporting a little - but more descriptive. - -2001-07-24 Peter Williams <peterw@ximian.com> - - * mail-config.glade: Add new label widgets with a message that SSL - isn't supported. - - * mail-account-gui.h: Add a new member to the Transport GUI struct - for the 'SSL is not supported' message. - - * mail-account-gui.c (source_type_changed): Change logic to display - a message stating that SSL isn't supported if SSL isn't supported. - (transport_type_changed): Same. - (mail_account_gui_new): Also load the labels for the the no-SSL - message. - - * mail-accounts.c (construct): Fix typo. - -2001-07-24 Not Zed <NotZed@Ximian.com> - - * component-factory.c (create_folder): Dont call notifyResult here - if we've just launched a thread to do the work, it calls it - itself. This apparently breaks the importers, but thats a - different issue. - -2001-07-23 Not Zed <NotZed@Ximian.com> - - * mail-mt.c (mail_msgport_replied): Go back to calling - mail_msg_free here. - (mail_msg_destroy): Remove the operation unregistration stuff. - (mail_msg_received): And put it here, so we unregister as soon as - the async part of the operation is complete. I thought about this - and we should be doing this anyway so we register/unregister - always in the same thread, although the camel_operation api - doesn't enforce it, this *is* what it expects. - - * message-list.c (regen_list_regen): re-add reporting to - rebuilding the message list. Basically fixes #4931 - -2001-07-23 Jeffrey Stedfast <fejj@ximian.com> - - * mail-search.c (toggled_fwd_cb): Oops. Uncomment this code since - Trow fixed GtkHTML to actually have this function now. - - * mail-config.glade: Fixed the "Read" to be Read in the glade file - per menesis' request. - - * mail-accounts.c (construct): Give the dialog a Close button - instead of an OK button. - (prompt_bcc_only_toggled): New. - (threaded_list_toggled): New. - (show_preview_toggled): New. - (construct): Add code for the bcc-only-prompt, threaded-list, and - show-preview checkboxes. - - * mail-ops.c (transfer_messages_transfer): If the source and - destination folders are the same, just mark the uids as undeleted - (in case they were marked as deleted before). - -2001-07-23 Jon Trowbridge <trow@ximian.com> - - * mail-search.c (begin_cb): Carefully check for NULL everywhere, - and do the right thing if the message we are currently looking at - gets expunged. (Bug #4870) - -2001-07-23 Jason Leach <jleach@ximian.com> - - [Bug #5225: No UI way to mark as unimportant] - - * folder-browser.c (on_right_click): Do the necessary stuff to - show or hide the correct "Mark Important" or "Mark as Unimportant" - menu items depending on the status of messages that are selected. - - * folder-browser-ui.c: Add the MarkAsUnimportant verb here. - - * mail-callbacks.c (mark_as_unimportant): Simple function that's - the callback for these new menu items. - -2001-07-22 Ettore Perazzoli <ettore@ximian.com> - - * component-factory.c (remove_folder): Updated to get a @type - argument. Return an error if the type isn't "mail". - (xfer_folder): Likewise. - -2001-07-21 Ettore Perazzoli <ettore@ximian.com> - - * component-factory.c: Make types "mailstorage" and "vtrash" - non-user-creatable. - -2001-07-20 Jason Leach <jleach@ximian.com> - - * mail-summary.c (generate_html_summary): Change this back to the - "evolution:/local/Inbox" URI. - -2001-07-20 Peter Williams <peterw@ximian.com> - - * component-factory.c (storage_remove_folder): Don't let the user - remove vtrash folders. - -2001-07-20 Peter Williams <peterw@ximian.com> - - * mail-mt.c (mail_msgport_replied): Fix DanW's fix. Pass the right - arguments to mail_msg_destroy. - - * component-factory.c (component_fn): Don't populate the context - menu; our only action didn't even work. - (populate_folder_context_menu): Removed. ChangeFolderProperties - needs a FolderBrowser which we don't have. It didn't even work - before. - - * mail-local.c (mail_local_reconfigure_folder): Bring the creation - of the hash table to the beginning to prevent warnings. Complain - if the mailbox is non-local. - -2001-07-20 Jeffrey Stedfast <fejj@ximian.com> - - * mail-ops.c (filter_folder_filter): Don't expunge the source - folder if we have a cache. - -2001-07-20 Dan Winship <danw@ximian.com> - - * mail-mt.c (mail_msgport_replied): Use mail_msg_destroy rather - than mail_msg_free, so the cancellation operation gets - unregistered and doesn't leak two file descriptors. - -2001-07-19 Jason Leach <jleach@ximian.com> - - * mail-summary.c (generate_html_summary): Update this - evolution:/local/ URI to evolution:/Local Folders/ to go along - with today's shell changes. - -2001-07-19 Jason Leach <jleach@ximian.com> - - * mail-display.c: Fix #4605: "Save Image as" should be "Save Image - as...". - -2001-07-19 Jason Leach <jleach@ximian.com> - - * mail-display.c (mail_display_new): Set the vertical scrolling - policy for the mail display to AUTOMATIC, only get a scrollbar if - the e-mail is longer than one frame. - - * folder-browser.c (my_folder_browser_init): We were setting the - policy twice (and to two different things). Removed this one. - - * message-list.c (message_list_init): Set the policy for the - message list scroll frame to be horizontal=NEVER, - vertical=AUTOMATIC (scrollbar only if you have >1 page of - messages). - -2001-07-19 Peter Williams <peterw@ximian.com> - - Track the NoSelect changes in Camel. - - * mail-callbacks.c (create_folders): We don't need to check if - the URL is NULL or not anymore. - - * component-factory.c (create_noselect_control): New - function. Create a dummy control for folders that can't contain - messages (ie \NoSelect) - (create_view): If the URI says the folder is noselect, make a - dummy control. FIXME: still should merge in the global UI - elements. - (xfer_folder): Don't allow the operation if the destination is - NoSelect. - (destination_folder_handle_motion): Ditto. - (destination_folder_handle_drop): Ditto. - -2001-07-19 Not Zed <NotZed@Ximian.com> - - * mail-local.c (reconfigure_folder_reconfigure): remvoed - register/start/end etc code. - - * mail-ops.c (get_messages_desc): Add the count here. - (get_messages_get): Remove the register/start code, its handled - above us. - (save_messages_desc): Added count. - (save_messages_save): Removed register/start/end code. - - * mail-mt.c (mail_msg_received, mail_msg_destroy): Changed to use - camel_operation rather than mail_status. - (mail_msgport_received, mail_msgport_replied): Turn of the - mail_status stuff, we dont need to report on stuff running in the - gui thread right? - (retrieve_shell_view_interface_from_control, set_view_data, - mail_statusf, mail_status, mail_status_end, mail_status_start, - status_timeout, do_del_status, set_status_op): removed now - redundant stuff. - (mail_msg_free): Removed reference to timeout_id. - -2001-07-18 Not Zed <NotZed@Ximian.com> - - * mail-local.c (reconfigure_folder_reconfigure): Changed to use - camel_operation rathre than mail_status. - (reconfigure_folder_describe): re-enabled this function. - - * mail-ops.c (get_messages_get): Changed to use camel-progress for - status reporting. - (save_messages_save): Likewise. - -2001-07-17 Not Zed <NotZed@Ximian.com> - - * mail-mt.c (struct _mail_msg_priv, destroy_objects, mail_msg_new, - mail_msg_free, do_op_status): Changed to use an EvolutionActivityClient for - progress. - -2001-07-18 Jason Leach <jleach@ximian.com> - - * mail-tools.h (mail_tool_get_local_inbox_url): Remove this - prototype for a function that was removed long ago. - (mail_tool_get_local_movemail_url): Ditto. - -2001-07-18 Jason Leach <jleach@ximian.com> - - [Simplifying how default account is stored and used internally, - fixes possabilities of having multiple default accounts and things - like deleting the current default account] - - * mail-account-gui.c (mail_account_gui_new): Update for new way of - finding out the default account. - (mail_account_gui_save): Ditto. - - * mail-accounts.c (load_accounts): Ditto. - - * mail-config-druid.c (make_default_account): Ditto. - - * mail-config.c: Added an int MailConfig::default_account, to be - used instead of a 'default_account' boolean on each mail account. - (mail_config_set_default_account_num): New function, facilitates - things. - - * Mail.idl: removed the Account::default_account boolean. - -2001-07-18 Jeffrey Stedfast <fejj@ximian.com> - - * mail-tools.c (mail_tool_generate_forward_subject): Do what was - suggested in #4596. - -2001-07-18 Peter Williams <peterw@ximian.com> - - * mail-accounts.c (construct): Add GTK_WIDGET to the charset - picker. Reportedly prevent a craash for someone... ? - - * mail-config.glade: Typo fix. - Later: And actually fix the typo. - -2001-07-17 Jeffrey Stedfast <fejj@ximian.com> - - * mail-accounts.c (mail_delete): Setup the auto-receive here - instead. - - * mail-config.c (mail_config_remove_account): Don't setup the - auto-recv here. - -2001-07-17 Iain Holmes <iain@ximian.com> - - * mail-accounts.c (mail_able): Reset the auto receive. - - * mail-config.h (mail_config_remove_account): Reset the autoreceive. - -2001-07-17 Jason Leach <jleach@ximian.com> - - * mail-account-gui.c (source_type_changed): Fix for last change: - hide the entire widget, not just the entry. - -2001-07-17 Jeffrey Stedfast <fejj@ximian.com> - - * folder-browser.c (message_list_drag_data_recieved): Fix to - correctly handle text/uri-lists that contain more than a single - url. - - * component-factory.c (destination_folder_handle_drop): Fix to - correctly handle text/uri-lists that contain more than a single - url. - -2001-07-17 Jason Leach <jleach@ximian.com> - - * mail-config.glade: Make the Path: entry into a GnomeFileEntry so - you get a nice "Browse..." button that pops up a file selector to - locate your mbox files. Bug #3501. - -2001-07-17 Jeffrey Stedfast <fejj@ximian.com> - - * mail-format.c (mail_part_toggle_displayed): Cleaned up a bit. - (handle_multipart_encrypted): Replace the encrypted part with the - decrypted part. - -2001-07-17 Iain Holmes <iain@ximian.com> - - * mail-accounts.c (mail_delete): Make a nicer dialog. - -2001-07-17 Jeffrey Stedfast <fejj@ximian.com> - - * mail-local.c (init_trash): Use CAMEL_VTRASH_NAME. - - * mail-ops.c (add_vtrash_info): Use CAMEL_VTRASH_NAME. - - * folder-browser.c: turned off some debugging - -2001-07-16 Jeffrey Stedfast <fejj@ximian.com> - - * mail-callbacks.c (transfer_msg): Disallow vtrash for now... - - * mail-ops.c (add_vtrash_info): Use g_strcasecmp() when looking - for a Trash folder - it may be lowercase or something funky. - (transfer_messages_transfer): Special-case vtrash folders. - - * mail-local.c (init_trash): No need to specify the vfolder - expression here. This code was moved into camel-vtrash-folder.c - ages ago. - - * component-factory.c: Let VTrash folders accept/export the same - dnd types as normal folders. - -2001-07-16 Peter Williams <peterw@ximian.com> - - * mail-folder-cache.c (outbox_folder): prototype outbox_folder so - we can check if a folder is it. - (make_folder_name): If the folder is the outbox, display the count - of total messages as "unsent". - (make_folder_status): If the folder is the outbox, display - "unsent" instead of "total" - -2001-07-16 Peter Williams <peterw@ximian.com> - - * mail-display.c (mail_display_redisplay): Use our own - display_style member instead of the global setting. - (mail_display_init): Initialize display_style. - - * mail-display.h: Include "mail-config.h" and add a display_style - member. - - * mail-format.c (write_headers): Look at the MailDisplay's - display_style instead of using the full_headers data. - - * folder-browser.c (folder_browser_set_message_display_style): Set - the MailDisplay's display style as well as the global display - style. - (my_folder_browser_init): Don't save preference changes by - default. (This is only observered wrt. the message display style - but should apply to other items.) - - * folder-browser-factory.c (folder_browser_factory_new_control): - Set this FB to save the preferences set in it. - - * folder-browser-ui.c (folder_browser_ui_add_message): Read our - display's state instead of the global setting. - -2001-07-16 Peter Williams <peterw@ximian.com> - - * mail-folder-cache.c (mail_folder_cache_set_folder_browser): DUH. - No need to update every folder if we set the folder browser to - NULL. - -2001-07-15 Jeffrey Stedfast <fejj@ximian.com> - - * mail-account-gui.c (mail_account_gui_save): Call - mail_autoreceive_setup() so that any changes to the list of - accounts will be respected the next time mail is checked. - -2001-07-13 Peter Williams <peterw@ximian.com> - - * mail-callbacks.c (expunge_folder): Segfault prevention here if - no uid is currently loaded. - - * mail-vfolder.c (unlist_vfolder): New function. If a vfolder in - our list gets finalized, NULL out info->folder (Is it wrong if - this happens?) Also, locking issues? - (vfolder_uri_to_folder): Hook up to the finalize event here. - -2001-07-13 Jeffrey Stedfast <fejj@ximian.com> - - * mail-ops.c (filter_folder_filter): Updated to reflect changes in - the filter API by passing in the provided uid cache to - camel_filter_driver_filter_folder. - (mail_filter_folder): Set the cache to NULL. - (mail_fetch_mail): Set the cache to NULL. - (fetch_mail_fetch): If a cache exists for this folder, set - it. When we are finished filtering the incoming messages, the - logic changes a bit. We now save the cache if keep_on_server is - set *or* if there was an exception this way if the user's download - gets interrupted, he won't have to download all the messages - again. - (fetch_mail_fetch): Oh yea, and just so if we get an exception - with `delete' turned on, the next time the user checks mail and an - exception *doesn't* occur, it will go back and mark all the - messages for deletion. - -2001-07-12 Iain Holmes <iain@ximian.com> - - * importers/evolution-mbox-importer.c (load_file_fn): Check that - the folder does exist before trying to import it. - -2001-07-12 Jeffrey Stedfast <fejj@ximian.com> - - * mail-callbacks.c (expunge_folder): Force-hide all deleted - messages before expunging. - (expunged_folder): Restore the user's "hide deleted messages" - preference. - -2001-07-12 Jason Leach <jleach@ximian.com> - - * mail-callbacks.c (expunge_folder): Only blank the mail display - if the message being viewed is one of those to be expunged. Bug - #4030. - -2001-07-12 Jason Leach <jleach@ximian.com> - - * mail-config.c (config_read): Should be saving the - 'identity_html_signature' and 'identity_has_html_signature" keys - in the /Mail/Accounts prefix (with the rest of the per-account - stuff, not on it's own) - -2001-07-11 JP Rosevear <jpr@ximian.com> - - * mail-display.c (get_embedded_for_component): no longer need to - set a my address property - -2001-07-10 Federico Mena Quintero <federico@ximian.com> - - * mail-display.c (link_copy_location): Set the CLIPBOARD selection - as well as the primary selection so that Edit/Paste will work in - other programs (e.g. Netscape). - (mail_display_new): Add the target for the CLIPBOARD selection. - -2001-07-10 Jason Leach <jleach@ximian.com> - - [Bug #4305: Make the automatic mark-as-read timer optional] - - * mail-config.glade: Necessary changes to make the Mark as "Read" - label a toggle button instead. - - * mail-accounts.c (construct): Connect to the "toggled" on our new - toggle. - (timeout_toggled): New callback, called from above. - - * mail-config.c (mail_config_get_do_seen_timeout): New. - (mail_config_set_do_seen_timeout): New. - (mail_config_write_on_exit): Save the preference here. - (config_read): Load it here. - -2001-07-10 JP Rosevear <jpr@ximian.com> - - * folder-browser.c: Cosmetic patch - replace our defines with the - e-popup ones - - * Makefile.am: Typo - -2001-07-10 Peter Williams <peterw@ximian.com> - - * mail-format.c (attachment_header): Took the logic of whether or - not to make the attachment header out of the actual function. - (mail_part_is_displayed_inline): Return if the part is being - displayed inline (regardless of whether it is actually inline). - (mail_part_toggle_displayed): Toggle whether it's displayed inline - or not. - (get_inline_flags): Determine whether the part is displayed inline - and whether it is actually inline. - (mail_format_mime_message): Initialize the attachment_status hash - table. - - * mail-display.c (inline_cb): Instead of modifying the - CamelMimePart, use mail_part_toggle_displayed - (button_press): As above. - (pixmap_press): Use mail_part_is_displayed_inline instead of - mail_part_is_inline. Get the MailDisplay from the popup to do - this. - - * mail.h: Add prototypes. - -2001-07-10 JP Rosevear <jpr@ximian.com> - - * Makefile.am: extra dist the news files - -2001-07-10 Jeffrey Stedfast <fejj@ximian.com> - - * mail-config.c (mail_config_write_on_exit): Use - bonobo_config_set_string_wrapper. - (mail_config_write): Same. - (bonobo_config_set_string_wrapper): Macro wrapping - bonobo_config_set_string that passes "" as the val if the val is - NULL. - - * mail-callbacks.c (mail_generate_reply): Make sure that the - reply-to addr i non-NULL before trying to add it to the hash - table. - -2001-07-09 JP Rosevear <jpr@ximian.com> - - * mail-account-gui.c (get_focused_widget): fix typo so it compiles - -2001-07-09 Jeffrey Stedfast <fejj@ximian.com> - - * mail-format.c (setup_mime_tables): Handle application/pgp using - the text/plain handler. - - * mail-account-gui.c (get_focused_widget): New function to - determine which widget is focused. - - * mail-account-editor.c (apply_changes): Not only flip to the - notebook page that wasn't finished, but also grab the focus of the - incomplete widget. - - * mail-config-druid.c (source_changed): Grab the focus of the - incomplete widget. - (transport_prepare): And here. - (identity_changed): Here too. - - * mail-account-gui.c (mail_account_gui_identity_complete): Take an - incomplete argument so we can set which widget is incomplete and - then the caller can focus it or whatever. - (service_complete): Same. - (mail_account_gui_transport_complete): And again here. - (mail_account_gui_management_complete): And here too. - -2001-07-09 Jeffrey Stedfast <fejj@ximian.com> - - * mail-format.c (decode_pgp): Update to pass in the `remember' - argument when creating a new pgp context. - (try_inline_pgp_sig): And here... - - * mail-crypto.c (mail_crypto_pgp_mime_part_sign): Update to pass - in the `remember' argument when creating a new pgp context. - (mail_crypto_pgp_mime_part_verify): Same. - (mail_crypto_pgp_mime_part_encrypt): And here... - (mail_crypto_pgp_mime_part_decrypt): And finally here. - - * mail-config.c (mail_config_get_remember_pgp_passphrase): New. - (mail_config_set_remember_pgp_passphrase): New. - (config_read): Read in the "remember passphrase" value. - (mail_config_write_on_exit): Save the remember-passphrase value. - - * mail-accounts.c (construct): Allow the user to set "Remember PGP - Passphrase". - (remember_pgp_passphrase_toggled): Set the toggle state. - -2001-07-09 Peter Williams <peterw@ximian.com> - - * mail-ops.c (get_folderinfo_got): Check for an exception and - print it. Call done anyway. - (do_update_subfolders): Check for NULL info. - -2001-07-09 Peter Williams <peterw@ximian.com> - - * mail-config.c (mail_config_write): Some NULL protection for our - strings: pgp_key, html_signature, smime_key. Probably we should do - this for all strings. Either that or change Bonobo Config. - - * message-list.c (message_list_init): Explicitly initialize search - to NULL. Bug 3951 might to be due to a problem wrt this, and it - can't hurt. - -2001-07-09 Dan Winship <danw@ximian.com> - - * mail-display.c (save_part): g_strdup the result of - g_get_home_dir since this variable will get free'd later. - - * mail-format.c (mail_lookup_handler): Use - gnome_vfs_mime_get_short_list_applications rather than - gnome_vfs_mime_get_default_application. - - * mail-display.c (pixmap_press): Construct the EPopupMenu array on - the fly, based on the number of applications available to open the - MIME type. - (launch_cb): Figure out which menu item was clicked, and invoke - the appropriate application. Ugh, messy, because of the EPopupMenu - interface. Probably should get rewritten some day. Also, make this - handle apps with expects_uris set too. - -2001-07-09 Peter Williams <peterw@ximian.com> - - * mail-config.c (mail_config_write): Change html_signature stuff - over to bonobo-config -- someone forgot to do this. - - * mail-folder-cache.c (dm): Gave up and got rid of dm. Just - replaced it with d(g_message()) and set G_LOG_DOMAIN. - -2001-07-09 Peter Williams <peterw@ximian.com> - - * mail-folder-cache.c (mail_folder_cache_set_update_shellview): - Deleted - (as opposed to #if 0) - (get_folder_info): Changed to assume it has the folder lock. - (make_folder_name): Same. - (make_folder_status): Same. - (update_idle): Don't unlock around the make_folder_ functions. - (*): Changed behavior wrt. get_folder_info. Lock before calling, - but also move preconditions before -- get_folder_info can only - return NULL if uri is NULL. Also add preconditions for other - arguments where necessary. - -2001-07-07 Christopher James Lahey <clahey@ximian.com> - - * message-list.c (on_cursor_activated_cmd): Check for new_uid != - NULL here before strcmping. - -2001-07-07 Dan Winship <danw@ximian.com> - - * main.c (main): Only install the segv_redirect handler if SEGV's - handler is not currently SIG_DFL. Otherwise you get an infinite - SEGV loop if you run with GNOME_DISABLE_CRASH_DIALOG. - -2001-07-07 Christopher James Lahey <clahey@ximian.com> - - * message-list.c (message_list_select): Made this handle being - given a row that's outside the range better. - -2001-07-06 Jason Leach <jleach@ximian.com> - - [Fix bug #1100, default account is stored strangely] - - * mail-config.c (mail_config_get_default_account_num): New - function, returns the integer of the position of the default - account, used to save which account is the default to the config - db. - (mail_config_write): Save the default account number here in - "/Mail/Accounts/default_account". - (config_read): Load in which is the default here. - -2001-07-06 Larry Ewing <lewing@ximian.com> - - * mail-callbacks.c (composer_send_cb): add a NULL check since that - is a valid return. - -2001-07-06 Peter Williams <peterw@ximian.com> - - * mail-format.c (format_mime_part): Prevent infinite recursion when - viewing attachments that we can't / shouldn't display but are some - form of plaintext. Cf bug #2234 - -2001-07-06 Jeffrey Stedfast <fejj@ximian.com> - - * folder-browser.c (folder_browser_copy): Freeze and Thaw the - folder. - -2001-07-06 Jeffrey Stedfast <fejj@ximian.com> - - * folder-browser.c (folder_browser_copy): Mark the messages as - Seen also. - (folder_browser_class_init): Create an atom type for - X-Evolution-Message selection type. - (my_folder_browser_init): Add our multiple selection types, one of - which is the default string type. - - * component-factory.c (destination_folder_handle_drop): Update to - use the new X-Evolution-Message type format. - - * folder-browser.c (selection_get): Convert the - X-Evolution-Message clipboard type to whatever format the target - wants. - (message_list_drag_data_get): Update because the - X-Evolution-Message type changed. - (folder_browser_copy): Same. - (x_evolution_message_parse): And here too. - -2001-07-06 Peter Williams <peterw@ximian.com> - - * mail-callbacks.c (composer_postpone_cb): Don't free the psd here -- - it will be freed on the "destroy" signal. - - * mail-folder-cache.c (maybe_update): Instead of an idle, use a very - short timeout in hopes of reducing the number of redundant updates. - - * mail-tools.c (mail_tool_uri_to_folder): Only note the folder in the - cache if we successfully got it. - -2001-07-06 Jason Leach <jleach@ximian.com> - - * mail-callbacks.c (delete_msg): Select the very next message - after deleting, not the next undeleted (it can make things jump - around in annoying ways if you are deleting many messages), bug #4032. - - * folder-browser.c: Forgot to commit the "Mark as Important" right - click menu item. - - * message-list.c (message_list_set_folder): Setup the strikeout - column here (after we've gotten the folder) so we can disable - strikeouts for vtrash folders, part of bug #2224. - -2001-07-06 Dan Winship <danw@ximian.com> - - * mail-folder-cache.c (mail_folder_cache_set_folder_browser): Fix - obvious bug in previous bugfix: Pass "fb" to check_for_fb_match() - so only the selected folder gets updated, instead of "all folders - that haven't yet been selected". - -2001-07-06 Ettore Perazzoli <ettore@ximian.com> - - * component-factory.c (populate_folder_context_menu): New function - to populate the right-click menu for mail folders. - (component_fn): Pass it to `evolution_shell_component_new()'. - -2001-07-05 Jeffrey Stedfast <fejj@ximian.com> - - * mail-accounts.c (construct): Add a checkbox for prompting when - sending a message with an empty subject. - - * mail-ops.c (mail_send_message): If filtering fails, return right - away. - - * mail-config.c (mail_config_set_show_preview): Okay, apparently I - was wrong. Oh well. - (mail_config_set_thread_list): Fix this one too. - -2001-07-05 Peter Williams <peterw@ximian.com> - - * mail-vfolder.c (vfolder_uri_to_folder): Add mail folder cache - hookups. - - * Makefile.am: Remove the ridiculuous relic known as - test-mail. Clean up a bit. - - * mail-vfolder.c (vfolder_uri_to_folder): Add mail folder cache - hookups. - -2001-07-05 Peter Williams <peterw@ximian.com> - - * mail-folder-cache.c (mail_folder_cache_set_folder_browser): - Clear the shell view label if mailer loses focus. - - * mail-ops.c (do_update_subfolders_rec): Check for NULL url before - calling folder cache functions. - -2001-07-04 Gediminas Paulauskas <menesis@delfi.lt> - - * folder-browser-ui.c (message_pixcache): set icon for - ApplyFilters command. - -2001-07-04 Jeffrey Stedfast <fejj@ximian.com> - - * mail-config.c (mail_config_set_show_preview): Revert Sam's - changes. - - Note: Uhm, g_hash_table_lookup_extended gives us a pointer to the - original value which we can just change to update the hash table - without the need to re-insert - it's already there!! Also, you - don't want to g_hash_table_insert the new value with the same key - without at least first removing the existing bucket. And, you - certainly don't want to g_free() the key after you insert it - - eek!! - -2001-07-03 Sam Creasey <sammy@oh.verio.com> - - * mail-config.c (mail_config_set_show_preview): Replace value in - config->preview_hash when it already exists. Old code never - re-inserted into the hash, just assigned to val -- it's an int - here, not a real pointer. - -2001-07-03 Joe Shaw <joe@ximian.com> - - * mail-callbacks.c (expunge_folder): Unset the message being displayed - when expunging. This makes expunged messages not show in the preview - pane when they're not there anymore. Fixes #3591. - -2001-07-03 Joe Shaw <joe@ximian.com> - - * mail-callbacks.c (mail_reply): If msg is NULL, fetch the message - and requeue a mail_reply call. Fixes bug #3816. - (requeue_mail_reply): Callback from mail_get_message(). - -2001-07-03 Jeffrey Stedfast <fejj@ximian.com> - - * mail-config.c (mail_config_get_show_preview): Use a better - GHashTable technique that will hopefully solve some bugs and also - use _with_default bonobo-config call. - (mail_config_set_show_preview): No sense in removing the entry - from the hash table and then re-inserting it. Just reset the - value. - (mail_config_get_thread_list): Use the same logic. - (mail_config_set_thread_list): And again here. - -2001-07-03 Peter Williams <peterw@ximian.com> - - * mail-folder-cache.c (make_folder_name, make_folder_status): - Split make_string into these. - (update_idle): Use (name and status) instead of (wide and thin) - for the text. - -2001-07-03 Jason Leach <jleach@ximian.com> - - * folder-browser-ui.c: "Mark as Important" menu thingy here. - -2001-07-03 Peter Williams <peterw@ximian.com> - - * folder-browser.c (message_list_drag_data_get): Compile fixes. - #include errno.h and gnome-dialog-utils.h. s/dirname/tmpdir/ - -2001-07-03 Peter Williams <peterw@ximian.com> - - Prevent folders from appearing to have -1 new messages. Prevent - nonactive folders from updating the title bar. Make the title bar - update when switching to an already-opened folder. - - * mail-folder-cache.c (update_message_counts): Ignore the value - for 'unread' if it is -1. - (get_mail_info_receive): Same - (mail_folder_cache_note_folderinfo): Same. - (get_folder_info): Initialize 'fb' to NULL. - (mail_folder_info): Add 'fb' member. - (mail_folder_cache_note_fb): Change note_message_list to this. - (update_idle): Only update the ShellView if the active folder - browser is the same as the one that the MFI references. - (mail_folder_cache_set_folder_browser): New function. Use it to - set the active folder browser. NULL is okay. - (check_for_fb_match): Called from the above. If the MFI has the - new folder browser as its view, queue an update. - - * mail-folder-cache.h: Fix prototypes. - - * mail-callbacks.c (create_folders): Check if fi->url is nonnull. - - * folder-browser.c (got_folder): Change to use note_fb instead of - note_messge_list. - - * folder-browser-factory.c (control_activate): Set the folder - browser - (control_deactivate): Clear it here. - (fb_get_svi): Kill some inappropriately cut-n-pasted code. - -2001-07-03 Dan Winship <danw@ximian.com> - - * mail-config.glade: Rename some of the widgets in the news config - to not conflict with the mail config stuff, so the mail config - druid will work again. - -2001-07-03 Jeffrey Stedfast <fejj@ximian.com> - - * folder-browser.c (message_list_drag_data_get): Use mkdtemp if we - have it, else use mktemp but make the code safer than it was - previously. - - * mail-display.c (launch_cb): Free the template string if the - tempdir failed to be created. - - * folder-browser.c (message_list_drag_data_get): Hide the URL - passwd, auth, and params. - (folder_browser_copy): Same. - -2001-07-03 Dan Winship <danw@ximian.com> - - * mail-ops.c (filter_folder_filter): Don't pass a dirty exception - to camel_folder_sync. Fixes an IMAP filtering crash. - -2001-07-02 Sam Creasey <sammy@oh.verio.com> - - * mail-account-editor-news.c: Added an MailAccountEditorNews, for - NNTP configuratuion. Based on MailAccountEditor, but stripped. - - * Makefile.am: added mail-account-editor-news.c and - mail-account-editor-news.h to SOURCES if ENABLE_NNTP is defined. - - * mail-accounts.c (load_news): Moved this function, and fixed some - slight brokenness. - (news_edit): Added functional code using MailAccountEditorNews - (news_add): Added functional code using news_edit after - allocation. - - * mail-config.glade: news_editor_window widget added. Used by - MailAccountEditorNews. - - * mail-display.c (save_data_cb): Store the pathname used when - saving messages so that the next save box will default to the - previous path. - - * message-browser.c (message_browser_new): add signal handler for - size_allocate on the message browser. Thus new windows are size - as they were last allocated. - (message_browser_size_allocate_cb): handler to store allocations. - - * message-list.c (message_list_setup_etree): connect to the - info_changed signals for the state of the message_list->tree. - Save the folder state to disk, so that when additional - message_lists are created, they are consistant. e.g. the next - buttons do the same thing in the browser, and in the message - viewer after changing sorting options. - - * subscribe-dialog.c (build_tree): freeze sc->folder model while - building the tree. Not doing so takes a very long time over 40000 - newsgroups. - -2001-07-02 Jeffrey Stedfast <fejj@ximian.com> - - * mail-accounts.c (construct): Setup the Empty Trash On Exit - widgets. - - * mail-config.c (config_read): Option to emtpy trash on exit. - (mail_config_write_on_exit): Same. - (mail_config_set_empty_trash_on_exit): Set the option. - (mail_config_get_empty_trash_on_exit): Get the option. - - * component-factory.c (owner_unset_cb): Empty the trash folders if - the user set the "empty trash on exit" option. - -2001-07-02 Jeffrey Stedfast <fejj@ximian.com> - - * mail-callbacks.c (transfer_msg): Updated for the - mail_transfer_messages API. - - * folder-browser.c (message_list_drag_data_recieved): Update for - the mail_transfer_messages API. - (selection_received): Same. - - * mail-ops.c (mail_transfer_messages): Renamed from - mail_do_transfer_messages and also added a callback/data arguments - since we need it component_factory::xfer_folder. - - * component-factory.c (xfer_folder): Use mail_transfer_messages - instead. - (destination_folder_handle_drop): Update to pass in a NULL - callback arg and a NULL data argument to mail_transfer_messages. - -2001-07-02 Larry Ewing <lewing@ximian.com> - - * mail-display.c (save_part): move the saving logic out of save_cb - so that we can reuse it for the image saving code. - (save_cb): call save_part. - (save_url): new function to resolve an save an html url. - (image_save_as): save function for images and. Add it to the - link_menu, and add MASK_URL and MASK_SRC to the structure so that - we cans show the proper menus. - (html_button_press_event): call get_src as well to find external - urls references. Add popup masking. - -2001-07-02 Peter Williams <peterw@ximian.com> - - * README.async: Add a warning about how wrong this document is. - -2001-07-02 Peter Williams <peterw@ximian.com> - - * mail-folder-cache.h: New file. Protoypes for the Mail Folder - Cache, which provides a place for all the disparate pieces of the - mailer to save bits of information about a folder. Centralizes the - information display code. - - * mail-folder-cache.c: New file. Implements the Mail Folder Cache. - - * Makefile.am (evolution_mail_SOURCES): Add the - mail-folder-cache.{c,h} - - * folder-browser-factory.c (fb_get_svi): Copy of that absurdly - long-named function in mail-display.c that gets the - GNOME_Evolution_ShellView. - (control_activate): Set the ShellView for the folder cache. - - * folder-browser.c (got_folder): Tell the folder browser about - this folder. - - * mail-callbacks.c (create_folders): Tell the folder cache about - the new folders. - - * mail-local.c (reconfigure_folder_reconfigure): Don't unhook our - events as we no longer hook them up. - (register_folder_registered): Tell the folder cache about this - folder's place in the local storage. - (register_folder_register): No longer hook events; the Folder - Cache will do this. - (local_folder_changed, local_folder_changed_proxy): Move to - mail-folder-cache.c - (free_local_folder): No longer unhook events. - - * mail-ops.c (do_update_subfolders_rec): Instead of setting the - folder status ourselves, inform the Folder Cache about the - changes. - - * mail-tools.c (mail_tool_uri_to_folder): Replace danw's cache - with the new Mail Folder Cache. - (cache_folder, etc): removed. - -2001-07-02 Jeffrey Stedfast <fejj@ximian.com> - - * mail-accounts.c: #include widgets/misc/e-charset-picker.h since - it was moved there from libgal. - -2001-07-02 Peter Williams <peterw@ximian.com> - - * importers/evolution-mbox-importer.c (mbox_factory_fn): Kill - irritating "Returning" g_warning. - -2001-07-02 Dan Winship <danw@ximian.com> - - * mail-session.c (get_filter_driver): Implement this, based on - code that used to be in mail-ops.c - - * mail-ops.c (mail_load_filter_context, setup_filter_driver): - Moved into MailSession::get_filter_driver. - (filter_get_folder): Moved to mail-session.c - (mail_filter_folder, mail_filter_on_demand, mail_fetch_mail, - mail_send_mail, mail_send_queue): Remove FilterContext args, use - camel_session_get_filter_driver. - - * mail-send-recv.c (mail_send_receive, mail_receive_uri): - Remove FilterContexts - -2001-07-01 Chris Toshok <toshok@ximian.com> - - * subscribe-dialog.c (subscribe_dialog_gui_init): the FolderSearch - control is in a different dockitem now. - -2001-07-01 Dan Winship <danw@ximian.com> - - * mail-tools.c (update_unread_count): Ref the folder before - proxying the event, in case there's only one reference to it and - it gets unreffed before the other end of the event handler runs. - (update_unread_count_main): And unref it when we're done. - (mail_tool_uri_to_folder): Only hold the lock around the hash - table operations, not the entire function. Holding the lock the - whole time can cause deadlock when resolving vfolders, and the - CamelSession and CamelStore locks ensure that multiple threads - calling this function will end up with the same CamelFolder object - at the end anyway, so we just need to lock and re-check the cache - at the end before adding the folder to the cache. - -2001-06-30 Ettore Perazzoli <ettore@ximian.com> - - * folder-browser-ui.c: Get MailNext/MailPrevious to use - next-message.png and previous-message.png, respectively. Also - change Print to use print.png. - -2001-06-30 Jon Trowbridge <trow@ximian.com> - - * mail-display.c (make_popup_window): Changed to return the - created window. - (find_socket): Added. Copied from e-shell-view.c. The fact - that I'm copying this bit of code all over isn't cool. - (html_button_press_event): Properly destroy the popup window when - the widget inside the control is destroyed. - - * mail-callbacks.c (addrbook_sender): Added. Implements - the "Add sender to addressbook" right-click. (Bug #3645) - (find_socket): Added. Copied from e-shell-view.c. - - * folder-browser.c: Added "Add sender to addressbook" to - context_menu[]. - - * mail-display.c: (handle_embedded_address_object): Removed. - (on_object_requested): Removed handling for embedded address - objects. (Which was obsolete crap.) - -2001-06-29 Larry Ewing <lewing@ximian.com> - - * mail-display.c (html_button_press_event): remove redundant - logic. - - * mail-callbacks.c (create_msg_composer): make sure we show the - sig file. - -2001-06-29 Jeffrey Stedfast <fejj@ximian.com> - - * folder-browser-factory.c (control_deactivate): Turn folder - syncing back on here so that IMAP folders will sync without - needing to hit Send & Receive. - - * mail-callbacks.c (ask_confirm_for_only_bcc): Throw up the - confirmation dialog. - (composer_get_message): If the user only specified Bcc recipients, - prompt him/her to make sure we should continue and risk the server - adding an Apparently-To header. - - * mail-config.c (config_read): Read in config option for prompting - when only Bcc recipients are specified. - (mail_config_write_on_exit): Save the option. - (mail_config_get_prompt_only_bcc): New. - (mail_config_set_prompt_only_bcc): New. - -2001-06-29 Dan Winship <danw@ximian.com> - - * mail-account-gui.c (build_auth_menu): Take two authtypes lists, - "all", and "supported", and make the unsupported authtypes grayed - out in the menu rather than missing. - (source_type_changed, transport_type_changed, - service_check_supported): Update build_auth_menu calls. - -2001-06-29 Radek Doulik <rodo@ximian.com> - - * mail-account-gui.c (menu_file_save_cb): implemented plain saving - -2001-06-28 Radek Doulik <rodo@ximian.com> - - * mail-account-gui.c (load_signature): implemented plain load - (load_signature): use e_msg_composer_get_signature_html - -2001-06-28 Peter Williams <peterw@ximian.com> - - * mail-ops.c (mail_send_message): Revert fejj's Bcc header removal; - this unsets the BCC recipients and so doesn't send to the Bcc'd - people at all. - -2001-06-28 Jeffrey Stedfast <fejj@ximian.com> - - * mail-send-recv.c (free_send_data): The e_iterator_get() returns - a gconstpointer and we need a non-const BonoboControl so cast it. - - * mail-account-gui.c (mail_account_gui_new): - gui->check_html_signature is GtkToggleButton not a GtkCheckButton. - - * folder-info.c: Added some #include's to supress warnings. - -2001-06-28 Ettore Perazzoli <ettore@ximian.com> - - * mail-display.c: Fix case of labels in the `link_menu' so that it - is consistent with that of the other menus in Evolution - [i.e. "Copy Link Location" instead of "Copy Location" etc.]. - -2001-06-28 Ettore Perazzoli <ettore@ximian.com> - - * mail-display.c (invisible_selection_get_callback): New, signal - handler for "selection_get" on the GtkInvisible widget we use for - selections. - (invisible_selection_clear_event_callback): New, signal handler - for "selection_clear_event" on the same invisible widget. - (mail_display_init): Initialize the `selection' and `invisible' - members. Also, explicitly initialize all the other fields as - well. - (mail_display_destroy): Free `selection'. Destroy `invisible'. - (link_copy_location): Re-implemented to just make the mail display - become the owner of the primary selection. - (on_selection_get): Remove `#if 0'ed code. - (mail_display_new): Remove the `#if 0'ed code that would connect - selection stuff to the HTML widget. - (mail_display_new): Connect the signals and add the targets to the - invisible widget. - - * mail-display.h: New members `selection' and `GtkInvisible' in - `MailDisplay'. - -2001-06-28 Jeffrey Stedfast <fejj@ximian.com> - - * mail-config.c (mail_config_write_on_exit): Don't bother trying - to save the passwd if the url is NULL. - - * folder-browser.c (vfolder_mlist): Strip the mlist name to fix - bug #3732. - - * component-factory.c (destination_folder_handle_drop): Since we - have an exception variable, we might as well use it when getting - folders too. - - * folder-browser.c (message_list_drag_data_recieved): Call - gtk_drag_finish. - -2001-06-28 Dan Winship <danw@ximian.com> - - * mail-tools.c (mail_tool_uri_to_folder): After finding a folder, - attach to its "folder_changed" and "message_changed" signals. - (update_unread_count, update_unread_count_main): Moved here from - folder-browser but basically unchanged. Doing this here lets us - get folder tree updates for folders that have had messages - moved/copied/filtered into them, but which don't yet have a view - associated with them. - - * folder-browser.c (update_unread_count, update_unread_count_main, - etc): Moved to mail-tools.c - -2001-06-28 Radek Doulik <rodo@ximian.com> - - * mail-config.c: use new fields everywhere - - * mail-config.h: as below - - * Mail.idl: added html_signature and has_html_signature - -2001-06-28 Ettore Perazzoli <ettore@ximian.com> - - * component-factory.c (component_fn): Register for the "mailto" - schema. - (handle_external_uri_cb): Callback for the "handle_external_uri" - signal. - (component_fn): Connect it. - -2001-06-27 Ettore Perazzoli <ettore@ximian.com> - - * component-factory.c (component_fn): Pass NULL as the - @external_uri_schemas argument to - `evolution_shell_component_new()'. - -2001-06-27 Peter Williams <peterw@ximian.com> - - * folder-browser-ui.c: Uncomment EditSelectThread. Yaay! - - * mail-callbacks.c (select_thread): New function. Self-explanatory - name. Implementation is a little hairy. - - * mail-callbacks.h: Prototype it here. - - * mail-callbacks.c (invert_selection): Here too. - (select_all): Here too. - - * subscribe-dialog.c (subscribe_select_all): Update to use new - ETree accessors. - (subscribe_invert_selection): Here too. - -2001-06-27 jacob berkman <jacob@ximian.com> - - * folder-browser.c (save_cursor_pos): work around an e-tree bug - -2001-06-27 Jeffrey Stedfast <fejj@ximian.com> - - * folder-browser.c: Fixed Cut/Copy/Paste to work - it turns out I - couldn't share a single GtkInvisible between all the - FolderBrowser's after all. - -2001-06-27 Peter Williams <peterw@ximian.com> - - * folder-browser-factory.c (control_deactivate): Change to use - more reality-based API below. - Include folder-browser-ui.h too. - (control_activate): Remove now-unused 'int state'. - - * folder-browser-ui.h: Changed prototypes to match changes below. - - * folder-browser-ui.c (folder_browser_ui_rm_message): Commented out - to reflect reality of how this stuff works (you can't actually remove - the pieces). - (folder_browser_ui_rm_global): Same. - (folder_browser_ui_rm_list): Left because here we add the view menus. - (folder_browser_ui_add_list): ... which were moved here. - (folder_browser_ui_rm_all): New function, does the job of old ui_rm() - -2001-06-26 Peter Williams <peterw@ximian.com> - - * folder-browser-ui.c: New file derived from - folder-browser-factory.c. Contains the Bonobo UI code, split into - three groups as described in ui/ChangeLog. Also contains the - GalView stuff and the hookups into the Bonobo UI stuff. - - * folder-browser-factory.c: Move most of the UI stuff to - folder-browser-ui.c. - (control_activate): Add all three kinds of UI element to this - folderbrowser. - (control_deactivate): Remove all three kinds. - - * folder-browser-ui.h: New file. Prototypes functions to add UI - elements to a FolderBrowser. - - * Makefile.am: Add folder-browser-ui.{c,h} - - * message-browser.c (PARENT_TYPE): Change to BONOBO_TYPE_WINDOW - (message_browser_destroy): Chain to parent destroy function. - (set_bonobo_ui): New function. Add the 'message' functions from - the folder browser to our UI. - (message_browser_close): BonoboVerbify this. - - * message-browser.h: Convert to BonoboWindow. - -2001-06-26 Jeffrey Stedfast <fejj@ximian.com> - - * folder-browser.c (my_folder_browser_init): Helps if I spell - "received" correctly. - - * mail-config.c (mail_config_set_thread_list): If the value is - already in the hash table, first remove it before setting the new - value so we don't leak. - (mail_config_set_show_preview): Same. - -2001-06-26 Dan Winship <danw@ximian.com> - - * mail-mt.c (op_status_timeout): Don't pop up a progress dialog to - say "I already finished this a while ago". - - * component-factory.c (storage_create_folder): Pass the path - prefix to folder_created so it can add it to the folder tree in - the right place. - - * mail-callbacks.c (folder_created): Take a path prefix. - -2001-06-26 jacob berkman <jacob@ximian.com> - - * mail-config.c (mail_config_get_show_preview): make ettore stop - complaining so i can get back to work - -2001-06-26 Jeffrey Stedfast <fejj@ximian.com> - - * component-factory.c (message_rfc822_dnd): No longer returns a - gboolean and also takes a CamelException. - (destination_folder_handle_drop): Do better error checking. - - * folder-browser.c (my_folder_browser_init): Connect to the - tree-drag-data-recieved signal. - (message_list_drag_data_recieved): New function that handles the - recieving end of the DnD event. - (x_evolution_message_parse): New convenience function to parse the - x-evolution-message type so that the cut/paste and DnD code can - share it. - (selection_received): Use x_evolution_message_parse(). - - * mail-config.c (config_read): Read in the default show_preview - value. - (mail_config_write_on_exit): Save the default show_preview value - as well as saving the individual settings for each URI that has - been changed. - -2001-06-25 Joe Shaw <joe@ximian.com> - - * folder-browser.c (invisible_destroyed): Check to make sure that - clipboard_selection is non-NULL before we g_byte_array_free() it. - -2001-06-25 jacob berkman <jacob@ximian.com> - - * mail-send-recv.c (free_send_data): sync folders after we've - gotten mail - - * folder-browser-factory.c (control_activate): set the ui - component on the folder browser - (control_activate): update the view preview item - (control_deactivate): don't sync the folder here - (control_deactivate): unset the ui component of the folder browser - - * mail-callbacks.c (toggle_flags): stuff from jleach to add an - importance keybinding - (mark_as_important): ditto - (toggle_as_important): again - - * mail-config.c (mail_config_get_show_preview): - (mail_config_set_show_preview): basically a copy of - get_thread_list() but for the preview pane - - * folder-browser.c (folder_browser_destroy): unref the our ui - component - (folder_browser_set_ui_component): new function for setting the ui - component - (save_cursor_pos): - (set_cursor_pos): try to show the selected row when the preview - pane is shown - (folder_browser_set_message_preview): implement - (folder_browser_toggle_preview): toggle the preview (duh) - (on_key_press): add keybindings for marking as important (!), and - hiding the preview pane (q) - (etree_key): clean up a little bit, and make enter either show the - preview pane or open the message - (fb_resize_cb): only save the paned size if the preview is alread - shown - (folder_browser_gui_init): pass ourselves to fb_resize_cb - (on_message_selected): only add the timeout if the preview is - shown - -2001-06-25 Jeffrey Stedfast <fejj@ximian.com> - - * folder-browser.c (folder_browser_destroy): Unref the invisible - window that we use for slections. - (folder_browser_class_init): Init the clipboard_atam type. - (selection_get): New - (selection_clear_event): New - (selection_received): New - (folder_browser_copy): New function to copy the message-list - selection. - (folder_browser_cut): New function to cut the message-list - selection. - (folder_browser_paste): New function to paste the message-list - selection. - (my_folder_browser_init): Initialize `invisible` if it's NULL else - ref it - also set some signals on it. - - * folder-browser-factory.c: Added verbs for cut/copy/paste. - -2001-06-23 Jason Leach <jleach@ximian.com> - - * mail-local.c (local_storage_removed_folder_cb): Fixes here for - removing folders. - - * mail-ops.c (remove_folder_get): Some fixes in here too. - -2001-06-22 Jeffrey Stedfast <fejj@ximian.com> - - * mail-config.c (config_read): Duh, we saved the charset as - "default_charset", not "charset" - no wonder the correct charset - menu item was never being set. - -2001-06-21 Jeffrey Stedfast <fejj@ximian.com> - - * mail-ops.c (mail_send_message): Temporarily remove the Bcc - header before sending the message. - -2001-06-21 Jon Trowbridge <trow@ximian.com> - - * mail-display.c (html_button_press_event): Remove empty "name" - property setting from the popup control. - -2001-06-21 Jeffrey Stedfast <fejj@ximian.com> - - * mail-callbacks.c (composer_get_message): Allow the message to be - sent even if there are no To recipients but only as long as there - are other recipients defined. - -2001-06-21 Jason Leach <jleach@ximian.com> - - * component-factory.c (mail_remove_storage): Deregister the - storage from the shell so it will get removed from the folder - tree. - -2001-06-20 Kjartan Maraas <kmaraas@gnome.org> - - * folder-browser.c: More than one accel key is a tad - confusing. - -2001-06-19 Jeffrey Stedfast <fejj@ximian.com> - - * mail-display.c: #include "folder-browser-factory.h" - - * component-factory.c (mail_remove_storage): New function to - remove an EvolutionStorage. - - * mail-accounts.c (mail_delete): Remove the storage from the - folder-tree. - (news_delete): Same. - -2001-06-19 Jeffrey Stedfast <fejj@ximian.com> - - * component-factory.c (destination_folder_handle_drop): Accept - text/uri-list mime types - this allows us to drag messages from - Nautilus into an Evolution folder. - - * folder-browser.c (message_list_drag_data_get): Do cleanup and - better error handling. - -2001-06-19 Jon Trowbridge <trow@ximian.com> - - * mail-tools.c (mail_tool_do_movemail): Properly clean up the - movemail files when no mail was received. - -2001-06-19 Radek Doulik <rodo@ximian.com> - - * mail-format.c (write_field_row_begin): add column with - between header name and value - (write_field_row_begin): hmm, use just bold as it looks - better - -2001-06-18 Jeffrey Stedfast <fejj@ximian.com> - - * component-factory.c (destination_folder_handle_drop): Use a nice - switch statement and use the new enum values. - - * mail-callbacks.c (list_add_addresses): Now takes a hash table of - already-used-recipients so that we don't get duplicates. - (mail_generate_reply): Pass in a rcpt_hash argument to - list_add_addresses(). These changes fix bug #1639. - -2001-06-18 Dan Winship <danw@ximian.com> - - * Makefile.am (evolution_mail_LDADD): Remove DB3_LDADD - -2001-06-18 Jeffrey Stedfast <fejj@ximian.com> - - * component-factory.c: Change the drop-type "x-evolution-dnd" to - "x-evolution-message" since we want to be able to DnD more than - one data type ;-) - - * folder-browser.c: Change supported DnD drop types to disclude - URI_LIST as that seems to crash Nautilus and seems overly - complicated. Since I am going to be supporting message/rfc822, - hopefully Nautilus can handle that or else maybe something like - text/plain. - (message_list_drag_data_get): Remove the code for URI_LIST. - -2001-06-14 Not Zed <NotZed@Ximian.com> - - * mail-tools.c (mail_tool_uri_to_folder): If we have a fragment in - the url, use that as the folder name, and not the path component. - -2001-06-13 Not Zed <NotZed@Ximian.com> - - * component-factory.c (mail_load_storages): Added temp hack to let - spool providers show up in the list. - -2001-06-16 Jeffrey Stedfast <fejj@ximian.com> - - * folder-browser.c (my_folder_browser_init): Allow user's to - "copy" drag & drop rather than just "move". - -2001-06-15 Jeffrey Stedfast <fejj@ximian.com> - - * component-factory.c (destination_folder_handle_drop): Implemented. - - * message-list.c (message_list_construct): Don't connect to the - DnD signals here. - (message_list_drag_data_get): Removed. - (add_uid): Removed. - - * folder-browser.c (my_folder_browser_init): Connect to DnD signals. - (message_list_drag_data_get): Implemented. - -2001-06-15 Jeffrey Stedfast <fejj@ximian.com> - - * mail-ops.c (mail_send_message): Fixed misuse of an uninitialized - variable. - - * component-factory.c (destination_folder_handle_drop): Implemented. - - * mail.h: Added prototype for evolution_folder_info_factory_init. - - * mail-ops.c (mail_do_transfer_messages): Now takes a const char* - as the dest_uri. This works better all around since we strdup'd - the string anyway. - -2001-06-15 Dan Winship <danw@ximian.com> - - * mail-format.c (mail_format_mime_message): We can't output - "<html>" and "</html>" here because it gets called recursively to - display message/rfc822 subparts. - (mail_format_raw_message): Add padding to match the formatted - display. - - * mail-display.c (mail_display_redisplay): Move rodo's html header - changes from mail_format_mime_message to here. - -2001-06-14 Jeffrey Stedfast <fejj@ximian.com> - - * folder-browser.c (got_folder): Updated to reflect changes to - mail_config_[g,s]et_thread_list(). - (folder_browser_toggle_threads): Same. - - * folder-browser-factory.c (control_activate): Updated to reflect - changes to mail_config_[g,s]et_thread_list(). - - * mail-config.c (mail_config_write_on_exit): Do cleanup when we're - done. - (mail_config_set_thread_list): Send in a URI so we can save the - state on a per-folder basis. - (mail_config_get_thread_list): Send in a URI so we can retrieve - the state on a per-folder basis. - - * component-factory.c: Setup the accepted_dnd_types. Also added - skeleton code for DnD. - -2001-06-14 Jeffrey Stedfast <fejj@ximian.com> - - * folder-browser-factory.c: Add Reply-to-List bonobo verbs. - - * folder-browser.c: Add Reply-to-List menu items. - - * mail-callbacks.c (mail_reply): Use an enum for specifying the - reply mode, becaus enow we can reply-to-list. - (reply_to_list): Implement. - (reply_to_sender): Use REPLY_SENDER. - (reply_to_all): Use REPLY_ALL. - (mail_generate_reply): Handle the different modes. - -2001-06-12 JP Rosevear <jpr@ximian.com> - - * Makefile.am: Remove folder-info.h until iain checks it in - -2001-06-12 Not Zed <NotZed@Ximian.com> - - * mail-account-gui.c (source_type_changed): Setup default spool - location same as for mbox mail retrieval. - -2001-06-08 Dan Winship <danw@ximian.com> - - * folder-browser-factory.c: fix some commands to match the ui file - again. - -2001-06-07 Iain Holmes <iain@ximian.com> - - * GNOME_Evolution_Mail.oaf.in: Add server info for FolderInfo - Remove server info for the Summary server - - * Mail.idl: Add a FolderInfo interface to retreive information about - a mail folder. - - * Makefile.am: Remove the executive summary stuff. Add the folder-info - files. - - * component-factory.c: Remove the mail-summary.h include. - Remove summary_factory. - (summary_fn): Remove. - (component_factory_init): Remove the summary_factory creation. - Initialise the info_factory. - -2001-06-08 Jon Trowbridge <trow@ximian.com> - - * mail-ops.c (mail_send_message): Reattach X-Evolution-Account - information to the message after sending it. This way it can - be used to set the identity properly if we later Resend the - message. - - * mail-tools.c (mail_tool_get_local_movemail_path): If you had - multiple accounts that used mboxes, and if you received mail in N - of those accounts, you would get N copies of each of your e-mail - messages. This is because everything was being dumped into one - big file by movemail, and the filters would run on that file N - times. To work around this, each mbox account now gets its own - distinct temporary movemail file. - -2001-06-07 Jon Trowbridge <trow@ximian.com> - - * mail-ops.c (fetch_mail_fetch): Pass the original source URI - to camel_filter_driver_filter_mbox. - (mail_send_message): Pass NULL as the orginal source URI - to camel_filter_driver_filter_message. - -2001-06-06 Jon Trowbridge <trow@ximian.com> - - * mail-account-gui.c (source_type_changed): Check that the chain - of deferences in gui->account->source->url is safe. This was - causing a segfault when adding a new account if any of the - existing accounts had their sources set to "None". - (i.e. gui->account->source == NULL) - - * mail-accounts.c (load_accounts): Check that account->source != - NULL before dereferencing it. - (load_accounts): The selection is cleared when the account clist - is rebuilt (say after a call to add), but no unselect event is - emitted. Yes, the clist is evil. We work around this by - explictly calling mail_unselect, our unselect signal handler. - (Otherwise, the edit and delete buttons remain sensitive and - accounts_row != 0, but the user can't see which row the dialog - thinks is selected.) - (load_news): Check the account->source != NULL before - dereferencing it. - (mail_unselect): If an insensitive button in a button box has the - focus, and if you hit tab, there is a segfault deep inside of gtk. - This is probably a gtk bug. We work around it by having the add - button (which is always sensitive) grab the focus on an unselect. - -2001-06-05 Jason Leach <jleach@ximian.com> - - (Fix bug #3211: Should undelete when flagging a delete message as - important) - - * message-list.c (on_click): When flagging a message as important, - check to see if it's flagged as deleted, if so, undelete it. - - (Fix bug #314: Display URLs in statusbar on mouseover) - - * mail-display.c (html_on_url): New function, callback for - GtkHTML's "on_url" signal. - -2001-06-05 Radek Doulik <rodo@ximian.com> - - * mail-format.c: make HTML and plain mails to have the same - boundary - -2001-06-03 Ettore Perazzoli <ettore@ximian.com> - - * Makefile.am (evolution_mail_LDADD): Move `$(DB3_LDADD)' before - libeutil. - -2001-06-01 Federico Mena Quintero <federico@ximian.com> - - * folder-browser.h (FolderBrowser): Added fields for the - GalViewMenus and GalViewCollection, since we need to keep them - around while the component is active. - - * folder-browser-factory.c (folder_browser_setup_view_menus): Plug - leaks; unref the spec and factory. Set the view collection and - the view menus on the FolderBrowser object. - (folder_browser_discard_view_menus): New function. - (control_deactivate): Discard the menus. - - * folder-browser.c (folder_browser_destroy): Destroy the view - collection and the view menus. - -2001-06-01 Ettore Perazzoli <ettore@ximian.com> - - * Makefile.am (evolution_mail_LDADD): Add `$(DB3_LDADD)'. - -2001-06-01 Jeffrey Stedfast <fejj@ximian.com> - - * mail-account-gui.c (mail_account_gui_save): Save the pgp and - smime settings. - (mail_account_gui_new): Setup the pgp and s/mime page (but disable - the s/mime frame if we are not compiled with s/mime support). - - * mail-config.c (account_copy): Updated to save extra pgp and - smime options. - (account_destroy): Free draft/sent folder info and also the new - pgp/smime keys. - (config_read): Read in the pgp and s/mime config options. - (mail_config_write): Save the account pgp and smime options. - -2001-06-01 Jeffrey Stedfast <fejj@ximian.com> - - * mail-account-gui.c (source_type_changed): Call - build_extra_conf() here too. This is when we REALLY want to call - it anyway, not on switch-page because then we'd lose any data on - the Receive Options page if we never switch to that page before - applying the changes. - - * mail-account-editor.c (construct): Don't connect to the - switch-page event, instead just call build_extra_conf() here with - the source->url. - -2001-06-01 Dan Winship <danw@ximian.com> - - * mail-config.c (config_read): Fix dumb misuse of g_get_charset. - -2001-05-31 Jeffrey Stedfast <fejj@ximian.com> - - * mail-format.c (handle_multipart_signed): Removed the code to - check for the validity of an S/MIME part. Stuff works differently - now. - - * mail-crypto.c: Rewrote how the S/MIME stuff is going to work. - -2001-05-30 Dan Winship <danw@ximian.com> - - * mail-config.glade: Rename the "PGP" page back to "Other" and add - a "default charset" option menu. - - * mail-config.c (config_read, mail_config_write_on_exit, - mail_config_get_default_charset, mail_config_set_default_charset): - Handle "default charset". - - * mail-accounts.c (construct): Fill in the "default_charset" menu - with an e_charset_picker menu. - (charset_menu_deactivate): Update the default charset. - -2001-05-29 Jeffrey Stedfast <fejj@ximian.com> - - * mail-callbacks.c (list_add_addresses): Take another argument to - ignore a certain address. - (mail_generate_reply): Ignore references to the reply-to address - when constructing the Cc list. - -2001-05-29 Jason Leach <jleach@ximian.com> - - * message-browser.c (message_browser_new): one-line fix for bug - #2536: File->Close in message viewer doesn't work. - (message_browser_new): Also replaced like 4 lines of code with a - one-liner featuring gnome_app_create_toolbar_with_data(). - -2001-05-28 Jason Leach <jleach@ximian.com> - - * mail-local.c (load_metainfo): Don't need to check if (foo!=NULL) - before doing an xmlFreeDoc(). - -2001-05-28 Dan Winship <danw@ximian.com> - - * mail-format.c (write_text_header): Fix a bug that could cause a - crash on messages with an empty subject. Oops. - -2001-05-27 Jeffrey Stedfast <fejj@ximian.com> - - * message-list.c: Removed the etable spec string. - (message_list_construct): Load the etable spec from a file. - - * folder-browser-factory.c: Load the etable spec from the file, - not a string. - - * Makefile.am: Add message-list.etspec to be installed. - - * message-list.etspec: New file containing the ETable file - specification. - - * mail-config.h: Prototype evolution_mail_config_get_type. - -2001-05-27 Dan Winship <danw@ximian.com> - - * folder-browser-factory.c: #include - "evolution-shell-component-utils.h" rather than "e-gui-utils.h" - for e_pixmaps_update. - - * subscribe-dialog.c: Likewise. - -2001-05-26 Jeffrey Stedfast <fejj@ximian.com> - - * mail-format.c (try_inline_pgp_sig): Fix to work properly. - (handle_multipart_signed): Fixed a bug that caused some - multipart/signed messages to be handled by the multipart_mixed - handler. - -2001-05-25 Jeffrey Stedfast <fejj@ximian.com> - - * folder-browser-factory.c: Added callbacks for Next/Previous - Unread and Next/Previous Flagged message. - - * mail-callbacks.c (previous_flagged_msg): Implemented. - (next_flagged_msg): Implemented. - -2001-05-26 Dan Winship <danw@ximian.com> - - * mail-ops.c (mail_send_message, transfer_messages_transfer, - set_offline_do): When unreffing a folder we got ourselves (as - opposed to one passed in by the caller), sync before unreffing, - since we might be holding the only reference to it. - (mail_refresh_folder): New op, like mail_sync_folder, but does a - camel_folder_refresh_info instead. - - * folder-browser-factory.c (control_activate): Call - mail_refresh_folder, not mail_sync_folder. (The goal is to see new - messages: sync used to work with imap because imap_sync was - broken, but it doesn't work for that any more.) - -2001-05-25 Peter Williams <peterw@ximian.com> - - * Makefile.am: Reference libeshell.la instead of libeshell.a. - -2001-05-25 Jeffrey Stedfast <fejj@ximian.com> - - * folder-browser-factory.c (control_activate): Disable Resend on - non-Sent folder FolderBrowsers. Thanks to Wayne Davis for this - patch. - - * component-factory.c (xfer_folder): This code should be correct - now. Still waiting on the shell to do it's job of creating the - metadata xml file in the destination folder though. - -2001-05-24 Jeffrey Stedfast <fejj@ximian.com> - - * message-list.c (message_list_select_uid): g_strdup the uid into - the ml->cursor_uid. - - * message-browser.c (message_browser_forward_msg): Use the default - forward style. - -2001-05-24 Dan Winship <danw@ximian.com> - - * mail-identify.c (mail_identify_mime_part): If the message data - is online, sniff the data for a MIME type first, and use the - filename second. Makes it more reliable, and deals with the - specific case of "application/octet-stream; name=foo.vcf" which - gnome-vfs will identify as vcalendar, but which can also be a - vcard. - -2001-05-24 Jeffrey Stedfast <fejj@ximian.com> - - * mail-format.c (try_inline_pgp_sig): Only write the message up to - (but not including) the attached signature block. - -2001-05-23 Jeffrey Stedfast <fejj@ximian.com> - - * mail-callbacks.c (composer_postpone_cb): Don't free the - folder-info here, instead have mail_append_mail() call our new - function, append_mail_cleanup() which'll free the - folder-info. This fixes the problem of send-later segfaulting. - - * message-list.c (message_list_set_folder): Make the message-list - respect the "hide deleted messages" setting. Fixes bug #2248. - - * component-factory.c (xfer_folder): New function that the shell - component calls to copy/move a folder. - (component_fn): Set the xfer_folder_fn argument. - - * mail-ops.c (mail_remove_folder): New async function to remove a - folder. God knows if it does what the ShellComponent needs or not - yet. - (mail_xfer_folder): Yet another yummy async function to move or - copy a folder to a new location. - - * component-factory.c (storage_remove_folder): New function for - removing folders. - (remove_folder): New function that the shell component calls to - delete a folder. - (component_fn): Set the remove_folder_fn argument. - -2001-05-22 Jeffrey Stedfast <fejj@ximian.com> - - * mail-config.c (mail_config_write_on_exit): Save the - message-display style. - (config_read): Read the message-display style. - -2001-05-22 Dan Winship <danw@ximian.com> - - * mail-display.c (on_url_requested): If http mode is - HTTP_SOMETIMES, use e_book_query_address_locally to check the From - address and load images if it's found. - - * mail-config.c (config_read): Default http_mode to - MAIL_CONFIG_HTTP_SOMETIMES. Fix typo to make default forward style - actually work. - -2001-05-22 Jeffrey Stedfast <fejj@ximian.com> - - * Makefile.am: Use MAILER_CFLAGS and MAILER_LIBS. - - * message-browser.c (message_browser_folder_loaded): Instead of - calling message_list_select_uid() here, instead connect to the - "message_list_loaded" signal since the message-list is not built - yet at this point. - (message_browser_message_list_built): Call - message_list_select_uid() here instead. - - * message-list.c: Lets have a new signal, MESSAGE_LIST_BUILT, that - gets emitted when the message-list has finished being built by one - of the built_*() functions. - (message_list_class_init): Setup the signal stuff. - (regen_list_regened): Emit the signal here (should this perhaps be - moved into each of the build_*() functions instead?). - -2001-05-21 Kjartan Maraas <kmaraas@gnome.org> - - * mail-local.c: Mark a string for translation. - -2001-05-18 Jon Trowbridge <trow@ximian.com> - - * Makefile.am (evolution_mail_LDADD): Added libebook.la (which is - now required by the composer.) - -2001-05-17 Dan Winship <danw@ximian.com> - - * mail-callbacks.c (composer_postpone_cb): mark Outbox messages as - read. - -2001-05-17 Jeffrey Stedfast <fejj@ximian.com> - - * mail-format.c (mail_write_authenticity): New convenience - function for all signature verification functions to use to - display whether or not the signed part was authentic. - (try_inline_pgp_sig): Use mail_write_authentic(). - (handle_multipart_signed): Add code to handle S/MIME - multipart/signed parts and also use mail_write_authenticity(). - -2001-05-17 Dan Winship <danw@ximian.com> - - * mail-config.glade: add new icons from jimmac. - -2001-05-16 Dan Winship <danw@ximian.com> - - * mail-format.c (mail_format_raw_message): add - E_TEXT_TO_HTML_ESCAPE_8BIT to the flags - -2001-05-16 Dan Winship <danw@ximian.com> - - * folder-browser.c (folder_browser_is_drafts, - folder_browser_is_sent, folder_browser_is_outbox): Functions to - determine if a folderbrowser is one of the drafts, sent, or outbox - folders. - (got_folder): Pass TRUE for the "outgoing" flag to - message_list_set_folder if this is a Sent, Drafts, or Outbox - folder. - - * message-list.c (message_list_set_folder): Take a flag saying - whether or not the folder is an "outgoing" folder. - (message_list_setup_etree): Ditto. Use that rather than a - hardcoded list of foldernames for deciding whether to swap From - and To in the default layout. - - * mail-config.c (mail_config_folder_to_cachename): Make IMAP - folders have unique cachenames rather than only one per store, so - that IMAP Sent and Drafts folders don't get forced into having the - same layout as the INBOX. - - * mail-callbacks.c: (is_sent_folder, is_drafts_folder): Gone. - Replaced with simpler folder_browser_is_* routines. - (edit_msg, resend_msg, open_msg): Use folder_browser_is_* - routines. - - * mail-local.c (reconfigure_clicked): Update call to - message_list_set_folder. - -2001-05-16 Jeffrey Stedfast <fejj@ximian.com> - - * mail-crypto.c (mail_crypto_is_smime_v3_signed): Removed (this - now exists in camel/camel-smime.c). - (mail_crypto_is_pkcs7_mime): Same. - (mail_crypto_smime_part_sign): new - (mail_crypto_smime_part_verify): new - (mail_crypto_smime_part_encrypt): new - (mail_crypto_smime_part_decrypt): new - (mail_crypto_pgp_mime_part_sign): Added code to set an exception - if the context fails to be created. - (mail_crypto_pgp_mime_part_verify): And here... - (mail_crypto_pgp_mime_part_encrypt): Same. - (mail_crypto_pgp_mime_part_decrypt): And here too. - -2001-05-16 Dan Winship <danw@ximian.com> - - * mail-display.c (mail_display_redisplay): Deal with full-header - mode in addition to source mode - - * mail-format.c (write_field_row_begin): Add WRITE_NOCOLUMNS flag - to write the header in a single table cell rather than two. Output - the second columns's "<td>" when not in NOCOLUMNS mode. Don't - include the ":" in the passed-in header name. - (write_date, write_address): Update for write_field_row_begin - changes. - (write_text_field): Genericified and updated from write_subject. - (write_headers): Deal with both normal and full-header mode. - -2001-05-15 Dan Winship <danw@ximian.com> - - * mail-display.c (on_url_requested): Load http images if the user - has force-loaded images too. - (mail_display_redisplay): Update for normal/headers/source changes. - (mail_display_load_images): New. Force HTTP image loading for the - current message. - - * mail-config.c (mail_config_get_message_display_style, - mail_config_set_message_display_style): Updated and renamed from - mail_config_{get,set}_view_source - - * mail-callbacks.c (load_images): New. - - * folder-browser.c (folder_browser_set_message_display_style): - Renamed and updated from folder_browser_toggle_view_source. - - * folder-browser-factory.c (verbs): Add ViewLoadImages. - (control_activate): Update for normal/headers/source change to - radio group. - -2001-05-15 Dan Winship <danw@ximian.com> - - * folder-browser-factory.c (verbs): Update for changes in - evolution-mail.xml (many commands were renamed to better match the - current menu layout). - (pixcache): Refer to commands via their paths in /commands/ - rather than hardcoding their menu paths. - -2001-05-14 Jon Trowbridge <trow@ximian.com> - - * mail-search.c (mail_search_construct): Put frame around dialog - vbox, put mail subject in that frame's label. (Patch by Duncan.) - (mail_search_set_subject): Break out subject-setting code. - Truncate long subjects with ellipses. - -2001-05-14 Duncan Mak <duncan@ximian.com> - - * mail-search.c (mail_search_construct): set the dialog's - window_icon to jimmac's new find_message.xpm. - -2001-05-13 Iain Holmes <iain@ximian.com> - - * Makefile.am: Make the LDADD line longer so it actually compiles - everything correctly. - -2001-05-14 Dan Winship <danw@ximian.com> - - * mail-config.glade: Split "Other" page into three pages, Display, - Composer, and PGP. Add HTML image stuff on the Display page and - default forward style on the Composer page. - - * mail-config.c (mail_config_get_default_forward_style, - mail_config_set_default_forward_style): User-specified default - style for forwarding messages. - (config_read, mail_config_write_on_exit): Deal with forward style. - - * mail-accounts.c: Handle HTML image display options and default - forward style. - - * mail-callbacks.c (forward): New. Forward in the user-selected - default style. - (forward_inline, forward_quoted): Simplify these some. Remove the - fallback to forward attached when forwarding multiple messages: it - should just forward the multiple messages inline or quoted in - those cases. (Which it doesn't yet, but that's a bug.) - - * folder-browser.c (context_menu): Remove "Forward inline" and - make "Forward" call forward() rather than forward_attached(). - - * folder-browser-factory.c: Update command/menu/toolbar/pixmap - gunk for the "MessageForwardAttached" vs "MessageForward" split. - - * mail-session.c (mail_session_get_type): - * mail-format.c (format_mime_part): - * mail-account-gui.c (setup_service): Fix warnings. - - * mail-mlist-magic.c: Remove this... it's not used any more. - - * folder-browser.c: - * message-browser.c: Remove references to mail-mlist-magic.h - -2001-05-14 Jon Trowbridge <trow@ximian.com> - - * folder-browser.c (folder_browser_config_search): Use secondary - searches here, so that we control the interference between the two - bits of searching UI. - -2001-05-13 Jon Trowbridge <trow@ximian.com> - - * mail-search.c (mail_search_construct): Destroy the MailSearch - dialog if the underlying MailDisplay is destroyed. I don't like - the way that label in the dialog with the message subject in it - looks, so I've #ifdef-ed it out for now. Center the Matches - label --- it makes the dialog look more balanced, I think. - (dialog_clicked_cb): Changed to reflect adjusted - ESearchingTokenizer API, using primary searches. - (toggled_case_cb): Use the primary search API. - - * e-searching-tokenizer.c: Make searching routines utf8-friendly. - Rationalize how the match begin/end markup is handled; allow for - begin/end markup that varies by search. Add concept of primary and - secondary matching, to disentangle possible interactions between - search-bar searches and search-dialog searches. - -2001-05-13 Jeffrey Stedfast <fejj@ximian.com> - - * mail-local.c (mail_local_storage_shutdown): Get rid of this - we - don't need it. - - * component-factory.c (owner_unset_cb): Don't unref the LocalStore - - we don't own a ref on it!! - -2001-05-12 Duncan Mak <duncan@ximian.com> - - * mail-search.c (begin_cb): Updates the subject on refresh and - sets subject to "Untitled Message" if subject is NULL. - (mail_search_construct): Moved msg_subject to its own GtkLabel, - sets subject to "Untitled Message" if subject is NULL. Give focus - to entry by default. Made <enter> in entry run - dialog_clicked_cb by setting gnome_dialog_editable_enters. - -2001-05-12 Gediminas Paulauskas <menesis@delfi.lt> - - * folder-browser-factory.c: load pixmaps for MessageCopy and - MessageForwardAttached. Thanks Wayne Davis <wfdavis@seas.upenn.edu> - for a patch. - -2001-05-11 Dan Winship <danw@ximian.com> - - * mail-display.c (load_http): callback to use GNOME-VFS to load - http data. - (on_url_requested): Handle http: URLs that refer to either MIME - parts or web data. - (mail_display_redisplay_when_loaded): Moved out of - mail_content_loaded and made more generic. - - * mail-format.c (add_url): Handle two different kinds of URLs - (URLs that point to CamelMimeParts and URLs that point to - GByteArrays). - (mail_content_loaded): Use mail_display_redisplay_when_loaded. - (format_mime_part): Renamed from "call_handler_function". Also, - record Content-Location if the part has one. (This is not yet 100% - correct: it doesn't deal with relative URLs at all.) - (handle_text_html): Use Content-Location URL rather than - Content-ID, when available (will help deal with relative URLs once - GtkHTML supports that better). - (etc): Update for changes. - - * mail-config.c (mail_config_get_http_mode, - mail_config_set_http_mode): get/set HTTP image downloading mode. - (config_read, mail_config_write_on_exit): save/load that data. - -2001-05-11 JP Rosevear <jpr@ximian.com> - - * mail-importer.h: add proto - - * mail-importer.c (mail_importer_uninit): release and unref the - local storage - - * mail-local.c (mail_local_store_finalize): use - bonobo_object_release_unref rather than doing Bonobo_Unknow_unref - and a corba release - (register_folder_registered): "sink" the local_store ref to - prevent circular ref - (mail_local_storage_shutdown): unref the local store - - * mail-local.h: new proto - - * component-factory.c (owner_unset_cb): uninit the importer and - shutdown the local storage - -2001-05-11 Jeffrey Stedfast <fejj@ximian.com> - - * mail-local.c (mail_local_reconfigure_folder): Set a title on the - window "Reconfigure %s" where %s is the folder name. Also, don't - allow more than one of these type windows to be opened per folder. - - * mail-tools.c (mail_tool_get_folder_name): Fix Danw's kludge to - actually work :-) - -2001-05-11 Martha Burke <martha@ximian.com> - - * gui/Makefile.am: sanitize LD_ADDS and CFLAGS so the libtool - lines are shorter (fixes problem on solaries due to sed) - -2001-05-11 Jeffrey Stedfast <fejj@ximian.com> - - * mail-vfolder.c (vfolder_edit): Don't allow multiple copies of - this to be run at a time. - - * mail-callbacks.c (providers_config): Don't allow multiple copies - of this to be run at a time. - (manage_subscriptions): Same, but this was a tad more kludgy since - we don't gnome_dialog_run_and_close() this one. I had to make the - widget a semi-global variable. yuck :\ - (filter_edit): Same. - -2001-05-11 Jon Trowbridge <trow@ximian.com> - - * e-searching-tokenizer.c (e_searching_tokenizer_new): - Remove a snippet of debugging code I left in by mistake. - -2001-05-11 Jeffrey Stedfast <fejj@ximian.com> - - * mail-callbacks.c (forward_inlined): If the cursor_uid is NULL, - then we can't forward anything so just return. - (forward_quoted): Same. - -2001-05-10 Jon Trowbridge <trow@ximian.com> - - * folder-browser.c (folder_browser_config_search): Use the - ESearchingTokenizer to highlight search matches for folder-level - searches. Still mildly broken, but it works for the simple cases. - - * mail-display.c (mail_display_new): Use our ESearchingTokenizer - for the mail display GtkHTML widget. - - * mail-search.c (dialog_clicked_cb): Use the ESearchingTokenizer to - highlight search matches. - (mail_search_construct): Add a match count to the search dialog. - - * e-searching-tokenizer.c - (e_searching_tokenizer_set_search_string): Added. A custom HTML - tokenizer that does highlighting of search strings. - - * mail-config.c: No, we don't want to include - bonobo-running-context.h... just bonobo-context.h. - -2001-05-10 Jeffrey Stedfast <fejj@ximian.com> - - * mail-config.c: Fix some compiler warnings by including the - correct bonobo headers and by using the correct bonobo types. - (config_read): Some fixes so that we can never have an empty - string as a URL. - -2001-05-10 Dan Winship <danw@ximian.com> - - * folder-browser.c (on_key_press): Don't advance to the next - undeleted message after "Delete"... - - * mail-callbacks.c (delete_msg): ...instead, do it here, whether - the user used Delete, Alt+D, or the toolbar. (But only if they - only deleted a single message.) - - * message-list.c (message_list_select): Don't clear the display on - failure. - (build_tree): Clear the display when the currently-selected - message stops existing and we don't have an obvious message to - select instead of it. (Eg, when deleting the last message with - "hide deleted messages" set, or expunging while a deleted message - is selected.) - -2001-05-09 Dan Winship <danw@ximian.com> - - * mail-offline-handler.c: New file, started by Ettore, finished by - me, to implement the GNOME_Evolution_Offline interface. - - * Makefile.am (evolution_mail_SOURCES): Add - mail-offline-handler.[ch] - - * mail-ops.c (mail_store_set_offline): Set a store online or - offline. - - * mail-send-recv.c (auto_timeout): Don't run auto-check-for-mail - while the session is offline. - - * component-factory.c (component_fn): Set up offline handler. - -2001-05-09 Christopher James Lahey <clahey@ximian.com> - - * importers/evolution-mbox-importer.c (load_file_fn): Made a const - char * here. - -2001-05-08 Iain Holmes <iain@ximian.com> - - * mail-config.[ch]: Moved all references to the Bonobo stuff into the .c file - -2001-05-08 Iain Holmes <iain@ximian.com> - - * mail-callbacks.c (filter_edit): Set the title of the dialog. - - * GNOME_Evolution_Mail.oaf.in: Add a reference for the MailConfig - interface stuff. - - * Mail.idl: Add the MailConfig interface, and a MailFilter interface. - - * component-factory.c (component_factory_init): Call - evolution_mail_config_factory_init. - - * mail-account-gui.c (setup_service): Just return if url == NULL, - don't crash. - - * mail-config.c: #include bonobo-object.h, #include Mail.h and define - the Config factory IID. - Implement the MailConfig interface with a BonoboObject. - (impl_GNOME_Evolution_MailConfig_addAccount): Convert the CORBA struct - into the correct MailConfig structures and add the account. - (evolution_mail_config_class_init): Initialise the class. - (evolution_mail_config_init): This function is intentionally left blank. - - (evolution_mail_config_factory_fn): Create an EvolutionMailConfig object - and return it. - (evolution_mail_config_factory_init): Set up the bonobo factory. - - * mail-config.h: #include bonobo-xobject.h and Mail.h - Declare the object structures. - - * importers/Makefile.am: Remove the intelligent importers. - - * importers/evolution-mbox-importer.c (folder_created_cb): Callback - from when the folder is created. Opens the folder and unrefs the - listener. - (load_file_fn): Create the folder if it doesn't exist. - -2001-05-08 Jeffrey Stedfast <fejj@ximian.com> - - * mail-tools.c (mail_tool_forward_message): Convert the Subject - header to HTML and also make sure that the Subject, To, and From - header values are non-NULL before feeding them into - e_text_to_html(). - - * mail-callbacks.c (edit_msg_internal): Free the UIDs if the user - decides to not go through with editing all the messages he - selected. - (resend_msg): If the user attempts to resend more than 10 - messages, make sure he really means it. - (do_resend_messages): Richard Zach feels that "Resend" should open - the message(s) in a composer since he might want to edit at least - the recipients (maybe he needs to resend because the message - bounced the first time) and Ettore wants pretty much the same - thing. This makes "Resend" basically the same as "Edit" but for - previously sent messages, whereas "Edit" is only for Drafts. - -2001-05-08 Gediminas Paulauskas <menesis@delfi.lt> - - * mail-search.c: convert search entry to utf8. - - * mail-local.c: d() debugging message. - - * mail-send-recv.c: replace " ..." with "..." - - * Makefile.am: removed EVOLUTION_VERSION. - -2001-05-07 Jeffrey Stedfast <fejj@ximian.com> - - * mail-account-gui.c: s/HAVE_NSS/HAVE_SSL for the SSL checkbox - stuff. - -2001-05-07 Dan Winship <danw@ximian.com> - - * folder-browser.c (my_folder_browser_init): Connect to - key_press_event on the GtkHTML widget. - (etree_key): Only handle space/backspace here, pass the rest off - to on_key_press. - (on_key_press): Handle Delete/N/P/Menu in either MessageList or - MailDisplay. - - * message-list.c (message_list_select): Grab focus if we don't - have it. - -2001-05-03 Dan Winship <danw@ximian.com> - - * message-list.c: #include <camel/camel-file-utils.h> - - * mail-ops.c (get_folderinfo_get): - * subscribe-dialog.c (build_tree): Update for - camel_store_get_folder_info prototype change. - - * mail-format.c (handle_text_plain_flowed): Improve more on the - fix from the other day: the first level of indentation adds blank - lines, but further levels don't... - -2001-04-30 Dan Winship <danw@ximian.com> - - * folder-browser.c (folder_browser_destroy): Unhook event handlers - before syncing the folder, since the folder browser will have been - destroyed by the time the sync thread completes and calls the - signal handlers. - -2001-04-29 Dan Winship <danw@ximian.com> - - * mail-format.c (handle_text_plain_flowed): Mojo this a bit so - that "\n\n>" gets translated to "<br><blockquote>" rather than - "<br><br><blockquote>", since the transition to blockquote mode - creates a blank line itself. Makes Mozilla-generated flowed - replies look better. - -2001-04-27 Dan Winship <danw@ximian.com> - - * mail-session.c: Renamed from session.c and made to be a subclass - of CamelSession. - - * mail-mt.c (mail_user_message): Renamed from mail_get_accept and - made more general-purpose, to implement the new - camel_session_alert_user. - -2001-04-26 Jeffrey Stedfast <fejj@ximian.com> - - * main.c (main): No need to camel_shutdown() anymore... - - * mail-callbacks.c (next_msg): Don't filter on Seen status. - (previous_msg): Same. - (next_unread_msg): New function that does what the old callback - next_msg callback did (only better named). - (previous_unread_msg): Same. - - * message-list.c (hide_load_state): Updated to use camel-file-util - routines. - (hide_save_1): Same. - (hide_save_state): And here too. - -2001-04-26 Dan Winship <danw@ximian.com> - - * Makefile.am (INCLUDES): Remove UNICODE_CFLAGS - - * mail-format.c (handle_text_plain_flowed): Use <font color=...> - to mark citations rather than italicizing them, which has never - looked very nice. Now this is more consistent with the non-flowed - case. - -2001-04-26 Jon Trowbridge <trow@ximian.com> - - * folder-browser-factory.c: Added "MessageSearch" verb. - - * mail-callbacks.c (search_msg): Added search callback. - (are_you_sure): Added some casts to fix compiler warnings. - - * mail-search.c: Added. A simple search-in-message widget, - that uses GtkHTML's searching capabilities. - -2001-04-25 Dan Winship <danw@ximian.com> - - * mail-callbacks.c (are_you_sure): New foot-shooting-prevention - helper function. - (edit_msg_internal, view_msg): If the user has more than 10 - messages selected, ask before opening them all in separate - windows, to protect against misclicks/typos after "select all" - (which we've had at least two reports of now). - -2001-04-25 Radek Doulik <rodo@ximian.com> - - * mail-tools.c (mail_tool_quote_message): set object data directly - in HTML source - - * mail-callbacks.c (mail_generate_reply): remove \n from citation - (mail_generate_reply): don't use e_msg_composer_mark_text_orig - -2001-04-24 Jeffrey Stedfast <fejj@ximian.com> - - * folder-browser.c: Added a new signal, "message_loaded" that gets - emitted when the message has been loaded and set on the - mail_display. - (folder_browser_class_init): Define the "message_loaded" signal - stuff. - (done_message_selected): Emit the "message_loaded" signal here. - - * message-browser.c (message_browser_next_msg): Do our own - message-list manipulation. We want the next message, not the next - unread message. - (message_browser_prev_msg): Same here but for previous. - (message_browser_new): Connect to the folder browser's - "message_loaded" signal. - (message_browser_folder_loaded): Don't connect to the - message-list's "message_selected" signal. - (message_browser_message_loaded): Nw callback which replaces the - old message_browser_message_selected callback's functionality. - -2001-04-24 Dan Winship <danw@ximian.com> - - * folder-browser.c: Add accelerators to the context menu. - (on_right_click): Use e_tree_get_cell_geometry and a - GtkMenuPositionFunc when responding to a Menu-key press so we can - line the menu up with the selected row rather than the cursor. - - * message-browser.c: include <gal/util/e-util.h> for E_MAKE_TYPE. - -2001-04-23 Jon Trowbridge <trow@ximian.com> - - * mail-display.c (html_button_press_event): Check for mailto: - links, and pop up our mail address menu when we find one. - (make_popup_window): The main piece of code (ignoring a zillion - little callbacks) to pop up our windows with reasonable semantics - for having them close automatically. - (mail_text_write): Enable converting addresses to mailto links - in message bodies. - - * mail-format.c (write_address): Simplify code, removing Radek's - <DATA> hacks. Write out addresses as mailto: links. - -2001-04-23 Jeffrey Stedfast <fejj@ximian.com> - - * mail-callbacks.c (do_view_message): Use the message-browser - widget rather than the mail-view window. - - * mail-view.c: Removed. - - * folder-browser.c: Added a folder_loaded signal. - - * message-browser.[c,h]: New window to solve all our message - browsing needs. This replaces mail-view.c. - - * message-list.c (message_list_select_uid): New function needed by - the new message-browser window. - -2001-04-23 Dan Winship <danw@ximian.com> - - * mail-callbacks.c (save_msg): Append a "/" to the result of - g_get_home_dir so gets the default dir it was supposed to. - -2001-04-22 Jeffrey Stedfast <fejj@ximian.com> - - * mail-ops.c (mail_send_message): Lets do proper refcounting on - the sent-folder. Also, g_strdup() the sent_folder_uri since we - later free it. If we don't, then we get lovely corrupt memory. - - * mail-crypto.c (mail_crypto_pgp_mime_part_sign): Make sure we - have a context before we try and use it. - -2001-04-22 Gediminas Paulauskas <menesis@delfi.lt> - - * folder-browser.c, mail-autofilter.c, mail-callbacks.c, - mail-ops.c, mail-summary.c, mail-vfolder.c: use system = - EVOLUTION_DATADIR "/file" instead of g_strdup_printf. Rename - userrules to user (and system) to be consistent. - - * mail-send-recv.c: set window icon to send-receive.xpm - -2001-04-21 Gediminas Paulauskas <menesis@delfi.lt> - - * mail-summary.c: translate "Mail summary". - -2001-04-20 Dan Winship <danw@ximian.com> - - * mail-config-druid.c (make_default_account): Convert the result - of g_get_real_name() from the locale charset to UTF8. Noted by - Petter Sundlöf (NOT "Petter Sundl_" :) - -2001-04-20 Jeffrey Stedfast <fejj@ximian.com> - - * mail-config.c (mail_config_set_pgp_type): Use a CamelPgpType. - (mail_config_get_pgp_type): Return a CamelPgpType. - (auto_detect_pgp_variables): auto-detect the user's pgp settings. - -2001-04-20 Dan Winship <danw@ximian.com> - - * mail-format.c (handle_text_plain): Fix a dumb thinko in my 04-11 - patch. - -2001-04-20 Kjartan Maraas <kmaraas@gnome.org> - - * mail-ops.c: (send_mail_desc): Convert subject from utf8 - before passing it on. - -2001-04-20 Gediminas Paulauskas <menesis@delfi.lt> - - * mail-display.c: #if 0'd out my not-working selection code - -2001-04-19 Dan Winship <danw@ximian.com> - - * mail-format.c (mail_format_raw_message): Make this more raw: - don't do URLs and citations. - -2001-04-18 Dan Winship <danw@ximian.com> - - * session.c (request_callback): Don't need to dup the string: the - relevant gnome-dialog routine already does. - - * message-list.c (message_list_destroy): Free the uid_nodemap. - (hide_save_state): Free the filename when we're done. - -2001-04-18 Jeffrey Stedfast <fejj@ximian.com> - - * mail-callbacks.c (is_sent_folder): Implemented. - (resend_msg): Use is_sent_folder(). - -2001-04-17 Dan Winship <danw@ximian.com> - - * mail-mt.c (mail_msg_check_error): Fix a memory leak. - -2001-04-16 Ettore Perazzoli <ettore@ximian.com> - - * importers/Makefile.am (INCLUDES): Add `$(EXTRA_GNOME_CFLAGS)' - here. - -2001-04-15 Jeffrey Stedfast <fejj@ximian.com> - - * mail-callbacks.c (mark_all_as_seen): Mark the messages as seen, - not unseen. - (is_drafts_folder): New function to attempt to determine if a - folder is a drafts folder. - (open_msg): Use is_drafts_folder(). - (edit_msg): And here. - (edit_msg_internal): New function that doesn't do the drafts - checking and is only to be used internally. This should save us - from having to doubly-check a folder to see if it's a drafts - folder when doing an Open on the message. - (open_msg): Call edit_msg_internal once we've established that the - folder is a drafts folder. - -2001-04-14 Jeffrey Stedfast <fejj@ximian.com> - - * mail-crypto.c (mail_crypto_pgp_mime_part_verify): Only use - non-NULL contexts. - (mail_crypto_pgp_mime_part_encrypt): Same. - (mail_crypto_pgp_mime_part_decrypt): And here too. - - * mail-format.c (try_inline_pgp_sig): Make sure to not use the - context if it is NULL. - (decode_pgp): Same. - - * folder-browser-factory.c: Added stuff for filtering/vfoldering - on mailinglists. - -2001-04-13 Dan Winship <danw@ximian.com> - - * Makefile.am (evolution_mail_LDADD): Remove some redundant LIBS - variables... purify complained that the command line was too - long. :-} - - * mail-account-gui.c: Plug leaks. - - * mail-display.c (on_url_requested): close the html stream on - error too. - - * mail-ops.c (fetch_mail_fetch): Move a line around that probably - doesn't affect anything, but it's correct. - - * session.c (auth_callback): Plug leak. - - * mail-send-recv.c (receive_status): Initialize "now". - -2001-04-13 Christopher James Lahey <clahey@ximian.com> - - * message-list.c (on_cursor_activated_cmd): Only activate the - message if the cursor has moved. - -2001-04-12 Christopher James Lahey <clahey@ximian.com> - - * message-list.c (e_mail_address_new): Updated this function to be - a correct full ordering. - (ml_has_get_node_by_id, ml_get_node_by_id): Implemented these - functions. - (find_next_undeleted): Changed this to find next sorted undeleted - message. Also, changed it so that if the current message is not - deleted, it returns NULL. - (build_tree, build_flat): Changed these to only set the cursor if - the cursor is changed. - - * subscribe-dialog.c: Changed this to pass NULL, NULL for - has_get_node_by_id and get_node_by_id. - -2001-04-12 Jeffrey Stedfast <fejj@ximian.com> - - * session.c (auth_callback): If the service is NULL, just use the - item as the key. - - * mail-crypto.c (mail_crypto_pgp_mime_part_sign): Use the - CamelCipherHash enum. - (mail_crypto_pgp_mime_part_verify): Use a CamelCipherValidity. - - * mail-format.c (try_inline_pgp_sig): Updated to use - CamelCipherValidity instead of CamelPgpValidity. - (handle_multipart_signed): Same. - -2001-04-12 Dan Winship <danw@ximian.com> - - * folder-browser.c (do_message_selected, on_message_selected): - Don't printf NULL - - * mail-format.c (mail_part_is_inline): Don't leak memory. - -2001-04-12 Jeffrey Stedfast <fejj@ximian.com> - - * mail-accounts.c (pgp_path_changed): Updated for changes to PGP - code. - - * component-factory.c (owner_set_cb): Don't init openpgp anymore - because we don't need it. - - * mail-crypto.c: Simply wrap the camel-pgp-mime functions (also - renamed the functions to be prefixed with mail_crypto). - - * mail-format.c (handle_multipart_signed): Update to use - camel_pgp_mime_is_rfc2015_signed() and other camel-pgp-mime - functions. - (handle_multipart_encrypted): Same but for rfc2015_encrypted. - (decode_pgp): Updated to use camel-pgp-context - (try_inline_pgp): Updated to use camel-pgp-context's. - (try_inline_pgp_sig): Same. - -2001-04-11 Dan Winship <danw@ximian.com> - - * mail-format.c (handle_text_plain): Only look for special - pseudo-multipart-isms (binhex, uucode, old pgp, etc) if the MIME - type is really text/plain. Otherwise, since there's no handler for - applciation/mac-binhex40, it gets sent to mail-identify.c, which - thinks it's text/plain because it starts with English words, and - so it gets sent back to the text/plain handler, which finds an - embedded binhex part... - - * mail-callbacks.c (do_view_message): mark messages as seen when - opening then in a separate window. - -2001-04-11 Jeffrey Stedfast <fejj@ximian.com> - - * openpgp-utils.c (openpgp_encrypt): Don't g_free the recipient - array members here because we free them in the caller. - -2001-04-11 Jeffrey Stedfast <fejj@ximian.com> - - * mail-crypto.c (pgp_mime_part_verify): Huh, somehow I forgot to - apply the from filter when verifying signed parts. Oh well, - probably not all that common. Fixed now though. - -2001-04-11 Jeffrey Stedfast <fejj@ximian.com> - - * mail-callbacks.c (save_msg): Use the homedir as the default - filename. - -2001-04-11 Christopher James Lahey <clahey@ximian.com> - - * message-list.c (save_tree_state, message_list_setup_etree): Save - the expanded state using the ETree built in expanded state code. - -2001-04-05 Not Zed <NotZed@Ximian.com> - - * Merge from evolution-0-10 to evolution-0-10-merge-0 into head. - -2001-04-04 Kjartan Maraas <kmaraas@gnome.org> - - * mail-account-gui.c: Add prototype for service_changed(). - * message-list.h: Remove #include <gal/e-table/e-tree-simple.h> - since it doesn't get installed. - -2001-04-04 Gediminas Paulauskas <menesis@delfi.lt> - - * mail-config-druid.c (create_html): set content type to utf8. - * mail-config.c (mail_config_check_service): fix warning. - * mail-display.c (link_open_in_browser): just call on_link_clicked(). - (link_menu): Open link works. - (link_copy_location): claim selection. - (on_selection_get): new function, selection handler. - (mail_display_new): connect to selection_get. FIXME: does not work. - -2001-04-04 Gediminas Paulauskas <menesis@delfi.lt> - - * component-factory.c: use big trash icon, stolen from mc. - -2001-04-03 Jeffrey Stedfast <fejj@ximian.com> - - * openpgp-utils.c (openpgp_encrypt): Add --no-tty argument to gpg. - -2001-04-03 Dan Winship <danw@ximian.com> - - * folder-browser-factory.c (control_activate): Sync the folder on - activate. - - * session.c (mail_session_remember_password): Use the same - URL-transforming rules we use when hashing the password so this - actually works. - -2001-04-02 Iain Holmes <iain@ximian.com> - - * importers/elm-importer.c (elm_can_import): Call is_kmail to check for - KMail files. - (is_kmail): Checks if the given directory is a KMail directory. - -2001-04-02 Iain Holmes <iain@ximian.com> - - * importers/elm-importer.c (elm_can_import): Check for some MH files - to make sure that the dir really is an Elm dir. - -2001-04-02 Dan Winship <danw@ximian.com> - - * mail-account-gui.c: Add a "provider_type" arg to - MailAccountGuiService. - (transport_needs_auth_toggled): Call service_changed if enabling - the auth pane so the status of the "Check supported types" button - will be correct. - (service_check_supported): Use gsvc->provider_type, not - CAMEL_PROVIDER_STORE. - (mail_account_gui_new): Pass the transport as the user_data to the - "changed" signal on transport.hostname, not the store. - (mail_account_gui_setup): Set up provider_type fields - -2001-04-01 Gediminas Paulauskas <menesis@delfi.lt> - - * component-factory.c: changed vtrash icon to trash. doh - * folder-browser-factory.c: pixmap cache got moved from here to - e-util/e-gui-utils.c. Changed pixmap paths according to file renames. - Added icons for print, get mail, etc., changed get mail icon as Jacub - suggested. - * subscribe-dialog.c: also use new pixmap cache. - -2001-03-30 Dan Winship <danw@ximian.com> - - * mail-config.c (check_service_check): Register for cancellation. - (mail_config_check_service): Pop up a modal dialog with a message - and a "Cancel" button for the duration of the check. - -2001-03-30 Iain Holmes <iain@ximian.com> - - * importers/evolution-mbox-importer.c (load_file_fn): Check if - foldername is \0. - - * importers/evolution-outlook-importer.c (load_file_fn): Ditto. - -2001-03-30 Jon Trowbridge <trow@ximian.com> - - * mail-display.c (mail_text_write): Add (commented-out) - E_TEXT_TO_HTML_CONVERT_ADDRESSES. - - * mail-config.c (mail_config_get_account_by_source_url): - Call e_url_equal to compare URLs. - -2001-03-30 Dan Winship <danw@ximian.com> - - * component-factory.c (debug_cb): If the EvolutionShellComponent - emits a "debug" signal, turn on camel_verbose_debug. - -2001-03-30 Radek Doulik <rodo@ximian.com> - - * mail-display.c (mail_display_redisplay): reset last_active - -2001-03-29 Jon Trowbridge <trow@ximian.com> - - * mail-callbacks.c: Added #include <time.h> to get things - to compile. - - * mail-callbacks.c (mail_generate_reply): Look at the - X-Evolution-Source header, and try to find a corresponding - account. If this works, send the mail from this account. - If not, use the default account. - - * mail-ops.c (send_queue_send): Strip out the X-Evolution-Source - header before sending. - - * mail-config.c (mail_config_get_account_by_source_url): Added. - Look up accounts by source URL. - -2001-03-29 Dan Winship <danw@ximian.com> - - * mail-format.c (call_handler_function): if called with a - multipart that's really a 0-part, spew an error and display as - source. - - * message-list.c: #include <camel/camel-vtrash-folder.h> - - * mail-callbacks.c: #include <libgnome/gnome-paper.h> - for the gnome-print stuff. - - * mail-display.c (pixmap_press): Ignore "funky" button clicks - (like scroll wheel scrolls) - -2001-03-29 Kjartan Maraas <kmaraas@gnome.org> - - * *.*: Cleaned up #includes. Remove unneccesary includes of - <gnome.h>, <gtk/gtk.h>, <bonobo.h> and replaced with more - fine grained headers where needed. Also marked a bunch of - strings for translations and added some missing prototypes. - -2001-03-29 Dan Winship <danw@ximian.com> - - * mail-account-editor.c (switch_page): Fix this so the "Receiving - Options" page gets filled in again. - - * mail-send-recv.c (receive_get_folder): Doh! This was storing - "struct _folder_info"s in the cache and then trying to read them - back as CamelFolders. Fixicate. Fixes the "crash with 2 POP - accounts" bug. - - * session.c (auth_callback): Update call to camel_url_to_string. - (Don't include the params in the password hash table key.) - - * mail-config.c (mail_config_folder_to_cachename): Call - camel_url_to_string with HIDE_PASSWORD and HIDE_PARAMS so that - changing URL params doesn't change the cachename. - - * mail-ops.c (add_vtrash_info): - * mail-local.c (reconfigure_folder_reconfigure): - * mail-account-gui.c (save_service): Update calls to - camel_url_to_string. - -2001-04-03 Dan Winship <danw@ximian.com> - - * folder-browser-factory.c (control_activate): Sync the folder on - activate. - - * session.c (mail_session_remember_password): Use the same - URL-transforming rules we use when hashing the password so this - actually works. - -2001-04-03 Not Zed <NotZed@Ximian.com> - - * mail-ops.c (mail_send_message): Strip header content before using it. - -2001-04-02 Iain Holmes <iain@ximian.com> - - * importers/elm-importer.c (elm_can_import): Calls is_kmail to - check for kmail files. - (is_kmail): Checks if the given directory is a KMail directory. - -2001-04-02 Dan Winship <danw@ximian.com> - - * mail-account-gui.c: Add a "provider_type" arg to - MailAccountGuiService. - (transport_needs_auth_toggled): Call service_changed if enabling - the auth pane so the status of the "Check supported types" button - will be correct. - (service_check_supported): Use gsvc->provider_type, not - CAMEL_PROVIDER_STORE. - (mail_account_gui_new): Pass the transport as the user_data to the - "changed" signal on transport.hostname, not the store. - (mail_account_gui_setup): Set up provider_type fields - -2001-04-02 Iain Holmes <iain@ximian.com> - - * importers/elm-importer.c (elm_can_import): Check for some MH files - to make sure that the dir really is an Elm dir. - -2001-03-30 Not Zed <NotZed@Ximian.com> - - * folder-browser.c (folder_browser_toggle_hide_deleted): New - function to listen for hide_deleted changes. - (folder_browser_toggle_hide_deleted): Only svae the hide-deleted - state if we are not setting a trash folder. - - * folder-browser-factory.c (control_activate): Set the - hide_deleted flag appropriately/setup the menu's appropriately. - (control_activate): Workaround to Force setting of options by - bypassing bonobo notification, since it doesn't properly handle - changed components. - - * mail-config.c (mail_config_get_hide_deleted): - (mail_config_set_hide_deleted): New functions for - accessing/setting the hide deleted state. - (mail_config_write_on_exit): - (config_read): Save/load the hide_deleted flag. - - * message-list.c (main_folder_changed): Oops, remember to copy - over all the rest of the changes too if we removed some. - (find_next_undeleted): Find the first undeleted message below us. - This of course does not follow sorting conventions, but thats - etree. Have to ask chris if there is a way to make it work like - that. - (message_list_set_hidedeleted): Check we dont set hide_delete on a - vtrash. - (build_tree): If the message has vanished, try and get the next - undeleted message set, etc, if it still exists. The set_cursor() - function seems very broken but i'm sure e-lahey will get to it - soon. - (build_flat): Similarly for above. - -2001-03-30 Dan Winship <danw@ximian.com> - - * mail-config.c (check_service_check): Register for cancellation. - (mail_config_check_service): Pop up a modal dialog with a message - and a "Cancel" button for the duration of the check. - - * component-factory.c (debug_cb): If the EvolutionShellComponent - emits a "debug" signal, turn on camel_verbose_debug. - -2001-03-30 Radek Doulik <rodo@ximian.com> - - * mail-display.c (mail_display_redisplay): reset last_active - -2001-03-29 Dan Winship <danw@ximian.com> - - * mail-format.c (call_handler_function): if called with a - multipart that's really a 0-part, spew an error and display as - source. - - * mail-display.c (pixmap_press): Ignore "funky" button clicks - (like scroll wheel scrolls) - -2001-03-29 Dan Winship <danw@ximian.com> - - * mail-account-editor.c (switch_page): Fix this so the "Receiving - Options" page gets filled in again. - - * mail-send-recv.c (receive_get_folder): Doh! This was storing - "struct _folder_info"s in the cache and then trying to read them - back as CamelFolders. Fixicate. Fixes the "crash with 2 POP - accounts" bug. - - * session.c (auth_callback): Update call to camel_url_to_string. - (Don't include the params in the password hash table key.) - - * mail-config.c (mail_config_folder_to_cachename): Call - camel_url_to_string with HIDE_PASSWORD and HIDE_PARAMS so that - changing URL params doesn't change the cachename. - - * mail-ops.c (add_vtrash_info): - * mail-local.c (reconfigure_folder_reconfigure): - * mail-account-gui.c (save_service): Update calls to - camel_url_to_string. - -2001-03-29 Not Zed <NotZed@Ximian.com> - - * mail-local.c (init_trash): Create a vtrash folder, not a vee folder. - - * folder-browser-factory.c (control_activate): Hook in the hide - deleted thingy. - Removed MessageHideDeleted menu stuff. - - * message-list.c (message_list_set_hidedeleted): New function, to - set if we should hide deleted messages automatically/always. - (regen_list_regen): If we have hide deleted messages turned on, - then hide them. - (main_message_changed): Promote to a folder_changed event with a - change list, folder_changed has the optimisations to handle this - appropriately. - (main_folder_changed): IF we get changes events for - deleted/undeleted stuff, change to added/removed events, rebuild - if necessary. - (message_list_set_folder): Setup the default hidedeleted state to - be to hide everything unless it is in a vtrash folder. - -2001-03-28 Jeffrey Stedfast <fejj@ximian.com> - - * mail-account-gui.c (setup_service): Move the - gtk_toggle_button_set_active outside the if. - -2001-03-28 Dan Winship <danw@ximian.com> - - * mail-account-gui.c (mail_account_gui_new): Set up the - sent/drafts folder buttons. - (folder_picker_clicked): Pop up the folder selector when sent or - drafts is clicked. - (mail_account_gui_save): Save the sent/drafts folders. - - * mail-config.c (account_copy): copy sent/drafts info - (config_read): read sent/drafts info - (mail_config_write): write sent/drafts info - - * mail-callbacks.c (composer_send_cb, composer_postpone_cb): - split out some common code here (and fix inconsistencies). Always - set headers on the message giving the account name, transport, - and sent folder to use. - - * mail-ops.c (mail_send_message): If the message has an - X-Evolution-Account header, use the transport/sent folder info for - that account (assuming it still exists). Otherwise, if it has - X-Evolution-Transport and/or X-Evolution-Fcc, use those. If not, - use the default transport and sent folder. - FIXME: Falls back silently to the default sent folder if it can't - open the account-specific one... - (send_queue_send): remove the X-Evolution-Transport, etc - processing here, as it gets done by mail_send_message now. - FIXME: We only sync the default sent folder. - - * component-factory.c (owner_set_cb): While setting up the - standard folders, also record their URIs. - -2001-03-27 Jeffrey Stedfast <fejj@ximian.com> - - * mail-account-editor.c (switch_page): Lets do some NULL checking - here. First, make sure the gsrc isn't NULL and also make sure that - account->source isn't NULL either. - - * mail-account-gui.c (mail_account_gui_setup): If there isn't a - source_proto, make sure we select "None" as the source type. - -2001-03-27 Dan Winship <danw@ximian.com> - - * mail-config-druid.c (construct): set the initial druid button - state after doing the mail_account_gui_setup, since that may - invoke signal handlers that will change it. - - * mail-account-gui.c (mail_account_gui_new): Fill in signature and - organization too. - (mail_account_gui_save): Preserve the "enabled" flag on the source. - (save_service): Don't look at authtype if the widget is - insensitive. (Fixes the "smtp://;auth=PLAINservername" bug.) - -2001-03-27 Not Zed <NotZed@Ximian.com> - - * mail-send-recv.c (receive_done): Use gnome-dialog-close instead - of object_unref, for some reason it doesn't like being unref'd - with a refcount of 1, _who knows_. Gets rid of that refcount - warning on get mail. - -2001-03-27 Dan Winship <danw@ximian.com> - - * mail-config.glade: Probably the very last new config dialog - ever. (Ha ha). From Anna, based on a story by me. - - * mail-account-gui.c: New code for the new mail-config.glade. This - abstracts out all of the common code between the account editor - and the druid. It also handles the spiffy new provider-specific - config stuff. - - FIXME: The code to check if a service is ok or not is no longer - there... waiting until the online/offline stuff from the shell - appears. - - * mail-account-editor.c, mail-config-druid.c: These are much - smaller now, since most of the interesting bits moved to - mail-account-gui.c - - * mail-accounts.c: Add an enabled/disabled column/button to - replace the checkbox that used to be in the editor, because it - really makes more sense to have it out here. This looks ugly. - Probably ought to ETable it... - (load_accounts): Fill in the enabled column. - (mail_select, mail_unselect): toggle the sensitivity and name of - the Enable/Disable button appropriately - (mail_able): Handle the enable/disable button. - - * mail-config.c: Remove reply-to from MailConfigIdentity since it - didn't belong there (and wasn't being saved anyway). - (mail_config_check_service): Simplify this a bit. This really - needs to pop up a dialog with a "connecting..." message and a - cancel button. - - * mail-ops.c (uid_cachename_hack): Kludge, copied+modified from - mail_config_folder_to_cachename to deal with the different - behavior of the URL code now. Will go away when the keep-on-server - code moves. - (get_folderinfo_get): Only pass "subscribed_only" to - camel_store_get_folder_info if the store supports subscriptions... - - * mail-local.c (local_provider): Update this to reflect the - CamelProvider structure change - -2001-03-26 Jeffrey Stedfast <fejj@ximian.com> - - * mail-callbacks.c (transfer_msg): Add "vtrash" as an allowed mail - folder type. - - * mail-ops.c (transfer_messages_transfer): Updated to reflect - changes made to the move/copy API in camel-folder.c - (add_vtrash_info): Use /Trash as the path instead of Trash. - - * mail-local.c (reconfigure_folder_reconfigure): Updated this too. - -2001-03-20 Not Zed <NotZed@Ximian.com> - - * mail-local.c (init_trash): Fixed vfolder_new api. - -2001-03-26 Dan Winship <danw@ximian.com> - - * mail-format.c (get_cid): Make fake content-id URLs be guaranteed - unique: the old way (with %p on the CamelMimePart *) would - generate duplicates if memory was freed and re-allocated the right - way. - - * mail-display.c (pixbuf_gen_idle, etc): Make the thumbnail cache - global rather than per-MailDisplay, since content-ids ought to be - globally unique. Also, don't leak content-id strings when the - pixbuf generation fails, and remove pixbufs from the cache after 5 - minutes. - - * component-factory.c (mail_load_storages): Simplify a bit using - camel_session_get_provider. - - * mail-callbacks.c (empty_trash): Ditto, and fix up use of - CamelException. - -2001-03-26 Radek Doulik <rodo@ximian.com> - - * mail-format.c (write_address): clear name and email data after - each address - -2001-03-25 Dan Winship <danw@ximian.com> - - * component-factory.c (unref_standard_folders): Fix a bug in this - that probably would have been noticed sooner if ETree hadn't always - made the mailer crash before you got here. :-) - -2001-03-25 Jeffrey Stedfast <fejj@ximian.com> - - * mail-account-editor.c (transport_auth_type_changed): Allow the - authtype to be NULL. - (transport_auth_init): If the provider allows authtypes but - doesn't *need* one, create a "None" menu item that the user can - choose. This should fix the bug people have been seeing recently - since dan removed the no_authtype authmech from the smtp provider. - -2001-03-24 Jeffrey Stedfast <fejj@ximian.com> - - * openpgp-utils.c (openpgp_verify): Default to iso-8859-1 as the - user's charset here if it is undefined. This is a better choice - than us-ascii. - -2001-03-23 Jon Trowbridge <trow@ximian.com> - - * mail-display.c (handle_embedded_address_object): #ifdef away - some code I don't quite want to delete yet. - (html_button_press_event): Remove some of Radek's placeholder - code, replace it with code to create my AddressPopup bonobo - control. - - * mail-format.c: Remove some obsolete code that if #ifdef-ed out - a while ago. - - * mail-ops.c (send_queue_send): Strip out the X-Evolution-Identity - header when sending. - -2001-03-23 Christopher James Lahey <clahey@ximian.com> - - * message-list.c: Turned on BROKEN_ETREE. - -2001-03-22 Iain Holmes <iain@ximian.com> - - * importers/evolution-outlook-importer.c: Update for new IDL. - - * importers/evolution-mbox-importer.c: Update for new IDL. - - * importers/Makefile.am: Build the elm importer. - -2001-03-22 Jeffrey Stedfast <fejj@ximian.com> - - * mail-accounts.c (mail_double_click): New callback to handle a - double-click event in the account clist. - (construct): Setup the double-click event for the account list. - -2001-03-22 Radek Doulik <rodo@ximian.com> - - * mail-display.c (mail_display_new): connect to button_press_event - and iframe_created events of GtkHTML widget - (html_button_press_event): new signal handler, runs popup on - address fields and on links, later we should add popups for images - and maybe some more? any ideas? - (html_iframe_created): new signal handler, takes care of - connecting to button_press_event of all iframes : plus bunch of - empty methods for popup menu items - to be implemented - (html_motion_notify_event): new handler, highlights addresses by - underline - (html_enter_notify_event): take care of enter event - (update_active): helper function, extracted from - html_motion_notify_event - (update_active): move to absolute coordinates - (html_button_press_event): ditto - - * mail-format.c (write_address): revert back to raw HTML text, - store name and email to Text objects, workaround gtkhtml tables - bug (to be fixed soon ;-) - -2001-03-21 Ettore Perazzoli <ettore@ximian.com> - - * folder-browser-factory.c (update_pixmaps): Don't return if - loading one image fails. - -2001-03-21 Dan Winship <danw@ximian.com> - - * mail-format.c (handle_multipart_related): Fix a bug in (illegal) - 0-part messages - - * mail-config-druid.c (incoming_check, incoming_type_changed, - transport_check, transport_type_changed): * mail-account-editor.c - (transport_type_changed, source_check): Use the new URL part - macros - - * mail-config.c (check_service_check): Use provider authtype list - if not connecting. - -2001-03-20 Miguel de Icaza <miguel@ximian.com> - - * folder-browser-factory.c: Added new icons. - -2001-03-18 Miguel de Icaza <miguel@ximian.com> - - * folder-browser-factory.c: Remove duplicated verb. - -2001-03-20 Iain Holmes <iain@ximian.com> - - * importers/evolution-mbox-importer.c (process_item_fn): Step the - parser so that it will import more than one message. - -2001-03-20 JP Rosevear <jpr@ximian.com> - - * importers/Makefile.am: extra dist the oaf files - -2001-03-20 Radek Doulik <rodo@ximian.com> - - * mail-tools.c (mail_tool_quote_message): set color in html - citation - - * mail-config.c: added citation highlighting configuration - - * mail-tools.c (mail_tool_quote_message): use citation - highlighting - - * mail-display.c (mail_text_write): use citation highlighting - -2001-03-20 Christopher James Lahey <clahey@ximian.com> - - * folder-browser.c (etree_key): Made this check if the control - mask is set. - -2001-03-20 Christopher James Lahey <clahey@ximian.com> - - * message-list.c (remove_node_diff, build_flat_diff): Remove the - node before freeing the data it points to. - -2001-03-19 Christopher James Lahey <clahey@ximian.com> - - * Merged e-tree-rework-branch: - -2001-03-18 Christopher James Lahey <clahey@ximian.com> - - * message-list.c: Added has_save_id and get_save_id methods. - - * subscribe-dialog.c: Added arguments for - e_tree_memory_callbacks_new of get_save_id and has_save_id to - NULL. - -2001-03-16 Christopher James Lahey <clahey@ximian.com> - - * message-list.c: Added a call to - e_tree_memory_set_expanded_default to TRUE. Removed all calls to - set_expanded on nodes while the tree is frozen since this fails - miserably now. - -2001-03-13 Christopher James Lahey <clahey@ximian.com> - - * message-list.c (message_list_get_layout): Turned off draw-grid. - -2001-03-09 Christopher James Lahey <clahey@ximian.com> - - * folder-browser-factory.c, folder-browser.c, message-list.c, - message-list.h, subscribe-dialog.c, subscribe-dialog.h, - mail-callbacks.c: Converted these all to use ETree instead of - ETable. - -End of branch - -2001-03-19 Iain Holmes <iain@ximian.com> - - * importers/pine-importer.c: Pine intelligent mail importer. - - * importer/elm-importer.c: Elm imtelligent mail importer. - - * importer/GNOME_Evolution_Mail_(Pine|Elm)_Intelligent_Importer.oaf.in: - Pine and Elm oafinfo files. - - * importer/netscape-importer.c (maybe_replace_name): Replace some invalid - names with valid ones (Trash -> Netscape-Trash). Change some netscape names - to Evolution names (Unsent Messages -> Outbox). - (scan_dir): Use less variables. - (netscape_import_file): Simplify. - -2001-03-19 Jeffrey Stedfast <fejj@ximian.com> - - * mail-ops.c: Removed gnome.h and ctype.h - (send_queue_send): Don't remove the X-Evolution header here. - (mail_send_message): Remove it here instead (so we only have to - remove it in one place - no matter if you send a single message or - send_queue. - -2001-03-19 Jeffrey Stedfast <fejj@ximian.com> - - * mail-format.c (write_headers): Write the date header. - - * component-factory.c (owner_unset_cb): Call - unref_standard_folders() here instead. - - * folder-browser-factory.c: Add Resend Message menu item. - - * folder-browser.c (on_right_click): Add resend to the right-click - menu. - - * mail-callbacks.c (composer_sent_cb): Unref the message. - (composer_postpone_cb): Unref the message here too. - (resend_msg): New callback to allow resending of messages in the - Sent folder. - -2001-03-18 Jeffrey Stedfast <fejj@ximian.com> - - * component-factory.c (unref_standard_folders): unref the standard - folders. - (owner_set_cb): Use g_atexit() to call unref_standard_folders() - when evolution-mail exits. This should solve the problem where - these folders are not synced when evolution-mail closes (because - they still had refs on them on close). - -2001-03-17 Not Zed <NotZed@Ximian.com> - - * mail-mt.c (mail_msg_free): Move the proxy event outside the lock - (otherwise we always deadlock). - - * mail-local.c (reconfigure_clicked): Clear the message list - during update inside the folder thingy. This is a hell mess, need - to move the gui stuff to mail-callbacks and make this reconfigure - thing a more generic func. - - * message-list.c (ml_value_to_string): Cleanup the logic to use - lookup tables. - (sort_uid_to_rows): Removed due to rewrite below. - (build_flat_diff): Changes for node/summary/etc changes. Also do - changed nodes too. - (clear_tree): Free the info reference for nodes in our hashtable. - (build_subtree): Ref the info reference in our hash/tree node. - (on_click): Dont free message info, since we just got our ref to - it. - (remove_node_diff): Free messageinfo off node. - (build_flat): Ref messageinfo. - (message_list_set_folder): Allow a NULL folder to be set - - i.e. clear the view. - (message_list_set_folder): Emit a no message sleeted signal. - (build_tree): Change cursor keeping stuff to work with new info. - - Turned off BROKEN_ETREE - well maybe it'll work. Check for - duplicate messages displayed, etc. - -2001-03-16 Not Zed <NotZed@Ximian.com> - - * message-list.h: Added uid_nodemap; mapping of uid's to e-tree - nodes. - - * message-list.c (build_flat): Changed to take a summary argument, - and to store node in node map, etc, and store info's in e-tree. - (build_subtree): Changed to store node in node map, and to store - info's in tree directly. - (ml_tree_value_at): Changed to get info directly from tree node, - removed allocated return value logic. - (ml_tree_value_at): Removed all "fake node" handling, no fake - nodes should ever exist. - (id_is_uid, id_is_subject, id_uid, id_subject): Removed macro's no - longer used. - (new_id_from_uid, new_id_from_subject): Removed no longer used. - (get_message_uid): - (get_message_info): Treat tree node data as messageinfo. - (message_list_select): Dont free the messageinfo, as its part of - our data, not retrieved from folder. - (message_list_drag_data_get): ditto. - (subtree_unread): Treat tree node data as messageinfo. - (subtree_size): ditto. - (subtree_earliest): ditto. - (clear_tree): Reset uid_nodemap on clear. - (save_node_state): tree nodes == messageinfo's. - (add_node_diff): ditto. - (remove_node_diff): ditto. - (main_folder_changed): use uid_nodemap to lookup changed nodes. - (main_message_changed): ditto. - -2001-03-16 Jeffrey Stedfast <fejj@ximian.com> - - * mail-crypto.c (pgp_mime_part_sign_prepare_part): New function to - prepare the mime part and any subparts for pgp signing. - (pgp_mime_part_sign_restore_part): New convenience function to - undo the prepare_part. - (pgp_mime_part_sign): Don't assume the part passed in is a leaf - part, we could very easily get a multipart (and in fact were which - is why people have been having unexpected results when signing - messages with attachments) and set the encoding as if it were a - leaf part. Use our 2 new convenience functions to set the - encoding(s) instead. - -2001-03-15 Miguel de Icaza <miguel@ximian.com> - - * folder-browser-factory.c (folder_browser_setup_view_menus): Fix - memory leak. - -2001-03-15 Jeffrey Stedfast <fejj@ximian.com> - - * mail-account-editor.c (apply_changes): We don't care about SSL, - yea baby... - (apply_changes): Don't care about SSL, no baby... - (construct): Yea, I said we don't care 'bout SSL, baby - (construct): That's exactly what I said, uh huh... - (transport_auth_type_changed): Set the sensitivity of the - user/passwd entries. - (transport_type_changed): If the hostname hasn't been set yet, - just use "localhost" as it doesn't really matter, since all we - need is a valid URL object. - - * mail-config.c: We no longer need `use_ssl' for sources and - transports. - -2001-03-15 Dan Winship <danw@ximian.com> - - * mail-display.c (mail_display_redisplay): Remove a stray - camel_object_ref that was causing messages to never be finalized - if they got redisplayed (because of attachments, delayed-loading - IMAP parts, etc) - -2001-03-15 Not Zed <NotZed@Ximian.com> - - * folder-browser.c: Added edit item to search-bar menu. - - * mail-callbacks.c (filter_edit): Changed for filter_editor_new() - api addition/change. - - * mail-vfolder.c (vfolder_edit): Use vfolder_editor_new intead. - -2001-03-14 Jeffrey Stedfast <fejj@ximian.com> - - * session.c (mail_session_init): Tell camel to init NSS. - (mail_session_accept_dialog): Doh! NULL terminate the list of - buttons and show the label. - - * mail-mt.c (do_get_accept): Same. - -2001-03-14 Ettore Perazzoli <ettore@ximian.com> - - * importers/Makefile.am (INCLUDES): Add `-I$(top_builddir)/shell' - and `-I$(top_srcdir)'. - -2001-03-13 Dan Winship <danw@ximian.com> - - * mail-display.c (on_url_requested): Call gtk_html_end() on the - stream so things happen. Fixes a problem with some inline images - (just very small ones maybe?) - - * importers/.cvsignore: create - -2001-03-13 Jeffrey Stedfast <fejj@ximian.com> - - * session.c (mail_session_init): Call camel_init with the - evolution directory passed in. Also, abort if camel cannot be - initialized. - - * main.c (main): Shutdown camel. - -2001-03-04 Michael Meeks <michael@ximian.com> - - * folder-browser-factory.c (free_pixmaps): impl. - (update_pixmaps): accelerate with cache. - -2001-03-13 Iain Holmes <iain@ximian.com> - - * Makefile.am: Removed the importers and created a subdirectory - for them to live happily as plugins. - - * mail-importer.c (mail_importer_create_folder): Modified the - function to take a BonoboListener for the callback. - (get_importer_list): Get a list of importer plugins. - (free_importer_list): Free the list of plugins. - (mail_importer_init): Initalise the list of plugins. - (main_importer_uninit): Unload the modules. - - * GNOME_Evolution_Mail.oaf.in: Remove the oaf_server entries for - the importers. - - * importers/*: Copy the importers in here. - -2001-03-12 Jeffrey Stedfast <fejj@ximian.com> - - * mail-config.c (mail_config_write): Make the transport save - whether or not it's supposed to use SSL as well. - (config_read): Read in whether or not we should remember the - transport password (for those that support SASL). - (mail_config_write): Save whether or not to save transport - passwords (needed for SASL enabled transports). - - * mail-ops.c (add_vtrash_info): Instead of always creating a new - vTrash folder, if the store already has a Trash folder, replace it - with the vTrash. Also, name the folder "Trash" instead of "vTrash" - and i18nify the name. - -2001-03-11 Jeffrey Stedfast <fejj@ximian.com> - - * mail-ops.h: Added protection. - - * folder-browser-factory.c: Add ActionsEmptyTrash. By the way - - should we rename the bonobo verbs now that our menu structure has - changed? - - * mail-callbacks.c (empty_trash): New callback to empty ALL of the - trash folders. - -2001-03-10 Jeffrey Stedfast <fejj@ximian.com> - - * mail-ops.c (send_queue_send): Remove our X-Evolution header - before we send. Also don't send messages that are marked for - deletion. - -2001-03-09 Jeffrey Stedfast <fejj@ximian.com> - - * mail-mt.c (mail_get_accept): New async function that will be - used for SSL certs later. - - * session.c (auth_callback): Changed to return a gpointer value. - (mail_session_accept_dialog): New function to handle the new - _ACCEPT authenticator mode. - -2001-03-08 Jeffrey Stedfast <fejj@ximian.com> - - * folder-browser-factory.c: Set the Forward->Quoted callback. - Also set the forward->Attachment callback. - - * mail-view.c (view_forward_msg): Specify FORWARD_ATTACHED. - - * mail-callbacks.c (forward_attached): Don't call - forward_messages() anymore...never really needed to. Just handle - it directly. - (forward_inlined): Specify FORWARD_INLINE as the flag argument. - (forward_quoted): New function sorta like forward_inlined except - this forwards the message quoted. - - * mail-tools.c (mail_tool_forward_message): New function to - prepare a message to be forwarded. - -2001-03-08 Jon Trowbridge <trow@ximian.com> - - * mail-format.c (write_field_row_begin): Added. Table row HTML - broken out into its own function. - (write_subject): Added. Emits the proper HTML for the subject - line. - (write_field_to_stream): #ifdef-ed out of existence. - (write_address): Take a CamelInternetAddress and spit out an - <object> tag with the appropriate <param>s. - - * mail-display.c (on_object_requested): Check for an "address" - object. If found, call... - (handle_embedded_address_object): ...this function, which creates - an AddressWidget bonobo control and passes in the necessary info. - I never really realized just quite how much GtkHTML kicks ass - until I figured out how to make this work. - -2001-03-08 Jeffrey Stedfast <fejj@ximian.com> - - * mail-vtrash.[c,h]: Removed from cvs - - * Makefile.am: Removed mail-vtrash.[c,h] - - * main.c: Don't #include "mail-vtrash" anymore. - - * component-factory.c: Add "vtrash" as a folder type we support. - (create_view): Kludgy-kludge around the vtrash type. - (owner_set_cb): Don't create the vTrash folder here anymore... - - * folder-browser.c (on_double_click): Call open_msg here so that - it does the Right Thing (tm). - -2001-03-08 Jeffrey Stedfast <fejj@ximian.com> - - * mail-local.c (mail_local_store_class_init): Override the default - init_trash() with the our custom one (since MailLocalStore doesn't - let the CamelStore keep a hash of opened folders and instead - keepts track of them itself). - (init_trash): custom implementation of the init_trash method for - MailLocalStores - (get_folder): i18nize. - (register_folder_registered): Don't add the folder to the vtrash - here. - -2001-03-08 Ettore Perazzoli <ettore@ximian.com> - - * component-factory.c (component_fn): Specify a NULL - `EvolutionShellComponentGetDndSelectionFn'. - -2001-03-07 Jeffrey Stedfast <fejj@ximian.com> - - * mail-autofilter.c (filter_rule_from_message): Add an action-part - widget. - (filter_rule_from_mlist): Same here. This should get rid of the - problem where people go to create a rule based on a message and - forget to fill-in the action part. - -2001-03-07 Jeffrey Stedfast <fejj@ximian.com> - - * mail-crypto.c (mail_crypto_is_smime_v3_signed): New function to - decide if a mime part is an S/MIME v3 signed part. - (mail_crypto_is_pkcs7_mime): New function to decide if a mime part - is an application/pkcs7-mime part (or an application/octet-stream - part with application/pkcs7-mime data). - - * mail-account-editor.c (source_auth_init): Move the signal - emittion to after the set_menu call so that it actually works. - (transport_type_changed): Updated to manipulate the user/passwd - fields for the transport. - (construct): Updated to init the user/passwd fields for the - transport. - (transport_auth_init): Renamed. Also fill in the user/passwd - fields if available. - -2001-03-06 Jeffrey Stedfast <fejj@ximian.com> - - * mail-accounts.c (construct): Disable the NNTP code if NNTP is - not enabled. This prevents some runtime warnings... - - * mail-config-druid.c: Updated to have a transport auth page. - -2001-03-01 Miguel de Icaza <miguel@ximian.com> - - * folder-browser.c (on_right_click): Move the context menus to - the toplevel code; Use enumerations for the various bitfield - constants. - - Add support for hiding items that are not required (read/unread - and delete/undelete). - - This requires my previous patch, as it assumes "Open" does the - right thing instead of having two operations: Open and Edit. - -2001-02-28 Miguel de Icaza <miguel@ximian.com> - - * folder-browser.c (on_right_click): Removed draft folders op - here, since open_msg now does the right thing (edit or view). - - * folder-browser-factory.c (update_pixmaps): Removed MessageEdit - from here. - - * mail-callbacks.c (open_msg): New function, does the "right - thing" to a message (either, edit or open). - - * folder-browser-factory.c: Register new command here. - (update_pixmaps): Rename keys that have been shuffled around. - (update_pixmaps): Rename to match new updates on xml file. - - Rename MessageOpenNewWindow to MessageOpen. Change action from - "view_message" to "open_message". - - * mail-callbacks.c (mark_all_as_seen): New command. Marks all - messages as seen. - -2001-03-06 Dan Winship <danw@ximian.com> - - * mail-ops.c (get_folderinfo_got): If the folderinfo has no URL - (ie, can't contain messages), don't add it as a vtrash source. - -2001-03-05 Jeffrey Stedfast <fejj@ximian.com> - - * mail-config-druid.c: Don't access the `active` data member of a - GtkToggleButton directly - bad programming, shame on me. - - * mail-account-editor.c: Same here. - - * mail-accounts.c: And here too. - - * mail-callbacks.c (empty_subject_destroyed): And finally here. - - * mail-crypto.c (pgp_mime_part_sign): Correcty set the mime type - for the multipart. Hmmm, still doesn't wrap correctly. NotZed? - Ideas? - (pgp_mime_part_encrypt): Here too. - -2001-03-03 Not Zed <NotZed@Ximian.com> - - * mail-tools.c: Remove very old camel lock stuff. - - * mail-local.c (register_folder_registered): Add the local folder - as a potential vfolder source. - - * folder-browser.c (got_folder): When we have a new folder, - register it as a potential vfolder source. - - * mail-vfolder.c: Added the source rule to the vfolder_info. - (vfolder_refresh): Store the rule in the vfolder info, etc. - (vfolder_register_source): Function to register a newly opened - folder with us. - (vfolder_uri_to_folder): Save the folder in the vfolder_info too. - (source_finalise): Handle clenaup when the folder dies. - -2001-03-02 Not Zed <NotZed@Ximian.com> - - * mail-mt.c (set_stop): Check the container is not NIL before - trying to set thje prop. - -2001-03-01 Not Zed <NotZed@Ximian.com> - - * folder-browser.c (folder_browser_search_menu_activated): Fixes - for changes to search bar. - (search_save): Removed. - (search_full): Removed. - (search_full_clicked): Removed. - (folder_browser_search_option_items[]): Removed. - (folder_browser_search_query_changed): Changed for search bar - changes. - (folder_browser_clear_search): Removed. - - * mail-vfolder.c (vfolder_clone_rule): New function to clone a - filter/search rule into a matching vfolder rule. - - * mail-send-recv.c (mail_receive_uri): Setup a timeout for status - updates. - (build_dialogue): Setup timeout id for status updates. - (operation_status_timeout): New function to set the status via a - timeout. - (receive_done): Remove the timeout handler if we need to. - (operation_status): - (receive_status): Just update the info, and let the timeout - handler update the gui. - (do_free_status): - (do_show_status): Removed gui thread status message processing. - -2001-02-28 Not Zed <NotZed@Ximian.com> - - * folder-browser.c (folder_browser_config_search): New function to - configure the FilterRule for the search mechanism. - -2001-02-27 Not Zed <NotZed@Ximian.com> - - * folder-browser.c (folder_browser_gui_init): Setup the search bar - as a filterbar. - (got_folder): Set the whole search bar sensitive or not based on - the search capability of the folder. - - * folder-browser.h: Changed to use efilterbar instead of esearchbar. - -2001-02-27 Jeffrey Stedfast <fejj@ximian.com> - - * mail-callbacks.c (configure_mail): Return TRUE if the user - configured his/her settings, else return FALSE. - (check_send_configuration): If configure_mail() returns TRUE, then - continue otherwise quit. - (send_receive_mail): Same. - -2001-02-26 Jeffrey Stedfast <fejj@ximian.com> - - * mail-callbacks.c (mail_generate_reply): Set a "References" - header no matter what if we are able to get a Message-Id. Fixes - bug #1583. - - * mail-accounts.c (mail_delete): Confirm that the user REALLY - wants to delete this account. - (news_delete): Same. - - * mail-ops.c (mail_send_message): Changed the product string - - will change it to use User-Agent once I get the RFC/DRUMS draft or - whatever. Until then I'll stick with X-Mailer. - -2001-02-26 Dan Winship <danw@ximian.com> - - * mail-callbacks.c (delete_msg): Mark deleted messages as "seen" - as well so they don't count towards the unread count. - - * mail-view.c (view_delete_msg): ditto - -2001-02-25 Jeffrey Stedfast <fejj@ximian.com> - - * component-factory.c (owner_set_cb): Re-add the - mail_vtrash_create() hack back in for LocalStores since there's no - better way to register a vTrash folder on the Local Storage yet. - - * mail-local.c (register_folder_registered): Add folders to the - vTrash folder here since the LocalStore does not let the parent - CamelStore class keep it's own hash of the folders. - -2001-02-25 Jeffrey Stedfast <fejj@ximian.com> - - * session.c (mail_session_forget_password): New function to force - the removal of a given password. - - * openpgp-utils.c (openpgp_decrypt): On failure, forget the - passphrase. - (openpgp_encrypt): Here too. (cleaned this up a bit too) - (openpgp_clearsign): And here. - (openpgp_sign): Again... - - * mail-callbacks.c (composer_postpone_cb): Abort if the message is - NULL (which is valid if an error occured). - (composer_send_cb): Same. - -2001-02-24 Jeffrey Stedfast <fejj@ximian.com> - - * folder-browser.c: Toss the mail_tool_camel_lock* stuff. - * mail-ops.c: Same. - * mail-summary.c: Here too. - - * mail-tools.c (mail_tool_uri_to_folder_noex): Blown away! - (mail_tool_filter_get_folder_func): *kapoosh* - (mail_tool_camel_lock_up): Same. - (mail_tool_camel_lock_down): Same. - (mail_tool_set_uid_flags): Don't need this rubbish anymore either. - -2001-02-24 Jeffrey Stedfast <fejj@ximian.com> - - * component-factory.c (mail_load_storages): No longer need to - construct the vTrash here. - (owner_set_cb): Don't make the vTrash for the local store here. - - * mail-ops.c (add_vtrash_info): New function to add a vTrash - folder info to a pre-constructed CamelFolderInfo for use in the - get_folder_info async function. - -2001-02-23 Jeffrey Stedfast <fejj@ximian.com> - - * main.c (main): No longer need to do a vtrash_cleanup() (it also - doesn't exist anymore). - - * component-factory.c (mail_load_storages): Updated to use the new - vtrash code. - (owner_set_cb): Same. - - * mail-tools.c (mail_tool_uri_to_folder): Update to handle the - "vtrash:" url prefix so that we can extract the REAL uri and know - to get the trash folder. - - * mail-vtrash.c (mail_vtrash_add): Add the vTrash folder to the - EvolutionStorage. - (mail_vtrash_create): Get the store based on the uri (async) and - then call mail_trash_add. - (vtrash_cleanup): Removed. - (vtrash_uri_to_folder): Removed. - (vtrash_create): Replaced by mail_vtrash_create() - -2001-02-23 Iain Holmes <iain@ximian.com> - - * component-factory.c (owner_set_cb): Init the importer here. - - * mail-importer.[ch] (mail_importer_create_folder): Add a function - that creates new folders in the shell. - (mail_importer_init): Take in an EvolutionShellClient, and get the - local_storage corba_object from it. - -2001-02-22 Jeffrey Stedfast <fejj@ximian.com> - - * mail-vtrash.c (create_trash_vfolder): Come up with a unique - store uri for each vtrash (using %p and the CamelStore we're gonna - place it on). - (get_trash_get): Pass in the store so we can use it for %p. - -2001-02-23 Not Zed <NotZed@Ximian.com> - - * mail-vfolder.c (vfolder_gui_add_from_mlist): Rule to add mlist - vfolder. - - * mail-autofilter.c (filter_gui_add_for_mailing_list): Removed. - (rule_from_mlist): Build a generic match rule from an mlist. - (vfolder_rule_from_mlist): Setup the vfolder rule for an mlist. - (filter_rule_from_mlist): Setup a filter rule fro an mlist. - (filter_gui_add_from_mlist): GUI thingy to do the work. - - * folder-browser.c (on_right_click): Added vfolder on mailing list - to filter menu. - (on_right_click): Use header_raw_check_mailign_list instead of - mlist magic to get the mailing list name. - (filter_mlist): Changed to use new add_from_mlist() call. - (vfolder_mlist): New function for vfolder from mlist. - - * mail-send-recv.c (build_dialogue): Only allow downloading if the - source is enabled at this time. - (mail_autoreceive_setup): Check for enabled sources before setting - up autodownload. - -2001-02-22 Jeffrey Stedfast <fejj@ximian.com> - - * mail-accounts.c (construct): Construct the PGP Path - GnomeFileEntry widget. - (pgp_path_changed): Try to auto-detect which PGP type the binary - file is based on the basename (yuck). - -2001-02-23 Not Zed <NotZed@Ximian.com> - - * mail-ops.c (create_folder_get): Make op cancellable/report - internals. - (get_folder_get): - (sync_folder_sync): - (get_folderinfo_get): Make op cancellable/report internals. - - * mail-vtrash.c (get_trash_get): Setup the operation registration, - and create a pseudo "start/stop" operation. - (get_trash_free): Free store if we have it. - (get_trash_got): Move vtrash add into here, so we execute in the - right thread. - - * component-factory.c (owner_set_cb): Make trash creation async. - - * mail-local.c (register_folder_desc): A description of what we're - doing. - - * mail-mt.c (mail_msg_new): Set status callback to operation_new. - (mail_operation_status): Operation status function, proxy messages - to main thread, and attempt to present a meaningful ui experience - for operations. - -2001-02-22 Jeffrey Stedfast <fejj@ximian.com> - - * openpgp-utils.c (openpgp_verify): Fixed memory corruption bug. - - * mail-format.c (try_inline_pgp_sig): Check to make sure the - validity isn't NULL. - (handle_multipart_signed): Check for NULL validities. - -2001-02-21 Jeffrey Stedfast <fejj@ximian.com> - - * mail-tools.c (mail_tool_uri_to_folder): Protect against NULL - uri's. - - * mail-vtrash.c: Do mutex locking on the global hash table - this - should clear up some segfaults ;-) - - * mail-config-druid.c (druid_finish): Set the 'enabled' member of - the source to TRUE if the URL exists else set to FALSE. - (incoming_type_changed): If the provider chosen is "None" then - gray-out the auto-check widgets and the check-settings, otherwise - sensitize them. - - * mail-account-editor.c (construct): Added a few more settings. - (apply_changes): Save the new settings. - - * mail-config.c (service_copy): Updated. - (config_read): Read in whether or not the account is enabled. - (mail_config_write): Save if the account is enabled or not. - -2001-02-22 Jeffrey Stedfast <fejj@ximian.com> - - * mail-ops.c (mail_send_message): Updated to reflect changes to - the filter-driver code. - -2001-02-22 Not Zed <NotZed@Ximian.com> - - * Makefile.am (CAMEL_OBJS_EXTRA): Removed, no longer link with - libcamelvee. - (evolution_mail_LDADD): Ditto. - - * mail-vtrash.c: Moved camel-vee-store header ot camel levle. - - * mail-tools.c: Moved camel-vee-folder header to camel. - - * mail-local.c (local_storage_new_folder_cb): started hack for - progress reporting, which is currently to the console. - - * mail-mt.c (set_stop): Set the stop button sensitivity. - (mail_msg_received): enable/disable stop button while we're - processing stuff in another thread. - - * message-list.c (ml_tree_value_at): If our uid entry vanishes - before w'ere ready, then make a fake. - -2001-02-21 Jeffrey Stedfast <fejj@ximian.com> - - * mail-crypto.c (pgp_mime_part_verify): Changed to use - PgpValidity. - - * openpgp-utils.c (openpgp_verify): Return a PgpValidity and set - the description as UTF-8 for later use in mail-format.c when - writing to GtkHTML. - - * mail-format.c (try_inline_pgp_sig): Updated to use the new - PgpValidity code. - (handle_multipart_signed): Updated. - -2001-02-21 Not Zed <NotZed@Ximian.com> - - * mail-callbacks.c (composer_postpone_cb): Fix for api changes to - append_mail. - - * Makefile.am (evolution_mail_SOURCES): Removed mail-threads.[ch]. - - * mail-threads.[ch]: Removed. - - * subscribe-dialog.c (subscribe_do_get_store): Chagned to use new - thread stuff. This is really getting boring. - (subscribe_do_subscribe_folder): Changed to use new thread stuff. - Last one at last, phew. - - * session.c (register_callback): Changed to use new thread stuff. - YUCK. I dropped some functionality, now the timeout callback - return is ignored, so basically it keeps running till finished. - - * mail-ops.c (mail_operation_run): Removed, no longer used/needed. - (mail_do_append_mail): Changed to use new thread stuff. - (mail_do_transfer_messages): ditto. - - * mail-local.c (local_storage_new_folder_cb): Use new thread - stuff, also only run synchronous for this operation. - (mail_local_reconfigure_folder): - (reconfigure_clicked): Changed to use new mail thread stuff. - - * mail-config.c (mail_config_check_service): Changed to use new - thread stuff. - -2001-02-20 Dan Winship <danw@ximian.com> - - * mail-vtrash.c (get_trash_get): Pass NULL, not "/" for @top. - - * mail-callbacks.c (create_folders): Make this work with - CamelStores where the separator character isn't /. folder_created - and folder_deleted are still broken. - -2001-02-20 Not Zed <NotZed@Ximian.com> - - * mail-vtrash.c: Include the camel-vee-store.h header from the - uninstalled copy. - -2001-02-19 Jeffrey Stedfast <fejj@ximian.com> - - * component-factory.c (mail_load_storages): Create vTrash folders - for all remote stores as well. - -2001-02-20 Not Zed <NotZed@Ximian.com> - - * mail-vtrash.c (create_trash_vfolder): Add the auto-update flag - to the folder open flags. - -2001-02-19 Jeffrey Stedfast <fejj@ximian.com> - - * mail-vfolder.c (mail_vfolder_get_vfolder_storage): New handy - dandy function to ref and return the vfolder storage (will - probably be disavowed once I figure out how to get the vTrash - folder to show up in the EvolutionLocalStorage). - - * main.c (main): Call vtrash_cleanup(). - - * mail-vtrash.c: New file. - (vtrash_uri_to_folder): vtrash: URI handler - (vtrash_create): Replacement async vtrash function for the old one - in mail-ops.c - (vtrash_cleanup): Cleanup code - unrefs the cached vtrash folders - and free's the hashtable. - - * Makefile.am: Added mail-vtrash.[c,h]. - - * mail-tools.c (mail_tool_uri_to_folder): If we have a vtrash: - URI, call the vtrash URI handler function rather than continuing - on. Yes, I know this is a hack and it needs to be fixed. - - * mail-ops.c (mail_do_setup_trash): Removed. - (mail_trash_get): Removed. - - * component-factory.c (owner_set_cb): Create the vTrash folder for - the LocalStore here. - - * mail-local.c (get_folder_info): Implement. - -2001-02-20 Not Zed <NotZed@Ximian.com> - - * mail-ops.c (fetch_mail_fetch): Unref the driver here, in the - subthread, so we dont block the gui while it sync's all the - folders. - (fetch_mail_fetched): Rewmoved above code from here. - -2001-02-16 Not Zed <NotZed@Ximian.com> - - * mail-send-recv.c (receive_status): Dont do the thaw/freeze set here. - (update_folders): " - - * mail-vfolder.c (vfolder_refresh): Setup the virtual - 'unmatched' folder by default. - (vfolder_uri_to_folder): HAndle UNMATCHED folder specially, it has - no explicit sources. - -2001-02-16 Jeffrey Stedfast <fejj@ximian.com> - - * mail-send-recv.c (receive_get_folder): Not sure it makes any - difference, but lets ref the folder while the hash table is locked - rather than after we unlock it. - -2001-02-16 Jeffrey Stedfast <fejj@ximian.com> - - * main.c: * component-factory.c: Reverse the changes I made - yesterday. - -2001-02-15 Jeffrey Stedfast <fejj@ximian.com> - - * main.c (main): Have the mail-config and openpgp initialize here - instead. - - * component-factory.c (owner_set_cb): No need to have mail-config - and openpgp init here. - -2001-02-15 Jeffrey Stedfast <fejj@ximian.com> - - * mail-ops.c (do_scan_subfolders): Use mail_storage_create_folder - - * mail-callbacks.c (mail_storage_create_folder): Convenience - function so we can keep all the evolution_storage_add_new_folder() - code in one place as much as possible. - - * subscribe-dialog.c (recursive_add_folder): Use 'name' rather - than the no-description bs since that's what all the other places - do. - - * mail-callbacks.c (folder_created): New callback to handle the - "folder_created" signal - handles CamelFolderInfo's recursively. - (folder_deleted): Same but for "folder_deleted". - - * component-factory.c (storage_create_folder): Instead of doing - the evolution_storage_new_folder() stuff by hand, pass it off to - the new callback: folder_created(). At some point this will be - unecessary as we'll attach this callback to the "folder_created" - signal. - -2001-02-15 Jeffrey Stedfast <fejj@ximian.com> - - * message-list.c: Wrapped the address compare functions in a - #ifdef - (address_compare): #ifdef the use of the smart address sorting - code and provide a #else for using g_strcasecmp(). - -2001-02-14 Jeffrey Stedfast <fejj@ximian.com> - - * openpgp-utils.c (openpgp_verify): Add the --no-tty flag. - -2001-02-14 Dan Winship <danw@ximian.com> - - * mail-mlist-magic.c: Rewrite explanatory comments to use normal - regexps rather than procmail weirdness. - (check_sender): match "foo-owner" as well as "owner-foo". - (check_list_post): (New) Check for "List-Post: <mailto:..." - (mail_mlist_magic_detect_list): Iterate through an array of - function pointers rather than calling each checker explicitly. - - * component-factory.c (add_storage): Connect to the - "create_folder" signal on the storage. - (storage_create_folder): Do folder creation. - -2001-02-14 Jeffrey Stedfast <fejj@ximian.com> - - * component-factory.c (owner_set_cb): Setup the Trash folder. - - * mail-ops.c (create_trash_vfolder): Do better error handling. - (populate_folder_urls): Oops, helps to strdup the url into the - array if we plan on freeing the data. - (mail_get_trash): New async function that may eventually replace - mail_do_setup_trash(). - (do_setup_trash): Do better error handling. - - * mail-local.c (mail_local_store_class_init): Override - get_folder_info. - (get_folder_info): Implement. - -2001-02-13 Christopher James Lahey <clahey@ximian.com> - - * mail-local.c (do_reconfigure_folder): Fix some uninitialized - variables. - -2001-02-12 Not Zed <NotZed@Ximian.com> - - * message-list.c (build_tree): if doing a full update, save the - cursor pos and restore it afterwards. - (on_cursor_activated_cmd): Copy the current_uid to a new string. - I dont know why this is required, but it is. - (message_list_destroy): Free the cursor_uid as we're done with it. - (build_flat): IF the current uid disappeared from the list, then - unset the message. - (build_tree): Likewise. - -2001-02-12 Jeffrey Stedfast <fejj@ximian.com> - - * mail-config.c (mail_config_write): Clean out the cruft in the - Accounts section before writing the current accounts out to the - config file. - - * mail-account-editor.c (construct): Strip the leading "/" from - the Namespace/Path entry if the provider doesn't require absolute - pathnames. - -2001-02-12 Kjartan Maraas <kmaraas@gnome.org> - - * Makefile.am: xml-i18n-tools setup. - * GNOME_Evolution_Mail.oaf.in: Mark strings for translation. - -2001-02-11 Dan Winship <danw@ximian.com> - - * mail-callbacks.[ch]: Re-add non-static forward_messages. - mail-view.c needs it. - -2001-02-11 Jeffrey Stedfast <fejj@ximian.com> - - * mail-callbacks.c (forward_inlined): Don't leak memory. - (forward_messages): change doinline to be a gboolean argument. - -2001-02-10 Jeffrey Stedfast <fejj@ximian.com> - - * mail-callbacks.c (list_add_addresses): Check the full list of - IDs instead of just the default id and if we find an address - matching one of the user's ids, then save it. - (mail_generate_reply): Try to guess which account to use based - upon the list of To and Cc addresses and pass that as the 'From' - address to e_msg_composer_set_headers(). - (forward_get_composer): Updated to reflect changes to - e-msg-composer. - -2001-02-11 Gediminas Paulauskas <menesis@delfi.lt> - - * mail-config.glade.h: removed, xml-i18n-extract's the strings itself. - * *.glade: do not output_translatable_strings - * Makefile.am: removed *.glade.h from EXTRA_DIST. - -2001-02-09 Dan Winship <danw@ximian.com> - - * mail-local.c: Updates for CamelStore changes, small memory leak - fixes. - (lookup_folder): Removed (and moved into the reconfigure code) - since this method no longer exists in CamelStore. - (do_reconfigure_folder, etc): Update the info in the - MailLocalStore after reconfiguring. - (mail_local_lookup_folder): Removed - - * local-config.glade: fix padding of the label_format - - * message-list.c (ml_tree_value_at): Don't keep message infos - reffed across calls, since this can cause badness after a - reconfigure. Instead, just strdup the needed values and free those - on the next call. - - * mail-tools.c (mail_tool_get_root_of_store): Unused, remove. - (mail_tool_get_inbox): use camel_store_get_inbox. - - * evolution-outlook-importer.c (load_file_fn): - * evolution-mbox-importer.c (load_file_fn): Use - mail_tool_get_local_inbox() instead of mail_importer_get_folder() - - * mail-importer.c (mail_importer_get_folder): Removed - -2001-02-08 Jeffrey Stedfast <fejj@ximian.com> - - * mail-callbacks.c (mail_generate_reply): New location for this - function. - - * mail-format.c: Removed mail_generate_reply as it's ONLY ever - used in mail-callbacks.c. - - * mail-ops.c (fetch_mail_fetch): Reworked some keep-mail-on-server - logic so that we ALWAYS look for a cached array of UIDs that we - may have downloaded previously so as not to download them again - even if we will be deleting them off the server. This fixes bug - #1344. - -2001-02-09 Not Zed <NotZed@Ximian.com> - - * mail-ops.c (filter_folder_free): only free driver, if set. - (fetch_mail_fetched): Unref the driver here, so it can cleanup - before we call the 'done' callback. - - * component-factory.c (owner_set_cb): Add setup for mail - autoreceive stuff. - - * mail-send-recv.c (free_info_data): Free the send info's from teh - active hash, not the running list. - (receive_done): As we finish downloads, remove them and clean them - up, and also close the window. - (mail_autoreceive_setup): New function to setup & maintain - automatic download stuff. - -2001-02-08 Jeffrey Stedfast <fejj@ximian.com> - - * mail-config-druid.c (construct): Set the sensitivity of the spin - button based on the state of the checkbox. - - * mail-config.c (config_read): Properly do defaults here. - (mail_config_write): Removed some of the settings being saved - here. - (mail_config_write_on_exit): Save those settings here instead. - -2001-02-08 Jeffrey Stedfast <fejj@ximian.com> - - * mail-display.c (on_object_requested): Cast the CamelMedium to a - CamelMimePart before performing actions on it as if it were a - CamelMimePart. - - * mail-config-druid.c (druid_finish): Save the auto-check settings. - (construct): Initialize auto-check widgets. - (mail_config_druid_get_auto_check): New function - (mail_config_druid_get_auto_check_minutes): New functions - - * mail-config.c (config_read): Read in whether or not to check - every x minutes. - (mail_config_write): Save auto-check config data and SSL. - -2001-02-07 Jeffrey Stedfast <fejj@ximian.com> - - * mail-autofilter.c (rule_add_subject): Use "contains" because the - subject might be broken into subparts and using the "is" rule will - then fail ;-) - -2001-02-08 Not Zed <NotZed@Ximian.com> - - * mail-send-recv.c (mail_send_receive): - (mail_receive_uri): Init active_downloads hash if it hasn't been yet. - -2001-02-07 Not Zed <NotZed@Ximian.com> - - * mail-send-recv.c (operation_status): Handle internal camel status return. - (receive_done): Remove active download when done. - (mail_receive_uri): Initiate download of a single source, with no gui. - (build_dialogue): Mark any new items as real active downloads. - (do_show_status): Make the progress bar optional. - -2001-02-06 Not Zed <NotZed@Ximian.com> - - * mail-send-recv.c: camel_cancel->camel_operation. - - * mail-ops.old.c: camel_cancel->camel_operation. - - * mail-ops.c: camel_cancel->camel_operation. - - * mail-mt.c: camel_cancel->camel_operation. - - * mail-callbacks.c (stop_threads): camel_cancel->camel_operation. - - * mail-mt.h: CamelCancel->CamelOperation. - -2001-02-07 Jeffrey Stedfast <fejj@ximian.com> - - * mail-mt.c (set_view_data): Check current_message for NULL - this - fixes a bug running under SunOS (not a major deal tho as it's in a - debug printf). - -2001-02-06 Jeffrey Stedfast <fejj@ximian.com> - - * mail-config.c (mail_config_write_on_exit): Oops, save the - seen_timeout variable. - -2001-02-06 Christopher James Lahey <clahey@ximian.com> - - * Makefile.am (evolution_mail_LDADD): Added libmenus.la. - - * folder-browser-factory.c (control_activate): Added GalView menus - here. - - * message-list.c, message-list.h (message_list_get_layout): Made - message_list_get_layout export. - -2001-02-06 Iain Holmes <iain@ximian.com> - - * mail-display.c (pixbuf_gen_idle): Set the size of the icon to 24x24 - always. - (button_press): Function to toggle the disposition of an attachment. - (on_object_requested): New way to indicate functions on attachments. - - * message-list.c (hide_load_state): Free the olduid. - -2001-02-06 Jeffrey Stedfast <fejj@ximian.com> - - * mail-config-druid.c (set_defaults): Updated to checkfor - "(none)". - - * mail-account-editor.c (entry_changed): Make sure the email - address is valid. - - * mail-config-druid.c (identity_check): Check to make sure we have - a valid email address. - (is_email): New function to check a string to see if it's a valid - email address. - -2001-02-05 Jeffrey Stedfast <fejj@ximian.com> - - * evolution-mbox-importer.c: We are now going to use a file - descriptor and a CamelMimeParser rather than a FILE pointer. - (load_file_fn): Open the file descriptor and initialize the - CamelMimeParser. - (importer_destroy_cb): Unref the mime parser. - (support_format_fn): Use an fd and use a case-insensitive - comparison as well as elimate a buffer overrun. - (process_item_fn): Process 1 CamelMimeMessage per invocation so as - to not lock up Iain's GUI and to work similar to the way Iain - originally coded it. - -2001-02-05 Christopher James Lahey <clahey@ximian.com> - - * evolution-mbox-importer.c, evolution-mbox-importer.h: Moved - bonobo includes from the .c to the .h. Include - evolution-mbox-importer.h in evolution-mbox-importer.c. - - * evolution-outlook-importer.c, evolution-outlook-importer.h: - Moved bonobo includes from the .c to the .h. Include - evolution-outlook-importer.h in evolution-outlook-importer.c. - - * mail-callbacks.c: Include mail-send-recv.h. - - * mail-local.c (mail_local_lookup_folder): Cast local_store to - CAMEL_STORE. - - * mail-mt.c (mail_msg_cleanup): Make this function static. - - * mail-send-recv.c, mail-send-recv.h: Created mail_send_recv.h. - Included it in mail-send-recv.c. Added a #include - <libgnomeui/gnome-window-icon.h>. - (mail_send_receive): Added a cast. - - * mail-summary.c (new_folder_cb, removed_folder_cb, - create_summary_view): Cast the source func in calling g_idle_add. - -2001-02-05 Jeffrey Stedfast <fejj@ximian.com> - - * mail-format.c (try_inline_pgp_sig): New function to handle - inline pgp-signatures. - - * mail-config-druid.c (construct): Keep track of the CheckSettings - check boxes. - (transport_next): Connect if the user says so. - (incoming_next): Same. Also, don't jump to the next page if - test-settings fails. - -2001-02-05 Jeffrey Stedfast <fejj@ximian.com> - - * mail-config-druid.c (incoming_next): Updated to not connect when - getting a list of authtypes. - (transport_next): No longer connects - again, this is - useless. Read the apply_changes argument for the reason why. - - * mail-account-editor.c (apply_changes): Updated. Set the - 'connect' argument to FALSE for now, this basically means that the - call is worthless tho so it may be best to either get rid of the - checks altogether or else make it connect. - (source_auth_init): Don't connect here, it's just plain annoying. - (transport_construct_authmenu): Same here. - - * mail-config.c (mail_config_check_service): Now takes a connect - argument. - -2001-02-03 Michael Meeks <michael@helixcode.com> - - * mail-local.c (load_metainfo): Fix dodgy libxml allocation - pollution, and potential faults on NULL attributes. - -2001-02-02 Not Zed <NotZed@Ximian.com> - - * mail-send-recv.c (mail_send_receive): Cleaned up so we dont add - an unecessary level of indenting. - - * message-list.c (ml_tree_value_at): For collapsed tree nodes, - scan the collapses nodes for the unread and status information. - Since we dont really have fake nodes anymore. - -2001-01-30 Ian Campbell <ijc25@cam.ac.uk> - - * message-list.c: Add support for new icons for being - read/unread for fake root messages on threads. - -2001-01-30 Iain Holmes <iain@ximian.com> - - * mail-send-recv.c (mail_send_receive): Only allow one send and - receive to be running at once. - (build_dialogue): Set the icon for the window. - - * evolution-mbox-importer.c (support_format_fn): Only compare the first - 5 bytes of the signature. - -2001-01-30 Kjartan Maraas <kmaraas@gnome.org> - - * folder-browser.c: Fix typo. - -2001-01-29 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-importer.c (mail_importer_add_line): Cast the - camel_stream_mem_new() to a CamelStreamMem. - -2001-01-29 JP Rosevear <jpr@ximian.com> - - * main.c: Return efence ifdefs to 0 for solaris build - -2001-01-29 Not Zed <NotZed@Ximian.com> - - * message-list.c (tree_equal): Debug function to compare the tree - we think we have, after an incremental update. - (build_tree): Check the tree after we've built it. - (build_tree): Oops, turn on BROKEN_ETREE again. - - * mail-mt.c (mail_get_password): If we are being called from the - main gui thread, then just call the dialogue directly. Ideally we - dont want this anyway but lets handle the case nicely. - (mail_get_password): Try locking around the password request, to - single-queue any password requests. - (mail_msg_init): Push an exit handler to clean it up on completion. - - * mail-send-recv.c (receive_update_got_store): New function called - when the store has been retrieved asynchronously. - (mail_send_receive): Get the store asynchronously. This was - causing problems where the password dialogue would try and be - called from the main thread via a message. - - * mail-ops.c (mail_get_store): New function to get a store - (a)synchronously. More or less taken from subscribe-dialog, which - i will remove later. - (mail_scan_subfolders): Try running the scan subfolder thing - asynchronously, to help startup time. Not sure if this will work, - but presumably the shell can handle the folders appearing later - ok. - -2001-01-28 Jeffrey Stedfast <fejj@ximian.com> - - * mail-config-druid.c (set_defaults): Turns out that I was wrong - about the g_get_real_name mem leak, god damn glib for not - following the const char* standard. - -2001-01-28 Jeffrey Stedfast <fejj@ximian.com> - - * mail-config-druid.c (management_prepare): Use UTF-8. - (set_defaults): Use UTF-8 and also fixed a memory leak by freeing - the string returned by g_get_real_name(). - (mail_config_druid_get_account_name): Use UTF-8. - (mail_config_druid_get_full_name): Same. - (mail_config_druid_get_email_address): Same. - (mail_config_druid_get_organization): Same. - - * mail-account-editor.c (apply_changes): Save UTF-8 strings rather - than gtk strings. - (construct): Use the UTF-8 convenience functions to set the gtk - entries for the ID fields. - -2001-01-28 Ettore Perazzoli <ettore@ximian.com> - - * mail-vfolder.c (vfolder_gui_add_rule): Make the OK button the - default one. - - * mail-search-dialogue.c (mail_search_dialogue_init): Use stock - buttons for OK and Cancel. Make the OK button the default one. - -2001-01-28 Ettore Perazzoli <ettore@ximian.com> - - * mail-vfolder.c (vfolder_gui_add_rule): Set a default size for - the window so that more rules are visible. - - * mail-search-dialogue.c (mail_search_dialogue_construct): Set a - default size for the window so that more rules are visible. - -2001-01-28 Not Zed <NotZed@Ximian.com> - - * mail-display.c (write_data_to_file): Changed to use - mail_save_part to save the data in another thread. - (save_data_cb): Hide the fileselector once we have a button press, - and are saving stuff. - - * mail-ops.c (mail_save_part): New function to save a part content - asynchronously. - -2001-01-27 Christopher James Lahey <clahey@helixcode.com> - - * folder-browser.c (etable_key): Don't handle home and end keys - since %ETable deals with them now. - -2001-01-27 Jeffrey Stedfast <fejj@ximian.com> - - * message-list.c (address_compare): Protect against NULL address - pointers. - (subject_compare): Same but for subject pointers. - -2001-01-27 Iain Holmes <iain@ximian.com> - - * mail-summary.c (create_summary_view): Applied patch from John R Sheets - to fix some warnings. - (idle_check): Fixed the prototype to fix some warnngs as well. - -2001-01-26 Ettore Perazzoli <ettore@ximian.com> - - * mail-display.c (get_embedded_for_component): Try a control - first, instead of an embeddable. - -2001-01-26 Jeffrey Stedfast <fejj@ximian.com> - - * subscribe-dialog.c (populate_store_foreach): Check for a NULL - service->url as we obviously can't subscribe to folders on a - non-existant mail source :-) - (subscribe_do_get_store): Check for a NULL url here too, not that - we should need it anymore (due to the above fix) but it doesn't - hurt. Also, should we wait on the thread? Probably doesn't matter. - -2001-01-26 Iain Holmes <iain@ximian.com> - - * evolution-outlook-importer.c (load_file_fn): Replace fsetpos with - fseek and use a long instead of fpos_t. - (process_item_fn): Same. - - * mail-importer.h: Add a frozen item to tell when the folder is frozen. - - * evolution-mbox-importer.c (process_item_fn): Fix the blank message. - Set the frozen element. - (importer_destroy_cb): Thaw the folder if frozen. - -2001-01-26 Dan Winship <danw@ximian.com> - - * mail-identify.c (mail_identify_mime_part): Fix an uninitialized - variable use. - -2001-01-26 Jason Leach <jasonleach@usa.net> - - (Fixing an old FIXME) - - * component-factory.c (create_vfolder_storage): removing - create_vfolder_storage, replacing call to it with - vfolder_create_storage. - -2001-01-26 Not Zed <NotZed@Ximian.com> - - * message-list.c (build_tree): Define BROKEN_ETREE again, till we - get this stuff fixed better. - -2001-01-25 Not Zed <NotZed@Ximian.com> - - * folder-browser.c: Moved teh "sender contains" item to the end of - the list, so the gui doesn't suddenly change on everyone. Fixed - the sender-contains search string to be a valid s-exp (ha, didn't - test it even once eh ettore?!) - (search_save): Dont have the sender contains as the default case - (which well, never gets called anyway), oops i guess i should've - reviewed the patch a little more. - -2001-01-26 Ettore Perazzoli <ettore@ximian.com> - - * folder-browser.c: Add a missing parenthesis to the "from - contains" rule. Also make it the last item instead of the first - one. - -2001-01-25 Iain Holmes <iain@ximian.com> - - * component-factory.c (component_factory_init): Init the mail - mail importers. - - * mail-local.[ch] (mail_local_lookup_folder): retrieve the local - folder given by the name. - - * mail-importer.[ch]: Basic functions for all importers to use. - - * evolution-mbox-importer.[ch]: Mbox importer. - -2001-01-25 Jeffrey Stedfast <fejj@ximian.com> - The following fixes seem to clear up the problem of new mail not - being shown in the Inbox and/or other folders where mail had been - delivered. - - * mail-send-recv.c (build_dialogue): Freeze the inbox. - (receive_get_folder): Freeze folders before dumping them into the - hash table. - (free_folder_info): Thaw the folder. - (free_info_data): Thaw the Inbox. - -2001-01-25 Jason Leach <jasonleach@usa.net> - - (Don't prompt about unsaved changes for replies/forwards that have - not actually been modified) - - * mail-callbacks.c (do_forward_inline): Unset the has_changed for - the message composer. - (do_forward_attach): Same here. - (mail_reply): And here. - -2001-01-25 Dan Winship <danw@ximian.com> - - * mail-format.c (mail_content_loaded): Check if a message part's - content is available, and if it's not, queue a thread that will - load it and then queue an idle-handler redisplay of the message. - (call_handler_function): Call mail_content_loaded() on the part - and don't try to display it if it's currently offline. - (get_data_wrapper_text): Simplify a bit - - * mail-display.c (mail_display_queue_redisplay): rename and make - non-static. - (mail_display_redisplay): Use a "new and improved" way of - preserving the GtkHTML scroll location. ("new and improved" is - code for "gross and hackish", but there should be a real interface - for this eventually.) - (on_url_requested): Use mail_content_loaded() and don't write out - offline cid: URLs - - * mail-identify.c (mail_identify_mime_part): Use - mail_content_loaded and don't try to identify the data if it's - offline. - -2001-01-25 Christopher James Lahey <clahey@helixcode.com> - - * message-list.c: Made the message list pay attention to the - "cursor_activated" signal instead of the "cursor_change" signal. - -2001-01-25 Ettore Perazzoli <ettore@ximian.com> - - * folder-browser-factory.c (update_pixmaps): Set the print icon - for various other items. - (set_pixmap): Be a bit more verbose in the warning message if the - icon isn't found [i.e. report the name of the file too]. - -2001-01-25 Ettore Perazzoli <ettore@ximian.com> - - * folder-browser-factory.c (update_pixmaps): Set the pixmaps for - the "/menu/Folder/FolderConfig" and "/menu/Settings/SetMailConfig" - items. - (set_pixmap): Don't prepend the "buttons" prefix. - (update_pixmaps): Update accordingly. - -2001-01-24 Not Zed <NotZed@Ximian.com> - - * folder-browser.c (search_string[]): Fix the subject match - expression, which was missing a closing ). - - * mail-send-recv.c (do_show_status): Escape any % signs in the - string before setting the format string. - -2001-01-24 Jeffrey Stedfast <fejj@ximian.com> - - * mail-config.glade: Added a 3rd page to the account editor to - allow users to set their HTML sending preference and also allow - them to change their message status timeout. - - * mail-accounts.c (construct): Added handlers for the send-html - checkbox and for the mark-message-as timeout spinbutton. - -2001-01-23 Jeffrey Stedfast <fejj@ximian.com> - - * mail-account-editor.c (apply_changes): Save the source and - transport changes whether the user can connect to the host or not. - -2001-01-23 Ettore Perazzoli <ettore@ximian.com> - - [Applied patch from Tuomas Kuosmanen <tigert@ximian.com>] - - * folder-browser.c: Added enum value `ESB_SENDER_CONTAINS' as well - as a "Sender contains" item to the search menu. Also add a - corresponding "(match-all)" rule to the `search_string' array. - (search_save): Handle `ESB_SENDER_CONTAINS' here. - -2001-01-23 Ettore Perazzoli <ettore@ximian.com> - - * GNOME_Evolution_Mail.oafinfo: Fixed the repo_ids so that they - use the right syntax. - -2001-01-23 Dan Winship <danw@ximian.com> - - * folder-browser-factory.c: - * mail-callbacks.c (send_receive_mail): Fix spelling. - -2001-01-24 Not Zed <NotZed@Ximian.com> - - * mail-ops.c (fetch_mail_fetch): Set the default folder when - copying to mbox. This is a quick fix, i might need to do a slight - redesign to clean it up. - -2001-01-23 Jeffrey Stedfast <fejj@ximian.com> - - * mail-send-recv.c (build_dialogue): Make sure the source->url is - not NULL (which is perfectly valid). - (mail_send_receive): Where oh where should my prototype be? - (receive_get_folder): Make sure to ref the folder before you add - it to the hash table. - - * openpgp-utils.c: - * mail-crypto.c: A few minor tweaks. - -2001-01-23 Not Zed <NotZed@Ximian.com> - - * message-list.c (build_tree): Try turning off the BROKEN_ETREE - thing. It seems to work ok (better?) now, but if its still broken - i'll remove it again for the next release. - -2001-01-22 Jeffrey Stedfast <fejj@ximian.com> - - * mail-config-druid.c (set_defaults): Automagically fill in the - user's default transport if he/she has setup previous accounts. - - * mail-format.c (handle_multipart_signed): Just wrote a temp way - of reporting success/fail of PGP/MIME signature verification - status. - -2001-01-22 Iain Holmes <iain@ximian.com> - - * evolution-outlook-importer.c: Outlook Express 4 .mbx importer. - - * component-factory.c (component_factory_init): initialise the - outlook importer. - - * GNOME_Evolution_Mail.oafinfo: Add the details for the Outlook - importer. - -2001-01-22 Dan Winship <danw@ximian.com> - - * mail-mt.[ch]: make mail_gui_thread non-static. - - * main.c (main): Set up signal handler for SEGV, BUS, FPE - (segv_redirect): if a gnome-segv'ing signal is received in - a thread other than mail_gui_thread, re-deliver it to that - thread to work around a problem with the gnome segv handler. - -2001-01-22 Jeffrey Stedfast <fejj@ximian.com> - - * mail-format.c (handle_multipart_signed): Fixed to display - subparts (other than the signature part) and started to write a - pretty way to show if the signature verified or not. - -2001-01-23 Not Zed <NotZed@Ximian.com> - - * mail-crypto.c (pgp_mime_part_verify): Fix a double-free problem. - -2001-01-22 Jeffrey Stedfast <fejj@ximian.com> - - * mail-config-druid.c (incoming_type_changed): Oops, danw didn't - know 'provider' could be NULL :-) - -2001-01-22 Dan Winship <danw@ximian.com> - - * mail-config-druid.c (incoming_type_changed): Change "Path:" - label to "Namespace:" for IMAP. Use $MAILDIR rather than $MAIL for - Maildir. If $MAIL isn't set, guess. - - * component-factory.c (mail_hash_storage): Function to add a - store/storage mapping. - (add_storage): Use it. - - * mail-vfolder.c (vfolder_uri_to_folder): Use the vfolder name - rather than the string "mbox" (which wasn't ever used for - anything) in the vfolder URL. (Combined with the CamelVeeFolder - change, this makes camel_folder_get_name() return a pretty name - for vfolders now.) Call mail_hash_storage() to record the - CamelVeeStore/vfolder_storage mapping. (Ideally, there'd only be a - single CamelVeeStore... this is just a quick hack.) - - vfolders now display their unread count once you've looked at them - once. - -2001-01-22 Dan Winship <danw@ximian.com> - - * mail-tools.h: s/filter-driver.h/camel-filter-driver.h/ and - update first arg of mail_too_filter_get_folder_func - - * mail-tools.c (mail_tool_filter_get_folder_func): Update first - arg to CamelFilterDriver * - - * mail-send-recv.c (receive_status): - * mail-ops.c (send_queue_send): s/FILTER/CAMEL_FILTER/ - - * mail-callbacks.c: Remove filter-driver.h include - - * mail-accounts.c: Put the news functions inside #ifdef - ENABLE_NNTP to prevent warnings about unused statis functions. - - * subscribe-dialog.c (subscribe_folders, unsubscribe_folders, - subscribe_refresh_list): Update prototype to match BONOBO_UI_VERB. - (populate_store_list): add a de-constifying cast - -2001-01-22 Not Zed <NotZed@Ximian.com> - - * .cvsignore: Added temp profiling files. - - * component-factory.c (owner_set_cb): remove a warning with - conditional news compilation. - - * mail-ops.h: Cleaned up the header list. - -2001-01-22 Jeffrey Stedfast <fejj@ximian.com> - - * mail-crypto.c (mail_crypto_is_rfc2015_signed): Helps if I spell - stuff correctly so it can pass the tests ;-) - -2001-01-22 Not Zed <NotZed@Ximian.com> - - * folder-browser-factory.c: Replace the old get_send mail with the - new one (button). - - * mail-ops.c (set_x_mailer): - (mail_load_evolution_rule_context): - (mail_do_fetch_mail): - (mail_do_filter_ondemand): - (mail_send_mail_old): - (mail_do_send_queue): All removed, (for) now lives in mail-send-recv.c. - (load_context): - (setup_filter_driver): - (filter_get_folder): - (mail_filter_folder): - (mail_fetch_mail): - (mail_update_subfolders): - (mail_send_mail): - (mail_send_queue): New equivalents of all these fundtions, moved - from mail-send-recv.c ... - (mail_filter_on_demand): Moved here too. - (mail_load_filter_context): Export this. - - * mail-callbacks.c (apply_filters): Use the new - mail_filter_on_demand() call. - (send_receieve_mail): Use mail_send_receive to do the work. Add a - little error handling here that used to be elsewhere. - (send_queued_mail): Removed. - (fetch_mail): Removed. - (select_first_unread): #ifdef'd this out. Not sure if this still - makes sense, but it doesn't get run right now anyway. - (composer_postpone_cb): Fix the setting of message flags. You - dont need to get them first, ever. - - * mail-send-recv.c (mail_send_message): Dont use - mail_tool_send_via_transport anymore (it does nothing useful). - - * mail-tools.c (mail_tool_camel_lock_up): Turned into a noop. - (mail_tool_camel_lock_down): And here too. - (mail_tool_move_folder_contents): Removed from the code (hasn't - bene used for ages). - (mail_tool_send_via_transport): Removed, it doesn't save anything. - -2001-01-21 Jeffrey Stedfast <fejj@ximian.com> - - * component-factory.c (owner_set_cb): Initialize OpenPGP. - - * openpgp-utils.c (openpgp_init): No longer takes a passphrase - callback, we'll just use the mail-session one. Makes life simpler. - (pgp_get_passphrase): Use mail_session_request_dialog(). - - * mail-ops.c (do_send_queue): Remove the X-Evolution header before - we send. - - * mail-crypto.c (pgp_mime_part_sign): Don't forget to unref the - filters. - (pgp_mime_part_verify): Same. - (pgp_mime_part_encrypt): Same. - (pgp_mime_part_decrypt): Take NotZed's advice and use - camel_stream_mem_new_with_buffer instead of writing to a new - stream_mem. Also use camel_data_wrapper_construct_from_stream - instead of creating a parser and using that. - -2001-01-21 Jeffrey Stedfast <fejj@ximian.com> - - * mail-crypto.c: Updated header comment and fixed some ref/unref - count problems in the various functions. Also fixed some other - little things. - (pgp_mime_part_encrypt): Do some canonical CRLF action before - encrypting. - (pgp_mime_part_sign): Make sure we are the owners of the byte - array. - (pgp_mime_part_verify): Same. - (pgp_mime_part_encrypt): Same. - (pgp_mime_part_decrypt): Same. - -2001-01-21 Christopher James Lahey <clahey@helixcode.com> - - * message-list.c (message_list_get_layout): Added - draw-focus="true" and selection-mode="browse" attributes to the - ETableSpecification. - (message_list_construct): Removed setting the "draw_focus" - argument since it doesn't exist any more. - -2001-01-21 Not Zed <NotZed@Ximian.com> - - * mail-mt.c (mail_msg_new): Init a cancel field in the message. - (mail_msg_free): Free it. - (mail_msg_cancel): New function to attempt to cancel an operation - by id. Impelementation functions can still be uncancellable by - not registering for cancellation, etc, or do it themselves as - well. - - * mail-send-recv.c (fetch_mail_filter_folder): set folder_uid's - properly, so we can save it later. - (filter_folder_filter): Renamed from fetch_mail_filter_folder, - since its going to be used for all filtering. - (mail_fetch_mail): Changed from mail_filter_mail. - (mail_filter_folder): New function, replaces - mail_do_filter_ondemand functionality. - (mail_filter_on_demand): New function, actually replaces - mail_do_filter_ondemand. - (receive_get_folder): Added an exception arg. - (mail_send_message): New function to just send a message. - (send_mail_send): Use mail_send_message. - (send_queue_send): New send qeue code, use mail_send_message, and - clean up some stuff. - (mail_send_receive): Changed from mail_receive. - (build_dialogue): Setup the sending data, as well. - (mail_update_subfolders): New function to update folder info. - (send_mail_send): hook into cancellation if we want. - -2001-01-20 Jeffrey Stedfast <fejj@ximian.com> - - * mail-ops.c (do_send_queue): Strip leading space from the - transport url gotten from the message. - -2001-01-19 Jeffrey Stedfast <fejj@ximian.com> - - * mail-format.c (mail_generate_reply): If the name is empty - string, use the address. - -2001-01-19 Dan Winship <danw@ximian.com> - - * mail-display.c (pixmap_press): Update for e_popup_menu_run - change. - - * folder-browser.c (etable_key): On GDK_Menu (the menu key on - 105-key keyboards), pop up the right-click menu. - (on_right_click): update for e_popup_menu_run change. - - * subscribe-dialog.c (recursive_add_folder): New function to add a - folder and any parents of it that don't yet exist. Fixes bugzilla - #1028. - -2001-01-19 Not Zed <NotZed@Ximian.com> - - * mail-send-recv.c: New swanky send/recieve thingy, well it so far - only receives (pop/mbox). Ignore all the warnings for now, and - the ugly 'button' to run it. - -2001-01-18 Jeffrey Stedfast <fejj@ximian.com> - - * folder-browser-factory.c: Added the next/previous toolbar - buttons. - - * mail-callbacks.c (next_msg): New callback so we can have a next - toolbar button. - (previous_msg): Same but for previous. - -2001-01-17 Jeffrey Stedfast <fejj@ximian.com> - - * mail-account-editor.c (construct): Anna's dialog now supports - SSL so we can get rid of the ssl-support checks. Also work around - the fact that Anna's dialog doesn't have an optionmenu for the - transport type, it's a label instead. - (transport_type_init): Cast the transport_type widget to a - GtkOptionMenu where appropriate as the widget that stores it is - now generic. - (apply_changes): Modify code to work with anna's dialog...*sigh* - (ok_clicked): Alert the user that one or more servers failed to - validate and allow him to continue anyway. - -2001-01-17 Jeffrey Stedfast <fejj@ximian.com> - - * mail-config.c (mail_config_set_pgp_path): New config function to - set the path to the pgp binary. - (mail_config_get_pgp_path): Gee I wonder... - (mail_config_set_pgp_type): This one sets the type (ie PGP5, PGP2, - or GnuPG - see openpgp-utils.h for values) - (mail_config_get_pgp_type): Der. - -2001-01-17 Jeffrey Stedfast <fejj@ximian.com> - - * mail-account-editor.c (construct): Handle NULL source and, while - we're at it, transport URLs. Apparently camel_url_new() and/or - camel-url_free() don't handle NULL input well. - - * mail-accounts.c (load_accounts): Handle NULL source URLs. - -2001-01-17 Jeffrey Stedfast <fejj@ximian.com> - - * mail-account-editor.c (construct): Oops. "url && url->host" - doesn't do much without the '?' and ':' ;-) - -2001-01-17 Ettore Perazzoli <ettore@ximian.com> - - * mail-ops.c (set_x_mailer): New function. - (send_mail_send): Use it. - (do_send_queue): Use it. - -2001-01-17 Martin Norbäck <d95mback@dtek.chalmers.se> - - * openpgp-utils.c (pgp_get_passphrase): Changed the word entry - to enter, which is the correct word to use. - -2001-01-17 Jeffrey Stedfast <fejj@ximian.com> - - * mail-callbacks.c (ask_confirm_for_empty_subject): Update to use - EMessageBox and to record if the user doesn't want to ever see - this dialog again. - - * mail-config.c (mail_config_get_prompt_empty_subject): New config - function. - (mail_config_set_prompt_empty_subject): Another new one. - -2001-01-16 Jeffrey Stedfast <fejj@ximian.com> - - * mail-account-editor.c (apply_changes): Modify to be able to - handle a NULL source_url. - (source_auth_init): Allow for a NULL source url. - (source_check): Same. - - * mail-config.c (mail_config_write): Allow for NULL source - URLs. And while we're at it, NULL transport URLs as well. Might as - well save the use_ssl variable too. - (config_read): Same. - - * mail-config-druid.c (druid_finish): Modify to allow a NULL - source url. - (incoming_next): Modify to check for a NULL source and jump to the - transport page if one is encountered (this means the user decided - not to config a source). - (incoming_type_changed): Modify to set all widgets insensitive if - the user selected the "None" source menu item (aka NULL provider). - (incoming_check): Modify to allow the user to go to the next page - when he/she has chosen "None" for their source type. - (mail_config_druid_get_source_url): Return NULL if the provider is - NULL. - (mail_config_druid_get_transport_url): Same. - -2001-01-16 Dan Winship <danw@ximian.com> - - * mail-display.c (on_object_requested): Don't do thumbnails for - offline images - -2001-01-16 Jeffrey Stedfast <fejj@ximian.com> - - * mail-callbacks.c (save_msg_ok): If the user hits "No", then - don't destroy the filesel window. - - * mail-ops.c (save_messages_save): Open with mode 0666 as danw - suggests. - -2001-01-16 Chris Toshok <toshok@helixcode.com> - - * component-factory.c (owner_set_cb): only load the news storage - if ENABLE_NNTP. - - * mail-accounts.c (construct): if !ENABLE_NNTP, remove the news - page from the dialog. - -2001-01-16 Radek Doulik <rodo@helixcode.com> - - * mail-format.c (mail_generate_reply): use - e_msg_composer_mark_text_orig - -2001-01-16 Dan Winship <danw@ximian.com> - - * mail-ops.c (send_mail_send, do_send_queue): Update the X-Mailer - header to use the string specified by configure. - -2001-01-16 Jason Leach <jasonleach@usa.net> - - * subscribe-dialog.c: removed unecessary #inlcude "e-title-bar.h" - -2001-01-16 Jason Leach <jasonleach@usa.net> - - * openpgp-utils.c (pgp_get_passphrase): Fix a string causing - translation problems. Bug #1147. - -2001-01-16 Not Zed <NotZed@Ximian.com> - - * mail-ops.c (mail_do_fetch_mail): Setup a cancellation handle. - (do_fetch_mail): REgister for cancellation here. - (cleanup_fetch_mail): And unregister for cancellation here. - (mail_get_message): Add a cancel handle. - (get_message_get): Register/deregister for cancel. - (get_message_free): & clean up. - - * mail-mt.c (mail_msg_received): Removed debuggng. - - * mail-callbacks.c (stop_threads): Callback for stopping. - - * folder-browser-factory.c: Add a stop button verb thingy. - (control_activate): Disable the stop button by default. - -2001-01-15 Christopher James Lahey <clahey@ximian.com> - - * message-list.c, message-list.h: Change from using filters for - date and size to using e_cell_date and e_cell_size. Moved a bunch - of includes from the message-list.h to the message-list.c. - -2001-01-15 Miguel de Icaza <miguel@ximian.com> - - * mail-callbacks.c (configure_mail): Set the default button to - `Yes' here. - -2001-01-13 Jeffrey Stedfast <fejj@ximian.com> - - * mail-account-editor.c (source_auth_init): If the preferred - authmech isn't found, default to the first one in the list. - (transport_construct_authmenu): This function already did the - above but I made it simpler. - (apply_changes): A number of cleanups. - -2001-01-13 Jeffrey Stedfast <fejj@ximian.com> - - * mail-config-druid.c (druid_finish): Fixed mail_load_storages to - make a mini GSList of the account, not the account->source. Oops. - - * mail-accounts.c (news_delete): Updated to use the remove_news() - function. - - * mail-config.c (mail_config_remove_news): New convenience - function for removing news accounts. - (mail_config_remove_account): Pretty much the same thing. - - * mail-ops.c (do_send_queue): Get the X-Evolution-Transport URL - and use that if it exists, else fall back on the default - transport. - - * mail-callbacks.c (composer_postpone_cb): Set an - X-Evolution-Transport header. - -2001-01-12 Jeffrey Stedfast <fejj@ximian.com> - - * Makefile.am: Removed GPG_* variables. - - * component-factory.c (mail_load_storages): Now takes a - 'is_account_data' variable to specify whether the sources is a - list of accounts of a list of services. Basically, the only time - you should pass in FALSE is when you are setting up NNTP storages. - (add_storage): Now takes a 'name' argument that specifies the name - to use in the storage. - (owner_set_cb): Updated to pass TRUE for accounts and FALSE for - news servers into mail_load_storages. - -2001-01-12 Christopher James Lahey <clahey@helixcode.com> - - * message-list.c: Changed filter_date and filter_size to match the - changes in gal. - -2001-01-12 Jeffrey Stedfast <fejj@ximian.com> - - * mail-config.glade: Anna's dialogs. - - * mail-config.c (mail_config_get_account_by_address): - Removed. Danw and I decided on setting a X-Evolution-Transport - header on messages going to the Outbox so we can later guess which - transport to use when sending it. - - * mail-account-editor.c (apply_changes): Update to some day be - able to support SSL. - (construct): Update for Anna's dialogs... - - * subscribe-dialog.c (populate_store_list): Updated to reflect - past changes to the mail-config API. - -2001-01-12 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-callbacks.c (composer_send_cb): Get the account by using - the new e_msg_composer_get_preferred_account() function. Also - check to make sure everything is configured (in case they deleted - their accounts while composing mail?). - - * mail-config.c (mail_config_get_account_by_address): New - convenience function. - -2001-01-12 Ettore Perazzoli <ettore@helixcode.com> - - * component-factory.c (component_fn): Pass NULL as the - @copy_folder_fn arg to `evolution_shell_component_new()'. - - * folder-browser.c (on_right_click): Removed hide menu. It - belongs to the view menu now. - -2001-01-12 Miguel de Icaza <miguel@ximian.com> - - * message-list.c: Add strings for localization - - * folder-browser.c: Rename "Save" to "Store search as vFolder". - -2001-01-11 Miguel de Icaza <miguel@gnu.org> - - * mail-display.c (on_object_requested): Unref the property bag - when we are done with it. - (get_embedded_for_component): Moved the code to request the - embeddable/control to a separate function. - -2001-01-12 Jeffrey Stedfast <fejj@ximian.com> - - * mail-config.c (mail_config_get_account_by_name): New convenience - function that I will need later when I redo the composer From - field. - - * mail-display.c (on_object_requested): Update to reflect past - changes to the mail-config API. - - * session.c (mail_session_set_password): strdup() the key. - - * mail-config-druid.c (construct): We don't want to be able to set - the reply-to in the config druid. - (druid_finish): Don't set a reply-to anymore. - (mail_config_druid_finalise): Don't unref the providers. - - * mail-config.glade: Took out the Reply-To field in the druid. - -2001-01-11 Miguel de Icaza <miguel@gnu.org> - - * mail-config-druid.c (incoming_type_changed): Guess the default - MAIL value for MBOX and Maildir files. - - * mail-callbacks.c (configure_mail): Force finalization of the - function before returning fixing the FIXME that was there. - -2001-01-11 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-config-druid.c (transport_next): If the service_check - fails, pop-up a warning dialog letting the user know he or she may - have problems and then let them continue on with their lives. - (incoming_next): Same (+ jump them over the auth page to the - transport page). - - * mail-account-editor.c (apply_changes): Eek! Don't destroy the - account if the connection fails, duh. This is what is causing the - segfaults. - -2001-01-11 Dan Winship <danw@ximian.com> - - * folder-browser.c (got_folder): Connect to folder_changed as well - as message_changed for updating unread count - -2001-01-10 Miguel de Icaza <miguel@helixcode.com> - - * GNOME_Evolution_Mail.oafinfo: Add Bonobo/ItemContainer as the - set of supported interfaces in GNOME_Evolution_Mail_Composer - component. - -2001-01-11 Dan Winship <danw@ximian.com> - - * mail-format.c (write_field_to_stream): Translate the header name - to UTF8. - -2001-01-10 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-callbacks.c (configure_mail): New function that explains to - the user why he can't do the action he requested and then procedes - to ask if he'd like to configure his accounts now. - (check_send_configuration): If the user doesn't have configured - accounts, don't let him continue and call configure_mail(). - (fetch_mail): Same. - (send_queued_mail): Same. - (send_receieve_mail): Same. - - * mail-config.c (mail_config_write): Don't save a "is_configured" - variable. Instead we'll just check to see if we have accounts - if - yes, then configured == TRUE. - (mail_config_is_configured): return accounts != NULL. - (mail_config_get_default_account): Mark the first account as the - default if none are marked. - -2001-01-10 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-account-editor.c (source_auth_type_changed): Set the - sensitivity of the Password label too. - - * mail-config-druid.c (transport_back): New callback to handle - when the user hits the "back" button when on the transport - page. This is needed to handle the case where we don't want to - show the user the auth page (due to there being no auth choices). - (incoming_next): If we are going to skip over the auth page, set - the 'have_auth_page' variable to FALSE. - (construct): Initialize the have_auth_page to TRUE. - -2001-01-10 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-config-druid.c (incoming_type_changed): Grab the focus of - the first widget that is sensitive. - (transport_type_changed): Same. - (identity_prepare): Grab the focus of the name entry. - - * mail-callbacks.c (send_queued_mail): Prevent Federico's segfault. - -2001-01-10 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-config-druid.c (auth_type_changed): Clear the password - entry if it's not allowed. - (transport_type_changed): Clear the hostname if it is not allowed - by the provider type. - - * mail-account-editor.c (transport_type_changed): If the hostname - is allowed, clear it. - - * mail-config-druid.c (incoming_type_changed): Clear the contents - of the entry boxes that are not to be used. - (mail_config_druid_get_source_url): If the text in the entry is - emptry string, don't set it' contents in the url. - -2001-01-10 Miguel de Icaza <miguel@helixcode.com> - - * mail-callbacks.c (print_msg): Fix proto. - (print_preview_msg): Fix proto. - - * subscribe-dialog.c: Remove more UNSAFE macros. - -2001-01-09 Jason Leach <jasonleach@usa.net> - - * mail-display.c (pixmap_press): Bugfix for #1077: scrollwheel - doesn't work while hovering over an attachment icon. - -2001-01-09 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-config-druid.glade: Moved to mail-config.glade - - * mail-accounts.c (construct): Updated to use mail-config.glade. - - * mail-account-editor.c (construct): Updated to use - mail-config.glade. - - * mail-config-druid.c (construct): Updated to use - mail-config.glade. - - * mail.h: Added the new mail config headers. - -2001-01-09 Dan Winship <danw@helixcode.com> - - * mail-local.c (local_folder_changed_proxy): Change - mail_op_forward_event to mail_proxy_event. - -2001-01-09 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-ops.c (save_messages_save): Let the system umask determine - the permissions of this file. - - * mail-config-druid.c (incoming_type_changed): Gray out the - appropriate labels too. - (auth_type_changed): And here. - (transport_type_changed): Here too... - - * mail-account-editor.c (source_check): Gray out the appropriate - labels too. - (transport_type_changed): And here too. - -2001-01-09 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-account-editor.c: For all optionmenu's, set the appropriate - 'history'. - (keep_mail_check): Set the keep-on-server checkbutton sensitivity - based on whether or not the store is a storage or not. - (construct): Call keep_mail_check(). - - * mail-config-druid.c (incoming_type_changed): Set the - keep-on-server checkbutton sensitivity based on whether or not the - store is a storage or not. - - * mail-accounts.c (construct): Make sure the dialog isn't a - scrunched little thingy. - -2001-01-09 Dan Winship <danw@helixcode.com> - - * Makefile.am (evolution_mail_LDFLAGS): Add -export-dynamic, so - libglade can resolve evolution-mail symbols. - -2001-01-09 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-format.c: Updated. - (decode_pgp): Get rid of #ifdef PGP_PROGRAM's and handle - appropriately. - (handle_multipart_signed): Same. - (handle_multipart_encrypted): Same. - - * Makefile.am: Added openpgp-utils.[c,h] to the build. - - * openpgp-utils.c: New source file containing all of the pgp - interface code. - - * mail-crypto.c: Removed all of the openpgp funtions as they are - being moved to a new file. - (mail_crypto_is_rfc2015_signed): Renamed. - (mail_crypto_is_rfc2015_encrypted): Renamed. - -2001-01-09 Jeffrey Stedfast <fejj@helixcode.com> - - * session.c (mail_session_set_password): New function to set the - password for a given url. - - * mail-config-druid.c (druid_finish): Don't save the password in - the source url, instead insert it into the save-password hash. - (mail_config_druid_get_source_url): Check to make sure the - authmech isn't "", if it is then don't set the authmech. - - * mail-account-editor.c (apply_changes): Don't save the password - in the source url, instead insert it into the save-password - hash. Also check to make sure we don't set an empty string as the - authmech for the source or transport. - - * mail-accounts.c (mail_default): After reloading the accounts, - reselect the previously selected account. - (mail_delete): Same. - - * mail-config-druid.c (druid_cancel): Fixed segfault bug. - -2001-01-09 Radek Doulik <rodo@helixcode.com> - - * mail-format.c (write_headers): remove </center><p> - (handle_text_plain): add <font size=\"-3\"> </font><br> before - msg text - (handle_text_plain_flowed): ditto - -2001-01-09 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-accounts.c (mail_default): Write the config data and reload - the accounts list so the "default" tag is relocated. - (mail_delete): Write the config data here too. - -2001-01-08 Jeffrey Stedfast <fejj@helixcode.com> - - * Makefile.am: - * component-factory.c: - * folder-browser-factory.c: - * folder-browser.c: - * mail-accounts.[c,h]: - * mail-account-editor.[c,h]: - * mail-callbacks.c: - * mail-config.[c,h]: - * mail-config-druid.[c,h]: - * mail-config-druid.glade: - * mail-display.c: - * mail-format.c: - * mail-tools.c: Brand spankin' new config druid, editor, - and manager. - -2001-01-08 Dan Winship <danw@helixcode.com> - - * mail-ops.c: Add an #include <errno.h> - -2001-01-08 Jeffrey Stedfast <fejj@helixcode.com> - - * Makefile.am: - * component-factory.c: - * folder-browser-factory.c: - * folder-browser.c: - * mail-callbacks.c: - * mail-config.[c,h]: - * mail-display.c: - * mail-format.c: - * mail-tools.c: Reverted mail-config changes temporarily until - I get it working correctly. - -2001-01-08 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-config-druid.c: More lovely fixes... - - * mail-callbacks.c: Don't segfault if a default account doesn't - exist. - -2001-01-08 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-config-druid.c: A bunch of fixes. - - * mail-accounts.c: More fixes... - - * mail-account-editor.c (construct): Reparent the notebook to the - editor->vbox and set the resize policy. - -2001-01-07 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-callbacks.c (providers_config): Use a - gnome_dialog_run_and_close(). - - * mail-accounts.c (construct): Reparent the notebook to the - dialog->vbox not to the dialog itself. Also set the resize policy - to allow the user to stretch it. - -2001-01-07 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-tools.c (mail_tool_quote_message): Updated to reflect - changes to the mail-config API. - - * mail-display.c (redisplay): Updated to reflect changes to the - mail-config API. - - * mail-callbacks.c (providers_config): Use the new account dialog. - - * mail-config-druid.c (druid_finish): Load the new storage into - the shell. - (mail_config_druid_new): Take a shell argument. - - * mail-format.c (mail_generate_reply): Updated to reflect changes - to the mail-config API. - - * mail-config-druid.c: Fixed this to build. - - * mail-callbacks.c (check_send_configuration): Updated to reflect - changes to the mail-config API. - (create_msg_composer): Same. - (forward_get_composer): Same. - (send_queued_mail): Same. - (composer_send_cb): Same. - - * mail-account-editor.c: Updated to build cleanly. * - mail-config-druid.c: Same. * mail-accounts.c: Same. - - * folder-browser-factory.c (control_activate): Updated for API - changes in mail-config. - - * folder-browser.c (done_message_selected): Updated for API - changed in mail-config. - (folder_browser_gui_init): Same. - (got_folder): Same. - - * component-factory.c (owner_set_cb): After using the sources - list, free it as it is no longer a const GSList as with the older - mail-config code. - - * mail-config.c: Totally rewritten. - -2001-01-07 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-accounts.c (mail_edit): Implemented. - - * mail-account-editor.c (apply_clicked): Implemented. - (ok_clicked): Implemented. - (cancel_clicked): Implemented. - (source_auth_type_changed): Implemented. - (source_auth_init): Implemented. - (transport_construct_authmenu): Implemented. - (transport_type_changed): Updated to change regenerate the auth - option menu. - (construct): Attached callbacks to OK, Apply and Cancel buttons. - - * mail-account-editor.c (source_auth_init): Use the new - mail_config_check_service(). - - * mail-config-druid.c: Remove check_service() as it will be moved - into mail-config. - -2001-01-06 Christopher James Lahey <clahey@helixcode.com> - - * message-list.c (message_list_select): Made it so that going to - the next or previous message in the list will at least move one - message, even if the current message matches the query. This - makes 'n' go to the next unread message, even if the current - message is unread. - -2001-01-06 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-account-editor.c: Coded a bunch of the methods. - -2001-01-04 Iain Holmes <iain@helixcode.com> - - * mail-summary.c (idle_check): Check if the HTML for the current - summary has been created, and if not then keep trying until it - has. - (new_folder_cb) - (removed_folder_cb) - (create_summary_view): Use the idle_check function to generate the - summary. - (create_summary_view): Don't set the HTML here. Set it via the - pipe. - -2001-01-05 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-account-editor.[c,h]: New source files to provide an - account editor widget. - - * mail-config-druid.c (auth_type_changed): Set the authproto on - the druid so we can look it up later. - -2001-01-05 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-accounts.c (mail_add): Since the druid now handles adding - the new account to the config, we'll just connect to the destroy - event and show the druid. - (mail_add_finished): Just reload the account list here. - - * mail-config-druid.c (druid_finish): New callback to handle the - "finish" signal. On second thought, it seems it would be best for - the finish callback to be here rather than in mail-accounts.c. - - * mail-accounts.[c,h]: Added. Contains source for the Account manager - window. And just like mail-config-druid.c, it's not yet complete. - - * mail-config-druid.c (mail_config_druid_get_incoming_keep_mail): - Renamed from _delete_mail - (mail_config_druid_get_transport_url): New convenience function - that replaces the get_hostname, get_protocol, etc. - (mail_config_druid_get_source_url): Same. - - * mail-config-druid.glade: Changed "Delete mail from server" to - "Keep mail on server" as this has a more positive ring to it. Both - I and Aaron agree this is the better phrase. - -2001-01-04 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-config-druid.c: Fixed a few 'Oops'es. - - * mail-config-druid.glade: Added a "Default" button for marking an - account as the default. - -2001-01-04 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-config-druid.glade: Updated. What else can I say? - -2001-01-04 Dan Winship <danw@helixcode.com> - - * folder-browser.c (got_folder): Connect to "message_changed" on - the folder if it's on a remote storage. - (update_unread_count): Update the folder unread count / highlight - in the shell when the unread message count changes - -2001-01-04 Not Zed <NotZed@HelixCode.com> - - * mail-ops.c (mail_do_send_mail): Removed old implementation. - - * folder-browser.c (do_message_selected): If we haven't got a real - uid, then clear the display instead. - - * message-list.c (message_list_drag_data_get): Use new save - message function, and also wait for it to finish before - continuing. - (folder_changed): - (message_changed): Use mail_proxy_event instead of - mail_do_forward. - (mail_regen_list): New iplementation to replace the old. - : remove <gnome.h> from headers. Dont define timeit by default. - (main_folder_changed): - (message_list_set_folder): - (message_list_set_threaded): - (message_list_set_search): - (message_list_hide_add): - (message_list_hide_uids): - (message_list_hide_clear): Use mail_regen_list instead of - mail_do_regenerate_messagelist. - (mail_do_regenerate_messagelist): Removed the old stuff. No - functionality changed yet, just using different thread stuff. - - * mail-callbacks.c (save_msg_ok): Use new save message function. - - * component-factory.c (create_view): - (add_storage): Use mail_scan_subfolders to build the folder info. - (create_folder): Use new implementation with our own callback. - (owner_set_cb): Changed b ack to use mail_get_folder, but now wait - for it to finish. This will let any gui still run, but also gives - us the required synchronous operation. - (got_folder): Callback for when the folder has been opened. - - * mail-ops.c (mail_get_folderinfo): New function to just get the - folder info in another thread. - (mail_scan_subfolders): New scan subfolder implementation that - uses mail_get_folderinfo. - (mail_do_scan_subfolders): Removed old implementation. - (mail_create_folder): Nerw implementation to create a folder, only. - (mail_do_create_folder): Removed old implementation. - (mail_save_messages): New implementation, fixes a couple of minor - problems, and now provides a return so it can be waited on. Also - check that the writes worked, etc. - (mail_do_save_messages): Remove previous implementation. - (mail_do_flag_messages): Removed, nothing uses it. - (mail_do_flag_messages): Removed, nothing uses it anymore. - (mail_get_folder): REturn the operation id, so callers can wait - for it. - (sync_folder_desc): - (expunge_folder_desc): Add describe functions so we know what its - doing. - (mail_send_mail): More generic implementation of sending mail. - - * mail-mt.c (mail_msg_new): Lock around seq increment. And insert - each new message into a hash table of active messages. - (mail_msg_init): Init the active message table. - (mail_msg_free): Remove the message from the active message table. - (mail_msg_wait): New function, waits for a message to be - processed, by id. - (mail_msg_check_error): Dont display the error if it is a - user-cancelled operation. - (mail_proxy_event): new implementation of mail_op_forward_event. - Only real difference is it uses the new thread stuff, and you can - wait for it to finish if you want. - (mail_proxy_event): If we're already in the main thread, just call - the function. - -2001-01-03 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-config-druid.c: New source file that implements - mail-config-druid. Note: this is not yet complete. - -2001-01-03 Not Zed <NotZed@HelixCode.com> - - * mail-view.c (view_forward_msg): Call - mail-callbacks.c:forward_messages(), so the behaviour is the same - as from the folder browser. - - * mail-callbacks.c (forward_messages): New function to forward - messages, attached or not. - (forward_inlined): Changed to use new forward-messages - implementation. - (forward_attached): Likewise. - (do_forward_attach): Callback for forwarding as attachment, once - we have built it. - (do_forward_inline): Likewise, for inline, once we have retrieved - the message. - (forward_message): Removed. - - * mail-ops.c (mail_build_attachment): New function to build an - attachment of messages. - (mail_do_attach_message): Removed, functionality superceeded by - above. - (mail_do_forward_message): Removed. Likewise. - (mail_create_folder): Started work on an alternative - implementation of create_folder, but not sure about it yet. - - * mail-tools.c (mail_tool_generate_forward_subject): Remove locking. - (mail_tool_make_message_attachment): Free the description when done. - -2001-01-03 Radek Doulik <rodo@helixcode.com> - - * mail-format.c (write_headers): add font color setting for table, - changed border behavior - - * mail-display.c (redisplay): don't set body bg and text color - -2001-01-02 Not Zed <NotZed@HelixCode.com> - - * mail-callbacks.c (view_msg): Fix for mail_get_message change, - use queue thread. - - * folder-browser.c (done_message_selected): Fix mail_Get_message - calls, use new thread. - (do_message_selected): " - - * mail-ops.c (mail_get_message): Add a thread argument so callers - can specify which queue it executes on. - - * mail-mt.c (mail_msg_free): Fix a free order problem. - (mail_msg_destroy): Call mail_msg_free to do the work. - (mail_msgport_replied): " - (mail_msgport_replied): Check/display errors if we get them. - (mail_msgport_received): If we have a describe function, say what - we're doing, also set busy/unbusy. - (mail_msgport_replied): Clear busy when we get a reply. - (mail_get_password): Unset busy. - (mail_msg_received): Set busy as we go. - (mail_msg_destroy): Unset busy when done. - (mail_status): Blah blah, new status interface, the other wans't - workable with the way the shell api works. - -2000-12-29 Not Zed <NotZed@HelixCode.com> - - * folder-browser.c (do_message_selected): If we are reconfiguring, - just keep polling till we are done (yeah kinda shitty, but easy). - (folder_browser_set_uri): Clear reconfigure flag here. ick. - (got_folder): And here too. - (on_right_click): Remove locking. - (hide_sender): and here too. - (hide_subject): And here. - (on_right_click): If we are in reconfigure, then the whole menu is disabled. - - * mail-mt.c (status_busy_timeout): Clear the status_busy_timeout_id. - - * mail-local.c (local_storage_new_folder_cb): Made getting folders - completely synchronous. The shell expects it, and it was only - synchronous before by a sideeffect. - (do_reconfigure_folder): Remove locking stuff. - (do_reconfigure_folder): Use our own much simpler copying routine - than that stupid move_folder_contents thing. - (update_progress): Use mail_status_message() instead. - (do_reconfigure_folder): Set the reconfigure flag during - reconfigure & set busy flag. - (cleanup_reconfigure_folder): clear busy flag. - - * mail-tools.c (mail_tool_uri_to_folder): Remove the tool_lock - stuff. - (mail_tool_uri_to_folder_noex): Clear exception on exit. - (mail_tool_move_folder_contents): Get rid of this really stupid - function that is only used in one place. - - * component-factory.c (owner_set_cb): Use direct calls to get the - folders, as this code must run synchronous. Remove the event wait - stuff. - - * mail-callbacks.c (edit_msg): Call mail_get_messages, and create - the composers ourself. - (do_edit_messages): get_messages callback, create the composers - and connect to signals we need. - (view_msg): Dont call do_view_messages, just call - mail_get_messge for each to get them in parallel. - (do_view_message): view a single message. - - * mail-ops.c (mail_edit_messages): Just use mail_get_messages - for this operation. Removed the other async operation stuff. - Changed my mind, just removed entirely. - (mail_do_view_messages): Removed. - (mail_do_setup_folder): Removed. - (mail_do_scan_subfolders): Make this run synchronously, as every - caller expects it to (even if they didn't realise). - -2000-12-28 Not Zed <NotZed@HelixCode.com> - - * mail-callbacks.c (send_queued_mail): Dont expunge the folder - here, but in send_queue, otherwise it might execute out of order. - (expunge_folder): Remove the talbe prechange stuff, and infact - references to the message_list folder, as we have our own folder. - Also, dont allow expunge if we're already expunging. - (expunged_folder): Clkear the expunging flag if we're finished. - - * folder-browser-factory.c (control_deactivate): Likewise here. - Hrm, i thought this function required a callback, silly me. - - * mail-tools.c (mail_tool_make_message_attachment): Remov e - locking. - - * folder-browser.c (on_message_selected): Use a timeout handler so - we dont select immediately. - (folder_browser_set_uri): Changed to use mail_get_folder. - (got_folder): New callback called when get_folder is finished. - (folder_browser_destroy): Use new sync interface. - - * mail-ops.c (mail_get_message): New function to asynchrounously - get a message. - : #define out mail_tool_camel_lock stuff entirely. - (mail_get_folder): New function to asynchrounously get a folder. - (mail_do_load_folder): Removed, replaced by more generic function - above. - (mail_do_display_message): Removed, replaced by the more generic - funciton get_message. - (mail_get_messages): New function to get a list of messages - asynchronously. - (mail_sync_folder): New interface to sync a folder async. - (mail_expunge_folder): New interface for expunging folder, with - callback. - (do_send_queue): Remove lock stuff, and expunge if (and only if) - successful, also sync the sent folder while we're at it. - - * session.c (mail_session_request_dialog): Changed to use new - mail_get_password call. - - * mail-mt.[ch]: New threading/interthread messaging framework. - - * main.c (main): Init the message/thread system. - -2001-01-02 Dan Winship <danw@helixcode.com> - - * mail-format.c (mail_part_is_inline): - (find_preferred_alternative): - * mail-display.c (launch_cb): Use header_content_type_simple, not - header_content_type_format. - -2000-12-26 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-crypto.c (mail_crypto_openpgp_verify): Implemented. - -2000-12-23 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-ops.c (mail_do_setup_trash): New function similar to - mail_do_setup_folder() except that this creates the Trash VFolder - (special-case). - -2000-12-21 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-ops.c (do_send_mail): Don't free info inside the last - if-statement, if sent_folder doesn't exist we'll have a memory - leak. Instead free it afterward. - -2000-12-29 Dan Winship <danw@helixcode.com> - - * mail-crypto.c: Oops. Update this for CamelContentType stuff too. - -2000-12-28 Dan Winship <danw@helixcode.com> - - * mail-format.c (mail_part_is_inline, mail_get_message_body): Use - CamelContentType, and use header_content_type_is instead of doing - it by hand. - - (handle_text_plain): - (handle_multipart_related): - (find_preferred_alternative): - (handle_message_external_body): Use CamelContentType and - header_content_type_* functions instead of GMimeContentField. - - * mail-display.c (write_data_to_file, launch_cb): Use - CamelContentType and header_content_type_* functions instead of - GMimeContentField. - -2000-12-26 Iain Holmes <iain@helixcode.com> - - * mail-display.c (mail_display_init): Initialise the thumbnail cache. - (mail_display_destroy): Free the cache. - (pixbuf_gen_idle): Check the cache for a pixbuf, add the pixbuf to the - cache if it's not there. - -2000-12-26 Iain Holmes <iain@helixcode.com> - - * mail-summary.c (create_summary_view): Create a shared - BonoboEventSource object and use it for all the objects that - aggregate Bonobo::EventSource. - -2000-12-27 Dan Winship <danw@helixcode.com> - - * subscribe-dialog.c (setup_subscribe_folder): Use info->name, not - input->full_name. Fixes #1029 in bugzilla.helixcode.com. - ({setup,do,cleanup}_subscribe_folder): Update previous fix: Jeff - had changed it to use ->full_name instead of ->name because that's - what camel_store_subscribe_folder needed. So we need to have - *both* names available, one for Camel, one for the shell. - -2000-12-24 Christopher James Lahey <clahey@helixcode.com> - - * message-list.c (filter_date): Changed this to format times in 12 - hour time instead of 24 hour time. - -2000-12-24 Christopher James Lahey <clahey@helixcode.com> - - * message-list.c (filter_date): Changed this to do different - formatting of dates within the last week. - -2000-12-24 Not Zed <NotZed@HelixCode.com> - - * Merge from camel-mt-branch. - -2000-12-23 Christopher James Lahey <clahey@helixcode.com> - - * message-list.c (filter_date): Changed this to do different - formatting of dates based on the current time. - -2000-12-23 Christopher James Lahey <clahey@helixcode.com> - - * message-list.c (message_list_get_layout): Added titles to the - pixbuf columns. - -2000-12-21 Iain Holmes <iain@helixcode.com> - - * mail-summary.c: Added code to detect and regenerate the summary - when a new vfolder is created or removed. - - * mail-vfolder.c: Export the vfolder_storage variable, so that - the summary can add a listener to it. - -2000-12-05 Iain Holmes <iain@helixcode.com> - - * component-factory.c (factory_destroy): Wait till all views have - gone and then destroy both factories. - -2000-12-21 Dan Winship <danw@helixcode.com> - - * mail-display.c (pixbuf_for_mime_type): Deal with the possibility - that we have an icon-filename listed for a MIME type, but the icon - file doesn't actually exist. Also, if gnome-unknown.png can't be - found, fall back. Might fix a crash people have been reporting... - -2000-12-18 Chris Toshok <toshok@helixcode.com> - - * mail-format.c (handle_multipart_encrypted): for now #ifdef - PGP_PROGRAM falling back to handle_multipart_mixed. - (handle_multipart_signed): same. - -2000-12-18 Dan Winship <danw@helixcode.com> - - * message-list.c (hide_save_state): Unlock camel when done to - prevent a hang later. - -2000-12-18 Miguel de Icaza <miguel@helixcode.com> - - * mail-tools.c (mail_tool_move_folder_contents): Only update - display every 2 seconds. - - * mail-ops.c (do_view_messages): Only update display every 2 seconds. - -2000-12-23 Not Zed <NotZed@HelixCode.com> - - * message-list.h (MessageList): Add a specific hide data lock. - - * message-list.c (message_list_drag_data_get): Do not use - cursor_uid, but get all currentlys elected messages directly off - the message-list. - (message_list_destroy): Removed mail_tool_camel_lock stuff. - (on_click): " - (message_list_hide_add, message_list_hide_uids, hide_load_state, - hide_save_state, message_list_hide_clear): ", but use a specfic - lock for the hide data. - (do_regenerate_messagelist): remove mail_tool_camel_lock stuff, - add hide_lock where required. - (message_list_init): Setup the hide_lock. - (message_list_destroy): Free the hide_lock. - -2000-12-22 Not Zed <NotZed@HelixCode.com> - - * mail-ops.c (mail_do_sync_folder): Run sync in different thread - each time. Just a quick litlte hack to check multithreading. - There are now few operations that single-queue. Need to work out - a way to make the allocation of threads & resources easier, so we - dont get overwhelmed with threads, but we dont block when we dont - have to, either. - - * message-list.c (main_folder_changed): If we have only changed - events, then process them directly. - (mail_do_regenerate_messagelist): Run regenerate in a new thread - each time, another quick hack to check mutlithreading. - - * mail-view.c (view_delete_msg): Call camel folder set message - flags directly. mail_do_set_message_flags() is now completely - unused. - - * folder-browser.c (mark_msg_seen): Call camel folder - set_message_flags directly. - - * mail-callbacks.c (flag_messages): New function, that just sets - flags of all selected messages, without all that messy thread - stuff (setting flags is in-memory). - (mark_as_seen): Use flag_messages(). - (mark_as_unseen): " - (undelete_msg): " - (delete_msg): " - -2000-12-20 Not Zed <NotZed@HelixCode.com> - - * message-list.c (message_list_select): Free messageinfo lookups. - (message_list_drag_data_get): " - (subtree_unread): " - (subtree_size): " - (subtree_earliest): " - (ml_tree_value_at): " Also, keep the message info around in a - static variable, and ref'd, so that any internal references we - have to it dont vanish while we're not looking. This has a couple - of problems ... esp since we never unref the last access, although - camel-folder-summary wont check this when its unref'd, so we're - 'safe'. - (save_node_state): free messageinfo lookups. - (on_click): " - (get_message_info): deconstify return. - - * mail-tools.c (mail_tool_move_folder_contents): Free messageinfo - lookups. - - * mail-ops.c (do_filter_ondemand): Free messageinfo lookups. - (do_flag_messages): " - (do_fetch_mail): Remove mail_tool_lock stuff. - (mail_operation_run): Quick hack to run an operation - asynchrounously, in a brand-new thread. - - * folder-browser.c (on_right_click): Free messageinfo lookups. - -2000-12-16 Not Zed <NotZed@HelixCode.com> - - * message-list.c (build_tree): Always use the slow (full-update) - version of the tree update code, to get around a bug(?) in etree. - (build_flat): Likewise. - -2000-12-15 Not Zed <NotZed@HelixCode.com> - - * mail-display.c (write_data_to_file): Dont blindly convert all - parts to utf8, e.g. image/jpg. We only convert text/* parts, and - only then if required. - -2000-12-14 Not Zed <NotZed@HelixCode.com> - - * component-factory.c (create_view): cast over a warning. - - * folder-browser-factory.c: Add verbs for hide functions. - - * message-list.c (message_list_hide_clear): - (message_list_hide_uids): - (message_list_hide_add): Some api renaming. - (message_list_hide_add): Allow ML_HIDE_SAME to be passed to mean - not to change the upper/lower range at all. - (hide_save_state): Save the state of the hide list to stable - storage. - (hide_load_state): Load the state of hte hide list. - (message_list_set_folder): Load/save the state of the folder if it - is changed/set. - (message_list_destroy): Save the state of the folder hide list - when done. - (save_tree_state): If we wrote out an empty state file, simply - remove it instead. - - * folder-browser.c (on_right_click): Add some hide menus. - (hide_read): Hide read messages. - (hide_deleted): Hide deleted messages. - (hide_selected): Hide selected/current message. - (hide_none): Show all hidden messages. - (on_right_click): Lock around accesses to the message (inside - mlist_detect_magic). - (on_right_click): Free the mailing list name. - -2000-12-13 Not Zed <NotZed@HelixCode.com> - - * folder-browser.c (on_right_click): Add camel locking since we - call it directly. Whoever heard of a lock you 'down' to unlock? - - * message-list.c (mail_do_regenerate_messagelist): Added hide - expression, messages to hide. Fixed all callers. - (do_regenerate_messagelist): IF we have a hide expression, search - and remove those from the uid list. If we have a hide range, - apply that afterwards. - (cleanup_regenerate_messagelist): Handle freeing the hide uid - temporary data, if required. - (message_list_destroy): Free hide data, also lock around all camel - object stuff. - (message_list_length): New function to get the number of messages - avaialble to be hidden by range. - (message_list_set_hide): Set the hide expression and range. - Issue: Should hiding be remembered? - (message_list_unhide_all): Turn off all hiding. - (message_list_hide_uids): Hide a list of uid's. - -2000-12-15 Dan Winship <danw@helixcode.com> - - * subscribe-dialog.c (folder_toggle_cb): Update this for the new - signal handler prototype. Fixes the crash on double-click. - -2000-12-15 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-format.c (handle_multipart_signed): New callback to handle - multipart/signed parts. - (decode_pgp): Update to account for the cipherlen argument needed - for openpgp_decrypt. - (is_rfc2015): Removed as we now have a better version in - mail-crypto. - (handle_multipart_encrypted): Updated to use the PGP/MIME utility - functions. - - * mail-crypto.c (mail_crypto_openpgp_decrypt): Don't check - (!*plaintext) as it could be a binary stream. Now also takes a - cipherlen argument. - (mail_crypto_openpgp_sign): New function. - (pgp_mime_part_sign): New function to replace a mime part with the - pgp signed equivalent. - (pgp_mime_part_encrypt): New function to replace a mime part with - the pgp encrypted equivalent. - (pgp_mime_part_decrypt): New function to decrypt a pgp encrypted - mime part (like from pgp_mime_part_encrypt) and replace it. - (is_rfc2015_signed): New function to determine if a mime part is - an rfc2015 signed part. - (is_rfc2015_encrypted): New function to determine if a mime part - is an rfc2015 encrypted part. - (mail_crypto_openpgp_verify): New openpgp function to verify a - signature. - -2000-12-14 Christopher James Lahey <clahey@helixcode.com> - - * mail-threads.c (update_active_views): Unref the iterator when - we're done with it. - -2000-12-14 Larry Ewing <lewing@helixcode.com> - - * mail-display.c (mail_display_new): call - gtk_html_set_default_content_type to make gkthtml default to utf-8 - when parsing. This requires gtkhtml >= the released 0.8. - -2000-12-14 Ettore Perazzoli <ettore@helixcode.com> - - * mail-threads.c (read_msg): Call `ui_set_busy()' before - `ui_set_message()' so that we are sure that the - set_busy/unset_busy calls always happen in order. - -2000-12-13 Christopher James Lahey <clahey@helixcode.com> - - * folder-browser.c (my_folder_browser_init): Made the vertical - scrollbar always be there. - - * message-list.c (message_list_get_layout): Changed the minimum - width of some of the pixmap column headers. - -2000-12-12 Christopher James Lahey <clahey@helixcode.com> - - * component-factory.c (create_view): Added a cast. - - * mail-summary.c: Added #include "mail-summary.h". Commented out - folder_free, summary_free, and view_destroy_cb since they're not - used. - (do_changed): Added a cast. - (create_summary_view): Changed some types so that casting would be - easier. - - * session.c (mail_session_remember_password): Added a cast. - -2000-12-12 Dan Winship <danw@helixcode.com> - - * mail-summary.h: Fix to use the right .h instead of the - deprecated one. - -2000-12-12 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-callbacks.c (forward_message): Attach a signature when - forwarding, fixes bug #826. - -2000-12-11 Dan Winship <danw@helixcode.com> - - * session.c (mail_session_enable_interaction): New function to - tell the code that it's ok (or not) to interact with the user when - trying to authenticate to a service. Starts out turned off. - (mail_session_request_dialog): If interaction is disabled, fail if - the password isn't in the cache. - - * component-factory.c (owner_set_cb): Call - mail_session_enable_interaction() after everything else. (This - means that the IMAP password dialog will no longer pop up [under - the splash screen] at startup.) - -2000-12-11 Dan Winship <danw@helixcode.com> - - * component-factory.c (create_view): Deal with "mailstorage" type - views (top-level mail storages) by trying to fill the storage's - folder tree again if we failed before. - (add_storage): Create new storages with a URI and type - "mailstorage". - - * mail-ops.c (cleanup_scan_subfolders): On success, mark the - storage as having been loaded, so create_view won't try again. - -2000-12-11 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-format.c (decode_pgp): Updated to reflect arguments to the - openpgp functions - now also takes an outlen argument. - (try_inline_pgp): Updated. - (handle_multipart_encrypted): Updated here too. - - * mail-crypto.c (crypto_exec_with_passwd): Updated to handle - binary streams and such. - (mail_crypto_openpgp_encrypt): Always initialize the passwd_fds - even if we don't plan on signing. Added an 'inlen' to specify the - length of the input data (as it could be binary). Also added a - 'userid' argument for cases when we want to sign as well as - encrypt. - (mail_crypto_openpgp_decrypt): Updated to take an outlen argument - in case the ciphertext is encrypted binary data. - (mail_crypto_openpgp_clearsign): Added a 'hash' and 'detach' - arguments. 'hash' allows the program to specify the preferred hash - function (which will come in handy when generating - PGP/MIME). 'detach' allows the program to specify whether it wants - a detached signature or the entire signed text. - -2000-12-11 Dan Winship <danw@helixcode.com> - - * message-list.c: Remove the never-once-used BonoboObject stuff - and make MessageList be a GtkWidget instead. Also, keep track of - the ETable directly rather than repeatedly calling - e_table_scrolled_get_table. - - * folder-browser.c (folder_browser_destroy): Use gtk methods - rather than bonobo methods to destroy the message list. - (on_right_click, on_double_click): These are being attached to the - ETable directly now, so fix the first argument (which isn't being - used anyway, but...). Ignore double-clicks on "active" columns - (the ones where clicking does something beyond "select"), fixing - bug #811, which is what got me started on this to begin with... - (folder_browser_gui_init): simplify now that MessageList itself is - a widget. Also use message_list->table rather than - e_table_scrolled_get_table. - - * mail-local.c (mail_local_reconfigure_folder): Add "mail_" to - the beginning of this function name to match its prototype and the - other vague namespace conventions in the mailer. - - * mail-callbacks.c (select_all, invert_selection): Use ml->table. - (configure_folder): s/local_reconfigure_folder/mail_&/ - - * mail-ops.c (do_flag_messages): clean up the cleanup a bit - - * mail-tools.c (mail_tool_quote_message): Remove an unused - variable. - -2000-12-11 Not Zed <NotZed@HelixCode.com> - - * local-config.glade: reordered the options and added maildir, - mbox, maildir, mh, in that order. - - * mail-local.c (reconfigure_clicked): Added maildir, re-ordered to - match the changed xml file too. - (do_reconfigure_folder): WHoever 'threaded' this code forgot to - check that folder_browser functions shouldn't be called here. - (cleanup_reconfigure_folder): Call it here instead. - (lookup_folder): Blah blah, we have to lookup the folder and - verify its still the same format, joy. Becaause someone thought - it would be wise to make the code 5x more complicated for no - reason, and totally break 'mail reconfigure' in the process. i'm - really happy about that one. - (cleanup_register_folder): Uh, yeah, so like, the - local_store->folders hashtable is supposed to point to like, - LocalFolders, not CamelFolders. - (free_local_folder): Free the localfolder struct properly. - (free_folder): Call above to free data properly. - (get_folder): Fix for fixing folders hashtable. - (local_storage_removed_folder_cb): Same here. - (local_storage_new_folder_cb): Ref the local_store when putting it - in the local_folder. - (cleanup_register_folder): Properly free the local_folder if the - op failed. - (free_local_folder): Unhook events also. - (d): Oops, left debug turned on. - -2000-12-09 Christopher James Lahey <clahey@helixcode.com> - - * message-list.c (message_list_init): Change the "drawfocus" - argument on e_table_scrolled_get_table(etable) instead of on - etable (etable is an ETableScrolled.) - -2000-12-08 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-callbacks.c (save_msg_ok): Check to see if the file already - exists, if it does prompt the user to for permission to overwrite - the file. - (forward_message): g_strdup the cursor_uid if there is only a - single message to be forwarded or we'll segfault later. - - * mail-ops.c (do_save_messages): Rewrote yet again. I'm back to - almost an identical implementation as the first time I wrote this - except now we write the From line which I had forgotten last - time. This means that we no longer have to unlink the .ev-summary - file created and we also use fewer resources (no need to create a - CamelMboxFolder object). - -2000-12-08 JP Rosevear <jpr@helixcode.com> - - * folder-browser.c (on_double_click): the e-table double-click - signal now has extra params - -2000-12-07 Ettore Perazzoli <ettore@helixcode.com> - - * component-factory.c (add_storage): Pass `NULL' as the - @toplevel_node_handler_id arg in `evolution_storage_new()'. - FIXME: We should be passing the ID of the mail component here. - * mail-vfolder.c (vfolder_create_storage): Likewise. - -2000-12-08 Jeffrey Stedfast <fejj@helixcode.com> - - * message-list.c (message_list_get_layout): Set the "Size" field - to sort using integer comparison instead of string. - (filter_size): New function to transform a integer size into a - more readable form. - (ml_value_to_string): Use filter_size. - (ml_value_is_empty): COL_SIZE is no longer a string, so handle - this as an integer. - (ml_initialize_value): Here too. - (ml_free_value): And here. - (ml_duplicate_value): And here too. - (message_list_create_extras): Setup the size etable cell. - -2000-12-08 Christopher James Lahey <clahey@helixcode.com> - - * folder-browser.c: Connect to signals on the ETable instead of - the ETableScrolled. - - * subscribe-dialog.c: Used the e_table_scrolled_get_table function - instead of accessing the variable directly. - -2000-12-08 Christopher James Lahey <clahey@helixcode.com> - - * message-list.c: Connect to signals on the ETable instead of the - ETableScrolled. - -2000-12-07 Christopher James Lahey <clahey@helixcode.com> - - * message-list.c: Got rid of code referencing the ETableScrolled - proxy functions. Changed the call to e_table_set_cursor_row to - send a model row instead of a view row. - -2000-12-07 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-callbacks.c (forward_message): Only do a - message_list_foreach if we plan on attaching messages, otherwise - just use ml->cursor_uid. - - * mail-ops.c (cleanup_forward_messages): If attaching multiple - forwarded message, wrap them in a multipart/digest otherwise just - attach the single message as a message/rfc822. - -2000-12-07 Dan Winship <danw@helixcode.com> - - * mail-display.c (on_object_requested): Make the iTip hack spew a - g_warning and not crash if you have no identity configured. To be - revisited. - - * mail-callbacks.c: (various) - * folder-browser.c (filter_mlist): - * mail-autofilter.c (filter_gui_add_from_message): - * mail-vfolder.c (vfolder_gui_add_from_message): Add some - g_return_if_fail()s to protect from crashes until the code to - enable/disable commands based on how many messages are selected is - done. - -2000-12-06 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-vfolder.c (vfolder_gui_add_rule): Make the vfolder editor - resize correctly. Fixes bug #835. - -2000-12-06 Dan Winship <danw@helixcode.com> - - Fix up shutdown so that things that should be destroyed get - destroyed. Among other things, this fixes the bug where IMAP - stores weren't disconnected at shutdown. - - * mail-threads.c (update_active_views): Update for - folder_browser_factory_get_control_list change to EList. - - * folder-browser-factory.c: Turn control_list into an EList so - that we can safely remove items from it while it's being iterated - (which will happen as FolderBrowsers are destroyed at shutdown - while the thread code is trying to update the status bars). - (control_destroy_cb): Just destroy the folder_browser. - (browser_destroy_cb): New callback for FolderBrowser destroy. - Remove the control from control_list here instead of - control_destroy_cb, because the controls don't seem to get - destroyed reliably... - - * component-factory.c: Clean up stuff. - (factory_destroy): Get rid of this. - (owner_unset_cb): Schedule an idle handler to quit. - (idle_quit): Wait for all of the FolderBrowsers to be destroyed - and then destroy the storages and quit. - - * mail-summary.h (create_summary_view): Fix prototype - -2000-12-06 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-config.c (mail_config_folder_to_cachename): Use - e_filename_make_safe (which used to be e_str_make_safe). - - * mail-display.c (make_safe_filename): And here. - - * message-list.c (message_list_drag_data_get): Here too. - -2000-12-06 Dan Winship <danw@helixcode.com> - - * mail-local.c (cleanup_register_folder): Run the folder_changed - code on message_changed as well, so the unread message counts - update as messages are read. - - * folder-browser.c: Remove bits of filter-on-demand and toolbar - bug workaround cruft that don't do anything useful any more. - - * mail-ops.c (cleanup_load_folder): unref the ref we added in - setup_load_folder. - -2000-12-05 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-display.c (write_data_to_file): Use a charset filter to - make sure the data is written out in the charset it was meant to - be in instead of UTF-8. - - * mail-format.c (mail_format_raw_message): Don't use the raw - message body as the format argument, use "%s" instead. If the raw - message contains %'s then it will segfault otherwise. - -2000-12-04 Dan Winship <danw@helixcode.com> - - * mail-config-gui.c (service_page_item_new): Fix a typo so that - toggling the "remember password" checkbox will activate the "OK" - button if it was inactive. - -2000-12-05 Ettore Perazzoli <ettore@helixcode.com> - - * mail-vfolder.c (vfolder_create_storage): Updated the call to - `evolution_storage_new()': pass NULL for @toplevel_node_uri. - - * component-factory.c (add_storage): Updated the call to - `evolution_storage_new()': pass NULL for @toplevel_node_uri. - -2000-12-04 Jeffrey Stedfast <fejj@helixcode.com> - - * subscribe-dialog.c (setup_subscribe_folder): Use info->full_name - rather than info->name so that we get the namespace part of the - folder path as well. - -2000-12-04 Ettore Perazzoli <ettore@helixcode.com> - - * folder-browser-factory.c: Updated to define verbs - "MessageForwardInlined" and "MessageForwardAttached" instead of - "MessageForwardInline" and "MessageForwardAttach". - - * folder-browser.c (on_right_click): Make forwarding as an - attachment the default. - - * mail-callbacks.c (forward_inlined): Renamed from `forward_msg'. - (forward_attached): Renamed from `forward_attach'. - * mail-callbacks.h: Updated accordingly. - -2000-12-01 Dan Winship <danw@helixcode.com> - - * session.c (mail_session_remember_password): Writes out passwords - (to .gnome_private) in our patented proprietary "Best Awesome - Super Encryption 64" ("BASE64") format which could not possibly - ever be cracked by even the most cryptographically knowledgeable - five-year-olds. - (mail_session_init): Load remembered passwords at startup. - (mail_session_forget_passwords): Erase them from disk as well as - memory. - - * mail-config.c: Add "remember_password" field to - MailConfigService. - (mail_config_write_on_exit): Call mail_session_remember_password - for services with "remember_password" set. - * mail-config-gui.c: Add "remember password" checkbox to the - dialogs, and make it appear and disappear as appropriate. - - * component-factory.c (mail_load_storages): Unref the store - regardless of whether or not we're using it, so we don't leak - references to non-storage stores. - -2000-12-01 Jeffrey Stedfast <fejj@helixcode.com> - - * message-list.c (e_mail_address_new): Perform better - error-handling. - -2000-12-01 Radek Doulik <rodo@helixcode.com> - - * mail-ops.c (mail_op_report_status): use mail_op_set_message_plain - - * mail-threads.c (mail_op_set_message_plain): plain version of - mail_op_set_message, doesn't use printf, passes message untouched, - use set_message - (mail_op_set_message): set_message - (set_message): helper function - -2000-11-30 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-ops.c (cleanup_fetch_mail): Don't display a dialog, instead - inform the user that there was no new mail by setting a status - message. - - * message-list.c (message_list_drag_data_get): Use the new - e_str_make_safe function. - - * mail-display.c (make_safe_filename): And here. - - * mail-config.c (mail_config_folder_to_cachename): Here too. - -2000-11-30 Not Zed <NotZed@HelixCode.com> - - * mail-ops.c (cleanup_load_folder): Set threaded view before - setting the folder (cleanup some flash ons tartup). - - * message-list.c (message_list_init): Initialise a mempool for uid - string storage. - (new_id_from_uid): Added messagelist arg, allocate strings from - uid_pool. - (new_id_from_subject): Same. Fixed all callers. - (remove_node_diff): Dont free uid here. - (build_flat_diff): Nor here. - (clear_tree): Flush the mempool, rather than freeing the id's - directly. - (free_tree_ids): Removed, no longer required. - (free_tree_ids): Likewise. - (message_list_init): Dont connect to the table destroy signal - anymore to free the uid table. - (message_list_destroy): Free the uid pool here. - (*): Use accessors for messageid stuff. - (content_is_attachment): Removed, no longer required. - (ml_tree_value_at): Get the attachment flag directly from the - summary. - (ml_tree_value_at): For 'fake' nodes, try and do something better - than "?" for from, to, and size. - (subtree_size): New function, add up the total size of a subtree. - (subtree_earliest): Get the earliest date from a subtree. - (ml_tree_value_at): Return earliest date sent/received for fake - nodes. - (ml_tree_value_at): Return something to mark a fake subject line - as a fake subject, although i dont know, i guess this buggers up - sorting ... - (subtree_size): Check the info node is still there. - (subtree_earliest): Same here. - (subtree_unread): And here. The info node might vanish if the - folder has changed/is changing and we try and redraw stuff while - its doing it. - (message_list_drag_data_get): Use accessors. - -2000-11-29 Jeffrey Stedfast <fejj@helixcode.com> - - * message-list.c (message_list_drag_data_get): Implement. - (message_list_init): Connect the d&d signal. - - * mail-ops.c (do_save_messages): Use camel a bit more to help us - out. Don't create the file ourselves, treat it as a CamelFolder so - we don't have to worry about formatting. - -2000-11-29 Dan Winship <danw@helixcode.com> - - * main.c (main): Remove no-longer-needed e_unicode_init. - - * mail-tools.c (mail_tool_quote_message): Fix the allocation here - (again) and put a comment explaining it. (Fixes a crash when - replying.) - -2000-11-28 Dan Winship <danw@helixcode.com> - - * component-factory.c (owner_set_cb): Wait until after setting up - the local storage to find the Drafts/Outbox/Sent folders. - - * mail-ops.c (do_setup_folder): Use the file: store rather than - mbox:. - -2000-11-28 Jeffrey Stedfast <fejj@helixcode.com> - - * folder-browser-factory.c: Added the SaveAs bonobo menu verb - thingy. - - * mail-callbacks.c (save_msg): New callback for saving messages. - (save_msg_ok): - - * folder-browser.c (on_right_click): Add a Save As menu item. - - * mail-ops.c (cleanup_save_messages): Save all emails to the path - given. - -2000-11-28 Dan Winship <danw@helixcode.com> - - * mail-local.c (cleanup_register_folder): Fix the initial unread - counts after the last patch. - -2000-11-27 Dan Winship <danw@helixcode.com> - - * mail-local.c (local_folder_changed): This needs to run from the - main thread, not the camel thread, so add a proxy signal handler - to call mail_op_forward_event. Fixes hangs (eg bugzilla #909). - -2000-11-27 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-display.c: Removed some unecessary debugging printf's - -2000-11-27 Dan Winship <danw@helixcode.com> - - * mail-config-druid.glade: Revert the new druid for now, until the - corresponding code is done, so that the druid will work again. - -2000-11-21 Iain Holmes <iain@helixcode.com> - - * mail-config-gui.c (mail_config): Don't use the "delete-event" - signal. - -2000-11-21 Iain Holmes <iain@helixcode.com> - - * mail-display.c (pixbuf_for_mime_type): free fm_icon. - - * component-factory (summary_fn): Remove the configure param. - (factory_destroy): Made into a generic function so that the - summary_factory can be ref-counted as well as the normal - factory. - -2000-11-21 Dan Winship <danw@helixcode.com> - - * Makefile.am: add GPGME_CFLAGS and GPGME_LIBS - -2000-11-21 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-config.c (mail_config_view_source): New function to return - if user wants to view message source. - (mail_config_set_view_source): New function to set whether the - view wants to view source. - - * mail-ops.c (mail_do_view_message_sources): Removed. We're not - gonna view-source this way anymore. - - * folder-browser-factory.c: Removed the ViewSource bonobo verb - from the Message menu. - (control_activate): Added ViewSource. - - * folder-browser.c (on_right_click): Removed Message menu item to - view message source. - (folder_browser_toggle_view_source): New callback to set whether - or not the MailDisplay shows the raw message or the pretty-ified - message. - - * mail-callbacks.c: Removed view_source. - - * mail-display.c (redisplay): If toggle_raw is set then display - the raw message else display the pretty formatted message. - (mail_display_redisplay): New function to force the redisplay of a - message. - - * mail-format.c (mail_format_raw_message): New function to - write the raw message data. - -2000-11-21 Not Zed <NotZed@HelixCode.com> - - * mail-vfolder.c (vfolder_uri_to_folder): IF we dont find a - source, clear the exception and ignore it silently. for e.g. if - the user reconfigured their mailboxes and one of them no longer - exists. - -2000-11-21 Radek Doulik <rodo@helixcode.com> - - * mail-display.c: #include <gtkhtml/gtkhtml-embedded.h> - -2000-11-21 Not Zed <NotZed@HelixCode.com> - - * message-thread.[ch]: Removed. No longer serves a purpose. - - * Makefile.am (evolution_mail_SOURCES): Removed message-thread.[ch]. - - * message-list.c (build_subtree): - (node_equal): - (add_node_diff): - (build_subtree_diff): - (do_regenerate_messagelist): - (cleanup_regenerate_messagelist): Changed to use camel-folder-thread. - (message_list_set_folder): If we get set a new folder, unhook any - events before unrefing the folder too (the folder is never reset - currently, but this would cause problems). - (subtree_unread): Check for uid null, wont crash, but its a bug. - (ml_tree_value_at): If the uid is null, then fake an obviously bad - line. - (build_subtree): Yeah well, we can't like freeze/thaw here, - because this is called recursive, and freeze/thaw isn't - recursive, like pre model and post model change was. - (build_tree): Maybe we can try it here, although i dont think - it'll help much. - (build_flat): And this is also a tree. yes a tree. - (build_tree): Added changes arg. If set, then try the 'diff' - approach, unless the tree is already empty. - (message_list_set_threaded): Dont clear the tree here. - (message_list_set_search): Or here. - -2000-11-20 Not Zed <NotZed@HelixCode.com> - - * message-list.c (save_node_state): Save out the md5 hash of the - messageid as hex, since thats all we have for those nodes. - (build_subtree): Expand the messageid to a hex string first, then - check it. - (add_node_diff): And the same here. - - * message-thread.c (thread_messages): Changed for changes to - messageid/references items. - (id_hash, id_equal): New functions to hash on the binary message id hash. - (thread_messages): removed some more no longer used dead code. - -2000-11-20 Jeffrey Stedfast <fejj@helixcode.com> - - * message-list.c (e_mail_address_compare): New comparison function - that will replace address_compare if/when we ever go to save the - preparsed addresses in the ETable rather than parsing them each - time. Also fixed it so that we should get better sorting when - addresses don't contain name parts (I was checking for NULL but - not '\0'). - (address_compare): Use e_mail_address_compare. - -2000-11-19 Peter Williams <peterw@helixcode.com> - - * mail-ops.c (update_changed_folders): Instead of making the CORBA - call in the dispatch thread, store the new display names and have - cleanup_fetch_mail make the CORBA calls. Fixes deadlocks. - (cleanup_fech_mail): Loop through the update_infos and make the - CORBA calls. - (setup_fetch_mail): Clear some new data items. - -2000-11-17 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-format.c (mail_generate_reply): Use the new quote_message - function and make it start with "On %s, %s wrote:" since people - seem to want that. - - * mail-ops.c (cleanup_forward_messages): Use the new quote_message - function. - - * mail-tools.c (mail_tool_quote_message): New convenience function - to quote a message body (since both the reply and forward code do - similar quoting) - -2000-11-17 Not Zed <NotZed@HelixCode.com> - - * message-list.c (message_list_destroy): Before we destroy - ourselves, unhook ourselves from the folder update events. Should - fix a common crash on exit case. - -2000-11-16 Jeffrey Stedfast <fejj@helixcode.com> - - * folder-browser-factory.c: Added the MessageViewSource bonobo - menu verb. - - * mail-ops.c (mail_do_save_messages): New async function to save - messages as individual files in a given path. - -2000-11-15 Jeffrey Stedfast <fejj@helixcode.com> - - * folder-browser-factory.c: Added a new Forward as Attachment - bonobo menu item verb. - - * mail-view.c (view_forward_msg): Updated to reflect changes to - mail_do_forward_message(). It now forwards the message without - attaching it - is this what we want? - - * mail-ops.c (mail_do_view_message_sources): New async function to - display message source dialog windows. - (setup_forward_messages): If we were asked not to forward the - message(s) as attachment(s) and the user chose more than a single - message, then default to making each message an attachment. - (cleanup_forward_messages): If we aren't forwarding the message as - an attachment, then quote the text and set the composer's body - with it. - - * mail-callbacks.c (view_source): New callback to view the message - source of all messages that are currently selected. - (forward_attach): New callback to forward a message as an - attachment (forward_msg is now for forwarding a message without it - being an attachment). - (forward_message): Convenience function for forwarding messages. - -2000-11-13 Jeffrey Stedfast <fejj@helixcode.com> - - * subscribe-dialog.c (subscribe_do_subscribe_folder): Take a - 'subscribe' argument so that this can function as a subscribe AND - unsibscribe method. - (describe_subscribe_folder): Updated. - (do_subscribe_folder): Updated. - (cleanup_subscribe_folder): Updated. - (subscribe_folder_info): Pass along a TRUE as the 'subscribe' - param. - (unsubscribe_folder_info): Pass along a FALSE as the 'subscribe' - param. - -2000-11-13 Christopher James Lahey <clahey@helixcode.com> - - * message-list.c: Removed some e_table_model calls and replaced - them with e_tree_model calls. - -2000-11-12 Dan Winship <danw@helixcode.com> - - * mail-local.c (mail_do_register_folder): Do this the normal way - rather than calling mail_operation_wait_for_finish. There was some - reason for it originally, but it no longer applies. This makes - adding new folders from the folder selection dialog no longer - hang. - -2000-11-12 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-ops.c (do_filter_ondemand): Sync the source folder. - -2000-11-11 Matt Bissiri <bissiri@eecs.umich.edu> - - * evolution-mail.oafinfo: - * mail-threads.c: (retrieve_shell_view_interface_from_control): - Update the remaining "IDL:Evolution*" to "IDL:GNOME/Evolution*" - to sync up with yesterday's IDL re-scoping. - -2000-11-10 Michael Meeks <michael@helixcode.com> - - * Makefile.am ($(EVOLUTION_MAIL_CORBA_GENERATED)): sort include order. - -2000-11-09 Jeffrey Stedfast <fejj@helixcode.com> - - * subscribe-dialog.glade[.h]: New glade file for possibly using to - create the subscribe dialog. - -2000-11-08 Radek Doulik <rodo@helixcode.com> - - * mail-format.c (mail_generate_reply): likewise - - * mail-callbacks.c (create_msg_composer): added send_html arg to - e_msg_composer_new_with_sig_file call - -2000-11-07 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-search-dialogue.c (mail_search_dialogue_construct): Allow - rule part to expand when the user resizes the dialog. - -2000-11-07 Jeffrey Stedfast <fejj@helixcode.com> - - * folder-browser.c (search_save): Don't handle custom searching - anymore... we don't want this. - (search_full): Same. - (folder_browser_search_menu_activated): Set the search entry - widget sensitive. - (folder_browser_search_query_changed): Same. - -2000-11-07 Jeffrey Stedfast <fejj@helixcode.com> - - * folder-browser.c (search_full_clicked): Updated to use the - ESearchBar object rather than the previously used search widgets. - (search_full): Same. - (search_save): Same. Also use enums to make it a little easier to - read now that we have to have enums anyway. - (folder_browser_search_menu_activated): New ESearchBar menu - callback. - (folder_browser_search_query_changed): New ESearchBar query - callback. Replaces search_set() - (folder_browser_clear_search): Updated to use the ESearchBar - object rather than the previously used search widgets. - (folder_browser_gui_init): Don't hand construct a search widget, - use the new ESearchBar convenience widget. - - * mail-ops.c (cleanup_load_folder): Updated to reflect changes to - FolderBrowser. - -2000-11-07 Jesse Pavel <jpavel@helixcode.com> - - * mail-display.c (pixmap_press): modified some of the EPopupMenu - structures to account for differences in the popup menu API (as - informed by Jeff. - (on_object_requested): passed the user's default email address - to the iTip control. - -2000-11-07 Ettore Perazzoli <ettore@helixcode.com> - - * Makefile.am (INCLUDES): Add the composer dirs. - -2000-11-07 Not Zed <NotZed@HelixCode.com> - - * mail-display.c (on_object_requested): God, I sure wish people - would listen when i'm saying i'm changing and API. I mean - I even mailed everyone and everything. Can't see any changelog - either. - -2000-11-06 Not Zed <NotZed@HelixCode.com> - - * mail-autofilter.c (rule_from_message): Updates for api changes. - - * mail-tools.c (mail_tool_generate_forward_subject): Fixed for api - changes. Sigh, whoever wrote the multithread code of the mailer, - had little idea. You can't just lock for getting a const value, - until you are finished with it, cause the owner still owns it. - Fixed this too. Yuck, what a horrid forwarding format, can we - change this, or make it configurable? The mail headers show who - forwarded it, we dont need to duplicate it in that UGLY subject. - - * mail-format.c (write_field_to_stream): Removed some jeffness. - dont g_strdup stuff we dont need to, and remove the - value_is_encoded thing since we can get the unencoded address - now. - (write_address): New function to write an address field. - (write_headers): Uses write_address to write addresses, cleaner, - fixed the god-awful unreadable indenting too. - (handle_text_plain): Use a 'smarter' printf format, so we dont - need to allocate and copy substrings unecessarily (esp since - they're about to be allocated any copied another few times - anyway *sigh*). - (write_field_to_stream): Commented out the isprint check, which - afaik serves no purpose. - (list_add_addresses): New function to build a list of - display-ready addresses. Although I think the composer then uses - these as internet-ready addresses. It should probably take a list - of CamelAddress's if thats what it wants. - (mail_generate_reply): Cleaned up the address list creation stuff - a heap, and fixes for camel api changes. Also fixed a small - memory leak as a side effect (fulladdr wasn't freed if it was the - same as the sender). - - * mail-display.c (on_object_requested): Changed for interface - changes to the from address. I think passing the encoded - (internet version) of the address is right here. - -2000-11-06 Jeffrey Stedfast <fejj@helixcode.com> - - * folder-browser.c (on_right_click): Move filter stuff into a - submenu of the popup menu. - -2000-11-06 Jesse Pavel <jpavel@helixcode.com> - - * mail-display.c: used Camel to parse the full address before - passing the email address to my iTip control. - -2000-11-06 Dan Winship <danw@helixcode.com> - - First draft of folder tree unread message indication for /local - mail folders. - - * mail-local.c: Add a new CamelStore subclass, MailLocalStore, - which attaches to an Evolution_LocalStorage on one side and - CamelSession on the other, and keeps track of local folders. Some - of this code was previously in mail-local-storage.c, which no - longer exists. - (local_reconfigure_folder, etc): Various mail_op-related cleanups, - and wrap d() around a bunch of printfs. - - * mail-tools.c (mail_tool_get_local_inbox_url, - mail_tool_get_local_movemail_url): Removed - (mail_tool_get_local_inbox): Simplified. - (mail_tool_do_movemail): Remove unused dest_url variable. - (mail_tool_uri_to_folder): Simplify. Now down to two cases - (vfolder, and everything else). - - * component-factory.c (owner_set_cb): Pass evolution_dir to - mail_local_storage_startup. - - * Makefile.am (evolution_mail_SOURCES): Remove - mail-local-storage.[ch] - - * mail-summary.c: Remove mail-local-storage.h include - -2000-11-06 Kjartan Maraas <kmaraas@gnome.org> - - * mail-autofilter.c: Fix up #include <config.h> - * mail-crypto.c: Same here. - * mail-search-dialog.c: Here too. - * main.c: Fix indentation of #ifdef - * message-thread.c: Fix include. - -2000-11-06 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-callbacks.c (delete_msg): Don't invert the flag. - (undelete_msg): Same (when multiple messages are selected). - -2000-11-06 Jeffrey Stedfast <fejj@helixcode.com> - - * folder-browser-factory.c: Updated to have the same menu items as - the new right-click menu - eventually these 2 menus should be the - same. - - * folder-browser.c (on_right_click): Now correctly handles the - case of multiple selection. - - * mail-callbacks.c (enumerate_msg): Make public so it can be used - in other source files (it's a useful function!) - -2000-11-05 Jeffrey Stedfast <fejj@helixcode.com> - - * folder-browser.c (on_right_click): Added an "Undelete" option to - the right-click menu and also set a mask so it was only selectable - if the message is marked as deleted. Also set a mask for "Mark as - Read" and "Mark as Unread". - - * mail-callbacks.c (undelete_msg): New callback to undelete - messages. - -2000-11-03 Dan Winship <danw@helixcode.com> - - * message-list.c (cleanup_regenerate_messagelist): don't free the - MessageList search when it's being reused - -2000-11-03 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-local.c (mail_local_map_uri): Don't show the passwd in the - url string. - (mail_tool_local_uri_to_folder): Same. - (do_reconfigure_folder): Same. - -2000-11-03 Jeffrey Stedfast <fejj@helixcode.com> - - * Makefile.am: Added new header files. - - * component-factory.c (owner_set_cb): - s/session_init/mail_session_init - - * session.c: Renamed public functions to mail_session_*. - FIXME: Rename session.c to mail-session.c - - * folder-browser-factory.c: #include "mail-callbacks.h", #include - "mail-session.h" and replace forget_passwords with - mail_session_forget_passwords - - * mail.h: Move session prototypes to mail-session.h, Move - mail-crypto prototypes to mail-crypto.h, Move mail-callback - prototypes to mail-callbacks.h - - * mail-session.h: New header file containing public prototypes - for session.c - - * mail-format.c: #include "mail-crypto.h" - - * mail-view.c: - * folder-browser.c: #include "mail-callbacks.h" - - * mail-crypto.h: New header file containing public prototypes - for mail-crypto.c - - * mail-callbacks.h: New header file containing public prototypes - for mail-callbacks.c - - * message-list.c (message_list_get_layout): Set useful defaults. - (message_list_setup_etable): Don't set the Outbox defaults on a - folder just because it doesn't have a corresponding saved file. - -2000-11-03 Dan Winship <danw@helixcode.com> - - * mail-config-gui.c (service_page_item_new): url_flags are now on - CamelProvider, not CamelService - - * main.c: - * subscribe-dialog.c: - * mail-threads.c: Kill warnings - -2000-11-03 Federico Mena Quintero <federico@helixcode.com> - - * Makefile.am: Clean the idl-generated files properly. - -2000-11-03 Not Zed <NotZed@HelixCode.com> - - * mail-view.c: Added mail-display.h. - - * mail-autofilter.c: Removed unecessary headers. Who ran indent - over this code? Sigh. - - * mail-ops.c (display_message_input_s): Added messagedisplay. - (mail_do_display_message): Added messagedisplay arg. - (mail_do_display_message): Dont bother doing another thread when - we know we dont have a uid. - (): Added folder-browser.h to headers. Sigh. - - * folder-browser-factory.c (control_activate): Setup the - viewthreaded callback to the folder_browser function. - - * folder-browser.c (my_folder_browser_init): Connect to - right_click of etable of the messagelist here. - (on_right_click): Changed for argument changes. - (folder_browser_toggle_threads): Changed to take a fb, and to set - threaded mode on the messagelist. - (my_folder_browser_init): Connect also to the double_click signal. - (my_folder_browser_init): Connect to the message_selected signal - of the message_list. - (on_message_selected): Signal handler for message selected. - (my_folder_browser_init): Fix for change to message_list_new(). - - * message-list.h: Dont include folder-browser.h. - (message_list_toggle_threads): Moved into folder-browser.h. - (struct _MessageList): Removed folderbrowser. - - * mail.h: Dont include folder-browser.h here either, but - mail-types.h instead. - Moved prototypes moved into folder-browser.c into - folder-browser.h. (vfolder_*, filter_*). - - * mail-display.h: Dont include folder-browser.h here, but - mail-types.h and specific camel headers. - - * message-thread.c (sort_node): Invert the sort order logic so the - list is sorted in mailbox order, not reverse mailbox order. - - * message-list.c (free_tree_ids): Fix a merge foo. - (remove_node_diff): Removed unused row argument. Fixed - callers/prototype. - (clear_tree): pre_change on the removal of the root node. - (build_flat): Only perform pre_change if we are rebuilding the - whole lot. For incremental change let etable do its thing. - (build_tree): Likewise for building the tree view. If making - incremental updates, do them as we build it. - (vfolder_subject): - (vfolder_sender): - (vfolder_recipient): - (filter_subject): - (filter_sender): - (filter_recipient): - (filter_mlist): - (on_right_click): Moved to folder-browser.c, where they belong. - (message_list_init): Dont connect to right_click anymore. - (message_list_toggle_threads): Moved to folder-browser.c, renamed. - (on_double_click): Moved to folder-browser.c - (on_click): Set the flags directly, rather than in anothre thread, - which is just not necessary. - (message_list_class_init): Added a new signal 'message_selected', - to indicate when a message was selected. - (on_cursor_change_idle): Emit a signal, rather than directly - triggering the display update. - (select_row): Removed, no longer used. - (idle_select_row): And this too. - (select_msg): Removed as well. - (message_list_select): Emit a signal, rather - thandisplaying/clearing the mail-display directly. - (mark_msg_seen): Moved to folder-browser.c - (message_list_new): Removed folderbrowser argument. - -2000-11-02 Jeffrey Stedfast <fejj@helixcode.com> - - * message-list.c (on_right_click): Sync with message - menu. Addresses bugzilla bug #778. - -2000-11-02 Christopher James Lahey <clahey@helixcode.com> - - * message-list.c: Turn on draw grid for the main ETable (this may - not be working in ETable itself.) - -2000-11-01 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-threads.c (mail_op_set_message): fmt argument should be - const. - -2000-11-01 Dan Winship <danw@helixcode.com> - - Make "Get Mail" even more functional on IMAP (scans all folders), - and do a first cut at folder tree highlighting (for IMAP/news - only). - - * mail-ops.c (do_fetch_mail): For imap (sigh, we *still* shouldn't - be hardcoding that), rescan the store's folder tree, rescan each - changed folder for new messages, and update the shell folder tree. - (do_scan_subfolders): Update for component-factory.c changes, and - set folder display names and highlights appropriately when - building the storage. - - * component-factory.c (add_storage): Make this static (was - mail_add_new_storage). Use camel_service_get_name for the name - rather than url->host. (Among other things, this lets you use a - single machine as both an IMAP server and a news server.) - (mail_lookup_storage): Hash storages based on their CamelStore - rather than the URL. - (factory_destroy): Disconnect each of the CamelStores in the - storages_hash. - - * subscribe-dialog.c (cleanup_subscribe_folder): - * mail-vfolder.c (vfolder_refresh): Pass "highlighted" flag to - evolution_storage_new_folder - -2000-11-01 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-ops.c (mail_op_report_status): Don't call the default - logging function. - (do_fetch_mail): Set the logfile and don't pass the logfile to - filter_driver_set_status_func - it's purpose has been altered. - (do_filter_ondemand): Same. - -2000-11-02 Not Zed <NotZed@HelixCode.com> - - ** Merged in camel-incremental-branch. - - * mail-format.c (mail_get_message_body): Jeff! Sigh. - We should definetly not be strduping the - content, it has already been copied and duplicated. Look at - get_data_wrapper_text. - -2000-11-01 Chris Toshok <toshok@helixcode.com> - - * subscribe-dialog.h: add fields search_entry and search_top. - - * subscribe-dialog.c: add mail-ops.c style async operations for - getting the store (to remove deadlock in the case where a auth - dialog is dismissed at startup and then the subscribe dialog is - brought up), and subscribing/unsubscribing to folders. One case - remains, that is getting the list of all folders. - (subscribe_search): flesh out this function - (build_tree): use the search_top field so we can search for - groups/folders. - (subscribe_dialog_destroy): free search_top. - (subscribe_dialog_construct): init search_top. - -2000-10-30 Iain Holmes <iain@helixcode.com> - - * mail-summary.c (generate_folder_summaries): Fix spelling :) - Set folder->uri to NULL for the Inbox. - -2000-10-26 Iain Holmes <iain@helixcode.com> - - * mail-summary.c (generate_html_summary): Add view:// uris to - switch the display to that folder. - -2000-11-01 Jeffrey Stedfast <fejj@helixcode.com> - - * folder-browser-factory.c: Hmmm, someone can't spell Filder, - er...I mean Filter ;-) - -2000-11-01 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-autofilter.c (rule_from_message): If the name is NULL or - empty, then set the title to "Mail from <address>". Closes - bugzilla bug #777. Also when filtering on Subject, set the file - name to "Subject is <subject>" rather than just "<subject>" - I - think this is a bit more user-friendly. - (strip_re): Use unsigned char when passing to is<type>() - functions from ctype.h. - (rule_add_subject): Use the "is" rule instead of "contains". - -2000-11-01 Jesse Pavel <jpavel@helixcode.com> - - * mail-display.c: added property bag support for Bonobo - controls, support which helps only the iTip control, currently. - -2000-11-01 Dan Winship <danw@helixcode.com> - - * mail-display.c (pixbuf_gen_idle): Lots of fixes and - simplifications. Should get rid of the "missing icon" problem. - There is still a problem with some images failing to get - thumbnails, even though they display correctly. - (pixbuf_for_mime_type): New function to try really hard to get the - right icon for a MIME type, including looking in mc and nautilus's - pixmap directories. - (on_object_requested): Always use pixbuf_gen_idle, even for - non-image types, to prevent code duplication. - -2000-10-31 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-format.c (mail_get_message_body): Shouldn't we be - strdup'ing the content? This seems to fix the memory corruption - problems. - (mail_generate_reply): Make sure that the last char in the - generated reply text is '\0' (when body text doesn't end with a - \n, a random char will appear otherwise). - -2000-10-31 Dan Winship <danw@helixcode.com> - - * mail-config-gui.c (do_test_service): Update for - camel_service_disconnect change. - -2000-10-31 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-autofilter.c (filter_gui_add_for_mailing_list): Match "is" - rather than "contains" now that we have the "is"-rule. - -2000-10-30 Dan Winship <danw@helixcode.com> - - * mail-config-gui.c (config_do_query_authtypes): Redo this so that - it works for all pages, not just the first page. (Now that this is - finally working again, I expect Anna to finish her redesign in the - next 15 minutes.) - (service_page_item_new): Fix up the sizing of the Auth line to - look more like everything else. - -2000-10-29 Dan Winship <danw@helixcode.com> - - * mail-tools.c (mail_tool_uri_to_folder): Simplify this a lot by - making IMAP and NNTP use the same code, now that the IMAP - namespace doesn't need special magic handling. - - * message-list.c (mail_do_regenerate_messagelist): Don't try to - regenerate the message list if there is no folder. (The Bonobo UI - code will call this as the callback for the "Threaded View" - command.) - - * mail-ops.c (do_fetch_mail): Sync the folder before refreshing so - we don't lose flag settings. - -2000-10-27 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-callbacks.c (composer_send_cb): Check to make sure that the - recipient list is neither NULL nor a 0-length list of addresses - and pop up a dialog letting the user know why we are not allowing - him/her to send the message. - -2000-10-26 Dan Winship <danw@helixcode.com> - - * mail-display.c (write_data_to_file): Don't destroy a dialog - after run_and_close'ing it. - -2000-10-26 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-callbacks.c (composer_send_cb): Check for the TO recipient - list being NULL and don't send. - -2000-10-25 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-ops.c (do_send_mail): Don't forget to unref the - FilterDriver. - - * mail-callbacks.c (apply_filters): New callback for applying - on-demand filters. (removed the old on-demand filters callback). - - * mail-ops.c (do_filter_ondemand): Rewrote to apply "incoming" - filters to all selected messages. - (mail_do_filter_ondemand): No longer takes a FilterContext - argument or a destination folder argument (why did we ever need - this last one??) but now takes a uids argument. - - * folder-browser-factory.c: Add a MessageApplyFilters menu item. - -2000-10-25 Iain Holmes <iain@helixcode.com> - - * mail-summary.[ch]: Updated for the new ExecutiveSummary code. - - * Makefile.am: Added the summary files and the evolution-services CFLAGS - and LIB stuff. - - * component-factory.c: Re-enabled the summary stuff. - -2000-10-25 Dan Winship <danw@helixcode.com> - - * main.c (main): Pass send/postpone signal handler functions to - evolution_composer_factory_init. - -2000-10-25 Jeffrey Stedfast <fejj@helixcode.com> - - * subscribe-dialog.c (subscribe_select_all): Implemented. - (subscribe_invert_selection): (was unselect_all) Implemented. - -2000-10-25 Dan Winship <danw@helixcode.com> - - * message-list.c: Add a "flagged" column, based on the Camel - "flagged" flag, for assigning an arbitrary "hey, I care about - this" flag to a message. - (ml_tree_set_value_at): Remove - (ml_tree_is_cell_editable): No, it's not. - (on_click): Handle the read/unread and flagged fields via the - click handler. Among other things, this makes it not select - a message when you change its read status. - -2000-10-24 Dan Winship <danw@helixcode.com> - - * subscribe-dialog.c (folder_info_subscribed, - subscribe_folder_info, unsubscribe_folder_info): Don't prepend "/" - to the folder's full_name. Deal with hierarchy in the - EvolutionStorage tree better. - (storage_tree_path): Helper function to build a storage path from - a CamelFolderInfo. - -2000-10-23 Dan Winship <danw@helixcode.com> - - * *: Add some missing _()s and N_()s. - -2000-10-23 Dan Winship <danw@helixcode.com> - - * Makefile.am (INCLUDES): Update EVOLUTION_LOCALEDIR. - -2000-10-23 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-ops.c (do_send_mail): Apply outgoing filters to the - message. - -2000-10-23 Christopher James Lahey <clahey@helixcode.com> - - * message-list.c: Fixed a possible error in row numberings. This - needs to be changed quite a bit anyway, but this should make - things slightly nicer in some cases. - -2000-10-23 Christopher James Lahey <clahey@helixcode.com> - - * folder-browser.c: Made the top of the folder browser a little - prettier. - - * mail-display.c, mail-vfolder.c: Made more dialogs resizable. - -2000-10-23 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-autofilter.c (filter_gui_add_from_message): Don't forget to - set the rule source! (eg "incoming", "demand", or "outgoing") - -2000-10-22 Ettore Perazzoli <ettore@helixcode.com> - - * message-list.c (message_list_init): Always display the vertical - scrollbar. - - * mail-display.c (mail_display_new): Always display the vertical - scrollbar. - -2000-10-20 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-config.h: #include <camel/camel-folder.h> - -2000-10-20 Michael Meeks <michael@helixcode.com> - - * mail.h: s/BonoboUIHandler/BonoboUIComponent/ - - * mail-callbacks.c (run_filter_ondemand): ditto. - - * session.c (forget_passwords): ditto. - -2000-10-20 Dan Winship <danw@helixcode.com> - - * evolution-mail.oafinfo: Declare composer factory. - - * main.c (main): Initialize it - -2000-10-19 Chris Toshok <toshok@helixcode.com> - - * message-list.c (nuke_uids): e-tree-model is now opaque. use the - accessor to get the root node. - -2000-10-19 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-callbacks.c: #include "mail-vfolder.h" - (vfolder_edit_vfolders): Don't call the dummy vfolder_edit - function. - - * folder-browser-factory.c: s/VFolderEdit/SetVFolder - -2000-10-19 Dan Winship <danw@helixcode.com> - - * mail-ops.c: (do_fetch_mail): For an imap store, just refresh the - INBOX. - - * folder-browser-factory.c (control_deactivate): Don't sync - non-existent folders. - * message-list.c (nuke_uids): Don't traverse non-existent trees. - -2000-10-19 Ettore Perazzoli <ettore@helixcode.com> - - * Makefile.am (glade_messages): New. - (EXTRA_DIST): Add `$(glade_messages)'. - -2000-10-19 Dan Winship <danw@helixcode.com> - - * mail-ops.c: Clean up some old #if 0 code. - -2000-10-19 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-format.c (mail_generate_reply): Get the MailConfigIdentity - *before* we create a new composer object so that we can set the - signature file. - -2000-10-18 Michael Meeks <michael@helixcode.com> - - * folder-browser-factory.c (register_ondemand): kill. - (create_ondemand_hooks): die. - (control_activate): remove hook. - - * test-mail.c (create_container): kill old UI handler. - -2000-10-18 Christopher James Lahey <clahey@helixcode.com> - - * message-list.c: Fixed some column widths. - -2000-11-02 Not Zed <NotZed@HelixCode.com> - - * message-list.c (get_message_info): Call get_message_uid to get - the uid, save some duplicated code. - (folder_changed): Handle the case of a NULL changes input. - - * message-thread.c (thread_messages): Removed pointless - variable/assignment 'container'. - (thread_messages): Try and cope with duplicate message id's. - -2000-11-01 Not Zed <NotZed@HelixCode.com> - - * mail-callbacks.c (main_select_first_unread): Changed to use 0 as - the first row to select a message. - - * mail-ops.h (mail_do_regenerate_messagelist): Removed from - header. This function is no longer public since it is really an - internal message-list function. - - * folder-browser.c (search_full_clicked): Call the set_search() - function, rather than messagelist_rebuild, which is going private. - (search_set): Same here. - (folder_browser_clear_search): And here. - (etable_key): Call message_list_select() instead of - message_list_home and message_list_end. Removing some odd code - duplication. - - * message-thread.c (do_thread_messages): Moved the mail lock to - here, rather than locking for each message lookup (which is - useless anyway). This is still not correct either, as the tree - references folder data ... but a bit better than it was. - (thread_messages): Removed the mail tool lock stuff, lock in - higher functions. - - * message-list.h: Added a threaded indicator to the message list - itself. - (threaded_view): removed a mystery variable. - - * message-list.c (do_regenerate_messagelist): Made the code a - little more readable. - (build_tree): Fixed argument to be a thread_messages struct, not a - container. - (cleanup_regenerate_messagelist): Free changeinfo. - (mail_do_regenerate_messagelist): If we are adding changes to a - flat view, we dont need to goto the other thread at all, so - process immediately. - (message_list_toggle_threads): Clear the tree if we're changing - the view mode. - (message_list_toggle_threads): And reset the rowmap, since it is no - longer valid. - (build_tree): If we are building into an already empty tree, just - build into that (probably irrelevant optimisation). - (build_subtree): Build hte subtree in the same order as we got it, - not inverted order. - (message_list_set_threaded): New function to select the threaded - view/flat view. - (mail_do_regenerate_messagelist): Removed references to - mail_config, get it from the ml->threaded var instead. - (message_list_destroy): No longer free the key data for the - uid_rowmap. - (new_id_from_uid): Convert a uid string into an id string. - (new_id_from_subject): Likewise for subject strings. - 'id' strings replace the 'uid:' and 'subject:' stuff with - accessors and macros and use less memory and is more readable. - (id_is_uid): macro to check if an id string is a uid. - (id_uid): Returns the uid part of a uid id string. - (id_subject): Returns the uid part of a subject id string. - (build_subtree): Use the new id functions, and dont duplicate the - uid in the uid rowmap, but just reference it from the tree node. - (node_equal): Use new id functions. - (add_node_diff): And here too. - (remove_node_diff): And here. Also remove the uid from the - rowmap, and dont free it anymore. - (get_message_info): And here. - (get_message_uid): And here. - (subtree_unread): And here. - (ml_tree_value_at): " - (ml_tree_set_value_at): Noted a memory leak. do_flag_messages() - doesn't free the contents of the uid array, just the uid array - (well that i can tell, teh code has more problems anyway). - (ml_tree_set_value_at): And fix the id accessors. - (save_node_state): " - (build_flat): Use id macros/functions. Dont alloc memory for hash - key. - (build_flat_diff): Use id macros. - (build_flat_diff): Remove the hash table entry before freeing its - key data (in the node). - (free_key): Removed. Keys are no longer alloc'd. - (clear_tree): When we clear the tree, also clear the uid_rowmap, - as it is no longer valid (or contains allocated keys!). - (free_tree_ids): Renamed from nuke_uids. - (free_ids_cb): Renamed from nuke_uids_cb. - (free_tree_ids): Changed arg to be a ETreeModel directly. - (ml_tree_value_at): Map id to subject using the right macro. - (free_tree_ids): Check we have any nodes to traverse first. - (build_flat): Insert to row -1 to append the nodes (faster). - (remove_node_diff): Only remove the uid rowmap entry if it is - referencing this node (i.e. the key string is the same key string, - not just a matching key string). - (add_node_diff): Remove the uid rowmap entry before inserting a - new one to force the key to be replaced. This is required as the - tree may temporarily contain duplicate messages during the - rebuilding phase. - (message_list_set_search): New function, set the search string. - Only redo the search if it has changed, etc. - (mail_do_regenerate_messagelist): Made static. There is no need - for external code to call this. - (message_list_set_folder): NOP if the new folder is the same. - (message_list_set_folder): Clear the tree before rebuilding it. - (message_list_select): Ok, this wins the award for 'most bizarre - interface'. Changed the start row to mean the end of the list if - we supply -1, rather than the start of the list. Also fixed the - endpoints (it would never select message 0 if searching - backwards). - (idle_select_row): Changed start row to 0 from -1. - (message_list_end): Removed. - (message_list_home): Removed. - (go_to_message): Removed. message_list_select can do this. - (message_list_select): Check that direction is one of the valid - ones, otherwise we could be thrown for loops. - -2000-10-31 Not Zed <NotZed@HelixCode.com> - - * message-list.c (node_equal): Compares an etree node with a - message-thread node to see if they point to the same object. - (add_node_diff): Adds a new thread node to the etree. - (remove_node_diff): Removed an etree node, freeing any additional - data. - (build_subtree_diff): Takes an existing etree definition, and a - new thread definition and makes the etree match, using as few - operations as possible. - (do_regenerate_messagelist): No longer free/clear the uid/rowmap - here. - (regenerate_messagelist_input_t): Added a tree field - are we - building a tree view? - (regnerate_messagelist_data_t): Added a tree field, if we built a - tree result. Added a changes parameter, for building diff's after - search/etc. - (mail_do_regenerate_messagelist): Setup the tree indicator. - (build_flat_diff): Apply a changeset to a message list. - (build_flat): Added a changes argument, if present, use - build_flat_diff() to build the list. - (do_regenerate_messagelist): If we are generating a threaded view, - build the threaded list here, rather in another separate - invocation. - (cleanup_regenerate_messagelist): Call build_tree directly on the - threaded list. - (message_list_init): Init the uid_rowmap hash table here instead - of somewhere odd. - (message_list_destroy): Assume uid_rowmap exists. - (do_regenerate_messagelist): Remove the code here that is messing - with the message list data (search/uid_rowmap). We're in a - different thread boys ... - -2000-10-26 Not Zed <NotZed@HelixCode.com> - - * message-list.c (cleanup_regenerate_messagelist): Fixed some - logic to make more sense (gboolean)!pointer replaced with - (pointer != NULL). - (build_tree): Put the tree pre/post change stuff in here, where it - should be. - (build_flat): Same here. - (cleanup_regenerate_messagelist): Remove model_changed stuff here. - (setup_regenerate_messagelist): Remove pre_change stuff here. - -2000-10-20 Not Zed <NotZed@HelixCode.com> - - * message-list.c (main_folder_changed): Perform incremental update - of the display for flat view. - (ml_tree_value_at): Spit out a mroe meaningful warning when we - can't find the uid in our tree, in the folder. - - * message-thread.c (thread_messages): Made public. - (thread_messages_free): Made public. - (thread_messages): Now we also return a struct _thread_messages, - which is passed to other functions. - (container_free): Renamed from thread_messages_free. - (thread_messages_free): Take a thread_messages argument. - (thread_messages_add): New function to add a list of uid's to the - thread list. - (thread_messages_remove): Likewise, for removing them. - (cleanup_thread_messages): Change for struct changes. - (do_thread_messages): Likewise. - -2000-10-19 Not Zed <NotZed@HelixCode.com> - - * mail-tools.c (mail_tool_do_movemail): removed unused var - - * folder-browser.c (search_full_clicked): Fix for api changes, - such as it can be called an api, its mroe an utter mess infact. - (search_set): Same. - (search_set): And here. - (folder_browser_clear_search): And here. - - * message-list.c (folder_changed): Copy and forward the changeinfo - list to the mian thread. - (main_folder_changed): Free the changeinfo. Todo: something smart - with this information. - (struct regenerate_messagelist_input_s): Added a changes field. - (mail_do_regenerate_messagelist): Added a change list argument. - (message_list_set_folder): Fix for mail_do_regenreate_messagelist - api. - (message_list_toggle_threads): Same. - -2000-10-18 Iain Holmes <iain@helixcode.com> - - * mail-config-gui.c (mail_config): Make all the CLists have passive - titles. - (identity_dialog): Make the default button the "OK" button, and set - the dialog to close on pressing return on the entryboxes. - -2000-10-17 Iain Holmes <iain@helixcode.com> - - * mail-config-gui.c (service_page_item_new): Disable the optionmenu - because it is empty. - (service_page_item_auth_fill): Enable the optionmenu as there's stuff - in it now. - - * mail-callbacks.c (reply_to_sender): Call check_send_configuration - when we have the FolderBrowser because if it is done in mail_reply - (with passing NULL) it will only be able to continue if the mailer - has already been configured. - (reply_to_all): Same. - -2000-10-18 Not Zed <NotZed@HelixCode.com> - - * folder-browser.c (folder_browser_gui_init): No, we REALLY dont - want to perform an immediate search as the keys are pressed. - - * mail-display.c (on_object_requested): Kill a minor warning with - a cast. - - * mail-config.c: Include mising ctype.h to kill a warning. - - * message-thread.c (main): Fixed the test case for api changes. - - * message-list.c (message_list_drag_data_get): Set some flags to - get_folder(). I dont even think this will work because - mail_tool_get_folder doesn't handle file url's. - - * mail-vfolder.c (vfolder_uri_to_folder): Pass appropriate flags. - - * mail-ops.c (do_setup_folder): Pass appropriate flags. Hmm, - whats the difference between setup and create. *shrug* - (do_create_folder): Pass appropriate flags to get_folder. Needs a - way to specify the index flag. - - * mail-tools.c (mail_tool_get_folder_from_urlname): Changed create - to flags argument. - (mail_tool_get_local_inbox_url): Add an index argument. - (mail_tool_get_local_inbox): honour index flag. - (mail_tool_get_inbox): Changed for api change. - (mail_tool_uri_to_folder): Fixed calls to store_get_folder(); - - * mail-local.c (load_metainfo): Added an indexed field to the metainfo. - (save_metainfo): And save it too. - (do_reconfigure_folder): Honour index flag when creating the new - folder. Do not open the old folder with an index at all. - (mail_local_map_uri): Add an index argument - tells if the mbox is - indexed. - (mail_tool_local_uri_to_folder): Create & pass flags properly. - (#include gnome.h): Dont include all of gnome, just what we use, - and explicity include xml-memory, so we get xmlFree(). - -2000-10-16 Jeffrey Stedfast <fejj@helixcode.com> - - * folder-browser.c (search_full_clicked): Un #if 0'd out - (search_full): Same. - (folder_browser_gui_init): Connect search_full and search_activate. - (search_set): Uncomment search_full() - - * Makefile.am: Re-add `mail-search-dialogue.h' and - `mail-search-dialogue.c'. - -2000-10-16 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-format.c (mail_generate_reply): Decode recipient names so - that they display nicely in the To and Cc fields. - (write_field_to_stream): Now takes another argument - 'value_is_encoded' so that we know if we should decode that string - before proceding onward. Since the message subject is already - decoded before it's passed in, we don't want to decode it again - (wasted cpu time and/or any 8bit chars will be assumed to be - latin1 encoded and thus the decoded value will be corrupt). - -2000-10-16 Chris Toshok <toshok@helixcode.com> - - * mail-config-gui.c (service_page_get_url): only set the url->user - field if the user string is non-NULL and not empty. - -2000-10-16 Not Zed <NotZed@HelixCode.com> - - * message-list.c (message_list_setup_etable): Uh, fixed jeff's - wrong fix for setting the speficiation (the function changed to - set_state(), as can be seen in the e_table-scrolled_load_state() - call only 2 lines above). - -2000-10-13 Not Zed <NotZed@HelixCode.com> - - * message-list.c (message_list_setup_etable): oops, chose the - wrong thing to cut out after a merge conflict. - -2000-10-15 Chris Toshok <toshok@helixcode.com> - - * message-list.c (subtree_unread): ETreePath != GNode now, use - accessors. - (ml_tree_value_at): same. - (save_node_state): same. - (save_tree_state): same. - (nuke_uids_cb): convert to e_tree_model_node_traverse required - type. - (nuke_uids): g_node_traverse -> e_tree_model_node_traverse. - -2000-10-14 Ettore Perazzoli <ettore@helixcode.com> - - * evolution-mail.oafinfo: Add "evolution:shell-component-icon" - attribute. - -2000-10-13 Jeffrey Stedfast <fejj@helixcode.com> - - * message-list.c (message_list_setup_etable): Don't free the - service name. - -2000-10-12 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-ops.c (do_fetch_mail): sync & expunge the source folder - after filtering. - -2000-10-12 Jeffrey Stedfast <fejj@helixcode.com> - - * message-list.c (message_list_setup_etable): Create the 'spec' - and 'extras' arguments and call e_table_scrolled_new() rather than - set_specification as that function no longer (?) exists. - - Also started to add drag & drop functionality to something like - Nautilus (but #if 0'd it out until I had time to finish it and - till after 0.6). - -2000-10-12 Not Zed <NotZed@HelixCode.com> - - * message-list.c (message_list_setup_etable): Duh, fix the test - for the folder name, strstr != strcmp is it. - -2000-10-10 Not Zed <NotZed@HelixCode.com> - - * message-list.c (folder_to_cachename): Removed, changed callers - to use mail_config_folder_to_cachename instead. - - * mail-config.c (mail_config_folder_to_cachename): New utility - function to get a cache name for a folder. - - * mail-tools.c (mail_tool_do_movemail): Changed to return the path - to the mbox, rather than opening a folder of it. - - * mail-ops.c (mail_incorporate_messages): Dont bother making the - pseudo messageinfo, filder_driver_filter_message will do it for - us. - (report_status): Callback to report status of filtering operation. - (do_fetch_mail): Changed significantly - for the api changes to - the filtering system. Also now incorporates a mailbox file - directly, without having to import it into a camel folder first. - (mail_incorporate_messages): Removed entirely, no longer needed. - - * mail-vfolder.c (vfolder_refresh): Fix for context api changes. - (vfolder_uri_to_folder): Likewise. - - * folder-browser-factory.c (create_ondemand_hooks): Changed for - api changes. Also only adds demand filters to the menu (fixed a - small logic bug). - -2000-10-11 Chris Toshok <toshok@helixcode.com> - - * subscribe-dialog.c (folder_etree_value_at): special case for - folders with NULL urls (which aren't selected/subscribeable). - (unsubscribe_folder_info): can't (un)subscribe from folders with - non-NULL urls. - (subscribe_folder_info): same. - -2000-10-12 Christopher James Lahey <clahey@helixcode.com> - - * message-list.c: Replace To with From except in Drafts, Outbox, - or Sent boxes. Make Subject column pay attention to text - attributes like bold and strikethrough. - -2000-10-12 Iain Holmes <iain@helixcode.com> - - * component-factory.c: Disable the executive summary. - -2000-10-11 Chris Toshok <toshok@helixcode.com> - - * subscribe-dialog.c (FOLDER_ETABLE_SPEC): set expansion to 0.0, - minimum-width to 16, and resizable to false for the subscribed - column. - (folder_info_subscribed): new function so we can do the correct - path munging. - (subscribe_folder_info): only add the folder to the storage if - there wasn't an exception subscribing it. - (unsubscribe_folder_info): same, but unsubscribing. - (folder_etree_value_at): use folder_info_subscribed. - (folder_toggle_cb): same. - (unsubscribe_folder_foreach): same. - (subscribe_folder_foreach): same. - (subscribe_dialog_gui_init): set the bold column on the text cell, - and add the subscribed pixbuf. - -2000-10-11 Anna Marie Dirks <anna@helixcode.com> - * mail-threads.c: Changed the password-getting dialog so that the - text entry has focus. - -2000-10-11 Chris Toshok <toshok@helixcode.com> - - * subscribe-dialog.c (STORE_ETABLE_SPEC): change cell type to - "string" since we're not including it in the extras. - -2000-10-11 Christopher James Lahey <clahey@helixcode.com> - - * message-list.c, message-list.h, subscribe-dialog.c: Changed - these to use the proper form for the column element. - -2000-10-11 Christopher James Lahey <clahey@helixcode.com> - - * message-list.c, message-list.h, subscribe-dialog.c: Updated - these to the new ETable style of specifications. - -2000-10-11 Chris Toshok <toshok@helixcode.com> - - * subscribe-dialog.c (subscribe_dialog_gui_init): convert to the - new gal e-table stuff. - (html_size_req): - (html_new): - (put_html): #if 0 out the html functions since description stuff - isn't used and we don't want the warnings. - -2000-10-11 Chris Toshok <toshok@helixcode.com> - - * subscribe-dialog.c (subscribe_dialog_gui_init): remove the html - description stuff for now. - -2000-10-10 Chris Toshok <toshok@helixcode.com> - - * subscribe-dialog.c (folder_toggle_cb): umm.. duh :) only - subscribe if it's not subscribed, and vice versa. - (subscribe_folder_foreach): make sure to call - e_tree_model_node_changed. - (unsubscribe_folder_foreach): make sure to call - e_tree_model_node_changed. - -2000-10-10 Chris Toshok <toshok@helixcode.com> - - * mail-ops.c (setup_scan_subfolders): add a ref to input->storage - here so that the ref/unref pattern more closely matches other - mail-ops. also, this keeps the storage from being freed when we - hit the unref in cleanup_scan_subfolders, which is important - because we maintain a reference to it in the storage_hash in - component-factory.c - - * subscribe-dialog.h: add storage field. - - * subscribe-dialog.c (subscribe_folder_info): new function, - subscribe to a folder given it's CamelFolderInfo, and add it to - the shell - we're generating a path from the name of the folder - which is bad. - (unsubscribe_folder_info): same (except we unsubscribe and remove - from the shell). - (storage_selected_cb): unref the currently selected storage. - (subscribe_dialog_destroy): unref the currently selected storage. - (subscribe_dialog_construct): sc->storage = NULL. - - * component-factory.c (mail_lookup_storage): new function, to look - up a EvolutionStorage corresponding to a CamelService. we ref the - EvolutionStorage before passing it back. - (mail_add_new_storage): insert the storage into storages_hash if - result is EVOLUTION_STORAGE_OK. - - * mail.h: add prototype for mail_lookup_storage. - -2000-10-10 Larry Ewing <lewing@helixcode.com> - - * mail-format.c (mail_generate_reply): make sure we dup the return - value of get_reply_to or get_from when building the recipient list. - -2000-10-10 Iain Holmes <iain@helixcode.com> - - * mail-summary.c (generate_html_summary): Removed the <li> from the - HTML. - -2000-10-10 Cody Russell <bratsche@gnome.org> - - * mail-threads.c: Added #include <errno.h> - -2000-10-09 Iain Holmes <iain@helixcode.com> - - * mail-summary.c: Removed the extra arguments to rule_context_load. - -2000-10-09 Chris Toshok <toshok@helixcode.com> - - * subscribe-dialog.c, subscribe-dialog.h: use our own etable to - display the stores, and get them from the mail-config api. put - #if 0'ed code in place to add/remove the folders from the shell - when they're subscribed/unsusbcribed. also, react to double - clicks in the folder etable by toggling subscription status. - -2000-10-08 Iain Holmes <iain@helixcode.com> - - * mail-summary.c (create_summary_view): Updated to use new icon code. - -2000-10-08 Iain Holmes <iain@helixcode.com> - - * mail-summary.c (generate_html_summary): Generic function to - recreate the HTML of the summary. Checks all the folder summaries. - (generate_folder_summarys): Create a summary of all the vfolders - and the Inbox. - (create_summary_view): Generate the folder summarys before the - HTML. - -2000-10-09 Ettore Perazzoli <ettore@helixcode.com> - - * folder-browser.c: Don't #include "mail-search-dialogue.h" as - it's missing from the repository. - (search_full_clicked): Temporarily `#if 0'ed out. - (search_full): Likewise. - (folder_browser_gui_init): Don't connect `search_full'. - (create_option_menu): Don't connect `search_menu_deactivate'. - (folder_browser_gui_init): Don't connect `search_activate'. - (search_set): Don't do `search_full()'. - (folder_browser_gui_init): Likewise. - - * Makefile.am (evolution_mail_SOURCES): Remove - `mail-search-dialogue.h' and `mail-search-dialogue.c' as NotZed - forgot to put them into CVS. - -2000-10-06 Not Zed <NotZed@HelixCode.com> - - * mail-search-dialogue.c: New widget, full search dialogue for - mail. - - * folder-browser.c (search_set): If we click on custom search, run - the full search dialogue. - (folder_browser_gui_init): Add a button to perform a full search. - (search_full): Bring up the mail search dialogue asynchronously. - (search_full_clicked): Handle search options. - (folder_browser_destroy): Free the saved rule if there is one - there. - (search_options[]): Added a custom option option - brings up the - full search dialogue. - (search_set): Disable the search entry if we are doing a full - search. - - * mail-vfolder.c (vfolder_create_storage): Yay, finally - depeterised this stuff. - (vfolder_uri_to_folder): Removed an irrelevant comment. - - * mail-callbacks.c (filter_edit): And here. - - * mail-ops.c (do_fetch_mail): And here too. - - * mail-autofilter.c (filter_gui_add_from_message): Fixed call to - context_load. - (filter_gui_add_for_mailing_list): And here too. - - * folder-browser-factory.c (create_ondemand_hooks): Remove that - ondemand callback snot. - -2000-10-05 Not Zed <NotZed@HelixCode.com> - - * message-list.c (message_list_init_etable): Build the etable once - we know what folder we are going to use. - (save_header_state): Save the header spec to a cache file. - (message_list_destroy): Save the header spec. - (message_list_setup_etable): Setup the etable spec for this - folder, from a saved version if one exists, or to suit the folder - type (sent/received). - (message_list_set_folder): Setup the etable here once we have a folder. - -2000-10-09 Michael Meeks <michael@helixcode.com> - - * message-list.c (message_list_toggle_threads): re-write. - - * folder-browser-factory.c (control_activate): update paths, need - CVS HEAD bonobo, use a listener not a verb. - -2000-10-08 Miguel de Icaza <miguel@helixcode.com> - - * mail-ops.c (mail_incorporate_messages): Tag string for translation - (do_flag_messages): ditto. - - * mail-threads.c (pipe_write): Repeates writes on EINTRS. - (pipe_read): Repeats reads on EINTRS. - (mail_operation_queue): Use pipe_write - (mail_op_set_percentage): ditto. - (mail_op_hide_progressbar): ditto. - (mail_op_show_progressbar): ditto. - (mail_op_set_message): ditto. - (mail_op_get_password): ditto. - (mail_op_error): ditto. - (mail_op_forward_event): ditto. - (mail_operations_terminate): ditto. - (dispatch): use pipe_read. - (dispatch): use pipe_write - (dispatch): ditto. - - * mail-ops.c (mail_incorporate_messages): Only show message being - incorporated every 2 seconds, to avoid a bunch of CORBA round trips. - (do_transfer_messages): ditto. - (do_forward_messages): ditto. - -2000-10-07 Miguel de Icaza <miguel@helixcode.com> - - * mail-ops.c (do_fetch_mail): Move the functionality to - incorporate messages into mail_incorporate_messages. - (mail_load_evolution_rule_context): New function. Move the - functionality for loading the context rules to its own function. - -2000-10-06 Iain Holmes <iain@helixcode.com> - - * mail-summary.c: Fix the locking up of the mail by only calling - camel functions from the camel thread, and ORBit functions from - the GTK thread. Watch for the message-changed signal again. - - * component-factory.c (summary_fn, component_factory_init): - Re-enabled it, cos I think it works again. - - * mail-display.h: Remove the pb_cache. - - * Makefile.am: Readd the mail-summary.[ch] files and add the - evolution-services library to the link. - -2000-10-06 Chris Toshok <toshok@helixcode.com> - - * mail-ops.c (do_scan_subfolders): set the @subscribed_only - parameter to TRUE, since the subscribe UI is the only interface - that should show unsubscribed groups. - -2000-10-06 Ettore Perazzoli <ettore@helixcode.com> - - * mail-ops.c (do_scan_subfolders): Add missing @subscribed_only - parameter in the call to `camel_store_get_folder_info()'. [FALSE, - I hope that's right.] - -2000-10-05 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-format.c (write_field_to_stream): Decode the header before - writing it to the header box. - - * mail-callbacks.c (send_receieve_mail): fetch mail before - sending, this is a temp fix for POP-before-SMTP authentication. - -2000-10-05 Michael Meeks <michael@helixcode.com> - - * component-factory.c (summary_fn, component_factory_init): - Disable summary stuff, it appears to be badly broken. - - * Makefile.am (evolution_mail_SOURCES): add mail-summary.[ch] - - * subscribe-dialog.c (update_pixmaps): upd. - (set_pixmap): upd. - (subscribe_dialog_gui_init): upd. - remove redundant and annoying forward definitions. - - * folder-browser-factory.c (control_deactivate): upd. - (control_activate_cb): upd. - (control_activate): upd. - (set_pixmap): upd. - (update_pixmaps): upd. - (register_ondemand): upd. - (create_ondemand_hooks): upd. - -2000-10-04 Jeffrey Stedfast <fejj@helixcode.com> - - * message-list.c (address_compare): Use CamelInternetAddress - instead of my quick hack (aka InternetAddress). - -2000-10-05 Iain Holmes <iain@helixcode.com> - - * mail-summary.c: Don't watch for the message-changed signal. - -2000-10-05 Iain Holmes <iain@helixcode.com> - - * component-factory.c (component_factory_init): Setup the summary - factory as well. - (summary_fn): New function to create the ExecutiveSummaryComponent. - - * mail-summary.c: Create the view, and update it when something - changes. - -2000-10-04 Iain Holmes <iain@helixcode.com> - - * mail-display.c (on_object_requested): Removed the pixbuf cache - as it would return the pixbufs in the reverse order every so often - and generally get all confused. - -2000-10-04 Dan Winship <danw@helixcode.com> - - * folder-browser-factory.c (control_deactivate): Add back the - "sync folder on leave" hack that got lost in the UIHandler merge. - -2000-10-04 Jeffrey Stedfast <fejj@helixcode.com> - - * folder-browser-factory.c: Instead of UnSelectAll, we want - InvertSelection. - - * mail-callbacks.c (select_all): Finished this function. - (invert_selection): Finished. (was unselect_all - but that's not - what we really wanted as it'd be pointless. invert_selection is a - much more useful callback :-) - -2000-10-04 Chris Toshok <toshok@helixcode.com> - - * mail-tools.c (mail_tool_get_root_of_store): remove news specific - check. - (mail_tool_uri_to_folder): news: -> nntp: - -2000-10-04 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-ops.c (do_filter_ondemand): Don't expunge the source - mailbox on completion. - -2000-10-04 Dan Winship <danw@helixcode.com> - - * mail-ops.c (do_scan_subfolders): Don't try to add_folders if - get_folder_info returned NULL. - -2000-10-04 Not Zed <NotZed@HelixCode.com> - - * message-list.c (message_list_init_header): Fix the attachment - icon width. - (content_is_attachment): Perform some simple tests to see if the - message contains an attachment. - (build_subtree): Kill a pointless warning. - -2000-10-04 Miguel de Icaza <miguel@helixcode.com> - - * mail-callbacks.c (delete_msg): Added a comment to a piece of - code that I was trying to "fix" just to find that the strange - behaviour here that was about to be fixed, was actually a fix to - the problem I was trying to fix. - - So put the original comments from Dan, and will hope that someone - with more knowledge about this can figure why the delete key wont - delete messages and select the next unread message. - -2000-10-02 Chris Toshok <toshok@helixcode.com> - - * subscribe-dialog.c (subscribe_dialog_destroy): destroy our - tree_model and remove the root node. also, release_unref our - control and view, and unref the listener. - - * mail-tools.c (mail_tool_uri_to_folder): news url's contain host - names too, now. - -2000-10-02 Chris Toshok <toshok@helixcode.com> - - * subscribe-dialog.c, subscribe-dialog.h: add a - storage-set-view-listener, and add a little printf saying what - storage was selected. - -2000-10-02 Chris Toshok <toshok@helixcode.com> - - * subscribe-dialog.c (subscribe_dialog_gui_init): get - Evolution::StorageSetView interface on our storage set view - control, and set "show_folders" to FALSE. - -2000-10-02 Chris Toshok <toshok@helixcode.com> - - * Makefile.am (INCLUDES): add -I$(top_srcdir)/widgets/misc - - * subscribe-dialog.c (subscribe_dialog_gui_init): change the - window title to Manage Subscriptions, bold subscribed folders, and - add a title bar ala the evolution shell (but without the close - button). - -2000-10-02 Chris Toshok <toshok@helixcode.com> - - * subscribe-dialog.h: add fields for the storage set - Bonobo_Control and Evolution_StorageSetView interfaces. - - * subscribe-dialog.c (subscribe_dialog_gui_init): create the uih - as early as possible, and add the storage set view to the left - side of the hpaned. - -2000-09-22 Michael Meeks <michael@helixcode.com> - - * folder-browser-factory.c (set_pixmap): upd. - (control_activate): upd. - -2000-10-02 Dan Winship <danw@helixcode.com> - - * mail-config-gui.c: Remove "Port" entry from source dialog. We'll - use "host:port" like Netscape and other programs do. - (service_page_get_url): If host ends in ":###", use that as port. - (service_page_set_url): If URL contains a port, append it to the - hostname, separated by a colon. - -2000-10-02 Chris Toshok <toshok@helixcode.com> - - * Makefile.am (evolution_mail_SOURCES): subscribe-control.[ch] -> - subscribe_dialog.[ch] - - * mail-callbacks.c (manage_subscriptions): subscribe_control -> - subscribe_dialog. Also, pass the shell to subscribe_dialog_new. - - * mail-types.h: SubscribeControl -> SubscribeDialog. - - * subscribe-dialog.c, subscribe-dialog.h: rename from - subscribe-control.[ch]. - - * subscribe-dialog.c (subscribe_dialog_construct): pass - Evolution_Shell in. - (subscribe_dialog_new): takes Evolution_Shell argument now. - -2000-10-02 Chris Toshok <toshok@helixcode.com> - - * message-list.c (message_list_init_renderers): remove the 2 tree - pixbufs, so adjust the offsets to the score pixbufs. also, pass - NULL for the open/closed pixbufs to the tree cell renderer. - -2000-10-02 Dan Winship <danw@helixcode.com> - - * mail-ops.c (mail_do_scan_subfolders, etc): Update for - CamelFolderInfo changes. - - * message-list.c (message_list_destroy): Don't save_tree_state if - there's no folder associated with the MessageList. - - * folder-browser.c (folder_browser_set_uri): Only call - mail_do_load_folder if the URI is not "". - -2000-10-02 Iain Holmes <iain@helixcode.com> - - * mail-display.[ch]: Add a cache for the pixbufs, hashed on CID, - so that we only have to make a thumbnail once. - -2000-10-01 Iain Holmes <iain@helixcode.com> - - * mail-display.c: Generate the thumbnails on an idle function so - that the user interface isn't locked. Checks in case the widget it - will use to display the image isn't destroyed. - -2000-10-01 Iain Holmes <iain@helixcode.com> - - * mail-display.c (on_object_requested): If the attachment is an - image display a thumbnail of it, instead of the generic image - icon. - -2000-09-29 Miguel de Icaza <miguel@helixcode.com> - - * folder-browser-factory.c: Add print preview verb here. - - * mail-callbacks.c (do_mail_print): Handle printing here, the - complete engine. - (mail_print_preview_msg): new. does print previewing. - (mail_print_msg): does printing of the message. - -2000-09-29 Chris Toshok <toshok@helixcode.com> - - * subscribe-control-factory.c, subscribe-control-factory.h: nuked. - - * subscribe-control.c, subscribe-control.h: lots of changes. we - now pop up a dialog, and will have a storage set view on our left - side, like the shell does. - - * mail.h: add prototype for manage_subscriptions. - - * mail-callbacks.c (manage_subscriptions): new function, pops up - the subscribe dialog. - - * folder-browser-factory.c: add the verb for managing - subscriptions. - - * Makefile.am (evolution_mail_SOURCES): add subscribe-control.[ch] - again. - -2000-09-28 Chris Toshok <toshok@helixcode.com> - - * subscribe-control.h (subscribe_search): added prototype. - - * subscribe-control.c (subscribe_search): new function. - - * subscribe-control-factory.c (make_folder_search_widget): new - function, to add search widget to toolbar. - (control_activate): create the search widget and add it to the - toolbar. - -2000-09-28 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-ops.c (do_send_queue): Messages should be appended to Sent - as Seen. - (do_send_mail): Same. - -2000-09-28 Ettore Perazzoli <ettore@helixcode.com> - - * Makefile.am: Don't compile `subscribe-control' for now. It - needs to be converted to the new UI handler code in Bonobo; it - doesn't compile right now. - -2000-09-27 Chris Toshok <toshok@helixcode.com> - - * subscribe-control.c (subscribe_refresh_list): new function. - - * subscribe-control.h (subscribe_refresh_list): new prototype. - - * subscribe-control-factory.c (update_pixmaps): add RefreshList - pixmap. also, add it to the verbs list. - -2000-09-27 Chris Toshok <toshok@helixcode.com> - - * mail-types.h: add SubscribeControl typedef. - - * Makefile.am (evolution_mail_SOURCES): add the subscribe stuff. - - * subscribe-control-factory.h * subscribe-control-factory.c * - subscribe-control.c: * subscribe-control.h: Mostly mocked up - subscribe ui. - -2000-09-27 Jeffrey Stedfast <fejj@helixcode.com> - Note: We need a configuration option to specify whether to log - filtering actions or not. - - * mail-ops.c (do_filter_ondemand): Updated to pass a log file - pointer to filter_driver_run. - (do_fetch_mail): Same. - (mail_do_fetch_mail): Fixed a compiler warning. - -2000-09-27 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-callbacks.c (composer_postpone_cb): Fix it so that "send - later" will still mark a message as being replied, forwarded, - whatever. Closes bug #568 on bugzilla. - -2000-09-27 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-ops.c (do_filter_ondemand): If the message has been - deleted, don't try filtering it - skip to the next message. Fixes - bugzilla bug #639. - -2000-09-25 Jeffrey Stedfast <fejj@helixcode.com> - - * folder-browser-factory.c: Shuffling (un)select all menu items to - the Edit menu. - -2000-09-25 Jeffrey Stedfast <fejj@helixcode.com> - - * folder-browser-factory.c: Added new menu items - - * mail-callbacks.c (mark_as_seen): New callback to mark all - selected messages as Seen. - (mark_as_unseen): New callback to mark all selected messages as - Unseen. - (select_all): New callback to select all messages (not yet - finished) - (unselect_all): New callback to unselect all messages (not yet - finished) - -2000-09-25 Not Zed <NotZed@HelixCode.com> - - * message-list.c (folder_to_cachename): Function to convert a - folder name/path to a filename for per-folder data. - (save_tree_state): - (load_tree_state): - (free_tree_state): For loading/saving the state of the expansion - of nodes in the tree. - (message_list_destroy): Save the tree state when done. - (save_node_state): Changed logic, we save when the node should be - closed on startup. i.e. any new nodes with children automatically - default to being open. - (subtree_unread): Check for unread messages in a subtree. So - false messages (for tree roots) are properly displayed. - -2000-09-25 Jeffrey Stedfast <fejj@helixcode.com> - - * message-list.c (address_compare): Updated to use Nat's - ENameWestern parser. - - * Makefile.am: link against e-util/ename/libename.la - -2000-09-25 Dan Winship <danw@helixcode.com> - - * mail-ops.c: CamelException is not for compile-time errors. - Replace lots of argument checks in setup_ functions with - g_return_if_fails in the public functions. Also remove some - prototypes that weren't needed because they were for static - functions that are defined before they're used. - -2000-09-23 Michael Meeks <michael@helixcode.com> - - * folder-browser-factory.c (set_pixmap): upd. - (control_activate): upd. - -2000-09-23 Ettore Perazzoli <ettore@helixcode.com> - - * message-list.c (internet_address_new_from_string): Skip spaces - at the beginning of the string first before doing anything else. - The code that follows doesn't like the first character of the - string to be a space. - -2000-09-22 Jeffrey Stedfast <fejj@helixcode.com> - - * message-list.c (address_compare): New comparison function for - email addresses. - (subject_compare): New comparison function for message subjects. - (message_list_init_header): Updated to use the new compare funcs. - -2000-09-21 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-format.c (mail_generate_reply): Fixed some memory - leakage. Call free_recipients() so we don't leak memory. - -2000-09-19 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-ops.c (do_scan_subfolders): Use the folder's full_name so - recursive directory structures display correctly ;-) - -2000-09-19 Dan Winship <danw@helixcode.com> - - * mail-ops.c (do_scan_subfolders): Update for CamelFolder changes - (subfolder_names -> subfolder_info). - -2000-09-19 Dan Winship <danw@helixcode.com> - - * mail-callbacks.c (create_msg_composer, compose_msg, send_to_url, - mail_reply, forward_msg): * mail-format.c (mail_generate_reply): * - mail-ops.c (cleanup_edit_messages): - - * mail-view.c (view_forward_msg): Deal with NULL composer. - -2000-09-18 Dan Winship <danw@helixcode.com> - - * main.c (main): Call gnome_vfs_init() since the composer now does - file operations (to get the MIME type of attachments). - -2000-09-18 Jeffrey Stedfast <fejj@helixcode.com> - - * message-list.c: Removed COL_ONLINE_STATUS because we don't want - that. Renamed COL_PRIORITY to COL_SCORE and set it up to sort-of - work, I'm not really sure which renderer I should use. - -2000-09-18 Christopher James Lahey <clahey@helixcode.com> - - * Makefile.am: Added $(EXTRA_GNOME_CFLAGS) and - $(EXTRA_GNOME_LIBS). Removed unneeded libraries. - - * component-factory.c, folder-browser-factory.c, folder-browser.c, - mail-callbacks.c, mail-config-gui.c, mail-display.c, - mail-display.h, main.c, message-list.c, message-list.h: Fixed the - #include lines to deal properly with gal. - -2000-09-16 Michael Meeks <michael@helixcode.com> - - * Makefile.am (INCLUDES): add datadir - - * folder-browser-factory.c (control_activate): use it. - -2000-09-15 Dan Winship <danw@helixcode.com> - - * mail-callbacks.c (transfer_msg): Revert **Temp fix** from below - since the relevant shell bug has been fixed now. - - * mail-ops.c (do_fetch_mail): Fix the sense of the "keep on - server" check so we're not doing this backwards. Don't - get_message_flags, because POP doesn't support it and it's - pointless anyway since we're setting deleted, not toggling it. - call camel_folder_sync with expunge=TRUE so that the deletions are - actually recorded. - -2000-09-15 Dan Winship <danw@helixcode.com> - - This bug was so much fun to fix the first time that I decided to - fix it again. - - 2000-07-11 Dan Winship <danw@helixcode.com> - - * mail-ops.c (real_send_mail): Set the post_send_data flag - rather than toggling it. (Maybe we'll need more control - over it later, but for now, the only flag we set is - "replied", and we want that set, not toggled.) - -2000-09-14 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-callbacks.c (transfer_msg): **Temp fix** Send "" as the - default folder to select as anything else seems to cause a - segfault in shell's user_get_folder(). - (check_configured): A spoon full of 'line wrapping' makes the - medicine go down, the medicine go dowwwwn... - -2000-09-14 Iain Holmes <terrorist@gegl.org> - - * mail-callbacks.c (check_configured): Ask if you want to - configure the mail client if it isn't configured already. - (check_send_configuration): Remove the error box if mail isn't - configured. - (send_queued_mail): Same. - -2000-09-14 Dan Winship <danw@helixcode.com> - - * mail-ops.c (setup_append_mail): camel_folder_append is perfectly - happy to take a NULL info. - -2000-09-14 Michael Meeks <michael@helixcode.com> - - * folder-browser-factory.c: move fn to bonobo. - (set_pixmap): update. - (control_deactivate): add bonobo_ui_handler_unset_container - -2000-09-14 Christopher James Lahey <clahey@helixcode.com> - - * mail-config-gui.h: Changed the include here because it caused - make distcheck to fail for me. I changed it from <Evolution.h> to - "shell/Evolution.h". This seems to have fixed things. - -2000-09-14 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-ops.c (do_fetch_mail): Only use the cache if the user plans - to keep_on_server. - -2000-09-14 Michael Meeks <michael@helixcode.com> - - * folder-browser-factory.c (control_deactivate): kill - warning. (control_activate): set threaded toggle state, - add freeze / thaw. - (set_pixmap, fill_toolbar, update_pixmaps): update. - -2000-09-13 Christopher James Lahey <clahey@helixcode.com> - - * folder-browser-factory.c: Fixed a warning (Missing include - file.) - -2000-09-12 Ettore Perazzoli <ettore@helixcode.com> - - ($(EVOLUTION_MAIL_CORBA_GENERATED)): Add space after `-I'. - -2000-09-12 Ettore Perazzoli <ettore@helixcode.com> - - * Makefile.am: Remove `ui.xml' stuff. - -2000-09-12 Dan Winship <danw@helixcode.com> - - * mail-local-storage.c (mail_local_storage_startup): set - folder_tree before adding the listener, since that will eventually - invoke callbacks that will look at it. - - * folder-browser-factory.c (control_deactivate): sync the folder - on deactivate. - -2000-09-12 Ettore Perazzoli <ettore@helixcode.com> - - * message-list.c (on_right_click): Also display the name of the - mailing list in the "Filter on Mailing List" item for additional - Coolness factor. - - * mail-autofilter.c (filter_gui_add_for_mailing_list): Create the - rule with `filter_filter_new()' so that it also has an action - part. - - * mail-mlist-magic.c (get_header): Use the right header name to - retrieve the header. - -2000-09-12 Ettore Perazzoli <ettore@helixcode.com> - - * message-list.c (on_right_click): Grey out the mailing list - filter item if `mail_mlist_magic_detect_list()' returns NULL on - this message [i.e., if we cannot figure out a mailing list for - this message]. - (filter_mlist): Good boys don't use F words. - - * mail-mlist-magic.c (check_sender): Work safely if - `header_name_return' or `header_value_return' are NULL. - (check_x_been_there): Likewise. - (check_delivered_to): Likewise. - (check_x_mailing_list): Likewise. - (check_x_loop): Likewise. - (get_header): Use the right header name to retrieve the header. - - * message-list.c (on_right_click): Mark strings for translation. - -2000-09-12 Ettore Perazzoli <ettore@helixcode.com> - - * folder-browser-factory.c: Use the latest, shiny, amazing TigerT - art for the toolbar. - - * component-factory.c: #include "mail-local-storage.h". - (owner_set_cb): Removed unused variable. - - * message-list.c (filter_sender): Made static. - (filter_recipient): Likewise. - (filter_subject): Likewise. - (vfolder_recipient): Likewise. - (vfolder_sender): Likewise. - (vfolder_subject): Likewise. - - * mail.h (vfolder_subject): Removed prototype [WTF was this doing - here?!?!]. - (vfolder_sender): Likewise. - (vfolder_recipient): Likewise. - (filter_subject): Likewise. - (filter_sender): Likewise. - (filter_recipient): Likewise. - - * message-list.c: Added a new "Filter on mailing list" menu item. - (filter_mlist): Callback for this menu item. Use - `filter_gui_add_for_mailing_list' to pop up the filter dialog with - the appropriate rule. - - * mail-autofilter.c (filter_gui_add_for_mailing_list): New. - - * message-thread.c (dump_tree): Removed unused variable. - - * mail-mlist-magic.c: New. - * mail-mlist-magic.h: New. - - * mail-autofilter.c (rule_match_recipients): Mark strings for - translation. - (rule_from_message): Likewise. - (filter_gui_add_from_message): Likewise. - -2000-09-12 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-ops.c (do_fetch_mail): Was trying to unhook an event from - the wrong folder - oops. - -2000-09-12 Not Zed <NotZed@HelixCode.com> - - * message-thread.c: Reverted to version 1.15. - (remove_node): Ok, if a node has a parent, remove it from the - parent list, otherwise remove it from the (supplied) root list. - (group_root_set): When we merge children, free the lost node. - (thread_messages_free): Remove the return, run as is. - (prune_empty): Plugged another small leak. - -2000-09-11 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-callbacks.c (run_filter_ondemand): Updated to use the new - mail_do_filter_ondemand. - - * mail-ops.c (do_fetch_mail): Update to use the new - filter_driver_run args. - (do_filter_ondemand): Updated to use the new filter_driver_run - args. - (mail_do_filter_ondemand): Take a FilterContext as a argument - instead of a driver as we need to destroy the filter inside the - do_filter_ondemand function and things'd get messy. - -2000-09-11 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-ops.c (do_fetch_mail): Don't have the filter driver - self_destruct. - -2000-09-11 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-ops.c (do_fetch_mail): If we're fetching from an mbox - formatted file then we need to do some special-casing. - -2000-09-11 Ettore Perazzoli <ettore@helixcode.com> - - * component-factory.c (owner_set_cb): Call - `mail_local_storage_startup()' to set up handling of the local - storage. - - * mail-local-storage.c: New. - * mail-local-storage.h: New. - -2000-09-11 Christopher James Lahey <clahey@helixcode.com> - - * mail-display.c: Fixed some warnings. - -2000-09-11 Dan Winship <danw@helixcode.com> - - * mail-display.c, mail-format.c: Another big rewrite of this - stuff. Now all (well, most) attachments get a small icon with a - description and a (non-obvious) right-click pop-up menu with - options to save, open in an external program, or show/hide inline. - - TODO: antialias the icon, add more options to the pop-up for - certain MIME types, add an icon to the headers, fix PGP to work - like everything else, fix message/external-body to work again, - add some icon caching action, etc, etc. - -2000-09-09 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-ops.c (do_fetch_mail): Use the CamelUIDCache so that we - only retrieve *new* messages and also send notes to the status bar - telling it which message we're downloading so that Ettore can - sleep at night ;-) - -2000-09-09 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-ops.c (do_fetch_mail): Updated to not send hook/unhook data - to filter_driver_run as it no longer takes those args. - (do_filter_ondemand): Same. Also wrap filtering in freeze/thaw to - prevent signals from being queued up - -2000-09-09 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-ops.c (do_fetch_mail): Freeze the default folder before - filtering and thaw it afterward to prevent a ton of - "folder_changed" signals from being queued. - -2000-09-08 Christopher James Lahey <clahey@helixcode.com> - - * folder-browser.c, mail-config-gui.c, mail-ops.c: Fixed some - warnings. - - * message-list.c: Added base ETableModel functions. - -2000-09-08 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-ops.c (do_fetch_mail): Updated to pass a CamelMessageInfo - to filter_driver_run - (do_filter_ondemand): Same. - -2000-09-07 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-ops.c (do_filter_ondemand): Updated to check the boolean - return code from filter_driver_run to find out whether or not the - message was filtered so that it can decide whether or not to - delete the message from the source folder or not. - -2000-09-07 Jesse Pavel <jpavel@helixcode.com> - - * mail-format.c (mail_generate_reply) Changed the behavior of - Reply-to-All so that the sender's address does not appear in - the cc: list. - -2000-09-07 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-ops.c (do_fetch_mail): Updated to pass an exception to - filter_driver_run and also check the exception before deleting the - message from the source folder. - (do_filter_ondemand): Updated to pass an exception to - filter_driver_run - -2000-09-07 Dan Winship <danw@helixcode.com> - - * session.c (session_init): Pass a storage dir to - camel_session_new now. - - * main.c (main): Can't call session_init here now, because it - requires evolution_dir to be set. - - * component-factory.c (owner_set_cb): call session_init here. - - * mail-ops.c (do_fetch_mail): Fix previous fix. (Free the uids, - just do it correctly.) - -2000-09-07 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-ops.c (do_fetch_mail): Don't free uids, let the camel - folder do that when it gets finalized - -2000-09-06 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-ops.c (mail_do_filter_ondemand): New async function to - filter messages on demand. - (do_fetch_mail): Updated to filter 1 message at a time using the - new filter-driver code - - * mail-callbacks.c (composer_postpone_cb): Send NULL as the - message info. - (run_filter_ondemand): Use mail_do_filter_ondemand instead of - filter_driver_run - - * mail-tools.c: Removed mail_tool_filter_contents_into and - mail_tool_fetch_mail_into_searchable as they have now been - deprecated. - -2000-09-06 Dan Winship <danw@helixcode.com> - - * message-list.c (clear_tree): set the data to NULL for the tree - root, so nuke_uids won't try to free anything. - -2000-09-06 Ettore Perazzoli <ettore@helixcode.com> - - * folder-browser.c (folder_browser_new): @shell made const. - `CORBA_Object_duplicate()' it before storing it. - (folder_browser_destroy): Free the shell object with - `CORBA_Object_release()', not `CORBA_free()'. - - * folder-browser-factory.c (folder_browser_factory_new_control): - @shell made const. - -2000-09-05 Dan Winship <danw@helixcode.com> - - * mail-display.c (make_safe_filename): - * mail-format.c (handle_mystery): - * mail-identify.c (mail_identify_mime_part): - camel_mime_part_get_filename now deals with both - Content-Disposition and Content-Type. - -2000-09-05 Peter Williams <peterw@helixcode.com> - - * mail-ops.c (cleanup_load_folder): Check for NULL folder. - (mail_do_setup_folder): Copy the 'name' parameter so that - we can free it. - - * message-list.c (nuke_uids): Depth '-1' means "unlimited", not 0. - -2000-09-05 Dan Winship <danw@helixcode.com> - - * component-factory.c (owner_set_cb): Re-rename "Sent". - - * folder-browser.c (fb_resize_cb): Remove the "+ 90" here since it - seems to break things for me, and it's not commented anyway and - there's no excuse for adding 90 to a number with no explanation. - -2000-09-05 Peter Williams <peterw@helixcode.com> - - * folder-browser.c (folder_browser_destroy): Don't free the shell; - it's not ours. - -2000-09-05 Dan Winship <danw@helixcode.com> - - * mail-tools.c (mail_tool_move_folder_contents): only call - camel_folder_get_message_info if the folder has - summary_capability. Don't hack up a fake CamelMessageInfo: - append_message will take NULL. - - * mail-ops.c: Replace mail_do_setup_draftbox, - mail_do_setup_outbox, and mail_do_setup_sentbox with - mail_do_setup_folder. - (do_send_mail, do_send_queue): s/sentbox_folder/sent_folder/ - - * component-factory.c (owner_set_cb): Use mail_do_setup_folder, - rename sentbox_folder to sent_folder, and call - mail_operation_wait_for_finish after the setup_folder calls in - case anything needs to use the _folder variables. - -2000-09-04 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-format.c (mail_generate_reply): Applied Jesse's patch that - will append a signature to the replied message text - - * folder-browser-factory.c: Changed "Send & Receieve" back to "Get - Mail" temporarily so that the toolbar buttons don't all get - stretched to some weird proportion - -2000-09-03 JP Rosevear <jpr@helixcode.com> - - * mail-config.c (mail_config_add_news): Copy the passed in item - before adding - (mail_config_add_source): ditto - (mail_config_add_identity): ditto - - * mail-config-gui.c (mail_config): We don't actually need a notebook - pointer. - (identities_edit_clicked): Don't explicitly destroy, we are using - gtk_clist_set_data_full now - (sources_edit_clicked): ditto - (news_edit_clicked): ditto - (mail_config): Use gtk_clist_set_row_data_full to kill leaks - -2000-09-03 Jeffrey Stedfast <fejj@helixcode.com> - - * folder-browser-factory.c: Change the "Get Mail" toolbar button - to become "Send & Receieve" - - * mail-callbacks.c (send_queued_mail): New callback function for - sending queued mail - (send_receieve_mail): New callback for Send & Receieve that - basically just calls send_queued_mail and then fetch_mail - - * mail-ops.c (cleanup_send_mail): Mod to be able to handle a NULL - composer window - (setup_send_mail): Modified to handle a NULL composer widget - (mail_do_send_queue): New convenience async function to send all - messages in a folder (aka all messages in a queue) - -2000-09-02 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-tools.c (mail_tool_move_folder_contents): Since POP3 - doesn't implement get_message_info, we need to check for info to - be NULL. In this case, we need to make our own info structure to - pass to append_message and then remember to free it - afterward. Should we even bother with get_message_info? And if so, - should we then implement get_message_info for POP3? - -2000-09-02 Ettore Perazzoli <ettore@helixcode.com> - - * folder-browser.c (etable_key): Make the `Home' key to move to - the beginning of the list and `End' to the end of it, using - `message_list_home()' and `message_list_end()'. - - * message-list.c (message_list_home): New. - (message_list_end): New. - - * folder-browser.c (folder_browser_new): Don't ref the shell here. - (folder_browser_destroy): Don't unref the shell. Instead, - `CORBA_free()' the object reference. - - * folder-browser-factory.c (control_activate): Bind "Open in New - Window" to `Ctrl-O'. - -2000-09-02 Lauris Kaplinski <lauris@helixcode.com> - - * mail-config-gui.c: Use e_utf8 wrappers - - * main.c (main): Do e_unicode_init, so we are not confusing - libunicode - -2000-09-01 Christopher James Lahey <clahey@helixcode.com> - - * folder-browser.c: Removed a warning. - -2000-09-01 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-callbacks.c (compose_msg): Attach a callback to the - postpone signal - (send_to_url): Same - (mail_reply): Same - (forward_msg): Same - (composer_postpone_cb): Callback function for the postpone signal - - * mail-ops.c (mail_do_setup_outbox): New convenience function to - load the Outbox folder - (mail_do_setup_sentbox): Same, but for Sentbox. - (do_send_mail): Now saves messages in Sentbox if sent successfully - (mail_do_append_mail): New convenience async function for - appending messages to a folder - - * component-factory.c: Added outbox_folder and sent_folder - (owner_set_cb): Call our new convenience functions to load Outbox - and Sentbox - -2000-09-01 Ettore Perazzoli <ettore@helixcode.com> - - * mail-ops.c (cleanup_scan_subfolders): Update for the extra arg - needed by `evolution_storage_new_folder()'. - * mail-vfolder.c (vfolder_refresh): Likewise. - -2000-08-31 Peter Williams <peterw@helixcode.com> - - * folder-browser.c (folder_browser_new): Don't ref the shell: - causes a race upon exit. - (folder_browser_destroy): Don't unref it. - - * mail-config-gui.c (service_page_item_new): Add a checkbutton - "use default port" to make life simple. - (service_page_get_url): Honor use_default_port. - (service_page_set_url): Set use_default_port based on the input - URL. - (toggle_port): New function, sets the sensitivity of the - port entry based on "use default port" - - (config_do_query_authtypes): Make this asynchronous, as it - may involve connecting to a server. - (service_page_detect): Call the async auth querier. - (service_page_item_new): Put the authentication stuff in if - the url_flags have URL_ALLOW_AUTH. Call the async auth querier - to get the info. - -2000-08-30 Ettore Perazzoli <ettore@helixcode.com> - - * mail-view.c (mail_view_create): Make the HTML widget grab the - focus. - -2000-08-30 Peter Williams <peterw@helixcode.com> - - * mail-config-gui.c (do_test_service): Explicitly connect to - the service again. - - * component-factory.c (mail_load_storages): Now that - camel_service_get_provider exists, use it to make this function - much simpler. - -2000-08-29 Peter Williams <peterw@helixcode.com> - - * folder-browser.c (folder_browser_new): Ref the Evolution_Shell. - Is this correct, or is it a circular reference? - -2000-08-29 Dan Winship <danw@helixcode.com> - - * mail-ops.c (mail_do_send_mail): Update this and related - functions to no longer take a From address. (The composer deals - with it itself now.) - (do_send_mail): Add the Evolution version back to the X-Mailer - header (this change got lost in the thread migration). - - * mail-callbacks.c (composer_send_cb): Don't re-fetch the From - address. It's set by the composer now. Don't free the - post_send_data from here. - (mail_reply): Attach to the composer's destroy signal to free the - psd. (The current code would free it more than once if an error - occurred while trying to send the first time.) - -2000-08-28 Peter Williams <peterw@helixcode.com> - - * mail-config-gui.c (mail_config_apply_clicked): Add new news sources, - not only stores. - -2000-08-28 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-callbacks.c (composer_send_cb): Free the from address when - we're done with it. Also, e_msg_composer_hdrs_get_from returns - alloc'd memory so don't strdup it. - -2000-08-28 Peter Williams <peterw@helixcode.com> - - * mail-ops.c (do_transfer_messages): Add status messages. - (do_flag_messages): Same. - (do_scan_subfolders): Same. - (do_forward_messages): Same. - (do_view_messages): Same. - -2000-08-28 Ettore Perazzoli <ettore@helixcode.com> - - * mail-view.c (mail_view_create): Use `gnome_app_set_toolbar()' - the easy way instead of doing things manually with `GnomeDock' and - `gnome_app_add_toolbar()'. - (MINIMUM_WIDTH): New #define. - (MINIMUM_HEIGHT): New #define. - (view_size_allocate_cb): New, callback for the "size_allocate" - signal of the mail view. It saves the last allocation in a static - `last_allocation' variable. - (mail_view_create): Connect it. - (set_default_size): New function. Set the default width/height to - the last allocation width/height; if the width/height is less than - the `MINIUM_WIDTH' or `MINIMUM_HEIGHT', use that value instead. - - * mail-tools.c (mail_tool_move_folder_contents): Show `i + 1', not - `i', so that we correctlly start counting from one instead of zero. - -2000-08-28 Peter Williams <peterw@helixcode.com> - - * *.c: s,mail_dialog_run,gnome_dialog_run,g. - - * main.c (main): Since only the main thread is dealing with GTK+, - free the GDK threads mutex and never worry about locking again. - -2000-08-28 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-crypto.c (mail_crypto_openpgp_encrypt): Fix to prevent - possible buffer overflows and a logic fix. - -2000-08-27 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-crypto.c (mail_crypto_openpgp_clearsign): New crypto - function to clearsign plaintext - -2000-08-27 Ariel Rios <ariel@arcavia.com> - - * folder-browser-factory.c (control_activate): Added bonobo menu - handler for mark_all_deleted function. - - * mail.h: (mark_all_deleted): Added prototype. - - * mail-callbacks.c (mark_all_deleted): Added callback for marking - all displayed messages in a folder as deleted. - -2000-08-26 Ettore Perazzoli <ettore@helixcode.com> - - * mail-view.c (mail_view_create): Use - `gtk_window_set_default_size' on the toplevel instead of - `gtk_widget_set_usize()', and make the default size smaller. - -2000-08-25 Christopher James Lahey <clahey@helixcode.com> - - * mail-crypto.c: Fixed an uninitialized variable. - -2000-08-26 JP Rosevear <jpr@helixcode.com> - - * evolution-mail.gnorba: Kill - - * Makefile.am: Remove gnorba related stuff - -2000-08-25 Peter Williams <peterw@helixcode.com> - - * mail-config-gui.c (service_page_item_new): If the service wants - a host, also let the user specify a port. - (MailDialogServicePageItem): Add members for the port GtkEntry and - the default port. - (service_page_get_url): Translate the port in the entry back into - the CamelURL. - (service_page_set_url): Read in the port from the URL or use - the default. - -2000-08-25 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-crypto.c (mail_crypto_openpgp_encrypt): Implemented PGP 2.x - encryption. We only need to get the passphrase if we plan to sign - the text, otherwise we don't need to worry about getting the - passphrase. - -2000-08-24 Lauris Kaplinski <lauris@helixcode.com> - - * folder-browser.c: Use e_utf8 wrappers - - * mail-config-gui.c: Use e_utf8 wrappers - -2000-08-24 Peter Williams <peterw@helixcode.com> - - * folder-browser-factory.c (control_activate): Add all the - functions from message-list.c's popup menu to the main - menu as well - - * message-list.c (vfolder_subject): These functions become - public. - - * mail-callbacks.c (mark_all_seen): Don't call camel_folder_get_uids - here. IMAP, for example, will try to communicate with the IMAP - server during that call. - - * mail-ops.c (cleanup_fetch_mail): Tell the user - which URL has no new mail, as they may be checking - more than one source. - (mail_do_flag_all_messages): New function. Flags all of - the messages in a folder. Something of a hack. This merely - extends the flag_messages operation; it doesn't implement - a new one. - (do_flag_messages et al): Fetch the uids if we need to; - use camel_folder_free_uids if necessary, etc. - - * mail-tools.c (mail_tool_move_folder_contents): Add - messages to tell the user what's going on. - -2000-08-24 Christopher James Lahey <clahey@helixcode.com> - - * folder-browser-factory.c: Fixed some warnings in the uihandler - code. - -2000-08-24 Peter Williams <peterw@helixcode.com> - - * component-factory.c (mail_load_storages): New function. - Loads a list of URI's as mail storages, and inserts them - into the shell's folder tree if appropriate (really, only - puts them into the folder tree.) - (mail_add_new_storage): Insert a storage into the folder - tree. Not always appropriate (eg, /var/spool/mail/user is - a storage that shouldn't be in the folder tree.) - (create_view): Generate the Evolution_Shell and pass it - to folder_browser_factor_new_control so that its member - 'shell' can be set. - (owner_set_cb): Instead of create_news_storage and - creating the imap storages, load the news storages and - mail storages via mail_load_storages(). - - * folder-browser-factory.c (control_activate): Change to - use providers_config again instead of mail_config. Pass - the folderbrowser so that the config code knows where - to insert the new storages if any are created. Pass - forget_passwords the folderbriwser, too, for good luck. - (folder_browser_factory_new_control): Take a new parameter, - the Evolution_Shell that we belong to. The field in - FolderBrowser has been there but was never getting set by - anything, and we need this to be able to insert new storages - into the shell's folder list. - - * folder-browser.c (folder_browser_new): Accept the - new Evolution_Shell parameter. Set it. (Should we - ref it or something?) - - * mail-config-gui.c (struct MailDruidDialog): Store an - Evolution_Shell. With this we can insert the stores into - the shell's folder list. - (struct MailDialog): Same. - (service_page_item_changed): Close a leak. - (identity_dialog): Unswitch the Add/Edit identity titles. - (news_dialog): Analogous to above. - (mail_druid_finish): Add the new mail source to the shell - view. - (mail_config_druid): Take a new Evolution_Shell parameter - for later use. - (mail_config_apply_clicked): Add all the mail sources to - the shell view. - (mail_config): Take a new Evolution_Shell parameter. - - * mail-callbacks.c (check_configured): Accept a FolderBrowser - so that we know where to put the new storages if any are - created. Almost all the callbacks are passed a FB * anyway - so this isn't a big deal. - (check_send_configuration): Make sure that we're configured - enough to be able to send mail. composer_send_cb() used to - do this, but it would need a FolderBrowser *, and there are - too many entry points to composer_send_cb to make this - feasible. - (fetch_mail): Pass the extra parm to check_configured(). - (free_psd): Move so that composer_send_cb can call this - directly. - (composer_send_cb): Don't check for proper configuration - here -- it is the caller's responsiblity to call - check_send_configuration(). Call free_psd() directly. - (compose_msg): Call check_send_configuration(). - (send_to_url): Same. This is called from mail-display.c, - though, and cannot reasonably be passed a FB. So: we can't - start up the config dialog directly; the user must do it - manually. Oh well. - (mail_reply): Same as above. - (forward_msg): Same as compose_msg(). - (edit_msg): Same as above. - (providers_config): Reenable so that we can pass mail_config - its FolderBrowser. - - * mail-display.c (write_data_to_file): Use the much more - straightforward run_and_close to retrieve the user's answer, - instead of the reply callback stuff. - - * mail-threads.c (mail_dialog_run): New wrapper for - gnome_dialog_run that will take care of the GDK lock correctly. - Far far more complicated than it should be. - (mail_dialog_run_and_close): Analogous to above. - (read_msg): Set inside_read_msg and unset it for the benefit - of the two above functions. Don't bracket ourselves in - GDK_THREADS_ENTER/_LEAVE anymore. - (mail_operation_queue): Use mail_dialog_run_and_close. - (show_error): As above. - (get_password): As above. - - * mail-display.c (write_data_to_file): This has the only - exception to the rule that "use mail_dialog_run(_and_close) - instead of the gnome equivalent always." Not quite sure why - it doesn't work here (the file selection window?). - - * mail-config-gui.c (identity_dialog): Change to - mail_dialog_run_and_close. - (source_dialog): Same as above. - (news_dialog): Same as above. - (cleanup_test_service): Same as above. - (mail_config): Change to mail_dialog_run(). - - * session.c (mail_request_dialog): Change to - mail_dialog_run_and_close. - - * mail-tools.c (mail_tool_uri_to_folder_noex): As above. - - * mail-ops.c (cleanup_fetch_mail): As above. - - * mail-local.c (local_reconfigure_folder): As above. - - * mail-callbacks.c (check_send_configuration): As above. - (ask_confirm_for_empty_subject): As above. - (edit_msg): As above. - (filter_edit): As above. - -2000-08-23 Dan Winship <danw@helixcode.com> - - * folder-browser-factory.c (control_activate): Reformat a bit, - make "Folder" appear before "Message", fill in the Message menu - more. - -2000-08-23 Peter Williams <peterw@helixcode.com> - - * mail-ops.c (describe_fetch_mail): Don't use the camel calls - to describe the operation. - -2000-08-22 Peter Williams <peterw@helixcode.com> - - * mail-tools.c (mail_tool_get_folder_from_urlname): Don't connect - to the service explicitly. - (mail_tool_send_via_transport): Don't connect to the transport - explicitly. - (mail_tool_get_root_of_store): Same. - - * mail-config-gui.c (do_test_service): Just try camel_session_get_service, - which will now connect for us. - - * message-thread.h: Add a note about *next being the first member - of struct _container... if it isn't, everything goes Very Wrong. - - * message-thread.c (free_container): Extra debug print. - (remove_node): Handle the case of empty containers holding the child - that we're interested in. - (thread_messages_free): Extra debug print. - -2000-08-20 Jeremy Wise <jwise@pathwaynet.com> - * folder-browser.c: (fb_resize_cb) Added function to monitor resize - of the e_paned in the main view. - -2000-08-18 Peter Williams <peterw@helixcode.com> - - * mail-tools.c (mail_tool_filter_contents_into): Fix a race. filter_driver_run is an - async operation so it won't even be started by the time we sync the folders and check - for the movemailbox to be emtpy. Thus the empty check for the movemail would fail - 99% of the time. - - * mail-callbacks.c (run_filter_ondemand): Pass he new argument to the ever-mushrooming - filter_driver_run. - -2000-08-17 Peter Williams <peterw@helixcode.com> - - * folder-browser-factory.c (control_activate): Fix menu item names. - (register_ondemand): Put the ondemand hooks into the new folder menu. - -2000-08-17 Ettore Perazzoli <ettore@helixcode.com> - - * mail-vfolder.c (vfolder_gui_add_rule): Use stock OK/Cancel - buttons and add i18n support. - - * folder-browser-factory.c (control_activate): Changed menu item - label from "Mark all messages seen" to "Mark All Messages as - Read". Changed capitalization of some other menu items. - (control_activate): Put the message- and folder- related menu - items in new "Message" and "Folder" subtrees which are created in - the `<Component Placeholder>' item created by the shell. - (control_deactivate): Updated accordingly. - (control_activate): Put the filter and vfolder editors, the mail - configuration and the "forget password" command into the - "settings" menu. - (control_deactivate): Updated accordingly. - - * mail-config-gui.c (transport_page_new): Add translation mark. - (service_page_new): Show the menu items before appending them. - (service_page_item_new): Use `GTK_FILL' for the "Detect supported - types..." button. - - * local-config.glade: Change the apply button into an ok button. - -2000-08-17 Peter Williams <peterw@helixcode.com> - - Implement filtering on demand. - - * folder-browser-factory.c (register_ondemand): New function. Callback - to put the filter-on-demand filters into the bonobo UIH; - (create_ondemand_hooks): New function. Read in our on-demand filters - and hook them into the UI. - (remove_ondemand_hooks): New function. Remove the hooks when done with - them. - (control_activate): Call create_ondemand_hooks() - (control_deactivate): Call remove_ondemand_hooks(); - - * mail-callbacks.c (run_filter_ondemand): New function. Callback - for running a filter on demand. - (filter_edit): Pass NULLs as the new arguments to rule_context_load. - - * mail.h: Prototype run_filter_ondemand(); - - * folder-browser.c (oc_destroy): New function. Iterator to destroy - an fb_ondemand_closure. - (folder_browser_destroy): Free the data associated with the ondemand - menu items. - (my_folder_browser_init): Clear the filter_ variables. - - * folder-browser.h: Two new members of FolderBrowser: filter_menu_paths, - a list of fb_ondemand_closures so that the menu items can be freed and - removed; and filter_context, a permanently loaded FilterContext for - running the ondemand filters. Prototype the new fb_ondemand_closure - structure. - - * mail-autofilter.c (filter_gui_add_from_message): Pass NULLs as the - new parameters to rule_context_load (we don't need to hook up ondemand - menu items...) - - * mail-tools.c (mail_tool_filter_get_folder_func): Rename from - get_folder_func() and make public so mail-callbacks.c:run_filter_ondemand() - can use it too. - (mail_tool_filter_contents_into): Use the new name of get_folder_func. - Pass NULLs as the extra arguments to rule_context_load. Pass the - extra source type to filter_driver_run (only use INCOMING). - - * mail-tools.h: Publicly prototype mail_tool_filter_get_folder_func() - - * mail-vfolder.c (vfolder_create_storage): Pass NULLs as the extra - arguments to rule_context_load. - - * message-list.c (message_list_init): Free our strdup'd uids when - the table model gets destroyed. - (nuke_uids): New function. Walk the tree nodes to free the uids. - (nuke_uids_cb): New callback for nuke_uids(); - - -2000-08-16 Richard Hult <rhult@hem.passagen.se> - - * mail-ops.c (cleanup_display_message): Use a configurable timeout. - - * mail-config.c (mail_config_set_mark_as_seen_timeout): New function - for the settable mark-as-seen timeout. - (mail_config_mark_as_seen_timeout): Likewise. - (mail_config_write): Write the timeout setting. - (config_read): Read timeout setting. - - * mail-config-gui.c (mail_config): Add option for the settable - mark-as-seen timeout. - (mail_config_apply_clicked): Likewise. - (timeout_changed): New function for the timeout setting. - -2000-08-16 Peter Williams <peterw@helixcode.com> - - * message-thread.c (walk_containers): More (default disabled) - mem debugging here. Fix the big leaks. - - * mail-format.c (get_url_for_icon): Copy the url_path so that - it can't get freed under us. - - * mail-threads.c (mail_operation_queue): Fix a leak. - - * mail-ops.c (mail_do_display_message): Fix another leak. - - * message-list.c (message_list_destroy): Remove the seen_id timeout - if necessary. - - * mail-local.c (mail_tool_local_uri_to_folder): Fix a leak. - - * session.c (auth_callback): Fix a leak. Almost seems as if - I've been using Purify... - - -2000-08-15 Peter Williams <peterw@helixcode.com> - - * message-thread.c (alloc_container): Add support for debugging - container allocations -- currently disabled. Make sure that - the g_strfreev works. - - * message-list.c (main_message_changed): Address bug #496 -- - possible race when forwading a message_changed event. - - * mail-threads.c (dispatch): Close the dispatch thread's half of - pipes when about to exit. - (mail_operations_terminate): Close the main thread's half of the - pipes when about to exit. - (all): Add i18n support. - - * mail-tools.c (all): Add i18n support. - - * mail-ops.c (transfer_messages): Generalize move_messages into - transfer_messages so that we can copy too. - (all): Add i18n supprt where appropriate. - - * mail-ops.h: Prototype the new mail_do_transfer_messages. - - * folder-browser-factory.c: Add a UI hook for copy_msg. - - * mail-callbacks.c (transfer_msg): Generalize move so that it supports - copy as well, and add a callback 'copy_msg'. - - * message-list.c (on_right_click): Add a right-click hook for Copy Message. - - * session.c (mail_request_dialog): Don't deadlock when in main thread. - -2000-08-14 Peter Williams <peterw@helixcode.com> - - * mail-threads.c (show_error): Fix the error dialogs. - (read_msg): Re-enable them. - - * mail-ops.c (do_scan_subfolders): Silence a compile warning. - -2000-08-13 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-crypto.c (mail_crypto_openpgp_encrypt): Added support for - encrypting via PGP 5.0 - -2000-08-13 Ettore Perazzoli <ettore@helixcode.com> - - * mail-ops.c (cleanup_create_folder): Release the listener object - with `CORBA_Object_release()', not `CORBA_free()'. - -2000-08-13 Ettore Perazzoli <ettore@helixcode.com> - - * main.c (main): Set the signal handlers for `SIGSEGV' and - `SIGBUS' to the default ones. - -2000-08-13 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-config.c (mail_config_write): Set config->configured to - TRUE - -2000-08-13 Ettore Perazzoli <ettore@helixcode.com> - - * mail-config-gui.c (mail_config_druid): Don't - `GDK_THREADS_ENTER()'/`GDK_THREADS_LEAVE()'. - -2000-08-13 Ettore Perazzoli <ettore@helixcode.com> - - * mail-threads.c (update_active_views): Just iterate through all - the controls, not just the active ones. - - * folder-browser-factory.c: Don't keep track of active controls. - Rather, keep track of all of them. - (folder_browser_factory_get_active_control_list): Removed. - (folder_browser_factory_get_control_list): New. - -2000-08-13 Dan Winship <danw@helixcode.com> - - * Makefile.am (evolution_mail_SOURCES): add mail-local.h - -2000-08-13 Ettore Perazzoli <ettore@helixcode.com> - - * mail-threads.c (read_msg): For now, don't do anything about - errors. - -2000-08-13 Dan Winship <danw@helixcode.com> - - * mail-format.c (add_url): Fix some freed-memory references - - * mail-threads.c (get_password): Don't free the prompt. It - doesn't belong to you. - -2000-08-13 Ettore Perazzoli <ettore@helixcode.com> - - * mail-ops.c (mail_do_create_folder): Duplicate the listener - object. - (cleanup_create_folder): Free the listener. - -2000-08-13 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-threads.c (get_password): Don't wrap the gnome_dialog_run - in GDK_THREADS_ENTER/LEAVE - -2000-08-13 Ettore Perazzoli <ettore@helixcode.com> - - * folder-browser-factory.c (control_destroy_cb): Remove the - control from the active control list, if it's there. - - * mail.h (folder_browser_factory_new_control): Removed prototype. - (folder_browser_factory_init): Removed prototype. - - * folder-browser-factory.h: New. - - * folder-browser-factory.c: New static variable `active_controls', - list of the currently active controls. - (control_activate): Add the control to it. - (control_deactivate): Remove the control from it. - (folder_browser_factory_get_active_control_list): New. - - * mail-threads.c (mail_operations_get_status): New function. - - * folder-browser.c (folder_browser_gui_init): Add i18n support for - the labels. - - [The following is actually from a patch by Peter Williams - <peterw@helixcode.com>.] - - * Removed types `PERCENTAGE', `HIDE_PBAR', `SHOW_PBAR'. New - struct `block_info_s'. Removed all the code to create and destroy - the progress window. - -2000-08-13 Jeffrey Stedfast <fejj@helixcode.com> - - * component-factory.c (create_news_storage): Updated to reflect - changes to mail_do_scan_subfolders - (create_imap_storage): Same. - - * mail-ops.c (mail_do_scan_subfolders): No longer takes an - add_INBOX argument - -2000-08-13 Dan Winship <danw@helixcode.com> - - * mail-ops.c (do_scan_subfolders): Lose a reference to the store - on purpose. To be fixed later. - -2000-08-12 Dan Winship <danw@helixcode.com> - - * component-factory.c (create_imap_storage): Take the source as a - command-line argument rather than fetching it from mail-config. - (owner_set_cb): Call create_imap_storage on each configured IMAP - store. - - * mail-format.c (decode_pgp): Redo this so that the lock icon - remains active after a failed decryption so you can click on it - and try again. - (try_inline_pgp, handle_multipart_encrypted): Put a border around - the decrypted data. - - * message-list.c (cleanup_regenerate_messagelist): Don't clear the - tree here. If two "folder_changed"s arrive in close succession, - then one possible ordering of events is - cleanup_regenerate_messagelist, cleanup_regenerate_messagelist, - cleanup_thread_messages, cleanup_thread_messages. Which would - result in the message list being filled in twice without being - cleared in between. So don't clear it until the rebuilding - function itself is called. - (clear_tree): New function to empty out the ETreeModel in the - message list. - (build_tree): Change to simpler interface. Call clear_tree. - (build_subtree): Does most of the work of the old build_tree - (build_flat): Remove unused arg. Call clear_tree. - - * message-thread.c (cleanup_thread_messages): Update for - build_tree interface change. - - * mail-ops.c (do_send_mail): Don't leak the transport. - - * mail-tools.c (mail_tool_get_folder_from_urlname): Don't ref the - store returned from camel_session_get_store. It's already reffed. - (mail_tool_get_root_of_store): Ditto. - (mail_tool_send_via_transport): Remove some commented-out code and - fix it to not leave the transport connected if sending fails. - - * mail-callbacks.c (delete_msg): Toggling a flag is an - "instantaneous" operation, so if we're only doing one, just do it - and return, rather than queueing it for the other thread. This - makes the "Delete" key work correctly (move to the next message) - again. - - * mail-identify.c: Remove workaround for gnome-vfs 0.2 bug. - - * mail-format.c (lookup_handler): Remove workaround for function - introduced between gnome-vfs 0.2 and 0.3, since we depend on 0.3 - now. - -2000-08-12 Michael Meeks <michael@helixcode.com> - - * main.c (main): kill using_oaf assertion. - -2000-08-11 Peter Williams <peterw@helixcode.com> - - * Makefile.am: Make it so that test-mail links - -2000-08-11 JP Rosevear <jpr@helixcode.com> - - * folder-browser-factory.c (control_activate): Move menu items - that affect a single message together, ditto with ones that - affect multiple messages, put a separator in. - -2000-08-11 Christopher James Lahey <clahey@helixcode.com> - - * mail-format.c, mail-tools.h, message-list.c: Fixed a warning. - -2000-08-11 Dan Winship <danw@helixcode.com> - - * mail-display.c, mail-format.c: Redo this again. Get rid of - struct mail_format_data and move most of that info into - MailDisplay itself, and pass the MailDisplay around. Add a GData** - to MailDisplay, and put the urls hash table into that. Also add - the ability to redisplay the currently-displayed message (with the - same GData**), and add a "show_pgp" datum to it that controls - whether or not to decrypt PGP messages, and redo the PGP stuff - (again) to take that into account. Now you don't get the annoying - PGP password dialog box without any warning. - -2000-08-11 Peter Williams <peterw@helixcode.com> - - * mail-config-gui.c (service_acceptable): Make verify-service - an asynchronous operation. - - * Makefile.am (noinst_PROGRAMS): Don't build test-thread - while mail-threads.c is in flux. - - * mail-threads.c (mail_operation_queue): Make the error - and query dialogs modal. - - * mail-local.c (update_progress): Don't use the - temporarily-disabled mail_op_set_percentage(). - -2000-08-11 Chris Toshok <toshok@helixcode.com> - - * mail-config.c (mail_config_get_default_news): use config->news - instead of config->sources. - -2000-08-11 Dan Winship <danw@helixcode.com> - - * mail-format.c (destroy_part): Update this for CamelObject - (try_inline_pgp): Deal with decrypting here rather than trying to - pawn the data off to handle_multipart_encrypted, since it most - likely won't be correct (won't have the proper MIME headers inside - the encrypted part). - (handle_multipart_encrypted): Add code from Nathan Thompson-Amato - to re-MIME-parse the decrypted data after decrypting. - - * mail-crypto.c (mail_crypto_openpgp_{de,en}crypt): Get the - password here rather than having it passed in. Remove some dead - code. - - * session.c (mail_request_dialog): Allow this to work in either a - sync or an async context. - -2000-08-11 Peter Williams <peterw@helixcode.com> - - * mail-tools.c (mail_tool_fetch_mail_into_searchable): Don't - do the imap check here... it's a silly place. - - * mail-ops.c (do_fetch_mail): Do the imap check here. - -2000-08-11 JP Rosevear <jpr@helixcode.com> - - * mail-config-gui.c (service_page_new): Work around - gtk option menu bug. - (service_page_item_auth_fill): ditto - -2000-08-11 Peter Williams <peterw@helixcode.com> - - * mail-threads.c (read_msg): Fix the new FORWARD_EVENT handler - (didn't free msg, didn't write newline in the debug) - - * mail-local.c (local_reconfigure_folder): Make the dialog - modal. - - * mail-callbacks.c (select_first_unread): Fix some warnings. - - * mail-threads.c (mail_op_forward_event): New function that - writes a FORWARD_EVENT signal to the compipe, to allow Camel - events to be handled in the main thread. - (read_msg): Handle a FORWARD_EVENT. - - * mail-callbacks.c (select_first_unread): Forward the - event into the main thread to prevent the GTK calls in the - dispatcher thread. - (main_select_first_unread): New name of old select_first_unread. - - * message-list.c (folder_changed): Same as above. - (main_folder_changed): Same as above. - (message_changed): Same as above. - (main_message_changed): Same as above. - - * mail-format.c (free_byte_array): Note about using - mail_op_forward_event. (cmm_destroyed): Same. - -2000-08-11 Dan Winship <danw@helixcode.com> - - * message-list.c (message_list_select): If the caller passes "-1" - for the model row, translate that to view row 0. - - * message-list.c (idle_select_row): - * mail-callbacks.c (select_first_unread): Use new - message_list_select kludge^H^H^H^H^H^Hfeature - -2000-08-11 JP Rosevear <jpr@helixcode.com> - - * mail-config-gui.c (source_dialog): Allow the window - to be growable - - * mail-config.c: use void in empty declarations - -2000-08-11 Peter Williams <peterw@helixcode.com> - - * mail-config.c (mail_config_get_news): Change () to (void) - if a function takes no arguments. - - * mail-config.h: Prototype mail_config_get_{sources,news}x - -2000-08-11 JP Rosevear <jpr@helixcode.com> - - * mail-config-gui.c (identity_dialog): iddialog, not sdialog - (news_edit_clicked): Kill leftover c-p crud - -2000-08-11 JP Rosevear <jpr@helixcode.com> - - * mail-config-gui.c (news_edit_clicked): Check nrow, not srow. - -2000-08-11 JP Rosevear <jpr@helixcode.com> - - * mail-config-gui.c (service_acceptable): Use camel_object_unref - instead of gtk_object_unref - (mail_druid_finish): Use new config accessors - (mail_config_druid): No need to call config functions - (news_add_clicked): Increments maxnrow, not maxsrow - (mail_config_apply_clicked): Use new config accessors - (mail_config): ditto - - * component-factory.c (create_imap_storage): Use new - config accessors - (create_news_storage): ditto - - * mail-config.glade: Set news clist name correctly - - * mail-config.c (config_read): Rename from mail_config_read and - made private - no one should need to do a read manually. - (mail_config_set_send_html): New accessor - (mail_config_add_identity): ditto - (mail_config_get_sources): ditto - (mail_config_add_source): ditto - (mail_config_get_default_news): ditto - (mail_config_get_news): ditto - (mail_config_add_news): ditto - - * mail-config.h: Prototype new accessors. Config struct is now - in mail-config.c and hidden from the world. - -2000-08-11 Dan Winship <danw@helixcode.com> - - * mail-ops.c (describe_fetch_mail): Use camel_service_get_name - rather than showing the URL to the user. - -2000-08-11 Peter Williams <peterw@helixcode.com> - - * mail-ops.c (do_refile_messages): Freeze the folders while moving. - (do_flag_messages): Same. - - * mail-threads.c (get_password_clicked): Fix the case when the - user /doesn't/ use escape to cancel the dialog :-/ - (show_error_clicked): Same. - -2000-08-11 Dan Winship <danw@helixcode.com> - - * mail-tools.c (mail_tool_get_folder_name): Add a function to - return a useful name for a folder (not just "mbox" or "mh" for - any local folder.) - - * mail-ops.c: Use mail_tool_get_folder_name rather than - folder->full_name when printing folder names. - -2000-08-11 Not Zed <NotZed@HelixCode.com> - - * mail-tools.c (mail_tool_get_local_inbox_url): Properly handle - different local file formats. The folder isn't always mbox. - (mail_tool_do_movemail): Movemail always uses an mbox format - however. - (mail_tool_get_local_movemail_url): What is the mbox url, it is - always the same type, mbox. - (mail_tool_fetch_mail_into_searchable): Same here. - - * mail-local.c (mail_local_map_uri): Map a local uri to the real uri. - -2000-08-10 Christopher James Lahey <clahey@helixcode.com> - - * folder-browser-factory.c, message-list.c, message-thread.c, - session.c: Fixed some warnings. - -2000-08-10 Dan Winship <danw@helixcode.com> - - * session.c (session_init): Don't call e_setup_base_dir. It was - wrong and it doesn't exist any more. - - * component-factory.c (owner_set_cb): Update for changed - prototype, and record the evolution_homedir. Move call to - mail_config_init here from session.c so it happens after - evolution_dir is initialized. - - * mail.h: define "extern char *evolution_dir;" (formerly in - e-util/e-setup.h) - - * component-factory.c, mail-callbacks.c, mail-config-gui.c, - mail-config.c, mail-display.c, mail-format.c, mail-ops.c, - mail-tools.c, session.c: Remove "e-util/e-setup.h" include. - -2000-08-10 Peter Williams <peterw@helixcode.com> - - * test-thread.c (queue_ops): Use mail_operations_terminate() to - close the other thread nicely. - - * mail-threads.c (get_password_deleted): Handle the "close" event - as a cancel. - (show_error): Same. - -2000-08-10 Dan Winship <danw@helixcode.com> - - * mail-tools.c (mail_tool_get_folder_from_urlname): Add a - "gboolean create" argument to pass to camel_store_get_folder. - - * mail-ops.c (do_create_folder, do_setup_draftbox): - * mail-local.c (mail_tool_local_uri_to_folder): - * mail-vfolder.c (vfolder_uri_to_folder): Add create flag to - mail_tool_get_folder_from_urlname calls. - -2000-08-10 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-callbacks.c (composer_send_cb): Fix compile warning by - casting the object to a CamelObject - -2000-08-10 Peter Williams <peterw@helixcode.com> - - * mail-tools.c (mail_tool_filter_contents_into): Delete the source - folder if told to and if it's empty - (mail_tool_get_local_movemail_path): New function. - -2000-08-10 Dan Winship <danw@helixcode.com> - - * mail-callbacks.c (reply_to_all): Fix a bug in the async changes. - (This was identical to reply_to_sender.) - -2000-08-10 Not Zed <NotZed@HelixCode.com> - - * mail-local.c (do_local_reconfigure_folder): Update for - append_message api change. - - * message-list.c (message_list_regenerate): Change for search api - change. - (ml_tree_value_at): Add a colour column, based on the colour - assigned in the summary. - (message_list_init_renderers): Init colour column. - -2000-08-09 Peter Williams <peterw@helixcode.com> - - * mail-display.c (part_for_url): Remove a gtk_object_get_data - -2000-08-09 Cody Russell <bratsche@gnome.org> - - * folder-browser-factory.c, mail-view.c: Make the toolbars - honor the user's gnomecc settings for detachable toolbars. - -2000-08-09 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-ops.c (composer_send_cb): Get the from address set in the - composer, if that fails ONLY THEN get the default from mail config - - * mail-config.c (mail_config_get_identities): New convenience - function for getting a list of the configured identities - -2000-08-09 Dan Winship <danw@helixcode.com> - - * mail-display.c (on_object_requested): Support controls as well - as embeddables. - -2000-08-09 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-view.c (mail_view_create): Changed to only take a - FolderBrowser argument - - * mail-ops.c (real_view_msg): Create a new FolderBrowser for each - message being opened in a new window. Also set the - message_list->cursor_uid and mail_display->current_message to the - appropriate values. - (real_view_msg): Updated to reflect changes in the mail_view_create - - * message-list.c (on_right_click): Nicify a little, add in a menu - separator between VFolder and Filter stuff. - - * mail-ops.c (real_view_msg): Set the UID of the message that is - being displayed - -2000-08-09 Ettore Perazzoli <ettore@helixcode.com> - - * folder-browser-factory.c (control_activate): Use - `GNOME_STOCK_MENU_*' things instead of `GNOME_STOCK_PIXMAP_*' - things, that are too big and look bad. - -2000-08-09 Peter Williams <peterw@helixcode.com> - - * mail-view.c (mail_view_create): Save the top window so that on_close - can find it [with set_data]. - (on_close): Recover the top window. - - * mail-threads.c (read_msg): Destroy the window instead of hiding it. - -2000-08-09 Not Zed <NotZed@HelixCode.com> - - * mail-autofilter.c (filter_gui_add_from_message): Helper function - to add with confirm. - (rule_match_recipients): Dont set real name if its empty for the - filter name. - (rule_match_subject): was cutting ] off mailing list names. - - * message-list.c (on_right_click): Added menu to install - vfolders/filters from message. - -2000-08-09 Not Zed <NotZed@HelixCode.com> - - * mail-autofilter.c: New file to hold auto filter/vfolder stuff. - -2000-08-09 Christopher James Lahey <clahey@helixcode.com> - - * mail-display.c, mail-format.c, mail-ops.c: Fixed some warnings. - - * message-list.c: Fix the call to e_popup_menu_run to match the - new signature. - -2000-08-09 Ettore Perazzoli <ettore@helixcode.com> - - * folder-browser-factory.c (control_activate): Create a "print - message" menu item. - -2000-08-09 Jeffrey Stedfast <fejj@helixcode.com> - - * message-list.c (message_list_init): Attached a double_click - signal handler - (on_double_click): Our lovely new double_click callback. Will - display the current selected message in a new window - -2000-08-08 Jeremy Wise <jwise@pathwaynet.com> - * mail-config.[ch], folder-browser.c: Added configuration work to - save the size of the vpaned widget. It will be functional when the - e_paned widget emits a "resized" signal - -2000-08-08 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-config.h: Added void as an argument to functions not - needing any parameters to avoid compile warnings. - -2000-08-08 Jeremy Wise <jwise@pathwaynet.com> - * mail-config.[ch], main.c, folder-browser-factory.c: State of the - threaded list toggle is now saved via gnome_config - -2000-08-08 Dan Winship <danw@helixcode.com> - - * mail-config-gui.c (service_page_item_new): Attach a signal - handler to call the "changed" function when the user clicks the - "keep on server" checkbox. - -2000-08-08 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-ops.c (view_msg): New convenience function with params of a - normal Gtk callback function. We also now create a new - FolderBrowser object so that the message-view window isn't tied to - the display in the main window - (view_message): Now calls view_msg (this function is a bonobo - callback and can't be used with gtk widgets) - (edit_msg): Same idea as view_msg() - (edit_message): Again, same as view_message() - - * message-list.c (on_right_click): Callback for creating an - e-popup-menu - (message_list_init): Added a right_click event to trigger a pop-up - menu to be displayed - -2000-08-08 Dan Winship <danw@helixcode.com> - - * mail-config-gui.c: Add "Don't delete messages from server" - button to remote SOURCEs that aren't STORAGEs (ie, POP). - (provider_list): Only list SOURCEs. (ie, not mh) - - * mail-config.c: Save/load "keep_on_server" flag. - - * mail-ops.c (fetch_remote_mail): New function, split out of - real_fetch_mail. Deals with copying mail from a remote server into - a temporary mbox, possibly using a CamelUIDCache to leave the - messages on the server. - - * mail-crypto.c, mail-format.c, message-thread.c: Fix some - compiler warnings. - - * mail-format.c (mail_generate_reply): Fix up format of addresses. - (write_headers): Use CamelAddress functions to simplify this. - -2000-08-08 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-view.c: Lets get rid of the last separator in the toolbar - until we add n/p - -2000-08-08 Ettore Perazzoli <ettore@helixcode.com> - - * mail-threads.c (queue_window_delete_event_cb): Callback for - "delete_event", just doing nothing. - (create_queue_window): Connect it to the "delete_event" signal of - the progress dialog. - -2000-08-08 Peter Williams <peterw@helixcode.com> - - * mail-threads.c (remove_next_pending): Sanity check for - job queue, which seems to have some issues. - (read_msg): Make sure that the next operation isn't started - before the last one is cleaned up. - - * mail-callbacks.c (fetch_mail): Fix erroneous free. - - * mail-config-gui.c (mail_config_druid): Wrap the gtk_main call. - - * mail-ops.c (do_flag_messages): Allow specification of whether - to set the flags unconditionally or toggle their current state. - - * message-list.c (ml_tree_set_value_at): Toggle the seen status; - don't set it unconditionally. - - * mail-callbacks.c (delete_msg): Toggle the deletion status; - don't set it unconditionally. - - * mail-tools.c (mail_tool_do_movemail): Fix for undeclared tmpfd. - - * mail-local.c (local_reconfigure_folder): Big rewrite; make into - an asynchronous operation. Use some mail tools to make life easy. - -2000-08-08 Dan Winship <danw@helixcode.com> - - * main.c (main): Move mail_config_init after session_init, since - it depends on evolution_dir being set. - -2000-08-08 JP Rosevear <jpr@helixcode.com> - - * mail-ops.c (check_configured): Use config accessors - (fetch_mail): ditto - (composer_send_cb): ditto - (create_msg_composer): ditto - - * mail-config-gui.h: Update API - - * mail-config.h: Update API - - * mail-config.c: Add accessor functions - (mail_config_is_configured): accessor function - (mail_config_get_default_identity): ditto - (mail_config_get_default_source): ditto - (mail_config_get_transport): ditto - (mail_config_send_html): ditto - (identity_copy): Make public - (identity_destroy): ditto - (identity_destroy_each): ditto - (service_copy): ditto - (service_destroy): ditto - (service_destroy_each): ditto - (mail_config_init): Rename from init_config and make public - (mail_config_clear): Rename from clear_config and make public - (mail_config_read): Rename from read_config and make public - (mail_config_write): Reanme from write_config and make public - - * main.c (main): Call mail_config_init. - - * mail.h: Include mail-config-gui.h - - * mail-config-gui.c: Move config gui stuff here. - (source_dialog): Kill memory leak from debug leftovers. - Make sure returned source is NULL by default - -2000-08-07 Not Zed <NotZed@HelixCode.com> - - * mail-local.c (local_reconfigure_folder): Redone to show a - dialogue first, and show progress of whats happening as its done. - - * Makefile.am (glade_DATA): Added local-config.glade, for mailbox - reconfig dialogue. - -2000-08-04 Not Zed <NotZed@HelixCode.com> - - * folder-browser.c (mail_uri_to_folder): Use local_uri_to_folder() - for local uri's (file://). - - * mail-local.c (local_uri_to_folder): Handle looking up folder - storage type before opening the store/folder. - (local_reconfigure_folder): Function to reconfigure the format of - a local mailbox into another storage format. - - * Makefile.am (evolution_mail_SOURCES): Added mail-local.c and - missing mail-vfolder.h. - -2000-08-07 Jeffrey Stedfast <fejj@helixcode.com> - - * Makefile.am: Added mail-view.c - - * folder-browser-factory.c (control_activate): Adda menu item for - viewing the message - - * mail-view.c: New file containing methods for viewing messages in - separate windows - - * mail-ops.c (view_message): New callback for viewing messages in - a new window. - -2000-08-07 Jeffrey Stedfast <fejj@helixcode.com> - - * component-factory.c (real_create_generic_storage): New function - to replace real_create_imap_storage and real_create_news_storage - (create_imap_storage): Updated. - (create_news_storage): Updated. - -2000-08-07 Peter Williams <peterw@helixcode.com> - - * mail-ops.c (cleanup_edit_messages): New operation: edit_messages - For continuing draft messages. - (attach_messages): Fix accidental 0 datasize. - (do_setup_draftbox): New operation: setup_draftbox. Soooo hacky. - - * mail-callbacks.c: Move fejj's edit message to the async home. - - * component-factory.c (owner_set_cb): Use mail_do_setup_draftbox. - - -2000-08-07 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-display.c: - * component-factory.c: s/strncasecmp/g_strncasecmp - - * mail-format.c (write_headers): Get rid of kludge around subject - beginning with spaces. - (mail_generate_reply): Get rid of kludge around subject beginning - with spaces and also use g_strncasecmp instead of strncasecmp for - portability - - * mail-ops.c (forward_msg): Get rid of kludges around subject - beginning with spaces. - -2000-08-07 Dan Winship <danw@helixcode.com> - - * message-list.c (message_list_select): Clarify that the input row - is a model row, and swap it to a view row when finding the - next/previous row. - (idle_select_row): Select view row 0, not model row 0. - - * mail-ops.c (select_first_unread): Start from view row 0, not - model row 0. - -2000-08-07 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-format.c (mail_get_message_body): Renamed from reply_body() - so other functions can use it - (mail_generate_reply): Updated to reflect function name changes - - * mail-ops.c (real_edit_msg): Attach a callback to the send signal - -2000-08-07 Jeffrey Stedfast <fejj@helixcode.com> - - * folder-browser-factory.c (control_activate): New menu item under - Actions to allow editing of messages. - - * mail-ops.c (edit_message): New function for editing messages. - - * component-factory.c (owner_set_cb): Create a global reference to - the Drafts mbox folder for the Composer to use - -2000-08-06 JP Rosevear <jpr@helixcode.com> - - * mail-config.c (ndialog_page_undone): Desensitize ok button - (sdialog_page_undone): ditto - (iddialog_page_undone): ditto - (news_page_new): Typo - news, not mail - (transport_page_new): Typo - transport, not source - (identity_dialog): Set undone callback - (source_dialog): ditto - (news_dialog): ditto - (mail_druid_identity_undone): Desensitize next button and - mark done flag as false - (mail_druid_source_undone): ditto - (mail_druid_transport_undone): ditto - (mail_druid_identity_done): Mark done flag as true - (mail_druid_source_done): ditto - (mail_druid_transport_done): ditto - (mail_druid_prepare): Use done flag to set next button - sensitivity, fixes #467 - -2000-08-06 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-crypto.c (mail_crypto_openpgp_encrypt): Added support for - encrypting with GnuPG. Support for PGP5 and PGP2 are still in - progress. - -2000-08-05 Dan Winship <danw@helixcode.com> - - * folder-browser-factory.c (control_activate): Remove bonobo 0.15 - vs 0.15-and-a-half ifdef, since we require post-0.16 now. - -2000-08-04 Dan Winship <danw@helixcode.com> - - * mail-threads.c (mail_operation_wait_for_finish): Don't use - "while (gtk_events_pending ()) gtk_main_iteration ();" inside - another tight loop, because it makes the thread spin rather than - blocking and waiting like it should. - -2000-08-04 Peter Williams <peterw@helixcode.com> - - * message-thread.c (do_thread_messages): Uninitialized variable - fix. - - * mail-threads.c (read_msg): Small leak fix. - - * component-factory.c (owner_unset_cb): Use mail_operations_ - terminate() instead of wait_for_finish(). - - * mail-threads.c (mail_operation_queue): Centralize the clur - handling functions; fix a race condition where the dispatcher - would overwrite the closure before the main thread could - free the old one. - (mail_operations_terminate): New function, wait for ops to - finished and kill the other thread. - (dispatch): changes to die when terminate is called (abort - on NULL spec). - - * mail-ops.c (cleanup_display_message): Fix improper handling - of displaying a NULL message (which means clear the message - display). - -2000-08-04 Ettore Perazzoli <ettore@helixcode.com> - - * message-list.c (message_list_regenerate): Free the GPtrArray - correctly instead of using `g_strfreev()'. - -2000-08-04 Michael Meeks <michael@helixcode.com> - - * folder-browser-factory.c (control_activate): release the ui_handler - after set_container. - -2000-08-03 Michael Meeks <michael@helixcode.com> - - * mail-config.c (identity_page_new): only whack the sig in if the - file exists. - - * component-factory.c (factory_fn): count running instances, - attach destroy signal (factory_destroy): add. - - * main.c (main): pass orb around. - -2000-08-03 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-ops.c (composer_send_cb): Yay, no more compiler warnings - - * mail-config.c: set config = NULL - (provider_list) Eek! Initialize news to NULL! Also, use - g_slist_prepend() for "performance" gains ;-) - (init_config): Set the config member data to NULL just to be on - the safe side - (clear_config): Don't bother freeing slist data if the slist is - NULL - -2000-08-03 Peter Williams <peterw@helixcode.com> - - * mail-ops.c (op_forward_messages): Use the new dynamic - operation naming. - - * message-thread.c (describe_thread_messages): Ditto. - - * message-list.c (describe_regenerate_messagelist): Ditto. - - * mail-threads.c (get_password_clicked): Dynamic generation - of descriptive text for mail operations. "Opening a folder" -> - "Opening INBOX". Supported only so far, will be implemented - quickly. - g_strdup() the old_message when changing the queue_window_label's - text. - - * main.c (main): One more gconf reference to take out... - - * mail-ops.c (composer_send_cb): Check for an identity before - sending. - -2000-08-03 JP Rosevear <jpr@helixcode.com> - - * mail-config.glade: Increase window size slightly, rename - "Transport" to "Mail Transport" - - * mail-config.c (init_config): Remove gconf references - (clear_config): ditto - (read_config): ditto - (write_config): ditto - (mail_config): Null provider lists before filling them - (mail_config_druid): ditto - (identity_page_new): Increase spacing of vbox - (service_page_new): ditto - - * Makefile.am: Remove gconf references. - -2000-08-02 Dan Winship <danw@helixcode.com> - - * mail-config.c (service_page_item_new): Make the "test settings" - button FILL rather than SHRINK so it doesn't end up oddly-placed. - - * mail-config-druid.glade: Make the icon background dark blue - like the surrounding area. - -2000-08-02 Peter Williams <peterw@helixcode.com> - - * component-factory.c (owner_unset_cb): Wait for async operations - to finish before exiting. - -2000-08-02 Christopher James Lahey <clahey@helixcode.com> - - * mail-ops.c, message-list.c: Emit "model_pre_change" where - appropriate. - -2000-08-02 Peter Williams <peterw@helixcode.com> - - * mail-config.h: #ifdef _MAIL_CONFIG_H protect the header. - -2000-08-01 Peter Williams <peterw@helixcode.com> - - * mail-threads.c: Implement Solaris threads. Attempt - to join to the thread upon exit -- hopefully prevents - all those nasty zombie processes from popping up :-( - -2000-08-01 Dan Winship <danw@helixcode.com> - - * mail-crypto.c: New code to spawn off GPG/PGP to do stuff. - Currently only deals with decryption. From Nathan Thompson-Amato - <ndt@jps.net>, with bunches of changes from me. - - * session.c (mail_request_dialog): Expose the password dialog to - the rest of the app (for use by the GPG/PGP code). - - * mail-format.c (handle_text_plain): Handle special inline data - types. (Currently uuencoding, BinHex, and PGP encryption.) This is - not the best way to deal with it, but it works for now. - (try_inline_pgp): Convert an inline PGP-encrypted message into a - multipart/encrypted part. - (try_inline_binhex): Convert an inline BinHex attachment into an - application/mac-binhex40 part (which we currently don't deal - with...) - (try_uudecoding): Convert a uuencoded attachment to an - application/octet-stream part. - (handle_multipart_encrypted): Deal with RFC2015 MIME-encoded PGP - encrypted messages. (From ndt.) - - * mail-display.c (mail_text_write, mail_error_write): New utility - functions. - - * Makefile.am (evolution_mail_SOURCES): add mail-crypto.c - -2000-07-31 Christopher James Lahey <clahey@helixcode.com> - - * component-factory.c, folder-browser.c: Fixed some warnings. - - * message-list.c: Made the icon column non sortable. - -2000-07-31 Dan Winship <danw@helixcode.com> - - * mail-config.c (service_page_set_url): Fix a NULL-pointer strcmp - noticed by peterw. - -2000-07-31 Not Zed <NotZed@HelixCode.com> - - * mail-vfolder.h: Header for vfolder functions. - - * folder-browser.c (mail_uri_to_folder): Use new scheme to open - vfolders. - (search_save): New button/function to save a search as a vfolder. - - * mail-vfolder.c (vfolder_edit): Made asynchronous. - (vfolder_uri_to_folder): New function for loading vfolders and - setting up their source folders. - (vfolder_refresh): Change shell vfolder uri's to indirect - references rather than the real vfolder uri. - (vfolder_gui_add_rule): Add a rule with user confirmation. - (vfolder_create_part): Get a new part by name, for creating rules - in code. - - * message-thread.c (thread_messages): Check for uid lookup - failure, which indicates an error in the folder or calling code. - -2000-07-29 Not Zed <NotZed@HelixCode.com> - - * component-factory.c (create_view): Remove hack to pass the - storage around. - - * folder-browser-factory.c (control_activate): Changed to call - renamed vfolder editor. - - * mail-ops.c (vfolder_edit_vfolders): renamed from vfolder_edit, - call new edit function. - (vfolder_editor_clicked): Removed. - (filter_druid_clicked): - (filter_edit): Updated for api change. - (real_fetch_mail): Fixed up for api change and fucked up indent. - (filter_get_folder): callback for filter driver. - - * mail-vfolder.c: New file to manage virtual folders. - -2000-07-29 JP Rosevear <jpr@helixcode.com> - - * mail-format.c (mail_generate_reply): Use new mail config stuff - - * component-factory.c (create_imap_storage): Use new mail config - stuff - (create_news_storage): ditto - - * evolution-mail.schemas: Gconf schema for evolution mail - - * mail-config-druid.glade: Gladification of config druid - - * mail-config.h: New header with config structs. - - * mail-config.c: Rewrite of GUI configuration tools to use - new config structs. Stores multiple identities and sources now. - Still only uses the first one found. - (mail_config_fetch): Returns MailConfig struct to caller - for configuration queries. - (mail_config): Renamed function to show mail config dialog. - (mail_config_druid): Renamed function to show mail config druid. - - * mail-ops.c (create_msg_composer): Use - e_msg_composer_new_with_sig_file and new config stuff - (check_configured): Use new config stuff - (fetch_mail): ditto - (composer_send_cb): ditto - -2000-07-28 Cody Russell <bratsche@gnome.org> - * mail-ops.c, mail.h: Added mark_all_seen(), to mark every - message in the list with CAMEL_MESSAGE_SEEN. - - * folder-browser-factory.c: Added "Actions/Mark all seen". - -2000-07-27 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-config.c: Lets fix Dan's kludge the Right Way (tm) - (set_service_url): Only strip off the leading "/" from the - url->path if url->host is NULL - (get_service_url): Only prepend a leading "/" to the path if the - host is NULL - -2000-07-27 Dan Winship <danw@helixcode.com> - - * mail-config.c (get_service_url): toss in a kludge to deal with - the IMAP vs mbox path problem for now. - -2000-07-26 Christopher James Lahey <clahey@helixcode.com> - - * message-list.c, message-list.h: Removed counting of selected - messages. - -2000-07-26 Dan Winship <danw@helixcode.com> - - * mail-ops.c (real_fetch_mail): Don't create the tmp_mbox before - calling movemail, because the external movemail requires it to not - exist. Contrariwise, delete it in the cleanup code if it's empty. - Update for camel_movemail interface change. Do the "No new - messages" dialog in the mbox case as well as the remote mail - issue. - -2000-07-26 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-ops.c: s/struct refile_data/struct move_data - (real_move_msg): Renamed from real_refile_msg() - (move_msg): Renamed from refile_msg() - - * folder-browser-factory.c: Changed Refile to Move. - -2000-07-26 Dan Winship <danw@helixcode.com> - - * mail-format.c (lookup_handler): Update for OAF and for external - apps as well as components. - (handle_via_external): Handler to set up for data that can be - displayed by an external application. - - * mail-display.c (on_link_clicked, etc): Refactor the save_data() - code and add launch_external() as a handler for - x-evolution-external URLs. - (embeddable_destroy_cb): Remove this, since it seems like it's all - wrong. - (on_object_requested): Update for OAF, and fix some bugs. - -2000-07-25 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-config.c (get_service_url): Always prepend a leading "/" to - the url->path. - (set_service_url): Added more error checking and also strip the - leading '/' from the url->path - (create_identity_page): Set the signature file to the one specified in - the identity record, else set the default path to ~/.sugnature - -2000-07-25 Michael Meeks <michael@helixcode.com> - - * mail-config.c (create_identity_page): set default signature to - ~/.signature - -2000-07-25 Peter Williams <peterw@helixcode.com> - - * mail-ops.c (reply): Check for the case of fb->mail_display-> - current_message = NULL, which shouldn't happen, but has happened - to me. - -2000-07-25 Dan Winship <danw@helixcode.com> - - * message-thread.c (group_root_set): Don't group together messages - with the same non-Re: subject and no References/In-Reply-To. More - often than not, they're unrelated. (eg, "[No subject]".) - (thread_messages): Handle messages with no Message-Id. "This - shouldn't happen", but it does sometimes, and it's not much code - to make it just work. - -2000-07-25 Ettore Perazzoli <ettore@helixcode.com> - - * mail-config.c (create_service_page): Call - `gtk_option_menu_set_menu()' as the last thing, as `GtkOptionMenu' - is fscking broken. Also, `gtk_widget_show()' the individual menu - items. - -2000-07-24 Dan Winship <danw@helixcode.com> - - * message-list.c (mark_msg_seen, ml_tree_set_value_at, - message_list_regenerate): Update for CamelFolder API changes. - (Certain functions no longer take a CamelException.) - - * mail-ops.c (real_fetch_mail, real_send_mail, real_delete_msg): - ditto - - * component-factory.c (real_create_imap_storage, - real_create_news_storage): ditto - -2000-07-24 Dan Winship <danw@helixcode.com> - - * component-factory.c, folder-browser-factory.c, test-mail.c: - Remove GOAD support. - - * main.c: Remove GOAD support. - (main): More "guess the build mistake" fun, this time for the - failure to initialize Bonobo case. - -2000-07-24 Peter Williams <peterw@helixcode.com> - - * mail-tools.c (mail_tool_set_uid_flags): Change - function to faithfully pass parameters to - camel_folder_set_message_flags; this function is - somewhat useless now. Other files synced with - API change. - - * mail-ops.c (op_display_message): Change "display - a message" into "retrieve a messsage" in the - description of mail_op_display_message. - - * mail-threads.c (display_timeout): New function. - Only display the progress dialog if the operation - takes more than a second to perform. - (hide_queue_window): New function. Hide the queue - window as an idle function... I'm thinking maybe - the problem with hiding it was due to us not - being in a GTK event sequence? Perhaps it's only - the timeout, which was not being cancelled, which - is now. - - * message-list.c (get_message_uid): New function, - copy of get_message_info, except gets only the - UID, as that's all that most functions want, and - we avoid a Camel call. - -2000-07-23 Ettore Perazzoli <ettore@helixcode.com> - - * mail-ops.c (create_message_composer): New. - (compose_msg): Use it. - (send_to_url): Likewise. - (forward_msg): Likewise. - - * folder-browser-factory.c (control_activate): Use `_()' instead - of `N_()'. - -2000-07-21 Peter Williams <peterw@helixcode.com> - - * message-thread.c (setup_thread_messages): New - operation: thread_messages, simple wrapper around - thread_messages () and thread_messages_free(); - - * message-list.c (cleanup_regenerate_messagelist): - Use new thread_messages operation instead of just - calling ... thread_messages :-) - - * folder-browser.c (folder_browser_destroy): Use new - sync_folder operation instead of calling camel_folder_sync - directly. - - * component-factory.c (create_folder): Changed to use - new create_folder operation. - - * mail-ops.c (mail_do_create_folder): New operation: create - folder. New operation: sync folder. - - * mail-format.c (cmm_destroyed): Remove the url hashtable from - the larger hashtable when it gets destroyed. - - * mail-callbacks.c (fetch_mail): Pass a hook function and data - down the chain to pick up the folder_changed and change the view. - - * mail-ops.c: Rename from mail-ops-new.c now that it's a little more - solid. - (fetch_mail): Add new options to hook and unhook an event while the - filter driver runs. A hack, but all of the operations are to some - extent. - (cleanup_fetch_mail): Unref the destination folder if not NULL. - * mail-tools.c (mail_tool_filter_contents_into): Intermediate the - event hook/unhook hack here. - -2000-07-20 Peter Williams <peterw@helixcode.com> - - * mail-ops-new.c (setup_send_mail): Fix silly forgetting-to-ref - problem on some sends (when not replying). Note the early exit - path with a big comment. - - * message-list.c (message_list_set_folder): Don't call - folder_changed, call mail_do_regenerate_messagelist, as - the GDK_THREADS_ENTER in the former can deadlock us! - - * folder-browser.c (folder_browser_set_uri): Ah, screw it. - Make 'load folder' asynchronous and pretend that it always - succeeds. - - * mail-ops-new.c (mail_do_load_folder): New operation, loads - a folder into a FolderBrowser. - - * mail-threads.c (read_msg): Check if the exception is - a user cancel; don't complain if it is. - (mail_operation_queue): Same. - (dispatch_func): Same. - -2000-07-20 Peter Williams <peterw@helixcode.com> - - * mail-ops-new.c (cleanup_send_mail): Fix evil mistaken - unref. - - * test-thread.c: Fit the new mail_operation_spec prototype. - - * mail-callbacks.c (composer_send_cb): Hide the composer upon - start of send operation. - - * folder-browser.c: #include "mail-ops-new.h" - - * mail-threads.h: Change text fields of mail_operation_spec to - provide two forms of the name. - - * mail-threads.c: Use appropriate new string fields. - (dispatch_func): Hide the progressbar by default. - - * message-list.c (op_regenerate_messagelist): Fix the datasize from - 0 -> sizeof (regenerate_messagelist_data_t). Add the new gerund and - infinitive strings. - (do_regenerate_messagelist): Include some code that fell between the - cracks. - - * mail-ops-new.c (op_scan_subfolders): Same datasize fix for - scan_subfolders. - (op_forward_message): Same. - (all): Add new gerund and inifinitive strings for mail_operation_spec. - (cleanup_send_mail): Destroy the composer on success; re-show it on - error. I'm so clever! - -2000-07-20 Ettore Perazzoli <ettore@helixcode.com> - - * component-factory.c (factory_fn): Updated for the new - `evolution_shell_component_new()' arg. - -2000-07-19 Jeffrey Stedfast <fejj@helixcode.com> - - * message-thread.c (thread_messages): What if message info is NULL? - -2000-07-17 Peter Williams <peterw@helixcode.com> - - * component-factory.c (real_create_{imap,news}_storage): Instead of - directly calling evolution_storage_new_folder, queue up a list of - folders to register so that we don't do our CORBA in The Other Thread. - (create_{imap,news}_storage): Changes ancillary to the above. - (add_new_mailbox): New function to queue up a folder - (cleanup_create_info): New function to dequeue the folders and free mem. - - * test-thread.c: s,ENABLE_BROKEN_THREADS,USE_BROKEN_THREADS -- oops - - * mail-format.c: (mail_lookup_url_table): New function to get the url - table associated with a CamelMimeMessage because we can no longer - gtk_object_get_data on it. - - * mail-display.c: replace 'gtk_object_get_data( message, "urls" )' - with 'mail_lookup_url_table( message )' - -2000-07-16 Jeffrey Stedfast <fejj@helixcode.com> - - * folder-browser.c, component-factory.c: Initial code to support - IMAP folders that don't use "/" as a directory separator. - -2000-07-15 Ettore Perazzoli <ettore@helixcode.com> - - * mail-ops.c (set_x_mailer_header): New helper function to set the - `X-Mailer:' header to to `Evolution <version> [Developer - Preview]". - (real_send_mail): Call it. - -2000-07-14 Peter Williams <peterw@curious-george.helixcode.com> - - * message-list.c (message_list_set_folder): Ported to CamelObject: - GTK_OBJECT->CAMEL_OBJECT; gtk_signal_connect->camel_object_hook_event; - GDK_THREADS_ENTER/LEAVE around "changed" event hooks. - - * folder-browser.c (folder_browser_destroy): likewise. - (mail_uri_to_folder): likewise. - (folder_browser_load_folder): likewise. - -2000-07-14 Ettore Perazzoli <ettore@helixcode.com> - - * Makefile.am (evolution_mail_LDADD): Add `GCONF_LIBS'. - -2000-07-14 Dan Winship <danw@helixcode.com> - - * mail-format.c (write_headers): put a <p> at the end of the - header table. (I think there used to be whitespace after it, but - then some gtkhtml change got rid of it...) - (handle_text_plain): Don't do this <PRE>. Instead, CONVERT_NL and - CONVERT_SPACES and wrap it in <TT>. Now if the sender didn't - include any newlines, it will be wrapped to the width of the - window instead of extending off into infinity. - -2000-07-13 Dan Winship <danw@helixcode.com> - - * message-list.c (message_list_destroy): Only unref the folder if - it's been set. - - * folder-browser.c (folder_browser_destroy): Only sync the folder - if it's been set. - -2000-07-13 Jonathan Blandford <jrb@redhat.com> - - * mail-config.c (create_transport): - s/CAMEL_SERVICE_NEED_HOST/CAMEL_SERVICE_URL_NEED_HOST. - -2000-07-13 Dan Winship <danw@helixcode.com> - - * mail-config.c (add_row): Add a "gboolean required" argument, and - set its value on the entry. - (create_source, create_transport): Create rows for URL elements if - the URL ALLOWs them. Mark them required if it NEEDs them. - (service_note_doneness): Only require the required fields to be - filled in. - - Now the IMAP config page allows the user to enter a path, but - doesn't require it. - -2000-07-13 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-ops.c (real_fetch_mail): Back to the old way to avoid - g_warnings, yay. Also fix append to send a flags argument (0) - -2000-07-12 Chris Toshok <toshok@helixcode.com> - - * mail-config.c (providers_config_new): fix some cut & paste bung. - -2000-07-12 Chris Toshok <toshok@helixcode.com> - - * mail-format.c (setup_function_table): add "message/news" to the - mime_function_table using the same handler as message/rfc822. - -2000-07-12 Chris Toshok <toshok@helixcode.com> - - * mail-config.glade*: add news server tab to dialog. - - * mail-config.c (on_NewsServerConfigDialogButton_clicked): new function. - (on_clistNewsServers_select_row): new function. - (on_cmdNewsServersAdd_clicked): new function. - (on_cmdNewsServersEdit_clicked): new function. - (on_cmdNewsServersDelete_clicked): new function. - (providers_config_new): mirror the source tab's code to fill in - the news server tab. - (write_config): save out the news server. - (create_news_server_config_dialog): new function. - (create_news_server_page): new function. - -2000-07-12 Peter Williams <peterw@helixcode.com> - - * mail-display.c (save_data): Change from evolution_dir to - g_get_home_dir() for default location of save file. - -2000-07-11 Dan Winship <danw@helixcode.com> - - * Update for CamelFolder API changes - -2000-07-11 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-ops.c (real_fetch_mail): Changed to use - camel_folder_move_message_to () rather than get_message () and then - append_message (). This also makes it so we don't have to worry about - fetching message flags to pass to the new append_message () method. - - * folder-browser.c (folder_browser_load_folder): Disable - Search capability menu/entry if folder doesn't support it. - - * message-list.c (message_list_regenerate): Don't perform - a search if the folder doesn't support it. - -2000-07-11 Dan Winship <danw@helixcode.com> - - * mail-ops.c (real_send_mail): Set the post_send_data flag rather - than toggling it. (Maybe we'll need more control over it later, - but for now, the only flag we set is "replied", and we want - that set, not toggled.) - -2000-07-10 Dan Winship <danw@helixcode.com> - - * folder-browser-factory.c (control_activate): Work with both - current and 0.15 bonobo - - * kill more debugging messages - - * mail-ops.c (real_fetch_mail): Don't multiply free dest_url. - - * message-list.c (message_list_select): Update - message_list_select_next to do either next or previous. - - * folder-browser.c (etable_key): Make 'n' and 'p' do next and - previous unread message. - - * mail-ops.c (select_first_unread): Update. - (real_fetch_mail): clean up a bit. - -2000-07-10 Ettore Perazzoli <ettore@helixcode.com> - - * mail-ops.c (forward_msg): Initialize `fwd_subj' to NULL if - `from' is NULL. - -2000-07-10 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-ops.c (real_fetch_mail): Fixed broken POP fetching - -2000-07-10 Ettore Perazzoli <ettore@helixcode.com> - - * component-factory.c: Removed variable `browsers'. - (create_view): Don't update it. - (owner_unset_cb): Don't sync the folders here anymore, because at - this point the folder browser is dead already so we cannot get a - valid list of folders from it anymore. - - * folder-browser.c (folder_browser_destroy): Sync the associated - mailbox first. - -2000-07-10 Christopher James Lahey <clahey@helixcode.com> - - * message-list.c, message-list.h: Switched from ETable to - ETableScrolled. - -2000-07-10 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-ops.c (real_fetch_mail): Fixed movemail so that it too would - deliver to Inbox. - -2000-07-09 Dan Winship <danw@helixcode.com> - - * message-list.c (get_message_info): Don't g_warn if the user - selects a fake tree parent. - (message_list_select_next): Ignore fake rows - (build_tree): Store the "root_subject" for fake rows - (ml_tree_value_at): Display the correct subject for fake rows. - (on_cursor_change_cmd): Update for the other changes and set - cursor_uid to NULL when the cursor is on a fake row. - - * mail-ops.c (reply): Don't try to reply when no (real) message is - selected. - (forward_msg): Ditto. - -2000-07-09 Christopher James Lahey <clahey@helixcode.com> - - * message-list.c: Remove setting of dnd_code since that's handled - internally to ETable. - -2000-07-08 Dan Winship <danw@helixcode.com> - - * folder-browser.c (etable_key): Fix up the pageup/pagedown - increment a bit. - - * folder-browser-factory.c (control_activate): Add a "Threaded - Message List" item to the "View" menu. - - * message-list.c (message_list_toggle_threads): Handler for that. - (build_flat): New function to build a "flat" message list using - the tree model. - (message_list_regenerate): Build tree or flat message list - depending on the global setting. - - * message-thread.c (get_root_subject): fix a "Re:" parsing bug - -2000-07-08 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-ops.c (real_fetch_mail): Always dump incoming messages to - Inbox (assuming not filtered to another location). - -2000-07-08 Ettore Perazzoli <ettore@helixcode.com> - - * folder-browser-factory.c (control_activate): Move the - "Expunge" item to the "Action" menu. - (control_deactivate): Accordingly. - -2000-07-08 Dan Winship <danw@helixcode.com> - - * mail-ops.c (forward_msg): Deal with having multiple selected - messages. - - * mail-format.c (mail_generate_forward): Removed. (Integrated into - forward_msg) - -2000-07-08 Jeffrey Stedfast <fejj@helixcode.com> - - * message-list.c (build_tree): Small fix to stop uid data from - being set on a message-list tree node when it didn't correspond - to an actual message. - -2000-07-08 Dan Winship <danw@helixcode.com> - - * message-list.c (get_message_info): Fix Jeff's FIXME: This does - get called with out-of-range data sometimes, so we do need the - check. Use e_table_model_row_count to get the actual right answer. - -2000-07-07 Jeffrey Stedfast <fejj@helixcode.com> - - * message-list.c (get_message_info): This wasn't quite right, it - will now work but still isn't perfect. See FIXME comment. - -2000-07-07 Dan Winship <danw@helixcode.com> - - * message-thread.c (remove_node): Add another argument "clast" - pointing to the container before the current one in the list, - which it can update if that turns out to be the one that it - removed. - (group_root_set): Update for remove_node change, and remove both - nodes in the "subjects are common" case. Fixes a bug that would - cause the message list to be truncated if this rule was invoked. - - (sort_node): sort the tree by the original order of the messages - in the folder rather than by date. - -2000-07-07 Dan Winship <danw@helixcode.com> - - * message-list.c: Lots of changes. Store uids as node data on the - tree nodes and use those rather than rows where possible. (The - concept of "row" is just getting too complicated.) Get rid of the - summary_table, because given a uid we can call - camel_folder_get_message_info, which makes more sense than keeping - a separate uid->row hash table ourselves. - - (get_message_info): update - (get_message_row): removed - (ml_col_cound, ml_row_count, ml_value_at, ml_set_value_at, - ml_cell_is_editable, ml_duplicate_value, ml_free_value, - ml_initialize_value, ml_value_is_empty, ml_value_to_string): - Removed. We always use the tree model now. - (message_list_init): Remove the non-tree code. - (build_tree): store uids in the tree rather than row numbers, - and build the message_list->uid_rowmap to map from uids to rows - when needed. - (message_list_regenerate): Renamed from _set_search, since it's - used to redraw in non-search cases too. - (message_changed): Use the uid_rowmap to get a model row number. - - * message-thread.c (thread_messages): Change the interface on this - to work with the new MessageList. - - * folder-browser.c (search_set, folder_browser_clear_search): - s/message_list_set_search/message_list_regenerate/ - -2000-07-07 Christopher James Lahey <clahey@helixcode.com> - - * message-list.c (get_message_info): Handle a row number of -1 - properly. - -2000-07-06 Dan Winship <danw@helixcode.com> - - * message-list.c (get_message_info): Map tree model row numbers to - summary row numbers. - (ml_tree_value_at, ml_tree_set_value_at, - ml_tree_is_cell_editable): So don't do that here. - -2000-07-06 JP Rosevear <jpr@arcavia.com> - - * mail-config.glade*: Glade files for the configuration dialog. - - * mail-config.c (providers_config_new): Build the dialog with - glade. - -2000-07-06 Dan Winship <danw@helixcode.com> - - * folder-browser-factory.c, folder-browser.c, mail-ops.c, - message-list.c: fix warnings. - - * main.c (main): gtkhtmllib_init is no more. Call gconf_init - directly instead. - - * message-list.c (message_list_select_next): New function to - select the first message on or after the given row that meets - certain flag criteria. - - * mail-ops.c (real_fetch_mail): call message_list_select_next to - select first unread message in current folder if it changes. - (real_delete_msg): Remove the code to move the etable cursor. It - only makes sense really if you deleted the message with the - keyboard, so do it from etable_key. - - * folder-browser.c (etable_key): call message_list_select_next to - select next non-deleted message after Delete. - - * mail-identify.c: Add a workaround for a small gnome-vfs 0.2 bug - so we don't need to require CVS gnome-vfs. - -2000-07-06 Not Zed <NotZed@HelixCode.com> - - * message-thread.c (sort_thread): sort messages based on date for - the initial sort order. - (thread_messages_free): Implement. - - * message-list.c (message_list_init_header): Setup the subject - renderer to a tree in tree mode. - (on_cursor_change_cmd): For a tree model, map the view row to the - data row. - (build_tree): Builds the tree data structure of all messages. - (message_list_set_search): For a tree model, build the tree here. - (ml_tree_icon_at): Icon callback, returns nothing. - (ml_tree_value_at): - (ml_tree_set_value_at): - (ml_tree_is_cell_editable): Maps tree node to data row, and calls - the equivalent table callback - (message_list_init_renderers): Setup the tree renderer if needed. - (message_list_init): set the root node invisible afterall. - (message_list_set_search): Clear the old tree before putting in a - new one. - - * message-list.h: Add a tree renderer to render list, and - tree_view indicator. - - * message-thread.[ch]: Code for message threading. - -2000-07-05 Dan Winship <danw@helixcode.com> - - * mail-identify.c (mail_identify_mime_part): Oops. My gnome-vfs - was out-of-date. Update for changed function name. - -2000-07-05 Dan Winship <danw@helixcode.com> - - * mail-identify.c (mail_identify_mime_part): Use the gnomevfs - sniff buffer interface to try to identify the MIME type when - everything else fails. - - * mail-display.c (on_object_requested): - * mail-format.c (lookup_handler, handle_undisplayable, - handle_audio): s/gnome_mime/gnome_vfs_mime/ - - * Makefile.am: Add gnomevfs stuff - -2000-07-03 Ettore Perazzoli <ettore@helixcode.com> - - * component-factory.c (create_folder): Get rid of a compiler - warning by making sure `folder' is always initialized to some - value for any code path. - -2000-07-03 Dan Winship <danw@helixcode.com> - - * message-list.c (select_msg): call mail_display_set_message with - NULL if the message we tried to select doesn't exist (probably - meaning we tried to selecte the first message and the folder is - empty.) - - * mail-display.c (mail_display_set_message): deal with NULL as an - input (meaning "undisplay previous message and display nothing"). - -2000-07-02 Dan Winship <danw@helixcode.com> - - * mail-ops.c (real_fetch_mail): Remove hack to redisplay the - inbox, since folder_changed signals will now be emitted - appropriately. - - * component-factory.c (create_vfolder_storage): Fix - filter_driver_new invocation. - - * Makefile.am (bin_PROGRAMS): test-mail and test-thread should be - noinst. - - * mail-ops.c (real_fetch_mail): - (vfolder_editor_clicked): - * component-factory.c (create_vfolder_storage): - Pass mail_uri_to_folder and rules to filter_driver_new. - -2000-07-02 Ettore Perazzoli <ettore@helixcode.com> - - * folder-browser.c (mail_uri_to_folder): Fix double freeing of the - local exception `ex'. - -2000-07-01 Ettore Perazzoli <ettore@helixcode.com> - - * mail-ops.c (refile_msg): Only allow type "mail" in the folder - selection dialog. - -2000-07-01 Dan Winship <danw@helixcode.com> - - * pixmaps.h, pixmaps/*.xpm: Removed. These aren't being used any - more. (The real pixmaps are in ../art.) - -2000-07-01 Jeffrey Stedfast <fejj@helixcode.com> - - * message-list.c (get_message_info): - (select_msg): Updated to reflect camel-folder changes. - - * mail-ops.c (real_fetch_mail): Modified to reflect camel-folder - changes. - -2000-06-30 Dan Winship <danw@helixcode.com> - - * mail-ops.c (print_msg): Use gnome-print to do a print preview. - - * folder-browser-factory.c: Hook up "Print" button. - - * message-list.c (message_list_foreach): New function, a wrapper - around e_table_selected_row_foreach, which calls the callback - function with UIDs rather than row numbers. - - * folder-browser-factory.c: Remove never-used "Find" button from - the toolbar and replace it with "Refile". (We need a better icon - for this...). Hook up "Refile" to "refile_msg". - - * mail-ops.c (refile_msg): Call the shell's user_select_folder - routine, and then use message_list_foreach and real_refile_msg to - do the work. - (delete_msg): Update to use message_list_foreach. - - * folder-browser.c (mail_uri_to_folder): new function, extracted - from folder_browser_load_folder, to turn a URI into a folder. - (folder_browser_load_folder): Use it. - -2000-06-30 Peter Williams <peterw@curious-george.helixcode.com> - - * component-factory.c (create_news_storage, create_imap_storage): - Fixed to use new EvolutionShellClient proxy thingamajiggie. - -2000-06-30 Dan Winship <danw@helixcode.com> - - * message-list.c (on_row_selection): use the ETable row_selection - signal to track how many rows are selected. Eventually we will use - this info to disable toolbar buttons when you have too few/too - many messages selected, but the current toolbar widget doesn't - allow that. - - * message-list.h, message-list.c, mail-ops.c: Change selected_row - and selected_uid fields of MessageList to cursor_row and - cursor_uid to be more correct according to the new ETable - interfaces. - -2000-06-30 Ettore Perazzoli <ettore@helixcode.com> - - * component-factory.c: Eeek. Fix typo: add missing star in the - declaration of `global_shell_client'. - -2000-06-29 Ettore Perazzoli <ettore@helixcode.com> - - * component-factory.c: Replace `global_shell_interface' with - `global_shell_client'. - -2000-06-29 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-ops.c (delete_msg): Clean up compile warnings - (real_fetch_mail): Fetching from IMAP should do nothing - -2000-06-29 Christopher James Lahey <clahey@helixcode.com> - - * mail-ops.c: Handle multiple deletes (change by Peter Williams.) - -2000-06-29 Jeffrey Stedfast <fejj@helixcode.com> - - * folder-browser-factory.c: Changed "Send" to "Compose" to - avoid user confusion. Compose is a little more intuitive. - Also changed the pixmap to MAIL_NEW instead of MAIL_SND - - * mail-ops.c (compose_msg): Renamed to avoid confusion - -2000-06-29 Dan Winship <danw@helixcode.com> - - * component-factory.c (create_imap_storage, create_news_storage): - remove some code incorrectly copied and pasted from - create_vfolder_storage which caused vfolder creation to stop - working. - -2000-06-29 Christopher James Lahey <clahey@helixcode.com> - - * message-list.c, mail-ops.c: Changed the name of - e_table_select_row to e_table_set_cursor_row. - -2000-06-29 Peter Williams <peterw@helixcode.com> - - * message-list.c (message_list_init): Set the dnd_code of the - ETableHeader to something so that Solaris sprintf doesn't die - on a NULL string. - - * mail-config.c (providers_config_new): Check for a null "transport" - string (not all OS' handle NULL strings well *cough* Solaris) - -2000-06-28 Dan Winship <danw@helixcode.com> - - * mail-format.c (mail_generate_forward): add default subjects - - * component-factory.c (create_folder): Refuse to create folders - not of type "mail", and correctly create an empty "mbox" folder - for new folders in /local. - - * main.c (init_corba): Call od_assert_using_oaf() or - od_assert_using_goad() as appropriate to make sure people didn't - somehow trick the build system. - -2000-06-28 Jeffrey Stedfast <fejj@helixcode.com> - - * message-list.c: Added prototype for filter_date to make - it build cleanly - -2000-06-27 Christopher James Lahey <clahey@helixcode.com> - - * message-list.c: Made dates display grouping information - properly. - -2000-06-27 Peter Williams <peterw@curious-george.helixcode.com> - - * message-list.c (mark_msg_seen): Need to return a value - on error. - - * main.c (main): Don't start threads or enter threads if - there's no threading! Sigh. - - * test-thread.c: Don't compile if no threads. - - * session.c: Work without broken threads. - - * message-list.c (filter_date): Solve the ctime_r problem the - correct way, with the magic of autoconf. - -2000-06-27 Christopher James Lahey <clahey@helixcode.com> - - * message-list.c: Work around mismatched ctime_r functions. This - will be fixed. - -2000-06-27 Peter Williams <peterw@curious-george.helixcode.com> - - * mail-threads.c: Don't compile this if we don't have - threads enabled. This should maybe be on the Makefile.am - level. - -2000-06-27 Michael Zucchi <zucchi@zedzone.mmc.com.au> - - * component-factory.c (owner_set_cb): Put in a gross hack to - export the shell reference elsewhere. - -2000-06-26 Christopher James Lahey <clahey@helixcode.com> - - * message-list.c: Added a value_to_string handler. - -2000-06-26 Peter Williams <peterw@helixcode.com> - - * component-factory.c, mail-ops.c: #ifdef the threads stuff so - that if USE_BROKEN_THREADS is not defined we just call the functions - in the main thread. - - * mail-threads.h: Don't declare funcs if USE_BROKEN_THREADS not - defined. - - * mail-threads.c: Put the query and message boxes on top so that - you can see them. - -2000-06-26 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-config.c (error_dialog): va_start() returns void, don't - assign it's retval to a variable. - -2000-06-26 Ettore Perazzoli <ettore@helixcode.com> - - * main.c (main): Call `GDK_THREADS_ENTER()' and - `GDK_THREADS_LEAVE()' around the main loop as in the examples from - the GTK+ FAQ. - - * mail-threads.c (DEBUG): New macro for debugging. - (read_msg): Use it. - -2000-06-25 Peter Williams <peterw@helixcode.com> - - * Makefile.am: Clean up the various _LIBS and _CFLAGS - to work with simpler THREADS_LIBS and THREADS_CFLAGS scheme. - -2000-06-23 Jeffrey Stedfast <fejj@helixcode.com> - - * folder-browser.c (folder_browser_load_folder): Improved the - code to separate the imap namespace from the folder name. - -2000-06-23 Peter Williams <peterw@curious-george.helixcode.com> - - * component-factory.c: Include e-util/e-setup.h for the - prototype of evolution_dir; prototype create_news_storage. - (real_create_imap_storage, real_create_news_storage): New - functions moving the camel stuff into the async callback. - (create_imap_storage, create_news_storage): Chopped in - half to move camel stuff as above. - - * mail-ops.c: Include "mail-threads.h" for threading protos. - (real_fetch_mail, real_send_mail, real_expunge_folder): - New functions moving the camel stuff into the async callback. - (async_mail_exception_dialog): A version of mail_exception_dialog - to be called from the async handlers (just calls mail_op_error()) - (fetch_mail, expunge_folder, composer_send_cb): Cut in half to - move camel stuff as above. - (cleanup_send_mail): Clean up after the async real_send_mail - with the gtk_object_destroys et al. - - * mail-threads.c: Instead of hiding the progress bar, make it - zip back and forth constantly. - (progress_timeout): New func. Timeout called to make the pbar - shimmy. - (timeout_toggle): New func. Turn on and off the shimmy effect. - (check_cond): New func. Make sure that the GCond for modal - operation is initialized before mail_op_{error,get_password}. - (show_error_clicked, read_msg, get_password_clicked): Move - over to timeout_toggle. - (mail_op_error,mail_op_get_password): Add check_cond() call. - - * main.c: (main) Call g_thread_init. - - * session.c: Change auth_callback stuff over to assume that it's - being called async. Note: no real good way to tell if this is - the case or not. - (request_callback): ifdef'ed out - (evolution_auth_callback): Use mail_op_get_password. - -2000-06-22 Jeffrey Stedfast <fejj@helixcode.com> - - * folder-browser.c (folder_browser_load_folder): Now should - correctly get the selected folder from the given URL. - -2000-06-22 Chris Toshok <toshok@helixcode.com> - - * folder-browser.c (folder_browser_load_folder): add handling for - loading "news:" folders. - - * component-factory.c (create_news_storage): add a root for news - source. - (owner_set_cb): call create_news_storage. - -2000-06-22 Jeffrey Stedfast <fejj@helixcode.com> - - * folder-browser.c (folder_browser_load_folder): Updated to - prepend url-> path if it exists for that imap store. - - * component-factory.c (create_imap_storage): Modified to not - prepend a hard-coded namespace. - -2000-06-22 Chris Toshok <toshok@helixcode.com> - - * mail-ops.c (fetch_mail_cleanup): new function, passed as arg to - mail_operation_try. - (fetch_mail): add cleanup func arg. - -2000-06-22 Christopher James Lahey <clahey@helixcode.com> - - * message-list.c: Changed ml_value_at to return "" instead of NULL - in some cases. - -2000-06-22 Peter Williams <peterw@curious-george.helixcode.com> - * Makefile.am: Add GNOME_EXTRA_LIBS so that we get libgthread - in our LIBS for evolution-mail. - - * mail-threads.c: Make the dialog boxes for error and - question non-modal. They're modal relative to the dispatch - thread, but before they would also eg lock up the toolbar - buttons (while the menus, managed by another process, were - active -- a weird effect). - -2000-06-22 Peter Williams <peterw@curious-george.helixcode.com> - - * mail-threads.[ch]: Extra argument to mail_operation_try: - 'cleanup', a function to be called in the main thread after - the dispatcher thread exits. gtk_object_destroy's et al may - attempt to unmap windows so we can't do them in the dispatcher - thread :-( - - * test-thread.c: Updated with demo of new argument working. - -2000-06-22 Peter Williams <peterw@helixcode.com> - - * test-thread.c (op_5): New tests for the get_password - hook. - - * mail-threads.[ch]: New hook, mail_op_get_password, for - getting a user response from an async operation. The operation - blocks while waiting for the response. A big whole mutex - condition threading blocking dealie to make sure that it - works. - - Also the error hook creates a dialog again, which also needs - to block its caller while we wait for the user to press ok. - -2000-06-22 Peter Williams <peterw@helixcode.com> - - * mail-threads.c (various functions): Prettify the UI - so that the progress bar doesn't become all huge 'n stuff. - (mail_operation_try): Now save the operation's description, - so that we can display it later as the default message. - (read_msg): When the operation starts set the label to its - UI-friendly name. - (dispatch_func): Free the saved prettyname. - -2000-06-21 Christopher James Lahey <clahey@helixcode.com> - - * message-list.c: Removed an erroneous comment. - -2000-06-21 Dan Winship <danw@helixcode.com> - - * mail-config.c (create_transport_page): Make this not crash if - you don't have a transport configured. - - * message-list.c: Update received date to work like sent date. - -2000-06-21 Peter Williams <peterw@helixcode.com> - - * mail-thread.{c,h}: New files -- a simple API for executing - the major mail ops (fetch_mail etc) asynchronously, allowing - the operations to send messages and update a progress bar. - - * test-thread.{c,h}: Tests the mail-thread API. - - * Makefile.am: add mail-thread.[ch] to evolution_mail_SOURCES - and declare the test_thread noinst_PROGRAM. - -2000-06-21 Peter Williams <peterw@helixcode.com> - - * mail-format.c (mail_generate_reply): Include "e-setup.h" to - get the prototype for evolution_dir. - -2000-06-20 Jeffrey Stedfast <fejj@helixcode.com> - - * component-factory.c (create_imap_storage): Oops. Should - have checked for a NULL sources. - -2000-06-20 Dan Winship <danw@helixcode.com> - - * message-list.c (mark_msg_seen): Quick hack to prevent a NULL - pointer dereference. Things need to be cleaned up a bit more here - though. - - * mail-sources.c: Oops. This should have been removed a long time - ago. - -2000-06-20 Jeffrey Stedfast <fejj@helixcode.com> - - * folder-browser.c (folder_browser_load_folder): Working on getting - this to work :) - - * component-factory.c (create_imap_storage): Should now correctly - construct the folder path allowing the selection of a folder. - -2000-06-20 Ettore Perazzoli <ettore@helixcode.com> - - * mail-format.c (mail_generate_reply): Declare `evolution_dir'. - Ugly, ugly, ugly, but I am not sure where it should go instead. - -2000-06-19 Ettore Perazzoli <ettore@helixcode.com> - - * mail-ops.c (ask_confirm_for_empty_subject): New function to ask - confirmation for an empty subject line. - (composer_send_cb): Use it if the subject is empty and only send - the message if the user confirms. - -2000-06-20 Jeffrey Stedfast <fejj@helixcode.com> - - * component-factory.c (create_imap_storage): Now creates the IMAP - storage (listing subfolders and such) - -2000-06-19 Dan Winship <danw@helixcode.com> - - * mail-format.c (find_preferred_alternative): add an option to - prefer text/plain. - (reply_body): add an option to prefer text/plain - (mail_generate_reply): Check the mail sending preferences, and - generate a text/plain reply if the user prefers to send plain text - (and we have a text/plain part to generate a reply from). - -2000-06-19 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-config.c (providers_config_new): Should now correctly display - the Transport page (made it set the optionmenu correctly, before it - would only set SMTP). - (create_transport_page): Updated to set the page info to sendmail/smtp - based on the url. - (create_service_page): Had to add some code to set data on some objects - so I could grab the objects I needed to modify in the above function. - -2000-06-18 Jeffrey Stedfast <fejj@helixcode.com> - - * folder-browser.c (folder_browser_load_folder): started to add - code to load an IMAP folder. - - * component-factory.c: Started to add a create_imap_storage - method so that we can eventually have our IMAP store displayed - in the tree view. - (create_vfolder_storage): Renamed from - create_test_storage(). - (owner_set_cb): Updated. - -2000-06-17 Dan Winship <danw@helixcode.com> - - * message-list.c (message_list_set_folder): Prevent double-freeing - action on summary_table and uid_rowmap. - -2000-06-16 Dan Winship <danw@helixcode.com> - - * message-list.c (ml_set_value_at): Implement clicking on the - envelope icon to set read/unread. Based on a patch by clahey. - (select_msg): keep the timeout id for the "seen" flagging in the - message_list structure, so ml_set_value_at can clear it so it - doesn't re-mark a message seen after you click it unseen. - -2000-06-16 Dan Winship <danw@helixcode.com> - - * message-list.c (get_message_row): new function to do a uid to - row mapping. - (mark_msg_seen, select_msg, message_changed, - message_list_set_folder): Update for Camel flag changes. - (on_cursor_change_cmd): Rename "row_to_select" to "selected_row", - and keep a "selected_uid" as well. - - * mail-ops.c (composer_send_cb): Update for Camel flag changes, - and fix some memory-handling bugs. (Free the post_send_data when - the composer is destroyed, not when the user clicks "send", which - could happen never, or more than once.) - (delete_msg): Update for Camel flag changes, and fix the "holding - down the delete key skips some messages" bug. - -2000-06-15 Dan Winship <danw@helixcode.com> - - * mail-ops.c (fetch_mail): - * component-factory.c (owner_unset_cb): - * message-list.c (message_list_set_folder): Update for CamelFolder - changes. - - * folder-browser.c (folder_browser_clear_search): New function to - revert back to non-searching mode. - - * mail-ops.c (fetch_mail): Use folder_browser_clear_search. - - * mail-display.c (on_url_requested): if the document requests an - unknown URL, it's not an error; just ignore the URL. - - * mail-ops.c (fetch_mail): If there's no new mail, tell the user. - -2000-06-14 Radek Doulik <rodo@helixcode.com> - - * main.c (main): call gtkhtmllib_init here - -2000-06-13 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-config.c (on_SourceConfigDialogButton_clicked): Make sure source - is always pointing to something, so a blank is not written to the config file - on close. - -2000-06-13 Ettore Perazzoli <ettore@helixcode.com> - - * Makefile.am (SHELL_OBJS): Removed. - (evolution_mail_LDADD): Use `libeshell.a'. Also use - `top_builddir' consistently. - -2000-06-12 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-config.c: Got rid of sources_max_row and identities_max_row - as they are not really needed (just use clist->rows) - (on_cmdSourcesEdit_clicked): Modified to make 'source' - point to the data being edited. - (on_cmdSourcesAdd_clicked): Adds a new clist item and selects it so the - editor knows where to stick the data when it's done. - -2000-06-12 Federico Mena Quintero <federico@helixcode.com> - - * message-list.c: Removed the ETableModel thaw handler. - -2000-06-12 Dan Winship <danw@helixcode.com> - - * folder-browser.c (folder_browser_set_uri): Return the result of - folder_browser_load_folder. - (get_prop, set_prop, folder_browser_properties_init): Remove. No - longer needed. - - * folder-browser-factory.c (folder_browser_factory_new_control): - Add a "uri" argument, return NULL if setting it fails. - (folder_browser_factory_new_control): Remove property bag stuff. - (folder_browser_factory_init, folder_browser_factory): Remove - this, since we're using the component factory now. - - * component-factory.c (create_view): Update for - folder_browser_factory_new_control change and return NOTFOUND as - appropriate. - - * main.c (main): Don't call folder_browser_factory_init. - - * mail-format.c (mail_generate_reply): Fix the subject generation - so we don't get "Re: Re:". This is working around something that - may later be declared a misfeature in Camel. - -2000-06-10 Ettore Perazzoli <ettore@helixcode.com> - - * component-factory.c (create_folder): New stub implementation for - the folder creation function in the EvolutionShellComponent we - expose [it simply returns success all the time]. - (factory_fn): Pass this function to `evolution_shell_component_new'. - -2000-06-09 Dan Winship <danw@helixcode.com> - - * folder-browser.c (folder_browser_new): Add a serial number to - FolderBrowser. - - * folder-browser-factory.c (control_activate, control_deactivate): - Include fb serial number in the name of the Bonobo toolbar to - prevent problems with disappearing toolbars. This is a kludge and - should go away. - - - * mail-ops.c (expunge_folder): display error from - camel_folder_expunge if there is one. - - * message-list.c (select_row): install an idle function to - select the row rather than doing it directly. Ugh. What a - kludge, but at least it works now. - - * session.c (evolution_auth_callback): Update for - CamelAuthCallback changes. (Uncache passwords when asked to.) - - * mail-ops.c (fetch_mail): close and expunge the source folder - after copying it to a local folder. - -2000-06-09 Ettore Perazzoli <ettore@helixcode.com> - - * component-factory.c (create_view): Updated to match the changes - to the definition of `EvolutionShellComponentCreateFn'. If @type - is not "mail", return an "unsupported type" error. - (factory_fn): Pass NULL for the `remove_folder' and - `create_folder' functions. - -2000-06-09 Dan Winship <danw@helixcode.com> - - * mail-format.c: Redo things a bit so that whitespace-only - text parts aren't displayed. (In particular, so that - whitespace-only subparts of multipart/mixed aren't displayed as - separate (empty) parts.) - -2000-06-06 Dan Winship <danw@helixcode.com> - - * mail-ops.c (fetch_mail): - * folder-browser.c (folder_browser_load_folder): Update for folder - creation/existence changes. - - * message-list.c (message_list_set_folder): Remove the code to - create the folder if it doesn't exist, since we don't want to do - that. - -2000-06-05 Dan Winship <danw@helixcode.com> - - * mail-ops.c (composer_send_cb): Leave the composer window around - if the message doesn't get sent. - -2000-06-05 Matt Loper <matt@helixcode.com> - - * folder-browser.c (etable_key): Allow "GDK_KP_Delete", a keypad - delete key, to delete a message. - -2000-06-05 Dan Winship <danw@helixcode.com> - - * session.c (evolution_auth_callback): Remember passwords between - calls. - (forget_passwords): Callback for "Forget Passwords" menu item. - - * folder-browser-factory.c (control_activate): - (control_deactivate): Add "Forget Passwords" menu item. - - * mail.h, mail-ops.c: fix some function prototypes - - * folder-browser.c (etable_key): Add "Delete" = delete message. - - * mail-format.c (mail_generate_forward): Update for new composer - attachment interface. - -2000-06-02 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-config.c (providers_config_new): Added a new notebook - page that allowed for mail format (text/plain or - multipart/alternative) - -2000-06-02 Dan Winship <danw@helixcode.com> - - * message-list.c (filter_date): If the date in the summary is 0, - output "?". - - * component-factory.c (create_view): keep a GList of folder - browsers created - (owner_unset_cb): Go through the list and close each folder before - exiting so they sync their summary state, etc to disk. - - * mail-ops.c (fetch_mail): Use camel_service_connect, not - connect_with_url, since we already passed the URL into - camel_session_get_store. - -2000-06-02 Christopher James Lahey <clahey@helixcode.com> - - * message-list.c: Use camel_folder_free_summary instead of - g_ptr_array_free. Unref the folder when we're done with it. - -2000-06-02 Christopher James Lahey <clahey@helixcode.com> - - * session.c: Revert removal of e_setup_base_dir. - -2000-06-02 Dan Winship <danw@helixcode.com> - - * folder-browser.c (my_folder_browser_init): Connect to ETable's - key_press signal. - (etable_key): scroll mail on space/backspace. - -2000-06-02 Christopher James Lahey <clahey@helixcode.com> - - * message-list.c: Made sent column as wide as from column. - -2000-06-02 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-config.c (on_cmdSourcesAdd_clicked): Changed identity_row - to source_row as this is a Sources clist we are dealing with and - not an identity clist - (on_cmdSourcesEdit_clicked): same - (on_cmdSourcesDelete_clicked): again, same - (on_cmdSourcesEdit_clicked): Source editor now fills in data from - the clist - -2000-06-01 Dan Winship <danw@helixcode.com> - - * message-list.c: Add a date column. - (COL_SENT_WIDTH_MIN): Make this wider. - (ml_value_at): return the sent date (as a time_t) for COL_SENT. - (Fix COL_TO too while I'm here.) - (ml_duplicate_value, ml_free_value, ml_initialize_value, - ml_value_is_empty): COL_SENT is numeric now. - (message_list_init_renderers): Create a date renderer (using - text_filter to translate the time_t into a string). - (message_list_init_header): Use render_date for COL_SENT. - -2000-06-01 Christopher James Lahey <clahey@helixcode.com> - - * session.c: Don't call e_setup_base_dir. - -2000-06-01 Dan Winship <danw@helixcode.com> - - * mail-format.c (mail_generate_forward): Fix forwarding to work - for people other than me. :) [Although apparently it doesn't - really.] - - * mail-ops.c (delete_msg): Add a quick hack to move the selection - down a row when you delete a message. - - * mail-format.c (handle_message_rfc822): use <blockquote> rather - than <center><table border=1 width=95%> to frame the embedded - message. If <pre> text in the subtable won't fit in the 95% width, - GtkHTML will write past the border of the table (and - <blockquote><table border=1> causes creeping updates so it's not - usable for now). - -2000-06-01 Christopher James Lahey <clahey@helixcode.com> - - * message-list.c (message_list_init): Turn off the grid in our - ETable. - -2000-06-01 Dan Winship <danw@helixcode.com> - - * mail-format.c (write_headers): Oops. This needs to take a - message argument because we might be writing headers for an - embedded message/rfc822 subpart rather than the root document. - -2000-06-01 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-config.c: Config dialogs are completed. - (service_acceptable): Fixed a segfault caused by duplicate - camel_exception_free() - (providers_config_new): Identity and Source clists are now filled in - when the dialog is created as well as the Transport page - - * folder-browser-factory.c: Renamed Tool/ menu items - Vfolder was changed to Virtual Folder and - Configure Camel Providers was changed to Mail Configuration - -2000-06-01 Ettore Perazzoli <ettore@helixcode.com> - - * Makefile.am (evolution_mail_LDADD): Link with - `libemiscwidgets.a'. - - * mail-display.c (mail_display_new): Use an EScrollFrame instead - of a GtkScrolledWindow. - (mail_display_set_message): Likewise. - - * mail-display.h: Replace the GtkScrolledWindow with an - EScrollFrame. - -2000-06-01 Dan Winship <danw@helixcode.com> - - * component-factory.c (owner_unset_cb): Quit when the shell exits. - This is a kludge, but a pretty necessary one until the refcounting - bugs that keep the component from exiting properly are fixed. - -2000-05-31 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-config.c: Partially implemented the source - configuration, seems to segfault due to a destroyed - gnome dialog being destroyed again in the method - on_SourceConfigDialogButton_clicked() - -2000-05-31 Dan Winship <danw@helixcode.com> - - * mail-format.c (free_url, handle_text_enriched, - get_url_for_icon): Fix up memory management of x-evolution-data - URLs so the URLs and/or their data don't get freed while there are - still references to them. - - * message-list.c (message_list_init_header): redo the (unused) - online status column to no longer refer to pixmaps that no longer - exist. - -2000-06-01 Ettore Perazzoli <ettore@helixcode.com> - - * folder-browser-factory.c (control_activate): Put the toolbar - into a frame to make it look like standard GNOME toolbars. Also, - set `GNOME_DOCK_ITEM_BEH_NEVER_VERTICAL' so that it does not do - evil things when its moved to the left or the right of the window. - -2000-05-31 Jeffrey Stedfast <fejj@helixcode.com> - - * mail-config.c: Configuration dialog now allows - adding/editing/deleting of Identities (which leaves - adding/editing/deleting of sources left to implement). - The data is also saved when the dialog is exited via - the OK button. - -2000-05-31 Dan Winship <danw@helixcode.com> - - * mail-format.c (mail_format_mime_message): Initialize the "urls" - hash table stored on the message and store cid and other URLs - there rather than as object data on the message. - (get_cid): rewrite this a bunch - (handle_text_enriched): move the code from write_iframe_string() - into here, since it's the only place that actually needs it. - (handle_text_html): simplify this a lot. We can use a cid: URL - here rather than x-evolution-data. - (get_url_for_icon): New routine to return URLs for icons, and - cache the results, so we don't have to keep re-reading the icon - files (and so we can't be spoofed into reading non-icon files). - (handle_mystery, handle_audio): use get_url_for_icon. - - * mail-display.c (save_data): move the CamelMimePart filename - extracting code from get_cid to here. - (on_link_clicked, on_object_requested): Update for cid: changes. - (on_url_requested): Kill off the kludgy, exploitable x-gnome-icon - URL schema, update cid and x-evolution-data to match - mail-format.c. - - It should now be easier to implement RFC 2557 (Content-Location, - etc), but that RFC still pretty much sucks. - -2000-05-30 Dan Winship <danw@helixcode.com> - - * mail-format.c: Redo this back to the old way: a single GtkHTML - with various things inline in it. (Gets rid of flicker, simplifies - some scrolling, selecting, and printing issues.) - (handle_text_enriched, handle_text_html): Use <iframe>s for these, - to protect the rest of the document from their possibily invalid - HTML. - (handle_via_bonobo): Use (new-and-improved) <object> tags for - this, moving most of the work back into mail-display.c - - * mail-display.c (on_object_requested): Move the Bonobo embedding - code back here again (reorganized a bit). - (on_url_requested): add x-evolution-data handler, for iframe - bodies. - (mail_html_new, mail_html_end): removed - (mail_display_set_message, mail_display_new): Update for NWO. - -2000-05-30 Not Zed <NotZed@HelixCode.com> - - * folder-browser.c (search_set): Properly encode the search string. - -2000-05-30 Jeffrey Stedfast <fejj@helixcode.com> - - * mail.h: Added a prototype for providers_config_new() which - is the constructor for the configuration dialog window - - * mail-config.c: Added set_service_url() which is basically - the reverse of get_service_url(). - Implemented on_cmdCamelServicesOK_clicked() - The configuration - window will now remember the Sendmail/SMTP data that the user - had entered in the previous session. - Removed on_cmdCamelServicesApply_clicked() - No need for this. - -2000-05-30 Dan Winship <danw@helixcode.com> - - * message-list.c (message_changed): call - e_table_model_row_changed, not e_table_model_changed so we do less - work, and don't lose the current selection. - (select_msg): Set up a timer to mark the displayed message as - "seen" if it's selected for longer than 1.5 seconds (a number - pulled out of Matt's butt). - (ml_value_at): Use the MESSAGE_STATUS column for read/unread as - well as deleted. - - * message-list.c: use the "new" tigert pixmaps rather than the - older ones. Includes a "replied to" icon (which is used now), but - no "deleted" icon (although we have the strikeout renderer for - that now). - -2000-05-30 Christopher James Lahey <clahey@helixcode.com> - - * message-list.c, message-list.h: Added bold for unread messages. - -2000-05-30 Jeffrey Stedfast <fejj@helixcode.com> - - * mail.h: Added a prototype for providers_config() - which is the callback for a new menu item that - will construct a configuration dialog for the camel - providers and identities and display it - - * mail-config.c: Added some code to construct the - new providers dialog and a bunch of callbacks (most - of which are not yet useful) - - * mail-ops.c: Added the code for the providers_confi() - callback - - * folder-browser-factory.c: Added the - "Tools/Camel Providers Configuration ..." menu item - -2000-05-30 Christopher James Lahey <clahey@helixcode.com> - - * message-list.c: Switched to using "cursor_change" signal instead - of "row_selection" for switching messages. Select the first row - (still doesn't work because of ETable.) Adapt to some small - ETable changes. Set drawfocus to FALSE. - -2000-05-29 Not Zed <NotZed@HelixCode.com> - - * folder-browser.c (folder_browser_load_folder): Hardcode the - vfolder source to just the inbox (so at least it returns - something). - - * component-factory.c (create_test_storage): Create a vfolder dir - first, and put the folders in that. - (create_test_storage): Create the storage as VFolders, not - "storage_name" :) - -2000-05-28 Dan Winship <danw@helixcode.com> - - * mail-config.c (error_dialog): helper function since we need to - set "modal" on the dialogs returned by gnome_error_dialog to make - them work when popped up from the modal Druid. - (service_acceptable): New function to check if the info entered on - a store/transport page actually checks out. - (mail_config_druid): Connect to the "next" signal on the store and - transport pages and don't let the user continue if the data is - bad and "check this before continuing" is checked. Also, only - display sources/transports in the "mail" domain. (Ie, not - "vfolder".) - - * mail-format.c (write_recipients_to_stream): Use `foo@bar' rather - than `<foo@bar>' for recipient with no name. - - * mail-ops.c (fetch_mail): don't put up an error message if the - user cancels the password dialog. - -2000-05-27 Not Zed <NotZed@HelixCode.com> - - * Makefile.am (SHELL_OBJS): Include mail storage so we can - initialise folders. - - * component-factory.c (create_test_storage): Parses vfolder - defintions and adds them to the storage. Definetly needs more - work. - - * folder-browser-factory.c (control_activate): Add the VFolder - druid menu item. - (control_deactivate): And remove it. - - * mail-ops.c (vfolder_editor_clicked): For editing vfolder - definitions (rather like filters, oddly enough :). Tries to - update the shell but it doesn't seem to work properly - requires a - mail component restart to take effect. - - * folder-browser.c (folder_browser_load_folder): Handle vfolder: - urls' appropriately and map to camel. Still needs a way to tell - the vfolder what folders to search! (all vfolders come up empty!). - -2000-05-28 Christopher James Lahey <clahey@helixcode.com> - - * message-list.c, message-list.h: Added a COL_DELETED and made it - the strikeout column for both text renderers. - -2000-05-27 Dan Winship <danw@helixcode.com> - - * mail-format.c: Various improvements: - - (call_handler_function, etc): Add a "mime_type" argument to the - handlers, so that if a part is tagged as - "application/octet-stream", and we figure out that it's really - something else, the handler we call can know what that something - else is. - - (handle_text_enriched): Small fixes to make this not do - text/enriched-specific syntax in text/richtext or vice versa. - - (handle_mystery): Allow for mystery data that can't even be saved - to disk. (ie, unrecognized external-body). Let the caller specify - the URL to use. - - (handle_message_external_body): New function to deal with - message/external-body parts. Generates URLs for anon-ftp, - local-file, and URL access-types, and a more-useful-than-before - descriptive message for other types. - - (handle_audio, handle_undisplayable): Use gnome_mime_get_value to - try to get a description of the MIME type to display to the user - rather than the raw form. (This will only work if the user has - recent gnome-vfs installed. [If they don't, it works just like - it used to.]) - -2000-05-26 Dan Winship <danw@helixcode.com> - - * mail-format.c (handle_text_html): Fix a bug (security/stability) - in its usage of mail_html_write. - - * mail-ops.c (composer_send_cb, reply): set CAMEL_MESSAGE_ANSWERED - on a message after a successful reply. - - * message-list.c (folder_changed): free the summary with - camel_folder_free_summary rather than g_ptr_array_free. - - * mail-format.c (handle_via_bonobo): Update for PersistStream - changes - -2000-05-25 Ettore Perazzoli <ettore@helixcode.com> - - * main.c (main): Initialize the component factory. - - * Makefile.am (evolution_mail_LDADD): Link with - `evolution-shell-component.o' from the shell directory. - - * evolution-mail.oafinfo: Updated with the - Evolution::ShellComponent OAFIID. - - * evolution-mail.gnorba: Updated with the - Evolution::ShellComponent GOAD ID. - - * folder-browser-factory.c (folder_browser_factory_new_control): - New function; code moved out from `folder_browser_factory'. - (folder_browser_factory): Use it. - - * component-factory.c: New. - * component-factory.h: New. - -2000-05-24 Dan Winship <danw@helixcode.com> - - * mail-ops.c (composer_send_cb): connect to and disconnect from - the transport. - -2000-05-24 Christopher James Lahey <clahey@helixcode.com> - - * Makefile.am: Added libepaned.a. - - * folder-browser.c: Switched from GtkPaned to EPaned. - -2000-05-23 Ettore Perazzoli <ettore@helixcode.com> - - * Makefile.am: Don't link to `evolution-service-repository.o' - anymore. - - * folder-browser-factory.c: Don't use crufty service-repository - anymore. - -2000-05-21 Ettore Perazzoli <ettore@helixcode.com> - - * message-list.c (get_message_info): Made static. - (ml_initialize_value): Return NULL to placate compiler. - - * folder-browser.c (folder_browser_gui_init): Add cast. - - * mail-display.c (mail_html_new): Don't pass an empty URL to - `gtk_html_begin()' anymore. - - * mail-config.c (put_html): Don't pass an empty URL to - `gtk_html_begin()' anymore. - - * mail-display.h: Updated for the new GtkHTML API that uses - `GtkHTMLStream *' instead of `GtkHTMLStreamHandle'. - * mail-display.c: Likewise. - * mail-config.c: Likewise. - * mail-format.c: Likewise. - -2000-05-19 NotZed <NotZed@HelixCode.com> - - * mail-format.c: Fixes for stream stuff. - - * mail-display.c (save_data_cb): Remove exception stuff on streams. - -2000-05-19 Christopher James Lahey <clahey@helixcode.com> - - * message-list.c: Added initialize_value and value_is_empty - callbacks. - -2000-05-18 Dan Winship <danw@helixcode.com> - - * folder-browser-factory.c (folder_browser_factory): Remove - development_warning (moved to shell) - - * message-list.c (select_msg): Update for camel_folder_get_uids - (folder_changed, message_list_set_folder): Update for - camel_folder_get_summary - - * mail-ops.c (fetch_mail): Update for camel_folder_get_uids - -2000-05-17 Dan Winship <danw@helixcode.com> - - * mail-component.c: This seems to be cruft. Nuke it. - - * mail-display.c (save_data_cb, save_data, on_url_requested): - * mail-format.c (handle_text_plain_flowed, handle_text_html): - Use camel_data_wrapper_write_to_stream rather than - camel_data_wrapper_get_output_stream. - -2000-05-16 NotZed <NotZed@HelixCode.com> - - * mail-ops.c (filter_edit): Function to bring up the filter editor. - (filter_druid_clicked): Save/close dialogue. - (fetch_mail): Apply filters to incoming mail ... *hold breath* - If we are coming from a non-indexed/searchable/etc source, then - copy it to an mbox first. When copying mail from an mbox source, - dont remove it aftewards, open it for append, so partially - filtered mail isn't lost. - - * Makefile.am (evolution_mail_LDADD): Added libfilter. - (INCLUDES): Add EVOLUTION_DATADIR, and fix matt's brokeneditor(tm) - for putting spaces instead of tabs in. - -2000-05-16 Christopher James Lahey <clahey@helixcode.com> - - * mail-format.c: Removed usage of bonobo_object_destroy. - -2000-05-14 Christopher James Lahey <clahey@helixcode.com> - - * message-list.c: Updated to work with new ETable resizing. - -2000-05-12 NotZed <NotZed@HelixCode.com> - - * mail-ops.c (fetch_mail): Use 6 X's to mkstemp, as required by - the man page, just a temp fix, this should probably change to a - known filename. - -2000-05-11 Dan Winship <danw@helixcode.com> - - * folder-browser-factory.c (control_activate): Now that we depend - on current gnome-libs we can make the toolbar detachable again. - -2000-05-11 Federico Mena Quintero <federico@helixcode.com> - - * folder-browser-factory.c (development_warning): Left-justify the - message. - -2000-05-10 Christopher James Lahey <clahey@helixcode.com> - - * folder-browser-factory.c (development_warning): Made this dialog - have fewer buttons. - -2000-05-10 Christopher James Lahey <clahey@helixcode.com> - - * folder-browser-factory.c (development_warning): New development - warning text from Nat. - -2000-05-10 Larry Ewing <lewing@helixcode.com> - - * mail-config.c (html_new): only set the default background color - if style is not NULL. - -2000-05-09 Christopher James Lahey <clahey@helixcode.com> - - * Makefile.am: Removed folder-browser-factory.h since it doesn't - exist. Added mail-display.h, mail-types.h, pixmaps.h. - -2000-05-09 Matt Loper <matt@helixcode.com> - - * folder-browser-factory.c (control_activate): Remove "File->mail" - menuitem. - - * mail-config.c (mail_config_druid): Fill in "blah blah blah". - -2000-05-09 Dan Winship <danw@helixcode.com> - - * folder-browser.c (folder_browser_load_folder): make this a - little less kludgy. Use gnome_error_dialog rather than printf on - errors. - - * mail-ops.c (fetch_mail): Fix to work with the new shell stuff... - sorta. Will need more fixing later when the new shell framework is - more done. - - * mail-config.c (finish): Call gnome_config_sync so the data - actually gets written. - -2000-05-08 Dan Winship <danw@helixcode.com> - - * mail-display.c (save_data_cb): - (on_url_requested): Update for CamelStream CamelException changes. - - * mail-format.c: Pass NULL for a CamelException in a bunch of - places... the user will see that the data is not being displayed, - and there's not a lot we can do, and none of these things should - be failing anyway. Maybe fix this later. - -2000-05-07 NotZed <NotZed@HelixCode.com> - - * message-list.c (ml_value_at): Size moved to message info, rather - than content info structure. - -2000-05-07 Dan Winship <danw@helixcode.com> - - * message-list.c (select_msg): unref the message after displaying - it. - - * mail-format.c (get_data_wrapper_text): - (handle_text_plain_flowed): - (handle_via_bonobo): Replace camel_stream_close calls. - -2000-05-07 Matt Loper <matt@helixcode.com> - - * folder-browser-factory.c: Changed a toolbar button from saying - "New mail" (which suggests you might be composing new mail) to - "Get mail". - -2000-05-06 Dan Winship <danw@helixcode.com> - - * folder-browser-factory.c (folder_browser_factory): Don't - hardcode "inbox" here. - - * folder-browser.c (folder_browser_set_uri): Don't hardcode - "inbox" here either. - (folder_browser_load_folder): Create a new store according to the - folder browser's URI, and load the mbox file from that store. - Parts of this are temporary. - - * session.c, mail.h: There is no longer a global store, just a - global session. - - * mail-config.c, mail-ops.c: Update for default_session -> session - change. fetch_mail is currently broken. - -2000-05-06 Dan Winship <danw@helixcode.com> - - * mail-config.c: New code to configure identity, mail source, and - mail transport. - (mail_config_druid): A druid using the config widgets. (Only - allows configuration of a single identity, source, and transport.) - - * mail-ops.c (check_configured): New function to make sure the - user has configured stuff, and call the druid if not. - (fetch_mail, send_msg, send_to_url, reply, forward_msg): Call - check_configured - (composer_send_cb): Make this pass the message to a CamelTransport - rather than just printing it to stdout. - - * folder-browser-factory.c (development_warning): Add a warning - about sending mail, since you can do that now. - -2000-05-06 Chris Toshok <toshok@HelixCode.com> - - * .cvsignore: ignore evolution-mail.pure - - * Makefile.am: add support for building evolution-mail.pure - -2000-05-06 Dan Winship <danw@helixcode.com> - - * mail.h: consolidate mail-format.h, mail-identify.h, mail-ops.h, - main.h and session.h into this new file. There's no reason to have - a .h for every .c. - -2000-05-05 Anders Carlsson <andersca@gnu.org> - - * test-mail.c (create_container): Use the OAFIID when using an - OAF-enabled build of bonobo. - -2000-05-04 NotZed <NotZed@HelixCode.com> - - * message-list.c (message_list_set_folder): Get the whole message - summary right away. - (folder_changed): And if we change too. - (ml_row_count): Use the match count or summary table length as the - row count. - (get_message_info): Use array references to lookup message summary - info. For the search result list, use the summary_search_cache to - cache the info lookup. - (message_list_init): Allocate the summary search cache. - (message_list_destroy): Free the summary search cache and the - summary table, if there is one to free. - (message_list_set_search): Save the match count, and clear the - summary search cache for reuse. - (folder_changed): Re-retrieve the summary list if the folder has - changed. - (message_list_set_folder): Retrieve the summary list when opening - the folder. - -2000-05-03 Jason Leach <leach@wam.umd.edu> - - * Makefile.am (evolution_mail_LDADD): s/-lunicode/$(UNICODE_LIBS)/ - in the LDADD section. - -2000-05-03 Dan Winship <danw@helixcode.com> - - * mail-format.c (write_recipients_to_stream, write_headers): Make - the "Cc:" field optional again. (Before, we could check if - camel_mime_message_get_recipients returned NULL, but now we need - to actually look into the returned CamelInternetAddress object.) - -2000-05-03 Larry Ewing <lewing@helixcode.com> - - * folder-browser.c (folder_browser_gui_init): comment out the - changed signal for now. - -2000-05-02 Matt Loper <matt@helixcode.com> - - * Makefile.am: set G_LOG_DOMAIN. - -2000-05-02 Larry Ewing <lewing@helixcode.com> - - * message-list.c (message_list_set_search): only free search if it - is not NULL. - -2000-05-02 NotZed <NotZed@HelixCode.com> - - * folder-browser.c (folder_browser_gui_init): Connect the changed - signal to search, so it searched immediately? - -2000-05-01 NotZed <NotZed@HelixCode.com> - - * pixmaps.h: Added envelope-deleted state. - - * folder-browser-factory.c: Setup callback for actual delete op. - (control_activate): Setup a tool menu item to expnge deleted - messages. - - * mail-ops.c (delete_msg): Toggle the delete flag on a message. - (expunge_folder): New function to expunge deleted messages from - the current folder. - - * folder-browser.c (folder_browser_gui_init): A hackish little - quick-search entry. - (search_activate): Perform a quick-search on the folder subject - only. - (folder_browser_gui_init): Add an option meny to the search line. - (create_option_menu): Build the option menu from a table. - (search_set): Build a search from another string whent he option - menu or text item is changed. 5 search options are defined so - far. - - * message-list.c (get_message_info): If there is an active search, - then get the data from that ... use this instead of - _get_message_info(). - (ml_row_count): If we have an active search, get the info from its - result. - (select_msg): Changed to use get_message_info, so searches work. - (ml_value_at): And same here. - (message_list_init_renderers): Added a 3rd state to message_status - = deleted. - (ml_value_at): Show the message state as deleted, if it is marked - for deletion. - (folder_changed): When the folder changes, update the display. - (message_list_set_folder): Connect to the folder_changed event - here. - (message_changed): Callback to update the display when the message - changes. - (select_msg): And connect to the message_changed signal so we know - when it cahgnes. - (message_list_set_search): Save the search string. - (folder_changed): If the folder changes, re-run the search, - otherwise we may end up with invalid entries in the display. - - * mail-display.c: Include missing errno.h. - -2000-04-30 Dan Winship <danw@helixcode.com> - - * session.c (session_providers_init): This is no longer necessary. - - * mail-ops.c (fetch_mail): Remove kludge to load remote provider, - as camel can do it by itself now. - -2000-04-29 Dan Winship <danw@helixcode.com> - - * mail-display.c (on_link_clicked): Handle clicks on "cid" URLs by - popping up a "Save Attachment" dialog. - - * mail-format.c (get_cid): if the part has a Content-Disposition - with a filename specified, record (a sanitized version of) that on - the wrapper when creating the cid reference, so the "save - attachment" code can use it later. - (handle_mystery): fix a bug in the cid generation here. - -2000-04-29 Dan Winship <danw@helixcode.com> - - * mail-format.c (lookup_handler, etc): Improve the builtin vs - bonobo selection code. - (handle_mystery): Include name and Content-Description in the - "mystery data" info, when available - (handle_unknown_type): Call mail_identify_mime_part before - giving up. - (handle_undisplayable): Split out of handle_unknown_type now - that handle_unknown_type can try alternate viewers. - (handle_via_bonobo): Fall back to handle_undisplayable if the - bonobo control fails. - - * mail-identify.c (mail_identify_mime_part): New function to - attempt to identify a MIME part that we can't identify based on - Content-Type alone. - - * mail-display.c (on_url_requested): redo the mystery data icon - display stuff less kludgily. - -2000-04-28 Dan Winship <danw@helixcode.com> - - * mail-format.c (write_recipients_to_stream, write_headers, - mail_generate_reply): Update (minimally) for Camel recipient - changes. - -2000-04-28 Ettore Perazzoli <ettore@helixcode.com> - - * main.c (init_bonobo): Don't call `init_corba()' and don't get - any args. - (init_corba) [!USING_OAF]: Fix args. - -2000-04-27 Ettore Perazzoli <ettore@helixcode.com> - - * folder-browser-factory.c: New macro `CONTROL_FACTORY_ID', which - is #defined to a different value according to whether we are - `USING_OAF' or not. - (folder_browser_factory_init): Use `CONTROL_FACTORY_ID'. - - * test-mail.c - (init_corba): New helper function, implemented differently - according to `USING_OAF'. - (main): Use `init_corba()'. - - * main.c - (init_corba): New helper function, implemented differently - according to `USING_OAF'. - (init_bonobo): Use `init_corba()'. - - * Makefile.am: Install OAF stuff if `USING_OAF'. Add - `-I$(datadir)/idl' to the `orbit-idl' command-line so that we can - use Bonobo IDL files installed under our prefix as well. Also, - use `$(ORBIT_IDL)' instead of hardcoded `orbit-idl'. - - * evolution-mail.oafinfo: New file. - -2000-04-27 Dan Winship <danw@helixcode.com> - - * mail-format.c: Move text_to_html to e-util. - - * mail-ops.c (send_to_url): New routine. Thin wrapper for - e_msg_composer_new_from_url. - - * mail-display.c (on_link_clicked): print a warning for news or - nntp URLs (which we'll deal with some day), and call send_to_url - for mailto URLs. - - * mail-format.c (text_to_html): Improve URL conversion code. - Recognize https, recognize "www\..*" without a prefixed "http://". - Properly escape &, <, >, etc in URL strings. Don't be fooled by - "mailto:", "http://", etc with no following data. - -2000-04-26 Dan Winship <danw@helixcode.com> - - * mail-format.c (text_to_html): Reorganize a bit and add a new - flag, TEXT_TO_HTML_CONVERT_URLS to recognize and wrap URLs - in text. - - * mail-display.c (mail_html_new): Add link_clicked signal handler. - (on_link_clicked): Use gnome_url_show to launch a browser. - - * mail-format.c: update for CamelStream changes. Update for - CamelMimeBodyPart -> CamelMimePart - -2000-04-25 Dan Winship <danw@helixcode.com> - - * mail-display.c, mail-format.c: Redo large chunks of this. The - mail display now consists of a vbox in a scrolled window, in which - we put multiple GtkHTML objects. This means broken HTML in one - part can't corrupt other parts. The headers now scroll with the - body. Unrecognized attachments look prettier, but still don't do - anything, and will probably be changed later. We can also now - display nested message/rfc822 parts and multipart/alternatives - with multipart subparts. Oh, and text/{richtext,enriched}, since - we had all these ancient sample messages that use it and the lack - of support annoyed me. :) - - Bonobo embeddables are broken right now, but I don't think that's - my fault. - - * mail-format.c (reply_body): Fix some bugs that crept into reply - generation. This needs a lot more work to deal correctly with - complicated bodies. - (setup_function_table): pass unknown text subtypes to - handle_text_plain. - (handle_multipart_appledouble): new handler. Just ignores the - first (application/applefile) part and tries to display the - second part. Since the second part is usually - application/octet-stream, this doesn't work very well still - usually. - (reply_body): Make this deal better with multiparts. - - * mail-format.c, mail-display.c: Now that we're not limited to - a single GtkHTML for the display, there's no reason to embed - Bonobo objects for unrecognized content-types in GtkHTML rather - than embedded them into the vbox directly. So do that. - - Meanwhile, fix up the handler-selection code so that we can - declare which built-in handlers are more desirable than external - handlers and which are less. (Of course, eventually we'll want - this to be customizable.) Add some cleverness to - handle_multipart_alternative as well so it doesn't accept an - alternative which we can display generically over one we can - display specifically. - - * mail-format.c (text_to_html): add a convert_space_hack flag, - which turns N spaces into N-1 s and a space. - (handle_text_plain): Check for "format=flowed" in the - Content-Type. - (handle_text_plain_flowed): Spinoff of handle_text_plain to deal - with RFC 2646 flowed text. (All the examples I can find of it - are generated by Eudora, but it's a pretty cool idea that ought - to be used more widely.) - -2000-04-23 Dan Winship <danw@helixcode.com> - - * folder-browser-factory.c: rename "send" to "send_msg", to avoid - name clash with the tcp function. Connect the "forward" button. - - * mail-ops.c: rename "send" to "send_msg", to avoid name clash - with the tcp function. Add forward_msg function. - - * mail-format.c (mail_generate_forward): support function for - forward_msg. Pretty much a big kludge right now, pending the - attachment/attachment-bar changes. - -2000-04-22 Dan Winship <danw@helixcode.com> - - * mail-display.c (on_url_requested): Change cid expectations to - match current camel reality. - - * main.c (main): call glade_gnome_init, for composer. - - * folder-browser-factory.c: move msg_composer_cb and - msg_composer_send_cb to mail-ops. Attach send, reply, and "reply - to all" buttons. - - * mail-ops.c (composer_send_cb, send): moved from - folder-browser-factory.c. - (reply_to_sender, reply_to_all): new functions to do replies. - - * mail-format.c (text_to_html): Add an "add_pre" flag, to make - it wrap the output in <pre></pre>. - (mail_generate_reply): New function to create a composer and build - a reply in it. - -2000-04-21 Dan Winship <danw@helixcode.com> - - * mail-display.c (on_url_requested): deal with cid: URLs. - (find_cid): helper routine for above. (This could be much better.) - (mail_display_init): connect url_requested signal - - * mail-format.c (handle_multipart_related): Make this work. - - * mail-display.c (mail_display_set_message): ref the message we - display, since we're going to unref it when we remove it. Fixes a - bug that showed up with the new camel code, but it's not obvious - if it's due to a bug or a feature in the new code. - -2000-04-20 NotZed <NotZed@HelixCode.com> - - * Makefile.am (evolution_mail_LDADD): Add libibex.la to link. - - * message-list.h: Removed folder summary. - - * message-list.c: Dont include folder-summary anymore. - (select_msg): Changed to use folder, not summary in - summary_get_message_info(). God this code is grotty. - (ml_value_at): Ditto. - (ml_value_at): Changed to use new interface. Hmm, this returns a - static variable, that seems wrong. - (message_list_set_folder): Remove folder summary. - (ml_row_count): Oops, remove some debug i put there. - -2000-04-20 Dan Winship <danw@helixcode.com> - - * mail-display.c: update for bonobo change, and remove a - now-unused variable. - -2000-04-17 Chris Toshok <toshok@helixcode.com> - - * message-list.c (on_row_selection_idle): new function, actually - calls select_msg. - (on_row_selection_cmd): register an idle instead of calling - select_msg directly. this fixes the lag before the row is - selected - selection is instantaneous now, with message loading - happening afterward. - - * message-list.h: add row_to_select and an idle_id to the message - list to make the select_msg call happen in an idle func. - - * message-list.c (message_list_init_renderers): no more - e_cell_set_editable. this info always comes from the model. - -2000-04-14 Dan Winship <danw@helixcode.com> - - * mail-format.[ch]: Moved from camel/camel-formatter, and changed - slightly. (More to come.) - - * html-stream.[ch]: No longer necessary. mail-format uses - GtkHTMLStreamHandles directly. - - * mail-display.[ch]: update for new message formatting code. - -2000-04-14 Chris Toshok <toshok@helixcode.com> - - * folder-browser-factory.c (control_activate): use - gnome_app_fill_toolbar_with_data, so we get the beautiful gnome - toolbar. - -2000-04-14 Dan Winship <danw@helixcode.com> - - * folder-browser-factory.c (development_warning): Fix up the - warning message a bit. - (folder_browser_factory): Make the warning bypassable. - -2000-04-12 Miguel de Icaza <miguel@gnu.org> - - * main.c (main): Call e_cursors_init. - -2000-04-10 Dan Winship <danw@helixcode.com> - - * mail-ops.c (fetch_mail): use camel_movemail when fetching mail - from an mbox store. This leaves behind temp files for now, - because CamelMboxFolder::delete is too confused to use, and NotZed - is rewriting CamelMboxFolder, so I'm not going to bother to try to - fix it. - - * mail-ops.c: Add some #includes for the non-HAVE_MKSTEMP case - -2000-04-09 Matt Loper <matt@helixcode.com> - - * folder-browser.c (folder_browser_new): set folder_browser->uri - to NULL, so that we know when to free it. - -2000-04-07 Miguel de Icaza <miguel@gnu.org> - - * message-list.c (states_pixmaps): Add more beautiful art from - Miggue, the Diego Rivera of the next millenium. - (message_list_init_header): Use the beautiful art. - - * pixmaps: Miguel rediscovers the "transparent" concept. - -2000-04-07 Matt Loper <matt@helixcode.com> - - * folder-browser.c (folder_browser_destroy): Unref the shell - interface that we have a handle to. - - * folder-browser-factory.c (control_destroy_cb): New function; - destroys a folder-browser when its control is destroyed. - (folder_browser_factory): Hook up to the above. - -2000-04-07 Dan Winship <danw@helixcode.com> - - * mail-ops.c: new file, for toolbar/menu callbacks - (fetch_mail): fetch mail. Doesn't do mbox locking. Many kludges. - - * folder-browser-factory.c (control_activate): use new fetch_mail - function as the callback for the "New mail" icon. Rename check_cb - to random_cb. - - * Makefile.am: don't build test-sources since the version in - CVS doesn't do much and once I've fixed it it won't be a separate - program. Add mail-ops.[ch]. - -2000-04-06 Miguel de Icaza <miguel@gnu.org> - - * message-list.c: Stick pixmaps here. - - * mail-display.c (embeddable_destroy_cb): Replaced C++ comments - with C comments. - - * message-list.c (load_internal_images): New function, loads images. - (message_list_init_renderers): Load images, fix previous attempt - at loading images. - - * Makefile.am (dist-hook): Added distribution of pixmaps. - - * pixmaps: New directory, used to hold the XPMs we ship with. - - * pixmaps/envelope-closed.xpm, pixmaps/envelope-open.xpm: Tigert's - envelopes incorporated. - -2000-03-31 Miguel de Icaza <miguel@gnu.org> - - * message-list.c (ml_value_at): Fix miss-used variable. - -2000-04-01 Michael Meeks <michael@helixcode.com> - - * folder-browser.c (folder_browser_properties_init): update to - new property (folder_browser_property_changed): kill. - (get_prop, set_prop): do the donkey work + make properly RW. - -2000-03-31 Dan Winship <danw@helixcode.com> - - * folder-browser-factory.c (folder_browser_set_shell): - * folder-browser.c (folder_browser_new): - * message-list.c (on_row_selection_cmd, select_msg, - message_list_init, message_list_set_folder): - - remove debugging printf()s that no longer seem useful - -2000-03-29 Dan Winship <danw@helixcode.com> - - * folder-browser-factory.c (control_activate): build a toolbar. - (control_deactivate): and hide it. - -2000-03-27 Chris Toshok <toshok@helixcode.com> - * mail-display.c: quiet warnings when building in ../po - -2000-03-26 Miguel de Icaza <miguel@gnu.org> - - * folder-browser-factory.c (folder_browser_set_shell): Memory leak - fix. - -2000-03-25 Dan Winship <danw@helixcode.com> - - * message-list.c (select_msg, ml_value_at): update for summary - changes. Hey, neat, it really does make it more efficient. - -2000-03-22 Christopher James Lahey <clahey@helixcode.com> - - * .cvsignore: Updated .cvsignore. - -2000-03-21 Matt Loper <matt@helixcode.com> - - * mail-display.c: Minor cleanup & commenting. - - * folder-browser-factory.c: Minor cleanup & warning elimination. - -2000-03-21 bertrand <bertrand@helixcode.com> - - * message-list.c (ml_value_at): display message size - -2000-03-20 Christopher James Lahey <clahey@helixcode.com> - - * message-list.c: Properly ref & sink the table and header models. - -2000-03-14 Dan Winship <danw@helixcode.com> - - * mail-sources.c: First cut at a mail source selection wizard. - Basically a rigged demo at this point. Doesn't use camel to get - its information, and is not yet complete or integrated with the - mail component. Did I mention that the code is ugly? - -2000-03-13 bertrand <bertrand@helixcode.com> - - * folder-browser-factory.c (folder_browser_set_shell): - for testing and demonstration purpose, immediately - register a fake service. - -2000-03-12 bertrand <bertrand@helixcode.com> - - * folder-browser-factory.c (folder_browser_factory_init): - name change. - (control_activate_cb): when the control is activated, - it merges its own UI with the remote UIHandler. - (control_add_menu): sample menu merging. - (folder_browser_factory): connect the control "activate" signal. - - * evolution-mail.gnorba: - name changes - - * folder-browser.h: added a reference to an - Evolution::Shell object. - - * folder-browser-factory.c (folder_browser_set_shell): - (folder_browser_control_add_service_repository_interface): - (folder_browser_factory): the folder-browser control now - implements the Evolution/ServiceRepository interface. - -2000-03-07 bertrand <bertrand@helixcode.com> - - * folder-browser-factory.c (development_warning): - added a warning so that the user knows that this - version may crash his mails. - -2000-03-05 bertrand <bertrand@helixcode.com> - - * message-list.h: include a referrence to the parent - folder browser. - - * message-list.c (ml_value_at): use the message summary - from the - - * html-stream.c (html_stream_close): when the stream - is closed, set the html stream to NULL - (html_stream_write): don't write anything if the - html handle does not exist. - (html_stream_reset): implemented. close the current - html handle and begins a new html parser. - - * session.c (session_store_new): use static exception - here. - -2000-03-05 Christopher James Lahey <clahey@helixcode.com> - - * message-list.c: Added a prototype message listing. - -2000-03-04 Christopher James Lahey <clahey@helixcode.com> - - * message-list.c: Set up the column headers properly. - - * folder-browser.c: Show the folder_browser widget. - -2000-03-04 Christopher James Lahey <clahey@helixcode.com> - - * message-list.c: Define ml_duplicate_value and ml_free_value - correctly. - -2000-03-04 Christopher James Lahey <clahey@helixcode.com> - - * message-list.c: Use g_int_compare and g_str_compare as we should - be instead of g_int_equal and g_str_equal. - -2000-03-04 bertrand <bertrand@helixcode.com> - - * test-mail.c (main): replace the bonobo-active/gtk-main - by bonobo-main. - Include Gnorba headers. - (main): don't call the container creation routine - before we entered the main loop. Use idle for that. - -2000-03-04 Christopher James Lahey <clahey@helixcode.com> - - * message-list.c: Change this to use the ETable widget itself - instead of building it from all the parts. - -2000-03-03 Christopher James Lahey <clahey@helixcode.com> - - * message-list.c: Ref the table columns since we unref them at the - end. - -2000-03-01 Ettore Perazzoli <ettore@helixcode.com> - - * Makefile.am (INCLUDES): Add `$(top_srcdir)'. Also, the - `top_srcdir' includes must come first everything else to avoid - including installed headers instead of our fresh ones. - -2000-02-28 NotZed <NotZed@HelixCode.com> - - * Makefile.am (evolution_mail_LDADD): Fixed references to eutil. - -2000-02-24 Christopher James Lahey <clahey@helixcode.com> - - * message-list.c: Changed to match new e_table_simple interface. - -2000-02-24 Dan Winship <danw@helixcode.com> - - * message-list.c (message_list_set_folder): update for CamelFolder - changes - -2000-02-24 Christopher James Lahey <clahey@helixcode.com> - - * message-list.c: Changed this to not use the "x" and "y" - arguments to e-table-item. - -2000-02-23 Matt Loper <matt@helixcode.com> - - * message-list.c (message_list_set_folder): Check 'desc'riptions - of exceptions. - -2000-02-22 bertrand <Bertrand.Guiheneuf@aful.org> - - * message-list.c (message_list_set_folder): - fix to show a sample correct implementation. - -2000-02-21 Matt Loper <matt@helixcode.com> - - * Makefile.am: added -lunicode to evolution_mail_LDADD. - -2000-02-21 Dan Winship <danw@helixcode.com> - - * session.c (session_store_new): Pass a CamelAuthCallback - (evolution_auth_callback) to camel_session_new. - -2000-02-21 Dan Winship <danw@helixcode.com> - - * session.c (session_store_new): Update session_store_new to - deal with the fact that camel_session_get_store takes a - CamelException now. Doesn't actually do anything with the - exception yet, because nothing else does yet either. - -2000-02-19 Matt Loper <matt@helixcode.com> - - * .cvsignore: added test-mail. - -2000-02-14 Miguel de Icaza <miguel@gnu.org> - - * folder-browser.c (folder_browser_load_folder): New routine, - loads a camel folder. - (folder_browser_set_uri): redo. - - * session.c: new file. Implements SessionStores to keep track of - a Session/Store tuple. - -2000-02-13 Matt Loper <matt@helixcode.com> - - * html-stream.c (html_stream_new): Second param of gtk_html_begin - should be "", not NULL. - (html_stream_new): gtk_html_parse() is deprecated, so the call was - removed. - - * html-stream.h: HTMLStreamClass's parent changed to - CamelStreamClass, not CamelStream. - -2000-02-11 Christopher James Lahey <clahey@helixcode.com> - - * Makefile.am: Add the e-text directory to the includes list. - - * message-list.c: Change the call to e_cell_text_new, since - there's an added argument. - -2000-02-09 Christopher James Lahey <clahey@helixcode.com> - - * Makefile.am: Added libetext as libetable depends on it. - -2000-02-08 Iain Holmes <ih@csd.abdn.ac.uk> - - * Makefile.am: Changed the order of the compilation so the CORBA stuff - was made before it was needed. - -2000-01-19 Miguel de Icaza <miguel@gnu.org> - - * Started work on the mail display engine. - - * html-stream.c, html-stream.h: New files, they are CamelStreams - used to write to the GtkHTML widget. - diff --git a/mail/GNOME_Evolution_Mail.server.in.in b/mail/GNOME_Evolution_Mail.server.in.in deleted file mode 100644 index b52a80267b..0000000000 --- a/mail/GNOME_Evolution_Mail.server.in.in +++ /dev/null @@ -1,193 +0,0 @@ -<oaf_info> - - <!-- Folder display control --> - - <!-- (factory) --> - <oaf_server iid="OAFIID:GNOME_Evolution_Mail_Factory:@VERSION@" - type="shlib" - location="@COMPONENTDIR@/libevolution-mail.so"> - - <oaf_attribute name="repo_ids" type="stringv"> - <item value="IDL:GNOME/ObjectFactory:1.0"/> - </oaf_attribute> - - <oaf_attribute name="name" type="string" - _value="Evolution Mail"/> - </oaf_server> - - <!-- (control) --> - <oaf_server iid="OAFIID:GNOME_Evolution_Mail_Control:@VERSION@" - type="factory" - location="OAFIID:GNOME_Evolution_Mail_ControlFactory:@VERSION@"> - - <oaf_attribute name="repo_ids" type="stringv"> - <item value="IDL:BonoboControl/evolution-mail:@VERSION@"/> - <item value="IDL:GNOME/Control:1.0"/> - </oaf_attribute> - - <oaf_attribute name="name" type="string" - _value="Evolution Mail folder viewer"/> - </oaf_server> - - <!-- Component Interface --> - - <oaf_server iid="OAFIID:GNOME_Evolution_Mail_Component:@VERSION@" - type="factory" - location="OAFIID:GNOME_Evolution_Mail_Factory:@VERSION@"> - - <oaf_attribute name="repo_ids" type="stringv"> - <item value="IDL:GNOME/Evolution/Component:@VERSION@"/> - </oaf_attribute> - - <oaf_attribute name="name" type="string" _value="Evolution Mail component"/> - - <oaf_attribute name="evolution:component_alias" type="string" value="mail"/> - - <oaf_attribute name="evolution:button_label" type="string" _value="Mail"/> - <oaf_attribute name="evolution:button_sort_order" type="string" value="-10"/> - <oaf_attribute name="evolution:button_icon" type="string" value="evolution-inbox.png"/> - - <oaf_attribute name="evolution:component_icon" type="string" value="evolution-inbox.png"/> - <oaf_attribute name="evolution:component_display_order" type="number" value="1"/> - - <oaf_attribute name="evolution:uri_schemas" type="stringv"> - <item value="mailto"/> - </oaf_attribute> - </oaf_server> - - <!-- Shell Component --> - - <oaf_server iid="OAFIID:GNOME_Evolution_Mail_ShellComponent:@VERSION@" - type="factory" - location="OAFIID:GNOME_Evolution_Mail_ControlFactory:@VERSION@"> - - <oaf_attribute name="repo_ids" type="stringv"> - <item value="IDL:GNOME/Evolution/ShellComponent:@VERSION@"/> - </oaf_attribute> - - <oaf_attribute name="name" type="string" - _value="Evolution Mail component"/> - - <oaf_attribute name="evolution:shell_component_icon" type="string" - value="evolution-inbox.png"/> - <oaf_attribute name="evolution:shell_component_launch_order" type="number" - value="1"/> - </oaf_server> - - <!-- Message composer --> - - <!-- (composer) --> - <oaf_server iid="OAFIID:GNOME_Evolution_Mail_Composer:@VERSION@" - type="factory" - location="OAFIID:GNOME_Evolution_Mail_Factory:@VERSION@"> - - <oaf_attribute name="repo_ids" type="stringv"> - <item value="IDL:GNOME/Evolution:Composer:@VERSION@"/> - <item value="IDL:Bonobo/ItemContainer:1.0"/> - </oaf_attribute> - - <oaf_attribute name="name" type="string" - _value="Evolution Mail composer"/> - </oaf_server> - - <!-- Startup Wizard --> - - <!-- (wizard) --> - <oaf_server iid="OAFIID:GNOME_Evolution_Mail_Wizard:@VERSION@" - type="factory" - location="OAFIID:GNOME_Evolution_Mail_ControlFactory:@VERSION@"> - - <oaf_attribute name="repo_ids" type="stringv"> - <item value="IDL:GNOME/Evolution/StartupWizard::@VERSION@"/> - </oaf_attribute> - - <oaf_attribute name="evolution:startup_wizard:priority" type="number" - value="1"/> - </oaf_server> - - - <!-- Configuration pages --> - - <!-- Account Editor --> - <oaf_server iid="OAFIID:GNOME_Evolution_Mail_AccountPrefs_ConfigControl:@VERSION@" - type="factory" - location="OAFIID:GNOME_Evolution_Mail_Factory:@VERSION@"> - - <oaf_attribute name="repo_ids" type="stringv"> - <item value="IDL:GNOME/Evolution/ConfigControl:@VERSION@"/> - </oaf_attribute> - - <oaf_attribute name="evolution2:config_item:title" type="string" - _value="Mail Accounts"/> - - <oaf_attribute name="evolution2:config_item:description" type="string" - _value="Configure your email accounts here"/> - - <oaf_attribute name="evolution2:config_item:icon_name" type="string" - value="mail-accounts-settings.png"/> - - <oaf_attribute name="evolution2:config_item:type" type="stringv"> - <item value="mail"/> - </oaf_attribute> - - <oaf_attribute name="evolution2:config_item:priority" type="string" value="-10"/> - - <oaf_attribute name="name" type="string" - _value="Evolution Mail accounts configuration control"/> - - </oaf_server> - - <!-- Mailer Preferences --> - <oaf_server iid="OAFIID:GNOME_Evolution_Mail_MailerPrefs_ConfigControl:@VERSION@" - type="factory" - location="OAFIID:GNOME_Evolution_Mail_Factory:@VERSION@"> - - <oaf_attribute name="repo_ids" type="stringv"> - <item value="IDL:GNOME/Evolution/ConfigControl:@VERSION@"/> - </oaf_attribute> - - <oaf_attribute name="evolution2:config_item:title" type="string" - _value="Mail Preferences"/> - - <oaf_attribute name="evolution2:config_item:description" type="string" - _value="Configure mail preferences, including security and message display, here"/> - - <oaf_attribute name="evolution2:config_item:icon_name" type="string" - value="mail-config-druid.png"/> - - <oaf_attribute name="evolution2:config_item:priority" type="string" value="-9"/> - - <oaf_attribute name="name" type="string" - _value="Evolution Mail preferences control"/> - - </oaf_server> - - <!-- Composer Preferences --> - <oaf_server iid="OAFIID:GNOME_Evolution_Mail_ComposerPrefs_ConfigControl:@VERSION@" - type="factory" - location="OAFIID:GNOME_Evolution_Mail_Factory:@VERSION@"> - - <oaf_attribute name="repo_ids" type="stringv"> - <item value="IDL:GNOME/Evolution/ConfigControl:@VERSION@"/> - </oaf_attribute> - - <oaf_attribute name="evolution2:config_item:title" type="string" - _value="Composer Preferences"/> - - <oaf_attribute name="evolution2:config_item:description" type="string" - _value="Configure spell-checking, signatures, and the message composer here"/> - - <oaf_attribute name="evolution2:config_item:icon_name" type="string" - value="composer-settings.png"/> - - <oaf_attribute name="evolution2:config_item:priority" type="string" value="-8"/> - - <oaf_attribute name="name" type="string" - _value="Evolution Mail composer configuration control"/> - - </oaf_server> - -</oaf_info> - - - diff --git a/mail/Makefile.am b/mail/Makefile.am deleted file mode 100644 index c377eca846..0000000000 --- a/mail/Makefile.am +++ /dev/null @@ -1,254 +0,0 @@ -SUBDIRS = # importers FIXME - -libexec_PROGRAMS = \ - evolution-mbox-upgrade - -importerdir = $(privlibdir)/evolution-mail-importers - -INCLUDES = \ - -I$(top_srcdir)/widgets \ - -I$(top_srcdir)/widgets/e-text \ - -I$(top_srcdir)/widgets/misc \ - -I$(top_srcdir)/camel \ - -I$(top_srcdir) \ - -I$(top_srcdir)/composer \ - -I$(top_builddir)/composer \ - -I$(top_builddir)/shell \ - -I$(top_srcdir)/shell \ - -I$(top_srcdir)/shell/importer \ - -I$(top_builddir)/shell/importer \ - $(EVOLUTION_MAIL_CFLAGS) \ - -DEVOLUTION_DATADIR=\""$(datadir)"\" \ - -DEVOLUTION_PRIVDATADIR=\""$(privdatadir)"\" \ - -DEVOLUTION_GLADEDIR=\""$(gladedir)"\" \ - -DEVOLUTION_ETSPECDIR=\""$(etspecdir)"\" \ - -DEVOLUTION_ICONSDIR=\""$(imagesdir)"\" \ - -DEVOLUTION_IMAGES=\""$(imagesdir)"\" \ - -DEVOLUTION_GALVIEWSDIR=\""$(viewsdir)"\" \ - -DEVOLUTION_BUTTONSDIR=\""$(buttonsdir)"\" \ - -DEVOLUTION_LOCALEDIR=\""$(localedir)"\" \ - -DEVOLUTION_UIDIR=\""$(evolutionuidir)"\" \ - -DCAMEL_PROVIDERDIR=\""$(camel_providerdir)"\" \ - -DMAIL_IMPORTERSDIR=\""$(importerdir)"\" \ - -DPREFIX=\""$(prefix)"\" \ - -DG_LOG_DOMAIN=\"evolution-mail\" - -component_LTLIBRARIES = libevolution-mail.la - -# Code generation for Spell.idl - -SPELL_IDL = Spell.idl - -SPELL_IDL_GENERATED_H = \ - Spell.h -SPELL_IDL_GENERATED_C = \ - Spell-common.c \ - Spell-skels.c \ - Spell-stubs.c -SPELL_IDL_GENERATED = $(SPELL_IDL_GENERATED_C) $(SPELL_IDL_GENERATED_H) - -$(SPELL_IDL_GENERATED_H): $(SPELL_IDL) - $(ORBIT_IDL) -I $(srcdir) -I $(datadir)/idl $(IDL_INCLUDES) $(srcdir)/Spell.idl -$(SPELL_IDL_GENERATED_C): $(SPELL_IDL_GENERATED_H) - -Spell-impl.o: Spell.h - - -# libevolution-mail - -libevolution_mail_la_SOURCES = \ - $(SPELL_IDL_GENERATED) \ - $(MARSHAL_GENERATED) \ - e-searching-tokenizer.c \ - e-searching-tokenizer.h \ - em-account-prefs.c \ - em-account-prefs.h \ - em-composer-prefs.c \ - em-composer-prefs.h \ - em-mailer-prefs.c \ - em-mailer-prefs.h \ - em-inline-filter.c \ - em-inline-filter.h \ - em-folder-selection.c \ - em-folder-selection.h \ - em-folder-selection-button.c \ - em-folder-selection-button.h \ - em-folder-selector.c \ - em-folder-selector.h \ - em-folder-tree.c \ - em-folder-tree.h \ - em-folder-tree-model.c \ - em-folder-tree-model.h \ - em-folder-view.c \ - em-folder-view.h \ - em-folder-browser.c \ - em-folder-browser.h \ - em-format.c \ - em-format.h \ - em-format-html.c \ - em-format-html.h \ - em-format-html-display.c \ - em-format-html-display.h \ - em-format-html-print.c \ - em-format-html-print.h \ - em-format-html-quote.c \ - em-format-html-quote.h \ - em-format-quote.c \ - em-format-quote.h \ - em-message-browser.c \ - em-message-browser.h \ - em-migrate.c \ - em-migrate.h \ - em-composer-utils.c \ - em-composer-utils.h \ - em-popup.c \ - em-popup.h \ - em-utils.c \ - em-utils.h \ - em-subscribe-editor.c \ - em-subscribe-editor.h \ - em-sync-stream.c \ - em-sync-stream.h \ - em-icon-stream.c \ - em-icon-stream.h \ - em-junk-filter.c \ - em-junk-filter.h \ - em-junk-plugin.c \ - em-junk-plugin.h \ - em-html-stream.c \ - em-html-stream.h \ - mail-account-editor.c \ - mail-account-editor.h \ - mail-account-gui.c \ - mail-account-gui.h \ - mail-autofilter.c \ - mail-autofilter.h \ - mail-component-factory.c \ - mail-component.c \ - mail-component.h \ - mail-config.c \ - mail-config.h \ - mail-config-druid.c \ - mail-config-druid.h \ - mail-crypto.c \ - mail-crypto.h \ - mail-config-factory.c \ - mail-config-factory.h \ - mail-folder-cache.c \ - mail-folder-cache.h \ - mail-mt.c \ - mail-mt.h \ - mail-offline-handler.c \ - mail-offline-handler.h \ - mail-ops.c \ - mail-ops.h \ - mail-send-recv.c \ - mail-send-recv.h \ - mail-session.c \ - mail-session.h \ - mail-signature-editor.c \ - mail-signature-editor.h \ - mail-tools.c \ - mail-tools.h \ - mail-types.h \ - mail-vfolder.c \ - mail-vfolder.h \ - message-list.c \ - message-list.h \ - message-tag-editor.c \ - message-tag-editor.h \ - message-tag-followup.c \ - message-tag-followup.h \ - mail.h - -# EPFIXME: Functionality to be brought back to life. -# -# mail-local.c -# mail-local.h - -libevolution_mail_la_LIBADD = \ - $(top_builddir)/shell/importer/libevolution-importer.la \ - $(top_builddir)/camel/libcamel.la \ - $(top_builddir)/e-util/libeutil.la \ - $(top_builddir)/shell/libeshell.la \ - $(top_builddir)/composer/libcomposer.la \ - $(top_builddir)/widgets/misc/libemiscwidgets.la \ - $(top_builddir)/widgets/misc/libefilterbar.la \ - $(top_builddir)/filter/libfilter.la \ - $(top_builddir)/widgets/menus/libmenus.la \ - $(EVOLUTION_MAIL_LIBS) - -libevolution_mail_la_LDFLAGS = \ - -avoid-version -module - - -# .server files - -evolution_mbox_upgrade_SOURCES = evolution-mbox-upgrade.c -evolution_mbox_upgrade_LDADD = \ - $(top_builddir)/camel/libcamel.la \ - $(top_builddir)/e-util/libeutil.la \ - $(EVOLUTION_MAIL_LIBS) - -server_in_files = GNOME_Evolution_Mail.server.in.in -server_DATA = $(server_in_files:.server.in.in=_$(BASE_VERSION).server) -@EVO_SERVER_RULE@ -@INTLTOOL_SERVER_RULE@ - -# Misc data to install - -glade_DATA = mail-config.glade local-config.glade subscribe-dialog.glade message-tags.glade mail-search.glade mail-security.glade -MARSHAL_GENERATED = em-marshal.c em-marshal.h -@EVO_MARSHAL_RULE@ - -etspec_DATA = message-list.etspec - -EXTRA_DIST = \ - ChangeLog.pre-1-4 \ - em-marshal.list \ - $(SPELL_IDL) \ - $(glade_DATA) \ - $(schema_DATA) \ - $(server_in_files) \ - $(etspec_DATA) - - -# Purify support - -if ENABLE_PURIFY -PLINK = $(LIBTOOL) --mode=link $(PURIFY) $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ - -all-local: evolution-mail.pure - -evolution-mail.pure: evolution-mail - @rm -f evolution-mail.pure - $(PLINK) $(evolution_mail_LDFLAGS) $(evolution_mail_OBJECTS) $(evolution_mail_LDADD) $(LIBS) - -endif - - -# GConf - -schemadir = $(GCONF_SCHEMA_FILE_DIR) -schema_in_files = evolution-mail.schemas.in.in -schema_DATA = $(schema_in_files:.schemas.in.in=-$(BASE_VERSION).schemas) -%-$(BASE_VERSION).schemas.in: %.schemas.in.in - cp $< $@ - -@INTLTOOL_SCHEMAS_RULE@ - -install-data-local: - if test -z "$(DESTDIR)" ; then \ - for p in $(schema_DATA) ; do \ - GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) $(GCONFTOOL) --makefile-install-rule $(srcdir)/$$p; \ - done \ - fi - - -# Prologue - -dist-hook: - cd $(distdir); rm -f $(BUILT_SOURCES) - -BUILT_SOURCES = $(SPELL_IDL_GENERATED) $(MARSHAL_GENERATED) $(server_DATA) -CLEANFILES = $(BUILT_SOURCES) diff --git a/mail/README.async b/mail/README.async deleted file mode 100644 index 3966b3a97b..0000000000 --- a/mail/README.async +++ /dev/null @@ -1,366 +0,0 @@ -******* -This document is absurdly, obscenely out of date. Don't read it. - - -- Peter Williams 7/2/2001 -******* - -Asynchronous Mailer Information -Peter Williams <peterw@helixcode.com> -8/4/2000 - -1. INTRODUCTION - -It's pretty clear that the Evolution mailer needs to be asynchronous in -some manner. Blocking the UI completely on IMAP calls or large disk reads -is unnacceptable, and it's really nice to be able to thread the message -view in the background, or do other things while a mailbox is downloading. - -The problem in making Evolution asynchronous is Camel. Camel is not -asynchronous for a few reasons. All of its interfaces are synchronous -- -calls like camel_store_get_folder, camel_folder_get_message, etc. can -take a very long time if they're being performed over a network or with -a large mbox mailbox file. However, these functions have no mechanism -for specifying that the operation is in progress but not complete, and -no mechanism for signaling when to operation does complete. - -2. WHY I DIDN'T MAKE CAMEL ASYNCHRONOUS - -It seems like it would be a good idea, then, to rewrite Camel to be -asynchonous. This presents several problems: - - * Many interfaces must be rewritten to support "completed" - callbacks, etc. Some of these interfaces are connected to - synchronous CORBA calls. - * Everything must be rewritten to be asynchonous. This includes - the CamelStore, CamelFolder, CamelMimeMessage, CamelProvider, - every subclass thereof, and all the code that touches these. - These include the files in camel/, mail/, filter/, and - composer/. The change would be a complete redesign for any - provider implementation. - * All the work on providers (IMAP, mh, mbox, nntp) up to this - point would be wasted. While they were being rewritten - evolution-mail would be useless. - -However, it is worth noting that the solution I chose is not optimal, -and I think that it would be worthwhile to write a libcamel2 or some -such thing that was designed from the ground up to work asynchronously. -Starting fresh from such a design would work, but trying to move the -existing code over would be more trouble than it's worth. - -3. WHY I MADE CAMEL THREADED - -If Camel was not going to be made asynchronous, really the only other -choice was to make it multithreaded. [1] No one has been particularly -excited by this plan, as debugging and writing MT-safe code is hard. -But there wasn't much of a choice, and I believed that a simple thread -wrapper could be written around Camel. - -The important thing to know is that while Camel is multithreaded, we -DO NOT and CANNOT share objects between threads. Instead, -evolution-mail sends a request to a dispatching thread, which performs -the action or queues it to be performed. (See section 4 for details) - -The goal that I was working towards is that there should be no calls -to camel made, ever, in the main thread. I didn't expect to and -didn't do this, but that was the intent. - -[1]. Well, we could fork off another process, but they share so much -data that this would be pretty impractical. - -4. IMPLEMENTATION - -a. CamelObject - -Threading presented a major problem regarding Camel. Camel is based -on the GTK Object system, and uses signals to communicate events. This -is okay in a nonthreaded application, but the GTK Object system is -not thread-safe. - -Particularly, signals and object allocations use static data. Using -either one inside Camel would guarantee that we'd be stuck with -random crashes forevermore. That's Bad (TM). - -There were two choices: make sure to limit our usage of GTK, or stop -using the GTK Object system. I decided to do the latter, as the -former would lead to a mess of "what GTK calls can we make" and -GDK_THREADS_ENTER and accidentally calling UI functions and upgrades -to GTK breaking everything. - -So I wrote a very very simple CamelObject system. It had three goals: - - * Be really straightforward, just encapsulate the type - heirarchy without all that GtkArg silliness or anything. - * Be as compatible as possible with the GTK Object system - to make porting easy - * Be threadsafe - -It supports: - - * Type inheritance - * Events (signals) - * Type checking - * Normal refcounting - * No unref/destroy messiness - * Threadsafety - * Class functions - -The entire code to the object system is in camel/camel-object.c. It's -a naive implementation and not full of features, but intentionally that -way. The main differences between GTK Objects and Camel Objects are: - - * s,gtk,camel,i of course - * Finalize is no longer a GtkObjectClass function. You specify - a finalize function along with an init function when declaring - a type, and it is called automatically and chained automatically. - * Declaring a type is a slightly different API - * The signal system is replaced with a not-so-clever event system. - Every event is equivalent to a NONE__POINTER signal. The syntax - is slightly different: a class "declares" an event and specifies - a name and a "prep func", that is called before the event is - triggered and can cancel it. - * There is only one CamelXXXClass in existence for every type. - All objects share it. - -There is a shell script, tools/make-camel-object.sh that will do all of -the common substitutions to make a file CamelObject-compatible. Usually -all that needs to be done is move the implementation of the finalize -event out of the class init, modify the get_type function, and replace -signals with events. - -Pitfalls in the transition that I ran into were: - - * gtk_object_ref -> camel_object_ref or you coredump - * some files return 'guint' instead of GtkType and must be changed - * Remove the #include <gtk/gtk.h> - * gtk_object_set_datas must be changed (This happened once; I - added a static hashtable) - * signals have to be fudged a bit to match the gpointer input - * the BAST_CASTARD option is on, meaning failed typecasts will - return NULL, almost guaranteeing a segfault -- gets those - bugs fixed double-quick! - -b. API -- mail_operation_spec - -I worked by creating a very specific definition of a "mail operation" -and wrote an engine to queue and dispatch them. - -A mail operation is defined by a structure mail_operation_spec -prototyped in mail-threads.h. It comes in three logical parts -- a -"setup" phase, executed in the main thread; a "do" phase, executed -in the dispatch thread; and a "cleanup" phase, executed in the main -thread. These three phases are guaranteed to be performed in order -and atomically with respect to other mail operations. - -Each of these phases is represented by a function pointer in the -mail_operation_spec structure. The function mail_operation_queue() is -called and passed a pointer to a mail_operation_spec and a user_data-style -pointer that fills in the operation's parameters. The "setup" callback -is called immediately, though that may change. - -Each callback is passed three parameters: a pointer to the user_data, -a pointer to the "operation data", and a pointer to a CamelException. -The "operation data" is allocated automatically and freed when the operation -completes. Internal data that needs to be shared between phases should -be stored here. The size allocated is specified in the mail_operation_spec -structure. - -Because all of the callbacks use Camel calls at some point, the -CamelException is provided as utility. The dispatcher will catch exceptions -and display error dialogs, unlike the synchronous code which lets -exceptions fall through the cracks fairly easily. - -I tried to implement all the operations following this convention. Basically -I used this skeleton code for all the operations, just filling in the -specifics: - -=================================== - -typedef struct operation_name_input_s { - parameters to operation -} operation_name_input_t; - -typedef struct operation_name_data_s { - internal data to operation, if any - (if none, omit the structure and set opdata_size to 0) -} operation_name_data_t; - -static gchar *describe_operation_name (gpointer in_data, gboolean gerund); -static void setup_operation_name (gpointer in_data, gpointer op_data, CamelException *ex); -static void do_operation_name (gpointer in_data, gpointer op_data, CamelException *ex); -static void cleanup_operation_name (gpointer in_data, gpointer op_data, CamelException *ex); - -static gchar *describe_operation_name (gpointer in_data, gboolean gerund) -{ - operation_name_input_t *input = (operation_name_input_t *) in_data; - - if (gerund) { - return a g_strdup'ed string describing what we're doing - } else { - return a g_strdup'ed string describing what we're about to do - } -} - -static void setup_operation_name (gpointer in_data, gpointer op_data, CamelException *ex) -{ - operation_name_input_t *input = (operation_name_input_t *) in_data; - operation_name_data_t *data = (operation_name_data_t *) op_data; - - verify that parameters are valid - - initialize op_data - - reference objects -} - -static void do_operation_name (gpointer in_data, gpointer op_data, CamelException *ex) -{ - operation_name_input_t *input = (operation_name_input_t *) in_data; - operation_name_data_t *data = (operation_name_data_t *) op_data; - - perform camel operations -} - -static void cleanup_operation_name (gpointer in_data, gpointer op_data, CamelException *ex) -{ - operation_name_input_t *input = (operation_name_input_t *) in_data; - operation_name_data_t *data = (operation_name_data_t *) op_data; - - perform UI updates - - free allocations - - dereference objects -} - -static const mail_operation_spec op_operation_name = { - describe_operation_name, - sizeof (operation_name_data_t), - setup_operation_name, - do_operation_name, - cleanup_operation_name -}; - -void -mail_do_operation_name (parameters) -{ - operation_name_input_t *input; - - input = g_new (operation_name_input_t, 1); - - store parameters in input - - mail_operation_queue (&op_operation_name, input, TRUE); -} - -=========================================== - -c. mail-ops.c - -Has been drawn and quartered. It has been split into: - - * mail-callbacks.c: the UI callbacks - * mail-tools.c: useful sequences wrapping common Camel operations - * mail-ops.c: implementations of all the mail_operation_specs - -An important part of mail-ops.c are the global functions -mail_tool_camel_lock_{up,down}. These simulate a recursize mutex around -camel. There are an extreme few, supposedly safe, calls to Camel made in -the main thread. These functions should go around evey call to Camel or -group thereof. I don't think they're necessary but it's nice to know -they're there. - -If you look at mail-tools.c, you'll notice that all the Camel calls are -protected with these functions. Remember that a mail tool is really -just another Camel call, so don't use them in the main thread either. - -All the mail operations are implemented in mail-ops.c EXCEPT: - - * filter-driver.c: the filter_mail operation - * message-list.c: the regenerate_messagelist operation - * message-thread.c: the thread_messages operation - -d. Using the operations - -The mail operations as implemented are very specific to evolution-mail. I -was thinking about leaving them mostly generic and then allowing extra -callbacks to be added to perform the more specific UI touches, but this -seemed kind of pointless. - -I basically looked through the code, found references to Camel, and split -the code into three parts -- the bit before the Camel calls, the bit after, -and the Camel calls. These were mapped onto the template, given a name, -and added to mail-ops.c. Additionally, I simplified the common tasks that -were taken care of in mail-tools.c, making some functions much simpler. - -Ninety-nine percent of the time, whatever operation is being done is being -done in a callback, so all that has to be done is this: - -================== - -void my_callback (GtkObject *obj, gchar *uid) -{ - camel_do_something (uid); -} - -==== becomes ==== - -void my_callback (GtkObject *obj, gchar *uid) -{ - mail_do_do_something (uid); -} - -================= - -There are, however, a few belligerents. Particularly, the function -mail_uri_to_folder returns a CamelFolder and yet should really be -asynchronous. This is called in a CORBA call that is sychronous, and -additionally is used in the filter code. - -I changed the first usage to return the folder immediately but -still fetch the CamelFolder asyncrhonously, and in the second case, -made filtering asynchronous, so the fact that the call is synchronous -doesn't matter. - -The function was renamed to mail_tool_uri_to_folder to emphasize that -it's a synchronous Camel call. - -e. The dispatcher - -mail_operation_queue () takes its parameters and assembles them in a -closure_t structure, which I abbreviate clur. It sets a timeout to -display a progress window if an operation is still running one second -later (we're not smart enough to check if it's the same operation, -but the issue is not a big deal). The other thread and some communication -pipes are created. - -The dispatcher thread sits in a loop reading from a pipe. Every time -the main thread queues an operation, it writes the closure_t into the pipe. -The dispatcher reads the closure, sends a STARTING message to the main -thread (see below for explanation), calls the callback specified in the -closure, and sends a FINISHED message. It then goes back to reading -from its pipe; it will either block until another operation comes along, -or find one right away and start it. This the pipe takes care of queueing -operations. - -The dispatch thread communicates with the main thread with another pipe; -however, the main thread has other things to do than read from the pipe, -so it adds registers a GIOReader that checks for messages in the glib -main loop. In addition to starting and finishing messages, the other -thread can communicate to the user using messages and a progress bar. -(This is currently implemented but unused.) - -5. ISSUES - - * Operations are queued and dequeued stupidly. Like if you click - on one message then click on another, the first will be retrieved - and displayed then overwritten by the second. Operations that could - be performed at the same time safely aren't. - * The CamelObject system is workable, but it'd be nice to work with - something established like the GtkObject - * The whole threading idea is not great. Concensus is that an - asynchronous interface is the Right Thing, eventually. - * Care still needs to be taken when designing evolution-mail code to - work with the asynchronous mail_do_ functions - * Some of the operations are extremely hacky. - * IMAP's timeout to send a NOOP had to be removed because we can't - use GTK. We need an alternative for this.
\ No newline at end of file diff --git a/mail/Spell.idl b/mail/Spell.idl deleted file mode 100644 index f251253422..0000000000 --- a/mail/Spell.idl +++ /dev/null @@ -1,71 +0,0 @@ -/* This file is part of gnome-spell bonobo component - - Copyright (C) 1999, 2000 Helix Code, Inc. - Authors: Radek Doulik <rodo@helixcode.com> - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ - -#include <Bonobo.idl> - -module GNOME { - module Spell { - - typedef sequence<string> StringSeq; - struct Language { - string name; - string abbreviation; - }; - typedef sequence<Language> LanguageSeq; - - interface Dictionary : Bonobo::Unknown { - - exception Error { - string error; - }; - - LanguageSeq getLanguages (); - - /** - * sets language(s), language string could contain more languages separated by space - */ - void setLanguage (in string language); - - /** - * checks word - * - * returns true if word is valid - */ - boolean checkWord (in string word) raises (Error); - - /** - * returns suggestions for word - */ - StringSeq getSuggestions (in string word) raises (Error); - - /** - * add to session/personal dictionary - */ - void addWordToSession (in string word) raises (Error); - void addWordToPersonal (in string word, in string language) raises (Error); - - /** - * informs dictionary, that word 'word' will be replaced/corrected by word 'replacement' - */ - void setCorrection (in string word, in string replacement, in string language); - }; - }; -}; diff --git a/mail/e-searching-tokenizer.c b/mail/e-searching-tokenizer.c deleted file mode 100644 index 44e88df378..0000000000 --- a/mail/e-searching-tokenizer.c +++ /dev/null @@ -1,1251 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ - -/* - * e-searching-tokenizer.c - * - * Copyright (C) 2002 Ximian, Inc. - * - * Developed by Jon Trowbridge <trow@ximian.com> - * Rewritten significantly to handle multiple strings and improve performance - * by Michael Zucchi <notzed@ximian.com> - */ - -/* - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public - * License as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - */ - - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <ctype.h> - -#include "e-searching-tokenizer.h" - -#include "e-util/e-memory.h" -#include "e-util/e-msgport.h" - -#define d(x) - -enum { - MATCH_SIGNAL, - LAST_SIGNAL -}; - -static guint signals[LAST_SIGNAL] = { 0, }; - -static void e_searching_tokenizer_begin (HTMLTokenizer *, char *); -static void e_searching_tokenizer_end (HTMLTokenizer *); -static char *e_searching_tokenizer_peek_token (HTMLTokenizer *); -static char *e_searching_tokenizer_next_token (HTMLTokenizer *); -static gboolean e_searching_tokenizer_has_more (HTMLTokenizer *); - -static HTMLTokenizer *e_searching_tokenizer_clone (HTMLTokenizer *); - -/* - static const gchar *space_tags[] = { "br", NULL };*/ - -static HTMLTokenizerClass *parent_class = NULL; - -/** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** **/ - -/* ??? -typedef struct _SharedState SharedState; -struct _SharedState { - gint refs; - gchar *str_primary; - gchar *str_secondary; - gboolean case_sensitive_primary; - gboolean case_sensitive_secondary; -}; -*/ - -/* ********************************************************************** */ - - -#if 0 -static SharedState * -shared_state_new (void) -{ - SharedState *shared = g_new0 (SharedState, 1); - shared->refs = 1; - return shared; -} - -static void -shared_state_ref (SharedState *shared) -{ - g_return_if_fail (shared != NULL); - g_return_if_fail (shared->refs > 0); - ++shared->refs; -} - -static void -shared_state_unref (SharedState *shared) -{ - if (shared) { - g_return_if_fail (shared->refs > 0); - --shared->refs; - if (shared->refs == 0) { - g_free (shared->str_primary); - g_free (shared->str_secondary); - g_free (shared); - } - } -} -#endif - -/** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** **/ - -/* ********************************************************************** */ - -/* Utility functions */ - -/* This is faster and safer than glib2's utf8 abomination, but isn't exported from camel as yet */ -static inline guint32 -camel_utf8_getc(const unsigned char **ptr) -{ - register unsigned char *p = (unsigned char *)*ptr; - register unsigned char c, r; - register guint32 v, m; - -again: - r = *p++; -loop: - if (r < 0x80) { - *ptr = p; - v = r; - } else if (r < 0xfe) { /* valid start char? */ - v = r; - m = 0x7f80; /* used to mask out the length bits */ - do { - c = *p++; - if ((c & 0xc0) != 0x80) { - r = c; - goto loop; - } - v = (v<<6) | (c & 0x3f); - r<<=1; - m<<=5; - } while (r & 0x40); - - *ptr = p; - - v &= ~m; - } else { - goto again; - } - - return v; -} - - -/* note: our tags of interest are 7 bit ascii, only, no need to do any fancy utf8 stuff */ -/* tags should be upper case - if this list gets longer than 10 entries, consider binary search */ -static char *ignored_tags[] = { "B", "I", "FONT", "TT", "EM", /* and more? */}; - -static int -ignore_tag(const char *tag) -{ - char *t = alloca(strlen(tag)+1), c, *out; - const char *in; - int i; - - /* we could use a aho-corasick matcher here too ... but we wont */ - - /* normalise tag into 't'. - Note we use the property that the only tags we're interested in - are 7 bit ascii to shortcut and simplify case insensitivity */ - in = tag+2; /* skip: TAG_ESCAPE '<' */ - if (*in == '/') - in++; - out = t; - while ((c = *in++)) { - if (c >= 'A' && c <= 'Z') - *out++ = c; - else if (c >= 'a' && c <= 'z') - *out++ = c & 0xdf; /* convert ASCII to upper case */ - else - /* maybe should check for > or ' ' etc? */ - break; - } - *out = 0; - - for (i=0;i<sizeof(ignored_tags)/sizeof(ignored_tags[0]);i++) { - if (strcmp(t, ignored_tags[i]) == 0) - return 1; - } - - return 0; -} - -/* ********************************************************************** */ - -/* Aho-Corasick search tree implmeentation */ - -/* next state if we match a character */ -struct _match { - struct _match *next; - guint32 ch; - struct _state *match; -}; - -/* tree state node */ -struct _state { - struct _match *matches; - unsigned int final; /* max no of chars we just matched */ - struct _state *fail; /* where to try next if we fail */ - struct _state *next; /* next on this level? */ -}; - -/* base tree structure */ -struct _trie { - struct _state root; - int max_depth; - - EMemChunk *state_chunks; - EMemChunk *match_chunks; -}; - -static void -dump_trie(struct _state *s, int d) -{ - char *p = alloca(d*2+1); - struct _match *m; - - memset(p, ' ', d*2); - p[d*2]=0; - - printf("%s[state] %p: %d fail->%p\n", p, s, s->final, s->fail); - m = s->matches; - while (m) { - printf(" %s'%c' -> %p\n", p, m->ch, m->match); - if (m->match) - dump_trie(m->match, d+1); - m = m->next; - } -} - -/* This builds an Aho-Corasick search trie for a set of utf8 words */ -/* See - http://www-sr.informatik.uni-tuebingen.de/~buehler/AC/AC.html - for a neat demo */ - -static inline struct _match * -g(struct _state *q, guint32 c) -{ - struct _match *m = q->matches; - - while (m && m->ch != c) - m = m->next; - - return m; -} - -static struct _trie * -build_trie(int nocase, int len, char **words) -{ - struct _state *q, *qt, *r; - char *word; - struct _match *m, *n = NULL; - int i, depth; - guint32 c; - struct _trie *trie; - int state_depth_max, state_depth_size; - struct _state **state_depth; - - trie = g_malloc(sizeof(*trie)); - trie->root.matches = NULL; - trie->root.final = 0; - trie->root.fail = NULL; - trie->root.next = NULL; - - trie->state_chunks = e_memchunk_new(8, sizeof(struct _state)); - trie->match_chunks = e_memchunk_new(8, sizeof(struct _match)); - - /* This will correspond to the length of the longest pattern */ - state_depth_size = 0; - state_depth_max = 64; - state_depth = g_malloc(sizeof(*state_depth[0])*64); - state_depth[0] = NULL; - - /* Step 1: Build trie */ - - /* This just builds a tree that merges all common prefixes into the same branch */ - - for (i=0;i<len;i++) { - word = words[i]; - q = &trie->root; - depth = 0; - while ((c = camel_utf8_getc((const unsigned char **)&word))) { - if (nocase) - c = g_unichar_tolower(c); - m = g(q, c); - if (m == NULL) { - m = e_memchunk_alloc(trie->match_chunks); - m->ch = c; - m->next = q->matches; - q->matches = m; - q = m->match = e_memchunk_alloc(trie->state_chunks); - q->matches = NULL; - q->fail = &trie->root; - q->final = 0; - if (state_depth_max < depth) { - state_depth_max += 64; - state_depth = g_realloc(state_depth, sizeof(*state_depth[0])*state_depth_max); - } - if (state_depth_size < depth) { - state_depth[depth] = 0; - state_depth_size = depth; - } - q->next = state_depth[depth]; - state_depth[depth] = q; - } else { - q = m->match; - } - depth++; - } - q->final = depth; - } - - d(printf("Dumping trie:\n")); - d(dump_trie(&trie->root, 0)); - - /* Step 2: Build failure graph */ - - /* This searches for the longest substring which is a prefix of another string and - builds a graph of failure links so you can find multiple substrings concurrently, - using aho-corasick's algorithm */ - - for (i=0;i<state_depth_size;i++) { - q = state_depth[i]; - while (q) { - m = q->matches; - while (m) { - c = m->ch; - qt = m->match; - r = q->fail; - while (r && (n = g(r, c)) == NULL) - r = r->fail; - if (r != NULL) { - qt->fail = n->match; - if (qt->fail->final > qt->final) - qt->final = qt->fail->final; - } else { - if ((n = g(&trie->root, c))) - qt->fail = n->match; - else - qt->fail = &trie->root; - } - m = m->next; - } - q = q->next; - } - } - - d(printf("After failure analysis\n")); - d(dump_trie(&trie->root, 0)); - - g_free(state_depth); - - trie->max_depth = state_depth_size; - - return trie; -} - -static void -free_trie(struct _trie *t) -{ - e_memchunk_destroy(t->match_chunks); - e_memchunk_destroy(t->state_chunks); - - g_free(t); -} - -/* ********************************************************************** */ - -/* html token searcher */ - -struct _token { - struct _token *next; - struct _token *prev; - unsigned int offset; - /* we need to copy the token for memory management, so why not copy it whole */ - char tok[1]; -}; - -/* stack of submatches currently being scanned, used for merging */ -struct _submatch { - unsigned int offstart, offend; /* in bytes */ -}; - -/* flags for new func */ -#define SEARCH_CASE (1) -#define SEARCH_BOLD (2) - -struct _searcher { - struct _trie *t; - - char *(*next_token)(); /* callbacks for more tokens */ - void *next_data; - - int words; /* how many words */ - char *tags, *tage; /* the tag we used to highlight */ - - int flags; /* case sensitive or not */ - - struct _state *state; /* state is the current trie state */ - - int matchcount; - - EDList input; /* pending 'input' tokens, processed but might match */ - EDList output; /* output tokens ready for source */ - - struct _token *current; /* for token output memory management */ - - guint32 offset; /* current offset through searchable stream? */ - guint32 offout; /* last output position */ - - unsigned int lastp; /* current position in rotating last buffer */ - guint32 *last; /* buffer that goes back last 'n' positions */ - guint32 last_mask; /* bitmask for efficient rotation calculation */ - - unsigned int submatchp; /* submatch stack */ - struct _submatch *submatches; -}; - -static void -searcher_set_tokenfunc(struct _searcher *s, char *(*next)(), void *data) -{ - s->next_token = next; - s->next_data = data; -} - -static struct _searcher * -searcher_new(int flags, int argc, char **argv, const char *tags, const char *tage) -{ - int i, m; - struct _searcher *s; - - s = g_malloc(sizeof(*s)); - - s->t = build_trie((flags&SEARCH_CASE) == 0, argc, argv); - s->words = argc; - s->tags = g_strdup(tags); - s->tage = g_strdup(tage); - s->flags = flags; - s->state = &s->t->root; - s->matchcount = 0; - - e_dlist_init(&s->input); - e_dlist_init(&s->output); - s->current = 0; - - s->offset = 0; - s->offout = 0; - - /* rotating queue of previous character positions */ - m = s->t->max_depth+1; - i = 2; - while (i<m) - i<<=2; - s->last = g_malloc(sizeof(s->last[0])*i); - s->last_mask = i-1; - s->lastp = 0; - - /* a stack of possible submatches */ - s->submatchp = 0; - s->submatches = g_malloc(sizeof(s->submatches[0])*argc+1); - - return s; -} - -static void -searcher_free(struct _searcher *s) -{ - struct _token *t; - - while ((t = (struct _token *)e_dlist_remhead(&s->input))) - g_free(t); - while ((t = (struct _token *)e_dlist_remhead(&s->output))) - g_free(t); - g_free(s->tags); - g_free(s->tage); - g_free(s->last); - g_free(s->submatches); - free_trie(s->t); - g_free(s); -} -static struct _token * -append_token(EDList *list, const char *tok, int len) -{ - struct _token *token; - - if (len == -1) - len = strlen(tok); - token = g_malloc(sizeof(*token) + len+1); - token->offset = 0; /* set by caller when required */ - memcpy(token->tok, tok, len); - token->tok[len] = 0; - e_dlist_addtail(list, (EDListNode *)token); - - return token; -} - -#define free_token(x) (g_free(x)) - -static void -output_token(struct _searcher *s, struct _token *token) -{ - int offend; - int left, pre; - - if (token->tok[0] == TAG_ESCAPE) { - if (token->offset >= s->offout) { - d(printf("moving tag token '%s' from input to output\n", token->tok[0]==TAG_ESCAPE?token->tok+1:token->tok)); - e_dlist_addtail(&s->output, (EDListNode *)token); - } else { - d(printf("discarding tag token '%s' from input\n", token->tok[0]==TAG_ESCAPE?token->tok+1:token->tok)); - free_token(token); - } - } else { - offend = token->offset + strlen(token->tok); - left = offend-s->offout; - if (left > 0) { - pre = s->offout - token->offset; - if (pre>0) - memmove(token->tok, token->tok+pre, left+1); - d(printf("adding partial remaining/failed '%s'\n", token->tok[0]==TAG_ESCAPE?token->tok+1:token->tok)); - s->offout = offend; - e_dlist_addtail(&s->output, (EDListNode *)token); - } else { - d(printf("discarding whole token '%s'\n", token->tok[0]==TAG_ESCAPE?token->tok+1:token->tok)); - free_token(token); - } - } -} - -static struct _token * -find_token(struct _searcher *s, int start) -{ - register struct _token *token; - - /* find token which is start token, from end of list back */ - token = (struct _token *)s->input.tailpred; - while (token->prev) { - if (token->offset <= start) - return token; - token = token->prev; - } - - return NULL; -} - -static void -output_match(struct _searcher *s, unsigned int start, unsigned int end) -{ - register struct _token *token; - struct _token *starttoken, *endtoken; - char b[8]; - - d(printf("output match: %d-%d at %d\n", start, end, s->offout)); - - starttoken = find_token(s, start); - endtoken = find_token(s, end); - - if (starttoken == NULL || endtoken == NULL) { - printf("Cannot find match history for match %d-%d\n", start, end); - return; - } - - d(printf("start in token '%s'\n", starttoken->tok[0]==TAG_ESCAPE?starttoken->tok+1:starttoken->tok)); - d(printf("end in token '%s'\n", endtoken->tok[0]==TAG_ESCAPE?endtoken->tok+1:endtoken->tok)); - - /* output pending stuff that didn't match afterall */ - while ((struct _token *)s->input.head != starttoken) { - token = (struct _token *)e_dlist_remhead(&s->input); - d(printf("appending failed match '%s'\n", token->tok[0]==TAG_ESCAPE?token->tok+1:token->tok)); - output_token(s, token); - } - - /* output any pre-match text */ - if (s->offout < start) { - token = append_token(&s->output, starttoken->tok + (s->offout-starttoken->offset), start-s->offout); - d(printf("adding pre-match text '%s'\n", token->tok[0]==TAG_ESCAPE?token->tok+1:token->tok)); - s->offout = start; - } - - /* output highlight/bold */ - if (s->flags & SEARCH_BOLD) { - sprintf(b, "%c<b>", (char)TAG_ESCAPE); - append_token(&s->output, b, -1); - } - if (s->tags) - append_token(&s->output, s->tags, -1); - - /* output match node(s) */ - if (starttoken != endtoken) { - while ((struct _token *)s->input.head != endtoken) { - token = (struct _token *)e_dlist_remhead(&s->input); - d(printf("appending (partial) match node (head) '%s'\n", token->tok[0]==TAG_ESCAPE?token->tok+1:token->tok)); - output_token(s, token); - } - } - - /* any remaining partial content */ - if (s->offout < end) { - token = append_token(&s->output, endtoken->tok+(s->offout-endtoken->offset), end-s->offout); - d(printf("appending (partial) match node (tail) '%s'\n", token->tok[0]==TAG_ESCAPE?token->tok+1:token->tok)); - s->offout = end; - } - - /* end highlight */ - if (s->tage) - append_token(&s->output, s->tage, -1); - - /* and close bold if we need to */ - if (s->flags & SEARCH_BOLD) { - sprintf(b, "%c</b>", (char)TAG_ESCAPE); - append_token(&s->output, b, -1); - } -} - -/* output any sub-pending blocks */ -static void -output_subpending(struct _searcher *s) -{ - int i; - - for (i=s->submatchp-1;i>=0;i--) - output_match(s, s->submatches[i].offstart, s->submatches[i].offend); - s->submatchp = 0; -} - -/* returns true if a merge took place */ -static int -merge_subpending(struct _searcher *s, int offstart, int offend) -{ - int i; - - /* merges overlapping or abutting match strings */ - if (s->submatchp && - s->submatches[s->submatchp-1].offend >= offstart) { - - /* go from end, any that match 'invalidate' follow-on ones too */ - for (i=s->submatchp-1;i>=0;i--) { - if (s->submatches[i].offend >= offstart) { - if (offstart < s->submatches[i].offstart) - s->submatches[i].offstart = offstart; - s->submatches[i].offend = offend; - if (s->submatchp > i) - s->submatchp = i+1; - } - } - return 1; - } - - return 0; -} - -static void -push_subpending(struct _searcher *s, int offstart, int offend) -{ - /* This is really an assertion, we just ignore the last pending match instead of crashing though */ - if (s->submatchp >= s->words) { - printf("ERROR: submatch pending stack overflow\n"); - s->submatchp = s->words-1; - } - - s->submatches[s->submatchp].offstart = offstart; - s->submatches[s->submatchp].offend = offend; - s->submatchp++; -} - -/* move any (partial) tokens from input to output if they are beyond the current output position */ -static void -output_pending(struct _searcher *s) -{ - struct _token *token; - - while ( (token = (struct _token *)e_dlist_remhead(&s->input)) ) - output_token(s, token); -} - -/* flushes any nodes we cannot possibly match anymore */ -static void -flush_extra(struct _searcher *s) -{ - unsigned int start; - int i; - struct _token *starttoken, *token; - - /* find earliest char that can be in contention */ - start = s->offset - s->t->max_depth; - for (i=0;i<s->submatchp;i++) - if (s->submatches[i].offstart < start) - start = s->submatches[i].offstart; - - /* now, flush out any tokens which are before this point */ - starttoken = find_token(s, start); - if (starttoken == NULL) - return; - - while ((struct _token *)s->input.head != starttoken) { - token = (struct _token *)e_dlist_remhead(&s->input); - output_token(s, token); - } -} - -static char * -searcher_next_token(struct _searcher *s) -{ - struct _token *token; - char *tok, *stok, *pre_tok; - struct _trie *t = s->t; - struct _state *q = s->state; - struct _match *m = NULL; - int offstart, offend; - guint32 c; - - while (e_dlist_empty(&s->output)) { - /* get next token */ - tok = s->next_token(s->next_data); - if (tok == NULL) { - output_subpending(s); - output_pending(s); - break; - } - - /* we dont always have to copy each token, e.g. if we dont match anything */ - token = append_token(&s->input, tok, -1); - token->offset = s->offset; - tok = token->tok; - - d(printf("new token %d '%s'\n", token->offset, token->tok[0]==TAG_ESCAPE?token->tok+1:token->tok)); - - /* tag test, reset state on unknown tags */ - if (tok[0] == TAG_ESCAPE) { - if (!ignore_tag(tok)) { - /* force reset */ - output_subpending(s); - output_pending(s); - q = &t->root; - } - - continue; - } - - /* process whole token */ - pre_tok = stok = tok; - while ((c = camel_utf8_getc((const unsigned char **)&tok))) { - if ((s->flags & SEARCH_CASE) == 0) - c = g_unichar_tolower(c); - while (q && (m = g(q, c)) == NULL) - q = q->fail; - if (q == NULL) { - /* mismatch ... reset state */ - output_subpending(s); - q = &t->root; - } else if (m != NULL) { - /* keep track of previous offsets of utf8 chars, rotating buffer */ - s->last[s->lastp] = s->offset + (pre_tok-stok); - s->lastp = (s->lastp+1)&s->last_mask; - - q = m->match; - /* we have a match of q->final characters for a matching word */ - if (q->final) { - s->matchcount++; - - /* use the last buffer to find the real offset of this char */ - offstart = s->last[(s->lastp - q->final)&s->last_mask]; - offend = s->offset + (tok - stok); - - if (q->matches == NULL) { - if (s->submatchp == 0) { - /* nothing pending, always put something in so we can try merge */ - push_subpending(s, offstart, offend); - } else if (!merge_subpending(s, offstart, offend)) { - /* can't merge, output what we have, and start againt */ - output_subpending(s); - push_subpending(s, offstart, offend); - /*output_match(s, offstart, offend);*/ - } else if (e_dlist_length(&s->input) > 8) { - /* we're continuing to match and merge, but we have a lot of stuff - waiting, so flush it out now since this is a safe point to do it */ - output_subpending(s); - } - } else { - /* merge/add subpending */ - if (!merge_subpending(s, offstart, offend)) - push_subpending(s, offstart, offend); - } - } - } - pre_tok = tok; - } - - s->offset += (pre_tok-stok); - - flush_extra(s); - } - - s->state = q; - - if (s->current) - free_token(s->current); - - s->current = token = (struct _token *)e_dlist_remhead(&s->output); - - return token?token->tok:NULL; -} - -static char * -searcher_peek_token(struct _searcher *s) -{ - char *tok; - - /* we just get it and then put it back, it's fast enuf */ - tok = searcher_next_token(s); - if (tok) { - /* need to clear this so we dont free it while its still active */ - e_dlist_addhead(&s->output, (EDListNode *)s->current); - s->current = NULL; - } - - return tok; -} - -static int -searcher_pending(struct _searcher *s) -{ - return !(e_dlist_empty(&s->input) && e_dlist_empty(&s->output)); -} - -/* ********************************************************************** */ - -struct _search_info { - GPtrArray *strv; - char *colour; - unsigned int size:8; - unsigned int flags:8; -}; - -/** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** **/ - -static struct _search_info * -search_info_new(void) -{ - struct _search_info *s; - - s = g_malloc0(sizeof(struct _search_info)); - s->strv = g_ptr_array_new(); - - return s; -} - -static void -search_info_set_flags(struct _search_info *si, unsigned int flags, unsigned int mask) -{ - si->flags = (si->flags & ~mask) | (flags & mask); -} - -static void -search_info_set_colour(struct _search_info *si, const char *colour) -{ - g_free(si->colour); - si->colour = g_strdup(colour); -} - -static void -search_info_add_string(struct _search_info *si, const char *s) -{ - const char *start; - guint32 c; - - if (s && s[0]) { - /* strip leading whitespace */ - start = s; - while ((c = camel_utf8_getc((const unsigned char **)&s))) { - if (!g_unichar_isspace(c)) { - break; - } - start = s; - } - /* should probably also strip trailing, but i'm lazy today */ - if (start[0]) - g_ptr_array_add(si->strv, g_strdup(start)); - } -} - -static void -search_info_clear(struct _search_info *si) -{ - int i; - - for (i=0;i<si->strv->len;i++) - g_free(si->strv->pdata[i]); - - g_ptr_array_set_size(si->strv, 0); -} - -static void -search_info_free(struct _search_info *si) -{ - int i; - - for (i=0;i<si->strv->len;i++) - g_free(si->strv->pdata[i]); - - g_ptr_array_free(si->strv, TRUE); - g_free(si->colour); - g_free(si); -} - -static struct _search_info * -search_info_clone(struct _search_info *si) -{ - struct _search_info *out; - int i; - - out = search_info_new(); - for (i=0;i<si->strv->len;i++) - g_ptr_array_add(out->strv, g_strdup(si->strv->pdata[i])); - out->colour = g_strdup(si->colour); - out->flags = si->flags; - out->size = si->size; - - return out; -} - -static struct _searcher * -search_info_to_searcher(struct _search_info *si) -{ - char *tags, *tage; - char *col; - - if (si->strv->len == 0) - return NULL; - - if (si->colour == NULL) - col = "red"; - else - col = si->colour; - - tags = alloca(20+strlen(col)); - sprintf(tags, "%c<font color=\"%s\">", TAG_ESCAPE, col); - tage = alloca(20); - sprintf(tage, "%c</font>", TAG_ESCAPE); - - return searcher_new(si->flags, si->strv->len, (char **)si->strv->pdata, tags, tage); -} - -/* ********************************************************************** */ - -struct _ESearchingTokenizerPrivate { - struct _search_info *primary, *secondary; - struct _searcher *engine; -}; - -/** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** **/ - -static void -e_searching_tokenizer_finalise (GObject *obj) -{ - ESearchingTokenizer *st = E_SEARCHING_TOKENIZER (obj); - struct _ESearchingTokenizerPrivate *p = st->priv; - - search_info_free (p->primary); - search_info_free (p->secondary); - if (p->engine) - searcher_free(p->engine); - - /* again wtf? - shared_state_unref (st->priv->shared); - */ - - g_free (p); - - if (G_OBJECT_CLASS (parent_class)->finalize) - G_OBJECT_CLASS (parent_class)->finalize(obj); -} - -static void -e_searching_tokenizer_class_init (ESearchingTokenizerClass *klass) -{ - GObjectClass *obj_class = (GObjectClass *) klass; - HTMLTokenizerClass *tok_class = HTML_TOKENIZER_CLASS (klass); - - parent_class = g_type_class_ref (HTML_TYPE_TOKENIZER); - - signals[MATCH_SIGNAL] = - g_signal_new ("match", - E_TYPE_SEARCHING_TOKENIZER, - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ESearchingTokenizerClass, match), - NULL, - NULL, - g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, 0); - - obj_class->finalize = e_searching_tokenizer_finalise; - - tok_class->begin = e_searching_tokenizer_begin; - tok_class->end = e_searching_tokenizer_end; - - tok_class->peek_token = e_searching_tokenizer_peek_token; - tok_class->next_token = e_searching_tokenizer_next_token; - tok_class->has_more = e_searching_tokenizer_has_more; - tok_class->clone = e_searching_tokenizer_clone; -} - -static void -e_searching_tokenizer_init (ESearchingTokenizer *st) -{ - struct _ESearchingTokenizerPrivate *p; - - p = st->priv = g_new0 (struct _ESearchingTokenizerPrivate, 1); - - p->primary = search_info_new(); - search_info_set_flags(p->primary, SEARCH_BOLD, SEARCH_CASE|SEARCH_BOLD); - search_info_set_colour(p->primary, "red"); - - p->secondary = search_info_new(); - search_info_set_flags(p->secondary, SEARCH_BOLD, SEARCH_CASE|SEARCH_BOLD); - search_info_set_colour(p->secondary, "purple"); -} - -GType -e_searching_tokenizer_get_type (void) -{ - static GType type = 0; - - if (!type) { - static const GTypeInfo info = { - sizeof (ESearchingTokenizerClass), - NULL, NULL, - (GClassInitFunc) e_searching_tokenizer_class_init, - NULL, NULL, - sizeof (ESearchingTokenizer), - 0, - (GInstanceInitFunc) e_searching_tokenizer_init, - }; - - type = g_type_register_static (HTML_TYPE_TOKENIZER, "ESearchingTokenizer", &info, 0); - } - - return type; -} - -HTMLTokenizer * -e_searching_tokenizer_new (void) -{ - return (HTMLTokenizer *) g_object_new (E_TYPE_SEARCHING_TOKENIZER, NULL); -} - -/** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** **/ - -/* blah blah the htmltokeniser doesn't like being asked - for a token if it doens't hvae any! */ -static char *get_token(HTMLTokenizer *t) -{ - HTMLTokenizerClass *klass = HTML_TOKENIZER_CLASS (parent_class); - - return klass->has_more(t) ? klass->next_token(t) : NULL; -} - -static void -e_searching_tokenizer_begin (HTMLTokenizer *t, char *content_type) -{ - ESearchingTokenizer *st = E_SEARCHING_TOKENIZER (t); - struct _ESearchingTokenizerPrivate *p = st->priv; - - /* reset search */ - if (p->engine) { - searcher_free(p->engine); - p->engine = NULL; - } - - if ((p->engine = search_info_to_searcher(p->primary)) - || (p->engine = search_info_to_searcher(p->secondary))) { - /*HTMLTokenizerClass *klass = HTML_TOKENIZER_CLASS (parent_class);*/ - - /*searcher_set_tokenfunc(p->engine, klass->next_token, st);*/ - searcher_set_tokenfunc(p->engine, get_token, st); - } - /* else - no engine, no search active */ - - HTML_TOKENIZER_CLASS (parent_class)->begin (t, content_type); -} - -static void -e_searching_tokenizer_end (HTMLTokenizer *t) -{ - /* so end gets called before any get/next tokens. - I dont get it. */ -#if 0 - ESearchingTokenizer *st = E_SEARCHING_TOKENIZER (t); - struct _ESearchingTokenizerPrivate *p = st->priv; - - /* not sure if we should reset search every time ... *shrug* */ - if (p->engine) { - searcher_free(p->engine); - p->engine = NULL; - } -#endif - - HTML_TOKENIZER_CLASS (parent_class)->end (t); -} - -static char * -e_searching_tokenizer_peek_token (HTMLTokenizer *tok) -{ - ESearchingTokenizer *st = E_SEARCHING_TOKENIZER (tok); - - /* If no search is active, just use the default method. */ - if (st->priv->engine == NULL) - return HTML_TOKENIZER_CLASS (parent_class)->peek_token (tok); - - return searcher_peek_token(st->priv->engine); -} - -static char * -e_searching_tokenizer_next_token (HTMLTokenizer *tok) -{ - ESearchingTokenizer *st = E_SEARCHING_TOKENIZER (tok); - int oldmatched; - char *token; - - /* If no search is active, just use the default method. */ - if (st->priv->engine == NULL) - return HTML_TOKENIZER_CLASS (parent_class)->next_token (tok); - - oldmatched = st->priv->engine->matchcount; - - token = searcher_next_token(st->priv->engine); - - /* not sure if this has to be accurate or just say we had some matches */ - if (oldmatched != st->priv->engine->matchcount) - g_signal_emit (st, signals[MATCH_SIGNAL], 0); - - return token; -} - -static gboolean -e_searching_tokenizer_has_more (HTMLTokenizer *tok) -{ - ESearchingTokenizer *st = E_SEARCHING_TOKENIZER (tok); - - return (st->priv->engine != NULL && searcher_pending(st->priv->engine)) - || HTML_TOKENIZER_CLASS (parent_class)->has_more (tok); -} - -/* proxy matched event, not sure what its for otherwise */ -static void -matched (ESearchingTokenizer *st) -{ - /*++st->priv->match_count;*/ - g_signal_emit (st, signals[MATCH_SIGNAL], 0); -} - -static HTMLTokenizer * -e_searching_tokenizer_clone (HTMLTokenizer *tok) -{ - ESearchingTokenizer *orig_st = E_SEARCHING_TOKENIZER (tok); - ESearchingTokenizer *new_st = E_SEARCHING_TOKENIZER (e_searching_tokenizer_new ()); - - search_info_free(new_st->priv->primary); - search_info_free(new_st->priv->secondary); - - new_st->priv->primary = search_info_clone(orig_st->priv->primary); - new_st->priv->secondary = search_info_clone(orig_st->priv->secondary); - - /* what the fucking what???? */ -#if 0 - shared_state_ref (orig_st->priv->shared); - shared_state_unref (new_st->priv->shared); - new_st->priv->shared = orig_st->priv->shared; -#endif - - g_signal_connect_swapped (new_st, "match", G_CALLBACK(matched), orig_st); - - return HTML_TOKENIZER (new_st); -} -/* ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** */ - -void -e_searching_tokenizer_set_primary_search_string (ESearchingTokenizer *st, const gchar *search_str) -{ - g_return_if_fail (st && E_IS_SEARCHING_TOKENIZER (st)); - - search_info_clear(st->priv->primary); - search_info_add_string(st->priv->primary, search_str); -} - -void -e_searching_tokenizer_add_primary_search_string (ESearchingTokenizer *st, const gchar *search_str) -{ - g_return_if_fail (st && E_IS_SEARCHING_TOKENIZER (st)); - - search_info_add_string(st->priv->primary, search_str); -} - -void -e_searching_tokenizer_set_primary_case_sensitivity (ESearchingTokenizer *st, gboolean iscase) -{ - g_return_if_fail (st && E_IS_SEARCHING_TOKENIZER (st)); - - search_info_set_flags(st->priv->primary, iscase?SEARCH_CASE:0, SEARCH_CASE); -} - -void -e_searching_tokenizer_set_secondary_search_string (ESearchingTokenizer *st, const gchar *search_str) -{ - g_return_if_fail (st && E_IS_SEARCHING_TOKENIZER (st)); - - search_info_clear(st->priv->secondary); - search_info_add_string(st->priv->secondary, search_str); -} - -void -e_searching_tokenizer_add_secondary_search_string (ESearchingTokenizer *st, const gchar *search_str) -{ - g_return_if_fail (st && E_IS_SEARCHING_TOKENIZER (st)); - - search_info_add_string(st->priv->secondary, search_str); -} - -void -e_searching_tokenizer_set_secondary_case_sensitivity (ESearchingTokenizer *st, gboolean iscase) -{ - g_return_if_fail (st && E_IS_SEARCHING_TOKENIZER (st)); - - search_info_set_flags(st->priv->secondary, iscase?SEARCH_CASE:0, SEARCH_CASE); -} - -gint -e_searching_tokenizer_match_count (ESearchingTokenizer *st) -{ - g_return_val_if_fail (st && E_IS_SEARCHING_TOKENIZER (st), -1); - - if (st->priv->engine) - return st->priv->engine->matchcount; - - return 0; -} diff --git a/mail/e-searching-tokenizer.h b/mail/e-searching-tokenizer.h deleted file mode 100644 index 9cdd3cb3c2..0000000000 --- a/mail/e-searching-tokenizer.h +++ /dev/null @@ -1,74 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ - -/* - * e-searching-tokenizer.h - * - * Copyright (C) 2001 Ximian, Inc. - * - * Developed by Jon Trowbridge <trow@ximian.com> - */ - -/* - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public - * License as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - */ - -#ifndef __E_SEARCHING_TOKENIZER_H__ -#define __E_SEARCHING_TOKENIZER_H__ - -#include <glib.h> -#include <gtkhtml/htmltokenizer.h> - -#define E_TYPE_SEARCHING_TOKENIZER (e_searching_tokenizer_get_type ()) -#define E_SEARCHING_TOKENIZER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TYPE_SEARCHING_TOKENIZER, ESearchingTokenizer)) -#define E_SEARCHING_TOKENIZER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), E_TYPE_SEARCHING_TOKENIZER, ESearchingTokenizerClass)) -#define E_IS_SEARCHING_TOKENIZER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TYPE_SEARCHING_TOKENIZER)) -#define E_IS_SEARCHING_TOKENIZER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TYPE_SEARCHING_TOKENIZER)) - -typedef struct _ESearchingTokenizer ESearchingTokenizer; -typedef struct _ESearchingTokenizerClass ESearchingTokenizerClass; - -struct _ESearchingTokenizerPrivate; - -struct _ESearchingTokenizer { - HTMLTokenizer parent; - - struct _ESearchingTokenizerPrivate *priv; -}; - -struct _ESearchingTokenizerClass { - HTMLTokenizerClass parent_class; - - void (*match) (ESearchingTokenizer *); -}; - -GType e_searching_tokenizer_get_type (void); - -HTMLTokenizer *e_searching_tokenizer_new (void); - -/* For now, just a simple API */ - -void e_searching_tokenizer_set_primary_search_string (ESearchingTokenizer *, const char *); -void e_searching_tokenizer_add_primary_search_string (ESearchingTokenizer *, const char *); -void e_searching_tokenizer_set_primary_case_sensitivity (ESearchingTokenizer *, gboolean is_case_sensitive); - -void e_searching_tokenizer_set_secondary_search_string (ESearchingTokenizer *, const char *); -void e_searching_tokenizer_add_secondary_search_string (ESearchingTokenizer *st, const char *search_str); -void e_searching_tokenizer_set_secondary_case_sensitivity (ESearchingTokenizer *, gboolean is_case_sensitive); - - -int e_searching_tokenizer_match_count (ESearchingTokenizer *); - - -#endif /* __E_SEARCHING_TOKENIZER_H__ */ diff --git a/mail/em-account-prefs.c b/mail/em-account-prefs.c deleted file mode 100644 index e4b3844b2b..0000000000 --- a/mail/em-account-prefs.c +++ /dev/null @@ -1,580 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Authors: Jeffrey Stedfast <fejj@ximian.com> - * - * Copyright 2002-2003 Ximian, Inc. (www.ximian.com) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA. - * - */ - - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <camel/camel-url.h> - -#include <gtk/gtkliststore.h> -#include <gtk/gtktreeselection.h> - -#include "mail.h" -#include "mail-component.h" -#include "mail-config.h" -#include "mail-config-druid.h" -#include "mail-account-editor.h" -#include "mail-ops.h" -#include "mail-send-recv.h" - -#include "art/mark.xpm" - -#include "em-account-prefs.h" - - -static void em_account_prefs_class_init (EMAccountPrefsClass *class); -static void em_account_prefs_init (EMAccountPrefs *prefs); -static void em_account_prefs_finalise (GObject *obj); -static void em_account_prefs_destroy (GtkObject *object); - -static void mail_accounts_load (EMAccountPrefs *prefs); - -static GdkPixbuf *disabled_pixbuf = NULL; -static GdkPixbuf *enabled_pixbuf = NULL; - -static GtkVBoxClass *parent_class = NULL; - - -#define PREFS_WINDOW(prefs) GTK_WINDOW (gtk_widget_get_ancestor (GTK_WIDGET (prefs), GTK_TYPE_WINDOW)) - - -GType -em_account_prefs_get_type (void) -{ - static GType type = 0; - - if (!type) { - GTypeInfo type_info = { - sizeof (EMAccountPrefsClass), - NULL, NULL, - (GClassInitFunc) em_account_prefs_class_init, - NULL, NULL, - sizeof (EMAccountPrefs), - 0, - (GInstanceInitFunc) em_account_prefs_init, - }; - - type = g_type_register_static (gtk_vbox_get_type (), "EMAccountPrefs", &type_info, 0); - } - - return type; -} - -static void -em_account_prefs_class_init (EMAccountPrefsClass *klass) -{ - GtkObjectClass *gtk_object_class = (GtkObjectClass *) klass; - GObjectClass *object_class = (GObjectClass *) klass; - - parent_class = g_type_class_ref (gtk_vbox_get_type ()); - - gtk_object_class->destroy = em_account_prefs_destroy; - - object_class->finalize = em_account_prefs_finalise; - - /* setup static data */ - disabled_pixbuf = NULL; - enabled_pixbuf = gdk_pixbuf_new_from_xpm_data ((const char **) mark_xpm); -} - -static void -em_account_prefs_init (EMAccountPrefs *prefs) -{ - prefs->druid = NULL; - prefs->editor = NULL; - - gdk_pixbuf_render_pixmap_and_mask (enabled_pixbuf, &prefs->mark_pixmap, &prefs->mark_bitmap, 128); -} - -static void -em_account_prefs_destroy (GtkObject *obj) -{ - EMAccountPrefs *prefs = (EMAccountPrefs *) obj; - - prefs->destroyed = TRUE; - - GTK_OBJECT_CLASS (parent_class)->destroy (obj); -} - -static void -em_account_prefs_finalise (GObject *obj) -{ - EMAccountPrefs *prefs = (EMAccountPrefs *) obj; - - g_object_unref (prefs->gui); - gdk_pixmap_unref (prefs->mark_pixmap); - g_object_unref (prefs->mark_bitmap); - - G_OBJECT_CLASS (parent_class)->finalize (obj); -} - -static void -account_add_finished (EMAccountPrefs *prefs, GObject *deadbeef) -{ - /* Either Cancel or Finished was clicked in the druid so reload the accounts */ - prefs->druid = NULL; - - if (!prefs->destroyed) - mail_accounts_load (prefs); - - g_object_unref (prefs); -} - -static void -account_add_clicked (GtkButton *button, gpointer user_data) -{ - EMAccountPrefs *prefs = (EMAccountPrefs *) user_data; - GtkWidget *parent; - - if (prefs->druid == NULL) { - prefs->druid = (GtkWidget *) mail_config_druid_new (); - - parent = gtk_widget_get_toplevel ((GtkWidget *) prefs); - if (GTK_WIDGET_TOPLEVEL (parent)) - gtk_window_set_transient_for ((GtkWindow *) prefs->druid, (GtkWindow *) parent); - - g_object_weak_ref ((GObject *) prefs->druid, - (GWeakNotify) account_add_finished, prefs); - - gtk_widget_show (prefs->druid); - g_object_ref (prefs); - } else { - gdk_window_raise (prefs->druid->window); - } -} - -static void -account_edit_finished (EMAccountPrefs *prefs, GObject *deadbeef) -{ - prefs->editor = NULL; - - if (!prefs->destroyed) - mail_accounts_load (prefs); - - g_object_unref (prefs); -} - -static void -account_edit_clicked (GtkButton *button, gpointer user_data) -{ - EMAccountPrefs *prefs = (EMAccountPrefs *) user_data; - - if (prefs->editor == NULL) { - GtkTreeSelection *selection; - EAccount *account = NULL; - GtkTreeModel *model; - GtkTreeIter iter; - - selection = gtk_tree_view_get_selection (prefs->table); - if (gtk_tree_selection_get_selected (selection, &model, &iter)) - gtk_tree_model_get (model, &iter, 3, &account, -1); - - if (account) { - GtkWidget *parent; - - parent = gtk_widget_get_toplevel ((GtkWidget *) prefs); - parent = GTK_WIDGET_TOPLEVEL (parent) ? parent : NULL; - - prefs->editor = (GtkWidget *) mail_account_editor_new (account, (GtkWindow *) parent, prefs); - - g_object_weak_ref ((GObject *) prefs->editor, (GWeakNotify) account_edit_finished, prefs); - gtk_widget_show (prefs->editor); - g_object_ref (prefs); - } - } else { - gdk_window_raise (prefs->editor->window); - } -} - -static void -account_delete_clicked (GtkButton *button, gpointer user_data) -{ - EMAccountPrefs *prefs = user_data; - GtkTreeSelection *selection; - EAccount *account = NULL; - EAccountList *accounts; - GtkTreeModel *model; - GtkWidget *confirm; - GtkTreeIter iter; - int ans; - - selection = gtk_tree_view_get_selection (prefs->table); - if (gtk_tree_selection_get_selected (selection, &model, &iter)) - gtk_tree_model_get (model, &iter, 3, &account, -1); - - /* make sure we have a valid account selected and that we aren't editing anything... */ - if (account == NULL || prefs->editor != NULL) - return; - - confirm = gtk_message_dialog_new (PREFS_WINDOW (prefs), - GTK_DIALOG_MODAL|GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_QUESTION, GTK_BUTTONS_NONE, - _("Are you sure you want to delete this account?")); - - button = (GtkButton *) gtk_button_new_from_stock (GTK_STOCK_YES); - gtk_button_set_label (button, _("Delete")); - gtk_dialog_add_action_widget ((GtkDialog *) confirm, (GtkWidget *) button, GTK_RESPONSE_YES); - gtk_widget_show ((GtkWidget *) button); - - button = (GtkButton *) gtk_button_new_from_stock (GTK_STOCK_NO); - gtk_button_set_label (button, _("Don't delete")); - gtk_dialog_add_action_widget ((GtkDialog *) confirm, (GtkWidget *) button, GTK_RESPONSE_NO); - gtk_widget_show ((GtkWidget *) button); - - ans = gtk_dialog_run ((GtkDialog *) confirm); - gtk_widget_destroy (confirm); - - if (ans == GTK_RESPONSE_YES) { - int len; - - /* remove it from the folder-tree in the shell */ - if (account->enabled && account->source && account->source->url) - mail_component_remove_store_by_uri (mail_component_peek (), account->source->url); - - /* remove it from the config file */ - mail_config_remove_account (account); - accounts = mail_config_get_accounts (); - - mail_config_write (); - - mail_autoreceive_setup (); - - gtk_list_store_remove ((GtkListStore *) model, &iter); - - len = e_list_length ((EList *) accounts); - if (len > 0) { - gtk_tree_selection_select_iter (selection, &iter); - } else { - gtk_widget_set_sensitive (GTK_WIDGET (prefs->mail_edit), FALSE); - gtk_widget_set_sensitive (GTK_WIDGET (prefs->mail_delete), FALSE); - gtk_widget_set_sensitive (GTK_WIDGET (prefs->mail_default), FALSE); - gtk_widget_set_sensitive (GTK_WIDGET (prefs->mail_able), FALSE); - } - } -} - -static void -account_default_clicked (GtkButton *button, gpointer user_data) -{ - EMAccountPrefs *prefs = user_data; - GtkTreeSelection *selection; - EAccount *account = NULL; - GtkTreeModel *model; - GtkTreeIter iter; - - selection = gtk_tree_view_get_selection (prefs->table); - if (gtk_tree_selection_get_selected (selection, &model, &iter)) - gtk_tree_model_get (model, &iter, 3, &account, -1); - - if (account) { - mail_config_set_default_account (account); - - mail_config_write (); - - mail_accounts_load (prefs); - } -} - -static void -account_able_clicked (GtkButton *button, gpointer user_data) -{ - MailComponent *component = mail_component_peek (); - EMAccountPrefs *prefs = user_data; - GtkTreeSelection *selection; - EAccount *account = NULL; - GtkTreeModel *model; - GtkTreeIter iter; - - selection = gtk_tree_view_get_selection (prefs->table); - if (gtk_tree_selection_get_selected (selection, &model, &iter)) { - gtk_tree_model_get (model, &iter, 3, &account, -1); - account->enabled = !account->enabled; - gtk_list_store_set ((GtkListStore *) model, &iter, 0, account->enabled, -1); - - gtk_button_set_label (prefs->mail_able, account->enabled ? _("Disable") : _("Enable")); - } - - if (account) { - /* if the account got disabled, remove it from the - folder-tree, otherwise add it to the folder-tree */ - if (account->source->url) { - if (account->enabled) - mail_component_load_store_by_uri (component, - account->source->url, - account->name); - else - mail_component_remove_store_by_uri (component, account->source->url); - } - - mail_autoreceive_setup (); - - mail_config_write (); - } -} - -static void -account_able_toggled (GtkCellRendererToggle *renderer, char *arg1, gpointer user_data) -{ - EMAccountPrefs *prefs = user_data; - GtkTreeSelection *selection; - EAccount *account = NULL; - GtkTreeModel *model; - GtkTreePath *path; - GtkTreeIter iter; - - path = gtk_tree_path_new_from_string (arg1); - model = gtk_tree_view_get_model (prefs->table); - selection = gtk_tree_view_get_selection (prefs->table); - - if (gtk_tree_model_get_iter (model, &iter, path)) { - gtk_tree_model_get (model, &iter, 3, &account, -1); - account->enabled = !account->enabled; - gtk_list_store_set ((GtkListStore *) model, &iter, 0, account->enabled, -1); - - if (gtk_tree_selection_iter_is_selected (selection, &iter)) - gtk_button_set_label (prefs->mail_able, account->enabled ? _("Disable") : _("Enable")); - } - - gtk_tree_path_free (path); - - if (account) { - MailComponent *component = mail_component_peek (); - - /* if the account got disabled, remove it from the - folder-tree, otherwise add it to the folder-tree */ - if (account->source->url) { - if (account->enabled) - mail_component_load_store_by_uri (component, account->source->url, account->name); - else - mail_component_remove_store_by_uri (component, account->source->url); - } - - mail_autoreceive_setup (); - mail_config_write (); - } -} - -static void -account_double_click (GtkTreeView *treeview, GtkTreePath *path, - GtkTreeViewColumn *column, EMAccountPrefs *prefs) -{ - account_edit_clicked (NULL, prefs); -} - -static void -account_cursor_change (GtkTreeSelection *selection, EMAccountPrefs *prefs) -{ - EAccount *account = NULL; - GtkTreeModel *model; - GtkTreeIter iter; - int state; - - state = gtk_tree_selection_get_selected (selection, &model, &iter); - if (state) { - gtk_tree_model_get (model, &iter, 3, &account, -1); - if (account->source && account->enabled) - gtk_button_set_label (prefs->mail_able, _("Disable")); - else - gtk_button_set_label (prefs->mail_able, _("Enable")); - } else { - gtk_widget_grab_focus (GTK_WIDGET (prefs->mail_add)); - } - - gtk_widget_set_sensitive (GTK_WIDGET (prefs->mail_edit), state); - gtk_widget_set_sensitive (GTK_WIDGET (prefs->mail_delete), state); - gtk_widget_set_sensitive (GTK_WIDGET (prefs->mail_default), state); - gtk_widget_set_sensitive (GTK_WIDGET (prefs->mail_able), state); -} - -static void -mail_accounts_load (EMAccountPrefs *prefs) -{ - EAccount *default_account; - EAccountList *accounts; - GtkListStore *model; - GtkTreeIter iter; - char *name, *val; - EIterator *node; - int row = 0; - - model = (GtkListStore *) gtk_tree_view_get_model (prefs->table); - gtk_list_store_clear (model); - - default_account = mail_config_get_default_account (); - - accounts = mail_config_get_accounts (); - node = e_list_get_iterator ((EList *) accounts); - while (e_iterator_is_valid (node)) { - EAccount *account; - CamelURL *url; - - account = (EAccount *) e_iterator_get (node); - - url = account->source && account->source->url ? camel_url_new (account->source->url, NULL) : NULL; - - gtk_list_store_append (model, &iter); - if (account == default_account) { - /* translators: default account indicator */ - name = val = g_strdup_printf ("%s %s", account->name, _("[Default]")); - } else { - val = account->name; - name = NULL; - } - - gtk_list_store_set (model, &iter, - 0, account->enabled, - 1, val, - 2, url && url->protocol ? url->protocol : (char *) _("None"), - 3, account, - -1); - g_free (name); - - if (url) - camel_url_free (url); - - row++; - - e_iterator_next (node); - } - - g_object_unref (node); -} - - - -GtkWidget *em_account_prefs_treeview_new (char *widget_name, char *string1, char *string2, - int int1, int int2); - -GtkWidget * -em_account_prefs_treeview_new (char *widget_name, char *string1, char *string2, int int1, int int2) -{ - GtkWidget *table, *scrolled; - GtkTreeSelection *selection; - GtkCellRenderer *renderer; - GtkListStore *model; - - scrolled = gtk_scrolled_window_new (NULL, NULL); - gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled), - GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); - gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled), GTK_SHADOW_IN); - - renderer = gtk_cell_renderer_toggle_new (); - g_object_set ((GObject *) renderer, "activatable", TRUE, NULL); - - model = gtk_list_store_new (4, G_TYPE_BOOLEAN, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_POINTER); - table = gtk_tree_view_new_with_model ((GtkTreeModel *) model); - gtk_tree_view_insert_column_with_attributes ((GtkTreeView *) table, -1, _("Enabled"), - renderer, "active", 0, NULL); - - g_object_set_data ((GObject *) scrolled, "renderer", renderer); - - renderer = gtk_cell_renderer_text_new (); - gtk_tree_view_insert_column_with_attributes ((GtkTreeView *) table, -1, _("Account name"), - renderer, "text", 1, NULL); - gtk_tree_view_insert_column_with_attributes ((GtkTreeView *)table, -1, _("Protocol"), - renderer, "text", 2, NULL); - selection = gtk_tree_view_get_selection ((GtkTreeView *) table); - gtk_tree_selection_set_mode (selection, GTK_SELECTION_SINGLE); - gtk_tree_view_set_headers_visible ((GtkTreeView *) table, TRUE); - - /* FIXME: column auto-resize? */ - /* Is this needed? - gtk_tree_view_column_set_alignment (gtk_tree_view_get_column (prefs->table, 0), 1.0);*/ - - gtk_container_add (GTK_CONTAINER (scrolled), table); - - g_object_set_data ((GObject *) scrolled, "table", table); - - gtk_widget_show (scrolled); - gtk_widget_show (table); - - return scrolled; -} - -static void -em_account_prefs_construct (EMAccountPrefs *prefs) -{ - GtkWidget *toplevel, *widget; - GtkCellRenderer *renderer; - GladeXML *gui; - - gui = glade_xml_new (EVOLUTION_GLADEDIR "/mail-config.glade", "accounts_tab", NULL); - prefs->gui = gui; - - /* get our toplevel widget */ - toplevel = glade_xml_get_widget (gui, "toplevel"); - - /* reparent */ - gtk_widget_ref (toplevel); - gtk_container_remove (GTK_CONTAINER (toplevel->parent), toplevel); - gtk_container_add (GTK_CONTAINER (prefs), toplevel); - gtk_widget_unref (toplevel); - - widget = glade_xml_get_widget (gui, "etableMailAccounts"); - - prefs->table = (GtkTreeView *) g_object_get_data ((GObject *) widget, "table"); - g_signal_connect (gtk_tree_view_get_selection (prefs->table), - "changed", G_CALLBACK (account_cursor_change), prefs); - g_signal_connect (prefs->table, "row-activated", G_CALLBACK (account_double_click), prefs); - - renderer = g_object_get_data ((GObject *) widget, "renderer"); - g_signal_connect (renderer, "toggled", G_CALLBACK (account_able_toggled), prefs); - - mail_accounts_load (prefs); - - prefs->mail_add = GTK_BUTTON (glade_xml_get_widget (gui, "cmdAccountAdd")); - g_signal_connect (prefs->mail_add, "clicked", G_CALLBACK (account_add_clicked), prefs); - - prefs->mail_edit = GTK_BUTTON (glade_xml_get_widget (gui, "cmdAccountEdit")); - g_signal_connect (prefs->mail_edit, "clicked", G_CALLBACK (account_edit_clicked), prefs); - - prefs->mail_delete = GTK_BUTTON (glade_xml_get_widget (gui, "cmdAccountDelete")); - g_signal_connect (prefs->mail_delete, "clicked", G_CALLBACK (account_delete_clicked), prefs); - - prefs->mail_default = GTK_BUTTON (glade_xml_get_widget (gui, "cmdAccountDefault")); - g_signal_connect (prefs->mail_default, "clicked", G_CALLBACK (account_default_clicked), prefs); - - prefs->mail_able = GTK_BUTTON (glade_xml_get_widget (gui, "cmdAccountAble")); - g_signal_connect (prefs->mail_able, "clicked", G_CALLBACK (account_able_clicked), prefs); -} - - -GtkWidget * -em_account_prefs_new (GNOME_Evolution_Shell shell) -{ - EMAccountPrefs *new; - - new = (EMAccountPrefs *) g_object_new (em_account_prefs_get_type (), NULL); - em_account_prefs_construct (new); - new->shell = shell; - - return (GtkWidget *) new; -} - - -void -em_account_prefs_apply (EMAccountPrefs *prefs) -{ - /* nothing to do here... */ -} diff --git a/mail/em-account-prefs.h b/mail/em-account-prefs.h deleted file mode 100644 index cff22fdc51..0000000000 --- a/mail/em-account-prefs.h +++ /dev/null @@ -1,99 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Authors: Jeffrey Stedfast <fejj@ximian.com> - * - * Copyright 2002-2003 Ximian, Inc. (www.ximian.com) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA. - * - */ - - -#ifndef __EM_ACCOUNT_PREFS_H__ -#define __EM_ACCOUNT_PREFS_H__ - -#ifdef __cplusplus -extern "C" { -#pragma } -#endif /* __cplusplus */ - -#include <gtk/gtkvbox.h> -#include <gtk/gtkbutton.h> -#include <gtk/gtkclist.h> -#include <glade/glade.h> -#include <gtk/gtktreeview.h> - -#include <gal/e-table/e-table.h> - -#include "evolution-config-control.h" - -#include <shell/Evolution.h> - - -#define EM_ACCOUNT_PREFS_TYPE (em_account_prefs_get_type ()) -#define EM_ACCOUNT_PREFS(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), EM_ACCOUNT_PREFS_TYPE, EMAccountPrefs)) -#define EM_ACCOUNT_PREFS_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), EM_ACCOUNT_PREFS_TYPE, EMAccountPrefsClass)) -#define EM_IS_ACCOUNT_PREFS(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), EM_ACCOUNT_PREFS_TYPE)) -#define EM_IS_ACCOUNT_PREFS_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), EM_ACCOUNT_PREFS_TYPE)) - -typedef struct _EMAccountPrefs EMAccountPrefs; -typedef struct _EMAccountPrefsClass EMAccountPrefsClass; - -struct _EMAccountPrefs { - GtkVBox parent_object; - - GNOME_Evolution_Shell shell; - - GladeXML *gui; - - GtkWidget *druid; - GtkWidget *editor; - - GdkPixmap *mark_pixmap; - GdkBitmap *mark_bitmap; - - GtkTreeView *table; - - GtkButton *mail_add; - GtkButton *mail_edit; - GtkButton *mail_delete; - GtkButton *mail_default; - GtkButton *mail_able; - - guint destroyed : 1; -}; - -struct _EMAccountPrefsClass { - GtkVBoxClass parent_class; - - /* signals */ - -}; - - -GtkType em_account_prefs_get_type (void); - -GtkWidget *em_account_prefs_new (GNOME_Evolution_Shell shell); - -void em_account_prefs_apply (EMAccountPrefs *prefs); - -/* needed by global config */ -#define EM_ACCOUNT_PREFS_CONTROL_ID "OAFIID:GNOME_Evolution_Mail_AccountPrefs_ConfigControl:" BASE_VERSION - -#ifdef __cplusplus -} -#endif - -#endif /* __EM_ACCOUNT_PREFS_H__ */ diff --git a/mail/em-camel-stream.c b/mail/em-camel-stream.c deleted file mode 100644 index a1274d634a..0000000000 --- a/mail/em-camel-stream.c +++ /dev/null @@ -1,326 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Authors: Jeffrey Stedfast <fejj@ximian.com> - * Michael Zucchi <notzed@ximian.com> - * - * Copyright 2001 Ximian, Inc. (www.ximian.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public - * License as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - * - */ - - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <string.h> -#include <stdio.h> -#include <camel/camel-stream.h> -#include <camel/camel-object.h> -#include <gtkhtml/gtkhtml.h> -#include <gtkhtml/gtkhtml-stream.h> -#include <gtk/gtkmain.h> -#include "em-camel-stream.h" - -#include "mail-mt.h" - -#define EMCS_BUFFER_SIZE (4096) - -/*#define LOG_STREAM*/ - -#define d(x) - -enum _write_msg_t { - EMCS_WRITE, - EMCS_FLUSH, - EMCS_CLOSE_OK, - EMCS_CLOSE_ERROR, -}; - -struct _write_msg { - EMsg msg; - - enum _write_msg_t op; - - const char *data; - size_t n; -}; - -static void em_camel_stream_class_init (EMCamelStreamClass *klass); -static void em_camel_stream_init (CamelObject *object); -static void em_camel_stream_finalize (CamelObject *object); - -static ssize_t stream_write(CamelStream *stream, const char *buffer, size_t n); -static int stream_close(CamelStream *stream); -static int stream_flush(CamelStream *stream); - -static CamelStreamClass *parent_class = NULL; - -CamelType -em_camel_stream_get_type (void) -{ - static CamelType type = CAMEL_INVALID_TYPE; - - if (type == CAMEL_INVALID_TYPE) { - type = camel_type_register (CAMEL_STREAM_TYPE, - "EMCamelStream", - sizeof (EMCamelStream), - sizeof (EMCamelStreamClass), - (CamelObjectClassInitFunc) em_camel_stream_class_init, - NULL, - (CamelObjectInitFunc) em_camel_stream_init, - (CamelObjectFinalizeFunc) em_camel_stream_finalize); - } - - return type; -} - -static void -em_camel_stream_class_init (EMCamelStreamClass *klass) -{ - CamelStreamClass *stream_class = CAMEL_STREAM_CLASS (klass); - - parent_class = (CamelStreamClass *) CAMEL_STREAM_TYPE; - - /* virtual method overload */ - stream_class->write = stream_write; - stream_class->flush = stream_flush; - stream_class->close = stream_close; -} - -static gboolean -emcs_gui_received(GIOChannel *source, GIOCondition cond, void *data) -{ - EMCamelStream *estream = data; - struct _write_msg *msg; - - d(printf("%p: gui sync op job waiting\n", estream)); - - msg = (struct _write_msg *)e_msgport_get(estream->data_port); - /* Should never happen ... */ - if (msg == NULL) - return TRUE; - - d(printf("%p: running sync op %d\n", estream, msg->op)); - - /* force out any pending data before doing anything else */ - if (estream->used > 0) { - d(printf("sync write %d\n", estream->used)); - - if (estream->html_stream) - gtk_html_stream_write(estream->html_stream, estream->buffer, estream->used); - estream->used = 0; - } - - switch (msg->op) { - case EMCS_WRITE: - d(printf("sync write %d\n", msg->n)); - if (estream->html_stream) - gtk_html_stream_write(estream->html_stream, msg->data, msg->n); - break; - case EMCS_FLUSH: - stream_flush((CamelStream *)estream); - break; - case EMCS_CLOSE_OK: - if (estream->html_stream) { - gtk_html_stream_close(estream->html_stream, GTK_HTML_STREAM_OK); - estream->html_stream = NULL; - } - break; - case EMCS_CLOSE_ERROR: - if (estream->html_stream) { - gtk_html_stream_close(estream->html_stream, GTK_HTML_STREAM_ERROR); - estream->html_stream = NULL; - } - break; - } - - e_msgport_reply((EMsg *)msg); - d(printf("%p: gui sync op jobs done\n", estream)); - - return TRUE; -} - -static void -em_camel_stream_init (CamelObject *object) -{ - EMCamelStream *estream = (EMCamelStream *)object; - - estream->data_port = e_msgport_new(); - estream->reply_port = e_msgport_new(); - - estream->gui_channel = g_io_channel_unix_new(e_msgport_fd(estream->data_port)); - estream->gui_watch = g_io_add_watch(estream->gui_channel, G_IO_IN, emcs_gui_received, estream); - - estream->used = 0; - estream->buffer = g_malloc(EMCS_BUFFER_SIZE); - - d(printf("%p: new estream\n", estream)); -} - -static void -sync_op(EMCamelStream *estream, enum _write_msg_t op, const char *data, size_t n) -{ - struct _write_msg msg; - - d(printf("%p: launching sync op %d\n", estream, op)); - /* we do everything synchronous, we should never have any locks, and - this prevents overflow from banked up data */ - msg.msg.reply_port = estream->reply_port; - msg.op = op; - msg.data = data; - msg.n = n; - e_msgport_put(estream->data_port, &msg.msg); - e_msgport_wait(estream->reply_port); - g_assert(e_msgport_get(msg.msg.reply_port) == &msg.msg); - d(printf("%p: returned sync op %d\n", estream, op)); -} - -static void -em_camel_stream_finalize (CamelObject *object) -{ - EMCamelStream *estream = (EMCamelStream *)object; - - d(printf("%p: finalising stream\n", object)); - if (estream->html_stream) { - d(printf("%p: html stream still open - error\n", object)); - if (pthread_self() == mail_gui_thread) - gtk_html_stream_close(estream->html_stream, GTK_HTML_STREAM_ERROR); - else - sync_op(estream, EMCS_CLOSE_ERROR, NULL, 0); - } - - /* TODO: is this stuff safe to do in another thread? */ - g_source_remove(estream->gui_watch); - g_io_channel_unref(estream->gui_channel); - e_msgport_destroy(estream->data_port); - estream->data_port = NULL; - e_msgport_destroy(estream->reply_port); - estream->reply_port = NULL; - g_free(estream->buffer); -} - -static ssize_t -stream_write (CamelStream *stream, const char *buffer, size_t n) -{ - EMCamelStream *estream = EM_CAMEL_STREAM (stream); - - if (estream->html_stream == NULL) - return -1; - -#ifdef LOG_STREAM - if (estream->save) - fwrite(buffer, sizeof(char), n, estream->save); -#endif - - if (pthread_self() == mail_gui_thread) - gtk_html_stream_write(estream->html_stream, buffer, n); - else { -#if 1 - size_t left = EMCS_BUFFER_SIZE-estream->used; - - /* A super-simple buffer, if we get too much to fit, just do a sync - write, which will implicitly clear our previous writes first */ - d(printf("thread write '%d'\n", n)); - - if (n >= left) { - sync_op(estream, EMCS_WRITE, buffer, n); - } else { - memcpy(estream->buffer + estream->used, buffer, n); - estream->used += n; - } -#else - sync_op(estream, EMCS_WRITE, buffer, n); -#endif - } - return (ssize_t) n; -} - -static int -stream_flush(CamelStream *stream) -{ - EMCamelStream *estream = (EMCamelStream *)stream; - - if (estream->html_stream) { - if (pthread_self() == mail_gui_thread) { - /* FIXME: flush html stream via gtkhtml_stream_flush which doens't exist yet ... */ - while (gtk_events_pending ()) - gtk_main_iteration (); - } else { - sync_op(estream, EMCS_FLUSH, NULL, 0); - } - } - - return 0; -} - -static int -stream_close(CamelStream *stream) -{ - EMCamelStream *estream = (EMCamelStream *)stream; - - d(printf("%p: closing stream\n", stream)); - -#ifdef LOG_STREAM - if (estream->save) { - fclose(estream->save); - estream->save = NULL; - } -#endif - - if (estream->html_stream) { - if (pthread_self() == mail_gui_thread) { - gtk_html_stream_close(estream->html_stream, GTK_HTML_STREAM_OK); - estream->html_stream = NULL; - } else { - sync_op(estream, EMCS_CLOSE_OK, NULL, 0); - } - } - - return 0; -} - -static void -emcs_gtkhtml_destroy(struct _GtkHTML *html, EMCamelStream *emcs) -{ - d(printf("%p: emcs gtkhtml destroy\n", emcs)); - emcs->html = NULL; - emcs->html_stream = NULL; -} - -/* TODO: Could pass NULL for html_stream, and do a gtk_html_begin - on first data -> less flashing */ -CamelStream * -em_camel_stream_new(struct _GtkHTML *html, struct _GtkHTMLStream *html_stream) -{ - EMCamelStream *new; - - new = EM_CAMEL_STREAM (camel_object_new (EM_CAMEL_STREAM_TYPE)); - new->html_stream = html_stream; - g_signal_connect(html, "destroy", G_CALLBACK(emcs_gtkhtml_destroy), new); - -#ifdef LOG_STREAM - { - static int count; - char name[32]; - - sprintf(name, "camel-stream.%d.html", count++); - printf("saving raw html to '%s'\n", name); - new->save = fopen(name, "w"); - } -#endif - return CAMEL_STREAM (new); -} diff --git a/mail/em-camel-stream.h b/mail/em-camel-stream.h deleted file mode 100644 index 955a15a5e2..0000000000 --- a/mail/em-camel-stream.h +++ /dev/null @@ -1,71 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Authors: Jeffrey Stedfast <fejj@ximian.com> - * - * Copyright 2001 Ximian, Inc. (www.ximian.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public - * License as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - * - */ - -#ifndef EM_CAMEL_STREAM_H -#define EM_CAMEL_STREAM_H - -#ifdef __cplusplus -extern "C" { -#pragma } -#endif /* __cplusplus */ - -#define EM_CAMEL_STREAM_TYPE (em_camel_stream_get_type ()) -#define EM_CAMEL_STREAM(obj) (CAMEL_CHECK_CAST((obj), EM_CAMEL_STREAM_TYPE, EMCamelStream)) -#define EM_CAMEL_STREAM_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), EM_CAMEL_STREAM_TYPE, EMCamelStreamClass)) -#define MAIL_IS_DISPLAY_STREAM(o) (CAMEL_CHECK_TYPE((o), EM_CAMEL_STREAM_TYPE)) - -struct _GtkHTML; -struct _GtkHTMLStream; - -#include <camel/camel-stream.h> -#include "e-util/e-msgport.h" - -typedef struct _EMCamelStream { - CamelStream parent_stream; - - struct _GtkHTML *html; - struct _GtkHTMLStream *html_stream; - - struct _EMsgPort *data_port, *reply_port; - struct _GIOChannel *gui_channel; - guint gui_watch; - char *buffer; - int used; - void *save; -} EMCamelStream; - -typedef struct { - CamelStreamClass parent_class; - -} EMCamelStreamClass; - - -CamelType em_camel_stream_get_type (void); - -/* the html_stream is closed when we are finalised (with an error), or closed (ok) */ -CamelStream *em_camel_stream_new(struct _GtkHTML *html, struct _GtkHTMLStream *html_stream); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* EM_CAMEL_STREAM_H */ diff --git a/mail/em-composer-prefs.c b/mail/em-composer-prefs.c deleted file mode 100644 index f16e254ccf..0000000000 --- a/mail/em-composer-prefs.c +++ /dev/null @@ -1,1010 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Authors: Jeffrey Stedfast <fejj@ximian.com> - * - * Copyright 2002-2003 Ximian, Inc. (www.ximian.com) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA. - * - */ - - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <string.h> - -#include "em-composer-prefs.h" -#include "composer/e-msg-composer.h" - -#include <bonobo/bonobo-generic-factory.h> - -#include <gal/util/e-iconv.h> -#include <gal/widgets/e-gui-utils.h> - -#include <gtk/gtktreemodel.h> -#include <gtk/gtkliststore.h> -#include <gtk/gtktreeselection.h> -#include <gtk/gtktreeview.h> - -#include "widgets/misc/e-charset-picker.h" - -#include "mail-config.h" - -#include "art/mark.xpm" - - -#define d(x) - -static void em_composer_prefs_class_init (EMComposerPrefsClass *class); -static void em_composer_prefs_init (EMComposerPrefs *dialog); -static void em_composer_prefs_destroy (GtkObject *obj); -static void em_composer_prefs_finalise (GObject *obj); - -static void sig_event_client (MailConfigSigEvent event, MailConfigSignature *sig, EMComposerPrefs *prefs); - -static GtkVBoxClass *parent_class = NULL; - - -GType -em_composer_prefs_get_type (void) -{ - static GType type = 0; - - if (!type) { - static const GTypeInfo info = { - sizeof (EMComposerPrefsClass), - NULL, NULL, - (GClassInitFunc) em_composer_prefs_class_init, - NULL, NULL, - sizeof (EMComposerPrefs), - 0, - (GInstanceInitFunc) em_composer_prefs_init, - }; - - type = g_type_register_static (gtk_vbox_get_type (), "EMComposerPrefs", &info, 0); - } - - return type; -} - -static void -em_composer_prefs_class_init (EMComposerPrefsClass *klass) -{ - GObjectClass *gobject_class = G_OBJECT_CLASS (klass); - GtkObjectClass *object_class = GTK_OBJECT_CLASS (klass); - - parent_class = g_type_class_ref (gtk_vbox_get_type ()); - - object_class->destroy = em_composer_prefs_destroy; - gobject_class->finalize = em_composer_prefs_finalise; -} - -static void -em_composer_prefs_init (EMComposerPrefs *composer_prefs) -{ - composer_prefs->enabled_pixbuf = gdk_pixbuf_new_from_xpm_data ((const char **) mark_xpm); - gdk_pixbuf_render_pixmap_and_mask (composer_prefs->enabled_pixbuf, - &composer_prefs->mark_pixmap, &composer_prefs->mark_bitmap, 128); -} - -static void -em_composer_prefs_finalise (GObject *obj) -{ - EMComposerPrefs *prefs = (EMComposerPrefs *) obj; - - g_object_unref (prefs->gui); - g_object_unref (prefs->enabled_pixbuf); - gdk_pixmap_unref (prefs->mark_pixmap); - g_object_unref (prefs->mark_bitmap); - - G_OBJECT_CLASS (parent_class)->finalize (obj); -} - -static void -em_composer_prefs_destroy (GtkObject *obj) -{ - EMComposerPrefs *prefs = (EMComposerPrefs *) obj; - - mail_config_signature_unregister_client ((MailConfigSignatureClient) sig_event_client, prefs); - - GTK_OBJECT_CLASS (parent_class)->destroy (obj); -} - -static void -attach_style_info (GtkWidget *item, gpointer user_data) -{ - int *style = user_data; - - g_object_set_data ((GObject *) item, "style", GINT_TO_POINTER (*style)); - - (*style)++; -} - -static void -toggle_button_toggled (GtkWidget *widget, gpointer user_data) -{ - EMComposerPrefs *prefs = (EMComposerPrefs *) user_data; - - if (prefs->control) - evolution_config_control_changed (prefs->control); -} - -static void -menu_changed (GtkWidget *widget, gpointer user_data) -{ - EMComposerPrefs *prefs = (EMComposerPrefs *) user_data; - - if (prefs->control) - evolution_config_control_changed (prefs->control); -} - -static void -option_menu_connect (GtkOptionMenu *omenu, gpointer user_data) -{ - GtkWidget *menu, *item; - GList *items; - - menu = gtk_option_menu_get_menu (omenu); - - items = GTK_MENU_SHELL (menu)->children; - while (items) { - item = items->data; - g_signal_connect (item, "activate", G_CALLBACK (menu_changed), user_data); - items = items->next; - } -} - -static void -sig_load_preview (EMComposerPrefs *prefs, MailConfigSignature *sig) -{ - char *str; - - if (!sig) { - gtk_html_load_from_string (GTK_HTML (prefs->sig_preview), " ", 1); - return; - } - - if (sig->script) - str = mail_config_signature_run_script (sig->script); - else - str = e_msg_composer_get_sig_file_content (sig->filename, sig->html); - if (!str) - str = g_strdup (""); - - /* printf ("HTML: %s\n", str); */ - if (sig->html) { - gtk_html_load_from_string (GTK_HTML (prefs->sig_preview), str, strlen (str)); - } else { - GtkHTMLStream *stream; - int len; - - len = strlen (str); - stream = gtk_html_begin_content (GTK_HTML (prefs->sig_preview), "text/html; charset=utf-8"); - gtk_html_write (GTK_HTML (prefs->sig_preview), stream, "<PRE>", 5); - if (len) - gtk_html_write (GTK_HTML (prefs->sig_preview), stream, str, len); - gtk_html_write (GTK_HTML (prefs->sig_preview), stream, "</PRE>", 6); - gtk_html_end (GTK_HTML (prefs->sig_preview), stream, GTK_HTML_STREAM_OK); - } - - g_free (str); -} - -static void -sig_edit_cb (GtkWidget *widget, EMComposerPrefs *prefs) -{ - GtkTreeSelection *selection; - MailConfigSignature *sig; - GtkTreeModel *model; - GtkWidget *parent; - GtkTreeIter iter; - - selection = gtk_tree_view_get_selection (prefs->sig_list); - if (!gtk_tree_selection_get_selected (selection, &model, &iter)) - return; - - gtk_tree_model_get (model, &iter, 1, &sig, -1); - - if (sig->script == NULL) { - /* normal signature */ - if (!sig->filename || *sig->filename == '\0') { - g_free (sig->filename); - sig->filename = g_strdup (_("Unnamed")); - } - - parent = gtk_widget_get_toplevel ((GtkWidget *) prefs); - parent = GTK_WIDGET_TOPLEVEL (parent) ? parent : NULL; - - mail_signature_editor (sig, (GtkWindow *) parent, FALSE); - } else { - /* signature script */ - GtkWidget *entry; - - entry = glade_xml_get_widget (prefs->sig_script_gui, "fileentry_add_script_script"); - gtk_entry_set_text (GTK_ENTRY (entry), sig->name); - - entry = glade_xml_get_widget (prefs->sig_script_gui, "entry_add_script_name"); - gtk_entry_set_text (GTK_ENTRY (entry), sig->name); - - g_object_set_data ((GObject *) entry, "script", sig); - - gtk_widget_show (prefs->sig_script_dialog); - gdk_window_raise (prefs->sig_script_dialog->window); - } -} - -MailConfigSignature * -em_composer_prefs_new_signature (GtkWindow *parent, gboolean html, const char *script) -{ - MailConfigSignature *sig; - - sig = mail_config_signature_new (html, script); - mail_signature_editor (sig, parent, TRUE); - - return sig; -} - -static void -sig_delete_cb (GtkWidget *widget, EMComposerPrefs *prefs) -{ - MailConfigSignature *sig; - GtkTreeModel *model; - GtkTreeSelection *selection; - GtkTreeIter iter; - - selection = gtk_tree_view_get_selection (prefs->sig_list); - if (gtk_tree_selection_get_selected (selection, &model, &iter)) { - gtk_tree_model_get (model, &iter, 1, &sig, -1); - gtk_list_store_remove ((GtkListStore *) model, &iter); - mail_config_signature_delete (sig); - } -} - -static void -sig_add_cb (GtkWidget *widget, EMComposerPrefs *prefs) -{ - GConfClient *gconf; - gboolean send_html; - GtkWidget *parent; - - gconf = mail_config_get_gconf_client (); - send_html = gconf_client_get_bool (gconf, "/apps/evolution/mail/composer/send_html", NULL); - - parent = gtk_widget_get_toplevel ((GtkWidget *) prefs); - parent = GTK_WIDGET_TOPLEVEL (parent) ? parent : NULL; - - em_composer_prefs_new_signature ((GtkWindow *) parent, send_html, NULL); -} - -static void -sig_add_script_response (GtkWidget *widget, int button, EMComposerPrefs *prefs) -{ - const char *script, *name; - GtkWidget *dialog; - GtkWidget *entry; - - if (button == GTK_RESPONSE_ACCEPT) { - entry = glade_xml_get_widget (prefs->sig_script_gui, "fileentry_add_script_script"); - script = gtk_entry_get_text (GTK_ENTRY (gnome_file_entry_gtk_entry (GNOME_FILE_ENTRY (entry)))); - - entry = glade_xml_get_widget (prefs->sig_script_gui, "entry_add_script_name"); - name = gtk_entry_get_text (GTK_ENTRY (entry)); - if (script && *script) { - struct stat st; - - if (!stat (script, &st) && S_ISREG (st.st_mode) && access (script, X_OK) == 0) { - MailConfigSignature *sig; - GtkWidget *parent; - - parent = gtk_widget_get_toplevel ((GtkWidget *) prefs); - parent = GTK_WIDGET_TOPLEVEL (parent) ? parent : NULL; - - if ((sig = g_object_get_data ((GObject *) entry, "script"))) { - /* we're just editing an existing signature script */ - mail_config_signature_set_name (sig, name); - } else { - sig = em_composer_prefs_new_signature ((GtkWindow *) parent, TRUE, script); - mail_config_signature_set_name (sig, name); - mail_config_signature_add (sig); - } - - gtk_widget_hide (prefs->sig_script_dialog); - - return; - } - } - - dialog = gtk_message_dialog_new (GTK_WINDOW (prefs->sig_script_dialog), - GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, - "%s", _("You must specify a valid script name.")); - - gtk_dialog_run ((GtkDialog *) dialog); - gtk_widget_destroy (dialog); - } - - gtk_widget_hide (widget); -} - -static void -sig_add_script_cb (GtkWidget *widget, EMComposerPrefs *prefs) -{ - GtkWidget *entry; - - entry = glade_xml_get_widget (prefs->sig_script_gui, "entry_add_script_name"); - gtk_entry_set_text (GTK_ENTRY (entry), _("Unnamed")); - - g_object_set_data ((GObject *) entry, "script", NULL); - - gtk_widget_show (prefs->sig_script_dialog); - gdk_window_raise (prefs->sig_script_dialog->window); -} - -static void -sig_selection_changed (GtkTreeSelection *selection, EMComposerPrefs *prefs) -{ - MailConfigSignature *sig; - GtkTreeModel *model; - GtkTreeIter iter; - int state; - - state = gtk_tree_selection_get_selected (selection, &model, &iter); - if (state) { - gtk_tree_model_get (model, &iter, 1, &sig, -1); - sig_load_preview (prefs, sig); - } - - gtk_widget_set_sensitive ((GtkWidget *) prefs->sig_delete, state); - gtk_widget_set_sensitive ((GtkWidget *) prefs->sig_edit, state); -} - -static void -sig_fill_clist (GtkTreeView *clist) -{ - GSList *l; - GtkListStore *model; - GtkTreeIter iter; - - model = (GtkListStore *) gtk_tree_view_get_model (clist); - gtk_list_store_clear (model); - - for (l = mail_config_get_signature_list (); l; l = l->next) { - MailConfigSignature *sig = l->data; - char *name = NULL, *val; - - gtk_list_store_append (model, &iter); - - if (sig->script) - name = val = g_strconcat (sig->name, " ", _("[script]"), NULL); - else - val = sig->name; - gtk_list_store_set (model, &iter, 0, val, 1, sig, -1); - g_free (name); - } -} - -static void -url_requested (GtkHTML *html, const char *url, GtkHTMLStream *handle) -{ - GtkHTMLStreamStatus status; - char buf[128]; - ssize_t size; - int fd; - - if (!strncmp (url, "file:", 5)) - url += 5; - - fd = open (url, O_RDONLY); - status = GTK_HTML_STREAM_OK; - if (fd != -1) { - while ((size = read (fd, buf, sizeof (buf)))) { - if (size == -1) { - status = GTK_HTML_STREAM_ERROR; - break; - } else - gtk_html_write (html, handle, buf, size); - } - } else - status = GTK_HTML_STREAM_ERROR; - - gtk_html_end (html, handle, status); -} - -static void -sig_event_client (MailConfigSigEvent event, MailConfigSignature *sig, EMComposerPrefs *prefs) -{ - MailConfigSignature *current; - GtkTreeSelection *selection; - GtkTreeModel *model; - GtkTreeIter iter; - char path[16]; - - switch (event) { - case MAIL_CONFIG_SIG_EVENT_ADDED: - d(printf ("signature ADDED\n")); - - model = gtk_tree_view_get_model (prefs->sig_list); - gtk_list_store_append ((GtkListStore *) model, &iter); - gtk_list_store_set ((GtkListStore *) model, &iter, 0, sig->name, 1, sig, -1); - break; - case MAIL_CONFIG_SIG_EVENT_NAME_CHANGED: - d(printf ("signature NAME CHANGED\n")); - - /* this is one bizarro interface */ - model = gtk_tree_view_get_model (prefs->sig_list); - sprintf (path, "%d", sig->id); - if (gtk_tree_model_get_iter_from_string (model, &iter, path)) { - char *val, *name = NULL; - - if (sig->script) - name = val = g_strconcat (sig->name, " ", _("[script]"), NULL); - else - val = sig->name; - - gtk_list_store_set ((GtkListStore *) model, &iter, 0, val, -1); - g_free (name); - } - break; - case MAIL_CONFIG_SIG_EVENT_CONTENT_CHANGED: - d(printf ("signature CONTENT CHANGED\n")); - selection = gtk_tree_view_get_selection (prefs->sig_list); - if (gtk_tree_selection_get_selected (selection, &model, &iter)) { - gtk_tree_model_get (model, &iter, 1, ¤t, -1); - if (sig == current) - sig_load_preview (prefs, sig); - } - break; - default: - ; - } -} - -/* - * - * Spell checking cut'n'pasted from gnome-spell/capplet/main.c - * - */ - -#include "Spell.h" - -#define GNOME_SPELL_GCONF_DIR "/GNOME/Spell" -#define SPELL_API_VERSION "0.3" - -static void -spell_set_ui (EMComposerPrefs *prefs) -{ - GtkListStore *model; - GtkTreeIter iter; - GHashTable *present; - gboolean go; - char **strv = NULL; - int i; - - prefs->spell_active = FALSE; - - /* setup the language list */ - present = g_hash_table_new (g_str_hash, g_str_equal); - if (prefs->language_str && (strv = g_strsplit (prefs->language_str, " ", 0))) { - for (i = 0; strv[i]; i++) - g_hash_table_insert (present, strv[i], strv[i]); - } - - model = (GtkListStore *) gtk_tree_view_get_model (prefs->language); - for (go = gtk_tree_model_get_iter_first ((GtkTreeModel *) model, &iter); go; - go = gtk_tree_model_iter_next ((GtkTreeModel *) model, &iter)) { - char *abbr; - - gtk_tree_model_get ((GtkTreeModel *) model, &iter, 2, &abbr, -1); - gtk_list_store_set (model, &iter, 0, g_hash_table_lookup (present, abbr) != NULL, -1); - } - - g_hash_table_destroy (present); - if (strv != NULL) - g_strfreev (strv); - - gnome_color_picker_set_i16 (GNOME_COLOR_PICKER (prefs->colour), - prefs->spell_error_color.red, - prefs->spell_error_color.green, - prefs->spell_error_color.blue, 0xffff); - - prefs->spell_active = TRUE; -} - -static gchar * -spell_get_language_str (EMComposerPrefs *prefs) -{ - GString *str = g_string_new (""); - GtkListStore *model; - GtkTreeIter iter; - gboolean go; - char *rv; - - model = (GtkListStore *) gtk_tree_view_get_model (prefs->language); - for (go = gtk_tree_model_get_iter_first ((GtkTreeModel *) model, &iter); - go; - go = gtk_tree_model_iter_next ((GtkTreeModel *) model, &iter)) { - char *abbr; - gboolean state; - - gtk_tree_model_get ((GtkTreeModel *) model, &iter, 0, &state, 2, &abbr, -1); - if (state) { - if (str->len) - g_string_append_c (str, ' '); - g_string_append (str, abbr); - } - } - - rv = str->str; - g_string_free (str, FALSE); - - return rv; -} - -static void -spell_get_ui (EMComposerPrefs *prefs) -{ - gnome_color_picker_get_i16 (GNOME_COLOR_PICKER (prefs->colour), - &prefs->spell_error_color.red, - &prefs->spell_error_color.green, - &prefs->spell_error_color.blue, NULL); - g_free (prefs->language_str); - prefs->language_str = spell_get_language_str (prefs); -} - -#define GET(t,x,prop,f,c) \ - val = gconf_client_get_without_default (prefs->gconf, GNOME_SPELL_GCONF_DIR x, NULL); \ - if (val) { f; prop = c (gconf_value_get_ ## t (val)); \ - gconf_value_free (val); } - -static void -spell_save_orig (EMComposerPrefs *prefs) -{ - g_free (prefs->language_str_orig); - prefs->language_str_orig = g_strdup (prefs->language_str ? prefs->language_str : ""); - prefs->spell_error_color_orig = prefs->spell_error_color; -} - -/* static void -spell_load_orig (EMComposerPrefs *prefs) -{ - g_free (prefs->language_str); - prefs->language_str = g_strdup (prefs->language_str_orig); - prefs->spell_error_color = prefs->spell_error_color_orig; -} */ - -static void -spell_load_values (EMComposerPrefs *prefs) -{ - GConfValue *val; - char *def_lang; - - def_lang = g_strdup (e_iconv_locale_language ()); - g_free (prefs->language_str); - prefs->language_str = g_strdup (def_lang); - prefs->spell_error_color.red = 0xffff; - prefs->spell_error_color.green = 0; - prefs->spell_error_color.blue = 0; - - GET (int, "/spell_error_color_red", prefs->spell_error_color.red, (void)0, (int)); - GET (int, "/spell_error_color_green", prefs->spell_error_color.green, (void)0, (int)); - GET (int, "/spell_error_color_blue", prefs->spell_error_color.blue, (void)0, (int)); - GET (string, "/language", prefs->language_str, g_free (prefs->language_str), g_strdup); - - if (prefs->language_str == NULL) - prefs->language_str = g_strdup (def_lang); - - spell_save_orig (prefs); - - g_free (def_lang); -} - -#define SET(t,x,prop) \ - gconf_client_set_ ## t (prefs->gconf, GNOME_SPELL_GCONF_DIR x, prop, NULL); - -#define STR_EQUAL(str1, str2) ((str1 == NULL && str2 == NULL) || (str1 && str2 && !strcmp (str1, str2))) - -static void -spell_save_values (EMComposerPrefs *prefs, gboolean force) -{ - if (force || !gdk_color_equal (&prefs->spell_error_color, &prefs->spell_error_color_orig)) { - SET (int, "/spell_error_color_red", prefs->spell_error_color.red); - SET (int, "/spell_error_color_green", prefs->spell_error_color.green); - SET (int, "/spell_error_color_blue", prefs->spell_error_color.blue); - } - - if (force || !STR_EQUAL (prefs->language_str, prefs->language_str_orig)) { - SET (string, "/language", prefs->language_str ? prefs->language_str : ""); - } - - gconf_client_suggest_sync (prefs->gconf, NULL); -} - -static void -spell_apply (EMComposerPrefs *prefs) -{ - spell_get_ui (prefs); - spell_save_values (prefs, FALSE); -} - -/* static void -spell_revert (EMComposerPrefs *prefs) -{ - spell_load_orig (prefs); - spell_set_ui (prefs); - spell_save_values (prefs, TRUE); -} */ - -static void -spell_changed (gpointer user_data) -{ - EMComposerPrefs *prefs = (EMComposerPrefs *) user_data; - - if (prefs->control) - evolution_config_control_changed (prefs->control); -} - -static void -spell_color_set (GtkWidget *widget, guint r, guint g, guint b, guint a, gpointer user_data) -{ - spell_changed (user_data); -} - -static void -spell_language_selection_changed (GtkTreeSelection *selection, EMComposerPrefs *prefs) -{ - GtkTreeIter iter; - GtkTreeModel *model; - gboolean state = FALSE; - - if (gtk_tree_selection_get_selected (selection, &model, &iter)) { - gtk_tree_model_get ((GtkTreeModel *) model, &iter, 0, &state, -1); - gtk_button_set_label ((GtkButton *) prefs->spell_able_button, state ? _("Disable") : _("Enable")); - state = TRUE; - } - gtk_widget_set_sensitive (prefs->spell_able_button, state); -} - -static void -spell_language_enable (GtkWidget *widget, EMComposerPrefs *prefs) -{ - GtkTreeIter iter; - GtkTreeModel *model; - GtkTreeSelection *selection; - gboolean state; - - selection = gtk_tree_view_get_selection (prefs->language); - if (gtk_tree_selection_get_selected (selection, &model, &iter)) { - gtk_tree_model_get (model, &iter, 0, &state, -1); - gtk_list_store_set ((GtkListStore *) model, &iter, 0, !state, -1); - gtk_button_set_label ((GtkButton *) prefs->spell_able_button, state ? _("Enable") : _("Disable")); - spell_changed (prefs); - } -} - -static gboolean -spell_language_button_press (GtkTreeView *tv, GdkEventButton *event, EMComposerPrefs *prefs) -{ - GtkTreePath *path = NULL; - GtkTreeViewColumn *column = NULL; - gtk_tree_view_get_path_at_pos (tv, event->x, event->y, &path, &column, NULL, NULL); - - /* FIXME: This routine should just be a "toggled" event handler on the checkbox cell renderer which - has "activatable" set. */ - - if (path != NULL && column != NULL && !strcmp (gtk_tree_view_column_get_title (column), _("Enabled"))) { - GtkTreeIter iter; - GtkTreeModel *model; - gboolean enabled; - - model = gtk_tree_view_get_model (tv); - gtk_tree_model_get_iter (model, &iter, path); - gtk_tree_model_get (model, &iter, 0, &enabled, -1); - gtk_list_store_set ((GtkListStore *) model, &iter, 0, !enabled, -1); - gtk_button_set_label ((GtkButton *) prefs->spell_able_button, enabled ? _("Enable") : _("Disable")); - spell_changed (prefs); - } - - return FALSE; -} - -static void -spell_setup (EMComposerPrefs *prefs) -{ - GtkListStore *model; - GtkTreeIter iter; - int i; - - model = (GtkListStore *) gtk_tree_view_get_model (prefs->language); - - if (prefs->language_seq) { - for (i = 0; i < prefs->language_seq->_length; i++) { - gtk_list_store_append (model, &iter); - gtk_list_store_set (model, &iter, - 1, _(prefs->language_seq->_buffer[i].name), - 2, prefs->language_seq->_buffer[i].abbreviation, - -1); - } - } - - spell_load_values (prefs); - spell_set_ui (prefs); - - glade_xml_signal_connect_data (prefs->gui, "spellColorSet", G_CALLBACK (spell_color_set), prefs); - glade_xml_signal_connect_data (prefs->gui, "spellLanguageEnable", GTK_SIGNAL_FUNC (spell_language_enable), prefs); - - g_signal_connect (prefs->language, "button_press_event", G_CALLBACK (spell_language_button_press), prefs); -} - -static gboolean -spell_setup_check_options (EMComposerPrefs *prefs) -{ - GNOME_Spell_Dictionary dict; - CORBA_Environment ev; - char *dictionary_id; - - dictionary_id = "OAFIID:GNOME_Spell_Dictionary:" SPELL_API_VERSION; - dict = bonobo_activation_activate_from_id (dictionary_id, 0, NULL, NULL); - if (dict == CORBA_OBJECT_NIL) { - g_warning ("Cannot activate %s", dictionary_id); - - return FALSE; - } - - CORBA_exception_init (&ev); - prefs->language_seq = GNOME_Spell_Dictionary_getLanguages (dict, &ev); - if (ev._major != CORBA_NO_EXCEPTION) - prefs->language_seq = NULL; - CORBA_exception_free (&ev); - - if (prefs->language_seq == NULL) - return FALSE; - - gconf_client_add_dir (prefs->gconf, GNOME_SPELL_GCONF_DIR, GCONF_CLIENT_PRELOAD_NONE, NULL); - - spell_setup (prefs); - - return TRUE; -} - -/* - * End of Spell checking - */ - -static void -em_composer_prefs_construct (EMComposerPrefs *prefs) -{ - GtkWidget *toplevel, *widget, *menu, *info_pixmap; - GtkDialog *dialog; - GladeXML *gui; - GtkListStore *model; - GtkTreeSelection *selection; - gboolean bool; - int style; - char *buf; - - prefs->gconf = mail_config_get_gconf_client (); - - gui = glade_xml_new (EVOLUTION_GLADEDIR "/mail-config.glade", "composer_tab", NULL); - prefs->gui = gui; - prefs->sig_script_gui = glade_xml_new (EVOLUTION_GLADEDIR "/mail-config.glade", "vbox_add_script_signature", NULL); - - /* get our toplevel widget */ - toplevel = glade_xml_get_widget (gui, "toplevel"); - - /* reparent */ - gtk_widget_ref (toplevel); - gtk_container_remove (GTK_CONTAINER (toplevel->parent), toplevel); - gtk_container_add (GTK_CONTAINER (prefs), toplevel); - gtk_widget_unref (toplevel); - - /* General tab */ - - /* Default Behavior */ - prefs->send_html = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui, "chkSendHTML")); - bool = gconf_client_get_bool (prefs->gconf, "/apps/evolution/mail/composer/send_html", NULL); - gtk_toggle_button_set_active (prefs->send_html, bool); - g_signal_connect (prefs->send_html, "toggled", G_CALLBACK (toggle_button_toggled), prefs); - - prefs->prompt_empty_subject = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui, "chkPromptEmptySubject")); - bool = gconf_client_get_bool (prefs->gconf, "/apps/evolution/mail/prompts/empty_subject", NULL); - gtk_toggle_button_set_active (prefs->prompt_empty_subject, bool); - g_signal_connect (prefs->prompt_empty_subject, "toggled", G_CALLBACK (toggle_button_toggled), prefs); - - prefs->prompt_bcc_only = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui, "chkPromptBccOnly")); - bool = gconf_client_get_bool (prefs->gconf, "/apps/evolution/mail/prompts/only_bcc", NULL); - gtk_toggle_button_set_active (prefs->prompt_bcc_only, bool); - g_signal_connect (prefs->prompt_bcc_only, "toggled", G_CALLBACK (toggle_button_toggled), prefs); - - prefs->auto_smileys = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui, "chkAutoSmileys")); - bool = gconf_client_get_bool (prefs->gconf, "/apps/evolution/mail/composer/magic_smileys", NULL); - gtk_toggle_button_set_active (prefs->auto_smileys, bool); - g_signal_connect (prefs->auto_smileys, "toggled", G_CALLBACK (toggle_button_toggled), prefs); - - prefs->spell_check = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui, "chkEnableSpellChecking")); - bool = gconf_client_get_bool (prefs->gconf, "/apps/evolution/mail/composer/inline_spelling", NULL); - gtk_toggle_button_set_active (prefs->spell_check, bool); - g_signal_connect (prefs->spell_check, "toggled", G_CALLBACK (toggle_button_toggled), prefs); - - prefs->charset = GTK_OPTION_MENU (glade_xml_get_widget (gui, "omenuCharset")); - buf = gconf_client_get_string (prefs->gconf, "/apps/evolution/mail/composer/charset", NULL); - menu = e_charset_picker_new (buf && *buf ? buf : e_iconv_locale_charset ()); - gtk_option_menu_set_menu (prefs->charset, GTK_WIDGET (menu)); - option_menu_connect (prefs->charset, prefs); - g_free (buf); - - /* Spell Checking: GNOME Spell part */ - prefs->colour = GNOME_COLOR_PICKER (glade_xml_get_widget (gui, "colorpickerSpellCheckColor")); - prefs->language = GTK_TREE_VIEW (glade_xml_get_widget (gui, "clistSpellCheckLanguage")); - model = gtk_list_store_new (3, G_TYPE_BOOLEAN, G_TYPE_STRING, G_TYPE_POINTER); - gtk_tree_view_set_model (prefs->language, (GtkTreeModel *) model); - gtk_tree_view_insert_column_with_attributes (prefs->language, -1, _("Enabled"), - gtk_cell_renderer_toggle_new (), - "active", 0, - NULL); - gtk_tree_view_insert_column_with_attributes (prefs->language, -1, _("Language(s)"), - gtk_cell_renderer_text_new (), - "text", 1, - NULL); - selection = gtk_tree_view_get_selection (prefs->language); - gtk_tree_selection_set_mode (selection, GTK_SELECTION_SINGLE); - g_signal_connect (selection, "changed", G_CALLBACK (spell_language_selection_changed), prefs); -#if 0 - gtk_clist_set_column_justification (prefs->language, 0, GTK_JUSTIFY_RIGHT); - gtk_clist_set_column_auto_resize (prefs->language, 0, TRUE); -#endif - - prefs->spell_able_button = glade_xml_get_widget (gui, "buttonSpellCheckEnable"); - info_pixmap = glade_xml_get_widget (gui, "pixmapSpellInfo"); - gtk_image_set_from_file (GTK_IMAGE (info_pixmap), EVOLUTION_IMAGES "/info-bulb.png"); - if (!spell_setup_check_options (prefs)) { - gtk_widget_hide (GTK_WIDGET (prefs->colour)); - gtk_widget_hide (GTK_WIDGET (prefs->language)); - } - - /* Forwards and Replies */ - prefs->forward_style = GTK_OPTION_MENU (glade_xml_get_widget (gui, "omenuForwardStyle")); - style = gconf_client_get_int (prefs->gconf, "/apps/evolution/mail/format/forward_style", NULL); - gtk_option_menu_set_history (prefs->forward_style, style); - style = 0; - gtk_container_foreach (GTK_CONTAINER (gtk_option_menu_get_menu (prefs->forward_style)), - attach_style_info, &style); - option_menu_connect (prefs->forward_style, prefs); - - prefs->reply_style = GTK_OPTION_MENU (glade_xml_get_widget (gui, "omenuReplyStyle")); - style = gconf_client_get_int (prefs->gconf, "/apps/evolution/mail/format/reply_style", NULL); - gtk_option_menu_set_history (prefs->reply_style, style); - style = 0; - gtk_container_foreach (GTK_CONTAINER (gtk_option_menu_get_menu (prefs->reply_style)), - attach_style_info, &style); - option_menu_connect (prefs->reply_style, prefs); - - /* Signatures */ - dialog = (GtkDialog *) gtk_dialog_new (); - prefs->sig_script_dialog = (GtkWidget *) dialog; - gtk_dialog_add_buttons (dialog, GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT, - GTK_STOCK_OK, GTK_RESPONSE_ACCEPT, NULL); - gtk_window_set_title ((GtkWindow *) dialog, _("Add script signature")); - g_signal_connect (dialog, "response", G_CALLBACK (sig_add_script_response), prefs); - widget = glade_xml_get_widget (prefs->sig_script_gui, "vbox_add_script_signature"); - gtk_box_pack_start_defaults ((GtkBox *) dialog->vbox, widget); - - prefs->sig_add = GTK_BUTTON (glade_xml_get_widget (gui, "cmdSignatureAdd")); - g_signal_connect (prefs->sig_add, "clicked", G_CALLBACK (sig_add_cb), prefs); - - glade_xml_signal_connect_data (gui, "cmdSignatureAddScriptClicked", - G_CALLBACK (sig_add_script_cb), prefs); - - prefs->sig_edit = GTK_BUTTON (glade_xml_get_widget (gui, "cmdSignatureEdit")); - g_signal_connect (prefs->sig_edit, "clicked", G_CALLBACK (sig_edit_cb), prefs); - - prefs->sig_delete = GTK_BUTTON (glade_xml_get_widget (gui, "cmdSignatureDelete")); - g_signal_connect (prefs->sig_delete, "clicked", G_CALLBACK (sig_delete_cb), prefs); - - prefs->sig_list = GTK_TREE_VIEW (glade_xml_get_widget (gui, "clistSignatures")); - model = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_POINTER); - gtk_tree_view_set_model (prefs->sig_list, (GtkTreeModel *)model); - gtk_tree_view_insert_column_with_attributes (prefs->sig_list, -1, _("Signature(s)"), - gtk_cell_renderer_text_new (), - "text", 0, - NULL); - selection = gtk_tree_view_get_selection (prefs->sig_list); - gtk_tree_selection_set_mode (selection, GTK_SELECTION_SINGLE); - g_signal_connect (selection, "changed", G_CALLBACK (sig_selection_changed), prefs); - - sig_fill_clist (prefs->sig_list); - if (mail_config_get_signature_list () == NULL) { - gtk_widget_set_sensitive ((GtkWidget *) prefs->sig_delete, FALSE); - gtk_widget_set_sensitive ((GtkWidget *) prefs->sig_edit, FALSE); - } - - /* preview GtkHTML widget */ - widget = glade_xml_get_widget (gui, "scrolled-sig"); - prefs->sig_preview = (GtkHTML *) gtk_html_new (); - g_signal_connect (prefs->sig_preview, "url_requested", G_CALLBACK (url_requested), NULL); - gtk_widget_show (GTK_WIDGET (prefs->sig_preview)); - gtk_container_add (GTK_CONTAINER (widget), GTK_WIDGET (prefs->sig_preview)); - - mail_config_signature_register_client ((MailConfigSignatureClient) sig_event_client, prefs); -} - - -GtkWidget * -em_composer_prefs_new (void) -{ - EMComposerPrefs *new; - - new = (EMComposerPrefs *) g_object_new (em_composer_prefs_get_type (), NULL); - em_composer_prefs_construct (new); - - return (GtkWidget *) new; -} - - -void -em_composer_prefs_apply (EMComposerPrefs *prefs) -{ - GtkWidget *menu, *item; - char *string; - int val; - - /* General tab */ - - /* Default Behavior */ - gconf_client_set_bool (prefs->gconf, "/apps/evolution/mail/composer/send_html", - gtk_toggle_button_get_active (prefs->send_html), NULL); - - gconf_client_set_bool (prefs->gconf, "/apps/evolution/mail/prompts/empty_subject", - gtk_toggle_button_get_active (prefs->prompt_empty_subject), NULL); - - gconf_client_set_bool (prefs->gconf, "/apps/evolution/mail/prompts/only_bcc", - gtk_toggle_button_get_active (prefs->prompt_bcc_only), NULL); - - gconf_client_set_bool (prefs->gconf, "/apps/evolution/mail/composer/inline_spelling", - gtk_toggle_button_get_active (prefs->spell_check), NULL); - - gconf_client_set_bool (prefs->gconf, "/apps/evolution/mail/composer/magic_smileys", - gtk_toggle_button_get_active (prefs->auto_smileys), NULL); - - menu = gtk_option_menu_get_menu (prefs->charset); - if (!(string = e_charset_picker_get_charset (menu))) - string = g_strdup (e_iconv_locale_charset ()); - - gconf_client_set_string (prefs->gconf, "/apps/evolution/mail/composer/charset", string, NULL); - g_free (string); - - /* Spell Checking */ - spell_apply (prefs); - - /* Forwards and Replies */ - menu = gtk_option_menu_get_menu (prefs->forward_style); - item = gtk_menu_get_active (GTK_MENU (menu)); - val = GPOINTER_TO_INT (g_object_get_data ((GObject *) item, "style")); - gconf_client_set_int (prefs->gconf, "/apps/evolution/mail/format/forward_style", val, NULL); - - menu = gtk_option_menu_get_menu (prefs->reply_style); - item = gtk_menu_get_active (GTK_MENU (menu)); - val = GPOINTER_TO_INT (g_object_get_data ((GObject *) item, "style")); - gconf_client_set_int (prefs->gconf, "/apps/evolution/mail/format/reply_style", val, NULL); - - /* Keyboard Shortcuts */ - /* FIXME: implement me */ - - /* Signatures */ - /* FIXME: implement me */ - - gconf_client_suggest_sync (prefs->gconf, NULL); -} diff --git a/mail/em-composer-prefs.h b/mail/em-composer-prefs.h deleted file mode 100644 index 70b5eb15eb..0000000000 --- a/mail/em-composer-prefs.h +++ /dev/null @@ -1,130 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Authors: Jeffrey Stedfast <fejj@ximian.com> - * - * Copyright 2002-2003 Ximian, Inc. (www.ximian.com) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA. - * - */ - - -#ifndef __EM_COMPOSER_PREFS_H__ -#define __EM_COMPOSER_PREFS_H__ - -#ifdef __cplusplus -extern "C" { -#pragma } -#endif /* __cplusplus */ - -#include <gtk/gtk.h> -#include <glade/glade.h> -#include <gtkhtml/gtkhtml.h> - -#include <libgnomeui/gnome-color-picker.h> -#include <libgnomeui/gnome-file-entry.h> -#include <gconf/gconf-client.h> - -#include "mail-signature-editor.h" - -#include "evolution-config-control.h" - -#include <shell/Evolution.h> -#include "Spell.h" - -#define EM_COMPOSER_PREFS_TYPE (em_composer_prefs_get_type ()) -#define EM_COMPOSER_PREFS(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), EM_COMPOSER_PREFS_TYPE, EMComposerPrefs)) -#define EM_COMPOSER_PREFS_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), EM_COMPOSER_PREFS_TYPE, EMComposerPrefsClass)) -#define EM_IS_COMPOSER_PREFS(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), EM_COMPOSER_PREFS_TYPE)) -#define EM_IS_COMPOSER_PREFS_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), EM_COMPOSER_PREFS_TYPE)) - -typedef struct _EMComposerPrefs EMComposerPrefs; -typedef struct _EMComposerPrefsClass EMComposerPrefsClass; - -struct _EMComposerPrefs { - GtkVBox parent_object; - - EvolutionConfigControl *control; - - GConfClient *gconf; - - GladeXML *gui; - - /* General tab */ - - /* Default Behavior */ - GtkToggleButton *send_html; - GtkToggleButton *auto_smileys; - GtkToggleButton *prompt_empty_subject; - GtkToggleButton *prompt_bcc_only; - GtkOptionMenu *charset; - - GtkToggleButton *spell_check; - GnomeColorPicker *colour; - GtkTreeView *language; - CORBA_sequence_GNOME_Spell_Language *language_seq; - gboolean spell_active; - char *language_str; - char *language_str_orig; - GdkColor spell_error_color; - GdkColor spell_error_color_orig; - GdkPixmap *mark_pixmap; - GdkBitmap *mark_bitmap; - GdkPixbuf *enabled_pixbuf; - GtkWidget *spell_able_button; - - /* Forwards and Replies */ - GtkOptionMenu *forward_style; - GtkOptionMenu *reply_style; - - /* Keyboard Shortcuts */ - GtkOptionMenu *shortcuts_type; - - /* Signatures */ - GtkTreeView *sig_list; - GtkButton *sig_add; - GtkButton *sig_edit; - GtkButton *sig_delete; - GtkHTML *sig_preview; - gboolean sig_switch; - int sig_row; - GladeXML *sig_script_gui; - GtkWidget *sig_script_dialog; -}; - -struct _EMComposerPrefsClass { - GtkVBoxClass parent_class; - - /* signals */ - -}; - - -GType em_composer_prefs_get_type (void); - -GtkWidget *em_composer_prefs_new (void); - -void em_composer_prefs_apply (EMComposerPrefs *prefs); - -MailConfigSignature *em_composer_prefs_new_signature (GtkWindow *parent, gboolean html, const char *script); - -/* needed by global config */ -#define EM_COMPOSER_PREFS_CONTROL_ID "OAFIID:GNOME_Evolution_Mail_ComposerPrefs_ConfigControl:" BASE_VERSION - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __EM_COMPOSER_PREFS_H__ */ diff --git a/mail/em-composer-utils.c b/mail/em-composer-utils.c deleted file mode 100644 index bc076a7f77..0000000000 --- a/mail/em-composer-utils.c +++ /dev/null @@ -1,600 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Authors: Jeffrey Stedfast <fejj@ximian.com> - * - * Copyright 2003 Ximian, Inc. (www.ximian.com) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA. - * - */ - - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <string.h> - -#include "mail-mt.h" -#include "mail-ops.h" -#include "mail-tools.h" -#include "mail-config.h" -#include "mail-session.h" -#include "mail-send-recv.h" - -#include <e-util/e-dialog-utils.h> /* e_notice */ - -#include "em-utils.h" -#include "em-composer-utils.h" - -struct emcs_t { - unsigned int ref_count; - - CamelFolder *drafts_folder; - char *drafts_uid; - - CamelFolder *folder; - guint32 flags, set; - char *uid; -}; - -static struct emcs_t * -emcs_new (void) -{ - struct emcs_t *emcs; - - emcs = g_new (struct emcs_t, 1); - emcs->ref_count = 1; - emcs->drafts_folder = NULL; - emcs->drafts_uid = NULL; - emcs->folder = NULL; - emcs->flags = 0; - emcs->set = 0; - emcs->uid = NULL; - - return emcs; -} - -static void -free_emcs (struct emcs_t *emcs) -{ - if (emcs->drafts_folder) - camel_object_unref (emcs->drafts_folder); - g_free (emcs->drafts_uid); - - if (emcs->folder) - camel_object_unref (emcs->folder); - g_free (emcs->uid); - g_free (emcs); -} - -static void -emcs_ref (struct emcs_t *emcs) -{ - emcs->ref_count++; -} - -static void -emcs_unref (struct emcs_t *emcs) -{ - emcs->ref_count--; - if (emcs->ref_count == 0) - free_emcs (emcs); -} - -static void -composer_destroy_cb (gpointer user_data, GObject *deadbeef) -{ - emcs_unref (user_data); -} - -static gboolean -ask_confirm_for_unwanted_html_mail (EMsgComposer *composer, EABDestination **recipients) -{ - gboolean res; - GString *str; - int i; - - str = g_string_new(""); - for (i = 0; recipients[i] != NULL; ++i) { - if (!eab_destination_get_html_mail_pref (recipients[i])) { - const char *name; - - name = eab_destination_get_textrep (recipients[i], FALSE); - - g_string_append_printf (str, " %s\n", name); - } - } - - /* FIXME: this wording sucks */ - res = em_utils_prompt_user((GtkWindow *) composer, GTK_RESPONSE_YES, "/apps/evolution/mail/prompts/unwanted_html", - _("You are sending an HTML-formatted message. Please make sure that\n" - "the following recipients are willing and able to receive HTML mail:\n" - "%s" - "Send anyway?"), - str->str); - g_string_free (str, TRUE); - - return res; -} - -static gboolean -ask_confirm_for_empty_subject (EMsgComposer *composer) -{ - return em_utils_prompt_user((GtkWindow *)composer, GTK_RESPONSE_YES, "/apps/evolution/mail/prompts/empty_subject", - _("This message has no subject.\nReally send?")); -} - -static gboolean -ask_confirm_for_only_bcc (EMsgComposer *composer, gboolean hidden_list_case) -{ - gboolean show_again, res; - const char *first_text; - - /* If the user is mailing a hidden contact list, it is possible for - them to create a message with only Bcc recipients without really - realizing it. To try to avoid being totally confusing, I've changed - this dialog to provide slightly different text in that case, to - better explain what the hell is going on. */ - - if (hidden_list_case) { - first_text = _("Since the contact list you are sending to " - "is configured to hide the list's addresses, " - "this message will contain only Bcc recipients."); - } else { - first_text = _("This message contains only Bcc recipients."); - } - - return em_utils_prompt_user ((GtkWindow *) composer, GTK_RESPONSE_YES, "/apps/evolution/mail/prompts/only_bcc", - "%s\n%s", first_text, - _("It is possible that the mail server may reveal the recipients " - "by adding an Apparently-To header.\nSend anyway?")); -} - -struct _send_data { - struct emcs_t *emcs; - EMsgComposer *composer; - gboolean send; -}; - -static void -composer_send_queued_cb (CamelFolder *folder, CamelMimeMessage *msg, CamelMessageInfo *info, - int queued, const char *appended_uid, void *data) -{ - struct emcs_t *emcs; - struct _send_data *send = data; - - emcs = send->emcs; - - if (queued) { - if (emcs && emcs->drafts_folder) { - /* delete the old draft message */ - camel_folder_set_message_flags (emcs->drafts_folder, emcs->drafts_uid, - CAMEL_MESSAGE_DELETED | CAMEL_MESSAGE_SEEN, - CAMEL_MESSAGE_DELETED | CAMEL_MESSAGE_SEEN); - camel_object_unref (emcs->drafts_folder); - emcs->drafts_folder = NULL; - g_free (emcs->drafts_uid); - emcs->drafts_uid = NULL; - } - - if (emcs && emcs->folder) { - /* set any replied flags etc */ - camel_folder_set_message_flags (emcs->folder, emcs->uid, emcs->flags, emcs->set); - camel_object_unref (emcs->folder); - emcs->folder = NULL; - g_free (emcs->uid); - emcs->uid = NULL; - } - - gtk_widget_destroy (GTK_WIDGET (send->composer)); - - if (send->send && camel_session_is_online (session)) { - /* queue a message send */ - mail_send (); - } - } else { - if (!emcs) { - /* disconnect the previous signal handlers */ - g_signal_handlers_disconnect_matched (send->composer, G_SIGNAL_MATCH_FUNC, 0, - 0, NULL, em_utils_composer_send_cb, NULL); - g_signal_handlers_disconnect_matched (send->composer, G_SIGNAL_MATCH_FUNC, 0, - 0, NULL, em_utils_composer_save_draft_cb, NULL); - - /* reconnect to the signals using a non-NULL emcs for the callback data */ - em_composer_utils_setup_default_callbacks (send->composer); - } - - e_msg_composer_set_enable_autosave (send->composer, TRUE); - gtk_widget_show (GTK_WIDGET (send->composer)); - } - - camel_message_info_free (info); - - if (send->emcs) - emcs_unref (send->emcs); - - g_object_unref (send->composer); - g_free (send); -} - -static CamelMimeMessage * -composer_get_message (EMsgComposer *composer, gboolean post, gboolean save_html_object_data) -{ - CamelMimeMessage *message = NULL; - EABDestination **recipients, **recipients_bcc; - gboolean send_html, confirm_html; - CamelInternetAddress *cia; - int hidden = 0, shown = 0; - int num = 0, num_bcc = 0; - const char *subject; - GConfClient *gconf; - EAccount *account; - int i; - - gconf = mail_config_get_gconf_client (); - - /* We should do all of the validity checks based on the composer, and not on - the created message, as extra interaction may occur when we get the message - (e.g. to get a passphrase to sign a message) */ - - /* get the message recipients */ - recipients = e_msg_composer_get_recipients (composer); - - cia = camel_internet_address_new (); - - /* see which ones are visible/present, etc */ - if (recipients) { - for (i = 0; recipients[i] != NULL; i++) { - const char *addr = eab_destination_get_address (recipients[i]); - - if (addr && addr[0]) { - camel_address_decode ((CamelAddress *) cia, addr); - if (camel_address_length ((CamelAddress *) cia) > 0) { - camel_address_remove ((CamelAddress *) cia, -1); - num++; - if (eab_destination_is_evolution_list (recipients[i]) - && !eab_destination_list_show_addresses (recipients[i])) { - hidden++; - } else { - shown++; - } - } - } - } - } - - recipients_bcc = e_msg_composer_get_bcc (composer); - if (recipients_bcc) { - for (i = 0; recipients_bcc[i] != NULL; i++) { - const char *addr = eab_destination_get_address (recipients_bcc[i]); - - if (addr && addr[0]) { - camel_address_decode ((CamelAddress *) cia, addr); - if (camel_address_length ((CamelAddress *) cia) > 0) { - camel_address_remove ((CamelAddress *) cia, -1); - num_bcc++; - } - } - } - - eab_destination_freev (recipients_bcc); - } - - camel_object_unref (cia); - - /* I'm sensing a lack of love, er, I mean recipients. */ - if (num == 0 && !post) { - e_notice ((GtkWindow *) composer, GTK_MESSAGE_WARNING, - _("You must specify recipients in order to send this message.")); - goto finished; - } - - if (num > 0 && (num == num_bcc || shown == 0)) { - /* this means that the only recipients are Bcc's */ - if (!ask_confirm_for_only_bcc (composer, shown == 0)) - goto finished; - } - - send_html = gconf_client_get_bool (gconf, "/apps/evolution/mail/composer/send_html", NULL); - confirm_html = gconf_client_get_bool (gconf, "/apps/evolution/mail/prompts/unwanted_html", NULL); - - /* Only show this warning if our default is to send html. If it isn't, we've - manually switched into html mode in the composer and (presumably) had a good - reason for doing this. */ - if (e_msg_composer_get_send_html (composer) && send_html && confirm_html) { - gboolean html_problem = FALSE; - - if (recipients) { - for (i = 0; recipients[i] != NULL && !html_problem; i++) { - if (!eab_destination_get_html_mail_pref (recipients[i])) - html_problem = TRUE; - } - } - - if (html_problem) { - html_problem = !ask_confirm_for_unwanted_html_mail (composer, recipients); - if (html_problem) - goto finished; - } - } - - /* Check for no subject */ - subject = e_msg_composer_get_subject (composer); - if (subject == NULL || subject[0] == '\0') { - if (!ask_confirm_for_empty_subject (composer)) - goto finished; - } - - /* actually get the message now, this will sign/encrypt etc */ - message = e_msg_composer_get_message (composer, save_html_object_data); - if (message == NULL) - goto finished; - - /* Add info about the sending account */ - account = e_msg_composer_get_preferred_account (composer); - - if (account) { - camel_medium_set_header (CAMEL_MEDIUM (message), "X-Evolution-Account", account->name); - camel_medium_set_header (CAMEL_MEDIUM (message), "X-Evolution-Transport", account->transport->url); - camel_medium_set_header (CAMEL_MEDIUM (message), "X-Evolution-Fcc", account->sent_folder_uri); - if (account->id->organization && *account->id->organization) { - char *org; - - org = camel_header_encode_string (account->id->organization); - camel_medium_set_header (CAMEL_MEDIUM (message), "Organization", org); - g_free (org); - } - } - - /* Get the message recipients and 'touch' them, boosting their use scores */ - if (recipients) - eab_destination_touchv (recipients); - - finished: - - if (recipients) - eab_destination_freev (recipients); - - return message; -} - -static void -got_post_folder (char *uri, CamelFolder *folder, void *data) -{ - CamelFolder **fp = data; - - *fp = folder; - - if (folder) - camel_object_ref (folder); -} - -void -em_utils_composer_send_cb (EMsgComposer *composer, gpointer user_data) -{ - extern CamelFolder *outbox_folder; - CamelMimeMessage *message; - CamelMessageInfo *info; - struct _send_data *send; - gboolean post = FALSE; - CamelFolder *folder; - XEvolution *xev; - char *url; - - url = e_msg_composer_hdrs_get_post_to ((EMsgComposerHdrs *) composer->hdrs); - if (url && *url) { - post = TRUE; - - mail_msg_wait (mail_get_folder (url, 0, got_post_folder, &folder, mail_thread_new)); - - if (!folder) { - g_free (url); - return; - } - } else { - folder = outbox_folder; - camel_object_ref (folder); - } - - g_free (url); - - message = composer_get_message (composer, post, FALSE); - if (!message) - return; - - if (post) { - /* Remove the X-Evolution* headers if we are in Post-To mode */ - xev = mail_tool_remove_xevolution_headers (message); - mail_tool_destroy_xevolution (xev); - } - - info = camel_message_info_new (); - info->flags = CAMEL_MESSAGE_SEEN; - - send = g_malloc (sizeof (*send)); - send->emcs = user_data; - if (send->emcs) - emcs_ref (send->emcs); - send->send = !post; - send->composer = composer; - g_object_ref (composer); - gtk_widget_hide (GTK_WIDGET (composer)); - - e_msg_composer_set_enable_autosave (composer, FALSE); - - mail_append_mail (folder, message, info, composer_send_queued_cb, send); - camel_object_unref (message); - camel_object_unref (folder); -} - -struct _save_draft_info { - struct emcs_t *emcs; - EMsgComposer *composer; - int quit; -}; - -static void -save_draft_done (CamelFolder *folder, CamelMimeMessage *msg, CamelMessageInfo *info, int ok, - const char *appended_uid, void *user_data) -{ - struct _save_draft_info *sdi = user_data; - struct emcs_t *emcs; - CORBA_Environment ev; - - if (!ok) - goto done; - CORBA_exception_init (&ev); - GNOME_GtkHTML_Editor_Engine_runCommand (sdi->composer->editor_engine, "saved", &ev); - CORBA_exception_free (&ev); - - if ((emcs = sdi->emcs) == NULL) { - emcs = emcs_new (); - - /* disconnect the previous signal handlers */ - g_signal_handlers_disconnect_by_func (sdi->composer, G_CALLBACK (em_utils_composer_send_cb), NULL); - g_signal_handlers_disconnect_by_func (sdi->composer, G_CALLBACK (em_utils_composer_save_draft_cb), NULL); - - /* reconnect to the signals using a non-NULL emcs for the callback data */ - em_composer_utils_setup_default_callbacks (sdi->composer); - } - - if (emcs->drafts_folder) { - /* delete the original draft message */ - camel_folder_set_message_flags (emcs->drafts_folder, emcs->drafts_uid, - CAMEL_MESSAGE_DELETED | CAMEL_MESSAGE_SEEN, - CAMEL_MESSAGE_DELETED | CAMEL_MESSAGE_SEEN); - camel_object_unref (emcs->drafts_folder); - emcs->drafts_folder = NULL; - g_free (emcs->drafts_uid); - emcs->drafts_uid = NULL; - } - - if (emcs->folder) { - /* set the replied flags etc */ - camel_folder_set_message_flags (emcs->folder, emcs->uid, emcs->flags, emcs->set); - camel_object_unref (emcs->folder); - emcs->folder = NULL; - g_free (emcs->uid); - emcs->uid = NULL; - } - - if (appended_uid) { - camel_object_ref (folder); - emcs->drafts_folder = folder; - emcs->drafts_uid = g_strdup (appended_uid); - } - - if (sdi->quit) - gtk_widget_destroy (GTK_WIDGET (sdi->composer)); - - done: - g_object_unref (sdi->composer); - if (sdi->emcs) - emcs_unref (sdi->emcs); - g_free (info); - g_free (sdi); -} - -static void -save_draft_folder (char *uri, CamelFolder *folder, gpointer data) -{ - CamelFolder **save = data; - - if (folder) { - *save = folder; - camel_object_ref (folder); - } -} - -void -em_utils_composer_save_draft_cb (EMsgComposer *composer, int quit, gpointer user_data) -{ - extern char *default_drafts_folder_uri; - extern CamelFolder *drafts_folder; - struct _save_draft_info *sdi; - CamelFolder *folder = NULL; - CamelMimeMessage *msg; - CamelMessageInfo *info; - EAccount *account; - - account = e_msg_composer_get_preferred_account (composer); - if (account && account->drafts_folder_uri && - strcmp (account->drafts_folder_uri, default_drafts_folder_uri) != 0) { - int id; - - id = mail_get_folder (account->drafts_folder_uri, 0, save_draft_folder, &folder, mail_thread_new); - mail_msg_wait (id); - - if (!folder) { - if (!em_utils_prompt_user ((GtkWindow *) composer, GTK_RESPONSE_YES, NULL, - _("Unable to open the drafts folder for this account.\n" - "Would you like to use the default drafts folder?"))) - return; - - folder = drafts_folder; - camel_object_ref (drafts_folder); - } - } else { - folder = drafts_folder; - camel_object_ref (folder); - } - - msg = e_msg_composer_get_message_draft (composer); - - info = g_new0 (CamelMessageInfo, 1); - info->flags = CAMEL_MESSAGE_DRAFT | CAMEL_MESSAGE_SEEN; - - sdi = g_malloc (sizeof (struct _save_draft_info)); - sdi->composer = composer; - g_object_ref (composer); - sdi->emcs = user_data; - if (sdi->emcs) - emcs_ref (sdi->emcs); - sdi->quit = quit; - - mail_append_mail (folder, msg, info, save_draft_done, sdi); - camel_object_unref (folder); - camel_object_unref (msg); -} - - -void -em_composer_utils_setup_callbacks (EMsgComposer *composer, CamelFolder *folder, const char *uid, - guint32 flags, guint32 set, CamelFolder *drafts, const char *drafts_uid) -{ - struct emcs_t *emcs; - - emcs = emcs_new (); - - if (folder && uid) { - camel_object_ref (folder); - emcs->folder = folder; - emcs->uid = g_strdup (uid); - emcs->flags = flags; - emcs->set = set; - } - - if (drafts && drafts_uid) { - camel_object_ref (drafts); - emcs->drafts_folder = drafts; - emcs->drafts_uid = g_strdup (drafts_uid); - } - - g_signal_connect (composer, "send", G_CALLBACK (em_utils_composer_send_cb), emcs); - g_signal_connect (composer, "save-draft", G_CALLBACK (em_utils_composer_save_draft_cb), emcs); - - g_object_weak_ref ((GObject *) composer, (GWeakNotify) composer_destroy_cb, emcs); -} diff --git a/mail/em-composer-utils.h b/mail/em-composer-utils.h deleted file mode 100644 index 7e4aeb0274..0000000000 --- a/mail/em-composer-utils.h +++ /dev/null @@ -1,43 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Authors: Jeffrey Stedfast <fejj@ximian.com> - * - * Copyright 2003 Ximian, Inc. (www.ximian.com) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA. - * - */ - - -#ifndef __EM_COMPOSER_UTILS_H__ -#define __EM_COMPOSER_UTILS_H__ - -#include <composer/e-msg-composer.h> - -#ifdef __cplusplus -extern "C" { -#pragma } -#endif /* __cplusplus */ - -void em_composer_utils_setup_callbacks (EMsgComposer *composer, CamelFolder *folder, const char *uid, - guint32 flags, guint32 set, CamelFolder *drafts, const char *drafts_uid); - -#define em_composer_utils_setup_default_callbacks(composer) em_composer_utils_setup_callbacks (composer, NULL, NULL, 0, 0, NULL, NULL) - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __EM_COMPOSER_UTILS_H__ */ diff --git a/mail/em-folder-browser.c b/mail/em-folder-browser.c deleted file mode 100644 index 313b2f61e4..0000000000 --- a/mail/em-folder-browser.c +++ /dev/null @@ -1,1018 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Authors: Michael Zucchi <notzed@ximian.com> - * Jeffrey Stedfast <fejj@ximian.com> - * - * Copyright 2003 Ximian, Inc. (www.ximian.com) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA. - * - */ - - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <string.h> - -#include <gtk/gtkvbox.h> -#include <gtk/gtkscrolledwindow.h> -#include <gtk/gtkbutton.h> -#include <gtk/gtkvpaned.h> -#include <gtkhtml/gtkhtml.h> -#include <gdk/gdkkeysyms.h> - -#include <libgnomeprintui/gnome-print-dialog.h> - -#include "mail-mt.h" -#include "mail-ops.h" -#include "mail-tools.h" -#include "mail-config.h" - -#include <e-util/e-passwords.h> -#include <e-util/e-dialog-utils.h> - -#include <camel/camel-mime-message.h> -#include <camel/camel-stream.h> -#include <camel/camel-stream-filter.h> -#include <camel/camel-mime-filter.h> -#include <camel/camel-mime-filter-tohtml.h> -#include <camel/camel-mime-filter-enriched.h> -#include <camel/camel-multipart.h> -#include <camel/camel-stream-mem.h> -#include <camel/camel-url.h> - -#include <bonobo/bonobo-main.h> -#include <bonobo/bonobo-object.h> -#include <bonobo/bonobo-generic-factory.h> -#include <bonobo/bonobo-control.h> -#include <bonobo/bonobo-ui-component.h> -#include <bonobo/bonobo-ui-util.h> - -/* for efilterbar stuff */ -#include <e-util/e-sexp.h> -#include "mail-vfolder.h" -#include "filter/vfolder-rule.h" -#include <widgets/misc/e-filter-bar.h> -#include <camel/camel-search-private.h> - -/* gal view crap */ -#include <gal/menus/gal-view-etable.h> -#include <gal/menus/gal-view-instance.h> -#include <gal/menus/gal-view-factory-etable.h> -#include "widgets/menus/gal-view-menus.h" - -#include "e-util/e-dialog-utils.h" -#include "em-utils.h" -#include "em-format-html-display.h" -#include "em-format-html-print.h" -#include "em-folder-browser.h" -#include "em-subscribe-editor.h" -#include "message-list.h" - -#include "mail-component.h" -#include "mail-ops.h" - -#include "evolution-shell-component-utils.h" /* Pixmap stuff, sigh */ - -#define d(x) - -struct _EMFolderBrowserPrivate { - GtkWidget *preview; /* container for message display */ - - GtkWidget *subscribe_editor; - - GalViewInstance *view_instance; - GalViewMenus *view_menus; - - guint vpane_resize_id; - guint list_built_id; /* hook onto list-built for delayed 'select first unread' stuff */ -}; - -static void emfb_activate(EMFolderView *emfv, BonoboUIComponent *uic, int state); -static void emfb_set_folder(EMFolderView *emfv, CamelFolder *folder, const char *uri); - -/* FilterBar stuff ... */ -static void emfb_search_config_search(EFilterBar *efb, FilterRule *rule, int id, const char *query, void *data); -static void emfb_search_menu_activated(ESearchBar *esb, int id, EMFolderBrowser *fb); -static void emfb_search_search_activated(ESearchBar *esb, EMFolderBrowser *emfb); -static void emfb_search_query_changed(ESearchBar *esb, EMFolderBrowser *fb); - -static int emfb_list_key_press(ETree *tree, int row, ETreePath path, int col, GdkEvent *ev, EMFolderBrowser *fb); - -static const EMFolderViewEnable emfb_enable_map[]; - -enum { - ESB_SAVE, -}; - -static ESearchBarItem emfb_search_items[] = { - E_FILTERBAR_ADVANCED, - { NULL, 0, NULL }, - E_FILTERBAR_SAVE, - E_FILTERBAR_EDIT, - { NULL, 0, NULL }, - { N_("Create _Virtual Folder From Search..."), ESB_SAVE, NULL }, - { NULL, -1, NULL } -}; - -static GalViewCollection *collection = NULL; - - -static EMFolderViewClass *emfb_parent; - -/* Needed since the paned wont take the position its given otherwise ... */ -static void -emfb_pane_realised(GtkWidget *w, EMFolderBrowser *emfb) -{ - GConfClient *gconf; - - gconf = mail_config_get_gconf_client (); - gtk_paned_set_position((GtkPaned *)emfb->vpane, gconf_client_get_int(gconf, "/apps/evolution/mail/display/paned_size", NULL)); -} - -static gboolean -emfb_pane_button_release_event(GtkWidget *w, GdkEventButton *e, EMFolderBrowser *emfb) -{ - GConfClient *gconf = mail_config_get_gconf_client (); - - if (GTK_WIDGET_REALIZED (w)) - gconf_client_set_int(gconf, "/apps/evolution/mail/display/paned_size", - gtk_paned_get_position(GTK_PANED(w)), NULL); - - return FALSE; -} - -static void -emfb_init(GObject *o) -{ - EMFolderBrowser *emfb = (EMFolderBrowser *)o; - RuleContext *search_context = mail_component_peek_search_context (mail_component_peek ()); - struct _EMFolderBrowserPrivate *p; - - p = emfb->priv = g_malloc0(sizeof(struct _EMFolderBrowserPrivate)); - - emfb->view.preview_active = TRUE; - - g_slist_free(emfb->view.ui_files); - emfb->view.ui_files = g_slist_append(NULL, EVOLUTION_UIDIR "/evolution-mail-global.xml"); - emfb->view.ui_files = g_slist_append(emfb->view.ui_files, EVOLUTION_UIDIR "/evolution-mail-list.xml"); - emfb->view.ui_files = g_slist_append(emfb->view.ui_files, EVOLUTION_UIDIR "/evolution-mail-message.xml"); - - emfb->view.enable_map = g_slist_prepend(emfb->view.enable_map, (void *)emfb_enable_map); - - if (search_context) { - const char *systemrules = g_object_get_data (G_OBJECT (search_context), "system"); - const char *userrules = g_object_get_data (G_OBJECT (search_context), "user"); - - emfb->search = e_filter_bar_new(search_context, systemrules, userrules, emfb_search_config_search, emfb); - e_search_bar_set_menu ((ESearchBar *)emfb->search, emfb_search_items); - gtk_widget_show((GtkWidget *)emfb->search); - - g_signal_connect(emfb->search, "menu_activated", G_CALLBACK(emfb_search_menu_activated), emfb); - g_signal_connect(emfb->search, "search_activated", G_CALLBACK(emfb_search_search_activated), emfb); - g_signal_connect(emfb->search, "query_changed", G_CALLBACK(emfb_search_query_changed), emfb); - - gtk_box_pack_start((GtkBox *)emfb, (GtkWidget *)emfb->search, FALSE, TRUE, 0); - } - - emfb->vpane = gtk_vpaned_new(); - g_signal_connect(emfb->vpane, "realize", G_CALLBACK(emfb_pane_realised), emfb); - emfb->priv->vpane_resize_id = g_signal_connect(emfb->vpane, "button_release_event", G_CALLBACK(emfb_pane_button_release_event), emfb); - - gtk_widget_show(emfb->vpane); - - gtk_box_pack_start_defaults((GtkBox *)emfb, emfb->vpane); - - gtk_paned_add1((GtkPaned *)emfb->vpane, (GtkWidget *)emfb->view.list); - gtk_widget_show((GtkWidget *)emfb->view.list); - - /* currently: just use a scrolledwindow for preview widget */ - p->preview = gtk_scrolled_window_new(NULL, NULL); - gtk_scrolled_window_set_policy((GtkScrolledWindow *)p->preview, GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); - gtk_scrolled_window_set_shadow_type((GtkScrolledWindow *)p->preview, GTK_SHADOW_IN); - gtk_widget_show(p->preview); - - gtk_container_add((GtkContainer *)p->preview, (GtkWidget *)emfb->view.preview->formathtml.html); - gtk_widget_show((GtkWidget *)emfb->view.preview->formathtml.html); - - gtk_paned_add2((GtkPaned *)emfb->vpane, p->preview); - gtk_widget_show(p->preview); - - g_signal_connect(emfb->view.list->tree, "key_press", G_CALLBACK(emfb_list_key_press), emfb); -} - -static void -emfb_finalise(GObject *o) -{ - EMFolderBrowser *emfb = (EMFolderBrowser *)o; - - g_free(emfb->priv); - - ((GObjectClass *)emfb_parent)->finalize(o); -} - -static void -emfb_destroy(GtkObject *o) -{ - EMFolderBrowser *emfb = (EMFolderBrowser *)o; - - if (emfb->priv->list_built_id) { - g_signal_handler_disconnect(((EMFolderView *)emfb)->list, emfb->priv->list_built_id); - emfb->priv->list_built_id = 0; - } - - ((GtkObjectClass *)emfb_parent)->destroy(o); -} - -static void -emfb_class_init(GObjectClass *klass) -{ - klass->finalize = emfb_finalise; - ((GtkObjectClass *)klass)->destroy = emfb_destroy; - ((EMFolderViewClass *)klass)->set_folder = emfb_set_folder; - ((EMFolderViewClass *)klass)->activate = emfb_activate; -} - -GType -em_folder_browser_get_type(void) -{ - static GType type = 0; - - if (type == 0) { - static const GTypeInfo info = { - sizeof(EMFolderBrowserClass), - NULL, NULL, - (GClassInitFunc)emfb_class_init, - NULL, NULL, - sizeof(EMFolderBrowser), 0, - (GInstanceInitFunc)emfb_init - }; - emfb_parent = g_type_class_ref(em_folder_view_get_type()); - type = g_type_register_static(em_folder_view_get_type(), "EMFolderBrowser", &info, 0); - } - - return type; -} - -GtkWidget *em_folder_browser_new(void) -{ - EMFolderBrowser *emfb = g_object_new(em_folder_browser_get_type(), 0); - - return (GtkWidget *)emfb; -} - -void em_folder_browser_show_preview(EMFolderBrowser *emfb, gboolean state) -{ - if ((emfb->view.preview_active ^ state) == 0 - || emfb->view.list == NULL) - return; - - emfb->view.preview_active = state; - - if (state) { - GConfClient *gconf = mail_config_get_gconf_client (); - int paned_size /*, y*/; - - paned_size = gconf_client_get_int(gconf, "/apps/evolution/mail/display/paned_size", NULL); - - /*y = save_cursor_pos (emfb);*/ - gtk_paned_set_position (GTK_PANED (emfb->vpane), paned_size); - gtk_widget_show (GTK_WIDGET (emfb->priv->preview)); - - if (emfb->view.list->cursor_uid) - message_list_select_uid(emfb->view.list, emfb->view.list->cursor_uid); - - /* need to load/show the current message? */ - /*do_message_selected (emfb);*/ - /*set_cursor_pos (emfb, y);*/ - } else { - em_format_format((EMFormat *)emfb->view.preview, NULL); - gtk_widget_hide(emfb->priv->preview); - /* - mail_display_set_message (emfb->mail_display, NULL, NULL, NULL); - emfb_ui_message_loaded (emfb);*/ - } - - /* FIXME: need to update menu's to reflect ui changes */ -} - -/* ********************************************************************** */ - -/* FIXME: Need to separate system rules from user ones */ -/* FIXME: Ugh! */ - -static void -emfb_search_menu_activated(ESearchBar *esb, int id, EMFolderBrowser *emfb) -{ - EFilterBar *efb = (EFilterBar *)esb; - - d(printf("menu activated\n")); - - switch (id) { - case ESB_SAVE: - d(printf("Save vfolder\n")); - if (efb->current_query) { - FilterRule *rule = vfolder_clone_rule(efb->current_query); - char *name, *text; - - text = e_search_bar_get_text(esb); - name = g_strdup_printf("%s %s", rule->name, (text&&text[0])?text:"''"); - g_free (text); - filter_rule_set_name(rule, name); - g_free (name); - - filter_rule_set_source(rule, FILTER_SOURCE_INCOMING); - vfolder_rule_add_source((VfolderRule *)rule, emfb->view.folder_uri); - vfolder_gui_add_rule((VfolderRule *)rule); - } - break; - } -} - -static void -emfb_search_config_search(EFilterBar *efb, FilterRule *rule, int id, const char *query, void *data) -{ - EMFolderBrowser *emfb = data; - GList *partl; - struct _camel_search_words *words; - int i; - GSList *strings = NULL; - - /* we scan the parts of a rule, and set all the types we know about to the query string */ - partl = rule->parts; - while (partl) { - FilterPart *part = partl->data; - - if (!strcmp(part->name, "subject")) { - FilterInput *input = (FilterInput *)filter_part_find_element(part, "subject"); - if (input) - filter_input_set_value(input, query); - } else if (!strcmp(part->name, "body")) { - FilterInput *input = (FilterInput *)filter_part_find_element(part, "word"); - if (input) - filter_input_set_value(input, query); - - words = camel_search_words_split(query); - for (i=0;i<words->len;i++) - strings = g_slist_prepend(strings, g_strdup(words->words[i]->word)); - camel_search_words_free (words); - } else if(!strcmp(part->name, "sender")) { - FilterInput *input = (FilterInput *)filter_part_find_element(part, "sender"); - if (input) - filter_input_set_value(input, query); - } else if(!strcmp(part->name, "to")) { - FilterInput *input = (FilterInput *)filter_part_find_element(part, "recipient"); - if (input) - filter_input_set_value(input, query); - } - - partl = partl->next; - } - - em_format_html_display_set_search(emfb->view.preview, - EM_FORMAT_HTML_DISPLAY_SEARCH_SECONDARY|EM_FORMAT_HTML_DISPLAY_SEARCH_ICASE, - strings); - while (strings) { - GSList *n = strings->next; - - g_free(strings->data); - g_slist_free_1(strings); - strings = n; - } -} - -static void -emfb_search_search_activated(ESearchBar *esb, EMFolderBrowser *emfb) -{ - char *search_word; - - if (emfb->view.list == NULL) - return; - - g_object_get (esb, "query", &search_word, NULL); - message_list_set_search(emfb->view.list, search_word); - g_free(search_word); -} - -static void -emfb_search_query_changed(ESearchBar *esb, EMFolderBrowser *emfb) -{ - int id; - - id = e_search_bar_get_item_id(esb); - if (id == E_FILTERBAR_ADVANCED_ID) - emfb_search_search_activated(esb, emfb); -} - -/* ********************************************************************** */ - -static int -emfb_list_key_press(ETree *tree, int row, ETreePath path, int col, GdkEvent *ev, EMFolderBrowser *emfb) -{ - if ((ev->key.state & GDK_CONTROL_MASK) != 0) - return FALSE; - - switch (ev->key.keyval) { - case GDK_space: - em_utils_adjustment_page(gtk_scrolled_window_get_vadjustment((GtkScrolledWindow *)emfb->priv->preview), TRUE); - break; - case GDK_BackSpace: - em_utils_adjustment_page(gtk_scrolled_window_get_vadjustment((GtkScrolledWindow *)emfb->priv->preview), FALSE); - break; - default: - return FALSE; - } - - return TRUE; -} - -/* ********************************************************************** */ - -static void -emfb_edit_cut(BonoboUIComponent *uid, void *data, const char *path) -{ - EMFolderBrowser *emfb = data; - - /* TODO: pity we can't sucblass this method, ugh, virtualise it? */ - - if (GTK_WIDGET_HAS_FOCUS(((ESearchBar *)emfb->search)->entry)) - gtk_editable_cut_clipboard((GtkEditable *)((ESearchBar *)emfb->search)->entry); - else if (message_list_has_primary_selection(emfb->view.list)) - message_list_copy(emfb->view.list, TRUE); - else if (emfb->view.preview_active) - em_format_html_display_cut(emfb->view.preview); -} - -static void -emfb_edit_copy(BonoboUIComponent *uid, void *data, const char *path) -{ - EMFolderBrowser *emfb = data; - - if (GTK_WIDGET_HAS_FOCUS(((ESearchBar *)emfb->search)->entry)) - gtk_editable_copy_clipboard((GtkEditable *)((ESearchBar *)emfb->search)->entry); - else if (message_list_has_primary_selection(emfb->view.list)) - message_list_copy(emfb->view.list, FALSE); - else if (emfb->view.preview_active) - em_format_html_display_copy(emfb->view.preview); -} - -static void -emfb_edit_paste(BonoboUIComponent *uid, void *data, const char *path) -{ - EMFolderBrowser *emfb = data; - - if (GTK_WIDGET_HAS_FOCUS(((ESearchBar *)emfb->search)->entry)) - gtk_editable_paste_clipboard((GtkEditable *)((ESearchBar *)emfb->search)->entry); - else - message_list_paste(emfb->view.list); -} - -static void -emfb_edit_invert_selection(BonoboUIComponent *uid, void *data, const char *path) -{ - EMFolderView *emfv = data; - - message_list_invert_selection(emfv->list); -} - -static void -emfb_edit_select_all(BonoboUIComponent *uid, void *data, const char *path) -{ - EMFolderView *emfv = data; - - message_list_select_all(emfv->list); -} - -static void -emfb_edit_select_thread(BonoboUIComponent *uid, void *data, const char *path) -{ - EMFolderView *emfv = data; - - message_list_select_thread(emfv->list); -} - -static void -emfb_folder_properties(BonoboUIComponent *uid, void *data, const char *path) -{ - /* If only we could remove this ... */ - /* Should it be part of the factory? */ - printf("FIXME: folderproperties\n"); -} - -static void -emfb_folder_expunge(BonoboUIComponent *uid, void *data, const char *path) -{ - EMFolderBrowser *emfb = data; - - em_utils_expunge_folder ((GtkWidget *) emfb, emfb->view.folder); -} - -static void -emfb_mark_all_read(BonoboUIComponent *uid, void *data, const char *path) -{ - /* FIXME: make a 'mark messages' function? */ - EMFolderView *emfv = data; - GPtrArray *uids; - int i; - - uids = camel_folder_get_uids(emfv->folder); - camel_folder_freeze(emfv->folder); - for (i=0;i<uids->len;i++) - camel_folder_set_message_flags(emfv->folder, uids->pdata[i], CAMEL_MESSAGE_SEEN, CAMEL_MESSAGE_SEEN); - camel_folder_thaw(emfv->folder); - camel_folder_free_uids(emfv->folder, uids); -} - -static void -emfb_view_hide_read(BonoboUIComponent *uid, void *data, const char *path) -{ - EMFolderView *emfv = data; - - message_list_hide_add(emfv->list, "(match-all (system-flag \"seen\"))", ML_HIDE_SAME, ML_HIDE_SAME); -} - -static void -emfb_view_hide_selected(BonoboUIComponent *uid, void *data, const char *path) -{ - EMFolderView *emfv = data; - GPtrArray *uids; - - /* TODO: perhaps this should sit directly on message_list? */ - /* is it worth it, it's so trivial */ - uids = message_list_get_selected(emfv->list); - message_list_hide_uids(emfv->list, uids); - message_list_free_uids(emfv->list, uids); -} - -static void -emfb_view_show_all(BonoboUIComponent *uid, void *data, const char *path) -{ - EMFolderView *emfv = data; - - message_list_hide_clear(emfv->list); -} - -/* ********************************************************************** */ - -static void -emfb_empty_trash(BonoboUIComponent *uid, void *data, const char *path) -{ - EMFolderView *emfv = data; - - em_utils_empty_trash ((GtkWidget *) emfv); -} - -static void -emfb_forget_passwords(BonoboUIComponent *uid, void *data, const char *path) -{ - e_passwords_forget_passwords(); -} - -static void -emfb_mail_compose(BonoboUIComponent *uid, void *data, const char *path) -{ - em_utils_compose_new_message (); -} - -static void -emfb_mail_stop(BonoboUIComponent *uid, void *data, const char *path) -{ - camel_operation_cancel(NULL); -} - -static void -emfb_mail_post(BonoboUIComponent *uid, void *data, const char *path) -{ - EMFolderView *emfv = data; - char *url; - - url = mail_tools_folder_to_url (emfv->folder); - em_utils_post_to_url (url); - g_free (url); -} - -static void -emfb_tools_filters(BonoboUIComponent *uid, void *data, const char *path) -{ - EMFolderBrowser *emfb = data; - - em_utils_edit_filters ((GtkWidget *) emfb); -} - -static void -emfb_subscribe_editor_destroy(GtkWidget *w, EMFolderBrowser *emfb) -{ - emfb->priv->subscribe_editor = NULL; -} - -static void -emfb_tools_subscriptions(BonoboUIComponent *uid, void *data, const char *path) -{ - EMFolderBrowser *emfb = data; - - if (emfb->priv->subscribe_editor) { - gdk_window_show(emfb->priv->subscribe_editor->window); - } else { - emfb->priv->subscribe_editor = (GtkWidget *)em_subscribe_editor_new(); - e_dialog_set_transient_for((GtkWindow *)emfb->priv->subscribe_editor, (GtkWidget *)emfb); - g_signal_connect(emfb->priv->subscribe_editor, "destroy", G_CALLBACK(emfb_subscribe_editor_destroy), emfb); - gtk_widget_show(emfb->priv->subscribe_editor); - } -} - -static void -emfb_tools_vfolders(BonoboUIComponent *uid, void *data, const char *path) -{ - /* FIXME: rename/refactor this */ - vfolder_edit(); -} - -static BonoboUIVerb emfb_verbs[] = { - BONOBO_UI_UNSAFE_VERB ("EditCut", emfb_edit_cut), - BONOBO_UI_UNSAFE_VERB ("EditCopy", emfb_edit_copy), - BONOBO_UI_UNSAFE_VERB ("EditPaste", emfb_edit_paste), - - BONOBO_UI_UNSAFE_VERB ("EditInvertSelection", emfb_edit_invert_selection), - BONOBO_UI_UNSAFE_VERB ("EditSelectAll", emfb_edit_select_all), - BONOBO_UI_UNSAFE_VERB ("EditSelectThread", emfb_edit_select_thread), - BONOBO_UI_UNSAFE_VERB ("ChangeFolderProperties", emfb_folder_properties), - BONOBO_UI_UNSAFE_VERB ("FolderExpunge", emfb_folder_expunge), - /* HideDeleted is a toggle */ - BONOBO_UI_UNSAFE_VERB ("MessageMarkAllAsRead", emfb_mark_all_read), - BONOBO_UI_UNSAFE_VERB ("ViewHideRead", emfb_view_hide_read), - BONOBO_UI_UNSAFE_VERB ("ViewHideSelected", emfb_view_hide_selected), - BONOBO_UI_UNSAFE_VERB ("ViewShowAll", emfb_view_show_all), - /* ViewThreaded is a toggle */ - - BONOBO_UI_UNSAFE_VERB ("EmptyTrash", emfb_empty_trash), - BONOBO_UI_UNSAFE_VERB ("ForgetPasswords", emfb_forget_passwords), - BONOBO_UI_UNSAFE_VERB ("MailCompose", emfb_mail_compose), - BONOBO_UI_UNSAFE_VERB ("MailPost", emfb_mail_post), - BONOBO_UI_UNSAFE_VERB ("MailStop", emfb_mail_stop), - BONOBO_UI_UNSAFE_VERB ("ToolsFilters", emfb_tools_filters), - BONOBO_UI_UNSAFE_VERB ("ToolsSubscriptions", emfb_tools_subscriptions), - BONOBO_UI_UNSAFE_VERB ("ToolsVFolders", emfb_tools_vfolders), - /* ViewPreview is a toggle */ - - BONOBO_UI_VERB_END -}; - -static EPixmap emfb_pixmaps[] = { - E_PIXMAP ("/commands/ChangeFolderProperties", "configure_16_folder.xpm"), - E_PIXMAP ("/commands/ViewHideRead", "hide_read_messages.xpm"), - E_PIXMAP ("/commands/ViewHideSelected", "hide_selected_messages.xpm"), - E_PIXMAP ("/commands/ViewShowAll", "show_all_messages.xpm"), - - E_PIXMAP ("/commands/MailCompose", "new-message.xpm"), - - E_PIXMAP_END -}; - -static const EMFolderViewEnable emfb_enable_map[] = { - { "EditSelectThread", EM_FOLDER_VIEW_SELECT_THREADED }, - { "ViewHideSelected", EM_POPUP_SELECT_MANY }, - { "ViewShowAll", EM_FOLDER_VIEW_SELECT_HIDDEN }, - { NULL }, -}; - -static void -emfb_hide_deleted(BonoboUIComponent *uic, const char *path, Bonobo_UIComponent_EventType type, const char *state, void *data) -{ - GConfClient *gconf; - EMFolderView *emfv = data; - - if (type != Bonobo_UIComponent_STATE_CHANGED) - return; - - gconf = mail_config_get_gconf_client (); - gconf_client_set_bool(gconf, "/apps/evolution/mail/display/show_deleted", state[0] == '0', NULL); - if (!(emfv->folder && (emfv->folder->folder_flags & CAMEL_FOLDER_IS_TRASH))) - message_list_set_hidedeleted(emfv->list, state[0] != '0'); -} - -static void -emfb_view_threaded(BonoboUIComponent *uic, const char *path, Bonobo_UIComponent_EventType type, const char *state, void *data) -{ - GConfClient *gconf; - EMFolderView *emfv = data; - - if (type != Bonobo_UIComponent_STATE_CHANGED) - return; - - gconf = mail_config_get_gconf_client (); - gconf_client_set_bool(gconf, "/apps/evolution/mail/display/thread_list", state[0] != '0', NULL); - - if (camel_object_meta_set(emfv->folder, "evolution:thread_list", state)) - camel_object_state_write(emfv->folder); - - /* FIXME: do set_threaded via meta-data listener on folder? */ - message_list_set_threaded(emfv->list, state[0] != '0'); - - /* FIXME: update selection state? */ -} - -static void -emfb_view_preview(BonoboUIComponent *uic, const char *path, Bonobo_UIComponent_EventType type, const char *state, void *data) -{ - GConfClient *gconf; - EMFolderView *emfv = data; - - if (type != Bonobo_UIComponent_STATE_CHANGED) - return; - - gconf = mail_config_get_gconf_client (); - gconf_client_set_bool(gconf, "/apps/evolution/mail/display/show_preview", state[0] != '0', NULL); - - if (camel_object_meta_set(emfv->folder, "evolution:show_preview", state)) - camel_object_state_write(emfv->folder); - - /* FIXME: do this via folder listener */ - em_folder_browser_show_preview((EMFolderBrowser *)emfv, state[0] != '0'); -} - -/* TODO: This should probably be handled by message-list, by storing/queueing - up the select operation if its busy rebuilding the message-list */ -static void -emfb_list_built(MessageList *ml, EMFolderBrowser *emfb) -{ - g_signal_handler_disconnect(ml, emfb->priv->list_built_id); - emfb->priv->list_built_id = 0; - - /* FIXME: if the 1st message in the list is unread, this will actually select the second unread msg */ - /* FIXME: this usually happens "too soon" and so the toolbar/menu-items remain desensitised even tho with the message selected they should be sensitive */ - if (((EMFolderView *)emfb)->list->cursor_uid == NULL) - message_list_select(((EMFolderView *)emfb)->list, - MESSAGE_LIST_SELECT_NEXT, 0, CAMEL_MESSAGE_SEEN, TRUE); -} - - -static void -emfb_list_display_view (GalViewInstance *instance, GalView *view, EMFolderBrowser *emfb) -{ - if (GAL_IS_VIEW_ETABLE (view)) - gal_view_etable_attach_tree (GAL_VIEW_ETABLE (view), emfb->view.list->tree); -} - -static void -collection_init (void) -{ - ETableSpecification *spec; - GalViewFactory *factory; - const char *evolution_dir; - char *dir; - - if (collection != NULL) - return; - - collection = gal_view_collection_new (); - - gal_view_collection_set_title (collection, _("Mail")); - - evolution_dir = mail_component_peek_base_directory (mail_component_peek ()); - dir = g_build_filename (evolution_dir, "mail", "views", NULL); - gal_view_collection_set_storage_directories (collection, EVOLUTION_GALVIEWSDIR "/mail/", dir); - g_free (dir); - - spec = e_table_specification_new (); - e_table_specification_load_from_file (spec, EVOLUTION_ETSPECDIR "/message-list.etspec"); - - factory = gal_view_factory_etable_new (spec); - g_object_unref (spec); - gal_view_collection_add_factory (collection, factory); - g_object_unref (factory); - - gal_view_collection_load (collection); -} - -static void -emfb_create_view_instance (EMFolderBrowser *emfb, CamelFolder *folder, const char *uri) -{ - struct _EMFolderBrowserPrivate *priv = emfb->priv; - gboolean outgoing; - char *id; - - collection_init (); - - if (priv->view_instance) { - g_object_unref (priv->view_instance); - priv->view_instance = NULL; - } - - if (folder == NULL) { - folder = emfb->view.folder; - uri = emfb->view.folder_uri; - } - - outgoing = em_utils_folder_is_drafts (folder, uri) - || em_utils_folder_is_sent (folder, uri) - || em_utils_folder_is_outbox (folder, uri); - - /* TODO: should this go through mail-config api? */ - id = mail_config_folder_to_safe_url (folder); - priv->view_instance = gal_view_instance_new (collection, id); - g_free (id); - - if (outgoing) - gal_view_instance_set_default_view (priv->view_instance, "As_Sent_Folder"); - - gal_view_instance_load (priv->view_instance); - - if (!gal_view_instance_exists (priv->view_instance)) { - struct stat st; - char *path; - - path = mail_config_folder_to_cachename (folder, "et-header-"); - if (path && stat (path, &st) == 0 && st.st_size > 0 && S_ISREG (st.st_mode)) { - ETableSpecification *spec; - ETableState *state; - GalView *view; - - spec = e_table_specification_new (); - e_table_specification_load_from_file (spec, EVOLUTION_ETSPECDIR "/message-list.etspec"); - view = gal_view_etable_new (spec, ""); - g_object_unref (spec); - - state = e_table_state_new (); - e_table_state_load_from_file (state, path); - gal_view_etable_set_state (GAL_VIEW_ETABLE (view), state); - g_object_unref (state); - - gal_view_instance_set_custom_view (priv->view_instance, view); - g_object_unref (view); - } - - g_free (path); - } - - if (priv->view_menus) - gal_view_menus_set_instance (priv->view_menus, priv->view_instance); - - g_signal_connect (priv->view_instance, "display_view", G_CALLBACK (emfb_list_display_view), emfb); - emfb_list_display_view (priv->view_instance, gal_view_instance_get_current_view (priv->view_instance), emfb); -} - -static void -emfb_set_folder(EMFolderView *emfv, CamelFolder *folder, const char *uri) -{ - /* This is required since we get activated the first time - before the folder is open and need to override the - defaults */ - if (folder) { - char *sstate; - - if ((sstate = camel_object_meta_get(folder, "evolution:show_preview"))) - em_folder_browser_show_preview((EMFolderBrowser *)emfv, sstate[0] != '0'); - - if ((sstate = camel_object_meta_get(folder, "evolution:thread_list"))) - message_list_set_threaded(emfv->list, sstate[0] != '0'); - -#if 0 - if (emfv->list->cursor_uid == NULL && ((EMFolderBrowser *)emfv)->priv->list_built_id == 0) - ((EMFolderBrowser *)emfv)->priv->list_built_id = - g_signal_connect(emfv->list, "message_list_built", G_CALLBACK(emfb_list_built), emfv); -#endif - - emfb_create_view_instance ((EMFolderBrowser *) emfv, folder, uri); - } - - emfb_parent->set_folder(emfv, folder, uri); -} - -/* TODO: All this mess should sit directly on MessageList, but it would - need to become BonoboUIComponent aware ... */ - -static void -emfb_create_view_menus(EMFolderBrowser *emfb, BonoboUIComponent *uic) -{ - struct _EMFolderBrowserPrivate *p = emfb->priv; - - g_assert(p->view_instance == NULL); - g_assert(p->view_menus == NULL); - - collection_init (); - - emfb_create_view_instance (emfb, emfb->view.folder, emfb->view.folder_uri); - p->view_menus = gal_view_menus_new (p->view_instance); - gal_view_menus_apply(p->view_menus, uic, NULL); - - /* Due to CORBA reentrancy, the view could be gone now. */ - if (p->view_instance == NULL) - return; - - g_signal_connect(p->view_instance, "display_view", G_CALLBACK(emfb_list_display_view), emfb); - emfb_list_display_view(p->view_instance, gal_view_instance_get_current_view(p->view_instance), emfb); -} - -static void -emfb_activate(EMFolderView *emfv, BonoboUIComponent *uic, int act) -{ - struct _EMFolderBrowserPrivate *p = ((EMFolderBrowser *)emfv)->priv; - - if (act) { - GConfClient *gconf; - gboolean state; - char *sstate; - - gconf = mail_config_get_gconf_client (); - - /* parent loads all ui files via ui_files */ - emfb_parent->activate(emfv, uic, act); - - bonobo_ui_component_add_verb_list_with_data(uic, emfb_verbs, emfv); - e_pixmaps_update(uic, emfb_pixmaps); - -#if 0 - /* FIXME: finish */ - /* (Pre)view pane size (do this first because it affects the - preview settings - see folder_browser_set_message_preview() - internals for details) */ - g_signal_handler_block(emfb->vpane, emfb->priv->vpane_resize_id); - gtk_paned_set_position((GtkPaned *)emfb->vpane, gconf_client_get_int (gconf, "/apps/evolution/mail/display/paned_size", NULL)); - g_signal_handler_unblock(emfb->vpane, emfb->priv->vpane_resize_id); -#endif - - /* (Pre)view toggle */ - if (emfv->folder - && (sstate = camel_object_meta_get(emfv->folder, "evolution:show_preview"))) { - state = sstate[0] == '1'; - g_free(sstate); - } else { - state = gconf_client_get_bool(gconf, "/apps/evolution/mail/display/show_preview", NULL); - } - - bonobo_ui_component_set_prop(uic, "/commands/ViewPreview", "state", state?"1":"0", NULL); - em_folder_browser_show_preview((EMFolderBrowser *)emfv, state); - bonobo_ui_component_add_listener(uic, "ViewPreview", emfb_view_preview, emfv); - - /* Stop button */ - state = mail_msg_active((unsigned int)-1); - bonobo_ui_component_set_prop(uic, "/commands/MailStop", "sensitive", state?"1":"0", NULL); - - /* HideDeleted */ - state = !gconf_client_get_bool(gconf, "/apps/evolution/mail/display/show_deleted", NULL); - bonobo_ui_component_set_prop(uic, "/commands/HideDeleted", "state", state ? "1" : "0", NULL); - bonobo_ui_component_add_listener(uic, "HideDeleted", emfb_hide_deleted, emfv); - if (!(emfv->folder && (emfv->folder->folder_flags & CAMEL_FOLDER_IS_TRASH))) - message_list_set_hidedeleted (emfv->list, state); - else - bonobo_ui_component_set_prop(uic, "/commands/HideDeleted", "sensitive", state?"1":"0", NULL); - - /* FIXME: If we have no folder, we can't do a few of the lookups we need, - perhaps we should postpone till we can */ - - /* ViewThreaded */ - if (emfv->folder - && (sstate = camel_object_meta_get(emfv->folder, "evolution:thread_list"))) { - state = sstate[0] == '1'; - g_free(sstate); - } else { - state = gconf_client_get_bool(gconf, "/apps/evolution/mail/display/thread_list", NULL); - } - - bonobo_ui_component_set_prop(uic, "/commands/ViewThreaded", "state", state?"1":"0", NULL); - bonobo_ui_component_add_listener(uic, "ViewThreaded", emfb_view_threaded, emfv); - message_list_set_threaded(emfv->list, state); - - /* FIXME: Selection state */ - - /* FIXME: property menu customisation */ - /*folder_browser_setup_property_menu (fb, fb->uicomp);*/ - - if (((EMFolderBrowser *)emfv)->search) - e_search_bar_set_ui_component((ESearchBar *)((EMFolderBrowser *)emfv)->search, uic); - - if (emfv->folder) - emfb_create_view_menus((EMFolderBrowser *)emfv, uic); - } else { - const BonoboUIVerb *v; - - for (v = &emfb_verbs[0]; v->cname; v++) - bonobo_ui_component_remove_verb(uic, v->cname); - - if (p->view_instance) { - g_object_unref(p->view_instance); - p->view_instance = NULL; - g_object_unref(p->view_menus); - p->view_menus = NULL; - } - - if (((EMFolderBrowser *)emfv)->search) - e_search_bar_set_ui_component((ESearchBar *)((EMFolderBrowser *)emfv)->search, NULL); - - emfb_parent->activate(emfv, uic, act); - } -} diff --git a/mail/em-folder-browser.h b/mail/em-folder-browser.h deleted file mode 100644 index 248deaf9b4..0000000000 --- a/mail/em-folder-browser.h +++ /dev/null @@ -1,60 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Authors: Michael Zucchi <notzed@ximian.com> - * - * Copyright 2003 Ximian, Inc. (www.ximian.com) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA. - * - */ - - -#ifndef _EM_FOLDER_BROWSER_H -#define _EM_FOLDER_BROWSER_H - -#include "em-folder-view.h" - -#ifdef __cplusplus -extern "C" { -#pragma } -#endif /* __cplusplus */ - -typedef struct _EMFolderBrowser EMFolderBrowser; -typedef struct _EMFolderBrowserClass EMFolderBrowserClass; - -struct _EMFolderBrowser { - EMFolderView view; - - struct _EMFolderBrowserPrivate *priv; - - GtkWidget *vpane; - struct _EFilterBar *search; -}; - -struct _EMFolderBrowserClass { - EMFolderViewClass parent_class; -}; - -GType em_folder_browser_get_type(void); - -GtkWidget *em_folder_browser_new(void); - -void em_folder_browser_show_preview(EMFolderBrowser *emfv, gboolean state); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* ! _EM_FOLDER_BROWSER_H */ diff --git a/mail/em-folder-selection-button.c b/mail/em-folder-selection-button.c deleted file mode 100644 index 5187e8d324..0000000000 --- a/mail/em-folder-selection-button.c +++ /dev/null @@ -1,255 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Authors: Jeffrey Stedfast <fejj@ximian.com> - * - * Copyright 2003 Ximian, Inc. (www.ximian.com) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA. - * - */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <string.h> - -#include <gtk/gtkimage.h> -#include <gtk/gtklabel.h> -#include <gtk/gtkhbox.h> - -#include <gal/util/e-util.h> - -#include "mail-component.h" -#include "em-folder-tree.h" -#include "em-folder-selector.h" - -#include "em-folder-selection-button.h" - -static void em_folder_selection_button_class_init (EMFolderSelectionButtonClass *klass); -static void em_folder_selection_button_init (EMFolderSelectionButton *emfsb); -static void em_folder_selection_button_destroy (GtkObject *obj); -static void em_folder_selection_button_finalize (GObject *obj); -static void em_folder_selection_button_clicked (GtkButton *button); - -static GtkButtonClass *parent_class = NULL; - -struct _EMFolderSelectionButtonPrivate { - GtkWidget *icon; - GtkWidget *label; - - char *uri; - - char *title; - char *caption; -}; - -enum { - SELECTED, - LAST_SIGNAL -}; - -static guint signals[LAST_SIGNAL] = { 0 }; - -GType -em_folder_selection_button_get_type (void) -{ - static GType type = 0; - - if (!type) { - static const GTypeInfo info = { - sizeof (EMFolderSelectionButtonClass), - NULL, /* base_class_init */ - NULL, /* base_class_finalize */ - (GClassInitFunc) em_folder_selection_button_class_init, - NULL, /* class_finalize */ - NULL, /* class_data */ - sizeof (EMFolderSelectionButton), - 0, /* n_preallocs */ - (GInstanceInitFunc) em_folder_selection_button_init, - }; - - type = g_type_register_static (GTK_TYPE_BUTTON, "EMFolderSelectionButton", &info, 0); - } - - return type; -} - -static void -em_folder_selection_button_class_init (EMFolderSelectionButtonClass *klass) -{ - GObjectClass *object_class = G_OBJECT_CLASS (klass); - GtkObjectClass *gtk_object_class = GTK_OBJECT_CLASS (klass); - GtkButtonClass *button_class = GTK_BUTTON_CLASS (klass); - - parent_class = g_type_class_ref (GTK_TYPE_BUTTON); - - object_class->finalize = em_folder_selection_button_finalize; - gtk_object_class->destroy = em_folder_selection_button_destroy; - button_class->clicked = em_folder_selection_button_clicked; - - signals[SELECTED] = g_signal_new ("selected", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET (EMFolderSelectionButtonClass, selected), - NULL, NULL, - g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, 0); -} - -static void -set_contents_unselected (EMFolderSelectionButton *button) -{ - gtk_image_set_from_pixbuf (GTK_IMAGE (button->priv->icon), NULL); - gtk_label_set_text (GTK_LABEL (button->priv->label), _("<click here to select a folder>")); -} - -static void -set_contents (EMFolderSelectionButton *button) -{ - struct _EMFolderSelectionButtonPrivate *priv = button->priv; - const char *folder_name; - CamelURL *url; - - if (priv->uri == NULL - || (url = camel_url_new (priv->uri, NULL)) == NULL) { - set_contents_unselected (button); - return; - } - - folder_name = url->fragment ? url->fragment : url->path + 1; - - if (folder_name == NULL) { - camel_url_free (url); - set_contents_unselected (button); - return; - } - - gtk_label_set_text (GTK_LABEL (priv->label), folder_name); - camel_url_free (url); -} - -static void -em_folder_selection_button_init (EMFolderSelectionButton *emfsb) -{ - struct _EMFolderSelectionButtonPrivate *priv; - GtkWidget *box; - - priv = g_new0 (struct _EMFolderSelectionButtonPrivate, 1); - emfsb->priv = priv; - - box = gtk_hbox_new (FALSE, 4); - - priv->icon = gtk_image_new (); - gtk_widget_show (priv->icon); - gtk_box_pack_start (GTK_BOX (box), priv->icon, FALSE, TRUE, 0); - - priv->label = gtk_label_new (""); - gtk_widget_show (priv->label); - gtk_label_set_justify (GTK_LABEL (priv->label), GTK_JUSTIFY_LEFT); - gtk_misc_set_alignment (GTK_MISC (priv->label), 0.0, 0.0); - gtk_box_pack_start (GTK_BOX (box), priv->label, TRUE, TRUE, 0); - - gtk_widget_show (box); - gtk_container_add (GTK_CONTAINER (emfsb), box); - - set_contents (emfsb); -} - -static void -em_folder_selection_button_destroy (GtkObject *obj) -{ - GTK_OBJECT_CLASS (parent_class)->destroy (obj); -} - -static void -em_folder_selection_button_finalize (GObject *obj) -{ - struct _EMFolderSelectionButtonPrivate *priv = ((EMFolderSelectionButton *) obj)->priv; - - g_free (priv->title); - g_free (priv->caption); - g_free (priv->uri); - g_free (priv); - - G_OBJECT_CLASS (parent_class)->finalize (obj); -} - -static void -emfsb_selector_response (EMFolderSelector *emfs, int response, EMFolderSelectionButton *button) -{ - if (response == GTK_RESPONSE_OK) { - const char *uri = em_folder_selector_get_selected_uri (emfs); - - em_folder_selection_button_set_selection (button, uri); - g_signal_emit (button, signals[SELECTED], 0); - } - - gtk_widget_destroy ((GtkWidget *) emfs); -} - -static void -em_folder_selection_button_clicked (GtkButton *button) -{ - struct _EMFolderSelectionButtonPrivate *priv = EM_FOLDER_SELECTION_BUTTON (button)->priv; - EMFolderTreeModel *model; - EMFolderTree *emft; - GtkWidget *dialog; - - if (GTK_BUTTON_CLASS (parent_class)->clicked != NULL) - (* GTK_BUTTON_CLASS (parent_class)->clicked) (button); - - model = mail_component_get_tree_model (mail_component_peek ()); - emft = (EMFolderTree *) em_folder_tree_new_with_model (model); - - dialog = em_folder_selector_new (emft, EM_FOLDER_SELECTOR_CAN_CREATE, priv->title, priv->caption); - em_folder_selector_set_selected ((EMFolderSelector *) dialog, priv->uri); - g_signal_connect (dialog, "response", G_CALLBACK (emfsb_selector_response), button); - gtk_widget_show (dialog); -} - -GtkWidget * -em_folder_selection_button_new (const char *title, const char *caption) -{ - EMFolderSelectionButton *button = g_object_new (EM_TYPE_FOLDER_SELECTION_BUTTON, NULL); - - button->priv->title = g_strdup (title); - button->priv->caption = g_strdup (caption); - - return GTK_WIDGET (button); -} - -void -em_folder_selection_button_set_selection (EMFolderSelectionButton *button, const char *uri) -{ - struct _EMFolderSelectionButtonPrivate *priv = button->priv; - - g_return_if_fail (EM_IS_FOLDER_SELECTION_BUTTON (button)); - - if (priv->uri != uri) { - g_free (priv->uri); - priv->uri = g_strdup (uri); - } - - set_contents (button); -} - -const char * -em_folder_selection_button_get_selection (EMFolderSelectionButton *button) -{ - g_return_val_if_fail (EM_IS_FOLDER_SELECTION_BUTTON (button), NULL); - - return button->priv->uri; -} diff --git a/mail/em-folder-selection-button.h b/mail/em-folder-selection-button.h deleted file mode 100644 index b8f64a4383..0000000000 --- a/mail/em-folder-selection-button.h +++ /dev/null @@ -1,69 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Authors: Jeffrey Stedfast <fejj@ximian.com> - * - * Copyright 2003 Ximian, Inc. (www.ximian.com) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA. - * - */ - - -#ifndef __EM_FOLDER_SELECTION_BUTTON_H__ -#define __EM_FOLDER_SELECTION_BUTTON_H__ - -#include <gtk/gtkbutton.h> - -#ifdef __cplusplus -extern "C" { -#pragma } -#endif /* __cplusplus */ - -#define EM_TYPE_FOLDER_SELECTION_BUTTON (em_folder_selection_button_get_type ()) -#define EM_FOLDER_SELECTION_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EM_TYPE_FOLDER_SELECTION_BUTTON, EMFolderSelectionButton)) -#define EM_FOLDER_SELECTION_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EM_TYPE_FOLDER_SELECTION_BUTTON, EMFolderSelectionButtonClass)) -#define EM_IS_FOLDER_SELECTION_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EM_TYPE_FOLDER_SELECTION_BUTTON)) -#define EM_IS_FOLDER_SELECTION_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), EM_TYPE_FOLDER_SELECTION_BUTTON)) - -typedef struct _EMFolderSelectionButton EMFolderSelectionButton; -typedef struct _EMFolderSelectionButtonClass EMFolderSelectionButtonClass; - -struct _EMFolderSelectionButton { - GtkButton parent; - - struct _EMFolderSelectionButtonPrivate *priv; -}; - -struct _EMFolderSelectionButtonClass { - GtkButtonClass parent_class; - - /* Signals. */ - - void (* selected) (EMFolderSelectionButton *button); -}; - - -GType em_folder_selection_button_get_type (void); - -GtkWidget *em_folder_selection_button_new (const char *title, const char *caption); - -void em_folder_selection_button_set_selection (EMFolderSelectionButton *button, const char *uri); -const char *em_folder_selection_button_get_selection (EMFolderSelectionButton *button); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __EM_FOLDER_SELECTION_BUTTON_H__ */ diff --git a/mail/em-folder-selection.c b/mail/em-folder-selection.c deleted file mode 100644 index 4a73623529..0000000000 --- a/mail/em-folder-selection.c +++ /dev/null @@ -1,218 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Authors: Jeffrey Stedfast <fejj@ximian.com> - * - * Copyright 2003 Ximian, Inc. (www.ximian.com) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA. - * - */ - - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <string.h> - -#include <gtk/gtkdialog.h> -#include <gtk/gtkstock.h> - -#include "em-folder-tree.h" -#include "em-folder-selection.h" - -#include "mail-component.h" -#include "mail-tools.h" - - -static void -folder_selected_cb (EMFolderTree *emft, const char *path, const char *uri, GtkDialog *dialog) -{ - if (!path || !strcmp (path, "/")) - gtk_dialog_set_response_sensitive (dialog, GTK_RESPONSE_OK, FALSE); - else - gtk_dialog_set_response_sensitive (dialog, GTK_RESPONSE_OK, TRUE); -} - -static GtkWidget * -create_dialog (GtkWindow *parent, EMFolderTree *emft, const char *title, const char *default_uri, gboolean allow_create) -{ - GtkWidget *dialog; - - dialog = gtk_dialog_new (); - - if (parent) - gtk_window_set_transient_for ((GtkWindow *) dialog, parent); - - gtk_window_set_default_size (GTK_WINDOW (dialog), 350, 300); - gtk_window_set_modal (GTK_WINDOW (dialog), TRUE); - gtk_window_set_title (GTK_WINDOW (dialog), title); - gtk_container_set_border_width (GTK_CONTAINER (dialog), 6); - gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), 6); - gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (dialog)->vbox), 6); - - if (allow_create) - gtk_dialog_add_buttons (GTK_DIALOG (dialog), GTK_STOCK_NEW, GTK_RESPONSE_APPLY, NULL); - - gtk_dialog_add_buttons (GTK_DIALOG (dialog), - GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, - GTK_STOCK_OK, GTK_RESPONSE_OK, - NULL); - - if (default_uri == NULL) - gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog), GTK_RESPONSE_OK, FALSE); - else - em_folder_tree_set_selected (emft, default_uri); - - gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK); - - gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), GTK_WIDGET (emft), TRUE, TRUE, 6); - - g_signal_connect (emft, "folder-selected", G_CALLBACK (folder_selected_cb), dialog); - - return dialog; -} - -CamelFolder * -em_folder_selection_run_dialog (GtkWindow *parent_window, const char *title, CamelFolder *default_folder) -{ - CamelFolder *selected_folder; - EMFolderTreeModel *model; - GtkWidget *dialog; - GtkWidget *emft; - const char *uri; - int response; - - model = mail_component_get_tree_model (mail_component_peek ()); - emft = em_folder_tree_new_with_model (model); - gtk_widget_show (emft); - - if (default_folder) { - char *default_uri; - - default_uri = mail_tools_folder_to_url (default_folder); - dialog = create_dialog (parent_window, (EMFolderTree *) emft, title, default_uri, FALSE); - g_free (default_uri); - } else { - dialog = create_dialog (parent_window, (EMFolderTree *) emft, title, NULL, FALSE); - } - - response = gtk_dialog_run (GTK_DIALOG (dialog)); - - if (response != GTK_RESPONSE_OK) { - gtk_widget_destroy (dialog); - return NULL; - } - - if (!(uri = em_folder_tree_get_selected_uri ((EMFolderTree *) emft))) { - gtk_widget_destroy (dialog); - return NULL; - } - - selected_folder = mail_tool_uri_to_folder (uri, 0, NULL); - gtk_widget_destroy (dialog); - - return selected_folder; -} - -/* FIXME: This isn't the way to do it, but then neither is the above, really ... */ -char * -em_folder_selection_run_dialog_uri (GtkWindow *parent_window, const char *title, const char *default_uri) -{ - EMFolderTreeModel *model; - GtkWidget *dialog; - GtkWidget *emft; - const char *uri; - int response; - char *ret; - - model = mail_component_get_tree_model (mail_component_peek ()); - emft = em_folder_tree_new_with_model (model); - gtk_widget_show (emft); - - if (default_uri) - dialog = create_dialog (parent_window, (EMFolderTree *) emft, title, default_uri, FALSE); - else - dialog = create_dialog (parent_window, (EMFolderTree *) emft, title, NULL, FALSE); - - response = gtk_dialog_run (GTK_DIALOG (dialog)); - - if (response != GTK_RESPONSE_OK) { - gtk_widget_destroy (dialog); - return NULL; - } - - if (!(uri = em_folder_tree_get_selected_uri ((EMFolderTree *) emft))) { - gtk_widget_destroy (dialog); - return NULL; - } - - ret = g_strdup (uri); - gtk_widget_destroy (dialog); - - return ret; -} - - -struct _select_folder_data { - void (*done) (const char *uri, void *data); - void *data; -}; - -static void -emfs_response (GtkWidget *dialog, int response, struct _select_folder_data *d) -{ - EMFolderTree *emft = g_object_get_data ((GObject *) dialog, "emft"); - const char *uri; - - gtk_widget_hide (dialog); - - if (response == GTK_RESPONSE_OK) { - uri = em_folder_tree_get_selected_uri (emft); - d->done (uri, d->data); - } - - gtk_widget_destroy (dialog); -} - -void -em_select_folder (GtkWindow *parent_window, const char *title, const char *default_uri, - void (*done) (const char *uri, void *user_data), void *user_data) -{ - struct _select_folder_data *d; - EMFolderTreeModel *model; - GtkWidget *dialog; - GtkWidget *emft; - - model = mail_component_get_tree_model (mail_component_peek ()); - emft = em_folder_tree_new_with_model (model); - gtk_widget_show (emft); - - if (default_uri) - dialog = create_dialog (parent_window, (EMFolderTree *) emft, title, default_uri, FALSE); - else - dialog = create_dialog (parent_window, (EMFolderTree *) emft, title, NULL, FALSE); - - d = g_malloc0 (sizeof (*d)); - d->data = user_data; - d->done = done; - - /* ugh, painful api ... */ - g_object_set_data ((GObject *) dialog, "emft", emft); - g_object_set_data_full ((GObject *) dialog, "emfs_data", d, g_free); - g_signal_connect (dialog, "response", G_CALLBACK (emfs_response), d); - - gtk_widget_show (dialog); -} diff --git a/mail/em-folder-selection.h b/mail/em-folder-selection.h deleted file mode 100644 index cbcbc20826..0000000000 --- a/mail/em-folder-selection.h +++ /dev/null @@ -1,51 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Authors: Jeffrey Stedfast <fejj@ximian.com> - * - * Copyright 2003 Ximian, Inc. (www.ximian.com) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA. - * - */ - - -#ifndef EM_FOLDER_SELECTION_H -#define EM_FOLDER_SELECTION_H - -#ifdef __cplusplus -extern "C" { -#pragma } -#endif /* __cplusplus */ - -#include <gtk/gtkwindow.h> -#include <camel/camel-folder.h> - -CamelFolder *em_folder_selection_run_dialog (GtkWindow *parent_window, - const char *title, - CamelFolder *default_folder); - -char *em_folder_selection_run_dialog_uri (GtkWindow *parent_window, - const char *title, - const char *default_uri); - -void em_select_folder (GtkWindow *parent_window, const char *title, const char *default_uri, - void (*done)(const char *uri, void *data), - void *data); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* EM_FOLDER_SELECTION_H */ diff --git a/mail/em-folder-selector.c b/mail/em-folder-selector.c deleted file mode 100644 index 5e2697ddf8..0000000000 --- a/mail/em-folder-selector.c +++ /dev/null @@ -1,362 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Authors: Jeffrey Stedfast <fejj@ximian.com> - * - * Copyright 2003 Ximian, Inc. (www.ximian.com) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA. - * - */ - - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <string.h> - -#include <libgnome/gnome-i18n.h> - -#include <gal/util/e-util.h> -#include <gal/widgets/e-gui-utils.h> - -#include <gtk/gtkentry.h> -#include <gtk/gtkbox.h> -#include <gtk/gtkhbox.h> -#include <gtk/gtklabel.h> -#include <gtk/gtkscrolledwindow.h> -#include <gtk/gtksignal.h> -#include <gtk/gtkstock.h> - -#include <camel/camel-url.h> -#include <camel/camel-store.h> -#include <camel/camel-session.h> - -#include "em-folder-tree.h" -#include "em-folder-selector.h" - -#define d(x) x - - -extern CamelSession *session; - - -static void em_folder_selector_class_init (EMFolderSelectorClass *klass); -static void em_folder_selector_init (EMFolderSelector *emfs); -static void em_folder_selector_destroy (GtkObject *obj); -static void em_folder_selector_finalize (GObject *obj); - - -static GtkDialogClass *parent_class = NULL; - - -GType -em_folder_selector_get_type (void) -{ - static GType type = 0; - - if (!type) { - static const GTypeInfo info = { - sizeof (EMFolderSelectorClass), - NULL, /* base_class_init */ - NULL, /* base_class_finalize */ - (GClassInitFunc) em_folder_selector_class_init, - NULL, /* class_finalize */ - NULL, /* class_data */ - sizeof (EMFolderSelector), - 0, /* n_preallocs */ - (GInstanceInitFunc) em_folder_selector_init, - }; - - type = g_type_register_static (GTK_TYPE_DIALOG, "EMFolderSelector", &info, 0); - } - - return type; -} - -static void -em_folder_selector_class_init (EMFolderSelectorClass *klass) -{ - GObjectClass *object_class = G_OBJECT_CLASS (klass); - GtkObjectClass *gtk_object_class = GTK_OBJECT_CLASS (klass); - - parent_class = g_type_class_ref (GTK_TYPE_DIALOG); - - object_class->finalize = em_folder_selector_finalize; - gtk_object_class->destroy = em_folder_selector_destroy; -} - -static void -em_folder_selector_init (EMFolderSelector *emfs) -{ - emfs->selected_path = NULL; - emfs->selected_uri = NULL; -} - -static void -em_folder_selector_destroy (GtkObject *obj) -{ - GTK_OBJECT_CLASS (parent_class)->destroy (obj); -} - -static void -em_folder_selector_finalize (GObject *obj) -{ - EMFolderSelector *emfs = (EMFolderSelector *) obj; - - g_free (emfs->selected_path); - g_free (emfs->selected_uri); - - G_OBJECT_CLASS (parent_class)->finalize (obj); -} - -static void -emfs_response (GtkWidget *dialog, int response, EMFolderSelector *emfs) -{ - EMFolderTreeModel *model; - const char *path, *uri; - EMFolderTree *emft; - - if (response != EM_FOLDER_SELECTOR_RESPONSE_NEW) - return; - - model = em_folder_tree_get_model (emfs->emft); - emft = (EMFolderTree *) em_folder_tree_new_with_model (model); - dialog = em_folder_selector_create_new (emft, 0, _("Create New Folder"), _("Specify where to create the folder:")); - gtk_window_set_transient_for ((GtkWindow *) dialog, (GtkWindow *) emfs); - - if (gtk_dialog_run ((GtkDialog *) dialog) == GTK_RESPONSE_OK) { - uri = em_folder_selector_get_selected_uri ((EMFolderSelector *) dialog); - path = em_folder_selector_get_selected_path ((EMFolderSelector *) dialog); - - if (em_folder_tree_create_folder (emfs->emft, path, uri)) - em_folder_tree_set_selected (emfs->emft, uri); - } - - gtk_widget_destroy (dialog); - - g_signal_stop_emission_by_name (emfs, "response"); -} - -static void -emfs_create_name_changed (GtkEntry *entry, EMFolderSelector *emfs) -{ - const char *path, *text = NULL; - gboolean active; - - if (emfs->name_entry->text_length > 0) - text = gtk_entry_get_text (emfs->name_entry); - - path = em_folder_tree_get_selected_path (emfs->emft); - - active = text && path && !strchr (text, '/'); - - gtk_dialog_set_response_sensitive ((GtkDialog *) emfs, GTK_RESPONSE_OK, active); -} - -static void -folder_selected_cb (EMFolderTree *emft, const char *path, const char *uri, EMFolderSelector *emfs) -{ - if (emfs->name_entry) - emfs_create_name_changed (emfs->name_entry, emfs); - else - gtk_dialog_set_response_sensitive (GTK_DIALOG (emfs), GTK_RESPONSE_OK, TRUE); -} - -void -em_folder_selector_construct (EMFolderSelector *emfs, EMFolderTree *emft, guint32 flags, const char *title, const char *text) -{ - GtkWidget *scrolled_window; - GtkWidget *label; - - gtk_window_set_default_size (GTK_WINDOW (emfs), 350, 300); - gtk_window_set_modal (GTK_WINDOW (emfs), TRUE); - gtk_window_set_title (GTK_WINDOW (emfs), title); - gtk_container_set_border_width (GTK_CONTAINER (emfs), 6); - - gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (emfs)->vbox), 6); - gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (emfs)->vbox), 6); - - emfs->flags = flags; - if (flags & EM_FOLDER_SELECTOR_CAN_CREATE) { - gtk_dialog_add_button (GTK_DIALOG (emfs), GTK_STOCK_NEW, EM_FOLDER_SELECTOR_RESPONSE_NEW); - g_signal_connect (emfs, "response", G_CALLBACK (emfs_response), emfs); - } - - gtk_dialog_add_buttons (GTK_DIALOG (emfs), GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, - GTK_STOCK_OK, GTK_RESPONSE_OK, NULL); - - gtk_dialog_set_response_sensitive (GTK_DIALOG (emfs), GTK_RESPONSE_OK, FALSE); - gtk_dialog_set_default_response (GTK_DIALOG (emfs), GTK_RESPONSE_OK); - - emfs->emft = emft; - gtk_widget_show ((GtkWidget *) emft); - - g_signal_connect (emfs->emft, "folder-selected", G_CALLBACK (folder_selected_cb), emfs); - - scrolled_window = gtk_scrolled_window_new (NULL, NULL); - gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_window), GTK_SHADOW_IN); - gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window), - GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); - gtk_widget_show (scrolled_window); - - gtk_container_add (GTK_CONTAINER (scrolled_window), (GtkWidget *) emft); - - gtk_box_pack_end (GTK_BOX (GTK_DIALOG (emfs)->vbox), scrolled_window, TRUE, TRUE, 6); - - if (text != NULL) { - label = gtk_label_new (text); - gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT); - gtk_widget_show (label); - - gtk_box_pack_end (GTK_BOX (GTK_DIALOG (emfs)->vbox), label, FALSE, TRUE, 6); - } - - GTK_WIDGET_SET_FLAGS ((GtkWidget *) emfs->emft, GTK_CAN_FOCUS); - gtk_widget_grab_focus ((GtkWidget *) emfs->emft); -} - -GtkWidget * -em_folder_selector_new (EMFolderTree *emft, guint32 flags, const char *title, const char *text) -{ - EMFolderSelector *emfs; - - emfs = g_object_new (em_folder_selector_get_type (), NULL); - em_folder_selector_construct (emfs, emft, flags, title, text); - - return (GtkWidget *) emfs; -} - - -static void -emfs_create_name_activate (GtkEntry *entry, EMFolderSelector *emfs) -{ - g_signal_emit_by_name (emfs, "response", GTK_RESPONSE_OK); -} - -GtkWidget * -em_folder_selector_create_new (EMFolderTree *emft, guint32 flags, const char *title, const char *text) -{ - EMFolderSelector *emfs; - GtkWidget *hbox, *w; - - /* remove the CREATE flag if it is there since that's the - * whole purpose of this dialog */ - flags &= ~EM_FOLDER_SELECTOR_CAN_CREATE; - - emfs = g_object_new (em_folder_selector_get_type (), NULL); - em_folder_selector_construct (emfs, emft, flags, title, text); - - hbox = gtk_hbox_new (FALSE, 0); - w = gtk_label_new_with_mnemonic (_("Folder _name:")); - gtk_box_pack_start ((GtkBox *) hbox, w, FALSE, FALSE, 6); - emfs->name_entry = (GtkEntry *) gtk_entry_new (); - g_signal_connect (emfs->name_entry, "changed", G_CALLBACK (emfs_create_name_changed), emfs); - g_signal_connect (emfs->name_entry, "activate", G_CALLBACK (emfs_create_name_activate), emfs); - gtk_box_pack_start ((GtkBox *) hbox, (GtkWidget *) emfs->name_entry, TRUE, FALSE, 6); - gtk_widget_show_all (hbox); - - gtk_box_pack_start ((GtkBox *) ((GtkDialog *) emfs)->vbox, hbox, FALSE, TRUE, 0); - - return (GtkWidget *) emfs; -} - - -void -em_folder_selector_set_selected (EMFolderSelector *emfs, const char *uri) -{ - em_folder_tree_set_selected (emfs->emft, uri); -} - - -const char * -em_folder_selector_get_selected_uri (EMFolderSelector *emfs) -{ - const char *uri, *name; - - if (!(uri = em_folder_tree_get_selected_uri (emfs->emft))) { - d(printf ("no selected folder?\n")); - return NULL; - } - - if (uri && emfs->name_entry) { - CamelProvider *provider; - CamelException ex; - CamelURL *url; - char *newpath; - - camel_exception_init (&ex); - provider = camel_session_get_provider (session, uri, &ex); - camel_exception_clear (&ex); - - name = gtk_entry_get_text (emfs->name_entry); - - url = camel_url_new (uri, NULL); - if (provider && (provider->url_flags & CAMEL_URL_FRAGMENT_IS_PATH)) { - if (url->fragment) - newpath = g_strdup_printf ("%s/%s", url->fragment, name); - else - newpath = g_strdup (name); - - camel_url_set_fragment (url, newpath); - } else { - newpath = g_strdup_printf ("%s/%s", url->path ? url->path : "", name); - camel_url_set_path (url, newpath); - } - - g_free (emfs->selected_path); - emfs->selected_path = newpath; - - g_free (emfs->selected_uri); - emfs->selected_uri = camel_url_to_string (url, 0); - - camel_url_free (url); - uri = emfs->selected_uri; - } - - return uri; -} - - -const char * -em_folder_selector_get_selected_path (EMFolderSelector *emfs) -{ - const char *path; - - if (emfs->selected_path) { - /* already did the work in a previous call */ - return emfs->selected_path; - } - - if (!(path = em_folder_tree_get_selected_path (emfs->emft))) { - d(printf ("no selected folder?\n")); - return NULL; - } - - if (path && emfs->name_entry) { - const char *name; - char *newpath; - - name = gtk_entry_get_text (emfs->name_entry); - if (strcmp (path, "/") != 0) - newpath = g_strdup_printf ("%s/%s", path, name); - else - newpath = g_strdup_printf ("/%s", name); - - path = emfs->selected_path = newpath; - } - - return path; -} diff --git a/mail/em-folder-selector.h b/mail/em-folder-selector.h deleted file mode 100644 index d9d4a172ce..0000000000 --- a/mail/em-folder-selector.h +++ /dev/null @@ -1,88 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Authors: Jeffrey Stedfast <fejj@ximian.com> - * - * Copyright 2003 Ximian, Inc. (www.ximian.com) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA. - * - */ - - -#ifndef EM_FOLDER_SELECTOR_H -#define EM_FOLDER_SELECTOR_H - -#include <gtk/gtkdialog.h> - -#ifdef cplusplus -extern "C" { -#pragma } -#endif /* cplusplus */ - -#define EM_TYPE_FOLDER_SELECTOR (em_folder_selector_get_type ()) -#define EM_FOLDER_SELECTOR(obj) (GTK_CHECK_CAST ((obj), E_TYPEM_FOLDER_SELECTOR, EMFolderSelector)) -#define EM_FOLDER_SELECTOR_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), E_TYPEM_FOLDER_SELECTOR, EMFolderSelectorClass)) -#define EM_IS_FOLDER_SELECTOR(obj) (GTK_CHECK_TYPE ((obj), E_TYPEM_FOLDER_SELECTOR)) -#define EM_IS_FOLDER_SELECTOR_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((obj), E_TYPEM_FOLDER_SELECTOR)) - -typedef struct _EMFolderSelector EMFolderSelector; -typedef struct _EMFolderSelectorPrivate EMFolderSelectorPrivate; -typedef struct _EMFolderSelectorClass EMFolderSelectorClass; - -struct _EMFolderSelector { - GtkDialog parent; - - guint32 flags; - struct _EMFolderTree *emft; - - struct _GtkEntry *name_entry; - char *selected_path; - char *selected_uri; -}; - -struct _EMFolderSelectorClass { - GtkDialogClass parent_class; - -}; - -enum { - EM_FOLDER_SELECTOR_CAN_CREATE = 1, -}; - -enum { - EM_FOLDER_SELECTOR_RESPONSE_NEW = -5, -}; - - -GType em_folder_selector_get_type (void); - -void em_folder_selector_construct (EMFolderSelector *emfs, struct _EMFolderTree *emft, guint32 flags, const char *title, const char *text); - -/* for selecting folders */ -GtkWidget *em_folder_selector_new (struct _EMFolderTree *emft, guint32 flags, const char *title, const char *text); - -/* for creating folders */ -GtkWidget *em_folder_selector_create_new (struct _EMFolderTree *emft, guint32 flags, const char *title, const char *text); - -void em_folder_selector_set_selected (EMFolderSelector *emfs, const char *uri); - -const char *em_folder_selector_get_selected_uri (EMFolderSelector *emfs); -const char *em_folder_selector_get_selected_path (EMFolderSelector *emfs); - -#ifdef cplusplus -} -#endif /* cplusplus */ - -#endif /* EM_FOLDER_SELECTOR_H */ diff --git a/mail/em-folder-tree-model.c b/mail/em-folder-tree-model.c deleted file mode 100644 index ada449660e..0000000000 --- a/mail/em-folder-tree-model.c +++ /dev/null @@ -1,1198 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Authors: Jeffrey Stedfast <fejj@ximian.com> - * - * Copyright 2003 Ximian, Inc. (www.ximian.com) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA. - * - */ - - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <stdio.h> -#include <string.h> -#include <sys/types.h> -#include <unistd.h> -#include <fcntl.h> -#include <errno.h> - -#include <e-util/e-mktemp.h> - -#include <camel/camel-file-utils.h> - -#include "mail-config.h" -#include "mail-session.h" -#include "mail-tools.h" - -#include "em-utils.h" - -#include "em-marshal.h" -#include "em-folder-tree-model.h" - - -#define d(x) x - -static GType col_types[] = { - G_TYPE_STRING, /* display name */ - G_TYPE_POINTER, /* store object */ - G_TYPE_STRING, /* path */ - G_TYPE_STRING, /* uri */ - G_TYPE_UINT, /* unread count */ - G_TYPE_BOOLEAN, /* is a store node */ - G_TYPE_BOOLEAN, /* has not-yet-loaded subfolders */ -}; - - -/* GObject virtual method overrides */ -static void em_folder_tree_model_class_init (EMFolderTreeModelClass *klass); -static void em_folder_tree_model_init (EMFolderTreeModel *model); -static void em_folder_tree_model_finalize (GObject *obj); - -/* interface init methods */ -static void tree_model_iface_init (GtkTreeModelIface *iface); -static void tree_drag_dest_iface_init (GtkTreeDragDestIface *iface); -static void tree_drag_source_iface_init (GtkTreeDragSourceIface *iface); - -/* drag & drop iface methods */ -static gboolean model_drag_data_received (GtkTreeDragDest *drag_dest, - GtkTreePath *dest_path, - GtkSelectionData *selection); -static gboolean model_row_drop_possible (GtkTreeDragDest *drag_dest, - GtkTreePath *dest_path, - GtkSelectionData *selection); -static gboolean model_row_draggable (GtkTreeDragSource *drag_source, - GtkTreePath *src_path); -static gboolean model_drag_data_get (GtkTreeDragSource *drag_source, - GtkTreePath *src_path, - GtkSelectionData *selection); -static gboolean model_drag_data_delete (GtkTreeDragSource *drag_source, - GtkTreePath *src_path); - - -enum { - LOADING_ROW, - DRAG_DATA_RECEIVED, - ROW_DROP_POSSIBLE, - ROW_DRAGGABLE, - DRAG_DATA_GET, - DRAG_DATA_DELETE, - LAST_SIGNAL -}; - -static guint signals[LAST_SIGNAL] = { 0, }; - - -static GtkTreeStore *parent_class = NULL; - - -GType -em_folder_tree_model_get_type (void) -{ - static GType type = 0; - - if (!type) { - static const GTypeInfo info = { - sizeof (EMFolderTreeModelClass), - NULL, /* base_class_init */ - NULL, /* base_class_finalize */ - (GClassInitFunc) em_folder_tree_model_class_init, - NULL, /* class_finalize */ - NULL, /* class_data */ - sizeof (EMFolderTreeModel), - 0, /* n_preallocs */ - (GInstanceInitFunc) em_folder_tree_model_init, - }; - static const GInterfaceInfo tree_model_info = { - (GInterfaceInitFunc) tree_model_iface_init, - NULL, - NULL - }; - static const GInterfaceInfo drag_dest_info = { - (GInterfaceInitFunc) tree_drag_dest_iface_init, - NULL, - NULL - }; - static const GInterfaceInfo drag_source_info = { - (GInterfaceInitFunc) tree_drag_source_iface_init, - NULL, - NULL - }; - - type = g_type_register_static (GTK_TYPE_TREE_STORE, "EMFolderTreeModel", &info, 0); - - g_type_add_interface_static (type, GTK_TYPE_TREE_MODEL, - &tree_model_info); - g_type_add_interface_static (type, GTK_TYPE_TREE_DRAG_DEST, - &drag_dest_info); - g_type_add_interface_static (type, GTK_TYPE_TREE_DRAG_SOURCE, - &drag_source_info); - } - - return type; -} - - -static void -em_folder_tree_model_class_init (EMFolderTreeModelClass *klass) -{ - GObjectClass *object_class = G_OBJECT_CLASS (klass); - - parent_class = g_type_class_ref (GTK_TYPE_TREE_STORE); - - object_class->finalize = em_folder_tree_model_finalize; - - /* signals */ - signals[LOADING_ROW] = - g_signal_new ("loading-row", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET (EMFolderTreeModelClass, loading_row), - NULL, NULL, - em_marshal_VOID__POINTER_POINTER, - G_TYPE_NONE, 2, - G_TYPE_POINTER, - G_TYPE_POINTER); -} - -static void -em_folder_tree_model_init (EMFolderTreeModel *model) -{ - model->store_hash = g_hash_table_new (g_direct_hash, g_direct_equal); - model->uri_hash = g_hash_table_new (g_str_hash, g_str_equal); - model->expanded = g_hash_table_new (g_str_hash, g_str_equal); -} - -static void -path_hash_free (gpointer key, gpointer value, gpointer user_data) -{ - g_free (key); - gtk_tree_row_reference_free (value); -} - -static void -store_info_free (struct _EMFolderTreeModelStoreInfo *si) -{ - camel_object_remove_event (si->store, si->created_id); - camel_object_remove_event (si->store, si->deleted_id); - camel_object_remove_event (si->store, si->renamed_id); - camel_object_remove_event (si->store, si->subscribed_id); - camel_object_remove_event (si->store, si->unsubscribed_id); - - g_free (si->display_name); - camel_object_unref (si->store); - gtk_tree_row_reference_free (si->row); - g_hash_table_foreach (si->path_hash, path_hash_free, NULL); - g_free (si); -} - -static void -store_hash_free (gpointer key, gpointer value, gpointer user_data) -{ - struct _EMFolderTreeModelStoreInfo *si = value; - - store_info_free (si); -} - -static void -uri_hash_free (gpointer key, gpointer value, gpointer user_data) -{ - g_free (key); - gtk_tree_row_reference_free (value); -} - -static gboolean -expanded_free (gpointer key, gpointer value, gpointer user_data) -{ - g_free (key); - return TRUE; -} - -static void -em_folder_tree_model_finalize (GObject *obj) -{ - EMFolderTreeModel *model = (EMFolderTreeModel *) obj; - - g_hash_table_foreach (model->store_hash, store_hash_free, NULL); - g_hash_table_destroy (model->store_hash); - - g_hash_table_foreach (model->uri_hash, uri_hash_free, NULL); - g_hash_table_destroy (model->uri_hash); - - g_hash_table_foreach (model->expanded, (GHFunc) expanded_free, NULL); - g_hash_table_destroy (model->expanded); - - g_free (model->filename); - - G_OBJECT_CLASS (parent_class)->finalize (obj); -} - - -static void -tree_model_iface_init (GtkTreeModelIface *iface) -{ - ; -} - -static void -tree_drag_dest_iface_init (GtkTreeDragDestIface *iface) -{ - iface->drag_data_received = model_drag_data_received; - iface->row_drop_possible = model_row_drop_possible; -} - -static void -tree_drag_source_iface_init (GtkTreeDragSourceIface *iface) -{ - iface->row_draggable = model_row_draggable; - iface->drag_data_get = model_drag_data_get; - iface->drag_data_delete = model_drag_data_delete; -} - - -static void -drop_uid_list (CamelFolder *dest, gboolean move, GtkSelectionData *selection, CamelException *ex) -{ - CamelFolder *src; - GPtrArray *uids; - char *src_uri; - - em_utils_selection_get_uidlist (selection, &src_uri, &uids); - - if (!(src = mail_tool_uri_to_folder (src_uri, 0, ex))) { - em_utils_uids_free (uids); - g_free (src_uri); - return; - } - - g_free (src_uri); - - camel_folder_transfer_messages_to (src, uids, dest, NULL, move, ex); - em_utils_uids_free (uids); - camel_object_unref (src); -} - -static void -drop_folder (CamelFolder *dest, gboolean move, GtkSelectionData *selection, CamelException *ex) -{ - CamelFolder *src; - - /* get the folder being dragged */ - if (!(src = mail_tool_uri_to_folder (selection->data, 0, ex))) - return; - - if (src->parent_store == dest->parent_store && move) { - /* simple rename() action */ - char *old_name, *new_name; - - old_name = g_strdup (src->full_name); - new_name = g_strdup_printf ("%s/%s", dest->full_name, src->name); - - camel_store_rename_folder (dest->parent_store, old_name, new_name, ex); - - g_free (old_name); - g_free (new_name); - } else { - /* copy the folder to the new location */ - CamelFolder *folder; - char *path; - - path = g_strdup_printf ("%s/%s", dest->full_name, src->name); - if ((folder = camel_store_get_folder (dest->parent_store, path, CAMEL_STORE_FOLDER_CREATE, ex))) { - GPtrArray *uids; - - uids = camel_folder_get_uids (src); - camel_folder_transfer_messages_to (src, uids, folder, NULL, FALSE, ex); - camel_folder_free_uids (src, uids); - - camel_object_unref (folder); - } - - g_free (path); - } - - camel_object_unref (src); -} - -static gboolean -import_message_rfc822 (CamelFolder *dest, CamelStream *stream, gboolean scan_from, CamelException *ex) -{ - CamelMimeParser *mp; - - mp = camel_mime_parser_new (); - camel_mime_parser_scan_from (mp, scan_from); - camel_mime_parser_init_with_stream (mp, stream); - - while (camel_mime_parser_step (mp, 0, 0) == CAMEL_MIME_PARSER_STATE_FROM) { - CamelMessageInfo *info; - CamelMimeMessage *msg; - - msg = camel_mime_message_new (); - if (camel_mime_part_construct_from_parser (CAMEL_MIME_PART (msg), mp) == -1) { - camel_object_unref (msg); - camel_object_unref (mp); - return FALSE; - } - - /* append the message to the folder... */ - info = g_new0 (CamelMessageInfo, 1); - camel_folder_append_message (dest, msg, info, NULL, ex); - camel_object_unref (msg); - - if (camel_exception_is_set (ex)) { - camel_object_unref (mp); - return FALSE; - } - - /* skip over the FROM_END state */ - camel_mime_parser_step (mp, 0, 0); - } - - camel_object_unref (mp); - - return TRUE; -} - -static void -drop_message_rfc822 (CamelFolder *dest, GtkSelectionData *selection, CamelException *ex) -{ - CamelStream *stream; - gboolean scan_from; - - scan_from = selection->length > 5 && !strncmp (selection->data, "From ", 5); - stream = camel_stream_mem_new_with_buffer (selection->data, selection->length); - - import_message_rfc822 (dest, stream, scan_from, ex); - - camel_object_unref (stream); -} - -static void -drop_text_uri_list (CamelFolder *dest, GtkSelectionData *selection, CamelException *ex) -{ - char **urls, *url, *tmp; - CamelStream *stream; - CamelURL *uri; - int fd, i; - - tmp = g_strndup (selection->data, selection->length); - urls = g_strsplit (tmp, "\n", 0); - g_free (tmp); - - for (i = 0; urls[i] != NULL; i++) { - /* get the path component */ - url = g_strstrip (urls[i]); - uri = camel_url_new (url, NULL); - g_free (url); - - if (!uri || strcmp (uri->protocol, "file") != 0) { - camel_url_free (uri); - continue; - } - - url = uri->path; - uri->path = NULL; - camel_url_free (uri); - - if ((fd = open (url, O_RDONLY)) == -1) { - g_free (url); - continue; - } - - stream = camel_stream_fs_new_with_fd (fd); - if (!import_message_rfc822 (dest, stream, TRUE, ex)) { - /* FIXME: should we abort now? or continue? */ - /* for now lets just continue... */ - camel_exception_clear (ex); - } - - camel_object_unref (stream); - g_free (url); - } - - g_free (urls); -} - - -static gboolean -model_drag_data_received (GtkTreeDragDest *drag_dest, GtkTreePath *dest_path, GtkSelectionData *selection) -{ - EMFolderTreeModel *model = (EMFolderTreeModel *) drag_dest; - const char *full_name; - CamelFolder *folder; - CamelStore *store; - CamelException ex; - GtkTreeIter iter; - char *path; - - /* this means we are receiving no data */ - if (!selection->data || selection->length == -1) - return FALSE; - - if (!gtk_tree_model_get_iter ((GtkTreeModel *) model, &iter, dest_path)) - return FALSE; - - gtk_tree_model_get ((GtkTreeModel *) model, &iter, - COL_POINTER_CAMEL_STORE, &store, - COL_STRING_FOLDER_PATH, &path, -1); - - /* make sure user isn't try to drop on a placeholder row */ - if (path == NULL) - return FALSE; - - full_name = path[0] == '/' ? path + 1 : path; - - camel_exception_init (&ex); - if ((folder = camel_store_get_folder (store, full_name, 0, &ex))) { - /* FIXME: would have been nicer if we could 'move' - * messages and/or folders. but alas, gtktreeview - * drag&drop doesn't give us the context->action to - * check for GDK_ACTION_MOVE, so we can't. Yay. */ - gboolean move = FALSE; - - if (selection->target == gdk_atom_intern ("x-uid-list", FALSE)) { - /* import a list of uids from another evo folder */ - drop_uid_list (folder, move, selection, &ex); - d(printf ("* dropped a x-uid-list\n")); - } else if (selection->target == gdk_atom_intern ("x-folder", FALSE)) { - /* copy or move (aka rename) a folder */ - drop_folder (folder, move, selection, &ex); - d(printf ("* dropped a x-folder\n")); - } else if (selection->target == gdk_atom_intern ("message/rfc822", FALSE)) { - /* import a message/rfc822 stream */ - drop_message_rfc822 (folder, selection, &ex); - d(printf ("* dropped a message/rfc822\n")); - } else if (selection->target == gdk_atom_intern ("text/uri-list", FALSE)) { - /* import an mbox, maildir, or mh folder? */ - drop_text_uri_list (folder, selection, &ex); - d(printf ("* dropped a text/uri-list\n")); - } else { - g_assert_not_reached (); - } - } - - if (camel_exception_is_set (&ex)) { - /* FIXME: error dialog? */ - camel_exception_clear (&ex); - return FALSE; - } - - return TRUE; -} - -static gboolean -model_row_drop_possible (GtkTreeDragDest *drag_dest, GtkTreePath *dest_path, GtkSelectionData *selection) -{ - EMFolderTreeModel *model = (EMFolderTreeModel *) drag_dest; - gboolean is_store; - GtkTreeIter iter; - - if (!gtk_tree_model_get_iter ((GtkTreeModel *) model, &iter, dest_path)) - return FALSE; - - gtk_tree_model_get ((GtkTreeModel *) model, &iter, COL_BOOL_IS_STORE, &is_store, -1); - - if (selection->target == gdk_atom_intern ("x-uid-list", FALSE)) { - if (is_store) - return FALSE; - - return TRUE; - } else if (selection->target == gdk_atom_intern ("x-folder", FALSE)) { - return TRUE; - } else if (selection->target == gdk_atom_intern ("message/rfc822", FALSE)) { - if (is_store) - return FALSE; - - return TRUE; - } else if (selection->target == gdk_atom_intern ("text/uri-list", FALSE)) { - if (is_store) - return FALSE; - - return TRUE; - } else { - g_assert_not_reached (); - return FALSE; - } -} - -static gboolean -model_row_draggable (GtkTreeDragSource *drag_source, GtkTreePath *src_path) -{ - EMFolderTreeModel *model = (EMFolderTreeModel *) drag_source; - gboolean is_store; - GtkTreeIter iter; - - if (!gtk_tree_model_get_iter ((GtkTreeModel *) model, &iter, src_path)) - return FALSE; - - gtk_tree_model_get ((GtkTreeModel *) model, &iter, COL_BOOL_IS_STORE, &is_store, -1); - - return !is_store; -} - -static void -drag_text_uri_list (CamelFolder *src, GtkSelectionData *selection, CamelException *ex) -{ - CamelFolder *dest; - const char *tmpdir; - CamelStore *store; - GPtrArray *uids; - GString *url; - - if (!(tmpdir = e_mkdtemp ("drag-n-drop-XXXXXX"))) { - camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, - _("Could not create temporary directory: %s"), - g_strerror (errno)); - return; - } - - url = g_string_new ("mbox:"); - g_string_append (url, tmpdir); - if (!(store = camel_session_get_store (session, url->str, ex))) { - camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, - _("Could not create temporary mbox store: %s"), - camel_exception_get_description (ex)); - g_string_free (url, TRUE); - - return; - } - - if (!(dest = camel_store_get_folder (store, "mbox", CAMEL_STORE_FOLDER_CREATE, ex))) { - camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, - _("Could not create temporary mbox folder: %s"), - camel_exception_get_description (ex)); - - camel_object_unref (store); - g_string_free (url, TRUE); - - return; - } - - camel_object_unref (store); - uids = camel_folder_get_uids (src); - - camel_folder_transfer_messages_to (src, uids, dest, NULL, FALSE, ex); - if (camel_exception_is_set (ex)) { - camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, - _("Could not copy messages to temporary mbox folder: %s"), - camel_exception_get_description (ex)); - } else { - /* replace "mbox:" with "file:" */ - memcpy (url->str, "file", 4); - g_string_append (url, "\r\n"); - gtk_selection_data_set (selection, selection->target, 8, url->str, url->len); - } - - camel_folder_free_uids (src, uids); - camel_object_unref (dest); - g_string_free (url, TRUE); -} - -static gboolean -model_drag_data_get (GtkTreeDragSource *drag_source, GtkTreePath *src_path, GtkSelectionData *selection) -{ - EMFolderTreeModel *model = (EMFolderTreeModel *) drag_source; - const char *full_name; - CamelFolder *folder; - CamelStore *store; - CamelException ex; - GtkTreeIter iter; - char *path, *uri; - - if (!gtk_tree_model_get_iter ((GtkTreeModel *) model, &iter, src_path)) - return FALSE; - - gtk_tree_model_get ((GtkTreeModel *) model, &iter, - COL_POINTER_CAMEL_STORE, &store, - COL_STRING_FOLDER_PATH, &path, - COL_STRING_URI, &uri, -1); - - /* make sure user isn't try to drag on a placeholder row */ - if (path == NULL) - return FALSE; - - full_name = path[0] == '/' ? path + 1 : path; - - camel_exception_init (&ex); - - if (selection->target == gdk_atom_intern ("x-folder", FALSE)) { - /* dragging to a new location in the folder tree */ - gtk_selection_data_set (selection, selection->target, 8, uri, strlen (uri) + 1); - } else if (selection->target == gdk_atom_intern ("text/uri-list", FALSE)) { - /* dragging to nautilus or something, probably */ - if ((folder = camel_store_get_folder (store, full_name, 0, &ex))) { - drag_text_uri_list (folder, selection, &ex); - camel_object_unref (folder); - } - } else { - g_assert_not_reached (); - } - - if (camel_exception_is_set (&ex)) { - /* FIXME: error dialog? */ - camel_exception_clear (&ex); - return FALSE; - } - - return TRUE; -} - -static gboolean -model_drag_data_delete (GtkTreeDragSource *drag_source, GtkTreePath *src_path) -{ - EMFolderTreeModel *model = (EMFolderTreeModel *) drag_source; - const char *full_name; - gboolean is_store; - CamelStore *store; - CamelException ex; - GtkTreeIter iter; - char *path; - - if (!gtk_tree_model_get_iter ((GtkTreeModel *) model, &iter, src_path)) - return FALSE; - - gtk_tree_model_get ((GtkTreeModel *) model, &iter, - COL_POINTER_CAMEL_STORE, &store, - COL_STRING_FOLDER_PATH, &path, - COL_BOOL_IS_STORE, &is_store, -1); - - if (is_store) - return FALSE; - - full_name = path[0] == '/' ? path + 1 : path; - - camel_exception_init (&ex); - camel_store_delete_folder (store, full_name, &ex); - if (camel_exception_is_set (&ex)) { - /* FIXME: error dialog? */ - camel_exception_clear (&ex); - return FALSE; - } - - return TRUE; -} - - -static void -em_folder_tree_model_load_state (EMFolderTreeModel *model, const char *filename) -{ - char *node; - FILE *fp; - - g_hash_table_foreach_remove (model->expanded, expanded_free, NULL); - - if ((fp = fopen (filename, "r")) == NULL) - return; - - while (camel_file_util_decode_string (fp, &node) != -1) - g_hash_table_insert (model->expanded, node, GINT_TO_POINTER (TRUE)); - - fclose (fp); -} - - -EMFolderTreeModel * -em_folder_tree_model_new (const char *evolution_dir) -{ - EMFolderTreeModel *model; - char *filename; - - model = g_object_new (EM_TYPE_FOLDER_TREE_MODEL, NULL); - gtk_tree_store_set_column_types ((GtkTreeStore *) model, NUM_COLUMNS, col_types); - - filename = g_build_filename (evolution_dir, "mail", "config", "folder-tree.state", NULL); - em_folder_tree_model_load_state (model, filename); - model->filename = filename; - - return model; -} - - -void -em_folder_tree_model_set_folder_info (EMFolderTreeModel *model, GtkTreeIter *iter, - struct _EMFolderTreeModelStoreInfo *si, - CamelFolderInfo *fi) -{ - GtkTreeRowReference *uri_row, *path_row; - unsigned int unread; - GtkTreePath *path; - GtkTreeIter sub; - gboolean load; - - load = !fi->child && (fi->flags & CAMEL_FOLDER_CHILDREN) && !(fi->flags & CAMEL_FOLDER_NOINFERIORS); - - path = gtk_tree_model_get_path ((GtkTreeModel *) model, iter); - uri_row = gtk_tree_row_reference_new ((GtkTreeModel *) model, path); - path_row = gtk_tree_row_reference_copy (uri_row); - gtk_tree_path_free (path); - - g_hash_table_insert (model->uri_hash, g_strdup (fi->url), uri_row); - g_hash_table_insert (si->path_hash, g_strdup (fi->path), path_row); - - unread = fi->unread_message_count == -1 ? 0 : fi->unread_message_count; - - gtk_tree_store_set ((GtkTreeStore *) model, iter, - COL_STRING_DISPLAY_NAME, fi->name, - COL_POINTER_CAMEL_STORE, si->store, - COL_STRING_FOLDER_PATH, fi->path, - COL_STRING_URI, fi->url, - COL_UINT_UNREAD, unread, - COL_BOOL_IS_STORE, FALSE, - COL_BOOL_LOAD_SUBDIRS, load, - -1); - - if (fi->child) { - fi = fi->child; - - do { - gtk_tree_store_append ((GtkTreeStore *) model, &sub, iter); - em_folder_tree_model_set_folder_info (model, &sub, si, fi); - fi = fi->sibling; - } while (fi); - } else if (load) { - /* create a placeholder node for our subfolders... */ - gtk_tree_store_append ((GtkTreeStore *) model, &sub, iter); - gtk_tree_store_set ((GtkTreeStore *) model, &sub, - COL_STRING_DISPLAY_NAME, _("Loading..."), - COL_POINTER_CAMEL_STORE, NULL, - COL_STRING_FOLDER_PATH, NULL, - COL_BOOL_LOAD_SUBDIRS, FALSE, - COL_BOOL_IS_STORE, FALSE, - COL_STRING_URI, NULL, - COL_UINT_UNREAD, 0, - -1); - - path = gtk_tree_model_get_path ((GtkTreeModel *) model, iter); - g_signal_emit (model, signals[LOADING_ROW], 0, path, iter); - gtk_tree_path_free (path); - } -} - - -static void -folder_subscribed_cb (CamelStore *store, void *event_data, EMFolderTreeModel *model) -{ - struct _EMFolderTreeModelStoreInfo *si; - CamelFolderInfo *fi = event_data; - GtkTreeRowReference *row; - GtkTreeIter parent, iter; - GtkTreePath *path; - gboolean load; - char *dirname; - - if (!(si = g_hash_table_lookup (model->store_hash, store))) - return; - - /* make sure we don't already know about it? */ - if (g_hash_table_lookup (si->path_hash, fi->path)) - return; - - /* get our parent folder's path */ - if (!(dirname = g_path_get_dirname (fi->path))) - return; - - if (!strcmp (dirname, "/")) { - /* user subscribed to a toplevel folder */ - row = si->row; - g_free (dirname); - } else { - row = g_hash_table_lookup (si->path_hash, dirname); - g_free (dirname); - - /* if row is NULL, don't bother adding to the tree, - * when the user expands enough nodes - it will be - * added auto-magically */ - if (row == NULL) - return; - } - - path = gtk_tree_row_reference_get_path (row); - if (!(gtk_tree_model_get_iter ((GtkTreeModel *) model, &parent, path))) { - gtk_tree_path_free (path); - return; - } - - gtk_tree_path_free (path); - - /* make sure parent's subfolders have already been loaded */ - gtk_tree_model_get ((GtkTreeModel *) model, &parent, COL_BOOL_LOAD_SUBDIRS, &load, -1); - if (load) - return; - - /* append a new node */ - gtk_tree_store_append ((GtkTreeStore *) model, &iter, &parent); - - em_folder_tree_model_set_folder_info (model, &iter, si, fi); -} - -static void -folder_unsubscribed_cb (CamelStore *store, void *event_data, EMFolderTreeModel *model) -{ - struct _EMFolderTreeModelStoreInfo *si; - CamelFolderInfo *fi = event_data; - GtkTreeRowReference *row; - GtkTreePath *path; - GtkTreeIter iter; - - if (!(si = g_hash_table_lookup (model->store_hash, store))) - return; - - if (!(row = g_hash_table_lookup (si->path_hash, fi->path))) - return; - - path = gtk_tree_row_reference_get_path (row); - if (!(gtk_tree_model_get_iter ((GtkTreeModel *) model, &iter, path))) { - gtk_tree_path_free (path); - return; - } - - em_folder_tree_model_remove_folders (model, si, &iter); -} - -static void -folder_created_cb (CamelStore *store, void *event_data, EMFolderTreeModel *model) -{ - /* we only want created events to do more work if we don't support subscriptions */ - if (!camel_store_supports_subscriptions (store)) - folder_subscribed_cb (store, event_data, model); -} - -static void -folder_deleted_cb (CamelStore *store, void *event_data, EMFolderTreeModel *model) -{ - /* we only want deleted events to do more work if we don't support subscriptions */ - if (!camel_store_supports_subscriptions (store)) - folder_unsubscribed_cb (store, event_data, model); -} - -static void -folder_renamed_cb (CamelStore *store, void *event_data, EMFolderTreeModel *model) -{ - struct _EMFolderTreeModelStoreInfo *si; - CamelRenameInfo *info = event_data; - GtkTreeRowReference *row; - GtkTreeIter root, iter; - GtkTreePath *path; - char *parent, *p; - - if (!(si = g_hash_table_lookup (model->store_hash, store))) - return; - - parent = g_strdup_printf ("/%s", info->old_base); - if (!(row = g_hash_table_lookup (si->path_hash, parent))) { - g_free (parent); - return; - } - g_free (parent); - - path = gtk_tree_row_reference_get_path (row); - if (!(gtk_tree_model_get_iter ((GtkTreeModel *) model, &iter, path))) { - gtk_tree_path_free (path); - return; - } - - em_folder_tree_model_remove_folders (model, si, &iter); - - parent = g_strdup (info->new->path); - if ((p = strrchr (parent + 1, '/'))) - *p = '\0'; - - if (!strcmp (parent, "/")) { - /* renamed to a toplevel folder on the store */ - path = gtk_tree_row_reference_get_path (si->row); - } else { - if (!(row = g_hash_table_lookup (si->path_hash, parent))) { - /* NOTE: this should never happen, but I - * suppose if it does in reality, we can add - * code here to add the missing nodes to the - * tree */ - g_assert_not_reached (); - g_free (parent); - return; - } - - path = gtk_tree_row_reference_get_path (row); - } - - g_free (parent); - - if (!gtk_tree_model_get_iter ((GtkTreeModel *) model, &root, path)) { - gtk_tree_path_free (path); - g_assert_not_reached (); - return; - } - - gtk_tree_store_append ((GtkTreeStore *) model, &iter, &root); - em_folder_tree_model_set_folder_info (model, &iter, si, info->new); -} - - -void -em_folder_tree_model_add_store (EMFolderTreeModel *model, CamelStore *store, const char *display_name) -{ - struct _EMFolderTreeModelStoreInfo *si; - GtkTreeRowReference *row; - GtkTreeIter root, iter; - GtkTreePath *path; - char *uri; - - g_return_if_fail (EM_IS_FOLDER_TREE_MODEL (model)); - g_return_if_fail (CAMEL_IS_STORE (store)); - g_return_if_fail (display_name != NULL); - - if ((si = g_hash_table_lookup (model->store_hash, store))) { - const char *name; - - path = gtk_tree_row_reference_get_path (si->row); - gtk_tree_model_get_iter ((GtkTreeModel *) model, &iter, path); - gtk_tree_path_free (path); - - gtk_tree_model_get ((GtkTreeModel *) model, &iter, COL_STRING_DISPLAY_NAME, (char **) &name, -1); - - g_warning ("the store `%s' is already in the folder tree as `%s'", - display_name, name); - - return; - } - - uri = camel_url_to_string (((CamelService *) store)->url, CAMEL_URL_HIDE_ALL); - - /* add the store to the tree */ - gtk_tree_store_append ((GtkTreeStore *) model, &iter, NULL); - gtk_tree_store_set ((GtkTreeStore *) model, &iter, - COL_STRING_DISPLAY_NAME, display_name, - COL_POINTER_CAMEL_STORE, store, - COL_STRING_FOLDER_PATH, "/", - COL_BOOL_LOAD_SUBDIRS, TRUE, - COL_BOOL_IS_STORE, TRUE, - COL_STRING_URI, uri, -1); - - path = gtk_tree_model_get_path ((GtkTreeModel *) model, &iter); - row = gtk_tree_row_reference_new ((GtkTreeModel *) model, path); - gtk_tree_path_free (path); - - si = g_new (struct _EMFolderTreeModelStoreInfo, 1); - si->display_name = g_strdup (display_name); - camel_object_ref (store); - si->store = store; - si->row = row; - si->path_hash = g_hash_table_new (g_str_hash, g_str_equal); - g_hash_table_insert (model->store_hash, store, si); - - /* each store has folders... but we don't load them until the user demands them */ - root = iter; - gtk_tree_store_append ((GtkTreeStore *) model, &iter, &root); - gtk_tree_store_set ((GtkTreeStore *) model, &iter, - COL_STRING_DISPLAY_NAME, _("Loading..."), - COL_POINTER_CAMEL_STORE, NULL, - COL_STRING_FOLDER_PATH, NULL, - COL_BOOL_LOAD_SUBDIRS, FALSE, - COL_BOOL_IS_STORE, FALSE, - COL_STRING_URI, NULL, - COL_UINT_UNREAD, 0, - -1); - - g_free (uri); - - /* listen to store events */ -#define CAMEL_CALLBACK(func) ((CamelObjectEventHookFunc) func) - si->created_id = camel_object_hook_event (store, "folder_created", CAMEL_CALLBACK (folder_created_cb), model); - si->deleted_id = camel_object_hook_event (store, "folder_deleted", CAMEL_CALLBACK (folder_deleted_cb), model); - si->renamed_id = camel_object_hook_event (store, "folder_renamed", CAMEL_CALLBACK (folder_renamed_cb), model); - si->subscribed_id = camel_object_hook_event (store, "folder_subscribed", CAMEL_CALLBACK (folder_subscribed_cb), model); - si->unsubscribed_id = camel_object_hook_event (store, "folder_unsubscribed", CAMEL_CALLBACK (folder_unsubscribed_cb), model); -} - - -static void -em_folder_tree_model_remove_uri (EMFolderTreeModel *model, const char *uri) -{ - GtkTreeRowReference *row; - - g_return_if_fail (EM_IS_FOLDER_TREE_MODEL (model)); - g_return_if_fail (uri != NULL); - - if ((row = g_hash_table_lookup (model->uri_hash, uri))) { - g_hash_table_remove (model->uri_hash, uri); - gtk_tree_row_reference_free (row); - } -} - - -static void -em_folder_tree_model_remove_store_info (EMFolderTreeModel *model, CamelStore *store) -{ - struct _EMFolderTreeModelStoreInfo *si; - - g_return_if_fail (EM_IS_FOLDER_TREE_MODEL (model)); - g_return_if_fail (CAMEL_IS_STORE (store)); - - if (!(si = g_hash_table_lookup (model->store_hash, store))) - return; - - g_hash_table_remove (model->store_hash, si->store); - store_info_free (si); -} - - -void -em_folder_tree_model_remove_folders (EMFolderTreeModel *model, struct _EMFolderTreeModelStoreInfo *si, GtkTreeIter *toplevel) -{ - GtkTreeRowReference *row; - char *uri, *folder_path; - gboolean is_store, go; - GtkTreeIter iter; - - if (gtk_tree_model_iter_children ((GtkTreeModel *) model, &iter, toplevel)) { - do { - GtkTreeIter next = iter; - - go = gtk_tree_model_iter_next ((GtkTreeModel *) model, &next); - em_folder_tree_model_remove_folders (model, si, &iter); - iter = next; - } while (go); - } - - gtk_tree_model_get ((GtkTreeModel *) model, toplevel, COL_STRING_URI, &uri, - COL_STRING_FOLDER_PATH, &folder_path, - COL_BOOL_IS_STORE, &is_store, -1); - - if (folder_path && (row = g_hash_table_lookup (si->path_hash, folder_path))) { - g_hash_table_remove (si->path_hash, folder_path); - gtk_tree_row_reference_free (row); - } - - em_folder_tree_model_remove_uri (model, uri); - - gtk_tree_store_remove ((GtkTreeStore *) model, toplevel); - - if (is_store) - em_folder_tree_model_remove_store_info (model, si->store); -} - - -void -em_folder_tree_model_remove_store (EMFolderTreeModel *model, CamelStore *store) -{ - struct _EMFolderTreeModelStoreInfo *si; - GtkTreePath *path; - GtkTreeIter iter; - - g_return_if_fail (EM_IS_FOLDER_TREE_MODEL (model)); - g_return_if_fail (CAMEL_IS_STORE (store)); - - if (!(si = g_hash_table_lookup (model->store_hash, store))) { - g_warning ("the store `%s' is not in the folder tree", si->display_name); - - return; - } - - path = gtk_tree_row_reference_get_path (si->row); - gtk_tree_model_get_iter ((GtkTreeModel *) model, &iter, path); - gtk_tree_path_free (path); - - /* recursively remove subfolders and finally the toplevel store */ - em_folder_tree_model_remove_folders (model, si, &iter); -} - - -gboolean -em_folder_tree_model_get_expanded (EMFolderTreeModel *model, const char *key) -{ - if (g_hash_table_lookup (model->expanded, key)) - return TRUE; - - return FALSE; -} - - -void -em_folder_tree_model_set_expanded (EMFolderTreeModel *model, const char *key, gboolean expanded) -{ - gpointer okey, oval; - - if (g_hash_table_lookup_extended (model->expanded, key, &okey, &oval)) { - g_hash_table_remove (model->expanded, okey); - g_free (okey); - } - - if (expanded) - g_hash_table_insert (model->expanded, g_strdup (key), GINT_TO_POINTER (TRUE)); -} - - -static void -expanded_save (gpointer key, gpointer value, FILE *fp) -{ - /* FIXME: don't save stale entries */ - if (!GPOINTER_TO_INT (value)) - return; - - camel_file_util_encode_string (fp, key); -} - -void -em_folder_tree_model_save_expanded (EMFolderTreeModel *model) -{ - char *dirname, *tmpname; - FILE *fp; - int fd; - - dirname = g_path_get_dirname (model->filename); - if (camel_mkdir (dirname, 0777) == -1 && errno != EEXIST) { - g_free (dirname); - return; - } - - g_free (dirname); - tmpname = g_strdup_printf ("%s~", model->filename); - - if (!(fp = fopen (tmpname, "w+"))) { - g_free (tmpname); - return; - } - - g_hash_table_foreach (model->expanded, (GHFunc) expanded_save, fp); - - if (fflush (fp) != 0) - goto exception; - - if ((fd = fileno (fp)) == -1) - goto exception; - - if (fsync (fd) == -1) - goto exception; - - fclose (fp); - fp = NULL; - - if (rename (tmpname, model->filename) == -1) - goto exception; - - g_free (tmpname); - - return; - - exception: - - if (fp != NULL) - fclose (fp); - - unlink (tmpname); - g_free (tmpname); -} diff --git a/mail/em-folder-tree-model.h b/mail/em-folder-tree-model.h deleted file mode 100644 index 3296af1ed1..0000000000 --- a/mail/em-folder-tree-model.h +++ /dev/null @@ -1,121 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Authors: Jeffrey Stedfast <fejj@ximian.com> - * - * Copyright 2003 Ximian, Inc. (www.ximian.com) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA. - * - */ - - -#ifndef __EM_FOLDER_TREE_MODEL_H__ -#define __EM_FOLDER_TREE_MODEL_H__ - -#include <gtk/gtktreednd.h> -#include <gtk/gtktreestore.h> - -#include <camel/camel-store.h> - -#ifdef __cplusplus -extern "C" { -#pragma } -#endif /* __cplusplus */ - -#define EM_TYPE_FOLDER_TREE_MODEL (em_folder_tree_model_get_type ()) -#define EM_FOLDER_TREE_MODEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EM_TYPE_FOLDER_TREE_MODEL, EMFolderTreeModel)) -#define EM_FOLDER_TREE_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EM_TYPE_FOLDER_TREE_MODEL, EMFolderTreeModelClass)) -#define EM_IS_FOLDER_TREE_MODEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EM_TYPE_FOLDER_TREE_MODEL)) -#define EM_IS_FOLDER_TREE_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EM_TYPE_FOLDER_TREE_MODEL)) -#define EM_FOLDER_TREE_MODEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EM_TYPE_FOLDER_TREE_MODEL, EMFolderTreeModelClass)) - -typedef struct _EMFolderTreeModel EMFolderTreeModel; -typedef struct _EMFolderTreeModelClass EMFolderTreeModelClass; -typedef struct _EMFolderTreeModelStoreInfo EMFolderTreeModelStoreInfo; - -enum { - COL_STRING_DISPLAY_NAME, /* string that appears in the tree */ - COL_POINTER_CAMEL_STORE, /* CamelStore object */ - COL_STRING_FOLDER_PATH, /* if node is a folder, the full path of the folder */ - COL_STRING_URI, /* the uri to get the store or - * folder object */ - COL_UINT_UNREAD, /* unread count */ - - COL_BOOL_IS_STORE, /* toplevel store node? */ - COL_BOOL_LOAD_SUBDIRS, /* %TRUE only if the store/folder - * has subfolders which have not yet - * been added to the tree */ - NUM_COLUMNS -}; - - -struct _EMFolderTreeModelStoreInfo { - CamelStore *store; - GtkTreeRowReference *row; - GHashTable *path_hash; /* maps CamelFolderInfo::path's to GtkTreeRowReferences */ - - char *display_name; - - unsigned int created_id; - unsigned int deleted_id; - unsigned int renamed_id; - unsigned int subscribed_id; - unsigned int unsubscribed_id; -}; - -struct _EMFolderTreeModel { - GtkTreeStore parent_object; - - char *filename; /* state filename */ - - GHashTable *store_hash; /* maps CamelStore's to store-info's */ - GHashTable *uri_hash; /* maps URI's to GtkTreeRowReferences */ - GHashTable *expanded; /* saved expanded state from previous session */ -}; - -struct _EMFolderTreeModelClass { - GtkTreeStoreClass parent_class; - - /* signals */ - void (* loading_row) (EMFolderTreeModel *model, - GtkTreePath *path, - GtkTreeIter *iter); -}; - - -GType em_folder_tree_model_get_type (void); - - -EMFolderTreeModel *em_folder_tree_model_new (const char *evolution_dir); - - -void em_folder_tree_model_set_folder_info (EMFolderTreeModel *model, GtkTreeIter *iter, - struct _EMFolderTreeModelStoreInfo *si, - CamelFolderInfo *fi); - -void em_folder_tree_model_add_store (EMFolderTreeModel *model, CamelStore *store, const char *display_name); -void em_folder_tree_model_remove_store (EMFolderTreeModel *model, CamelStore *store); -void em_folder_tree_model_remove_folders (EMFolderTreeModel *model, struct _EMFolderTreeModelStoreInfo *si, - GtkTreeIter *toplevel); - -gboolean em_folder_tree_model_get_expanded (EMFolderTreeModel *model, const char *key); -void em_folder_tree_model_set_expanded (EMFolderTreeModel *model, const char *key, gboolean expanded); -void em_folder_tree_model_save_expanded (EMFolderTreeModel *model); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __EM_FOLDER_TREE_MODEL_H__ */ diff --git a/mail/em-folder-tree.c b/mail/em-folder-tree.c deleted file mode 100644 index 23f4a88a5c..0000000000 --- a/mail/em-folder-tree.c +++ /dev/null @@ -1,1710 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Authors: Jeffrey Stedfast <fejj@ximian.com> - * - * Copyright 2003 Ximian, Inc. (www.ximian.com) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA. - * - */ - - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <unistd.h> -#include <fcntl.h> -#include <errno.h> - -#include <gtk/gtk.h> -#include <gdk-pixbuf/gdk-pixbuf.h> - -#include <camel/camel-session.h> -#include <camel/camel-store.h> -#include <camel/camel-folder.h> -#include <camel/camel-vtrash-folder.h> -#include <camel/camel-stream-mem.h> -#include <camel/camel-file-utils.h> - -#include "e-util/e-mktemp.h" -#include "e-util/e-request.h" -#include "e-util/e-dialog-utils.h" - -#include "mail-mt.h" -#include "mail-ops.h" -#include "mail-tools.h" -#include "mail-config.h" -#include "mail-component.h" - -#include "em-utils.h" -#include "em-popup.h" -#include "em-marshal.h" -#include "em-folder-tree.h" -#include "em-folder-selector.h" -#include "em-folder-selection.h" - - -#define d(x) x - - -struct _EMFolderTreePrivate { - GtkTreeView *treeview; - EMFolderTreeModel *model; - - char *selected_uri; - char *selected_path; - - guint save_state_id; - - guint loading_row_id; -}; - -enum { - FOLDER_SELECTED, - LAST_SIGNAL -}; - -static guint signals[LAST_SIGNAL] = { 0 }; - -/* Drag & Drop types */ -enum DndDragType { - DND_DRAG_TYPE_FOLDER, /* drag an evo folder */ - DND_DRAG_TYPE_TEXT_URI_LIST, /* drag to an mbox file */ -}; - -enum DndDropType { - DND_DROP_TYPE_UID_LIST, /* drop a list of message uids */ - DND_DROP_TYPE_FOLDER, /* drop an evo folder */ - DND_DROP_TYPE_MESSAGE_RFC822, /* drop a message/rfc822 stream */ - DND_DROP_TYPE_TEXT_URI_LIST, /* drop an mbox file */ -}; - -static GtkTargetEntry drag_types[] = { - { "x-folder", 0, DND_DRAG_TYPE_FOLDER }, - { "text/uri-list", 0, DND_DRAG_TYPE_TEXT_URI_LIST }, -}; - -static const int num_drag_types = sizeof (drag_types) / sizeof (drag_types[0]); - -static GtkTargetEntry drop_types[] = { - { "x-uid-list" , 0, DND_DROP_TYPE_UID_LIST }, - { "x-folder", 0, DND_DROP_TYPE_FOLDER }, - { "message/rfc822", 0, DND_DROP_TYPE_MESSAGE_RFC822 }, - { "text/uri-list", 0, DND_DROP_TYPE_TEXT_URI_LIST }, -}; - -static const int num_drop_types = sizeof (drop_types) / sizeof (drop_types[0]); - - -extern CamelSession *session; - - -static void em_folder_tree_class_init (EMFolderTreeClass *klass); -static void em_folder_tree_init (EMFolderTree *emft); -static void em_folder_tree_destroy (GtkObject *obj); -static void em_folder_tree_finalize (GObject *obj); - -static gboolean em_folder_tree_save_state (EMFolderTree *emft); -static void em_folder_tree_queue_save_state (EMFolderTree *emft); - -static void tree_row_collapsed (GtkTreeView *treeview, GtkTreeIter *root, GtkTreePath *path, EMFolderTree *emft); -static void tree_row_expanded (GtkTreeView *treeview, GtkTreeIter *root, GtkTreePath *path, EMFolderTree *emft); -static gboolean tree_button_press (GtkWidget *treeview, GdkEventButton *event, EMFolderTree *emft); -static void tree_selection_changed (GtkTreeSelection *selection, EMFolderTree *emft); - - -static GtkVBoxClass *parent_class = NULL; - - -GType -em_folder_tree_get_type (void) -{ - static GType type = 0; - - if (!type) { - static const GTypeInfo info = { - sizeof (EMFolderTreeClass), - NULL, /* base_class_init */ - NULL, /* base_class_finalize */ - (GClassInitFunc) em_folder_tree_class_init, - NULL, /* class_finalize */ - NULL, /* class_data */ - sizeof (EMFolderTree), - 0, /* n_preallocs */ - (GInstanceInitFunc) em_folder_tree_init, - }; - - type = g_type_register_static (GTK_TYPE_VBOX, "EMFolderTree", &info, 0); - } - - return type; -} - -static void -em_folder_tree_class_init (EMFolderTreeClass *klass) -{ - GObjectClass *object_class = G_OBJECT_CLASS (klass); - GtkObjectClass *gtk_object_class = GTK_OBJECT_CLASS (klass); - - parent_class = g_type_class_ref (GTK_TYPE_VBOX); - - object_class->finalize = em_folder_tree_finalize; - gtk_object_class->destroy = em_folder_tree_destroy; - - signals[FOLDER_SELECTED] = - g_signal_new ("folder-selected", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET (EMFolderTreeClass, folder_selected), - NULL, NULL, - em_marshal_VOID__STRING_STRING, - G_TYPE_NONE, 2, - G_TYPE_STRING, - G_TYPE_STRING); -} - - -static gboolean -subdirs_contain_unread (GtkTreeModel *model, GtkTreeIter *root) -{ - unsigned int unread; - GtkTreeIter iter; - - if (!gtk_tree_model_iter_children (model, &iter, root)) - return FALSE; - - do { - gtk_tree_model_get (model, &iter, COL_UINT_UNREAD, &unread, -1); - if (unread) - return TRUE; - - if (gtk_tree_model_iter_has_child (model, &iter)) - if (subdirs_contain_unread (model, &iter)) - return TRUE; - } while (gtk_tree_model_iter_next (model, &iter)); - - return FALSE; -} - - -enum { - FOLDER_ICON_NORMAL, - FOLDER_ICON_INBOX, - FOLDER_ICON_OUTBOX, - FOLDER_ICON_TRASH, - FOLDER_ICON_JUNK, - FOLDER_ICON_LAST -}; - -static GdkPixbuf *folder_icons[FOLDER_ICON_LAST]; - -static void -render_pixbuf (GtkTreeViewColumn *column, GtkCellRenderer *renderer, - GtkTreeModel *model, GtkTreeIter *iter, gpointer user_data) -{ - static gboolean initialised = FALSE; - GdkPixbuf *pixbuf = NULL; - gboolean is_store; - char *path; - - if (!initialised) { - folder_icons[FOLDER_ICON_NORMAL] = gdk_pixbuf_new_from_file (EVOLUTION_ICONSDIR "/folder-mini.png", NULL); - folder_icons[FOLDER_ICON_INBOX] = gdk_pixbuf_new_from_file (EVOLUTION_ICONSDIR "/inbox-mini.png", NULL); - folder_icons[FOLDER_ICON_OUTBOX] = gdk_pixbuf_new_from_file (EVOLUTION_ICONSDIR "/outbox-mini.png", NULL); - folder_icons[FOLDER_ICON_TRASH] = gdk_pixbuf_new_from_file (EVOLUTION_ICONSDIR "/evolution-trash-mini.png", NULL); - folder_icons[FOLDER_ICON_JUNK] = gdk_pixbuf_new_from_file (EVOLUTION_ICONSDIR "/evolution-junk-mini.png", NULL); - initialised = TRUE; - } - - gtk_tree_model_get (model, iter, COL_STRING_FOLDER_PATH, &path, - COL_BOOL_IS_STORE, &is_store, -1); - - if (!is_store && path != NULL) { - if (!strcasecmp (path, "/Inbox")) - pixbuf = folder_icons[FOLDER_ICON_INBOX]; - else if (!strcasecmp (path, "/Outbox")) - pixbuf = folder_icons[FOLDER_ICON_OUTBOX]; - else if (*path == '/' && !strcasecmp (path + 1, CAMEL_VTRASH_NAME)) - pixbuf = folder_icons[FOLDER_ICON_TRASH]; - else if (*path == '/' && !strcasecmp (path + 1, CAMEL_VJUNK_NAME)) - pixbuf = folder_icons[FOLDER_ICON_JUNK]; - else - pixbuf = folder_icons[FOLDER_ICON_NORMAL]; - } - - g_object_set (renderer, "pixbuf", pixbuf, "visible", !is_store, NULL); -} - -static void -render_display_name (GtkTreeViewColumn *column, GtkCellRenderer *renderer, - GtkTreeModel *model, GtkTreeIter *iter, gpointer user_data) -{ - gboolean is_store, bold; - unsigned int unread; - char *display; - char *name; - - gtk_tree_model_get (model, iter, COL_STRING_DISPLAY_NAME, &name, - COL_BOOL_IS_STORE, &is_store, - COL_UINT_UNREAD, &unread, -1); - - if (!(bold = is_store || unread)) { - if (gtk_tree_model_iter_has_child (model, iter)) - bold = subdirs_contain_unread (model, iter); - } - - if (!is_store && unread) - display = g_strdup_printf ("%s (%u)", name, unread); - else - display = g_strdup (name); - - g_object_set (renderer, "text", display, - "weight", bold ? PANGO_WEIGHT_BOLD : PANGO_WEIGHT_NORMAL, - NULL); - - g_free (display); -} - -static void -em_folder_tree_init (EMFolderTree *emft) -{ - struct _EMFolderTreePrivate *priv; - - priv = g_new0 (struct _EMFolderTreePrivate, 1); - priv->selected_uri = NULL; - priv->selected_path = NULL; - priv->treeview = NULL; - priv->model = NULL; - emft->priv = priv; -} - -static void -em_folder_tree_finalize (GObject *obj) -{ - EMFolderTree *emft = (EMFolderTree *) obj; - - g_free (emft->priv->selected_uri); - g_free (emft->priv->selected_path); - g_free (emft->priv); - - G_OBJECT_CLASS (parent_class)->finalize (obj); -} - -static void -em_folder_tree_destroy (GtkObject *obj) -{ - EMFolderTree *emft = (EMFolderTree *) obj; - struct _EMFolderTreePrivate *priv = emft->priv; - - if (priv->loading_row_id != 0) { - g_signal_handler_disconnect (priv->model, priv->loading_row_id); - priv->loading_row_id = 0; - } - - if (priv->save_state_id != 0) { - g_source_remove (priv->save_state_id); - em_folder_tree_save_state (emft); - } - - priv->treeview = NULL; - priv->model = NULL; - - GTK_OBJECT_CLASS (parent_class)->destroy (obj); -} - - -static GtkTreeView * -folder_tree_new (EMFolderTreeModel *model) -{ - GtkTreeSelection *selection; - GtkTreeViewColumn *column; - GtkCellRenderer *renderer; - GtkWidget *tree; - - tree = gtk_tree_view_new_with_model ((GtkTreeModel *) model); - - column = gtk_tree_view_column_new (); - gtk_tree_view_append_column ((GtkTreeView *) tree, column); - - renderer = gtk_cell_renderer_pixbuf_new (); - gtk_tree_view_column_pack_start (column, renderer, FALSE); - gtk_tree_view_column_set_cell_data_func (column, renderer, render_pixbuf, NULL, NULL); - - renderer = gtk_cell_renderer_text_new (); - gtk_tree_view_column_pack_start (column, renderer, TRUE); - gtk_tree_view_column_set_cell_data_func (column, renderer, render_display_name, NULL, NULL); - - selection = gtk_tree_view_get_selection ((GtkTreeView *) tree); - gtk_tree_selection_set_mode (selection, GTK_SELECTION_SINGLE); - - gtk_tree_view_set_headers_visible ((GtkTreeView *) tree, FALSE); - - return (GtkTreeView *) tree; -} - -static void -em_folder_tree_construct (EMFolderTree *emft, EMFolderTreeModel *model) -{ - struct _EMFolderTreePrivate *priv = emft->priv; - GtkTreeSelection *selection; - GtkWidget *scrolled; - - scrolled = gtk_scrolled_window_new (NULL, NULL); - gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled), - GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); - gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled), GTK_SHADOW_IN); - - priv->model = model; - priv->treeview = folder_tree_new (model); - gtk_widget_show ((GtkWidget *) priv->treeview); - - g_signal_connect (priv->treeview, "row-expanded", G_CALLBACK (tree_row_expanded), emft); - g_signal_connect (priv->treeview, "row-collapsed", G_CALLBACK (tree_row_collapsed), emft); - g_signal_connect (priv->treeview, "button-press-event", G_CALLBACK (tree_button_press), emft); - - selection = gtk_tree_view_get_selection ((GtkTreeView *) priv->treeview); - g_signal_connect (selection, "changed", G_CALLBACK (tree_selection_changed), emft); - - gtk_container_add ((GtkContainer *) scrolled, (GtkWidget *) priv->treeview); - gtk_widget_show (scrolled); - - gtk_box_pack_start ((GtkBox *) emft, scrolled, TRUE, TRUE, 0); -} - - -GtkWidget * -em_folder_tree_new (void) -{ - EMFolderTreeModel *model; - EMFolderTree *emft; - - model = em_folder_tree_model_new (mail_component_peek_base_directory (mail_component_peek ())); - emft = (EMFolderTree *) em_folder_tree_new_with_model (model); - g_object_unref (model); - - return (GtkWidget *) emft; -} - - -struct _gsbn { - struct _EMFolderTreeModelStoreInfo *si; - const char *name; -}; - -static void -get_store_by_name (CamelStore *store, struct _EMFolderTreeModelStoreInfo *si, struct _gsbn *gsbn) -{ - if (!strcmp (si->display_name, gsbn->name)) - gsbn->si = si; -} - -static void -expand_node (const char *key, gpointer value, EMFolderTree *emft) -{ - struct _EMFolderTreePrivate *priv = emft->priv; - struct _EMFolderTreeModelStoreInfo *si; - GtkTreeRowReference *row; - GtkTreePath *path; - EAccount *account; - const char *p; - char *id; - - if (!(p = strchr (key, ':'))) - return; - - id = g_strndup (key, p - key); - if ((account = mail_config_get_account_by_uid (id))) { - CamelException ex; - CamelStore *store; - - camel_exception_init (&ex); - store = (CamelStore *) camel_session_get_service (session, account->source->url, CAMEL_PROVIDER_STORE, &ex); - camel_exception_clear (&ex); - - if (store == NULL || !(si = g_hash_table_lookup (priv->model->store_hash, store))) { - if (store) - camel_object_unref (store); - g_free (id); - return; - } - } else { - struct _gsbn gsbn; - - gsbn.si = NULL; - gsbn.name = id; - - g_hash_table_foreach (priv->model->store_hash, (GHFunc) get_store_by_name, &gsbn); - if (!(si = gsbn.si)) { - g_free (id); - return; - } - } - - g_free (id); - - p++; - if (!strcmp (p, "/")) - row = si->row; - else if (!(row = g_hash_table_lookup (si->path_hash, p))) - return; - - path = gtk_tree_row_reference_get_path (row); - gtk_tree_view_expand_to_path (priv->treeview, path); - gtk_tree_path_free (path); -} - - -static void -loading_row_cb (EMFolderTreeModel *model, GtkTreePath *tree_path, GtkTreeIter *iter, EMFolderTree *emft) -{ - struct _EMFolderTreeModelStoreInfo *si; - CamelStore *store; - EAccount *account; - char *path, *key; - - gtk_tree_model_get ((GtkTreeModel *) model, iter, - COL_STRING_FOLDER_PATH, &path, - COL_POINTER_CAMEL_STORE, &store, - -1); - - si = g_hash_table_lookup (model->store_hash, store); - if ((account = mail_config_get_account_by_name (si->display_name))) { - key = g_strdup_printf ("%s:%s", account->uid, path); - } else { - key = g_strdup_printf ("%s:%s", si->display_name, path); - } - - if (em_folder_tree_model_get_expanded (model, key)) - gtk_tree_view_expand_to_path (emft->priv->treeview, tree_path); - - g_free (key); -} - - -GtkWidget * -em_folder_tree_new_with_model (EMFolderTreeModel *model) -{ - EMFolderTree *emft; - - emft = g_object_new (EM_TYPE_FOLDER_TREE, NULL); - em_folder_tree_construct (emft, model); - g_object_ref (model); - - /* FIXME: this sucks... */ - g_hash_table_foreach (model->expanded, (GHFunc) expand_node, emft); - - emft->priv->loading_row_id = g_signal_connect (model, "loading-row", G_CALLBACK (loading_row_cb), emft); - - return (GtkWidget *) emft; -} - - -void -em_folder_tree_enable_drag_and_drop (EMFolderTree *emft) -{ - struct _EMFolderTreePrivate *priv; - - g_return_if_fail (EM_IS_FOLDER_TREE (emft)); - - priv = emft->priv; - gtk_tree_view_enable_model_drag_source (priv->treeview, 0, drag_types, num_drag_types, - GDK_ACTION_COPY | GDK_ACTION_MOVE); - gtk_tree_view_enable_model_drag_dest (priv->treeview, drop_types, num_drop_types, - GDK_ACTION_COPY | GDK_ACTION_MOVE); -} - - -#if 0 -static void -dump_fi (CamelFolderInfo *fi, int depth) -{ - int i; - - while (fi != NULL) { - for (i = 0; i < depth; i++) - fputs (" ", stdout); - - printf ("path='%s'; full_name='%s'\n", fi->path, fi->full_name); - - if (fi->child) - dump_fi (fi->child, depth + 1); - - fi = fi->sibling; - } -} -#endif - -struct _EMFolderTreeGetFolderInfo { - struct _mail_msg msg; - - /* input data */ - GtkTreeRowReference *root; - EMFolderTree *emft; - CamelStore *store; - guint32 flags; - char *top; - - /* output data */ - CamelFolderInfo *fi; - - /* uri to select if any after the op is done */ - char *select_uri; -}; - -static void -em_folder_tree_get_folder_info__get (struct _mail_msg *mm) -{ - struct _EMFolderTreeGetFolderInfo *m = (struct _EMFolderTreeGetFolderInfo *) mm; - guint32 flags = m->flags; - - if (camel_store_supports_subscriptions (m->store)) - flags |= CAMEL_STORE_FOLDER_INFO_SUBSCRIBED; - - m->fi = camel_store_get_folder_info (m->store, m->top, flags, &mm->ex); -} - -static void -em_folder_tree_get_folder_info__got (struct _mail_msg *mm) -{ - struct _EMFolderTreeGetFolderInfo *m = (struct _EMFolderTreeGetFolderInfo *) mm; - struct _EMFolderTreePrivate *priv = m->emft->priv; - struct _EMFolderTreeModelStoreInfo *si; - GtkTreeIter root, iter; - CamelFolderInfo *fi; - GtkTreeStore *model; - GtkTreePath *path; - gboolean load; - - /* check that we haven't been destroyed */ - if (priv->treeview == NULL) - return; - - /* check that our parent folder hasn't been deleted/unsubscribed */ - if (!gtk_tree_row_reference_valid (m->root)) - return; - - if (!(si = g_hash_table_lookup (priv->model->store_hash, m->store))) { - /* store has been removed in the interim - do nothing */ - return; - } - - model = (GtkTreeStore *) gtk_tree_view_get_model (priv->treeview); - - path = gtk_tree_row_reference_get_path (m->root); - gtk_tree_model_get_iter ((GtkTreeModel *) model, &root, path); - gtk_tree_path_free (path); - - /* make sure we still need to load the tree subfolders... */ - gtk_tree_model_get ((GtkTreeModel *) model, &root, - COL_BOOL_LOAD_SUBDIRS, &load, - -1); - if (!load) - return; - - /* get the first child (which will be a dummy node) */ - gtk_tree_model_iter_children ((GtkTreeModel *) model, &iter, &root); - - /* FIXME: camel's IMAP code is totally on crack here, @top's - * folder info should be @fi and fi->child should be what we - * want to fill our tree with... *sigh* */ - if (m->top && !strcmp (m->fi->full_name, m->top)) { - if (!(fi = m->fi->child)) - fi = m->fi->sibling; - } else - fi = m->fi; - - if (fi == NULL) { - /* no children afterall... remove the "Loading..." placeholder node */ - gtk_tree_store_remove (model, &iter); - } else { - do { - em_folder_tree_model_set_folder_info (priv->model, &iter, si, fi); - - if ((fi = fi->sibling) != NULL) - gtk_tree_store_append (model, &iter, &root); - } while (fi != NULL); - } - - gtk_tree_store_set (model, &root, COL_BOOL_LOAD_SUBDIRS, FALSE, -1); - - if (m->select_uri) - em_folder_tree_set_selected (m->emft, m->select_uri); - - em_folder_tree_queue_save_state (m->emft); -} - -static void -em_folder_tree_get_folder_info__free (struct _mail_msg *mm) -{ - struct _EMFolderTreeGetFolderInfo *m = (struct _EMFolderTreeGetFolderInfo *) mm; - - camel_store_free_folder_info (m->store, m->fi); - - gtk_tree_row_reference_free (m->root); - camel_object_unref (m->store); - g_free (m->select_uri); - g_free (m->top); -} - -static struct _mail_msg_op get_folder_info_op = { - NULL, - em_folder_tree_get_folder_info__get, - em_folder_tree_get_folder_info__got, - em_folder_tree_get_folder_info__free, -}; - -static void -update_model_expanded_state (struct _EMFolderTreePrivate *priv, GtkTreeIter *iter, gboolean expanded) -{ - struct _EMFolderTreeModelStoreInfo *si; - CamelStore *store; - EAccount *account; - char *path, *key; - - gtk_tree_model_get ((GtkTreeModel *) priv->model, iter, - COL_STRING_FOLDER_PATH, &path, - COL_POINTER_CAMEL_STORE, &store, - -1); - - si = g_hash_table_lookup (priv->model->store_hash, store); - if ((account = mail_config_get_account_by_name (si->display_name))) { - key = g_strdup_printf ("%s:%s", account->uid, path); - } else { - key = g_strdup_printf ("%s:%s", si->display_name, path); - } - - em_folder_tree_model_set_expanded (priv->model, key, expanded); - g_free (key); -} - -static void -tree_row_expanded (GtkTreeView *treeview, GtkTreeIter *root, GtkTreePath *tree_path, EMFolderTree *emft) -{ - struct _EMFolderTreePrivate *priv = emft->priv; - struct _EMFolderTreeGetFolderInfo *m; - GtkTreeModel *model; - CamelStore *store; - const char *top; - gboolean load; - char *path; - - model = gtk_tree_view_get_model (treeview); - - gtk_tree_model_get (model, root, - COL_STRING_FOLDER_PATH, &path, - COL_POINTER_CAMEL_STORE, &store, - COL_BOOL_LOAD_SUBDIRS, &load, - -1); - - update_model_expanded_state (priv, root, TRUE); - - if (!load) { - em_folder_tree_queue_save_state (emft); - return; - } - - if (!path || !strcmp (path, "/")) - top = NULL; - else - top = path + 1; - - m = mail_msg_new (&get_folder_info_op, NULL, sizeof (struct _EMFolderTreeGetFolderInfo)); - m->root = gtk_tree_row_reference_new (model, tree_path); - camel_object_ref (store); - m->store = store; - m->emft = emft; - m->top = g_strdup (top); - m->flags = 0; - m->select_uri = NULL; - - e_thread_put (mail_thread_new, (EMsg *) m); -} - -static void -tree_row_collapsed (GtkTreeView *treeview, GtkTreeIter *root, GtkTreePath *tree_path, EMFolderTree *emft) -{ - update_model_expanded_state (emft->priv, root, FALSE); - em_folder_tree_queue_save_state (emft); -} - -#if 0 -static void -emft_popup_view (GtkWidget *item, EMFolderTree *emft) -{ - -} - -static void -emft_popup_open_new (GtkWidget *item, EMFolderTree *emft) -{ -} -#endif - - -struct _EMCopyFolders { - struct _mail_msg msg; - - /* input data */ - CamelStore *fromstore; - CamelStore *tostore; - - char *frombase; - char *tobase; - - int delete; -}; - -static void -em_copy_folders__copy (struct _mail_msg *mm) -{ - struct _EMCopyFolders *m = (struct _EMCopyFolders *) mm; - guint32 flags = CAMEL_STORE_FOLDER_INFO_RECURSIVE; - GList *pending = NULL, *deleting = NULL, *l; - GString *fromname, *toname; - CamelFolderInfo *fi; - const char *tmp; - int fromlen; - - if (camel_store_supports_subscriptions (m->fromstore)) - flags |= CAMEL_STORE_FOLDER_INFO_SUBSCRIBED; - - if (!(fi = camel_store_get_folder_info (m->fromstore, m->frombase, flags, &mm->ex))) - return; - - pending = g_list_append (pending, fi); - - toname = g_string_new (""); - fromname = g_string_new (""); - - tmp = strrchr (m->frombase, '/'); - if (tmp == NULL) - fromlen = 0; - else - fromlen = tmp - m->frombase + 1; - - d(printf ("top name is '%s'\n", fi->full_name)); - - while (pending) { - CamelFolderInfo *info = pending->data; - - pending = g_list_remove_link (pending, pending); - while (info) { - CamelFolder *fromfolder, *tofolder; - GPtrArray *uids; - - if (info->child) - pending = g_list_append (pending, info->child); - - if (m->tobase[0]) - g_string_printf (toname, "%s/%s", m->tobase, info->full_name + fromlen); - else - g_string_printf (toname, "%s", info->full_name + fromlen); - - d(printf ("Copying from '%s' to '%s'\n", info->full_name, toname->str)); - - /* This makes sure we create the same tree, e.g. from a nonselectable source */ - /* Not sure if this is really the 'right thing', e.g. for spool stores, but it makes the ui work */ - if ((info->flags & CAMEL_FOLDER_NOSELECT) == 0) { - d(printf ("this folder is selectable\n")); - if (!(fromfolder = camel_store_get_folder (m->fromstore, info->full_name, 0, &mm->ex))) - goto exception; - - if (!(tofolder = camel_store_get_folder (m->tostore, toname->str, CAMEL_STORE_FOLDER_CREATE, &mm->ex))) { - camel_object_unref (fromfolder); - goto exception; - } - - if (camel_store_supports_subscriptions (m->tostore) - && !camel_store_folder_subscribed (m->tostore, toname->str)) - camel_store_subscribe_folder (m->tostore, toname->str, NULL); - - uids = camel_folder_get_uids (fromfolder); - camel_folder_transfer_messages_to (fromfolder, uids, tofolder, NULL, m->delete, &mm->ex); - camel_folder_free_uids (fromfolder, uids); - - camel_object_unref (fromfolder); - camel_object_unref (tofolder); - } - - if (camel_exception_is_set (&mm->ex)) - goto exception; - else if (m->delete) - deleting = g_list_prepend (deleting, info); - - info = info->sibling; - } - } - - /* delete the folders in reverse order from how we copyied them, if we are deleting any */ - l = deleting; - while (l) { - CamelFolderInfo *info = l->data; - - d(printf ("deleting folder '%s'\n", info->full_name)); - - if (camel_store_supports_subscriptions (m->fromstore)) - camel_store_unsubscribe_folder (m->fromstore, info->full_name, NULL); - - camel_store_delete_folder (m->fromstore, info->full_name, NULL); - l = l->next; - } - - exception: - - camel_store_free_folder_info (m->fromstore, fi); - g_list_free (deleting); - - g_string_free (toname, TRUE); - g_string_free (fromname, TRUE); -} - -static void -em_copy_folders__free (struct _mail_msg *mm) -{ - struct _EMCopyFolders *m = (struct _EMCopyFolders *) mm; - - camel_object_unref (m->fromstore); - camel_object_unref (m->tostore); - - g_free (m->frombase); - g_free (m->tobase); -} - -static struct _mail_msg_op copy_folders_op = { - NULL, - em_copy_folders__copy, - NULL, - em_copy_folders__free, -}; - -static void -em_copy_folders (CamelStore *tostore, const char *tobase, CamelStore *fromstore, const char *frombase, int delete) -{ - struct _EMCopyFolders *m; - - m = mail_msg_new (©_folders_op, NULL, sizeof (struct _EMCopyFolders)); - camel_object_ref (fromstore); - m->fromstore = fromstore; - camel_object_ref (tostore); - m->tostore = tostore; - m->frombase = g_strdup (frombase); - m->tobase = g_strdup (tobase); - m->delete = delete; - - e_thread_put (mail_thread_new, (EMsg *) m); -} - -struct _copy_folder_data { - EMFolderTree *emft; - gboolean delete; -}; - -static void -emft_popup_copy_folder_selected (const char *uri, void *data) -{ - struct _copy_folder_data *cfd = data; - struct _EMFolderTreePrivate *priv; - CamelStore *fromstore, *tostore; - char *tobase, *frombase; - CamelException ex; - GtkWidget *dialog; - CamelURL *url; - - if (uri == NULL) { - g_free (cfd); - return; - } - - priv = cfd->emft->priv; - - d(printf ("copying folder '%s' to '%s'\n", priv->selected_path, uri)); - - camel_exception_init (&ex); - if (!(fromstore = camel_session_get_store (session, priv->selected_uri, &ex))) - goto exception; - - frombase = priv->selected_path + 1; - - if (!(tostore = camel_session_get_store (session, uri, &ex))) { - camel_object_unref (fromstore); - goto exception; - } - - url = camel_url_new (uri, NULL); - if (url->fragment) - tobase = url->fragment; - else if (url->path && url->path[0]) - tobase = url->path + 1; - else - tobase = ""; - - em_copy_folders (tostore, tobase, fromstore, frombase, cfd->delete); - - camel_url_free (url); - g_free (cfd); - - return; - - exception: - - dialog = gtk_message_dialog_new ((GtkWindow *) cfd->emft, GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, _("%s"), ex.desc); - g_signal_connect (dialog, "response", G_CALLBACK (gtk_widget_destroy), dialog); - camel_exception_clear (&ex); - gtk_widget_show (dialog); - g_free (cfd); -} - -static void -emft_popup_copy (GtkWidget *item, EMFolderTree *emft) -{ - struct _copy_folder_data *cfd; - - cfd = g_malloc (sizeof (*cfd)); - cfd->emft = emft; - cfd->delete = FALSE; - - em_select_folder (NULL, _("Select folder"), - NULL, emft_popup_copy_folder_selected, cfd); -} - -static void -emft_popup_move (GtkWidget *item, EMFolderTree *emft) -{ - struct _copy_folder_data *cfd; - - cfd = g_malloc (sizeof (*cfd)); - cfd->emft = emft; - cfd->delete = TRUE; - - em_select_folder (NULL, _("Select folder"), - NULL, emft_popup_copy_folder_selected, cfd); -} - - -gboolean -em_folder_tree_create_folder (EMFolderTree *emft, const char *path, const char *uri) -{ - struct _EMFolderTreePrivate *priv = emft->priv; - struct _EMFolderTreeModelStoreInfo *si; - const char *parent, *full_name; - char *name, *namebuf = NULL; - GtkWidget *dialog; - CamelStore *store; - CamelException ex; - - d(printf ("Creating folder: %s (%s)\n", path, uri)); - - camel_exception_init (&ex); - if (!(store = (CamelStore *) camel_session_get_service (session, uri, CAMEL_PROVIDER_STORE, &ex))) - goto exception; - - if (!(si = g_hash_table_lookup (priv->model->store_hash, store))) { - camel_object_unref (store); - g_assert_not_reached (); - goto exception; - } - - camel_object_unref (store); - - full_name = path[0] == '/' ? path + 1 : path; - namebuf = g_strdup (full_name); - if (!(name = strrchr (namebuf, '/'))) { - name = namebuf; - parent = ""; - } else { - *name++ = '\0'; - parent = namebuf; - } - - d(printf ("creating folder parent='%s' name='%s' path='%s'\n", parent, name, path)); - - camel_store_create_folder (si->store, parent, name, &ex); - if (camel_exception_is_set (&ex)) { - goto exception; - } else if (camel_store_supports_subscriptions (si->store)) { - camel_store_subscribe_folder (si->store, full_name, &ex); - if (camel_exception_is_set (&ex)) - goto exception; - } - - g_free (namebuf); - - return TRUE; - - exception: - - dialog = gtk_message_dialog_new ((GtkWindow *) emft, GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, _("%s"), ex.desc); - g_signal_connect (dialog, "response", G_CALLBACK (gtk_widget_destroy), dialog); - camel_exception_clear (&ex); - g_free (namebuf); - - gtk_widget_show (dialog); - - return FALSE; -} - -static void -emft_popup_new_folder_response (EMFolderSelector *emfs, int response, EMFolderTree *emft) -{ - const char *uri, *path; - - if (response != GTK_RESPONSE_OK) { - gtk_widget_destroy ((GtkWidget *) emfs); - return; - } - - uri = em_folder_selector_get_selected_uri (emfs); - path = em_folder_selector_get_selected_path (emfs); - - if (em_folder_tree_create_folder (emfs->emft, path, uri)) - gtk_widget_destroy ((GtkWidget *) emfs); -} - -static void -emft_popup_new_folder (GtkWidget *item, EMFolderTree *emft) -{ - EMFolderTree *folder_tree; - GtkWidget *dialog; - - folder_tree = (EMFolderTree *) em_folder_tree_new_with_model (emft->priv->model); - - dialog = em_folder_selector_create_new (folder_tree, 0, _("Create folder"), _("Specify where to create the folder:")); - em_folder_selector_set_selected ((EMFolderSelector *) dialog, emft->priv->selected_uri); - g_signal_connect (dialog, "response", G_CALLBACK (emft_popup_new_folder_response), emft); - gtk_widget_show (dialog); -} - -static void -emft_popup_delete_rec (CamelStore *store, CamelFolderInfo *fi, CamelException *ex) -{ - while (fi) { - CamelFolder *folder; - - if (fi->child) { - emft_popup_delete_rec (store, fi->child, ex); - - if (camel_exception_is_set (ex)) - return; - } - - d(printf ("deleting folder '%s'\n", fi->full_name)); - - /* shouldn't camel do this itself? */ - if (camel_store_supports_subscriptions (store)) - camel_store_unsubscribe_folder (store, fi->full_name, NULL); - - folder = camel_store_get_folder (store, fi->full_name, 0, NULL); - if (folder) { - GPtrArray *uids = camel_folder_get_uids (folder); - int i; - - camel_folder_freeze (folder); - for (i = 0; i < uids->len; i++) - camel_folder_delete_message (folder, uids->pdata[i]); - camel_folder_sync (folder, TRUE, NULL); - camel_folder_thaw (folder); - camel_folder_free_uids (folder, uids); - } - - camel_store_delete_folder (store, fi->full_name, ex); - if (camel_exception_is_set (ex)) - return; - - fi = fi->sibling; - } -} - -static void -emft_popup_delete_folders (CamelStore *store, const char *path, CamelException *ex) -{ - guint32 flags = CAMEL_STORE_FOLDER_INFO_RECURSIVE; - const char *full_name; - CamelFolderInfo *fi; - - if (camel_store_supports_subscriptions (store)) - flags |= CAMEL_STORE_FOLDER_INFO_SUBSCRIBED; - - full_name = path[0] == '/' ? path + 1 : path; - fi = camel_store_get_folder_info (store, full_name, flags, ex); - if (camel_exception_is_set (ex)) - return; - - emft_popup_delete_rec (store, fi, ex); - camel_store_free_folder_info (store, fi); -} - -static void -emft_popup_delete_response (GtkWidget *dialog, guint response, EMFolderTree *emft) -{ - struct _EMFolderTreePrivate *priv = emft->priv; - GtkTreeSelection *selection; - GtkTreeModel *model; - CamelStore *store; - CamelException ex; - GtkTreeIter iter; - char *path; - - gtk_widget_destroy (dialog); - if (response != GTK_RESPONSE_OK) - return; - - selection = gtk_tree_view_get_selection (priv->treeview); - gtk_tree_selection_get_selected (selection, &model, &iter); - gtk_tree_model_get (model, &iter, COL_STRING_FOLDER_PATH, &path, - COL_POINTER_CAMEL_STORE, &store, -1); - - camel_exception_init (&ex); - emft_popup_delete_folders (store, path, &ex); - if (camel_exception_is_set (&ex)) { - e_notice (NULL, GTK_MESSAGE_ERROR, _("Could not delete folder: %s"), ex.desc); - camel_exception_clear (&ex); - } -} - -static void -emft_popup_delete_folder (GtkWidget *item, EMFolderTree *emft) -{ - struct _EMFolderTreePrivate *priv = emft->priv; - GtkTreeSelection *selection; - GtkTreeModel *model; - GtkTreeIter iter; - GtkWidget *dialog; - char *title, *path; - - selection = gtk_tree_view_get_selection (priv->treeview); - gtk_tree_selection_get_selected (selection, &model, &iter); - gtk_tree_model_get (model, &iter, COL_STRING_FOLDER_PATH, &path, -1); - - dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_MODAL, - GTK_MESSAGE_QUESTION, GTK_BUTTONS_NONE, - _("Really delete folder \"%s\" and all of its subfolders?"), - path); - - gtk_dialog_add_button ((GtkDialog *) dialog, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL); - gtk_dialog_add_button ((GtkDialog *) dialog, GTK_STOCK_DELETE, GTK_RESPONSE_OK); - - gtk_dialog_set_default_response ((GtkDialog *) dialog, GTK_RESPONSE_OK); - gtk_container_set_border_width ((GtkContainer *) dialog, 6); - gtk_box_set_spacing ((GtkBox *) ((GtkDialog *) dialog)->vbox, 6); - - title = g_strdup_printf (_("Delete \"%s\""), path); - gtk_window_set_title ((GtkWindow *) dialog, title); - g_free (title); - - g_signal_connect (dialog, "response", G_CALLBACK (emft_popup_delete_response), emft); - gtk_widget_show (dialog); -} - -static void -emft_popup_rename_folder (GtkWidget *item, EMFolderTree *emft) -{ - struct _EMFolderTreePrivate *priv = emft->priv; - char *prompt, *folder_path, *name, *new_name, *uri; - GtkTreeSelection *selection; - const char *full_name, *p; - gboolean done = FALSE; - GtkTreeModel *model; - CamelStore *store; - GtkTreeIter iter; - size_t base_len; - - selection = gtk_tree_view_get_selection (priv->treeview); - gtk_tree_selection_get_selected (selection, &model, &iter); - gtk_tree_model_get (model, &iter, COL_STRING_FOLDER_PATH, &folder_path, - COL_STRING_DISPLAY_NAME, &name, - COL_POINTER_CAMEL_STORE, &store, - COL_STRING_URI, &uri, -1); - - full_name = folder_path[0] == '/' ? folder_path + 1 : folder_path; - if ((p = strrchr (full_name, '/'))) - base_len = (size_t) (p - full_name); - else - base_len = 0; - - prompt = g_strdup_printf (_("Rename the \"%s\" folder to:"), name); - while (!done) { - const char *why; - - new_name = e_request_string (NULL, _("Rename Folder"), prompt, name); - if (new_name == NULL || !strcmp (name, new_name)) { - /* old name == new name */ - done = TRUE; - } else { - CamelFolderInfo *fi; - CamelException ex; - char *path, *p; - - if (base_len > 0) { - path = g_malloc (base_len + strlen (new_name) + 2); - memcpy (path, full_name, base_len); - p = path + base_len; - *p++ = '/'; - strcpy (p, new_name); - } else { - path = g_strdup (new_name); - } - - camel_exception_init (&ex); - if ((fi = camel_store_get_folder_info (store, path, CAMEL_STORE_FOLDER_INFO_FAST, &ex)) != NULL) { - camel_store_free_folder_info (store, fi); - - e_notice (NULL, GTK_MESSAGE_ERROR, - _("A folder named \"%s\" already exists. Please use a different name."), - new_name); - } else { - const char *oldpath, *newpath; - - oldpath = full_name; - newpath = path; - - d(printf ("renaming %s to %s\n", oldpath, newpath)); - - camel_exception_clear (&ex); - camel_store_rename_folder (store, oldpath, newpath, &ex); - if (camel_exception_is_set (&ex)) { - e_notice (NULL, GTK_MESSAGE_ERROR, _("Could not rename folder: %s"), ex.desc); - camel_exception_clear (&ex); - } - - done = TRUE; - } - - g_free (path); - } - - g_free (new_name); - } -} - -struct _prop_data { - void *object; - CamelArgV *argv; - GtkWidget **widgets; -}; - -static void -emft_popup_properties_response (GtkWidget *dialog, int response, struct _prop_data *prop_data) -{ - CamelArgV *argv = prop_data->argv; - int i; - - if (response != GTK_RESPONSE_OK) { - gtk_widget_destroy (dialog); - return; - } - - for (i = 0; i < argv->argc; i++) { - CamelArg *arg = &argv->argv[i]; - - switch (arg->tag & CAMEL_ARG_TYPE) { - case CAMEL_ARG_BOO: - arg->ca_int = gtk_toggle_button_get_active ((GtkToggleButton *) prop_data->widgets[i]); - break; - case CAMEL_ARG_STR: - g_free (arg->ca_str); - arg->ca_str = (char *) gtk_entry_get_text ((GtkEntry *) prop_data->widgets[i]); - break; - default: - g_assert_not_reached (); - break; - } - } - - camel_object_setv (prop_data->object, NULL, argv); - gtk_widget_destroy (dialog); -} - -static void -emft_popup_properties_free (void *data) -{ - struct _prop_data *prop_data = data; - int i; - - for (i = 0; i < prop_data->argv->argc; i++) { - if ((prop_data->argv->argv[i].tag & CAMEL_ARG_TYPE) == CAMEL_ARG_STR) - g_free (prop_data->argv->argv[i].ca_str); - } - - camel_object_unref (prop_data->object); - g_free (prop_data->argv); - g_free (prop_data); -} - -static void -emft_popup_properties_got_folder (char *uri, CamelFolder *folder, void *data) -{ - GtkWidget *dialog, *w, *table, *label; - struct _prop_data *prop_data; - CamelArgGetV *arggetv; - CamelArgV *argv; - GSList *list, *l; - gint32 count, i; - char *name; - int row = 1; - - if (folder == NULL) - return; - - camel_object_get (folder, NULL, CAMEL_FOLDER_PROPERTIES, &list, CAMEL_FOLDER_NAME, &name, NULL); - - dialog = gtk_dialog_new_with_buttons (_("Folder properties"), NULL, - GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_STOCK_OK, GTK_RESPONSE_OK, - NULL); - - /* TODO: maybe we want some basic properties here, like message counts/approximate size/etc */ - w = gtk_frame_new (_("Properties")); - gtk_widget_show (w); - gtk_box_pack_start ((GtkBox *) ((GtkDialog *) dialog)->vbox, w, TRUE, TRUE, 6); - - table = gtk_table_new (g_slist_length (list) + 1, 2, FALSE); - gtk_widget_show (table); - gtk_container_add ((GtkContainer *) w, table); - - label = gtk_label_new (_("Folder Name")); - gtk_widget_show (label); - gtk_misc_set_alignment ((GtkMisc *) label, 1.0, 0.5); - gtk_table_attach ((GtkTable *) table, label, 0, 1, 0, 1, GTK_FILL | GTK_EXPAND, 0, 3, 0); - - label = gtk_label_new (name); - gtk_widget_show (label); - gtk_misc_set_alignment ((GtkMisc *) label, 0.0, 0.5); - gtk_table_attach ((GtkTable *) table, label, 1, 2, 0, 1, GTK_FILL | GTK_EXPAND, 0, 3, 0); - - /* build an arggetv/argv to retrieve/store the results */ - count = g_slist_length (list); - arggetv = g_malloc0 (sizeof (*arggetv) + (count - CAMEL_ARGV_MAX) * sizeof (arggetv->argv[0])); - arggetv->argc = count; - argv = g_malloc0 (sizeof (*argv) + (count - CAMEL_ARGV_MAX) * sizeof (argv->argv[0])); - argv->argc = count; - - i = 0; - l = list; - while (l) { - CamelProperty *prop = l->data; - - argv->argv[i].tag = prop->tag; - arggetv->argv[i].tag = prop->tag; - arggetv->argv[i].ca_ptr = &argv->argv[i].ca_ptr; - - l = l->next; - i++; - } - - camel_object_getv (folder, NULL, arggetv); - g_free (arggetv); - - prop_data = g_malloc0 (sizeof (*prop_data)); - prop_data->widgets = g_malloc0 (sizeof (prop_data->widgets[0]) * count); - prop_data->argv = argv; - - /* setup the ui with the values retrieved */ - l = list; - i = 0; - while (l) { - CamelProperty *prop = l->data; - - switch (prop->tag & CAMEL_ARG_TYPE) { - case CAMEL_ARG_BOO: - w = gtk_check_button_new_with_label (prop->description); - gtk_toggle_button_set_active ((GtkToggleButton *) w, argv->argv[i].ca_int != 0); - gtk_widget_show (w); - gtk_table_attach ((GtkTable *) table, w, 0, 2, row, row + 1, 0, 0, 3, 3); - prop_data->widgets[i] = w; - break; - case CAMEL_ARG_STR: - label = gtk_label_new (prop->description); - gtk_misc_set_alignment ((GtkMisc *) label, 1.0, 0.5); - gtk_widget_show (label); - gtk_table_attach ((GtkTable *) table, label, 0, 1, row, row + 1, GTK_FILL | GTK_EXPAND, 0, 3, 3); - - w = gtk_entry_new (); - gtk_widget_show (w); - if (argv->argv[i].ca_str) { - gtk_entry_set_text ((GtkEntry *) w, argv->argv[i].ca_str); - camel_object_free (folder, argv->argv[i].tag, argv->argv[i].ca_str); - argv->argv[i].ca_str = NULL; - } - gtk_table_attach ((GtkTable *) table, w, 1, 2, row, row + 1, GTK_FILL, 0, 3, 3); - prop_data->widgets[i] = w; - break; - default: - g_assert_not_reached (); - break; - } - - row++; - l = l->next; - } - - prop_data->object = folder; - camel_object_ref (folder); - - camel_object_free (folder, CAMEL_FOLDER_PROPERTIES, list); - camel_object_free (folder, CAMEL_FOLDER_NAME, name); - - /* we do 'apply on ok' ... since instant apply may apply some very long running tasks */ - - g_signal_connect (dialog, "response", G_CALLBACK (emft_popup_properties_response), prop_data); - g_object_set_data_full ((GObject *) dialog, "e-prop-data", prop_data, emft_popup_properties_free); - gtk_widget_show (dialog); -} - -static void -emft_popup_properties (GtkWidget *item, EMFolderTree *emft) -{ - struct _EMFolderTreePrivate *priv = emft->priv; - GtkTreeSelection *selection; - GtkTreeModel *model; - GtkTreeIter iter; - char *uri; - - selection = gtk_tree_view_get_selection (priv->treeview); - gtk_tree_selection_get_selected (selection, &model, &iter); - gtk_tree_model_get (model, &iter, COL_STRING_URI, &uri, -1); - - mail_get_folder (uri, 0, emft_popup_properties_got_folder, emft, mail_thread_new); -} - -static EMPopupItem emft_popup_menu[] = { -#if 0 - { EM_POPUP_ITEM, "00.emc.00", N_("_View"), G_CALLBACK (emft_popup_view), NULL, NULL, 0 }, - { EM_POPUP_ITEM, "00.emc.01", N_("Open in _New Window"), G_CALLBACK (emft_popup_open_new), NULL, NULL, 0 }, - - { EM_POPUP_BAR, "10.emc" }, -#endif - { EM_POPUP_ITEM, "10.emc.00", N_("_Copy"), G_CALLBACK (emft_popup_copy), NULL, "folder-copy-16.png", 0 }, - { EM_POPUP_ITEM, "10.emc.01", N_("_Move"), G_CALLBACK (emft_popup_move), NULL, "folder-move-16.png", 0 }, - - { EM_POPUP_BAR, "20.emc" }, - { EM_POPUP_ITEM, "20.emc.00", N_("_New Folder..."), G_CALLBACK (emft_popup_new_folder), NULL, "folder-mini.png", 0 }, - { EM_POPUP_ITEM, "20.emc.01", N_("_Delete"), G_CALLBACK (emft_popup_delete_folder), NULL, "evolution-trash-mini.png", 0 }, - { EM_POPUP_ITEM, "20.emc.01", N_("_Rename"), G_CALLBACK (emft_popup_rename_folder), NULL, NULL, 0 }, - - { EM_POPUP_BAR, "80.emc" }, - { EM_POPUP_ITEM, "80.emc.00", N_("_Properties..."), G_CALLBACK (emft_popup_properties), NULL, "configure_16_folder.xpm", 0 }, -}; - -static gboolean -tree_button_press (GtkWidget *treeview, GdkEventButton *event, EMFolderTree *emft) -{ - GSList *menus = NULL; - GtkMenu *menu; - EMPopup *emp; - int i; - - if (event->button != 3) - return FALSE; - - /* handle right-click by opening a context menu */ - emp = em_popup_new ("com.ximian.mail.storageset.popup.select"); - - for (i = 0; i < sizeof (emft_popup_menu) / sizeof (emft_popup_menu[0]); i++) { - EMPopupItem *item = &emft_popup_menu[i]; - - item->activate_data = emft; - menus = g_slist_prepend (menus, item); - } - - em_popup_add_items (emp, menus, (GDestroyNotify) g_slist_free); - - menu = em_popup_create_menu_once (emp, NULL, 0, 0); - - if (event == NULL || event->type == GDK_KEY_PRESS) { - /* FIXME: menu pos function */ - gtk_menu_popup (menu, NULL, NULL, NULL, NULL, 0, event->time); - } else { - gtk_menu_popup (menu, NULL, NULL, NULL, NULL, event->button, event->time); - } - - return TRUE; -} - - -static void -tree_selection_changed (GtkTreeSelection *selection, EMFolderTree *emft) -{ - struct _EMFolderTreePrivate *priv = emft->priv; - GtkTreeModel *model; - GtkTreeIter iter; - char *path, *uri; - - if (!gtk_tree_selection_get_selected (selection, &model, &iter)) - return; - - gtk_tree_model_get (model, &iter, COL_STRING_FOLDER_PATH, &path, - COL_STRING_URI, &uri, -1); - - g_free (priv->selected_uri); - priv->selected_uri = g_strdup (uri); - - g_free (priv->selected_path); - priv->selected_path = g_strdup (path); - - g_signal_emit (emft, signals[FOLDER_SELECTED], 0, path, uri); -} - - -void -em_folder_tree_set_selected (EMFolderTree *emft, const char *uri) -{ - struct _EMFolderTreeModelStoreInfo *si; - struct _EMFolderTreeGetFolderInfo *m; - struct _EMFolderTreePrivate *priv; - GtkTreeRowReference *row = NULL; - GtkTreeSelection *selection; - GtkTreePath *tree_path; - CamelStore *store; - CamelException ex; - const char *top; - char *path, *p; - CamelURL *url; - - g_return_if_fail (EM_IS_FOLDER_TREE (emft)); - - priv = emft->priv; - - camel_exception_init (&ex); - if (!(store = (CamelStore *) camel_session_get_service (session, uri, CAMEL_PROVIDER_STORE, &ex))) { - camel_exception_clear (&ex); - return; - } - - if (!(si = g_hash_table_lookup (priv->model->store_hash, store))) { - camel_object_unref (store); - return; - } - - if (!(url = camel_url_new (uri, NULL))) { - camel_object_unref (store); - return; - } - - if (((CamelService *) store)->provider->url_flags & CAMEL_URL_FRAGMENT_IS_PATH) - path = g_strdup_printf ("/%s", url->fragment ? url->fragment : ""); - else - path = g_strdup (url->path ? url->path : "/"); - - top = path[0] == '/' ? path + 1 : path; - camel_url_free (url); - - if (!strcmp (path, "/")) - row = si->row; - - if (row || (row = g_hash_table_lookup (si->path_hash, path))) { - /* the folder-info node has already been loaded */ - tree_path = gtk_tree_row_reference_get_path (row); - gtk_tree_view_expand_to_path (priv->treeview, tree_path); - selection = gtk_tree_view_get_selection (priv->treeview); - gtk_tree_selection_select_path (selection, tree_path); - gtk_tree_path_free (tree_path); - camel_object_unref (store); - g_free (path); - return; - } - - /* look for the first of our parent folders that has already been loaded */ - p = path + strlen (path); - while (p > path) { - if (*p == '/') { - *p = '\0'; - - if ((row = g_hash_table_lookup (si->path_hash, path))) - break; - } - - p--; - } - - if (row == NULL) { - /* none of the folders of the desired store have been loaded yet */ - row = si->row; - top = NULL; - } - - /* FIXME: this gets all the subfolders of our first loaded - * parent folder - ideally we'd only get what we needed, but - * it's probably not worth the effort */ - m = mail_msg_new (&get_folder_info_op, NULL, sizeof (struct _EMFolderTreeGetFolderInfo)); - m->root = gtk_tree_row_reference_copy (row); - m->store = store; - m->emft = emft; - m->top = top ? g_strdup (top) : NULL; - m->flags = CAMEL_STORE_FOLDER_INFO_RECURSIVE; - m->select_uri = g_strdup (uri); - - g_free (path); - - e_thread_put (mail_thread_new, (EMsg *) m); -} - - -const char * -em_folder_tree_get_selected_uri (EMFolderTree *emft) -{ - g_return_val_if_fail (EM_IS_FOLDER_TREE (emft), NULL); - - return emft->priv->selected_uri; -} - - -const char * -em_folder_tree_get_selected_path (EMFolderTree *emft) -{ - g_return_val_if_fail (EM_IS_FOLDER_TREE (emft), NULL); - - return emft->priv->selected_path; -} - - -EMFolderTreeModel * -em_folder_tree_get_model (EMFolderTree *emft) -{ - g_return_val_if_fail (EM_IS_FOLDER_TREE (emft), NULL); - - return emft->priv->model; -} - - -static gboolean -em_folder_tree_save_state (EMFolderTree *emft) -{ - struct _EMFolderTreePrivate *priv = emft->priv; - - em_folder_tree_model_save_expanded (priv->model); - priv->save_state_id = 0; - - return FALSE; -} - - -static void -em_folder_tree_queue_save_state (EMFolderTree *emft) -{ - struct _EMFolderTreePrivate *priv = emft->priv; - - if (priv->save_state_id != 0) - return; - - priv->save_state_id = g_timeout_add (1000, (GSourceFunc) em_folder_tree_save_state, emft); -} diff --git a/mail/em-folder-tree.h b/mail/em-folder-tree.h deleted file mode 100644 index ec4e9301d9..0000000000 --- a/mail/em-folder-tree.h +++ /dev/null @@ -1,80 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Authors: Jeffrey Stedfast <fejj@ximian.com> - * - * Copyright 2003 Ximian, Inc. (www.ximian.com) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA. - * - */ - - -#ifndef __EM_FOLDER_TREE_H__ -#define __EM_FOLDER_TREE_H__ - -#include <gtk/gtkvbox.h> -#include <camel/camel-store.h> - -#include "em-folder-tree-model.h" - -#ifdef __cplusplus -extern "C" { -#pragma } -#endif /* __cplusplus */ - -#define EM_TYPE_FOLDER_TREE (em_folder_tree_get_type ()) -#define EM_FOLDER_TREE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EM_TYPE_FOLDER_TREE, EMFolderTree)) -#define EM_FOLDER_TREE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EM_TYPE_FOLDER_TREE, EMFolderTreeClass)) -#define EM_IS_FOLDER_TREE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EM_TYPE_FOLDER_TREE)) -#define EM_IS_FOLDER_TREE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EM_TYPE_FOLDER_TREE)) -#define EM_FOLDER_TREE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EM_TYPE_FOLDER_TREE, EMFolderTreeClass)) - -typedef struct _EMFolderTree EMFolderTree; -typedef struct _EMFolderTreeClass EMFolderTreeClass; - -struct _EMFolderTree { - GtkVBox parent_object; - - struct _EMFolderTreePrivate *priv; -}; - -struct _EMFolderTreeClass { - GtkVBoxClass parent_class; - - /* signals */ - void (* folder_selected) (EMFolderTree *emft, const char *path, const char *uri); -}; - - -GType em_folder_tree_get_type (void); - -GtkWidget *em_folder_tree_new (void); -GtkWidget *em_folder_tree_new_with_model (EMFolderTreeModel *model); - -void em_folder_tree_enable_drag_and_drop (EMFolderTree *emft); - -void em_folder_tree_set_selected (EMFolderTree *emft, const char *uri); -const char *em_folder_tree_get_selected_uri (EMFolderTree *emft); -const char *em_folder_tree_get_selected_path (EMFolderTree *emft); - -EMFolderTreeModel *em_folder_tree_get_model (EMFolderTree *emft); - -gboolean em_folder_tree_create_folder (EMFolderTree *emft, const char *path, const char *uri); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __EM_FOLDER_TREE_H__ */ diff --git a/mail/em-folder-view.c b/mail/em-folder-view.c deleted file mode 100644 index 5f7a1742e6..0000000000 --- a/mail/em-folder-view.c +++ /dev/null @@ -1,2020 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Authors: Michael Zucchi <notzed@ximian.com> - * - * Copyright 2003 Ximian, Inc. (www.ximian.com) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA. - * - */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <string.h> - -#include <gtk/gtkvbox.h> -#include <gtk/gtkbutton.h> -#include <gtk/gtkvpaned.h> -#include <gdk/gdkkeysyms.h> - -#include <gtkhtml/gtkhtml.h> - -#include <libgnome/gnome-url.h> - -#include <libgnomeprintui/gnome-print-dialog.h> - -#include <camel/camel-mime-message.h> -#include <camel/camel-stream.h> -#include <camel/camel-stream-filter.h> -#include <camel/camel-mime-filter.h> -#include <camel/camel-mime-filter-tohtml.h> -#include <camel/camel-mime-filter-enriched.h> -#include <camel/camel-multipart.h> -#include <camel/camel-stream-mem.h> -#include <camel/camel-url.h> - -#include <bonobo/bonobo-main.h> -#include <bonobo/bonobo-object.h> -#include <bonobo/bonobo-generic-factory.h> -#include <bonobo/bonobo-control.h> -#include <bonobo/bonobo-ui-component.h> -#include <bonobo/bonobo-ui-util.h> - -#include "widgets/misc/e-charset-picker.h" - -#include <e-util/e-dialog-utils.h> - -#include "em-format-html-display.h" -#include "em-format-html-print.h" -#include "em-folder-selection.h" -#include "em-folder-view.h" -#include "em-message-browser.h" -#include "message-list.h" -#include "em-utils.h" - -#include <gtkhtml/gtkhtml.h> -#include <gtkhtml/htmlobject.h> -#include <gtkhtml/htmlengine.h> -#include <gtkhtml/htmlengine-save.h> - -#include "mail-mt.h" -#include "mail-ops.h" -#include "mail-config.h" /* hrm, pity we need this ... */ -#include "mail-autofilter.h" -#include "mail-vfolder.h" - -#include "evolution-shell-component-utils.h" /* Pixmap stuff, sigh */ - -static void emfv_folder_changed(CamelFolder *folder, CamelFolderChangeInfo *changes, EMFolderView *emfv); - -static void emfv_list_message_selected(MessageList *ml, const char *uid, EMFolderView *emfv); -static int emfv_list_right_click(ETree *tree, gint row, ETreePath path, gint col, GdkEvent *event, EMFolderView *emfv); -static void emfv_list_double_click(ETree *tree, gint row, ETreePath path, gint col, GdkEvent *event, EMFolderView *emfv); -static int emfv_list_key_press(ETree *tree, int row, ETreePath path, int col, GdkEvent *ev, EMFolderView *emfv); - -static void emfv_format_link_clicked(EMFormatHTMLDisplay *efhd, const char *uri, EMFolderView *); -static int emfv_format_popup_event(EMFormatHTMLDisplay *efhd, GdkEventButton *event, const char *uri, CamelMimePart *part, EMFolderView *); - -static void emfv_enable_menus(EMFolderView *emfv); - -static void emfv_set_folder(EMFolderView *emfv, CamelFolder *folder, const char *uri); -static void emfv_set_folder_uri(EMFolderView *emfv, const char *uri); -static void emfv_set_message(EMFolderView *emfv, const char *uid); -static void emfv_activate(EMFolderView *emfv, BonoboUIComponent *uic, int state); - -static void emfv_message_reply(EMFolderView *emfv, int mode); -static void vfolder_type_current (EMFolderView *emfv, int type); -static void filter_type_current (EMFolderView *emfv, int type); - -static void emfv_setting_setup(EMFolderView *emfv); - -static const EMFolderViewEnable emfv_enable_map[]; - -struct _EMFolderViewPrivate { - guint seen_id; - guint setting_notify_id; - - char *displayed_uid; /* only used to stop re-loads, don't use it to represent any selection state */ - - CamelObjectHookID folder_changed_id; - - GtkWidget *invisible; - char *selection_uri; -}; - -static GtkVBoxClass *emfv_parent; - -static void emfv_selection_get(GtkWidget *widget, GtkSelectionData *data, guint info, guint time_stamp, EMFolderView *emfv); -static void emfv_selection_clear_event(GtkWidget *widget, GdkEventSelection *event, EMFolderView *emfv); - -static void -emfv_init(GObject *o) -{ - EMFolderView *emfv = (EMFolderView *)o; - struct _EMFolderViewPrivate *p; - - gtk_box_set_homogeneous (GTK_BOX (emfv), FALSE); - - p = emfv->priv = g_malloc0(sizeof(struct _EMFolderViewPrivate)); - - emfv->ui_files = g_slist_append(NULL, EVOLUTION_UIDIR "/evolution-mail-message.xml"); - emfv->ui_app_name = "evolution-mail"; - - emfv->enable_map = g_slist_prepend(NULL, (void *)emfv_enable_map); - - emfv->list = (MessageList *)message_list_new(); - g_signal_connect(emfv->list, "message_selected", G_CALLBACK(emfv_list_message_selected), emfv); - - /* FIXME: should this hang off message-list instead? */ - g_signal_connect(emfv->list->tree, "right_click", G_CALLBACK(emfv_list_right_click), emfv); - g_signal_connect(emfv->list->tree, "double_click", G_CALLBACK(emfv_list_double_click), emfv); - g_signal_connect(emfv->list->tree, "key_press", G_CALLBACK(emfv_list_key_press), emfv); - - emfv->preview = (EMFormatHTMLDisplay *)em_format_html_display_new(); - g_signal_connect(emfv->preview, "link_clicked", G_CALLBACK(emfv_format_link_clicked), emfv); - g_signal_connect(emfv->preview, "popup_event", G_CALLBACK(emfv_format_popup_event), emfv); - - p->invisible = gtk_invisible_new(); - g_object_ref(p->invisible); - gtk_object_sink((GtkObject *)p->invisible); - g_signal_connect(p->invisible, "selection_get", G_CALLBACK(emfv_selection_get), emfv); - g_signal_connect(p->invisible, "selection_clear_event", G_CALLBACK(emfv_selection_clear_event), emfv); - gtk_selection_add_target(p->invisible, GDK_SELECTION_PRIMARY, GDK_SELECTION_TYPE_STRING, 0); - gtk_selection_add_target(p->invisible, GDK_SELECTION_PRIMARY, GDK_SELECTION_TYPE_STRING, 1); - - emfv->async = mail_async_event_new(); - - emfv_setting_setup(emfv); -} - -static void -emfv_finalise(GObject *o) -{ - EMFolderView *emfv = (EMFolderView *)o; - struct _EMFolderViewPrivate *p = emfv->priv; - - if (emfv->async) - mail_async_event_destroy(emfv->async); - - if (emfv->folder) { - if (p->folder_changed_id) - camel_object_remove_event(emfv->folder, p->folder_changed_id); - camel_object_unref(emfv->folder); - g_free(emfv->folder_uri); - } - - g_slist_free(emfv->ui_files); - g_slist_free(emfv->enable_map); - - g_free(p); - - ((GObjectClass *)emfv_parent)->finalize(o); -} - -static void -emfv_destroy (GtkObject *o) -{ - EMFolderView *emfv = (EMFolderView *) o; - struct _EMFolderViewPrivate *p = emfv->priv; - - if (p->seen_id) { - g_source_remove(p->seen_id); - p->seen_id = 0; - } - - if (p->setting_notify_id) { - GConfClient *gconf = gconf_client_get_default(); - - gconf_client_notify_remove(gconf, p->setting_notify_id); - p->setting_notify_id = 0; - g_object_unref(gconf); - } - - if (p->invisible) { - g_object_unref(p->invisible); - p->invisible = NULL; - } - - emfv->preview = NULL; - emfv->list = NULL; - emfv->preview_active = FALSE; - emfv->uic = NULL; - - ((GtkObjectClass *) emfv_parent)->destroy (o); -} - -static void -emfv_class_init(GObjectClass *klass) -{ - klass->finalize = emfv_finalise; - - ((GtkObjectClass *) klass)->destroy = emfv_destroy; - - ((EMFolderViewClass *)klass)->set_folder = emfv_set_folder; - ((EMFolderViewClass *)klass)->set_folder_uri = emfv_set_folder_uri; - ((EMFolderViewClass *)klass)->set_message = emfv_set_message; - ((EMFolderViewClass *)klass)->activate = emfv_activate; -} - -GType -em_folder_view_get_type(void) -{ - static GType type = 0; - - if (type == 0) { - static const GTypeInfo info = { - sizeof(EMFolderViewClass), - NULL, NULL, - (GClassInitFunc)emfv_class_init, - NULL, NULL, - sizeof(EMFolderView), 0, - (GInstanceInitFunc)emfv_init - }; - emfv_parent = g_type_class_ref(gtk_vbox_get_type()); - type = g_type_register_static(gtk_vbox_get_type(), "EMFolderView", &info, 0); - } - - return type; -} - -GtkWidget *em_folder_view_new(void) -{ - EMFolderView *emfv = g_object_new(em_folder_view_get_type(), 0); - - return (GtkWidget *)emfv; -} - -/* flag all selected messages. Return number flagged */ -/* FIXME: Should this be part of message-list instead? */ -int -em_folder_view_mark_selected(EMFolderView *emfv, guint32 mask, guint32 set) -{ - GPtrArray *uids; - int i; - - if (emfv->folder == NULL) - return 0; - - uids = message_list_get_selected(emfv->list); - camel_folder_freeze(emfv->folder); - - for (i=0; i<uids->len; i++) - camel_folder_set_message_flags(emfv->folder, uids->pdata[i], mask, set); - - message_list_free_uids(emfv->list, uids); - camel_folder_thaw(emfv->folder); - - return i; -} - -/* should this be elsewhere/take a uid list? */ -int -em_folder_view_open_selected(EMFolderView *emfv) -{ - GPtrArray *uids; - int i = 0; - - /* FIXME: handle editing message? Should be a different method? editing handled by 'Resend' method already */ - - uids = message_list_get_selected(emfv->list); - - if (em_utils_folder_is_drafts(emfv->folder, emfv->folder_uri) - || em_utils_folder_is_outbox(emfv->folder, emfv->folder_uri)) { - em_utils_edit_messages (emfv->folder, uids); - } else { - /* TODO: have an em_utils_open_messages call? */ - - /* FIXME: 'are you sure' for > 10 messages; is this even necessary? */ - - for (i=0; i<uids->len; i++) { - EMMessageBrowser *emmb; - - emmb = (EMMessageBrowser *)em_message_browser_window_new(); - /* FIXME: session needs to be passed easier than this */ - em_format_set_session((EMFormat *)((EMFolderView *)emmb)->preview, ((EMFormat *)emfv->preview)->session); - em_folder_view_set_folder((EMFolderView *)emmb, emfv->folder, emfv->folder_uri); - em_folder_view_set_message((EMFolderView *)emmb, uids->pdata[i]); - gtk_widget_show(emmb->window); - } - - message_list_free_uids(emfv->list, uids); - } - - return i; -} - -/* ********************************************************************** */ - -static void -emfv_set_folder(EMFolderView *emfv, CamelFolder *folder, const char *uri) -{ - int isout = (folder && uri - && (em_utils_folder_is_drafts(folder, uri) - || em_utils_folder_is_sent(folder, uri) - || em_utils_folder_is_outbox(folder, uri))); - - message_list_set_folder(emfv->list, folder, uri, isout); - g_free(emfv->folder_uri); - emfv->folder_uri = g_strdup(uri); - if (folder != emfv->folder) { - if (emfv->folder) { - mail_sync_folder (emfv->folder, NULL, NULL); - if (emfv->priv->folder_changed_id) - camel_object_remove_event(emfv->folder, emfv->priv->folder_changed_id); - camel_object_unref(emfv->folder); - } - emfv->folder = folder; - if (folder) { - emfv->priv->folder_changed_id = camel_object_hook_event(folder, "folder_changed", - (CamelObjectEventHookFunc)emfv_folder_changed, emfv); - camel_object_ref(folder); - } - } - - emfv_enable_menus(emfv); -} - -static void -emfv_got_folder(char *uri, CamelFolder *folder, void *data) -{ - EMFolderView *emfv = data; - - em_folder_view_set_folder(emfv, folder, uri); -} - -static void -emfv_set_folder_uri(EMFolderView *emfv, const char *uri) -{ - if (emfv->preview) - em_format_format((EMFormat *)emfv->preview, NULL); - - mail_get_folder(uri, 0, emfv_got_folder, emfv, mail_thread_new); -} - -static void -emfv_set_message(EMFolderView *emfv, const char *uid) -{ - message_list_select_uid(emfv->list, uid); -} - -/* ********************************************************************** */ - -static void -emfv_selection_get(GtkWidget *widget, GtkSelectionData *data, guint info, guint time_stamp, EMFolderView *emfv) -{ - struct _EMFolderViewPrivate *p = emfv->priv; - - if (p->selection_uri == NULL) - return; - - gtk_selection_data_set(data, data->target, 8, p->selection_uri, strlen(p->selection_uri)); -} - -static void -emfv_selection_clear_event(GtkWidget *widget, GdkEventSelection *event, EMFolderView *emfv) -{ -#if 0 /* do i care? */ - struct _EMFolderViewPrivate *p = emfv->priv; - - g_free(p->selection_uri); - p->selection_uri = NULL; -#endif -} - -/* ********************************************************************** */ - -/* Popup menu - In many cases these are the functions called by the bonobo callbacks too */ - -struct _emfv_label_item { - EMPopupItem item; - - EMFolderView *emfv; - const char *label; -}; - -static void -emfv_popup_open(GtkWidget *w, EMFolderView *emfv) -{ - em_folder_view_open_selected(emfv); -} - -static void -emfv_popup_resend(GtkWidget *w, EMFolderView *emfv) -{ - GPtrArray *uids; - - if (!em_utils_check_user_can_send_mail((GtkWidget *)emfv)) - return; - - uids = message_list_get_selected(emfv->list); - em_utils_edit_messages (emfv->folder, uids); -} - -static void -emfv_popup_saveas(GtkWidget *w, EMFolderView *emfv) -{ - GPtrArray *uids; - - uids = message_list_get_selected(emfv->list); - em_utils_save_messages((GtkWidget *)emfv, emfv->folder, uids); -} - -static void -emfv_popup_print(GtkWidget *w, EMFolderView *emfv) -{ - em_folder_view_print(emfv, FALSE); -} - -static void -emfv_popup_reply_sender(GtkWidget *w, EMFolderView *emfv) -{ - emfv_message_reply(emfv, REPLY_MODE_SENDER); -} - -static void -emfv_popup_reply_list(GtkWidget *w, EMFolderView *emfv) -{ - emfv_message_reply(emfv, REPLY_MODE_LIST); -} - -static void -emfv_popup_reply_all(GtkWidget *w, EMFolderView *emfv) -{ - emfv_message_reply(emfv, REPLY_MODE_ALL); -} - -static void -emfv_popup_forward(GtkWidget *w, EMFolderView *emfv) -{ - GPtrArray *uids; - - if (!em_utils_check_user_can_send_mail((GtkWidget *)emfv)) - return; - - uids = message_list_get_selected(emfv->list); - em_utils_forward_messages (emfv->folder, uids); -} - -static void -emfv_popup_flag_followup(GtkWidget *w, EMFolderView *emfv) -{ - GPtrArray *uids = message_list_get_selected(emfv->list); - - em_utils_flag_for_followup((GtkWidget *)emfv, emfv->folder, uids); -} - -static void -emfv_popup_flag_completed(GtkWidget *w, EMFolderView *emfv) -{ - GPtrArray *uids; - - uids = message_list_get_selected(emfv->list); - em_utils_flag_for_followup_completed((GtkWidget *)emfv, emfv->folder, uids); -} - -static void -emfv_popup_flag_clear(GtkWidget *w, EMFolderView *emfv) -{ - GPtrArray *uids = message_list_get_selected(emfv->list); - - em_utils_flag_for_followup_clear((GtkWidget *)emfv, emfv->folder, uids); -} - -static void -emfv_popup_mark_read(GtkWidget *w, EMFolderView *emfv) -{ - em_folder_view_mark_selected(emfv, CAMEL_MESSAGE_SEEN, CAMEL_MESSAGE_SEEN); -} - -static void -emfv_popup_mark_unread(GtkWidget *w, EMFolderView *emfv) -{ - em_folder_view_mark_selected(emfv, CAMEL_MESSAGE_SEEN|CAMEL_MESSAGE_DELETED, 0); - - if (emfv->priv->seen_id) { - g_source_remove(emfv->priv->seen_id); - emfv->priv->seen_id = 0; - } -} - -static void -emfv_popup_mark_important(GtkWidget *w, EMFolderView *emfv) -{ - em_folder_view_mark_selected(emfv, CAMEL_MESSAGE_FLAGGED|CAMEL_MESSAGE_DELETED, CAMEL_MESSAGE_FLAGGED); -} - -static void -emfv_popup_mark_unimportant(GtkWidget *w, EMFolderView *emfv) -{ - em_folder_view_mark_selected(emfv, CAMEL_MESSAGE_FLAGGED, 0); -} - -static void -emfv_popup_mark_junk (GtkWidget *w, EMFolderView *emfv) -{ - mail_mark_junk (emfv->folder, emfv->list, TRUE); -} - -static void -emfv_popup_mark_nojunk (GtkWidget *w, EMFolderView *emfv) -{ - mail_mark_junk (emfv->folder, emfv->list, FALSE); -} - -static void -emfv_popup_delete(GtkWidget *w, EMFolderView *emfv) -{ - GPtrArray *uids; - - uids = message_list_get_selected (emfv->list); - em_folder_view_mark_selected (emfv, CAMEL_MESSAGE_SEEN|CAMEL_MESSAGE_DELETED, CAMEL_MESSAGE_SEEN|CAMEL_MESSAGE_DELETED); - - if (uids->len == 1) - message_list_select (emfv->list, MESSAGE_LIST_SELECT_NEXT, 0, 0, FALSE); - - em_utils_uids_free (uids); -} - -static void -emfv_popup_undelete(GtkWidget *w, EMFolderView *emfv) -{ - em_folder_view_mark_selected(emfv, CAMEL_MESSAGE_DELETED, 0); -} - -struct _move_data { - EMFolderView *emfv; - GPtrArray *uids; - int delete; -}; - -static void -emfv_popup_move_cb(const char *uri, void *data) -{ - struct _move_data *d = data; - - if (uri) - mail_transfer_messages(d->emfv->folder, d->uids, d->delete, uri, 0, NULL, NULL); - else - em_utils_uids_free(d->uids); - - g_object_unref(d->emfv); - g_free(d); -} - -static void -emfv_popup_move(GtkWidget *w, EMFolderView *emfv) -{ - struct _move_data *d; - - d = g_malloc(sizeof(*d)); - d->emfv = emfv; - g_object_ref(emfv); - d->uids = message_list_get_selected(emfv->list); - d->delete = TRUE; - - em_select_folder ((GtkWindow *) emfv, _("Select folder"), NULL, emfv_popup_move_cb, d); -} - -static void -emfv_popup_copy(GtkWidget *w, EMFolderView *emfv) -{ - struct _move_data *d; - - d = g_malloc(sizeof(*d)); - d->emfv = emfv; - g_object_ref(emfv); - d->uids = message_list_get_selected(emfv->list); - d->delete = FALSE; - - em_select_folder ((GtkWindow *) emfv, _("Select folder"), NULL, emfv_popup_move_cb, d); -} - -static void -emfv_set_label(EMFolderView *emfv, const char *label) -{ - GPtrArray *uids = message_list_get_selected(emfv->list); - int i; - - for (i=0;i<uids->len;i++) - camel_folder_set_message_user_tag(emfv->folder, uids->pdata[i], "label", label); - - message_list_free_uids(emfv->list, uids); -} - -static void -emfv_popup_label_clear(GtkWidget *w, EMFolderView *emfv) -{ - emfv_set_label(emfv, NULL); -} - -static void -emfv_popup_label_set(GtkWidget *w, struct _emfv_label_item *item) -{ - emfv_set_label(item->emfv, item->label); -} - -static void -emfv_popup_add_sender(GtkWidget *w, EMFolderView *emfv) -{ - GPtrArray *uids = message_list_get_selected(emfv->list); - CamelMessageInfo *info; - const char *addr; - - if (uids->len == 1 - && (info = camel_folder_get_message_info(emfv->folder, uids->pdata[0])) != NULL - && (addr = camel_message_info_from(info)) != NULL - && addr[0] != 0) - em_utils_add_address((GtkWidget *)emfv, addr); - - em_utils_uids_free(uids); -} - -static void -emfv_popup_apply_filters(GtkWidget *w, EMFolderView *emfv) -{ - GPtrArray *uids = message_list_get_selected(emfv->list); - - mail_filter_on_demand(emfv->folder, uids); -} - -/* filter callbacks, this will eventually be a wizard, see - filter_type_current/vfolder_type_current for implementation */ - -#define EMFV_POPUP_AUTO_TYPE(autotype, name, type) \ -static void \ -name(GtkWidget *w, EMFolderView *emfv) \ -{ \ - autotype(emfv, type); \ -} - -EMFV_POPUP_AUTO_TYPE(vfolder_type_current, emfv_popup_vfolder_subject, AUTO_SUBJECT) -EMFV_POPUP_AUTO_TYPE(vfolder_type_current, emfv_popup_vfolder_sender, AUTO_FROM) -EMFV_POPUP_AUTO_TYPE(vfolder_type_current, emfv_popup_vfolder_recipients, AUTO_TO) -EMFV_POPUP_AUTO_TYPE(vfolder_type_current, emfv_popup_vfolder_mlist, AUTO_MLIST) -EMFV_POPUP_AUTO_TYPE(vfolder_type_current, emfv_popup_vfolder_thread, AUTO_THREAD) - -EMFV_POPUP_AUTO_TYPE(filter_type_current, emfv_popup_filter_subject, AUTO_SUBJECT) -EMFV_POPUP_AUTO_TYPE(filter_type_current, emfv_popup_filter_sender, AUTO_FROM) -EMFV_POPUP_AUTO_TYPE(filter_type_current, emfv_popup_filter_recipients, AUTO_TO) -EMFV_POPUP_AUTO_TYPE(filter_type_current, emfv_popup_filter_mlist, AUTO_MLIST) -EMFV_POPUP_AUTO_TYPE(filter_type_current, emfv_popup_filter_thread, AUTO_THREAD) - -/* TODO: Move some of these to be 'standard' menu's */ - -static EMPopupItem emfv_popup_menu[] = { - { EM_POPUP_ITEM, "00.emfv.00", N_("_Open"), G_CALLBACK(emfv_popup_open), NULL, NULL, 0 }, - { EM_POPUP_ITEM, "00.emfv.01", N_("_Edit as New Message..."), G_CALLBACK(emfv_popup_resend), NULL, NULL, EM_POPUP_SELECT_RESEND }, - { EM_POPUP_ITEM, "00.emfv.02", N_("_Save As..."), G_CALLBACK(emfv_popup_saveas), NULL, "save-as-16.png", 0 }, - { EM_POPUP_ITEM, "00.emfv.03", N_("_Print"), G_CALLBACK(emfv_popup_print), NULL, "print.xpm", 0 }, - - { EM_POPUP_BAR, "10.emfv" }, - { EM_POPUP_ITEM, "10.emfv.00", N_("_Reply to Sender"), G_CALLBACK(emfv_popup_reply_sender), NULL, "reply.xpm", EM_POPUP_SELECT_ONE }, - { EM_POPUP_ITEM, "10.emfv.01", N_("Reply to _List"), G_CALLBACK(emfv_popup_reply_list), NULL, NULL, EM_POPUP_SELECT_ONE|EM_POPUP_SELECT_MAILING_LIST }, - { EM_POPUP_ITEM, "10.emfv.02", N_("Reply to _All"), G_CALLBACK(emfv_popup_reply_all), NULL, "reply_to_all.xpm", EM_POPUP_SELECT_ONE }, - { EM_POPUP_ITEM, "10.emfv.03", N_("_Forward"), G_CALLBACK(emfv_popup_forward), NULL, "forward.xpm", EM_POPUP_SELECT_MANY }, - - { EM_POPUP_BAR, "20.emfv", NULL, NULL, NULL, NULL, EM_POPUP_SELECT_FLAG_FOLLOWUP|EM_POPUP_SELECT_FLAG_COMPLETED|EM_POPUP_SELECT_FLAG_CLEAR }, - { EM_POPUP_ITEM, "20.emfv.00", N_("Follo_w Up..."), G_CALLBACK(emfv_popup_flag_followup), NULL, "flag-for-followup-16.png", EM_POPUP_SELECT_FLAG_FOLLOWUP }, - { EM_POPUP_ITEM, "20.emfv.01", N_("Fla_g Completed"), G_CALLBACK(emfv_popup_flag_completed), NULL, NULL, EM_POPUP_SELECT_FLAG_COMPLETED }, - { EM_POPUP_ITEM, "20.emfv.02", N_("Cl_ear Flag"), G_CALLBACK(emfv_popup_flag_clear), NULL, NULL, EM_POPUP_SELECT_FLAG_CLEAR }, - - { EM_POPUP_BAR, "30.emfv" }, - { EM_POPUP_ITEM, "30.emfv.00", N_("Mar_k as Read"), G_CALLBACK(emfv_popup_mark_read), NULL, "mail-read.xpm", EM_POPUP_SELECT_MARK_READ }, - { EM_POPUP_ITEM, "30.emfv.01", N_("Mark as _Unread"), G_CALLBACK(emfv_popup_mark_unread), NULL, "mail-new.xpm", EM_POPUP_SELECT_MARK_UNREAD }, - { EM_POPUP_ITEM, "30.emfv.02", N_("Mark as _Important"), G_CALLBACK(emfv_popup_mark_important), NULL, "priority-high.xpm", EM_POPUP_SELECT_MARK_IMPORTANT }, - { EM_POPUP_ITEM, "30.emfv.03", N_("_Mark as Unimportant"), G_CALLBACK(emfv_popup_mark_unimportant), NULL, NULL, EM_POPUP_SELECT_MARK_UNIMPORTANT }, - { EM_POPUP_ITEM, "30.emfv.04", N_("Mark as _Junk"), G_CALLBACK(emfv_popup_mark_junk), NULL, NULL, EM_POPUP_SELECT_MARK_JUNK }, - { EM_POPUP_ITEM, "30.emfv.05", N_("Mark as _Not Junk"), G_CALLBACK(emfv_popup_mark_nojunk), NULL, NULL, EM_POPUP_SELECT_MARK_NOJUNK }, - - { EM_POPUP_BAR, "40.emfv" }, - { EM_POPUP_ITEM, "40.emfv.00", N_("_Delete"), G_CALLBACK(emfv_popup_delete), NULL, "evolution-trash-mini.png", EM_POPUP_SELECT_DELETE }, - { EM_POPUP_ITEM, "40.emfv.01", N_("U_ndelete"), G_CALLBACK(emfv_popup_undelete), NULL, "undelete_message-16.png", EM_POPUP_SELECT_UNDELETE }, - - { EM_POPUP_BAR, "50.emfv" }, - { EM_POPUP_ITEM, "50.emfv.00", N_("Mo_ve to Folder..."), G_CALLBACK(emfv_popup_move) }, - { EM_POPUP_ITEM, "50.emfv.01", N_("_Copy to Folder..."), G_CALLBACK(emfv_popup_copy) }, - - { EM_POPUP_BAR, "60.label" }, - { EM_POPUP_SUBMENU, "60.label.00", N_("Label") }, - { EM_POPUP_IMAGE, "60.label.00/00.label", N_("None"), G_CALLBACK(emfv_popup_label_clear) }, - { EM_POPUP_BAR, "60.label.00/00.label.00" }, - - { EM_POPUP_BAR, "70.emfv", NULL, NULL, NULL, NULL, EM_POPUP_SELECT_ONE }, - { EM_POPUP_ITEM, "70.emfv.00", N_("Add Sender to Address_book"), G_CALLBACK(emfv_popup_add_sender), NULL, NULL, EM_POPUP_SELECT_ONE|EM_POPUP_SELECT_ADD_SENDER }, - - { EM_POPUP_BAR, "80.emfv" }, - { EM_POPUP_ITEM, "80.emfv.00", N_("Appl_y Filters"), G_CALLBACK(emfv_popup_apply_filters) }, - - { EM_POPUP_BAR, "90.filter", NULL, NULL, NULL, NULL, EM_POPUP_SELECT_ONE }, - { EM_POPUP_SUBMENU, "90.filter.00", N_("Crea_te Rule From Message"), NULL, NULL, NULL, EM_POPUP_SELECT_ONE }, - { EM_POPUP_ITEM, "90.filter.00/00.00", N_("VFolder on _Subject"), G_CALLBACK(emfv_popup_vfolder_subject), NULL, NULL, EM_POPUP_SELECT_ONE }, - { EM_POPUP_ITEM, "90.filter.00/00.01", N_("VFolder on Se_nder"), G_CALLBACK(emfv_popup_vfolder_sender), NULL, NULL, EM_POPUP_SELECT_ONE }, - { EM_POPUP_ITEM, "90.filter.00/00.02", N_("VFolder on _Recipients"), G_CALLBACK(emfv_popup_vfolder_recipients), NULL, NULL, EM_POPUP_SELECT_ONE }, - { EM_POPUP_ITEM, "90.filter.00/00.03", N_("VFolder on Mailing _List"), - G_CALLBACK(emfv_popup_vfolder_mlist), NULL, NULL, EM_POPUP_SELECT_ONE|EM_POPUP_SELECT_MAILING_LIST }, - { EM_POPUP_ITEM, "90.filter.00/00.04", N_("VFolder on Thread"), - G_CALLBACK(emfv_popup_vfolder_thread), NULL, NULL, EM_POPUP_SELECT_ONE }, - - { EM_POPUP_BAR, "90.filter.00/10", NULL, NULL, NULL, NULL, EM_POPUP_SELECT_ONE }, - { EM_POPUP_ITEM, "90.filter.00/10.00", N_("Filter on Sub_ject"), G_CALLBACK(emfv_popup_filter_subject), NULL, NULL, EM_POPUP_SELECT_ONE }, - { EM_POPUP_ITEM, "90.filter.00/10.01", N_("Filter on Sen_der"), G_CALLBACK(emfv_popup_filter_sender), NULL, NULL, EM_POPUP_SELECT_ONE }, - { EM_POPUP_ITEM, "90.filter.00/10.02", N_("Filter on Re_cipients"), G_CALLBACK(emfv_popup_filter_recipients), NULL, NULL, EM_POPUP_SELECT_ONE }, - { EM_POPUP_ITEM, "90.filter.00/10.03", N_("Filter on _Mailing List"), - G_CALLBACK(emfv_popup_filter_mlist), NULL, NULL, EM_POPUP_SELECT_ONE|EM_POPUP_SELECT_MAILING_LIST }, - { EM_POPUP_ITEM, "90.filter.00/10.04", N_("Filter on Thread"), - G_CALLBACK(emfv_popup_filter_thread), NULL, NULL, EM_POPUP_SELECT_ONE }, -}; - -static void -emfv_popup_labels_free(void *data) -{ - GSList *l = data; - - while (l) { - GSList *n = l->next; - struct _emfv_label_item *item = l->data; - - g_free(item->item.path); - g_free(item); - - g_slist_free_1(l); - l = n; - } -} - -static void -emfv_popup(EMFolderView *emfv, GdkEvent *event) -{ - GSList *menus = NULL, *l, *label_list = NULL; - GtkMenu *menu; - EMPopup *emp; - EMPopupTarget *target; - int i; - - emp = em_popup_new("com.ximian.mail.folderview.popup.select"); - target = em_folder_view_get_popup_target(emfv); - - for (i=0;i<sizeof(emfv_popup_menu)/sizeof(emfv_popup_menu[0]);i++) { - EMPopupItem *item = &emfv_popup_menu[i]; - - item->activate_data = emfv; - menus = g_slist_prepend(menus, item); - } - - em_popup_add_items(emp, menus, (GDestroyNotify)g_slist_free); - - i = 1; - for (l = mail_config_get_labels(); l; l = l->next) { - struct _emfv_label_item *item; - MailConfigLabel *label = l->data; - GdkPixmap *pixmap; - GdkColor colour; - GdkGC *gc; - - item = g_malloc0(sizeof(*item)); - item->item.type = EM_POPUP_IMAGE; - item->item.path = g_strdup_printf("60.label.00/00.label.%02d", i++); - item->item.label = label->name; - item->item.activate = G_CALLBACK(emfv_popup_label_set); - item->item.activate_data = item; - item->emfv = emfv; - item->label = label->tag; - - gdk_color_parse(label->colour, &colour); - gdk_color_alloc(gdk_colormap_get_system(), &colour); - - pixmap = gdk_pixmap_new(((GtkWidget *)emfv)->window, 16, 16, -1); - gc = gdk_gc_new(((GtkWidget *)emfv)->window); - gdk_gc_set_foreground(gc, &colour); - gdk_draw_rectangle(pixmap, gc, TRUE, 0, 0, 16, 16); - gdk_gc_unref(gc); - - item->item.image = gtk_image_new_from_pixmap(pixmap, NULL); - gtk_widget_show(item->item.image); - - label_list = g_slist_prepend(label_list, item); - } - - em_popup_add_items(emp, label_list, emfv_popup_labels_free); - - menu = em_popup_create_menu_once(emp, target, target->mask, target->mask); - - if (event == NULL || event->type == GDK_KEY_PRESS) { - /* FIXME: menu pos function */ - gtk_menu_popup(menu, NULL, NULL, NULL, NULL, 0, event->key.time); - } else { - gtk_menu_popup(menu, NULL, NULL, NULL, NULL, event->button.button, event->button.time); - } -} - -/* ********************************************************************** */ - -/* Bonobo menu's */ - -/* a lot of stuff maps directly to the popup menu equivalent */ -#define EMFV_MAP_CALLBACK(from, to) \ -static void \ -from(BonoboUIComponent *uid, void *data, const char *path) \ -{ \ - to(NULL, (EMFolderView *)data); \ -} - -EMFV_MAP_CALLBACK(emfv_add_sender_addressbook, emfv_popup_add_sender) -EMFV_MAP_CALLBACK(emfv_message_apply_filters, emfv_popup_apply_filters) -EMFV_MAP_CALLBACK(emfv_message_copy, emfv_popup_copy) -EMFV_MAP_CALLBACK(emfv_message_move, emfv_popup_move) -EMFV_MAP_CALLBACK(emfv_message_forward, emfv_popup_forward) -EMFV_MAP_CALLBACK(emfv_message_reply_all, emfv_popup_reply_all) -EMFV_MAP_CALLBACK(emfv_message_reply_list, emfv_popup_reply_list) -EMFV_MAP_CALLBACK(emfv_message_reply_sender, emfv_popup_reply_sender) -EMFV_MAP_CALLBACK(emfv_message_mark_read, emfv_popup_mark_read) -EMFV_MAP_CALLBACK(emfv_message_mark_unread, emfv_popup_mark_unread) -EMFV_MAP_CALLBACK(emfv_message_mark_important, emfv_popup_mark_important) -EMFV_MAP_CALLBACK(emfv_message_mark_unimportant, emfv_popup_mark_unimportant) -EMFV_MAP_CALLBACK(emfv_message_mark_junk, emfv_popup_mark_junk) -EMFV_MAP_CALLBACK(emfv_message_mark_nojunk, emfv_popup_mark_nojunk) -EMFV_MAP_CALLBACK(emfv_message_delete, emfv_popup_delete) -EMFV_MAP_CALLBACK(emfv_message_undelete, emfv_popup_undelete) -EMFV_MAP_CALLBACK(emfv_message_followup_flag, emfv_popup_flag_followup) -/*EMFV_MAP_CALLBACK(emfv_message_followup_clear, emfv_popup_flag_clear) - EMFV_MAP_CALLBACK(emfv_message_followup_completed, emfv_popup_flag_completed)*/ -EMFV_MAP_CALLBACK(emfv_message_open, emfv_popup_open) -EMFV_MAP_CALLBACK(emfv_message_resend, emfv_popup_resend) -EMFV_MAP_CALLBACK(emfv_message_saveas, emfv_popup_saveas) -EMFV_MAP_CALLBACK(emfv_print_message, emfv_popup_print) - -static void -emfv_edit_cut(BonoboUIComponent *uid, void *data, const char *path) -{ - EMFolderView *emfv = data; - - if (message_list_has_primary_selection(emfv->list)) - message_list_copy(emfv->list, TRUE); - else if (emfv->preview_active) - em_format_html_display_cut(emfv->preview); -} - -static void -emfv_edit_copy(BonoboUIComponent *uid, void *data, const char *path) -{ - EMFolderView *emfv = data; - - if (message_list_has_primary_selection(emfv->list)) - message_list_copy(emfv->list, FALSE); - else if (emfv->preview_active) - em_format_html_display_copy(emfv->preview); -} - -static void -emfv_edit_paste(BonoboUIComponent *uid, void *data, const char *path) -{ - EMFolderView *emfv = data; - - message_list_paste(emfv->list); -} - -static void -emfv_mail_next(BonoboUIComponent *uid, void *data, const char *path) -{ - EMFolderView *emfv = data; - - message_list_select(emfv->list, MESSAGE_LIST_SELECT_NEXT, 0, 0, FALSE); -} - -static void -emfv_mail_next_flagged(BonoboUIComponent *uid, void *data, const char *path) -{ - EMFolderView *emfv = data; - - message_list_select(emfv->list, MESSAGE_LIST_SELECT_NEXT, CAMEL_MESSAGE_FLAGGED, CAMEL_MESSAGE_FLAGGED, FALSE); -} - -static void -emfv_mail_next_unread(BonoboUIComponent *uid, void *data, const char *path) -{ - EMFolderView *emfv = data; - - message_list_select(emfv->list, MESSAGE_LIST_SELECT_NEXT, 0, CAMEL_MESSAGE_SEEN, TRUE); -} - -static void -emfv_mail_next_thread(BonoboUIComponent *uid, void *data, const char *path) -{ - EMFolderView *emfv = data; - - message_list_select_next_thread(emfv->list); -} - -static void -emfv_mail_previous(BonoboUIComponent *uid, void *data, const char *path) -{ - EMFolderView *emfv = data; - - message_list_select(emfv->list, MESSAGE_LIST_SELECT_PREVIOUS, 0, 0, FALSE); -} - -static void -emfv_mail_previous_flagged(BonoboUIComponent *uid, void *data, const char *path) -{ - EMFolderView *emfv = data; - - message_list_select(emfv->list, MESSAGE_LIST_SELECT_PREVIOUS, CAMEL_MESSAGE_FLAGGED, CAMEL_MESSAGE_FLAGGED, TRUE); -} - -static void -emfv_mail_previous_unread(BonoboUIComponent *uid, void *data, const char *path) -{ - EMFolderView *emfv = data; - - message_list_select(emfv->list, MESSAGE_LIST_SELECT_PREVIOUS, 0, CAMEL_MESSAGE_SEEN, TRUE); -} - -static void -emfv_message_forward_attached (BonoboUIComponent *uic, void *data, const char *path) -{ - EMFolderView *emfv = data; - GPtrArray *uids; - - if (!em_utils_check_user_can_send_mail ((GtkWidget *) emfv)) - return; - - uids = message_list_get_selected (emfv->list); - em_utils_forward_attached (emfv->folder, uids); -} - -static void -emfv_message_forward_inline (BonoboUIComponent *uic, void *data, const char *path) -{ - EMFolderView *emfv = data; - GPtrArray *uids; - - if (!em_utils_check_user_can_send_mail ((GtkWidget *) emfv)) - return; - - uids = message_list_get_selected (emfv->list); - em_utils_forward_inline (emfv->folder, uids); -} - -static void -emfv_message_forward_quoted (BonoboUIComponent *uic, void *data, const char *path) -{ - EMFolderView *emfv = data; - GPtrArray *uids; - - if (!em_utils_check_user_can_send_mail ((GtkWidget *) emfv)) - return; - - uids = message_list_get_selected (emfv->list); - em_utils_forward_quoted (emfv->folder, uids); -} - -static void -emfv_message_redirect (BonoboUIComponent *uic, void *data, const char *path) -{ - EMFolderView *emfv = data; - - if (emfv->list->cursor_uid == NULL) - return; - - if (!em_utils_check_user_can_send_mail ((GtkWidget *) emfv)) - return; - - em_utils_redirect_message_by_uid (emfv->folder, emfv->list->cursor_uid); -} - -static void -emfv_message_post_reply (BonoboUIComponent *uic, void *data, const char *path) -{ - EMFolderView *emfv = data; - - if (emfv->list->cursor_uid == NULL) - return; - - if (!em_utils_check_user_can_send_mail ((GtkWidget *) emfv)) - return; - - em_utils_post_reply_to_message_by_uid (emfv->folder, emfv->list->cursor_uid); -} - -static void -emfv_message_reply(EMFolderView *emfv, int mode) -{ - /* GtkClipboard *clip; */ - - if (emfv->list->cursor_uid == NULL) - return; - - if (!em_utils_check_user_can_send_mail ((GtkWidget *) emfv)) - return; - - /* Look away! Look away! */ - - /* HACK: Nasty internal gtkhtml poking going on here */ - - /* Disabled since there's no simple way to find out if - gtkhtml has the primary selection right now */ - - /* Ugh, to use the clipboard we need to request the selection - and have an async callback - painful to deal with */ - - /*clip = gtk_clipboard_get(GDK_SELECTION_PRIMARY);*/ - if (FALSE /*gtk_clipboard_get_owner(clip) == (GObject *)emfv->preview*/ - && ((EMFormatHTML *)emfv->preview)->html->engine->primary) { - CamelMimeMessage *msg, *src; - struct _camel_header_raw *header; - HTMLEngineSaveState *state; - - src = (CamelMimeMessage *)((EMFormat *)emfv->preview)->message; - msg = camel_mime_message_new(); - - header = ((CamelMimePart *)src)->headers; - while (header) { - /* FIXME: shouldn't we strip out *all* Content-* headers? */ - if (g_ascii_strcasecmp(header->name, "content-type") != 0) - camel_medium_add_header((CamelMedium *)msg, header->name, header->value); - header = header->next; - } - - state = html_engine_save_buffer_new(((EMFormatHTML *)emfv->preview)->html->engine, TRUE); - html_object_save(((EMFormatHTML *)emfv->preview)->html->engine->primary, state); - camel_mime_part_set_content((CamelMimePart *)msg, - ((GString *)state->user_data)->str, - ((GString *)state->user_data)->len, - "text/html"); - - html_engine_save_buffer_free(state); - - em_utils_reply_to_message (msg, mode); - camel_object_unref(msg); - } else { - em_utils_reply_to_message_by_uid (emfv->folder, emfv->list->cursor_uid, mode); - } - - /*g_object_unref(clip);*/ -} - -static void -emfv_message_search(BonoboUIComponent *uic, void *data, const char *path) -{ - EMFolderView *emfv = data; - - em_format_html_display_search(emfv->preview); -} - -static void -emfv_print_preview_message(BonoboUIComponent *uic, void *data, const char *path) -{ - EMFolderView *emfv = data; - - em_folder_view_print(emfv, TRUE); -} - -static void -emfv_text_zoom_in(BonoboUIComponent *uic, void *data, const char *path) -{ - EMFolderView *emfv = data; - - if (emfv->preview) - em_format_html_display_zoom_in(emfv->preview); -} - -static void -emfv_text_zoom_out(BonoboUIComponent *uic, void *data, const char *path) -{ - EMFolderView *emfv = data; - - if (emfv->preview) - em_format_html_display_zoom_out(emfv->preview); -} - -static void -emfv_text_zoom_reset(BonoboUIComponent *uic, void *data, const char *path) -{ - EMFolderView *emfv = data; - - if (emfv->preview) - em_format_html_display_zoom_reset(emfv->preview); -} - -/* ********************************************************************** */ - -struct _filter_data { - CamelFolder *folder; - const char *source; - char *uid; - int type; - char *uri; - char *mlist; - char *references; -}; - -static void -filter_data_free (struct _filter_data *fdata) -{ - g_free (fdata->uid); - g_free (fdata->uri); - if (fdata->folder) - camel_object_unref (fdata->folder); - g_free (fdata->mlist); - g_free (fdata->references); - g_free (fdata); -} - -static void -filter_type_got_message (CamelFolder *folder, const char *uid, CamelMimeMessage *msg, void *user_data) -{ - struct _filter_data *data = user_data; - - if (msg) - filter_gui_add_from_message (msg, data->source, data->type); - - filter_data_free (data); -} - -static void -filter_type_uid (CamelFolder *folder, const char *uid, const char *source, int type) -{ - struct _filter_data *data; - - data = g_malloc0 (sizeof (*data)); - data->type = type; - data->source = source; - - mail_get_message (folder, uid, filter_type_got_message, data, mail_thread_new); -} - -static void -filter_type_current (EMFolderView *emfv, int type) -{ - const char *source; - GPtrArray *uids; - - if (em_utils_folder_is_sent (emfv->folder, emfv->folder_uri) - || em_utils_folder_is_outbox (emfv->folder, emfv->folder_uri)) - source = FILTER_SOURCE_OUTGOING; - else - source = FILTER_SOURCE_INCOMING; - - uids = message_list_get_selected (emfv->list); - - if (uids->len == 1) - filter_type_uid (emfv->folder, (char *) uids->pdata[0], source, type); - - em_utils_uids_free (uids); -} - -EMFV_MAP_CALLBACK(emfv_tools_filter_subject, emfv_popup_filter_subject) -EMFV_MAP_CALLBACK(emfv_tools_filter_sender, emfv_popup_filter_sender) -EMFV_MAP_CALLBACK(emfv_tools_filter_recipient, emfv_popup_filter_recipients) -EMFV_MAP_CALLBACK(emfv_tools_filter_mlist, emfv_popup_filter_mlist) -EMFV_MAP_CALLBACK(emfv_tools_filter_thread, emfv_popup_filter_thread) - -static void -vfolder_type_got_message (CamelFolder *folder, const char *uid, CamelMimeMessage *msg, void *user_data) -{ - struct _filter_data *data = user_data; - - if (msg) - vfolder_gui_add_from_message (msg, data->type, data->uri); - - filter_data_free (data); -} - -static void -vfolder_type_uid (CamelFolder *folder, const char *uid, const char *uri, int type) -{ - struct _filter_data *data; - - data = g_malloc0 (sizeof (*data)); - data->type = type; - data->uri = g_strdup (uri); - - mail_get_message (folder, uid, vfolder_type_got_message, data, mail_thread_new); -} - -static void -vfolder_type_current (EMFolderView *emfv, int type) -{ - GPtrArray *uids; - - uids = message_list_get_selected (emfv->list); - - if (uids->len == 1) - vfolder_type_uid (emfv->folder, (char *) uids->pdata[0], emfv->folder_uri, type); - - em_utils_uids_free (uids); -} - -EMFV_MAP_CALLBACK(emfv_tools_vfolder_subject, emfv_popup_vfolder_subject) -EMFV_MAP_CALLBACK(emfv_tools_vfolder_sender, emfv_popup_vfolder_sender) -EMFV_MAP_CALLBACK(emfv_tools_vfolder_recipient, emfv_popup_vfolder_recipients) -EMFV_MAP_CALLBACK(emfv_tools_vfolder_mlist, emfv_popup_vfolder_mlist) -EMFV_MAP_CALLBACK(emfv_tools_vfolder_thread, emfv_popup_vfolder_thread) - -/* ********************************************************************** */ - -static void -emfv_view_load_images(BonoboUIComponent *uic, void *data, const char *path) -{ - EMFolderView *emfv = data; - - if (emfv->preview) - em_format_html_load_http((EMFormatHTML *)emfv->preview); -} - -static BonoboUIVerb emfv_message_verbs[] = { - BONOBO_UI_UNSAFE_VERB ("EditCut", emfv_edit_cut), - BONOBO_UI_UNSAFE_VERB ("EditCopy", emfv_edit_copy), - BONOBO_UI_UNSAFE_VERB ("EditPaste", emfv_edit_paste), - - BONOBO_UI_UNSAFE_VERB ("MailNext", emfv_mail_next), - BONOBO_UI_UNSAFE_VERB ("MailNextFlagged", emfv_mail_next_flagged), - BONOBO_UI_UNSAFE_VERB ("MailNextUnread", emfv_mail_next_unread), - BONOBO_UI_UNSAFE_VERB ("MailNextThread", emfv_mail_next_thread), - BONOBO_UI_UNSAFE_VERB ("MailPrevious", emfv_mail_previous), - BONOBO_UI_UNSAFE_VERB ("MailPreviousFlagged", emfv_mail_previous_flagged), - BONOBO_UI_UNSAFE_VERB ("MailPreviousUnread", emfv_mail_previous_unread), - - BONOBO_UI_UNSAFE_VERB ("AddSenderToAddressbook", emfv_add_sender_addressbook), - - BONOBO_UI_UNSAFE_VERB ("MessageApplyFilters", emfv_message_apply_filters), - BONOBO_UI_UNSAFE_VERB ("MessageCopy", emfv_message_copy), - BONOBO_UI_UNSAFE_VERB ("MessageDelete", emfv_message_delete), - BONOBO_UI_UNSAFE_VERB ("MessageForward", emfv_message_forward), - BONOBO_UI_UNSAFE_VERB ("MessageForwardAttached", emfv_message_forward_attached), - BONOBO_UI_UNSAFE_VERB ("MessageForwardInline", emfv_message_forward_inline), - BONOBO_UI_UNSAFE_VERB ("MessageForwardQuoted", emfv_message_forward_quoted), - BONOBO_UI_UNSAFE_VERB ("MessageRedirect", emfv_message_redirect), - BONOBO_UI_UNSAFE_VERB ("MessageMarkAsRead", emfv_message_mark_read), - BONOBO_UI_UNSAFE_VERB ("MessageMarkAsUnRead", emfv_message_mark_unread), - BONOBO_UI_UNSAFE_VERB ("MessageMarkAsImportant", emfv_message_mark_important), - BONOBO_UI_UNSAFE_VERB ("MessageMarkAsUnimportant", emfv_message_mark_unimportant), - BONOBO_UI_UNSAFE_VERB ("MessageMarkAsJunk", emfv_message_mark_junk), - BONOBO_UI_UNSAFE_VERB ("MessageMarkAsNotJunk", emfv_message_mark_nojunk), - BONOBO_UI_UNSAFE_VERB ("MessageFollowUpFlag", emfv_message_followup_flag), - BONOBO_UI_UNSAFE_VERB ("MessageMove", emfv_message_move), - BONOBO_UI_UNSAFE_VERB ("MessageOpen", emfv_message_open), - BONOBO_UI_UNSAFE_VERB ("MessagePostReply", emfv_message_post_reply), - BONOBO_UI_UNSAFE_VERB ("MessageReplyAll", emfv_message_reply_all), - BONOBO_UI_UNSAFE_VERB ("MessageReplyList", emfv_message_reply_list), - BONOBO_UI_UNSAFE_VERB ("MessageReplySender", emfv_message_reply_sender), - BONOBO_UI_UNSAFE_VERB ("MessageResend", emfv_message_resend), - BONOBO_UI_UNSAFE_VERB ("MessageSaveAs", emfv_message_saveas), - BONOBO_UI_UNSAFE_VERB ("MessageSearch", emfv_message_search), - BONOBO_UI_UNSAFE_VERB ("MessageUndelete", emfv_message_undelete), - - BONOBO_UI_UNSAFE_VERB ("PrintMessage", emfv_print_message), - BONOBO_UI_UNSAFE_VERB ("PrintPreviewMessage", emfv_print_preview_message), - - BONOBO_UI_UNSAFE_VERB ("TextZoomIn", emfv_text_zoom_in), - BONOBO_UI_UNSAFE_VERB ("TextZoomOut", emfv_text_zoom_out), - BONOBO_UI_UNSAFE_VERB ("TextZoomReset", emfv_text_zoom_reset), - - /* TODO: This stuff should just be 1 item that runs a wizard */ - BONOBO_UI_UNSAFE_VERB ("ToolsFilterMailingList", emfv_tools_filter_mlist), - BONOBO_UI_UNSAFE_VERB ("ToolsFilterRecipient", emfv_tools_filter_recipient), - BONOBO_UI_UNSAFE_VERB ("ToolsFilterSender", emfv_tools_filter_sender), - BONOBO_UI_UNSAFE_VERB ("ToolsFilterSubject", emfv_tools_filter_subject), - BONOBO_UI_UNSAFE_VERB ("ToolsFilterThread", emfv_tools_filter_thread), - BONOBO_UI_UNSAFE_VERB ("ToolsVFolderMailingList", emfv_tools_vfolder_mlist), - BONOBO_UI_UNSAFE_VERB ("ToolsVFolderRecipient", emfv_tools_vfolder_recipient), - BONOBO_UI_UNSAFE_VERB ("ToolsVFolderSender", emfv_tools_vfolder_sender), - BONOBO_UI_UNSAFE_VERB ("ToolsVFolderSubject", emfv_tools_vfolder_subject), - BONOBO_UI_UNSAFE_VERB ("ToolsVFolderThread", emfv_tools_vfolder_thread), - - BONOBO_UI_UNSAFE_VERB ("ViewLoadImages", emfv_view_load_images), - /* ViewHeaders stuff is a radio */ - /* CaretMode is a toggle */ - - BONOBO_UI_VERB_END -}; -static EPixmap emfv_message_pixmaps[] = { - E_PIXMAP ("/commands/EditCut", "16_cut.png"), - E_PIXMAP ("/commands/EditCopy", "16_copy.png"), - E_PIXMAP ("/commands/EditPaste", "16_paste.png"), - - E_PIXMAP ("/commands/PrintMessage", "print.xpm"), - E_PIXMAP ("/commands/PrintPreviewMessage", "print-preview.xpm"), - E_PIXMAP ("/commands/MessageDelete", "evolution-trash-mini.png"), - E_PIXMAP ("/commands/MessageUndelete", "undelete_message-16.png"), - E_PIXMAP ("/commands/MessageCopy", "copy_16_message.xpm"), - E_PIXMAP ("/commands/MessageMove", "move_message.xpm"), - E_PIXMAP ("/commands/MessageReplyAll", "reply_to_all.xpm"), - E_PIXMAP ("/commands/MessageReplySender", "reply.xpm"), - E_PIXMAP ("/commands/MessageForward", "forward.xpm"), - E_PIXMAP ("/commands/MessageApplyFilters", "apply-filters-16.xpm"), - E_PIXMAP ("/commands/MessageSearch", "search-16.png"), - E_PIXMAP ("/commands/MessageSaveAs", "save-as-16.png"), - E_PIXMAP ("/commands/MessageMarkAsRead", "mail-read.xpm"), - E_PIXMAP ("/commands/MessageMarkAsUnRead", "mail-new.xpm"), - E_PIXMAP ("/commands/MessageMarkAsImportant", "priority-high.xpm"), - E_PIXMAP ("/commands/MessageFollowUpFlag", "flag-for-followup-16.png"), - - E_PIXMAP ("/Toolbar/MailMessageToolbar/MessageReplySender", "buttons/reply.png"), - E_PIXMAP ("/Toolbar/MailMessageToolbar/MessageReplyAll", "buttons/reply-to-all.png"), - E_PIXMAP ("/Toolbar/MailMessageToolbar/MessageForward", "buttons/forward.png"), - E_PIXMAP ("/Toolbar/MailMessageToolbar/PrintMessage", "buttons/print.png"), - E_PIXMAP ("/Toolbar/MailMessageToolbar/MessageMove", "buttons/move-message.png"), - E_PIXMAP ("/Toolbar/MailMessageToolbar/MessageCopy", "buttons/copy-message.png"), - E_PIXMAP ("/Toolbar/MailMessageToolbar/MessageDelete", "buttons/delete-message.png"), - E_PIXMAP ("/Toolbar/MailMessageToolbar/MessageMarkAsJunk", "stock-junk-24.png"), - E_PIXMAP ("/Toolbar/MailMessageToolbar/MessageMarkAsNotJunk", "stock-notjunk-24.png"), - - E_PIXMAP ("/Toolbar/MailNextButtons/MailNext", "buttons/next-message.png"), - E_PIXMAP ("/Toolbar/MailNextButtons/MailPrevious", "buttons/previous-message.png"), - - E_PIXMAP_END -}; - -/* this is added to emfv->enable_map in :init() */ -static const EMFolderViewEnable emfv_enable_map[] = { - { "EditCut", EM_POPUP_SELECT_MANY }, - { "EditCopy", EM_POPUP_SELECT_MANY }, - { "EditPaste", 0 }, - - /* FIXME: should these be single-selection? */ - { "MailNext", EM_POPUP_SELECT_MANY }, - { "MailNextFlagged", EM_POPUP_SELECT_MANY }, - { "MailNextUnread", EM_POPUP_SELECT_MANY }, - { "MailNextThread", EM_POPUP_SELECT_MANY }, - { "MailPrevious", EM_POPUP_SELECT_MANY }, - { "MailPreviousFlagged", EM_POPUP_SELECT_MANY }, - { "MailPreviousUnread", EM_POPUP_SELECT_MANY }, - - { "AddSenderToAddressbook", EM_POPUP_SELECT_ADD_SENDER }, - - { "MessageApplyFilters", EM_POPUP_SELECT_MANY }, - { "MessageCopy", EM_POPUP_SELECT_MANY }, - { "MessageDelete", EM_POPUP_SELECT_MANY|EM_POPUP_SELECT_DELETE }, - { "MessageForward", EM_POPUP_SELECT_MANY }, - { "MessageForwardAttached", EM_POPUP_SELECT_MANY }, - { "MessageForwardInline", EM_POPUP_SELECT_ONE }, - { "MessageForwardQuoted", EM_POPUP_SELECT_ONE }, - { "MessageRedirect", EM_POPUP_SELECT_ONE }, - { "MessageMarkAsRead", EM_POPUP_SELECT_MANY|EM_POPUP_SELECT_MARK_READ }, - { "MessageMarkAsUnRead", EM_POPUP_SELECT_MANY|EM_POPUP_SELECT_MARK_UNREAD }, - { "MessageMarkAsImportant", EM_POPUP_SELECT_MANY|EM_POPUP_SELECT_MARK_IMPORTANT }, - { "MessageMarkAsUnimportant", EM_POPUP_SELECT_MANY|EM_POPUP_SELECT_MARK_UNIMPORTANT }, - { "MessageMarkAsJunk", EM_POPUP_SELECT_MANY|EM_POPUP_SELECT_MARK_JUNK }, - { "MessageMarkAsNotJunk", EM_POPUP_SELECT_MANY|EM_POPUP_SELECT_MARK_NOJUNK }, - { "MessageFollowUpFlag", EM_POPUP_SELECT_MANY }, - { "MessageMove", EM_POPUP_SELECT_MANY }, - { "MessageOpen", EM_POPUP_SELECT_MANY }, - { "MessagePostReply", EM_POPUP_SELECT_ONE }, - { "MessageReplyAll", EM_POPUP_SELECT_ONE }, - { "MessageReplyList", EM_POPUP_SELECT_ONE|EM_POPUP_SELECT_MAILING_LIST }, - { "MessageReplySender", EM_POPUP_SELECT_ONE }, - { "MessageResend", EM_POPUP_SELECT_RESEND }, - { "MessageSaveAs", EM_POPUP_SELECT_MANY }, - { "MessageSearch", EM_POPUP_SELECT_ONE }, - { "MessageUndelete", EM_POPUP_SELECT_MANY|EM_POPUP_SELECT_UNDELETE }, - { "PrintMessage", EM_POPUP_SELECT_ONE }, - { "PrintPreviewMessage", EM_POPUP_SELECT_ONE }, - - { "TextZoomIn", EM_POPUP_SELECT_ONE }, - { "TextZoomOut", EM_POPUP_SELECT_ONE }, - { "TextZoomReset", EM_POPUP_SELECT_ONE }, - - { "ToolsFilterMailingList", EM_POPUP_SELECT_ONE }, - { "ToolsFilterRecipient", EM_POPUP_SELECT_ONE }, - { "ToolsFilterSender", EM_POPUP_SELECT_ONE }, - { "ToolsFilterSubject", EM_POPUP_SELECT_ONE }, - { "ToolsFilterThread", EM_POPUP_SELECT_ONE }, - { "ToolsVFolderMailingList", EM_POPUP_SELECT_ONE }, - { "ToolsVFolderRecipient", EM_POPUP_SELECT_ONE }, - { "ToolsVFolderSender", EM_POPUP_SELECT_ONE }, - { "ToolsVFolderSubject", EM_POPUP_SELECT_ONE }, - { "ToolsVFolderThread", EM_POPUP_SELECT_ONE }, - - { "ViewLoadImages", EM_POPUP_SELECT_ONE }, - - { NULL }, - - /* always enabled - - { "ViewFullHeaders", IS_0MESSAGE, 0 }, - { "ViewNormal", IS_0MESSAGE, 0 }, - { "ViewSource", IS_0MESSAGE, 0 }, - { "CaretMode", IS_0MESSAGE, 0 }, */ -}; - -static void -emfv_enable_menus(EMFolderView *emfv) -{ - guint32 disable_mask; - GString *name; - GSList *l; - EMPopupTarget *t; - - if (emfv->uic == NULL) - return; - - if (emfv->folder) { - t = em_folder_view_get_popup_target(emfv); - disable_mask = t->mask; - em_popup_target_free(t); - } else { - disable_mask = ~0; - } - - name = g_string_new(""); - for (l = emfv->enable_map; l; l = l->next) { - EMFolderViewEnable *map = l->data; - int i; - - for (i=0;map[i].name;i++) { - int state = (map[i].mask & disable_mask) == 0; - - g_string_printf(name, "/commands/%s", map[i].name); - bonobo_ui_component_set_prop(emfv->uic, name->str, "sensitive", state?"1":"0", NULL); - } - } - - g_string_free(name, TRUE); -} - -/* must match em_format_mode_t order */ -static const char * const emfv_display_styles[] = { - "/commands/ViewNormal", - "/commands/ViewFullHeaders", - "/commands/ViewSource" -}; - -static void -emfv_view_mode(BonoboUIComponent *uic, const char *path, Bonobo_UIComponent_EventType type, const char *state, void *data) -{ - EMFolderView *emfv = data; - int i; - - if (type != Bonobo_UIComponent_STATE_CHANGED - || state[0] == '0') - return; - - /* TODO: I don't like this stuff much, is there any way we can move listening for such events - elsehwere? Probably not I guess, unless there's a EMFolderViewContainer for bonobo usage - of a folder view */ - - for (i=0;i<= EM_FORMAT_SOURCE;i++) { - if (strcmp(emfv_display_styles[i]+strlen("/commands/"), path) == 0) { - em_format_set_mode((EMFormat *)emfv->preview, i); - - if (TRUE /* set preferences but not for EMMessageBrowser? */) { - GConfClient *gconf = mail_config_get_gconf_client (); - - gconf_client_set_int (gconf, "/apps/evolution/mail/display/message_style", i, NULL); - } - break; - } - } -} - -static void -emfv_caret_mode(BonoboUIComponent *uic, const char *path, Bonobo_UIComponent_EventType type, const char *state, void *data) -{ - EMFolderView *emfv = data; - - if (type != Bonobo_UIComponent_STATE_CHANGED) - return; - - em_format_html_display_set_caret_mode(emfv->preview, state[0] != '0'); - - gconf_client_set_bool(mail_config_get_gconf_client(), "/apps/evolution/mail/display/caret_mode", state[0] != '0', NULL); -} - -static void -emfv_charset_changed(BonoboUIComponent *uic, const char *path, Bonobo_UIComponent_EventType type, const char *state, void *data) -{ - EMFolderView *emfv = data; - - if (type != Bonobo_UIComponent_STATE_CHANGED) - return; - - /* menu items begin with "Charset-" = 8 characters */ - if (state[0] != '0' && strlen(path) > 8) { - path += 8; - /* default charset used in mail view */ - if (!strcmp(path, _("Default"))) - path = NULL; - - em_format_set_charset((EMFormat *)emfv->preview, path); - } -} - -static void -emfv_activate(EMFolderView *emfv, BonoboUIComponent *uic, int act) -{ - if (act) { - em_format_mode_t style; - gboolean state; - GSList *l; - - emfv->uic = uic; - - for (l = emfv->ui_files;l;l = l->next) - bonobo_ui_util_set_ui(uic, PREFIX, (char *)l->data, emfv->ui_app_name, NULL); - - bonobo_ui_component_add_verb_list_with_data(uic, emfv_message_verbs, emfv); - e_pixmaps_update(uic, emfv_message_pixmaps); - - state = emfv->preview->caret_mode; - bonobo_ui_component_set_prop(uic, "/commands/CaretMode", "state", state?"1":"0", NULL); - bonobo_ui_component_add_listener(uic, "CaretMode", emfv_caret_mode, emfv); - - style = ((EMFormat *)emfv->preview)->mode; - bonobo_ui_component_set_prop(uic, emfv_display_styles[style], "state", "1", NULL); - bonobo_ui_component_add_listener(uic, "ViewNormal", emfv_view_mode, emfv); - bonobo_ui_component_add_listener(uic, "ViewFullHeaders", emfv_view_mode, emfv); - bonobo_ui_component_add_listener(uic, "ViewSource", emfv_view_mode, emfv); - em_format_set_mode((EMFormat *)emfv->preview, style); - - if (emfv->folder && !em_utils_folder_is_sent(emfv->folder, emfv->folder_uri)) - bonobo_ui_component_set_prop(uic, "/commands/MessageResend", "sensitive", "0", NULL); - - /* default charset used in mail view */ - e_charset_picker_bonobo_ui_populate (uic, "/menu/View", _("Default"), emfv_charset_changed, emfv); - - emfv_enable_menus(emfv); - } else { - const BonoboUIVerb *v; - - /* TODO: Should this just rm /? */ - for (v = &emfv_message_verbs[0]; v->cname; v++) - bonobo_ui_component_remove_verb(uic, v->cname); - - if (emfv->folder) - mail_sync_folder(emfv->folder, NULL, NULL); - - emfv->uic = NULL; - } -} - -int em_folder_view_print(EMFolderView *emfv, int preview) -{ - /*struct _EMFolderViewPrivate *p = emfv->priv;*/ - EMFormatHTMLPrint *print; - GnomePrintConfig *config = NULL; - int res; - struct _CamelMedium *msg; - - /* FIXME: need to load the message first */ - if (!emfv->preview_active) - return 0; - - msg = emfv->preview->formathtml.format.message; - if (msg == NULL) - return 0; - - if (!preview) { - GtkDialog *dialog = (GtkDialog *)gnome_print_dialog_new(NULL, _("Print Message"), GNOME_PRINT_DIALOG_COPIES); - - gtk_dialog_set_default_response(dialog, GNOME_PRINT_DIALOG_RESPONSE_PRINT); - e_dialog_set_transient_for ((GtkWindow *) dialog, (GtkWidget *) emfv); - - switch (gtk_dialog_run(dialog)) { - case GNOME_PRINT_DIALOG_RESPONSE_PRINT: - break; - case GNOME_PRINT_DIALOG_RESPONSE_PREVIEW: - preview = TRUE; - break; - default: - gtk_widget_destroy((GtkWidget *)dialog); - return 0; - } - - config = gnome_print_dialog_get_config((GnomePrintDialog *)dialog); - gtk_widget_destroy((GtkWidget *)dialog); - } - - print = em_format_html_print_new(); - em_format_set_session((EMFormat *)print, ((EMFormat *)emfv->preview)->session); - res = em_format_html_print_print(print, msg, (EMFormatHTML *)emfv->preview, config, preview); - g_object_unref(print); - if (config) - g_object_unref(config); - - return res; -} - -EMPopupTarget * -em_folder_view_get_popup_target(EMFolderView *emfv) -{ - EMPopupTarget *t; - - t = em_popup_target_new_select(emfv->folder, emfv->folder_uri, message_list_get_selected(emfv->list)); - t->widget = (GtkWidget *)emfv; - - if (emfv->list->threaded) - t->mask &= ~EM_FOLDER_VIEW_SELECT_THREADED; - - if (message_list_hidden(emfv->list) != 0) - t->mask &= ~EM_FOLDER_VIEW_SELECT_HIDDEN; - - return t; -} - -/* ********************************************************************** */ - -struct mst_t { - EMFolderView *emfv; - char *uid; -}; - -static void -mst_free (struct mst_t *mst) -{ - mst->emfv->priv->seen_id = 0; - - g_free (mst->uid); - g_free (mst); -} - -static int -do_mark_seen (gpointer user_data) -{ - struct mst_t *mst = user_data; - EMFolderView *emfv = mst->emfv; - MessageList *list = emfv->list; - - if (mst->uid && list->cursor_uid && !strcmp (mst->uid, list->cursor_uid)) - camel_folder_set_message_flags (emfv->folder, mst->uid, CAMEL_MESSAGE_SEEN, CAMEL_MESSAGE_SEEN); - - return FALSE; -} - -static void -emfv_list_done_message_selected(CamelFolder *folder, const char *uid, CamelMimeMessage *msg, void *data) -{ - EMFolderView *emfv = data; - - em_format_format((EMFormat *)emfv->preview, (struct _CamelMedium *)msg); - - if (emfv->priv->seen_id) - g_source_remove(emfv->priv->seen_id); - - if (msg && emfv->mark_seen) { - if (emfv->mark_seen_timeout > 0) { - struct mst_t *mst; - - mst = g_new (struct mst_t, 1); - mst->emfv = emfv; - mst->uid = g_strdup (uid); - - emfv->priv->seen_id = g_timeout_add_full(G_PRIORITY_DEFAULT_IDLE, emfv->mark_seen_timeout, - (GSourceFunc)do_mark_seen, mst, (GDestroyNotify)mst_free); - } else { - camel_folder_set_message_flags(emfv->folder, uid, CAMEL_MESSAGE_SEEN, CAMEL_MESSAGE_SEEN); - } - } -} - -static void -emfv_list_message_selected(MessageList *ml, const char *uid, EMFolderView *emfv) -{ - /* FIXME: ui stuff based on messageinfo, if available */ - - if (emfv->preview_active) { - if (uid) { - if (emfv->priv->displayed_uid == NULL || strcmp(emfv->priv->displayed_uid, uid) != 0) { - g_free(emfv->priv->displayed_uid); - emfv->priv->displayed_uid = g_strdup(uid); - mail_get_message(emfv->folder, uid, emfv_list_done_message_selected, emfv, mail_thread_new); - } - } else { - g_free(emfv->priv->displayed_uid); - emfv->priv->displayed_uid = NULL; - em_format_format((EMFormat *)emfv->preview, NULL); - } - } - - emfv_enable_menus(emfv); -} - -static void -emfv_list_double_click(ETree *tree, gint row, ETreePath path, gint col, GdkEvent *event, EMFolderView *emfv) -{ - /* Ignore double-clicks on columns that handle thier own state */ - if (MESSAGE_LIST_COLUMN_IS_ACTIVE (col)) - return; - - em_folder_view_open_selected(emfv); -} - -static int -emfv_list_right_click(ETree *tree, gint row, ETreePath path, gint col, GdkEvent *event, EMFolderView *emfv) -{ - emfv_popup(emfv, event); - - return TRUE; -} - -static int -emfv_list_key_press(ETree *tree, int row, ETreePath path, int col, GdkEvent *ev, EMFolderView *emfv) -{ - GPtrArray *uids; - int i; - guint32 flags; - - if ((ev->key.state & GDK_CONTROL_MASK) != 0) - return FALSE; - - switch (ev->key.keyval) { - case GDK_Return: - case GDK_KP_Enter: - case GDK_ISO_Enter: - em_folder_view_open_selected(emfv); - break; - case GDK_Delete: - case GDK_KP_Delete: - /* If any messages are undeleted, run delete, if all are deleted, run undelete */ - flags = 0; - uids = message_list_get_selected(emfv->list); - for (i = 0; i < uids->len; i++) { - if ((camel_folder_get_message_flags(emfv->folder, uids->pdata[i]) & CAMEL_MESSAGE_DELETED) == 0) - break; - } - message_list_free_uids(emfv->list, uids); - if (i == uids->len) - emfv_popup_undelete(NULL, emfv); - else - emfv_popup_delete(NULL, emfv); - break; - case GDK_Menu: - /* FIXME: location of popup */ - emfv_popup(emfv, NULL); - break; - case '!': - uids = message_list_get_selected(emfv->list); - - camel_folder_freeze(emfv->folder); - for (i = 0; i < uids->len; i++) { - flags = camel_folder_get_message_flags(emfv->folder, uids->pdata[i]) ^ CAMEL_MESSAGE_FLAGGED; - if (flags & CAMEL_MESSAGE_FLAGGED) - flags &= ~CAMEL_MESSAGE_DELETED; - camel_folder_set_message_flags(emfv->folder, uids->pdata[i], - CAMEL_MESSAGE_FLAGGED|CAMEL_MESSAGE_DELETED, flags); - } - camel_folder_thaw(emfv->folder); - - message_list_free_uids(emfv->list, uids); - break; - default: - return FALSE; - } - - return TRUE; -} - -static void -emfv_format_link_clicked(EMFormatHTMLDisplay *efhd, const char *uri, EMFolderView *emfv) -{ - if (!strncasecmp (uri, "mailto:", 7)) { - em_utils_compose_new_message_with_mailto (uri); - } else if (*uri == '#') { - gtk_html_jump_to_anchor (((EMFormatHTML *) efhd)->html, uri + 1); - } else if (!strncasecmp (uri, "thismessage:", 12)) { - /* ignore */ - } else if (!strncasecmp (uri, "cid:", 4)) { - /* ignore */ - } else { - GError *err = NULL; - - gnome_url_show (uri, &err); - - if (err) { - g_warning ("gnome_url_show: %s", err->message); - g_error_free (err); - } - } -} - -struct _EMFVPopupItem { - EMPopupItem item; - - EMFolderView *emfv; - char *uri; -}; - -static void -emp_uri_popup_link_copy(GtkWidget *w, struct _EMFVPopupItem *item) -{ - struct _EMFolderViewPrivate *p = item->emfv->priv; - - g_free(p->selection_uri); - p->selection_uri = g_strdup(item->uri); - - gtk_selection_owner_set(p->invisible, GDK_SELECTION_PRIMARY, gtk_get_current_event_time()); - gtk_selection_owner_set(p->invisible, GDK_SELECTION_CLIPBOARD, gtk_get_current_event_time()); -} - -static struct _EMFVPopupItem emfv_uri_popups[] = { - { { EM_POPUP_ITEM, "00.uri.01", N_("_Copy Link Location"), G_CALLBACK(emp_uri_popup_link_copy), NULL, NULL, EM_POPUP_URI_NOT_MAILTO }, }, -}; - -static void -emfv_uri_popup_free(GSList *list) -{ - while (list) { - GSList *n = list->next; - struct _EMFVPopupItem *item = list->data; - - g_free(item->uri); - g_object_unref(item->emfv); - g_slist_free_1(list); - - list = n; - } -} - -static int -emfv_format_popup_event(EMFormatHTMLDisplay *efhd, GdkEventButton *event, const char *uri, CamelMimePart *part, EMFolderView *emfv) -{ - EMPopup *emp; - EMPopupTarget *target; - GtkMenu *menu; - - /* FIXME: this maybe should just fit on em-html-display, it has access to the - snooped part type */ - - emp = em_popup_new("com.ximian.mail.folderview.popup.uri"); - if (part) - target = em_popup_target_new_part(part, NULL); - else { - GSList *menus = NULL; - int i; - - target = em_popup_target_new_uri(uri); - - for (i=0;i<sizeof(emfv_uri_popups)/sizeof(emfv_uri_popups[0]);i++) { - emfv_uri_popups[i].item.activate_data = &emfv_uri_popups[i]; - emfv_uri_popups[i].emfv = emfv; - g_object_ref(emfv); - emfv_uri_popups[i].uri = g_strdup(target->data.uri); - menus = g_slist_prepend(menus, &emfv_uri_popups[i]); - } - em_popup_add_items(emp, menus, (GDestroyNotify)emfv_uri_popup_free); - } - - menu = em_popup_create_menu_once(emp, target, target->mask, target->mask); - gtk_menu_popup(menu, NULL, NULL, NULL, NULL, event->button, event->time); - - return TRUE; -} - -static void -emfv_gui_folder_changed(CamelFolder *folder, void *dummy, EMFolderView *emfv) -{ - emfv_enable_menus(emfv); - g_object_unref(emfv); -} - -static void -emfv_folder_changed(CamelFolder *folder, CamelFolderChangeInfo *changes, EMFolderView *emfv) -{ - g_object_ref(emfv); - mail_async_event_emit(emfv->async, MAIL_ASYNC_GUI, (MailAsyncFunc)emfv_gui_folder_changed, folder, NULL, emfv); -} - -/* keep these two tables in sync */ -enum { - EMFV_ANIMATE_IMAGES = 1, - EMFV_CHARSET, - EMFV_CITATION_COLOUR, - EMFV_CITATION_MARK, - EMFV_CARET_MODE, - EMFV_MESSAGE_STYLE, - EMFV_MARK_SEEN, - EMFV_MARK_SEEN_TIMEOUT, - EMFV_LOAD_HTTP, - EMFV_XMAILER_MASK, - EMFV_SETTINGS /* last, for loop count */ -}; - -/* IF these get too long, update key field */ -static const char * const emfv_display_keys[] = { - "animate_images", - "charset", - "citation_colour", - "mark_citations", - "caret_mode", - "message_style", - "mark_seen", - "mark_seen_timeout", - "load_http_images", - "xmailer_mask", -}; - -static GHashTable *emfv_setting_key; - -static void -emfv_setting_notify(GConfClient *gconf, guint cnxn_id, GConfEntry *entry, EMFolderView *emfv) -{ - char *tkey; - - g_return_if_fail (gconf_entry_get_key (entry) != NULL); - g_return_if_fail (gconf_entry_get_value (entry) != NULL); - - tkey = strrchr(entry->key, '/'); - g_return_if_fail (tkey != NULL); - - switch(GPOINTER_TO_INT(g_hash_table_lookup(emfv_setting_key, tkey+1))) { - case EMFV_ANIMATE_IMAGES: - em_format_html_display_set_animate(emfv->preview, gconf_value_get_bool(gconf_entry_get_value(entry))); - break; - case EMFV_CHARSET: - em_format_set_default_charset((EMFormat *)emfv->preview, gconf_value_get_string(gconf_entry_get_value(entry))); - break; - case EMFV_CITATION_COLOUR: { - const char *s; - GdkColor colour; - guint32 rgb; - - s = gconf_value_get_string(gconf_entry_get_value(entry)); - gdk_color_parse(s?s:"#737373", &colour); - rgb = ((colour.red & 0xff00) << 8) | (colour.green & 0xff00) | ((colour.blue & 0xff00) >> 8); - em_format_html_set_mark_citations((EMFormatHTML *)emfv->preview, - ((EMFormatHTML *)emfv->preview)->mark_citations, rgb); - break; } - case EMFV_CITATION_MARK: - em_format_html_set_mark_citations((EMFormatHTML *)emfv->preview, - gconf_value_get_bool(gconf_entry_get_value(entry)), - ((EMFormatHTML *)emfv->preview)->citation_colour); - break; - case EMFV_CARET_MODE: - em_format_html_display_set_caret_mode(emfv->preview, gconf_value_get_bool(gconf_entry_get_value(entry))); - break; - case EMFV_MESSAGE_STYLE: { - int style = gconf_value_get_int(gconf_entry_get_value(entry)); - - if (style < EM_FORMAT_NORMAL || style > EM_FORMAT_SOURCE) - style = EM_FORMAT_NORMAL; - em_format_set_mode((EMFormat *)emfv->preview, style); - break; } - case EMFV_MARK_SEEN: - emfv->mark_seen = gconf_value_get_bool(gconf_entry_get_value(entry)); - break; - case EMFV_MARK_SEEN_TIMEOUT: - emfv->mark_seen_timeout = gconf_value_get_int(gconf_entry_get_value(entry)); - break; - case EMFV_LOAD_HTTP: { - int style = gconf_value_get_int(gconf_entry_get_value(entry)); - - /* FIXME: this doesn't handle the 'sometimes' case, only the always case */ - em_format_html_set_load_http((EMFormatHTML *)emfv->preview, style == 2); - break; } - case EMFV_XMAILER_MASK: - em_format_html_set_xmailer_mask((EMFormatHTML *)emfv->preview, gconf_value_get_int(gconf_entry_get_value(entry))); - break; - } -} - -static void -emfv_setting_setup(EMFolderView *emfv) -{ - GConfClient *gconf = gconf_client_get_default(); - GConfEntry *entry; - GError *err = NULL; - int i; - char key[64]; - - if (emfv_setting_key == NULL) { - emfv_setting_key = g_hash_table_new(g_str_hash, g_str_equal); - for (i=1;i<EMFV_SETTINGS;i++) - g_hash_table_insert(emfv_setting_key, (void *)emfv_display_keys[i-1], GINT_TO_POINTER(i)); - } - - gconf_client_add_dir(gconf, "/apps/evolution/mail/display", GCONF_CLIENT_PRELOAD_NONE, NULL); - - for (i=1;err == NULL && i<EMFV_SETTINGS;i++) { - sprintf(key, "/apps/evolution/mail/display/%s", emfv_display_keys[i-1]); - entry = gconf_client_get_entry(gconf, key, NULL, TRUE, &err); - if (entry) { - emfv_setting_notify(gconf, 0, entry, emfv); - gconf_entry_free(entry); - } - } - - if (err) { - g_warning("Could not load display settings: %s", err->message); - g_error_free(err); - } - - emfv->priv->setting_notify_id = gconf_client_notify_add(gconf, "/apps/evolution/mail/display", - (GConfClientNotifyFunc)emfv_setting_notify, - emfv, NULL, NULL); - g_object_unref(gconf); -} diff --git a/mail/em-folder-view.h b/mail/em-folder-view.h deleted file mode 100644 index 080b19eb6a..0000000000 --- a/mail/em-folder-view.h +++ /dev/null @@ -1,117 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Authors: Michael Zucchi <notzed@ximian.com> - * - * Copyright 2003 Ximian, Inc. (www.ximian.com) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA. - * - */ - - -#ifndef _EM_FOLDER_VIEW_H -#define _EM_FOLDER_VIEW_H - -#include <gtk/gtkvbox.h> -#include "em-popup.h" - -#ifdef __cplusplus -extern "C" { -#pragma } -#endif /* __cplusplus */ - -struct _MessageList; -struct _EMFormatHTMLDisplay; -struct _CamelFolder; -struct _CamelMedium; - -typedef struct _EMFolderView EMFolderView; -typedef struct _EMFolderViewClass EMFolderViewClass; - -typedef struct _EMFolderViewEnable EMFolderViewEnable; - -enum { - EM_FOLDER_VIEW_SELECT_THREADED = EM_POPUP_SELECT_LAST, - EM_FOLDER_VIEW_SELECT_HIDDEN = EM_POPUP_SELECT_LAST<<1, - EM_FOLDER_VIEW_SELECT_LAST = EM_POPUP_SELECT_LAST<<2, -}; - -struct _EMFolderViewEnable { - const char *name; /* bonobo name, relative to /commands/ */ - guint32 mask; /* disable mask, see EM_FOLDER_VIEW_CAN* flags */ -}; - -struct _EMFolderView { - GtkVBox parent; - - struct _EMFolderViewPrivate *priv; - - struct _MessageList *list; - struct _EMFormatHTMLDisplay *preview; - - struct _CamelFolder *folder; - char *folder_uri; - - /* used to load ui from base activate implementation */ - GSList *ui_files; /* const char * list, TODO: should this be on class? */ - const char *ui_app_name; - - /* for proxying jobs to main or other threads */ - struct _MailAsyncEvent *async; - - struct _BonoboUIComponent *uic; /* if we're active, this will be set */ - GSList *enable_map; /* bonobo menu enable map, entries are 0-terminated EMFolderViewEnable arryas - TODO: should this be on class? */ - - int mark_seen_timeout; /* local copy of gconf stuff */ - int mark_seen:1; - int preview_active:1; /* is preview being used */ -}; - -struct _EMFolderViewClass { - GtkVBoxClass parent_class; - - /* if used as a control, used to activate/deactivate custom menu's */ - void (*activate)(EMFolderView *, struct _BonoboUIComponent *uic, int state); - - void (*set_folder_uri)(EMFolderView *emfv, const char *uri); - void (*set_folder)(EMFolderView *emfv, struct _CamelFolder *folder, const char *uri); - void (*set_message)(EMFolderView *emfv, const char *uid); -}; - -GType em_folder_view_get_type(void); - -GtkWidget *em_folder_view_new(void); - -#define em_folder_view_activate(emfv, uic, state) ((EMFolderViewClass *)G_OBJECT_GET_CLASS(emfv))->activate((emfv), (uic), (state)) -#define em_folder_view_set_folder(emfv, folder, uri) ((EMFolderViewClass *)G_OBJECT_GET_CLASS(emfv))->set_folder((emfv), (folder), (uri)) -#define em_folder_view_set_folder_uri(emfv, uri) ((EMFolderViewClass *)G_OBJECT_GET_CLASS(emfv))->set_folder_uri((emfv), (uri)) -#define em_folder_view_set_message(emfv, uid) ((EMFolderViewClass *)G_OBJECT_GET_CLASS(emfv))->set_message((emfv), (uid)) - -struct _EMPopupTarget *em_folder_view_get_popup_target(EMFolderView *emfv); - -int em_folder_view_mark_selected(EMFolderView *emfv, guint32 mask, guint32 set); -int em_folder_view_open_selected(EMFolderView *emfv); - -int em_folder_view_print(EMFolderView *emfv, int preview); - -/* this could be on message-list */ -guint32 em_folder_view_disable_mask(EMFolderView *emfv); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* ! _EM_FOLDER_VIEW_H */ diff --git a/mail/em-format-html-display.c b/mail/em-format-html-display.c deleted file mode 100644 index 808f8d030e..0000000000 --- a/mail/em-format-html-display.c +++ /dev/null @@ -1,1352 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Authors: Michael Zucchi <notzed@ximian.com> - * - * Copyright 2003 Ximian, Inc. (www.ximian.com) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA. - * - */ - - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <string.h> - -#include <gtkhtml/gtkhtml.h> -#include <gtkhtml/htmlengine.h> -#include <gtkhtml/htmlobject.h> -#include <gtkhtml/htmliframe.h> -#include <gtkhtml/htmlinterval.h> -#include <gtkhtml/gtkhtml-embedded.h> -#include <gtkhtml/gtkhtml-search.h> - -#include <gtk/gtkvbox.h> -#include <gtk/gtkhbox.h> -#include <gtk/gtkbutton.h> -#include <gtk/gtkstock.h> -#include <gtk/gtkimage.h> -#include <gtk/gtkarrow.h> - -#include <gtk/gtkmenu.h> -#include <gtk/gtkmenuitem.h> - -#include <glade/glade.h> - -#include <libgnomevfs/gnome-vfs-mime-handlers.h> - -#if 0 -#include <libgnomevfs/gnome-vfs-utils.h> -#include <libgnomevfs/gnome-vfs-mime-utils.h> -#include <libgnomevfs/gnome-vfs-mime.h> -#endif - -#include <bonobo/bonobo-control-frame.h> -#include <bonobo/bonobo-stream-memory.h> -#include <bonobo/bonobo-widget.h> - -#include <camel/camel-stream.h> -#include <camel/camel-stream-mem.h> -#include <camel/camel-mime-filter-tohtml.h> -#include <camel/camel-mime-part.h> -#include <camel/camel-multipart.h> -#include <camel/camel-multipart-signed.h> -#include <camel/camel-internet-address.h> -#include <camel/camel-mime-message.h> -#include <camel/camel-gpg-context.h> - -#include <e-util/e-msgport.h> -#include <e-util/e-gui-utils.h> -#include <e-util/e-dialog-utils.h> - -#include "mail-config.h" - -#include "em-format-html-display.h" -#include "em-marshal.h" -#include "e-searching-tokenizer.h" -#include "em-icon-stream.h" -#include "em-utils.h" -#include "em-popup.h" -#include "em-icon-stream.h" - -#define d(x) - -#define EFHD_TABLE_OPEN "<table>" - -struct _EMFormatHTMLDisplayPrivate { - /* For the interactive search dialogue */ - /* TODO: Should this be more subtle, like the mozilla one? */ - GtkDialog *search_dialog; - GtkWidget *search_entry; - GtkWidget *search_matches_label; - GtkWidget *search_case_check; - char *search_text; - int search_wrap; /* are we doing a wrap search */ -}; - -static int efhd_html_button_press_event (GtkWidget *widget, GdkEventButton *event, EMFormatHTMLDisplay *efh); -static void efhd_html_link_clicked (GtkHTML *html, const char *url, EMFormatHTMLDisplay *efhd); - -struct _attach_puri { - EMFormatPURI puri; - - const EMFormatHandler *handle; - - /* for the > and V buttons */ - GtkWidget *forward, *down; - /* currently no way to correlate this data to the frame :( */ - GtkHTML *frame; - CamelStream *output; - unsigned int shown:1; -}; - -static void efhd_iframe_created(GtkHTML *html, GtkHTML *iframe, EMFormatHTMLDisplay *efh); -/*static void efhd_url_requested(GtkHTML *html, const char *url, GtkHTMLStream *handle, EMFormatHTMLDisplay *efh); - static gboolean efhd_object_requested(GtkHTML *html, GtkHTMLEmbedded *eb, EMFormatHTMLDisplay *efh);*/ - -static void efhd_format_clone(EMFormat *, CamelMedium *, EMFormat *); -static void efhd_format_error(EMFormat *emf, CamelStream *stream, const char *txt); -static void efhd_format_message(EMFormat *, CamelStream *, CamelMedium *); -static void efhd_format_source(EMFormat *, CamelStream *, CamelMimePart *); -static void efhd_format_attachment(EMFormat *, CamelStream *, CamelMimePart *, const char *, const EMFormatHandler *); -static void efhd_complete(EMFormat *); - -static void efhd_builtin_init(EMFormatHTMLDisplayClass *efhc); - -enum { - EFHD_LINK_CLICKED, - EFHD_POPUP_EVENT, - EFHD_LAST_SIGNAL, -}; - -static guint efhd_signals[EFHD_LAST_SIGNAL] = { 0 }; - - -static EMFormatHTMLClass *efhd_parent; - -static void -efhd_gtkhtml_realise(GtkHTML *html, EMFormatHTMLDisplay *efhd) -{ - GtkStyle *style; - - /* FIXME: does this have to be re-done every time we draw? */ - - /* My favorite thing to do... muck around with colors so we respect people's stupid themes. - However, we only do this if we are rendering to the screen -- we ignore the theme - when we are printing. */ - style = gtk_widget_get_style((GtkWidget *)html); - if (style) { - int state = GTK_WIDGET_STATE(html); - gushort r, g, b; -#define SCALE (238) - - /* choose a suitably darker or lighter colour */ - r = style->base[state].red >> 8; - g = style->base[state].green >> 8; - b = style->base[state].blue >> 8; - - if (r+b+g > 128*3) { - r = (r*SCALE) >> 8; - g = (g*SCALE) >> 8; - b = (b*SCALE) >> 8; - } else { - r = 128 - ((SCALE * r) >> 9); - g = 128 - ((SCALE * g) >> 9); - b = 128 - ((SCALE * b) >> 9); - } - - efhd->formathtml.body_colour = ((r<<16) | (g<< 8) | b) & 0xffffff; - -#undef SCALE -#define SCALE (174) - /* choose a suitably darker or lighter colour */ - r = style->base[state].red >> 8; - g = style->base[state].green >> 8; - b = style->base[state].blue >> 8; - - if (r+b+g > 128*3) { - r = (r*SCALE) >> 8; - g = (g*SCALE) >> 8; - b = (b*SCALE) >> 8; - } else { - r = 128 - ((SCALE * r) >> 9); - g = 128 - ((SCALE * g) >> 9); - b = 128 - ((SCALE * b) >> 9); - } - - efhd->formathtml.frame_colour = ((r<<16) | (g<< 8) | b) & 0xffffff; - - r = style->base[GTK_STATE_NORMAL].red >> 8; - g = style->base[GTK_STATE_NORMAL].green >> 8; - b = style->base[GTK_STATE_NORMAL].blue >> 8; - - efhd->formathtml.content_colour = ((r<<16) | (g<< 8) | b) & 0xffffff; - - r = style->text[state].red >> 8; - g = style->text[state].green >> 8; - b = style->text[state].blue >> 8; - - efhd->formathtml.text_colour = ((r<<16) | (g<< 8) | b) & 0xffffff; - } -#undef SCALE -} - -static void -efhd_init(GObject *o) -{ - EMFormatHTMLDisplay *efhd = (EMFormatHTMLDisplay *)o; -#define efh ((EMFormatHTML *)efhd) - - efhd->priv = g_malloc0(sizeof(*efhd->priv)); - - efhd->search_tok = (ESearchingTokenizer *)e_searching_tokenizer_new(); - html_engine_set_tokenizer(efh->html->engine, (HTMLTokenizer *)efhd->search_tok); - - g_signal_connect(efh->html, "realize", G_CALLBACK(efhd_gtkhtml_realise), o); - - /* we want to convert url's etc */ - efh->text_html_flags |= CAMEL_MIME_FILTER_TOHTML_CONVERT_URLS | CAMEL_MIME_FILTER_TOHTML_CONVERT_ADDRESSES; -#undef efh -} - -static void -efhd_finalise(GObject *o) -{ - EMFormatHTMLDisplay *efhd = (EMFormatHTMLDisplay *)o; - - /* check pending stuff */ - - g_free(efhd->priv->search_text); - g_free(efhd->priv); - - ((GObjectClass *)efhd_parent)->finalize(o); -} - -static gboolean -efhd_bool_accumulator(GSignalInvocationHint *ihint, GValue *out, const GValue *in, void *data) -{ - gboolean val = g_value_get_boolean(in); - - g_value_set_boolean(out, val); - - return !val; -} - -static void -efhd_class_init(GObjectClass *klass) -{ - ((EMFormatClass *)klass)->format_clone = efhd_format_clone; - ((EMFormatClass *)klass)->format_error = efhd_format_error; - ((EMFormatClass *)klass)->format_message = efhd_format_message; - ((EMFormatClass *)klass)->format_source = efhd_format_source; - ((EMFormatClass *)klass)->format_attachment = efhd_format_attachment; - ((EMFormatClass *)klass)->complete = efhd_complete; - - klass->finalize = efhd_finalise; - - efhd_signals[EFHD_LINK_CLICKED] = - g_signal_new("link_clicked", - G_TYPE_FROM_CLASS(klass), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET(EMFormatHTMLDisplayClass, link_clicked), - NULL, NULL, - g_cclosure_marshal_VOID__POINTER, - G_TYPE_NONE, 1, G_TYPE_POINTER); - - efhd_signals[EFHD_POPUP_EVENT] = - g_signal_new("popup_event", - G_TYPE_FROM_CLASS(klass), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET(EMFormatHTMLDisplayClass, popup_event), - efhd_bool_accumulator, NULL, - em_marshal_BOOLEAN__BOXED_POINTER_POINTER, - G_TYPE_BOOLEAN, 3, - GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE, - G_TYPE_POINTER, G_TYPE_POINTER); - - efhd_builtin_init((EMFormatHTMLDisplayClass *)klass); -} - -GType -em_format_html_display_get_type(void) -{ - static GType type = 0; - - if (type == 0) { - static const GTypeInfo info = { - sizeof(EMFormatHTMLDisplayClass), - NULL, NULL, - (GClassInitFunc)efhd_class_init, - NULL, NULL, - sizeof(EMFormatHTMLDisplay), 0, - (GInstanceInitFunc)efhd_init - }; - efhd_parent = g_type_class_ref(em_format_html_get_type()); - type = g_type_register_static(em_format_html_get_type(), "EMFormatHTMLDisplay", &info, 0); - } - - return type; -} - -EMFormatHTMLDisplay *em_format_html_display_new(void) -{ - EMFormatHTMLDisplay *efhd; - - efhd = g_object_new(em_format_html_display_get_type(), 0); - - g_signal_connect(efhd->formathtml.html, "iframe_created", G_CALLBACK(efhd_iframe_created), efhd); - g_signal_connect(efhd->formathtml.html, "link_clicked", G_CALLBACK(efhd_html_link_clicked), efhd); - g_signal_connect(efhd->formathtml.html, "button_press_event", G_CALLBACK(efhd_html_button_press_event), efhd); - - return efhd; -} - -void em_format_html_display_goto_anchor(EMFormatHTMLDisplay *efhd, const char *name) -{ - printf("FIXME: go to anchor '%s'\n", name); -} - -void em_format_html_display_set_animate(EMFormatHTMLDisplay *efhd, gboolean state) -{ - efhd->animate = state; - gtk_html_set_animate(((EMFormatHTML *)efhd)->html, state); -} - -void em_format_html_display_set_caret_mode(EMFormatHTMLDisplay *efhd, gboolean state) -{ - efhd->caret_mode = state; - gtk_html_set_caret_mode(((EMFormatHTML *)efhd)->html, state); -} - -void -em_format_html_display_set_search(EMFormatHTMLDisplay *efhd, int type, GSList *strings) -{ - switch(type&3) { - case EM_FORMAT_HTML_DISPLAY_SEARCH_PRIMARY: - e_searching_tokenizer_set_primary_case_sensitivity(efhd->search_tok, (type&EM_FORMAT_HTML_DISPLAY_SEARCH_ICASE) == 0); - e_searching_tokenizer_set_primary_search_string(efhd->search_tok, NULL); - while (strings) { - e_searching_tokenizer_add_primary_search_string(efhd->search_tok, strings->data); - strings = strings->next; - } - break; - case EM_FORMAT_HTML_DISPLAY_SEARCH_SECONDARY: - default: - e_searching_tokenizer_set_secondary_case_sensitivity(efhd->search_tok, (type&EM_FORMAT_HTML_DISPLAY_SEARCH_ICASE) == 0); - e_searching_tokenizer_set_secondary_search_string(efhd->search_tok, NULL); - while (strings) { - e_searching_tokenizer_add_secondary_search_string(efhd->search_tok, strings->data); - strings = strings->next; - } - break; - } - - d(printf("redrawing with search\n")); - em_format_format_clone((EMFormat *)efhd, ((EMFormat *)efhd)->message, (EMFormat *)efhd); -} - -static void -efhd_update_matches(EMFormatHTMLDisplay *efhd) -{ - struct _EMFormatHTMLDisplayPrivate *p = efhd->priv; - char *str; - /* message-search popup match count string */ - char *fmt = _("Matches: %d"); - - if (p->search_dialog) { - str = alloca(strlen(fmt)+32); - sprintf(str, fmt, e_searching_tokenizer_match_count(efhd->search_tok)); - gtk_label_set_text((GtkLabel *)p->search_matches_label, str); - } -} - -static void -efhd_update_search(EMFormatHTMLDisplay *efhd) -{ - struct _EMFormatHTMLDisplayPrivate *p = efhd->priv; - GSList *words = NULL; - int flags = 0; - - if (p->search_text == NULL) - return; - - if (!gtk_toggle_button_get_active((GtkToggleButton *)p->search_case_check)) - flags = EM_FORMAT_HTML_DISPLAY_SEARCH_ICASE | EM_FORMAT_HTML_DISPLAY_SEARCH_PRIMARY; - else - flags = EM_FORMAT_HTML_DISPLAY_SEARCH_PRIMARY; - - if (p->search_text) - words = g_slist_append(words, p->search_text); - - em_format_html_display_set_search(efhd, flags, words); - g_slist_free(words); -} - -static void -efhd_search_response(GtkWidget *w, int button, EMFormatHTMLDisplay *efhd) -{ - struct _EMFormatHTMLDisplayPrivate *p = efhd->priv; - - if (button == GTK_RESPONSE_ACCEPT) { - char *txt = g_strdup(gtk_entry_get_text((GtkEntry *)p->search_entry)); - - g_strstrip(txt); - if (p->search_text && strcmp(p->search_text, txt) == 0 && !p->search_wrap) { - if (!gtk_html_engine_search_next(((EMFormatHTML *)efhd)->html)) - p->search_wrap = TRUE; - g_free(txt); - } else { - g_free(p->search_text); - p->search_text = txt; - if (!p->search_wrap) - efhd_update_search(efhd); - p->search_wrap = FALSE; - gtk_html_engine_search(((EMFormatHTML *)efhd)->html, txt, - gtk_toggle_button_get_active((GtkToggleButton *)p->search_case_check), - TRUE, FALSE); - } - } else { - g_free(p->search_text); - p->search_text = NULL; - gtk_widget_destroy((GtkWidget *)p->search_dialog); - p->search_dialog = NULL; - } -} - -static void -efhd_search_case_toggled(GtkWidget *w, EMFormatHTMLDisplay *efhd) -{ - struct _EMFormatHTMLDisplayPrivate *p = efhd->priv; - - g_free(p->search_text); - p->search_text = NULL; - efhd_search_response(w, GTK_RESPONSE_ACCEPT, efhd); -} - -static void -efhd_search_entry_activate(GtkWidget *w, EMFormatHTMLDisplay *efhd) -{ - efhd_search_response(w, GTK_RESPONSE_ACCEPT, efhd); -} - -/** - * em_format_html_display_search: - * @efhd: - * - * Run an interactive search dialogue. - **/ -void -em_format_html_display_search(EMFormatHTMLDisplay *efhd) -{ - struct _EMFormatHTMLDisplayPrivate *p = efhd->priv; - GladeXML *xml; - - if (p->search_dialog) { - gdk_window_raise(((GtkWidget *)p->search_dialog)->window); - return; - } - - xml = glade_xml_new (EVOLUTION_GLADEDIR "/mail-search.glade", "search_message_dialog", NULL); - if (xml == NULL) { - g_warning("Cannot open search dialog glade file"); - /* ?? */ - return; - } - - /* TODO: The original put the subject in the frame, but it had some - ugly arbitrary string-cutting code to make sure it fit. */ - - p->search_dialog = (GtkDialog *)glade_xml_get_widget(xml, "search_message_dialog"); - p->search_entry = glade_xml_get_widget(xml, "search_entry"); - p->search_matches_label = glade_xml_get_widget(xml, "search_matches_label"); - p->search_case_check = glade_xml_get_widget(xml, "search_case_check"); - p->search_wrap = FALSE; - - gtk_dialog_set_default_response((GtkDialog *)p->search_dialog, GTK_RESPONSE_ACCEPT); - efhd_update_matches(efhd); - - g_signal_connect(p->search_entry, "activate", G_CALLBACK(efhd_search_entry_activate), efhd); - g_signal_connect(p->search_case_check, "toggled", G_CALLBACK(efhd_search_case_toggled), efhd); - g_signal_connect(p->search_dialog, "response", G_CALLBACK(efhd_search_response), efhd); - e_dialog_set_transient_for((GtkWindow *)p->search_dialog, (GtkWidget *)efhd); - gtk_widget_show((GtkWidget *)p->search_dialog); -} - -void -em_format_html_display_cut (EMFormatHTMLDisplay *efhd) -{ - gtk_html_cut (((EMFormatHTML *) efhd)->html); -} - -void -em_format_html_display_copy (EMFormatHTMLDisplay *efhd) -{ - gtk_html_copy (((EMFormatHTML *) efhd)->html); -} - -void -em_format_html_display_paste (EMFormatHTMLDisplay *efhd) -{ - gtk_html_paste (((EMFormatHTML *) efhd)->html, FALSE); -} - -void -em_format_html_display_zoom_in (EMFormatHTMLDisplay *efhd) -{ - gtk_html_zoom_in (((EMFormatHTML *) efhd)->html); -} - -void -em_format_html_display_zoom_out (EMFormatHTMLDisplay *efhd) -{ - gtk_html_zoom_out (((EMFormatHTML *) efhd)->html); -} - -void -em_format_html_display_zoom_reset (EMFormatHTMLDisplay *efhd) -{ - gtk_html_zoom_reset (((EMFormatHTML *) efhd)->html); -} - -/* ********************************************************************** */ - -static void -efhd_iframe_created(GtkHTML *html, GtkHTML *iframe, EMFormatHTMLDisplay *efh) -{ - d(printf("Iframe created %p ... \n", iframe)); - - g_signal_connect(iframe, "button_press_event", G_CALLBACK (efhd_html_button_press_event), efh); - - return; -} - -static int -efhd_html_button_press_event (GtkWidget *widget, GdkEventButton *event, EMFormatHTMLDisplay *efhd) -{ - HTMLEngine *e; - HTMLPoint *point; - const char *url; - gboolean res = FALSE; - - if (event->button != 3) - return FALSE; - - e = ((GtkHTML *)widget)->engine; - point = html_engine_get_point_at(e, event->x, event->y, FALSE); - if (point == NULL) - return FALSE; - - d(printf("popup button pressed\n")); - - if ( (url = html_object_get_src(point->object)) != NULL - || (url = html_object_get_url(point->object, 0)) != NULL) { - EMFormatPURI *puri; - char *uri; - - uri = gtk_html_get_url_object_relative((GtkHTML *)widget, point->object, url); - puri = em_format_find_puri((EMFormat *)efhd, uri); - - d(printf("poup event, uri = '%s' part = '%p'\n", uri, puri?puri->part:NULL)); - - g_signal_emit((GtkObject *)efhd, efhd_signals[EFHD_POPUP_EVENT], 0, event, uri, puri?puri->part:NULL, &res); - g_free(uri); - } - - html_point_destroy(point); - - return res; -} - -static void -efhd_html_link_clicked (GtkHTML *html, const char *url, EMFormatHTMLDisplay *efhd) -{ - d(printf("link clicked event '%s'\n", url)); - g_signal_emit((GObject *)efhd, efhd_signals[EFHD_LINK_CLICKED], 0, url); -} - -static void -efhd_complete(EMFormat *emf) -{ - EMFormatHTMLDisplay *efhd = (EMFormatHTMLDisplay *)emf; - - if (efhd->priv->search_dialog) - efhd_update_matches(efhd); -} - -/* ********************************************************************** */ - -/* TODO: rename some of this stuff, it isn't 'smime' specific */ -/* FIXME: also in em-format-html.c */ -static const struct { - const char *icon, *shortdesc, *description; -} smime_sign_table[4] = { - { NULL, N_("Unsigned"), N_("This message is not signed. There is no guarantee the sender of the message is authentic.") }, - { "pgp-signature-ok.png",N_("Valid signature"), N_("This message is signed and is valid, the sender of this message is very likely who they claim to be.") }, - { "pgp-signature-bad.png", N_("Invalid signature"), N_("The signature of this message cannot be verified, it may have been altered in transit.") }, - { "pgp-signature-nokey.png", N_("Valid signature, cannot verify sender"), N_("This message is signed with a valid signature, but the sender of the message cannot be verified.") }, -}; - -static const struct { - const char *icon, *shortdesc, *description; -} smime_encrypt_table[4] = { - { NULL, N_("Unencrypted"), N_("This message is not encrypted. It's content may be viewed in transit across The Internet.") }, - { "pgp-signature-ok.png", N_("Encrypted, weak"), N_("This message is encrypted, but with a weak encryption algorithm. It would be difficult, but not impossible for an outsider to view the content of this message in a practical amount of time.") }, - { "pgp-signature-ok.png", N_("Encrypted"), N_("This message is encrypted. It would be difficult for an outsider to view the content of this message.") }, - { "pgp-signature-ok.png", N_("Encrypted, strong"), N_("This message is encrypted, with a strong encryption algorithm. It would be very difficult for an outsider to view the content of this message in a practical amount of time.") }, -}; - -struct _smime_pobject { - EMFormatHTMLPObject object; - - int signature; - CamelCipherValidity *valid; - GtkWidget *widget; -}; - -static void -efhd_xpkcs7mime_free(EMFormatHTMLPObject *o) -{ - struct _smime_pobject *po = (struct _smime_pobject *)o; - - if (po->widget) - gtk_widget_destroy(po->widget); - camel_cipher_validity_free(po->valid); -} - -static void -efhd_xpkcs7mime_info_response(GtkWidget *w, guint button, struct _smime_pobject *po) -{ - gtk_widget_destroy(w); - po->widget = NULL; -} - -static void -efhd_xpkcs7mime_validity_clicked(GtkWidget *button, EMFormatHTMLPObject *pobject) -{ - struct _smime_pobject *po = (struct _smime_pobject *)pobject; - GladeXML *xml; - GtkWidget *vbox, *w; - - if (po->widget) - /* FIXME: window raise? */ - return; - - xml = glade_xml_new(EVOLUTION_GLADEDIR "/mail-security.glade", "message_security_dialog", NULL); - po->widget = glade_xml_get_widget(xml, "message_security_dialog"); - - vbox = glade_xml_get_widget(xml, "signature_vbox"); - w = gtk_label_new(_(smime_sign_table[po->valid->sign.status].description)); - gtk_misc_set_alignment((GtkMisc *)w, 0.0, 0.5); - gtk_label_set_line_wrap((GtkLabel *)w, TRUE); - gtk_box_pack_start((GtkBox *)vbox, w, TRUE, TRUE, 6); - if (po->valid->sign.description) { - w = gtk_label_new(po->valid->sign.description); - gtk_misc_set_alignment((GtkMisc *)w, 0.0, 0.5); - gtk_label_set_line_wrap((GtkLabel *)w, FALSE); - gtk_box_pack_start((GtkBox *)vbox, w, TRUE, TRUE, 6); - } - gtk_widget_show_all(vbox); - - vbox = glade_xml_get_widget(xml, "encryption_vbox"); - w = gtk_label_new(_(smime_encrypt_table[po->valid->encrypt.status].description)); - gtk_misc_set_alignment((GtkMisc *)w, 0.0, 0.5); - gtk_label_set_line_wrap((GtkLabel *)w, TRUE); - gtk_box_pack_start((GtkBox *)vbox, w, TRUE, TRUE, 6); - if (po->valid->encrypt.description) { - w = gtk_label_new(po->valid->encrypt.description); - gtk_misc_set_alignment((GtkMisc *)w, 0.0, 0.5); - gtk_label_set_line_wrap((GtkLabel *)w, FALSE); - gtk_box_pack_start((GtkBox *)vbox, w, TRUE, TRUE, 6); - } - gtk_widget_show_all(vbox); - - g_object_unref(xml); - - g_signal_connect(po->widget, "response", G_CALLBACK(efhd_xpkcs7mime_info_response), po); - gtk_widget_show(po->widget); -} - -static gboolean -efhd_xpkcs7mime_button(EMFormatHTML *efh, GtkHTMLEmbedded *eb, EMFormatHTMLPObject *pobject) -{ - GtkWidget *icon, *button; - GdkPixbuf *pixbuf; - struct _smime_pobject *po = (struct _smime_pobject *)pobject; - char *file; - const char *name; - - /* FIXME: need to have it based on encryption and signing too */ - if (po->valid->sign.status == CAMEL_CIPHER_VALIDITY_SIGN_GOOD) - name = "pgp-signature-ok.png"; - else - name = "pgp-signature-bad.png"; - - file = g_build_filename(EVOLUTION_ICONSDIR, name, NULL); - pixbuf = gdk_pixbuf_new_from_file(file, NULL); - g_free(file); - if (pixbuf == NULL) - return FALSE; - - /* wtf isn't this just scaled on disk? */ - icon = gtk_image_new_from_pixbuf(gdk_pixbuf_scale_simple(pixbuf, 24, 24, GDK_INTERP_BILINEAR)); - g_object_unref(pixbuf); - gtk_widget_show(icon); - - button = gtk_button_new(); - g_signal_connect(button, "clicked", G_CALLBACK(efhd_xpkcs7mime_validity_clicked), pobject); - - gtk_container_add((GtkContainer *)button, icon); - gtk_widget_show(button); - gtk_container_add((GtkContainer *)eb, button); - - return TRUE; -} - -static void -efhd_output_secure(EMFormat *emf, CamelStream *stream, CamelMimePart *part, CamelCipherValidity *valid) -{ - CamelCipherValidity *save = ((EMFormatHTML *)emf)->valid_parent; - - /* Note: this same logic is in efh_output_secure */ - - if (((EMFormatHTML *)emf)->valid == NULL) { - ((EMFormatHTML *)emf)->valid = valid; - } else { - e_dlist_addtail(&((EMFormatHTML *)emf)->valid_parent->children, (EDListNode *)valid); - camel_cipher_validity_envelope(((EMFormatHTML *)emf)->valid_parent, valid); - } - - ((EMFormatHTML *)emf)->valid_parent = valid; - em_format_part(emf, stream, part); - ((EMFormatHTML *)emf)->valid_parent = save; - - if (((EMFormatHTML *)emf)->valid == valid - && (valid->encrypt.status != CAMEL_CIPHER_VALIDITY_ENCRYPT_NONE - || valid->sign.status != CAMEL_CIPHER_VALIDITY_SIGN_NONE)) { - char *classid; - struct _smime_pobject *pobj; - - camel_stream_printf(stream, "<table border=0 width=\"100%%\" cellpadding=3 cellspacing=0 bgcolor=%s><tr>", - valid->sign.status == CAMEL_CIPHER_VALIDITY_SIGN_GOOD?"#88bb88":"#bb8888"); - classid = g_strdup_printf("smime:///em-format-html/%p/icon/signed", part); - pobj = (struct _smime_pobject *)em_format_html_add_pobject((EMFormatHTML *)emf, sizeof(*pobj), classid, part, efhd_xpkcs7mime_button); - pobj->valid = camel_cipher_validity_clone(valid); - pobj->object.free = efhd_xpkcs7mime_free; - camel_stream_printf(stream, "<td valign=top><object classid=\"%s\"></object></td><td width=100%% valign=top>", classid); - - if (valid->sign.status != CAMEL_CIPHER_VALIDITY_SIGN_NONE) { - camel_stream_printf(stream, "%s<br>", _(smime_sign_table[valid->sign.status].shortdesc)); - } - - if (valid->encrypt.status != CAMEL_CIPHER_VALIDITY_ENCRYPT_NONE) { - camel_stream_printf(stream, "%s<br>", _(smime_encrypt_table[valid->encrypt.status].shortdesc)); - } - - camel_stream_printf(stream, "</td></tr></table>"); - } -} - -static void -efhd_application_xpkcs7mime(EMFormat *emf, CamelStream *stream, CamelMimePart *part, const EMFormatHandler *info) -{ - CamelCipherContext *context; - CamelException *ex; - extern CamelSession *session; - CamelMimePart *opart; - CamelCipherValidity *valid; - - ex = camel_exception_new(); - - context = camel_smime_context_new(session); - - opart = camel_mime_part_new(); - valid = camel_cipher_decrypt(context, part, opart, ex); - if (valid == NULL) { - em_format_format_error(emf, stream, ex->desc?ex->desc:_("Could not parse S/MIME message: Unknown error")); - em_format_part_as(emf, stream, part, NULL); - } else { - efhd_output_secure(emf, stream, opart, valid); - } - - camel_object_unref(opart); - camel_object_unref(context); - camel_exception_free(ex); -} - -/* ********************************************************************** */ - -static void -efhd_multipart_signed (EMFormat *emf, CamelStream *stream, CamelMimePart *part, const EMFormatHandler *info) -{ - CamelMultipartSigned *mps; - CamelMimePart *cpart; - CamelCipherContext *cipher = NULL; - - mps = (CamelMultipartSigned *)camel_medium_get_content_object((CamelMedium *)part); - if (!CAMEL_IS_MULTIPART_SIGNED(mps) - || (cpart = camel_multipart_get_part((CamelMultipart *)mps, CAMEL_MULTIPART_SIGNED_CONTENT)) == NULL) { - em_format_format_source(emf, stream, part); - return; - } - - /* FIXME: Should be done via a plugin interface */ - /* FIXME: duplicated in em-format-html.c */ - if (g_ascii_strcasecmp("application/x-pkcs7-signature", mps->protocol) == 0) - cipher = camel_smime_context_new(emf->session); - else if (g_ascii_strcasecmp("application/pgp-signature", mps->protocol) == 0) - cipher = camel_gpg_context_new(emf->session); - - if (cipher == NULL) { - em_format_format_error(emf, stream, _("Unsupported signature format")); - em_format_part_as(emf, stream, part, NULL); - } else { - CamelException *ex = camel_exception_new(); - CamelCipherValidity *valid; - - valid = camel_cipher_verify(cipher, part, ex); - if (valid == NULL) { - em_format_format_error(emf, stream, ex->desc?ex->desc:_("Unknown error verifying signature")); - em_format_part_as(emf, stream, part, NULL); - } else { - efhd_output_secure(emf, stream, cpart, valid); - } - - camel_exception_free(ex); - camel_object_unref(cipher); - } -} - -/* ********************************************************************** */ - -static EMFormatHandler type_builtin_table[] = { - { "application/x-pkcs7-mime", (EMFormatFunc)efhd_application_xpkcs7mime }, - { "multipart/signed", (EMFormatFunc)efhd_multipart_signed }, -}; - -static void -efhd_builtin_init(EMFormatHTMLDisplayClass *efhc) -{ - int i; - - for (i=0;i<sizeof(type_builtin_table)/sizeof(type_builtin_table[0]);i++) - em_format_class_add_handler((EMFormatClass *)efhc, &type_builtin_table[i]); -} - -/* ********************************************************************** */ - -static void efhd_format_clone(EMFormat *emf, CamelMedium *part, EMFormat *src) -{ - ((EMFormatClass *)efhd_parent)->format_clone(emf, part, src); -} - -/* TODO: if these aren't going to do anything should remove */ -static void efhd_format_error(EMFormat *emf, CamelStream *stream, const char *txt) -{ - ((EMFormatClass *)efhd_parent)->format_error(emf, stream, txt); -} - -static void efhd_format_message(EMFormat *emf, CamelStream *stream, CamelMedium *part) -{ - ((EMFormatClass *)efhd_parent)->format_message(emf, stream, part); -} - -static void efhd_format_source(EMFormat *emf, CamelStream *stream, CamelMimePart *part) -{ - ((EMFormatClass *)efhd_parent)->format_source(emf, stream, part); -} - -/* ********************************************************************** */ - -/* if it hasn't been processed yet, format the attachment */ -static void -efhd_attachment_show(GtkWidget *w, struct _attach_puri *info) -{ - d(printf("show attachment button called\n")); - - info->shown = ~info->shown; - em_format_set_inline(info->puri.format, info->puri.part, info->shown); - /* FIXME: do this in an idle handler */ - em_format_format_clone(info->puri.format, info->puri.format->message, info->puri.format); -#if 0 - /* FIXME: track shown state in parent */ - - if (info->shown) { - d(printf("hiding\n")); - info->shown = FALSE; - if (info->frame) - gtk_widget_hide((GtkWidget *)info->frame); - gtk_widget_show(info->forward); - gtk_widget_hide(info->down); - } else { - d(printf("showing\n")); - info->shown = TRUE; - if (info->frame) - gtk_widget_show((GtkWidget *)info->frame); - gtk_widget_hide(info->forward); - gtk_widget_show(info->down); - - /* have we decoded it yet? */ - if (info->output) { - info->handle->handler(info->puri.format, info->output, info->puri.part, info->handle); - camel_stream_close(info->output); - camel_object_unref(info->output); - info->output = NULL; - } - } - - em_format_set_inline(info->puri.format, info->puri.part, info->shown); -#endif -} - -static EMPopupItem efhd_menu_items[] = { - { EM_POPUP_BAR, "05.display", }, - { EM_POPUP_ITEM, "05.display.00", N_("_View Inline"), G_CALLBACK(efhd_attachment_show) }, - { EM_POPUP_ITEM, "05.display.00", N_("_Hide"), G_CALLBACK(efhd_attachment_show) }, -}; - -static void -efhd_popup_place_widget(GtkMenu *menu, int *x, int *y, gboolean *push_in, gpointer user_data) -{ - GtkWidget *w = user_data; - - gdk_window_get_origin(gtk_widget_get_parent_window(w), x, y); - *x += w->allocation.x + w->allocation.width; - *y += w->allocation.y; -} - -static gboolean -efhd_attachment_popup(GtkWidget *w, GdkEventButton *event, struct _attach_puri *info) -{ - GtkMenu *menu; - GSList *menus = NULL; - EMPopup *emp; - EMPopupTarget *target; - EMPopupItem *item; - - d(printf("attachment popup, button %d\n", event->button)); - - if (event && event->button != 1 && event->button != 3) { - /* ?? gtk_propagate_event(GTK_WIDGET (user_data), (GdkEvent *)event);*/ - return FALSE; - } - - emp = em_popup_new("com.ximian.mail.formathtmldisplay.popup.part"); - target = em_popup_target_new_part(info->puri.part, info->handle?info->handle->mime_type:NULL); - target->widget = w; - - /* add our local menus */ - efhd_menu_items[0].activate_data = info; - menus = g_slist_prepend(menus, &efhd_menu_items[0]); - item = &efhd_menu_items[info->shown?2:1]; - item->activate_data = info; - menus = g_slist_prepend(menus, item); - em_popup_add_items(emp, menus, (GDestroyNotify)g_slist_free); - - menu = em_popup_create_menu_once(emp, target, target->mask, target->mask); - if (event) - gtk_menu_popup(menu, NULL, NULL, NULL, NULL, event->button, event->time); - else - gtk_menu_popup(menu, NULL, NULL, (GtkMenuPositionFunc)efhd_popup_place_widget, w, 0, gtk_get_current_event_time()); - - return TRUE; -} - -static gboolean -efhd_attachment_popup_menu(GtkWidget *w, struct _attach_puri *info) -{ - return efhd_attachment_popup(w, NULL, info); -} - -/* ********************************************************************** */ - -static void -efhd_drag_data_get(GtkWidget *w, GdkDragContext *drag, GtkSelectionData *data, guint info, guint time, EMFormatHTMLPObject *pobject) -{ - CamelMimePart *part = pobject->part; - char *uri, *path; - CamelStream *stream; - - switch (info) { - case 0: /* mime/type request */ - stream = camel_stream_mem_new(); - /* TODO: shoudl format_format_text run on the content-object? */ - /* TODO: should we just do format_content? */ - if (camel_content_type_is (((CamelDataWrapper *)part)->mime_type, "text", "*")) { - /* FIXME: this should be an em_utils method, it only needs a default charset param */ - em_format_format_text((EMFormat *)pobject->format, stream, (CamelDataWrapper *)part); - } else { - CamelDataWrapper *dw = camel_medium_get_content_object((CamelMedium *)part); - - camel_data_wrapper_decode_to_stream(dw, stream); - } - - gtk_selection_data_set(data, data->target, 8, - ((CamelStreamMem *)stream)->buffer->data, - ((CamelStreamMem *)stream)->buffer->len); - camel_object_unref(stream); - break; - case 1: /* text-uri-list request */ - /* Kludge around Nautilus requesting the same data many times */ - uri = g_object_get_data((GObject *)w, "e-drag-uri"); - if (uri) { - gtk_selection_data_set(data, data->target, 8, uri, strlen(uri)); - return; - } - - path = em_utils_temp_save_part(w, part); - if (path == NULL) - return; - - uri = g_strdup_printf("file://%s\r\n", path); - g_free(path); - gtk_selection_data_set(data, data->target, 8, uri, strlen(uri)); - g_object_set_data_full((GObject *)w, "e-drag-uri", uri, g_free); - break; - default: - abort(); - } -} - -static void -efhd_drag_data_delete(GtkWidget *w, GdkDragContext *drag, EMFormatHTMLPObject *pobject) -{ - char *uri; - - uri = g_object_get_data((GObject *)w, "e-drag-uri"); - if (uri) { - /* NB: this doesn't kill the dnd directory */ - /* NB: is this ever called? */ - unlink(uri+7); - g_object_set_data((GObject *)w, "e-drag-uri", NULL); - } -} - -static void -efhd_write_icon_job(struct _EMFormatHTMLJob *job, int cancelled) -{ - EMFormatHTMLPObject *pobject; - CamelDataWrapper *dw; - - if (cancelled) - return; - - pobject = job->u.data; - dw = camel_medium_get_content_object((CamelMedium *)pobject->part); - camel_data_wrapper_decode_to_stream(dw, job->stream); - camel_stream_close(job->stream); -} - -/* attachment button callback */ -static gboolean -efhd_attachment_button(EMFormatHTML *efh, GtkHTMLEmbedded *eb, EMFormatHTMLPObject *pobject) -{ - struct _attach_puri *info; - GtkWidget *hbox, *w, *button, *mainbox; - char *simple_type; - GtkTargetEntry drag_types[] = { - { NULL, 0, 0 }, - { "text/uri-list", 0, 1 }, - }; - - /* FIXME: handle default shown case */ - d(printf("adding attachment button/content\n")); - - info = (struct _attach_puri *)em_format_find_puri((EMFormat *)efh, pobject->classid); - g_assert(info != NULL); - g_assert(info->forward == NULL); - - mainbox = gtk_hbox_new(FALSE, 0); - - button = gtk_button_new(); - - if (info->handle) - g_signal_connect(button, "clicked", G_CALLBACK(efhd_attachment_show), info); - else - GTK_WIDGET_UNSET_FLAGS(button, GTK_CAN_FOCUS); - - hbox = gtk_hbox_new(FALSE, 2); - info->forward = gtk_image_new_from_stock(GTK_STOCK_GO_FORWARD, GTK_ICON_SIZE_BUTTON); - gtk_box_pack_start((GtkBox *)hbox, info->forward, TRUE, TRUE, 0); - if (info->handle) { - info->down = gtk_image_new_from_stock(GTK_STOCK_GO_DOWN, GTK_ICON_SIZE_BUTTON); - gtk_box_pack_start((GtkBox *)hbox, info->down, TRUE, TRUE, 0); - } - - w = gtk_image_new(); - gtk_widget_set_size_request(w, 24, 24); - gtk_box_pack_start((GtkBox *)hbox, w, TRUE, TRUE, 0); - gtk_container_add((GtkContainer *)button, hbox); - gtk_box_pack_start((GtkBox *)mainbox, button, TRUE, TRUE, 0); - - /* FIXME: loses any snoop info */ - simple_type = camel_content_type_simple (((CamelDataWrapper *)pobject->part)->mime_type); - camel_strdown(simple_type); - - /* cache? */ - /* FIXME: offline parts, just get icon */ - if (camel_content_type_is (((CamelDataWrapper *)pobject->part)->mime_type, "image", "*")) { - EMFormatHTMLJob *job; - - job = em_format_html_job_new(efh, efhd_write_icon_job, pobject); - job->stream = (CamelStream *)em_icon_stream_new((GtkImage *)w); - em_format_html_job_queue(efh, job); - } else { - GdkPixbuf *pixbuf = e_icon_for_mime_type(simple_type, 24); - GdkPixbuf *mini = gdk_pixbuf_scale_simple(pixbuf, 24, 24, GDK_INTERP_BILINEAR); - - gtk_image_set_from_pixbuf((GtkImage *)w, mini); - g_object_unref(mini); - g_object_unref(pixbuf); - } - - drag_types[0].target = simple_type; - gtk_drag_source_set(button, GDK_BUTTON1_MASK, drag_types, sizeof(drag_types)/sizeof(drag_types[0]), GDK_ACTION_COPY); - g_signal_connect(button, "drag-data-get", G_CALLBACK(efhd_drag_data_get), pobject); - g_signal_connect (button, "drag-data-delete", G_CALLBACK(efhd_drag_data_delete), pobject); - g_free(simple_type); - - button = gtk_button_new(); - /*GTK_WIDGET_UNSET_FLAGS(button, GTK_CAN_FOCUS);*/ - gtk_container_add((GtkContainer *)button, gtk_arrow_new(GTK_ARROW_DOWN, GTK_SHADOW_ETCHED_IN)); - g_signal_connect(button, "button_press_event", G_CALLBACK(efhd_attachment_popup), info); - g_signal_connect(button, "popup_menu", G_CALLBACK(efhd_attachment_popup_menu), info); - g_signal_connect(button, "clicked", G_CALLBACK(efhd_attachment_popup_menu), info); - gtk_box_pack_start((GtkBox *)mainbox, button, TRUE, TRUE, 0); - - gtk_widget_show_all(mainbox); - - if (info->shown) - gtk_widget_hide(info->forward); - else if (info->down) - gtk_widget_hide(info->down); - - gtk_container_add((GtkContainer *)eb, mainbox); - - return TRUE; -} - -/* not used currently */ -/* frame source callback */ -static void -efhd_attachment_frame(EMFormat *emf, CamelStream *stream, EMFormatPURI *puri) -{ - struct _attach_puri *info = (struct _attach_puri *)puri; - - if (info->shown) { - d(printf("writing to frame content, handler is '%s'\n", info->handle->mime_type)); - info->handle->handler(emf, stream, info->puri.part, info->handle); - camel_stream_close(stream); - } else { - /* FIXME: this is leaked if the object is closed without showing it - NB: need a virtual puri_free method? */ - info->output = stream; - camel_object_ref(stream); - } -} - -static gboolean -efhd_bonobo_object(EMFormatHTML *efh, GtkHTMLEmbedded *eb, EMFormatHTMLPObject *pobject) -{ - CamelDataWrapper *wrapper; - Bonobo_ServerInfo *component; - GtkWidget *embedded; - Bonobo_PersistStream persist; - CORBA_Environment ev; - CamelStreamMem *cstream; - BonoboStream *bstream; - BonoboControlFrame *control_frame; - Bonobo_PropertyBag prop_bag; - - component = gnome_vfs_mime_get_default_component(eb->type); - if (component == NULL) - return FALSE; - - embedded = bonobo_widget_new_control(component->iid, NULL); - CORBA_free(component); - if (embedded == NULL) - return FALSE; - - CORBA_exception_init(&ev); - - control_frame = bonobo_widget_get_control_frame((BonoboWidget *)embedded); - prop_bag = bonobo_control_frame_get_control_property_bag(control_frame, NULL); - if (prop_bag != CORBA_OBJECT_NIL) { - /* - * Now we can take care of business. Currently, the only control - * that needs something passed to it through a property bag is - * the iTip control, and it needs only the From email address, - * but perhaps in the future we can generalize this section of code - * to pass a bunch of useful things to all embedded controls. - */ - const CamelInternetAddress *from; - char *from_address; - - from = camel_mime_message_get_from((CamelMimeMessage *)((EMFormat *)efh)->message); - from_address = camel_address_encode((CamelAddress *)from); - bonobo_property_bag_client_set_value_string(prop_bag, "from_address", from_address, &ev); - g_free(from_address); - - Bonobo_Unknown_unref(prop_bag, &ev); - } - - persist = (Bonobo_PersistStream)Bonobo_Unknown_queryInterface(bonobo_widget_get_objref((BonoboWidget *)embedded), - "IDL:Bonobo/PersistStream:1.0", NULL); - if (persist == CORBA_OBJECT_NIL) { - gtk_object_sink((GtkObject *)embedded); - CORBA_exception_free(&ev); - return FALSE; - } - - /* Write the data to a CamelStreamMem... */ - cstream = (CamelStreamMem *)camel_stream_mem_new(); - wrapper = camel_medium_get_content_object((CamelMedium *)pobject->part); - camel_data_wrapper_decode_to_stream(wrapper, (CamelStream *)cstream); - - /* ...convert the CamelStreamMem to a BonoboStreamMem... */ - bstream = bonobo_stream_mem_create(cstream->buffer->data, cstream->buffer->len, TRUE, FALSE); - camel_object_unref(cstream); - - /* ...and hydrate the PersistStream from the BonoboStream. */ - Bonobo_PersistStream_load(persist, - bonobo_object_corba_objref(BONOBO_OBJECT (bstream)), - eb->type, &ev); - bonobo_object_unref(BONOBO_OBJECT (bstream)); - Bonobo_Unknown_unref(persist, &ev); - CORBA_Object_release(persist, &ev); - - if (ev._major != CORBA_NO_EXCEPTION) { - gtk_object_sink((GtkObject *)embedded); - CORBA_exception_free(&ev); - return FALSE; - } - CORBA_exception_free(&ev); - - gtk_widget_show(embedded); - gtk_container_add(GTK_CONTAINER (eb), embedded); - - return TRUE; -} - -static gboolean -efhd_check_server_prop(Bonobo_ServerInfo *component, const char *propname, const char *value) -{ - CORBA_sequence_CORBA_string stringv; - Bonobo_ActivationProperty *prop; - int i; - - prop = bonobo_server_info_prop_find(component, propname); - if (!prop || prop->v._d != Bonobo_ACTIVATION_P_STRINGV) - return FALSE; - - stringv = prop->v._u.value_stringv; - for (i = 0; i < stringv._length; i++) { - if (!g_ascii_strcasecmp(value, stringv._buffer[i])) - return TRUE; - } - - return FALSE; -} - -static gboolean -efhd_use_component(const char *mime_type) -{ - GList *components, *iter; - Bonobo_ServerInfo *component = NULL; - - /* should this cache it? */ - - if (g_ascii_strcasecmp(mime_type, "text/x-vcard") != 0 - && g_ascii_strcasecmp(mime_type, "text/calendar") != 0) { - const char **mime_types; - int i; - - mime_types = mail_config_get_allowable_mime_types(); - for (i = 0; mime_types[i]; i++) { - if (!g_ascii_strcasecmp(mime_types[i], mime_type)) - goto type_ok; - } - return FALSE; - } -type_ok: - components = gnome_vfs_mime_get_all_components (mime_type); - for (iter = components; iter; iter = iter->next) { - Bonobo_ServerInfo *comp = iter->data; - - comp = iter->data; - if (efhd_check_server_prop(comp, "repo_ids", "IDL:Bonobo/PersistStream:1.0") - && efhd_check_server_prop(comp, "bonobo:supported_mime_types", mime_type)) { - component = comp; - break; - } - } - gnome_vfs_mime_component_list_free (components); - - return component != NULL; -} - -static void -efhd_format_attachment(EMFormat *emf, CamelStream *stream, CamelMimePart *part, const char *mime_type, const EMFormatHandler *handle) -{ - char *classid, *text, *html; - struct _attach_puri *info; - - classid = g_strdup_printf("attachment-%p", part); - info = (struct _attach_puri *)em_format_add_puri(emf, sizeof(*info), classid, part, efhd_attachment_frame); - em_format_html_add_pobject((EMFormatHTML *)emf, sizeof(EMFormatHTMLPObject), classid, part, efhd_attachment_button); - info->handle = handle; - info->shown = em_format_is_inline(emf, info->puri.part) && handle != NULL; - - camel_stream_write_string(stream, - "<table height=6><tr><td><a></a></td></tr></table>\n" - "<table cellspacing=0 cellpadding=0><tr><td>" - "<table width=10 cellspacing=0 cellpadding=0>" - "<tr><td></td></tr></table></td>"); - - camel_stream_printf(stream, "<td><object classid=\"%s\"></object></td>", classid); - - camel_stream_write_string(stream, - "<td><table width=3 cellspacing=0 cellpadding=0>" - "<tr><td></td></tr></table></td><td><font size=-1>"); - - /* output some info about it */ - /* FIXME: should we look up mime_type from object again? */ - text = em_format_describe_part(part, mime_type); - html = camel_text_to_html(text, ((EMFormatHTML *)emf)->text_html_flags & CAMEL_MIME_FILTER_TOHTML_CONVERT_URLS, 0); - camel_stream_write_string(stream, html); - g_free(html); - g_free(text); - - camel_stream_write_string(stream, - "</font></td></tr><tr></table>\n" - "<table height=6><tr><td><a></a></td></tr></table>\n"); - - if (handle) { - if (info->shown) - handle->handler(emf, stream, part, handle); - /*camel_stream_printf(stream, "<iframe src=\"%s\" marginheight=0 marginwidth=0>%s</iframe>\n", classid, _("Attachment content could not be loaded"));*/ - } else if (efhd_use_component(mime_type)) { - static int partid; - - g_free(classid); /* messy */ - - classid = g_strdup_printf("bonobo-unknown:///em-formath-html-display/%p/%d", part, partid++); - em_format_html_add_pobject((EMFormatHTML *)emf, sizeof(EMFormatHTMLPObject), classid, part, efhd_bonobo_object); - camel_stream_printf(stream, "<object classid=\"%s\" type=\"%s\">\n", classid, mime_type); - } - - g_free(classid); -} diff --git a/mail/em-format-html-display.h b/mail/em-format-html-display.h deleted file mode 100644 index cf78642112..0000000000 --- a/mail/em-format-html-display.h +++ /dev/null @@ -1,63 +0,0 @@ - -/* - Concrete class for formatting mails to displayed html -*/ - -#ifndef _EM_FORMAT_HTML_DISPLAY_H -#define _EM_FORMAT_HTML_DISPLAY_H - -#include "em-format-html.h" - -typedef struct _EMFormatHTMLDisplay EMFormatHTMLDisplay; -typedef struct _EMFormatHTMLDisplayClass EMFormatHTMLDisplayClass; - -struct _CamelMimePart; - -struct _EMFormatHTMLDisplay { - EMFormatHTML formathtml; - - struct _EMFormatHTMLDisplayPrivate *priv; - - struct _ESearchingTokenizer *search_tok; - - unsigned int animate:1; - unsigned int caret_mode:1; -}; - -#define EM_FORMAT_HTML_DISPLAY_SEARCH_PRIMARY (0) -#define EM_FORMAT_HTML_DISPLAY_SEARCH_SECONDARY (1) -#define EM_FORMAT_HTML_DISPLAY_SEARCH_ICASE (1<<8) - -struct _EMFormatHTMLDisplayClass { - EMFormatHTMLClass formathtml_class; - - /* a link clicked normally */ - void (*link_clicked)(EMFormatHTMLDisplay *efhd, const char *uri); - /* a part or a link button pressed event */ - int (*popup_event)(EMFormatHTMLDisplay *efhd, GdkEventButton *event, const char *uri, struct _CamelMimePart *part); -}; - -GType em_format_html_display_get_type(void); -EMFormatHTMLDisplay *em_format_html_display_new(void); - -void em_format_html_display_goto_anchor(EMFormatHTMLDisplay *efhd, const char *name); - -void em_format_html_display_set_animate(EMFormatHTMLDisplay *efhd, gboolean state); -void em_format_html_display_set_caret_mode(EMFormatHTMLDisplay *efhd, gboolean state); - -void em_format_html_display_set_search(EMFormatHTMLDisplay *efhd, int type, GSList *strings); -void em_format_html_display_search(EMFormatHTMLDisplay *efhd); - -void em_format_html_display_cut (EMFormatHTMLDisplay *efhd); -void em_format_html_display_copy (EMFormatHTMLDisplay *efhd); -void em_format_html_display_paste (EMFormatHTMLDisplay *efhd); - -void em_format_html_display_zoom_in (EMFormatHTMLDisplay *efhd); -void em_format_html_display_zoom_out (EMFormatHTMLDisplay *efhd); -void em_format_html_display_zoom_reset (EMFormatHTMLDisplay *efhd); - -/* experimental */ -struct _EPopupExtension; -void em_format_html_display_set_popup(EMFormatHTMLDisplay *, struct _EPopupExtension *); - -#endif /* !_EM_FORMAT_HTML_DISPLAY_H */ diff --git a/mail/em-format-html-print.c b/mail/em-format-html-print.c deleted file mode 100644 index 44da5abb73..0000000000 --- a/mail/em-format-html-print.c +++ /dev/null @@ -1,186 +0,0 @@ - -#include <libgnomeprint/gnome-print-job.h> -#include <libgnomeprintui/gnome-print-job-preview.h> - -#include <gtkhtml/gtkhtml.h> -#include <gtk/gtkwindow.h> - -#include <camel/camel-i18n.h> -#include "em-format-html-print.h" - -#include <string.h> - -static void efhp_builtin_init(EMFormatHTMLPrintClass *efhc); - -static EMFormatHTMLClass *efhp_parent; - -static void -efhp_init(GObject *o) -{ - EMFormatHTMLPrint *efhp = (EMFormatHTMLPrint *)o; - GtkWidget *html = (GtkWidget *)efhp->formathtml.html; - - /* ?? */ - gtk_widget_set_name(html, "EvolutionMailPrintHTMLWidget"); - - /* gtk widgets don't like to be realized outside top level widget - so we put new html widget into gtk window */ - efhp->window = gtk_window_new(GTK_WINDOW_TOPLEVEL); - gtk_container_add((GtkContainer *)efhp->window, html); - gtk_widget_realize(html); -} - -static void -efhp_finalise(GObject *o) -{ - EMFormatHTMLPrint *efhp = (EMFormatHTMLPrint *)o; - - gtk_widget_destroy(efhp->window); - if (efhp->config) - g_object_unref(efhp->config); - - ((GObjectClass *)efhp_parent)->finalize(o); -} - -static void -efhp_base_init(EMFormatHTMLPrintClass *efhpklass) -{ - efhp_builtin_init(efhpklass); -} - -static void -efhp_class_init(GObjectClass *klass) -{ - klass->finalize = efhp_finalise; -} - -GType -em_format_html_print_get_type(void) -{ - static GType type = 0; - - if (type == 0) { - static const GTypeInfo info = { - sizeof(EMFormatHTMLPrintClass), - (GBaseInitFunc)efhp_base_init, NULL, - (GClassInitFunc)efhp_class_init, - NULL, NULL, - sizeof(EMFormatHTMLPrint), 0, - (GInstanceInitFunc)efhp_init - }; - efhp_parent = g_type_class_ref(em_format_html_get_type()); - type = g_type_register_static(em_format_html_get_type(), "EMFormatHTMLPrint", &info, 0); - } - - return type; -} - -EMFormatHTMLPrint *em_format_html_print_new(void) -{ - EMFormatHTMLPrint *efhp; - - efhp = g_object_new(em_format_html_print_get_type(), 0); - - return efhp; -} - -struct footer_info { - GnomeFont *local_font; - gint page_num, pages; -}; - -static void -efhp_footer_cb(GtkHTML *html, GnomePrintContext *print_context, double x, double y, double width, double height, void *data) -{ - struct footer_info *info = data; - - /* do we want anything nicer here, like who its from, etc? */ - if (info->local_font) { - char *text = g_strdup_printf (_("Page %d of %d"), info->page_num, info->pages); - /*gdouble tw = gnome_font_get_width_string (info->local_font, text);*/ - /* FIXME: work out how to measure this */ - gdouble tw = strlen(text) * 8; - - gnome_print_gsave(print_context); - gnome_print_newpath(print_context); - gnome_print_setrgbcolor(print_context, .0, .0, .0); - gnome_print_moveto(print_context, x + width - tw, y - gnome_font_get_ascender(info->local_font)); - gnome_print_setfont(print_context, info->local_font); - gnome_print_show(print_context, text); - gnome_print_grestore(print_context); - - g_free(text); - info->page_num++; - } -} - -/* perform preview, or print */ -/* returns GNOME_PRINT_OK on success */ -static void -emfhp_complete(EMFormatHTMLPrint *efhp, void *data) -{ - GnomePrintContext *print_context; - GnomePrintJob *print_job; - gdouble line = 0.0; - struct footer_info info; - int res = GNOME_PRINT_OK; - - print_job = gnome_print_job_new(efhp->config); - print_context = gnome_print_job_get_context(print_job); - - gtk_html_print_set_master(efhp->formathtml.html, print_job); - info.local_font = gnome_font_find_closest("Sans Regular", 10.0); - if (info.local_font) { - line = gnome_font_get_ascender(info.local_font) - gnome_font_get_descender(info.local_font); - info.page_num = 1; - info.pages = gtk_html_print_get_pages_num(efhp->formathtml.html, print_context, 0.0, line); - gtk_html_print_with_header_footer(efhp->formathtml.html, print_context, 0.0, line, NULL, efhp_footer_cb, &info); - gnome_font_unref(info.local_font); - } else { - gtk_html_print(efhp->formathtml.html, print_context); - } - gtk_html_print_set_master(efhp->formathtml.html, NULL); - - gnome_print_job_close(print_job); - - if (efhp->preview) - gtk_widget_show(gnome_print_job_preview_new(print_job, _("Print Preview"))); - else - res = gnome_print_job_print(print_job); - - g_object_unref(print_job); - g_object_unref(efhp); -} - -int em_format_html_print_print(EMFormatHTMLPrint *efhp, struct _CamelMedium *msg, EMFormatHTML *source, struct _GnomePrintConfig *print_config, int preview) -{ - efhp->config = print_config; - if (print_config) - g_object_ref(print_config); - efhp->preview = preview; - - ((EMFormatHTML *)efhp)->load_http = source->load_http_now; - - g_signal_connect(efhp, "complete", G_CALLBACK(emfhp_complete), efhp); - - g_object_ref(efhp); - em_format_format_clone((EMFormat *)efhp, msg, (EMFormat *)source); - - return 0; /* damn async ... */ -} - -/* ********************************************************************** */ - -/* if only ... but i doubt this is possible with gnome print/gtkhtml */ -static EMFormatHandler type_builtin_table[] = { - /*{ "application/postscript", (EMFormatFunc)efhp_application_postscript },*/ -}; - -static void -efhp_builtin_init(EMFormatHTMLPrintClass *efhc) -{ - int i; - - for (i=0;i<sizeof(type_builtin_table)/sizeof(type_builtin_table[0]);i++) - em_format_class_add_handler((EMFormatClass *)efhc, &type_builtin_table[i]); -} diff --git a/mail/em-format-html-print.h b/mail/em-format-html-print.h deleted file mode 100644 index 78e3139e0f..0000000000 --- a/mail/em-format-html-print.h +++ /dev/null @@ -1,37 +0,0 @@ - -/* - Concrete class for formatting mails to displayed html -*/ - -#ifndef _EM_FORMAT_HTML_PRINT_H -#define _EM_FORMAT_HTML_PRINT_H - -#include "em-format-html.h" - -struct _GnomePrintConfig; - -typedef struct _EMFormatHTMLPrint EMFormatHTMLPrint; -typedef struct _EMFormatHTMLPrintClass EMFormatHTMLPrintClass; - -struct _CamelMimePart; - -struct _EMFormatHTMLPrint { - EMFormatHTML formathtml; - - struct _GtkWidget *window; /* used to realise the gtkhtml in a toplevel, i dont know why */ - struct _GnomePrintConfig *config; - - int preview:1; -}; - -struct _EMFormatHTMLPrintClass { - EMFormatHTMLClass formathtml_class; -}; - -GType em_format_html_print_get_type(void); - -EMFormatHTMLPrint *em_format_html_print_new(void); - -int em_format_html_print_print(EMFormatHTMLPrint *efhp, struct _CamelMedium *msg, EMFormatHTML *source, struct _GnomePrintConfig *print_config, int preview); - -#endif /* ! _EM_FORMAT_HTML_PRINT_H */ diff --git a/mail/em-format-html-quote.c b/mail/em-format-html-quote.c deleted file mode 100644 index d00b8bf5f7..0000000000 --- a/mail/em-format-html-quote.c +++ /dev/null @@ -1,277 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Authors: Jeffrey Stedfast <fejj@ximian.com> - * - * Copyright 2003 Ximian, Inc. (www.ximian.com) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA. - * - */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <string.h> - -#include <camel/camel-stream.h> -#include <camel/camel-mime-filter-tohtml.h> -#include "em-format-html-quote.h" - -struct _EMFormatHTMLQuotePrivate { - char *credits; -}; - -static void efhq_format_clone (EMFormat *, CamelMedium *, EMFormat *); -static void efhq_format_error (EMFormat *emf, CamelStream *stream, const char *txt); -static void efhq_format_message (EMFormat *, CamelStream *, CamelMedium *); -static void efhq_format_source (EMFormat *, CamelStream *, CamelMimePart *); -static void efhq_format_attachment (EMFormat *, CamelStream *, CamelMimePart *, const char *, const EMFormatHandler *); - -static void efhq_builtin_init (EMFormatHTMLQuoteClass *efhc); - -static EMFormatHTMLClass *efhq_parent; - -static void -efhq_init (GObject *o) -{ - EMFormatHTMLQuote *efhq = (EMFormatHTMLQuote *) o; - - efhq->priv = g_malloc0 (sizeof (*efhq->priv)); - - /* we want to convert url's etc */ - ((EMFormatHTML *) efhq)->text_html_flags |= CAMEL_MIME_FILTER_TOHTML_CONVERT_URLS | CAMEL_MIME_FILTER_TOHTML_CONVERT_ADDRESSES; - /* we want simple header format */ - ((EMFormatHTML *) efhq)->simple_headers = TRUE; -} - -static void -efhq_finalise (GObject *o) -{ - EMFormatHTMLQuote *efhq = (EMFormatHTMLQuote *) o; - - g_free (efhq->priv->credits); - g_free (efhq->priv); - - ((GObjectClass *) efhq_parent)->finalize (o); -} - -static void -efhq_base_init(EMFormatHTMLQuoteClass *efhqklass) -{ - efhq_builtin_init(efhqklass); -} - -static void -efhq_class_init (GObjectClass *klass) -{ - ((EMFormatClass *) klass)->format_clone = efhq_format_clone; - ((EMFormatClass *) klass)->format_error = efhq_format_error; - ((EMFormatClass *) klass)->format_message = efhq_format_message; - ((EMFormatClass *) klass)->format_source = efhq_format_source; - ((EMFormatClass *) klass)->format_attachment = efhq_format_attachment; - - klass->finalize = efhq_finalise; -} - -GType -em_format_html_quote_get_type (void) -{ - static GType type = 0; - - if (type == 0) { - static const GTypeInfo info = { - sizeof (EMFormatHTMLQuoteClass), - (GBaseInitFunc)efhq_base_init, NULL, - (GClassInitFunc)efhq_class_init, - NULL, NULL, - sizeof (EMFormatHTMLQuote), 0, - (GInstanceInitFunc) efhq_init - }; - - efhq_parent = g_type_class_ref (em_format_html_get_type ()); - type = g_type_register_static (em_format_html_get_type (), "EMFormatHTMLQuote", &info, 0); - } - - return type; -} - -EMFormatHTMLQuote * -em_format_html_quote_new (void) -{ - return (EMFormatHTMLQuote *) g_object_new (em_format_html_quote_get_type (), NULL); -} - -EMFormatHTMLQuote * -em_format_html_quote_new_with_credits (const char *credits) -{ - EMFormatHTMLQuote *emfq; - - emfq = (EMFormatHTMLQuote *) g_object_new (em_format_html_quote_get_type (), NULL); - emfq->priv->credits = g_strdup (credits); - - return emfq; -} - -static void -efhq_format_clone (EMFormat *emf, CamelMedium *part, EMFormat *src) -{ - ((EMFormatClass *) efhq_parent)->format_clone (emf, part, src); -} - -static void -efhq_format_error (EMFormat *emf, CamelStream *stream, const char *txt) -{ - /* FIXME: should we even bother writign error text for quoting? probably not... */ - ((EMFormatClass *) efhq_parent)->format_error (emf, stream, txt); -} - -static void -efhq_format_message (EMFormat *emf, CamelStream *stream, CamelMedium *part) -{ - EMFormatHTMLQuote *emfq = (EMFormatHTMLQuote *) emf; - - camel_stream_printf (stream, "%s<!--+GtkHTML:<DATA class=\"ClueFlow\" key=\"orig\" value=\"1\">-->\n" - "<font color=\"#%06x\">\n" - "<blockquote type=cite>\n", - emfq->priv->credits ? emfq->priv->credits : "", - emfq->formathtml.citation_colour); - - if (!((EMFormatHTML *)emf)->hide_headers) - em_format_html_format_headers((EMFormatHTML *)emf, stream, part); - - em_format_part(emf, stream, (CamelMimePart *)part); - - camel_stream_write_string (stream, "</blockquote></font><!--+GtkHTML:<DATA class=\"ClueFlow\" clear=\"orig\">-->"); -} - -static void -efhq_format_source (EMFormat *emf, CamelStream *stream, CamelMimePart *part) -{ - /* FIXME: should we just format_message? */ - ((EMFormatClass *) efhq_parent)->format_source (emf, stream, part); -} - -static void -efhq_format_attachment (EMFormat *emf, CamelStream *stream, CamelMimePart *part, const char *mime_type, const EMFormatHandler *handle) -{ - ; -} - -#include <camel/camel-medium.h> -#include <camel/camel-mime-part.h> -#include <camel/camel-multipart.h> -#include <camel/camel-url.h> - -static void -efhq_multipart_related(EMFormat *emf, CamelStream *stream, CamelMimePart *part, const EMFormatHandler *info) -{ - CamelMultipart *mp = (CamelMultipart *)camel_medium_get_content_object((CamelMedium *)part); - CamelMimePart *body_part, *display_part = NULL; - CamelContentType *content_type; - const char *location, *start; - int i, nparts; - CamelURL *base_save = NULL; - - if (!CAMEL_IS_MULTIPART(mp)) { - em_format_format_source(emf, stream, part); - return; - } - - /* sigh, so much for oo code reuse ... */ - /* FIXME: put in a function */ - nparts = camel_multipart_get_number(mp); - content_type = camel_mime_part_get_content_type(part); - start = camel_content_type_param (content_type, "start"); - if (start && strlen(start)>2) { - int len; - const char *cid; - - /* strip <>'s */ - len = strlen (start) - 2; - start++; - - for (i=0; i<nparts; i++) { - body_part = camel_multipart_get_part(mp, i); - cid = camel_mime_part_get_content_id(body_part); - - if (cid && !strncmp(cid, start, len) && strlen(cid) == len) { - display_part = body_part; - break; - } - } - } else { - display_part = camel_multipart_get_part(mp, 0); - } - - if (display_part == NULL) { - em_format_part_as(emf, stream, part, "multipart/mixed"); - return; - } - - /* stack of present location and pending uri's */ - location = camel_mime_part_get_content_location(part); - if (location) { - base_save = emf->base; - emf->base = camel_url_new(location, NULL); - } - em_format_push_level(emf); - - em_format_part(emf, stream, display_part); - em_format_pull_level(emf); - - if (location) { - camel_url_free(emf->base); - emf->base = base_save; - } -} - -static const char *type_remove_table[] = { - "image/gif", - "image/jpeg", - "image/png", - "image/x-png", - "image/tiff", - "image/x-bmp", - "image/bmp", - "image/x-cmu-raster", - "image/x-portable-anymap", - "image/x-portable-bitmap", - "image/x-portable-graymap", - "image/x-portable-pixmap", - "image/x-xpixmap", - "message/external-body", - "multipart/appledouble", - "multipart/signed", - - "image/jpg", - "image/pjpeg", -}; - -static EMFormatHandler type_builtin_table[] = { - { "multipart/related", (EMFormatFunc)efhq_multipart_related }, -}; - -static void -efhq_builtin_init (EMFormatHTMLQuoteClass *efhc) -{ - int i; - - for (i = 0; i < sizeof (type_remove_table) / sizeof (type_remove_table[0]); i++) - em_format_class_remove_handler ((EMFormatClass *) efhc, type_remove_table[i]); - - for (i=0;i<sizeof(type_builtin_table)/sizeof(type_builtin_table[0]);i++) - em_format_class_add_handler((EMFormatClass *)efhc, &type_builtin_table[i]); -} diff --git a/mail/em-format-html-quote.h b/mail/em-format-html-quote.h deleted file mode 100644 index 1422b04093..0000000000 --- a/mail/em-format-html-quote.h +++ /dev/null @@ -1,49 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Authors: Jeffrey Stedfast <fejj@ximian.com> - * - * Copyright 2003 Ximian, Inc. (www.ximian.com) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA. - * - */ - - -#ifndef _EM_FORMAT_HTML_QUOTE_H -#define _EM_FORMAT_HTML_QUOTE_H - -#include "em-format-html.h" - -typedef struct _EMFormatHTMLQuote EMFormatHTMLQuote; -typedef struct _EMFormatHTMLQuoteClass EMFormatHTMLQuoteClass; - -struct _EMFormatHTMLQuote { - EMFormatHTML formathtml; - - struct _EMFormatHTMLQuotePrivate *priv; -}; - -struct _EMFormatHTMLQuoteClass { - EMFormatHTMLClass formathtml_class; - -}; - -GType em_format_html_quote_get_type (void); - -EMFormatHTMLQuote *em_format_html_quote_new (void); - -EMFormatHTMLQuote *em_format_html_quote_new_with_credits (const char *cedits); - -#endif /* !_EM_FORMAT_HTML_QUOTE_H */ diff --git a/mail/em-format-html.c b/mail/em-format-html.c deleted file mode 100644 index f3b9b46c5a..0000000000 --- a/mail/em-format-html.c +++ /dev/null @@ -1,1627 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Authors: Michael Zucchi <notzed@ximian.com> - * - * Copyright 2003 Ximian, Inc. (www.ximian.com) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA. - * - */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <stdio.h> -#include <string.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <fcntl.h> -#include <ctype.h> - -#include <gal/util/e-iconv.h> -#include <gal/util/e-util.h> /* for e_utf8_strftime, what about e_time_format_time? */ -#include "e-util/e-time-utils.h" - -#include <gtkhtml/gtkhtml.h> -#include <gtkhtml/gtkhtml-embedded.h> -#include <gtkhtml/gtkhtml-stream.h> -#include <gtkhtml/htmlengine.h> - -#include <libgnomevfs/gnome-vfs-utils.h> -#include <libgnomevfs/gnome-vfs-mime-utils.h> -#include <libgnomevfs/gnome-vfs-mime-handlers.h> - -#include <camel/camel-mime-message.h> -#include <camel/camel-stream.h> -#include <camel/camel-stream-filter.h> -#include <camel/camel-mime-filter.h> -#include <camel/camel-mime-filter-tohtml.h> -#include <camel/camel-mime-filter-enriched.h> -#include <camel/camel-multipart.h> -#include <camel/camel-multipart-signed.h> -#include <camel/camel-gpg-context.h> -#include <camel/camel-smime-context.h> -#include <camel/camel-stream-mem.h> -#include <camel/camel-url.h> -#include <camel/camel-stream-fs.h> -#include <camel/camel-string-utils.h> -#include <camel/camel-http-stream.h> -#include <camel/camel-data-cache.h> -#include <camel/camel-file-utils.h> - - -#include <e-util/e-msgport.h> - -#include "mail-component.h" -#include "mail-mt.h" - -#include "em-format-html.h" -#include "em-html-stream.h" -#include "em-utils.h" - -#define d(x) - -#define EFH_TABLE_OPEN "<table>" - -struct _EMFormatHTMLPrivate { - struct _CamelMedium *last_part; /* not reffed, DO NOT dereference */ - volatile int format_id; /* format thread id */ - guint format_timeout_id; - struct _format_msg *format_timeout_msg; - - /* Table that re-maps text parts into a mutlipart/mixed */ - GHashTable *text_inline_parts; - - EDList pending_jobs; - GMutex *lock; -}; - -static void efh_url_requested(GtkHTML *html, const char *url, GtkHTMLStream *handle, EMFormatHTML *efh); -static gboolean efh_object_requested(GtkHTML *html, GtkHTMLEmbedded *eb, EMFormatHTML *efh); -static void efh_gtkhtml_destroy(GtkHTML *html, EMFormatHTML *efh); - -static void efh_format_clone(EMFormat *, CamelMedium *, EMFormat *); -static void efh_format_error(EMFormat *emf, CamelStream *stream, const char *txt); -static void efh_format_message(EMFormat *, CamelStream *, CamelMedium *); -static void efh_format_source(EMFormat *, CamelStream *, CamelMimePart *); -static void efh_format_attachment(EMFormat *, CamelStream *, CamelMimePart *, const char *, const EMFormatHandler *); -static gboolean efh_busy(EMFormat *); - -static void efh_builtin_init(EMFormatHTMLClass *efhc); - -static void efh_write_image(EMFormat *emf, CamelStream *stream, EMFormatPURI *puri); - -static EMFormatClass *efh_parent; -static CamelDataCache *emfh_http_cache; - -#define EMFH_HTTP_CACHE_PATH "http" - -static void -efh_init(GObject *o) -{ - EMFormatHTML *efh = (EMFormatHTML *)o; - - efh->priv = g_malloc0(sizeof(*efh->priv)); - - e_dlist_init(&efh->pending_object_list); - e_dlist_init(&efh->priv->pending_jobs); - efh->priv->lock = g_mutex_new(); - efh->priv->format_id = -1; - efh->priv->text_inline_parts = g_hash_table_new(NULL, NULL); - - efh->html = (GtkHTML *)gtk_html_new(); - gtk_html_set_blocking(efh->html, FALSE); - g_object_ref(efh->html); - gtk_object_sink((GtkObject *)efh->html); - - gtk_html_set_default_content_type(efh->html, "text/html; charset=utf-8"); - gtk_html_set_editable(efh->html, FALSE); - - g_signal_connect(efh->html, "destroy", G_CALLBACK(efh_gtkhtml_destroy), efh); - g_signal_connect(efh->html, "url_requested", G_CALLBACK(efh_url_requested), efh); - g_signal_connect(efh->html, "object_requested", G_CALLBACK(efh_object_requested), efh); - - efh->body_colour = 0xeeeeee; - efh->text_colour = 0; - efh->frame_colour = 0x3f3f3f; - efh->content_colour = 0xffffff; - efh->text_html_flags = CAMEL_MIME_FILTER_TOHTML_CONVERT_NL | CAMEL_MIME_FILTER_TOHTML_CONVERT_SPACES - | CAMEL_MIME_FILTER_TOHTML_MARK_CITATION; -} - -static void -efh_gtkhtml_destroy(GtkHTML *html, EMFormatHTML *efh) -{ - if (efh->priv->format_timeout_id != 0) { - g_source_remove(efh->priv->format_timeout_id); - efh->priv->format_timeout_id = 0; - mail_msg_free(efh->priv->format_timeout_msg); - efh->priv->format_timeout_msg = NULL; - } - - /* This probably works ... */ - if (efh->priv->format_id != -1) - mail_msg_cancel(efh->priv->format_id); - - if (efh->html) { - g_object_unref(efh->html); - efh->html = NULL; - } -} - -static void -efh_free_inline_parts(void *key, void *data, void *user) -{ - camel_object_unref(data); -} - -static void -efh_finalise(GObject *o) -{ - EMFormatHTML *efh = (EMFormatHTML *)o; - - /* FIXME: check for leaked stuff */ - - em_format_html_clear_pobject(efh); - camel_cipher_validity_free(efh->valid); - - efh_gtkhtml_destroy(efh->html, efh); - - g_hash_table_foreach(efh->priv->text_inline_parts, efh_free_inline_parts, NULL); - g_hash_table_destroy(efh->priv->text_inline_parts); - - g_free(efh->priv); - - ((GObjectClass *)efh_parent)->finalize(o); -} - -static void -efh_base_init(EMFormatHTMLClass *efhklass) -{ - efh_builtin_init(efhklass); -} - -static void -efh_class_init(GObjectClass *klass) -{ - ((EMFormatClass *)klass)->format_clone = efh_format_clone; - ((EMFormatClass *)klass)->format_error = efh_format_error; - ((EMFormatClass *)klass)->format_message = efh_format_message; - ((EMFormatClass *)klass)->format_source = efh_format_source; - ((EMFormatClass *)klass)->format_attachment = efh_format_attachment; - ((EMFormatClass *)klass)->busy = efh_busy; - - klass->finalize = efh_finalise; -} - -GType -em_format_html_get_type(void) -{ - static GType type = 0; - - if (type == 0) { - static const GTypeInfo info = { - sizeof(EMFormatHTMLClass), - (GBaseInitFunc)efh_base_init, NULL, - (GClassInitFunc)efh_class_init, - NULL, NULL, - sizeof(EMFormatHTML), 0, - (GInstanceInitFunc)efh_init - }; - const char *base_directory = mail_component_peek_base_directory (mail_component_peek ()); - char *path; - - efh_parent = g_type_class_ref(em_format_get_type()); - type = g_type_register_static(em_format_get_type(), "EMFormatHTML", &info, 0); - - /* cache expiry - 2 hour access, 1 day max */ - path = alloca(strlen(base_directory)+16); - sprintf(path, "%s/cache", base_directory); - emfh_http_cache = camel_data_cache_new(path, 0, NULL); - camel_data_cache_set_expire_age(emfh_http_cache, 24*60*60); - camel_data_cache_set_expire_access(emfh_http_cache, 2*60*60); - } - - return type; -} - -EMFormatHTML *em_format_html_new(void) -{ - EMFormatHTML *efh; - - efh = g_object_new(em_format_html_get_type(), 0); - - return efh; -} - -/* force loading of http images */ -void em_format_html_load_http(EMFormatHTML *emfh) -{ - if (emfh->load_http) - return; - - /* This will remain set while we're still rendering the same message, then it wont be */ - emfh->load_http_now = TRUE; - d(printf("redrawing with images forced on\n")); - em_format_format_clone((EMFormat *)emfh, emfh->format.message, (EMFormat *)emfh); -} - -void -em_format_html_set_load_http(EMFormatHTML *emfh, int state) -{ - if (emfh->load_http ^ state) { - emfh->load_http = state; - em_format_format_clone((EMFormat *)emfh, emfh->format.message, (EMFormat *)emfh); - } -} - -void -em_format_html_set_mark_citations(EMFormatHTML *emfh, int state, guint32 citation_colour) -{ - if (emfh->mark_citations ^ state || emfh->citation_colour != citation_colour) { - emfh->mark_citations = state; - emfh->citation_colour = citation_colour; - em_format_format_clone((EMFormat *)emfh, emfh->format.message, (EMFormat *)emfh); - } -} - -void -em_format_html_set_xmailer_mask(EMFormatHTML *emfh, unsigned int xmailer_mask) -{ - if (emfh->xmailer_mask ^ xmailer_mask) { - emfh->xmailer_mask = xmailer_mask; - em_format_format_clone((EMFormat *)emfh, emfh->format.message, (EMFormat *)emfh); - } -} - -CamelMimePart * -em_format_html_file_part(EMFormatHTML *efh, const char *mime_type, const char *path, const char *name) -{ - CamelMimePart *part; - CamelStream *stream; - CamelDataWrapper *dw; - char *filename; - - filename = g_build_filename(path, name, NULL); - stream = camel_stream_fs_new_with_name(filename, O_RDONLY, 0); - g_free(filename); - if (stream == NULL) - return NULL; - - part = camel_mime_part_new(); - dw = camel_data_wrapper_new(); - camel_data_wrapper_construct_from_stream(dw, stream); - camel_object_unref(stream); - if (mime_type) - camel_data_wrapper_set_mime_type(dw, mime_type); - part = camel_mime_part_new(); - camel_medium_set_content_object((CamelMedium *)part, dw); - camel_object_unref(dw); - camel_mime_part_set_filename(part, name); - - return part; -} - -/* all this api is a pain in the bum ... */ - -EMFormatHTMLPObject * -em_format_html_add_pobject(EMFormatHTML *efh, size_t size, const char *classid, CamelMimePart *part, EMFormatHTMLPObjectFunc func) -{ - EMFormatHTMLPObject *pobj; - - g_assert(size >= sizeof(EMFormatHTMLPObject)); - - pobj = g_malloc0(size); - if (classid) { - pobj->classid = g_strdup(classid); - } else { - static unsigned int uriid = 0; - - pobj->classid = g_strdup_printf("e-object:///%u", uriid++); - } - - pobj->format = efh; - pobj->func = func; - pobj->part = part; - - e_dlist_addtail(&efh->pending_object_list, (EDListNode *)pobj); - - return pobj; -} - -EMFormatHTMLPObject * -em_format_html_find_pobject(EMFormatHTML *emf, const char *classid) -{ - EMFormatHTMLPObject *pw; - - pw = (EMFormatHTMLPObject *)emf->pending_object_list.head; - while (pw->next) { - if (!strcmp(pw->classid, classid)) - return pw; - pw = pw->next; - } - - return NULL; -} - -EMFormatHTMLPObject * -em_format_html_find_pobject_func(EMFormatHTML *emf, CamelMimePart *part, EMFormatHTMLPObjectFunc func) -{ - EMFormatHTMLPObject *pw; - - pw = (EMFormatHTMLPObject *)emf->pending_object_list.head; - while (pw->next) { - if (pw->func == func && pw->part == part) - return pw; - pw = pw->next; - } - - return NULL; -} - -void -em_format_html_remove_pobject(EMFormatHTML *emf, EMFormatHTMLPObject *pobject) -{ - e_dlist_remove((EDListNode *)pobject); - if (pobject->free) - pobject->free(pobject); - g_free(pobject->classid); - g_free(pobject); -} - -void -em_format_html_clear_pobject(EMFormatHTML *emf) -{ - d(printf("clearing pending objects\n")); - while (!e_dlist_empty(&emf->pending_object_list)) - em_format_html_remove_pobject(emf, (EMFormatHTMLPObject *)emf->pending_object_list.head); -} - -struct _EMFormatHTMLJob * -em_format_html_job_new(EMFormatHTML *emfh, void (*callback)(struct _EMFormatHTMLJob *job, int cancelled), void *data) -{ - struct _EMFormatHTMLJob *job = g_malloc0(sizeof(*job)); - - job->format = emfh; - job->puri_level = ((EMFormat *)emfh)->pending_uri_level; - job->callback = callback; - job->u.data = data; - if (((EMFormat *)emfh)->base) - job->base = camel_url_copy(((EMFormat *)emfh)->base); - - return job; -} - -void -em_format_html_job_queue(EMFormatHTML *emfh, struct _EMFormatHTMLJob *job) -{ - g_mutex_lock(emfh->priv->lock); - e_dlist_addtail(&emfh->priv->pending_jobs, (EDListNode *)job); - g_mutex_unlock(emfh->priv->lock); -} - -/* ********************************************************************** */ - -static void emfh_getpuri(struct _EMFormatHTMLJob *job, int cancelled) -{ - d(printf(" running getpuri task\n")); - if (!cancelled) - job->u.puri->func((EMFormat *)job->format, job->stream, job->u.puri); -} - -static void emfh_gethttp(struct _EMFormatHTMLJob *job, int cancelled) -{ - CamelStream *cistream = NULL, *costream = NULL, *instream = NULL; - CamelURL *url; - ssize_t n, total = 0; - char buffer[1500]; - - if (cancelled - || (url = camel_url_new(job->u.uri, NULL)) == NULL) - goto badurl; - - d(printf(" running load uri task: %s\n", job->u.uri)); - - if (emfh_http_cache) - instream = cistream = camel_data_cache_get(emfh_http_cache, EMFH_HTTP_CACHE_PATH, job->u.uri, NULL); - - if (instream == NULL) { - char *proxy; - - if (!job->format->load_http_now) { - /* TODO: Ideally we would put the http requests into another queue and only send them out - if the user selects 'load images', when they do. The problem is how to maintain this - state with multiple renderings, and how to adjust the thread dispatch/setup routine to handle it */ - /* FIXME: Need to handle 'load if sender in addressbook' case too */ - camel_url_free(url); - goto done; - } - - instream = camel_http_stream_new(CAMEL_HTTP_METHOD_GET, ((EMFormat *)job->format)->session, url); - proxy = em_utils_get_proxy_uri(); - camel_http_stream_set_proxy((CamelHttpStream *)instream, proxy); - g_free(proxy); - camel_operation_start(NULL, _("Retrieving `%s'"), job->u.uri); - } else - camel_operation_start_transient(NULL, _("Retrieving `%s'"), job->u.uri); - - camel_url_free(url); - - if (instream == NULL) - goto done; - - if (emfh_http_cache != NULL && cistream == NULL) - costream = camel_data_cache_add(emfh_http_cache, EMFH_HTTP_CACHE_PATH, job->u.uri, NULL); - - do { - /* FIXME: progress reporting in percentage, can we get the length always? do we care? */ - n = camel_stream_read(instream, buffer, 1500); - if (n > 0) { - camel_operation_progress_count(NULL, total); - total += n; - d(printf(" read %d bytes\n", n)); - if (costream && camel_stream_write(costream, buffer, n) == -1) { - camel_data_cache_remove(emfh_http_cache, EMFH_HTTP_CACHE_PATH, job->u.uri, NULL); - camel_object_unref(costream); - costream = NULL; - } - - camel_stream_write(job->stream, buffer, n); - } else if (n < 0 && costream) { - camel_data_cache_remove(emfh_http_cache, EMFH_HTTP_CACHE_PATH, job->u.uri, NULL); - camel_object_unref(costream); - costream = NULL; - } - } while (n>0); - - /* indicates success */ - if (n == 0) - camel_stream_close(job->stream); - - if (costream) - camel_object_unref(costream); - - camel_object_unref(instream); -done: - camel_operation_end(NULL); -badurl: - g_free(job->u.uri); -} - -/* ********************************************************************** */ - -static void -efh_url_requested(GtkHTML *html, const char *url, GtkHTMLStream *handle, EMFormatHTML *efh) -{ - EMFormatPURI *puri; - struct _EMFormatHTMLJob *job = NULL; - - d(printf("url requested, html = %p, url '%s'\n", html, url)); - - puri = em_format_find_visible_puri((EMFormat *)efh, url); - if (puri) { - puri->use_count++; - - d(printf(" adding puri job\n")); - job = em_format_html_job_new(efh, emfh_getpuri, puri); - } else if (g_ascii_strncasecmp(url, "http:", 5) == 0 || g_ascii_strncasecmp(url, "https:", 6) == 0) { - d(printf(" adding job, get %s\n", url)); - job = em_format_html_job_new(efh, emfh_gethttp, g_strdup(url)); - } else { - d(printf("HTML Includes reference to unknown uri '%s'\n", url)); - gtk_html_stream_close(handle, GTK_HTML_STREAM_ERROR); - } - - if (job) { - job->stream = em_html_stream_new(html, handle); - em_format_html_job_queue(efh, job); - } -} - -static gboolean -efh_object_requested(GtkHTML *html, GtkHTMLEmbedded *eb, EMFormatHTML *efh) -{ - EMFormatHTMLPObject *pobject; - int res = FALSE; - - if (eb->classid == NULL) - return FALSE; - - pobject = em_format_html_find_pobject(efh, eb->classid); - if (pobject) { - /* This stops recursion of the part */ - e_dlist_remove((EDListNode *)pobject); - res = pobject->func(efh, eb, pobject); - e_dlist_addhead(&efh->pending_object_list, (EDListNode *)pobject); - } else { - printf("HTML Includes reference to unknown object '%s'\n", eb->classid); - } - - return res; -} - -/* ********************************************************************** */ -#include "em-inline-filter.h" -#include <camel/camel-stream-null.h> - -/* FIXME: This is duplicated in em-format-html-display, should be exported or in security module */ -static const struct { - const char *icon, *shortdesc; -} smime_sign_table[4] = { - { "pgp-signature-nokey.png", N_("Unsigned") }, - { "pgp-signature-ok.png", N_("Valid signature") }, - { "pgp-signature-bad.png", N_("Invalid signature") }, - { "pgp-signature-nokey.png", N_("Valid signature, cannot verify sender") }, -}; - -static const struct { - const char *icon, *shortdesc; -} smime_encrypt_table[4] = { - { NULL, N_("Unencrypted") }, - { "pgp-signature-ok.png", N_("Encrypted, weak"),}, - { "pgp-signature-ok.png", N_("Encrypted") }, - { "pgp-signature-ok.png", N_("Encrypted, strong") }, -}; - -/* TODO: this could probably be virtual on em-format-html - then we only need one version of each type handler */ -static void -efh_output_secure(EMFormat *emf, CamelStream *stream, CamelMimePart *part, CamelCipherValidity *valid) -{ - CamelCipherValidity *save = ((EMFormatHTML *)emf)->valid_parent; - - /* Note: this same logic is in efhd_output_secure */ - if (((EMFormatHTML *)emf)->valid == NULL) { - ((EMFormatHTML *)emf)->valid = valid; - } else { - e_dlist_addtail(&((EMFormatHTML *)emf)->valid_parent->children, (EDListNode *)valid); - camel_cipher_validity_envelope(((EMFormatHTML *)emf)->valid_parent, valid); - } - - ((EMFormatHTML *)emf)->valid_parent = valid; - em_format_part(emf, stream, part); - ((EMFormatHTML *)emf)->valid_parent = save; - - if (((EMFormatHTML *)emf)->valid == valid - && (valid->encrypt.status != CAMEL_CIPHER_VALIDITY_ENCRYPT_NONE - || valid->sign.status != CAMEL_CIPHER_VALIDITY_SIGN_NONE)) { - char *classid; - CamelMimePart *iconpart; - - camel_stream_printf(stream, "<table border=0 width=\"100%%\" cellpadding=3 cellspacing=0 bgcolor=%s><tr>", - valid->sign.status == CAMEL_CIPHER_VALIDITY_SIGN_GOOD?"#88bb88":"#bb8888"); - - classid = g_strdup_printf("smime:///em-format-html/%p/icon/signed", part); - camel_stream_printf(stream, "<td valign=\"top\"><img src=\"%s\"></td><td valign=\"top\" width=\"100%%\">", classid); - iconpart = em_format_html_file_part((EMFormatHTML *)emf, "image/png", - EVOLUTION_ICONSDIR, smime_sign_table[valid->sign.status].icon); - if (iconpart) { - (void)em_format_add_puri(emf, sizeof(EMFormatPURI), classid, iconpart, efh_write_image); - camel_object_unref(iconpart); - } - g_free(classid); - - if (valid->sign.status != CAMEL_CIPHER_VALIDITY_SIGN_NONE) { - camel_stream_printf(stream, "%s<br>", _(smime_sign_table[valid->sign.status].shortdesc)); - } - - if (valid->encrypt.status != CAMEL_CIPHER_VALIDITY_ENCRYPT_NONE) { - camel_stream_printf(stream, "%s<br>", _(smime_encrypt_table[valid->encrypt.status].shortdesc)); - } - - camel_stream_printf(stream, "</td></tr></table>"); - } -} - -static void -efh_application_xpkcs7mime(EMFormat *emf, CamelStream *stream, CamelMimePart *part, const EMFormatHandler *info) -{ - CamelCipherContext *context; - CamelException *ex; - extern CamelSession *session; - CamelMimePart *opart; - CamelCipherValidity *valid; - - ex = camel_exception_new(); - - context = camel_smime_context_new(session); - - opart = camel_mime_part_new(); - valid = camel_cipher_decrypt(context, part, opart, ex); - if (valid == NULL) { - em_format_format_error(emf, stream, ex->desc?ex->desc:_("Could not parse S/MIME message: Unknown error")); - em_format_part_as(emf, stream, part, NULL); - } else { - efh_output_secure(emf, stream, opart, valid); - } - - camel_object_unref(opart); - camel_object_unref(context); - camel_exception_free(ex); -} - -static void -efh_text_plain(EMFormatHTML *efh, CamelStream *stream, CamelMimePart *part, EMFormatHandler *info) -{ - CamelStreamFilter *filtered_stream; - CamelMimeFilter *html_filter; - CamelMultipart *mp; - CamelContentType *type; - const char *format; - guint32 rgb = 0x737373, flags; - int i, count; - - camel_stream_printf (stream, - "<table bgcolor=\"#%06x\" cellspacing=0 cellpadding=1 width=100%%><tr><td>\n" - "<table bgcolor=\"#%06x\" cellspacing=0 cellpadding=0 width=100%%><tr><td>\n" - "<table cellspacing=0 cellpadding=10><td><tr>\n", - efh->frame_colour & 0xffffff, efh->content_colour & 0xffffff); - - flags = efh->text_html_flags; - - /* Check for RFC 2646 flowed text. */ - type = camel_mime_part_get_content_type(part); - if (camel_content_type_is (type, "text", "plain") - && (format = camel_content_type_param (type, "format")) - && !g_ascii_strcasecmp(format, "flowed")) - flags |= CAMEL_MIME_FILTER_TOHTML_FORMAT_FLOWED; - - /* This scans the text part for inline-encoded data, creates - a multipart of all the parts inside it. */ - - /* FIXME: We should discard this multipart if it only contains - the original text, but it makes this hash lookup more complex */ - - /* TODO: We could probably put this in the superclass, since - no knowledge of html is required - but this messes with - filters a bit. Perhaps the superclass should just deal with - html anyway and be done with it ... */ - - mp = g_hash_table_lookup(efh->priv->text_inline_parts, part); - if (mp == NULL) { - EMInlineFilter *inline_filter; - CamelStream *null; - - null = camel_stream_null_new(); - filtered_stream = camel_stream_filter_new_with_stream(null); - camel_object_unref(null); - inline_filter = em_inline_filter_new(camel_mime_part_get_encoding(part)); - camel_stream_filter_add(filtered_stream, (CamelMimeFilter *)inline_filter); - camel_data_wrapper_write_to_stream(camel_medium_get_content_object((CamelMedium *)part), (CamelStream *)filtered_stream); - camel_stream_close((CamelStream *)filtered_stream); - camel_object_unref(filtered_stream); - mp = em_inline_filter_get_multipart(inline_filter); - g_hash_table_insert(efh->priv->text_inline_parts, part, mp); - camel_object_unref(inline_filter); - } - - filtered_stream = camel_stream_filter_new_with_stream(stream); - html_filter = camel_mime_filter_tohtml_new(flags, rgb); - camel_stream_filter_add(filtered_stream, html_filter); - camel_object_unref(html_filter); - - /* We handle our made-up multipart here, so we don't recursively call ourselves */ - - count = camel_multipart_get_number(mp); - for (i=0;i<count;i++) { - CamelMimePart *newpart = camel_multipart_get_part(mp, i); - - type = camel_mime_part_get_content_type(newpart); - if (camel_content_type_is (type, "text", "plain")) { - camel_stream_write_string(stream, "<tt>\n"); - em_format_format_text((EMFormat *)efh, (CamelStream *)filtered_stream, camel_medium_get_content_object((CamelMedium *)newpart)); - camel_stream_flush((CamelStream *)filtered_stream); - camel_stream_write_string(stream, "</tt>\n"); - } else { - em_format_part((EMFormat *)efh, stream, newpart); - } - } - - camel_object_unref(filtered_stream); - camel_stream_write_string(stream, - "</td></tr></table>\n" - "</td></tr></table>\n" - "</td></tr></table>\n"); -} - -static void -efh_text_enriched(EMFormatHTML *efh, CamelStream *stream, CamelMimePart *part, EMFormatHandler *info) -{ - CamelStreamFilter *filtered_stream; - CamelMimeFilter *enriched; - CamelDataWrapper *dw; - guint32 flags = 0; - - dw = camel_medium_get_content_object((CamelMedium *)part); - - if (!strcmp(info->mime_type, "text/richtext")) { - flags = CAMEL_MIME_FILTER_ENRICHED_IS_RICHTEXT; - camel_stream_write_string( stream, "\n<!-- text/richtext -->\n"); - } else { - camel_stream_write_string( stream, "\n<!-- text/enriched -->\n"); - } - - enriched = camel_mime_filter_enriched_new(flags); - filtered_stream = camel_stream_filter_new_with_stream (stream); - camel_stream_filter_add(filtered_stream, enriched); - camel_object_unref(enriched); - - camel_stream_write_string(stream, EFH_TABLE_OPEN "<tr><td><tt>\n"); - em_format_format_text((EMFormat *)efh, (CamelStream *)filtered_stream, dw); - - camel_stream_write_string(stream, "</tt></td></tr></table>\n"); - camel_object_unref(filtered_stream); -} - -static void -efh_write_text_html(EMFormat *emf, CamelStream *stream, EMFormatPURI *puri) -{ - em_format_format_text(emf, stream, camel_medium_get_content_object((CamelMedium *)puri->part)); -} - -static void -efh_text_html(EMFormatHTML *efh, CamelStream *stream, CamelMimePart *part, EMFormatHandler *info) -{ - const char *location, *base; - EMFormatPURI *puri; - - camel_stream_printf (stream, - "<table bgcolor=\"#%06x\" cellspacing=0 cellpadding=1 width=100%%><tr><td>\n" - "<table bgcolor=\"#%06x\" cellspacing=0 cellpadding=0 width=100%%><tr><td>\n" - "<!-- text/html -->\n", - efh->frame_colour & 0xffffff, efh->content_colour & 0xffffff); - - if ((base = camel_medium_get_header((CamelMedium *)part, "Content-Base"))) { - char *base_url; - size_t len; - - len = strlen(base); - if (*base == '"' && *(base + len - 1) == '"') { - len -= 2; - base_url = alloca(len + 1); - memcpy(base_url, base + 1, len); - base_url[len] = '\0'; - base = base_url; - } - - /* FIXME: set base needs to go on the gtkhtml stream? */ - gtk_html_set_base(efh->html, base); - } - - puri = em_format_add_puri((EMFormat *)efh, sizeof(EMFormatPURI), NULL, part, efh_write_text_html); - location = puri->uri?puri->uri:puri->cid; - d(printf("adding iframe, location %s\n", location)); - camel_stream_printf(stream, - "<iframe src=\"%s\" frameborder=0 scrolling=no>could not get %s</iframe>\n" - "</td></tr></table>\n" - "</td></tr></table>\n", - location, location); -} - -/* This is a lot of code for something useless ... */ -static void -efh_message_external(EMFormatHTML *efh, CamelStream *stream, CamelMimePart *part, EMFormatHandler *info) -{ - CamelContentType *type; - const char *access_type; - char *url = NULL, *desc = NULL; - - /* needs to be cleaner */ - type = camel_mime_part_get_content_type(part); - access_type = camel_content_type_param (type, "access-type"); - if (!access_type) { - camel_stream_printf(stream, _("Malformed external-body part.")); - return; - } - - if (!g_ascii_strcasecmp(access_type, "ftp") || - !g_ascii_strcasecmp(access_type, "anon-ftp")) { - const char *name, *site, *dir, *mode; - char *path; - char ftype[16]; - - name = camel_content_type_param (type, "name"); - site = camel_content_type_param (type, "site"); - dir = camel_content_type_param (type, "directory"); - mode = camel_content_type_param (type, "mode"); - if (name == NULL || site == NULL) - goto fail; - - /* Generate the path. */ - if (dir) - path = g_strdup_printf("/%s/%s", *dir=='/'?dir+1:dir, name); - else - path = g_strdup_printf("/%s", *name=='/'?name+1:name); - - if (mode && &mode) - sprintf(ftype, ";type=%c", *mode); - else - ftype[0] = 0; - - url = g_strdup_printf ("ftp://%s%s%s", site, path, ftype); - g_free (path); - desc = g_strdup_printf (_("Pointer to FTP site (%s)"), url); - } else if (!g_ascii_strcasecmp (access_type, "local-file")) { - const char *name, *site; - - name = camel_content_type_param (type, "name"); - site = camel_content_type_param (type, "site"); - if (name == NULL) - goto fail; - - url = g_strdup_printf ("file:///%s", *name == '/' ? name+1:name); - if (site) - desc = g_strdup_printf(_("Pointer to local file (%s) valid at site \"%s\""), name, site); - else - desc = g_strdup_printf(_("Pointer to local file (%s)"), name); - } else if (!g_ascii_strcasecmp (access_type, "URL")) { - const char *urlparam; - char *s, *d; - - /* RFC 2017 */ - - urlparam = camel_content_type_param (type, "url"); - if (urlparam == NULL) - goto fail; - - /* For obscure MIMEy reasons, the URL may be split into words */ - url = g_strdup (urlparam); - s = d = url; - while (*s) { - /* FIXME: use camel_isspace */ - if (!isspace ((unsigned char)*s)) - *d++ = *s; - s++; - } - *d = 0; - desc = g_strdup_printf (_("Pointer to remote data (%s)"), url); - } else - goto fail; - - camel_stream_printf(stream, "<a href=\"%s\">%s</a>", url, desc); - g_free(url); - g_free(desc); - - return; - -fail: - camel_stream_printf(stream, _("Pointer to unknown external data (\"%s\" type)"), access_type); -} - -static void -emfh_write_related(EMFormat *emf, CamelStream *stream, EMFormatPURI *puri) -{ - em_format_format_content(emf, stream, puri->part); - camel_stream_close(stream); -} - -static void -emfh_multipart_related_check(struct _EMFormatHTMLJob *job, int cancelled) -{ - struct _EMFormatPURITree *ptree; - EMFormatPURI *puri, *purin; - - if (cancelled) - return; - - d(printf(" running multipart/related check task\n")); - - ptree = job->puri_level; - puri = (EMFormatPURI *)ptree->uri_list.head; - purin = puri->next; - while (purin) { - if (puri->use_count == 0) { - d(printf("part '%s' '%s' used '%d'\n", puri->uri?puri->uri:"", puri->cid, puri->use_count)); - if (puri->func == emfh_write_related) - em_format_part((EMFormat *)job->format, (CamelStream *)job->stream, puri->part); - /* else it was probably added by a previous format this loop */ - } - puri = purin; - purin = purin->next; - } -} - -/* RFC 2387 */ -static void -efh_multipart_related(EMFormat *emf, CamelStream *stream, CamelMimePart *part, const EMFormatHandler *info) -{ - CamelMultipart *mp = (CamelMultipart *)camel_medium_get_content_object((CamelMedium *)part); - CamelMimePart *body_part, *display_part = NULL; - CamelContentType *content_type; - const char *location, *start; - int i, nparts; - CamelURL *base_save = NULL; - EMFormatPURI *puri; - struct _EMFormatHTMLJob *job; - - if (!CAMEL_IS_MULTIPART(mp)) { - em_format_format_source(emf, stream, part); - return; - } - - nparts = camel_multipart_get_number(mp); - content_type = camel_mime_part_get_content_type(part); - start = camel_content_type_param (content_type, "start"); - if (start && strlen(start)>2) { - int len; - const char *cid; - - /* strip <>'s */ - len = strlen (start) - 2; - start++; - - for (i=0; i<nparts; i++) { - body_part = camel_multipart_get_part(mp, i); - cid = camel_mime_part_get_content_id(body_part); - - if (cid && !strncmp(cid, start, len) && strlen(cid) == len) { - display_part = body_part; - break; - } - } - } else { - display_part = camel_multipart_get_part(mp, 0); - } - - if (display_part == NULL) { - em_format_part_as(emf, stream, part, "multipart/mixed"); - return; - } - - /* stack of present location and pending uri's */ - location = camel_mime_part_get_content_location(part); - if (location) { - d(printf("setting content location %s\n", location)); - base_save = emf->base; - emf->base = camel_url_new(location, NULL); - } - em_format_push_level(emf); - - /* queue up the parts for possible inclusion */ - for (i = 0; i < nparts; i++) { - body_part = camel_multipart_get_part(mp, i); - if (body_part != display_part) { - puri = em_format_add_puri(emf, sizeof(EMFormatPURI), NULL, body_part, emfh_write_related); - d(printf(" part '%s' '%s' added\n", puri->uri?puri->uri:"", puri->cid)); - } - } - - em_format_part(emf, stream, display_part); - camel_stream_flush(stream); - - /* queue a job to check for un-referenced parts to add as attachments */ - job = em_format_html_job_new((EMFormatHTML *)emf, emfh_multipart_related_check, NULL); - job->stream = stream; - camel_object_ref(stream); - em_format_html_job_queue((EMFormatHTML *)emf, job); - - em_format_pull_level(emf); - - if (location) { - camel_url_free(emf->base); - emf->base = base_save; - } -} - -static void -efh_multipart_signed(EMFormat *emf, CamelStream *stream, CamelMimePart *part, const EMFormatHandler *info) -{ - CamelMimePart *cpart; - CamelMultipartSigned *mps; - CamelCipherContext *cipher = NULL; - - mps = (CamelMultipartSigned *)camel_medium_get_content_object((CamelMedium *)part); - if (!CAMEL_IS_MULTIPART_SIGNED(mps) - || (cpart = camel_multipart_get_part((CamelMultipart *)mps, CAMEL_MULTIPART_SIGNED_CONTENT)) == NULL) { - em_format_format_error(emf, stream, _("Could not parse MIME message. Displaying as source.")); - em_format_format_source(emf, stream, part); - return; - } - - /* FIXME: Should be done via a plugin interface */ - /* FIXME: duplicated in em-format-html-display.c */ - if (g_ascii_strcasecmp("application/x-pkcs7-signature", mps->protocol) == 0) - cipher = camel_smime_context_new(emf->session); - else if (g_ascii_strcasecmp("application/pgp-signature", mps->protocol) == 0) - cipher = camel_gpg_context_new(emf->session); - - if (cipher == NULL) { - em_format_format_error(emf, stream, _("Unsupported signature format")); - em_format_part_as(emf, stream, part, NULL); - } else { - CamelException *ex = camel_exception_new(); - CamelCipherValidity *valid; - - valid = camel_cipher_verify(cipher, part, ex); - if (valid == NULL) { - em_format_format_error(emf, stream, ex->desc?ex->desc:_("Unknown error verifying signature")); - em_format_part_as(emf, stream, part, NULL); - } else { - efh_output_secure(emf, stream, cpart, valid); - } - - camel_exception_free(ex); - camel_object_unref(cipher); - } -} - -static void -efh_write_image(EMFormat *emf, CamelStream *stream, EMFormatPURI *puri) -{ - CamelDataWrapper *dw = camel_medium_get_content_object((CamelMedium *)puri->part); - - d(printf("writing image '%s'\n", puri->uri?puri->uri:puri->cid)); - camel_data_wrapper_decode_to_stream(dw, stream); - camel_stream_close(stream); -} - -static void -efh_image(EMFormatHTML *efh, CamelStream *stream, CamelMimePart *part, EMFormatHandler *info) -{ - EMFormatPURI *puri; - const char *location; - - puri = em_format_add_puri((EMFormat *)efh, sizeof(EMFormatPURI), NULL, part, efh_write_image); - location = puri->uri?puri->uri:puri->cid; - d(printf("adding image '%s'\n", location)); - camel_stream_printf(stream, "<img hspace=10 vspace=10 src=\"%s\">", location); -} - -static EMFormatHandler type_builtin_table[] = { - { "application/x-pkcs7-mime", (EMFormatFunc)efh_application_xpkcs7mime }, - - { "image/gif", (EMFormatFunc)efh_image }, - { "image/jpeg", (EMFormatFunc)efh_image }, - { "image/png", (EMFormatFunc)efh_image }, - { "image/x-png", (EMFormatFunc)efh_image }, - { "image/tiff", (EMFormatFunc)efh_image }, - { "image/x-bmp", (EMFormatFunc)efh_image }, - { "image/bmp", (EMFormatFunc)efh_image }, - { "image/svg", (EMFormatFunc)efh_image }, - { "image/x-cmu-raster", (EMFormatFunc)efh_image }, - { "image/x-ico", (EMFormatFunc)efh_image }, - { "image/x-portable-anymap", (EMFormatFunc)efh_image }, - { "image/x-portable-bitmap", (EMFormatFunc)efh_image }, - { "image/x-portable-graymap", (EMFormatFunc)efh_image }, - { "image/x-portable-pixmap", (EMFormatFunc)efh_image }, - { "image/x-xpixmap", (EMFormatFunc)efh_image }, - { "text/enriched", (EMFormatFunc)efh_text_enriched }, - { "text/plain", (EMFormatFunc)efh_text_plain }, - { "text/html", (EMFormatFunc)efh_text_html }, - { "text/richtext", (EMFormatFunc)efh_text_enriched }, - /*{ "text/ *", (EMFormatFunc)efh_text_plain },*/ - { "message/external-body", (EMFormatFunc)efh_message_external }, - { "multipart/signed", (EMFormatFunc)efh_multipart_signed }, - { "multipart/related", (EMFormatFunc)efh_multipart_related }, - - /* This is where one adds those busted, non-registered types, - that some idiot mailer writers out there decide to pull out - of their proverbials at random. */ - - { "image/jpg", (EMFormatFunc)efh_image }, - { "image/pjpeg", (EMFormatFunc)efh_image }, -}; - -static void -efh_builtin_init(EMFormatHTMLClass *efhc) -{ - int i; - - for (i=0;i<sizeof(type_builtin_table)/sizeof(type_builtin_table[0]);i++) - em_format_class_add_handler((EMFormatClass *)efhc, &type_builtin_table[i]); -} - -/* ********************************************************************** */ - -/* Sigh, this is so we have a cancellable, async rendering thread */ -struct _format_msg { - struct _mail_msg msg; - - EMFormatHTML *format; - EMFormat *format_source; - EMHTMLStream *estream; - CamelMedium *message; -}; - -static char *efh_format_desc(struct _mail_msg *mm, int done) -{ - return g_strdup(_("Formatting message")); -} - -static void efh_format_do(struct _mail_msg *mm) -{ - struct _format_msg *m = (struct _format_msg *)mm; - struct _EMFormatHTMLJob *job; - struct _EMFormatPURITree *puri_level; - int cancelled = FALSE; - CamelURL *base; - - if (m->format->html == NULL) - return; - - camel_stream_printf((CamelStream *)m->estream, - "<!doctype html public \"-//W3C//DTD HTML 4.0 TRANSITIONAL//EN\">\n<html>\n" - "<head>\n<meta name=\"generator\" content=\"Evolution Mail Component\">\n</head>\n" - "<body bgcolor =\"#%06x\" text=\"#%06x\" marginwidth=6 marginheight=6>\n", - m->format->body_colour & 0xffffff, - m->format->text_colour & 0xffffff); - - /* <insert top-header stuff here> */ - - if (((EMFormat *)m->format)->mode == EM_FORMAT_SOURCE) - em_format_format_source((EMFormat *)m->format, (CamelStream *)m->estream, (CamelMimePart *)m->message); - else - em_format_format_message((EMFormat *)m->format, (CamelStream *)m->estream, m->message); - - camel_stream_write_string((CamelStream *)m->estream, "</body>\n</html>\n"); - camel_stream_close((CamelStream *)m->estream); - camel_object_unref(m->estream); - m->estream = NULL; - - puri_level = ((EMFormat *)m->format)->pending_uri_level; - base = ((EMFormat *)m->format)->base; - - /* now dispatch any added tasks ... */ - g_mutex_lock(m->format->priv->lock); - while ((job = (struct _EMFormatHTMLJob *)e_dlist_remhead(&m->format->priv->pending_jobs))) { - g_mutex_unlock(m->format->priv->lock); - - /* This is an implicit check to see if the gtkhtml has been destroyed */ - if (!cancelled) - cancelled = m->format->html == NULL; - - /* Now do an explicit check for user cancellation */ - if (!cancelled) - cancelled = camel_operation_cancel_check(NULL); - - /* call jobs even if cancelled, so they can clean up resources */ - ((EMFormat *)m->format)->pending_uri_level = job->puri_level; - if (job->base) - ((EMFormat *)m->format)->base = job->base; - job->callback(job, cancelled); - ((EMFormat *)m->format)->base = base; - - /* clean up the job */ - camel_object_unref(job->stream); - if (job->base) - camel_url_free(job->base); - g_free(job); - - g_mutex_lock(m->format->priv->lock); - } - g_mutex_unlock(m->format->priv->lock); - d(printf("out of jobs, done\n")); - - ((EMFormat *)m->format)->pending_uri_level = puri_level; -} - -static void efh_format_done(struct _mail_msg *mm) -{ - struct _format_msg *m = (struct _format_msg *)mm; - - d(printf("formatting finished\n")); - - m->format->priv->format_id = -1; - g_signal_emit_by_name(m->format, "complete"); -} - -static void efh_format_free(struct _mail_msg *mm) -{ - struct _format_msg *m = (struct _format_msg *)mm; - - d(printf("formatter freed\n")); - g_object_unref(m->format); - if (m->estream) { - camel_stream_close((CamelStream *)m->estream); - camel_object_unref(m->estream); - } - if (m->message) - camel_object_unref(m->message); - if (m->format_source) - g_object_unref(m->format_source); -} - -static struct _mail_msg_op efh_format_op = { - efh_format_desc, - efh_format_do, - efh_format_done, - efh_format_free, -}; - -static gboolean -efh_format_timeout(struct _format_msg *m) -{ - GtkHTMLStream *hstream; - EMFormatHTML *efh = m->format; - struct _EMFormatHTMLPrivate *p = efh->priv; - - if (m->format->html == NULL) { - mail_msg_free(m); - return FALSE; - } - - d(printf("timeout called ...\n")); - if (p->format_id != -1) { - d(printf(" still waiting for cancellation to take effect, waiting ...\n")); - return TRUE; - } - - g_assert(e_dlist_empty(&p->pending_jobs)); - - d(printf(" ready to go, firing off format thread\n")); - - /* call super-class to kick it off */ - efh_parent->format_clone((EMFormat *)efh, m->message, m->format_source); - em_format_html_clear_pobject(m->format); - - if (efh->valid) { - camel_cipher_validity_free(efh->valid); - efh->valid = NULL; - efh->valid_parent = NULL; - } - - if (m->message == NULL) { - hstream = gtk_html_begin(efh->html); - gtk_html_stream_close(hstream, GTK_HTML_STREAM_OK); - mail_msg_free(m); - p->last_part = NULL; - } else { - /*hstream = gtk_html_begin(efh->html);*/ - hstream = NULL; - m->estream = (EMHTMLStream *)em_html_stream_new(efh->html, hstream); - - if (p->last_part == m->message) { - /* HACK: so we redraw in the same spot */ - /* FIXME: It doesn't work! */ - efh->html->engine->newPage = FALSE; - } else { - /* clear cache of inline-scanned text parts */ - g_hash_table_foreach(p->text_inline_parts, efh_free_inline_parts, NULL); - g_hash_table_destroy(p->text_inline_parts); - p->text_inline_parts = g_hash_table_new(NULL, NULL); - - p->last_part = m->message; - /* FIXME: Need to handle 'load if sender in addressbook' case too */ - efh->load_http_now = efh->load_http; - } - - efh->priv->format_id = m->msg.seq; - e_thread_put(mail_thread_new, (EMsg *)m); - } - - efh->priv->format_timeout_id = 0; - efh->priv->format_timeout_msg = NULL; - - return FALSE; -} - -static void efh_format_clone(EMFormat *emf, CamelMedium *part, EMFormat *emfsource) -{ - EMFormatHTML *efh = (EMFormatHTML *)emf; - struct _format_msg *m; - - /* How to sub-class ? Might need to adjust api ... */ - - if (efh->html == NULL) - return; - - d(printf("efh_format called\n")); - if (efh->priv->format_timeout_id != 0) { - d(printf(" timeout for last still active, removing ...\n")); - g_source_remove(efh->priv->format_timeout_id); - efh->priv->format_timeout_id = 0; - mail_msg_free(efh->priv->format_timeout_msg); - efh->priv->format_timeout_msg = NULL; - } - - m = mail_msg_new(&efh_format_op, NULL, sizeof(*m)); - m->format = (EMFormatHTML *)emf; - g_object_ref(emf); - m->format_source = emfsource; - if (emfsource) - g_object_ref(emfsource); - m->message = part; - if (part) - camel_object_ref(part); - - if (efh->priv->format_id == -1) { - d(printf(" idle, forcing format\n")); - efh_format_timeout(m); - } else { - d(printf(" still busy, cancelling and queuing wait\n")); - /* cancel and poll for completion */ - mail_msg_cancel(efh->priv->format_id); - efh->priv->format_timeout_msg = m; - efh->priv->format_timeout_id = g_timeout_add(100, (GSourceFunc)efh_format_timeout, m); - } -} - -static void efh_format_error(EMFormat *emf, CamelStream *stream, const char *txt) -{ - char *html; - - html = camel_text_to_html (txt, CAMEL_MIME_FILTER_TOHTML_CONVERT_NL|CAMEL_MIME_FILTER_TOHTML_CONVERT_URLS, 0); - camel_stream_printf(stream, "<em><font color=\"red\">%s</font></em><br>", html); - g_free(html); -} - -static void -efh_format_text_header(EMFormat *emf, CamelStream *stream, const char *label, const char *value, guint32 flags) -{ - char *mhtml = NULL; - const char *fmt, *html; - - if (value == NULL) - return; - - while (*value == ' ') - value++; - - if (flags & EM_FORMAT_HTML_HEADER_HTML) - html = value; - else - html = mhtml = camel_text_to_html(value, ((EMFormatHTML *)emf)->text_html_flags, 0); - - if (((EMFormatHTML *)emf)->simple_headers) { - fmt = "<b>%s</b>: %s<br>"; - } else { - if (flags & EM_FORMAT_HTML_HEADER_NOCOLUMNS) { - if (flags & EM_FORMAT_HEADER_BOLD) - fmt = "<tr><td><b>%s:</b> %s</td></tr>"; - else - fmt = "<tr><td>%s: %s</td></tr>"; - } else { - if (flags & EM_FORMAT_HEADER_BOLD) - fmt = "<tr><th align=\"right\" valign=\"top\">%s:<b> </b></th><td>%s</td></tr>"; - else - fmt = "<tr><td align=\"right\" valign=\"top\">%s:<b> </b></td><td>%s</td></tr>"; - } - } - - camel_stream_printf(stream, fmt, label, html); - g_free(mhtml); -} - -static void -efh_format_address(EMFormat *emf, CamelStream *stream, const CamelInternetAddress *cia, const char *name, guint32 flags) -{ - char *text; - - if (cia == NULL || !camel_internet_address_get(cia, 0, NULL, NULL)) - return; - - text = camel_address_format((CamelAddress *)cia); - efh_format_text_header(emf, stream, name, text, flags | EM_FORMAT_HEADER_BOLD); - g_free(text); -} - -static void -efh_format_header(EMFormat *emf, CamelStream *stream, CamelMedium *part, const char *namein, guint32 flags, const char *charset) -{ -#define msg ((CamelMimeMessage *)part) -#define efh ((EMFormatHTML *)emf) - char *name; - - name = alloca(strlen(namein)+1); - strcpy(name, namein); - camel_strdown(name); - - if (!strcmp(name, "from")) - efh_format_address(emf, stream, camel_mime_message_get_from(msg), _("From"), flags); - else if (!strcmp(name, "reply-to")) - efh_format_address(emf, stream, camel_mime_message_get_reply_to(msg), _("Reply-To"), flags); - else if (!strcmp(name, "to")) - efh_format_address(emf, stream, camel_mime_message_get_recipients(msg, CAMEL_RECIPIENT_TYPE_TO), _("To"), flags); - else if (!strcmp(name, "cc")) - efh_format_address(emf, stream, camel_mime_message_get_recipients(msg, CAMEL_RECIPIENT_TYPE_CC), _("Cc"), flags); - else if (!strcmp(name, "bcc")) - efh_format_address(emf, stream, camel_mime_message_get_recipients(msg, CAMEL_RECIPIENT_TYPE_BCC), _("Bcc"), flags); - else { - const char *txt, *label; - char *value = NULL; - - if (!strcmp(name, "subject")) { - txt = camel_mime_message_get_subject(msg); - label = _("Subject"); - flags |= EM_FORMAT_HEADER_BOLD; - } else if (!strcmp(name, "x-evolution-mailer")) { /* pseudo-header */ - txt = camel_medium_get_header(part, "x-mailer"); - if (txt == NULL) - txt = camel_medium_get_header(part, "user-agent"); - if (txt == NULL - || ((efh->xmailer_mask & EM_FORMAT_HTML_XMAILER_OTHER) == 0 - && ((efh->xmailer_mask & EM_FORMAT_HTML_XMAILER_EVOLUTION) == 0 - || strstr(txt, "Evolution") == NULL))) - return; - - label = _("Mailer"); - flags |= EM_FORMAT_HEADER_BOLD; - } else if (!strcmp(name, "date")) { - int msg_offset, local_tz; - time_t msg_date; - struct tm local; - const char *date; - - date = camel_medium_get_header(part, "date"); - if (date == NULL) - return; - - /* Show the local timezone equivalent in brackets if the sender is remote */ - msg_date = camel_header_decode_date (date, &msg_offset); - e_localtime_with_offset(msg_date, &local, &local_tz); - - /* Convert message offset to minutes (e.g. -0400 --> -240) */ - msg_offset = ((msg_offset / 100) * 60) + (msg_offset % 100); - /* Turn into offset from localtime, not UTC */ - msg_offset -= local_tz / 60; - - if (msg_offset) { - char buf[32], *html; - - msg_offset += (local.tm_hour * 60) + local.tm_min; - if (msg_offset >= (24 * 60) || msg_offset < 0) { - /* translators: strftime format for local time equivalent in Date header display, with day */ - e_utf8_strftime(buf, sizeof(buf), _("<I> (%a, %R %Z)</I>"), &local); - } else { - /* translators: strftime format for local time equivalent in Date header display, without day */ - e_utf8_strftime(buf, sizeof(buf), _("<I> (%R %Z)</I>"), &local); - } - - html = camel_text_to_html(date, ((EMFormatHTML *)emf)->text_html_flags, 0); - txt = value = g_strdup_printf("%s %s", html, buf); - g_free(html); - flags |= EM_FORMAT_HTML_HEADER_HTML; - } else { - txt = date; - } - - label = _("Date"); - flags |= EM_FORMAT_HEADER_BOLD; - } else { - txt = camel_medium_get_header(part, name); - value = camel_header_decode_string (txt, charset); - txt = value; - label = namein; - } - - efh_format_text_header(emf, stream, label, txt, flags); - g_free(value); - } -#undef msg -#undef efh -} - -void -em_format_html_format_headers(EMFormatHTML *efh, CamelStream *stream, CamelMedium *part) -{ - EMFormatHeader *h; - const char *charset; - CamelContentType *ct; -#define emf ((EMFormat *)efh) - - ct = camel_mime_part_get_content_type((CamelMimePart *)part); - charset = camel_content_type_param (ct, "charset"); - charset = e_iconv_charset_name(charset); - - if (!efh->simple_headers) - camel_stream_printf(stream, - "<font color=\"#%06x\">\n" - "<table cellpadding=0>\n", - efh->text_colour & 0xffffff); - - /* dump selected headers */ - h = (EMFormatHeader *)emf->header_list.head; - if (h->next == NULL || emf->mode == EM_FORMAT_ALLHEADERS) { - struct _camel_header_raw *header; - - header = ((CamelMimePart *)part)->headers; - while (header) { - efh_format_header(emf, stream, part, header->name, EM_FORMAT_HTML_HEADER_NOCOLUMNS, charset); - header = header->next; - } - } else { - while (h->next) { - efh_format_header(emf, stream, part, h->name, h->flags, charset); - h = h->next; - } - } - - if (!efh->simple_headers) - camel_stream_printf(stream, - "</table>\n</font>\n"); -#undef emf -} - -static void efh_format_message(EMFormat *emf, CamelStream *stream, CamelMedium *part) -{ -#define efh ((EMFormatHTML *)emf) - CamelCipherValidity *save = efh->valid, *save_parent = efh->valid_parent; - - efh->valid = NULL; - efh->valid_parent = NULL; - - if (emf->message != part) - camel_stream_printf(stream, "<blockquote>\n"); - - if (!efh->hide_headers) - em_format_html_format_headers(efh, stream, part); - - camel_stream_printf(stream, "<table height=6><tr><td><a></a></td></tr></table>\n"); - em_format_part(emf, stream, (CamelMimePart *)part); - - if (emf->message != part) - camel_stream_printf(stream, "</blockquote>\n"); - - camel_cipher_validity_free(efh->valid); - - efh->valid = save; - efh->valid_parent = save_parent; -#undef efh -} - -static void efh_format_source(EMFormat *emf, CamelStream *stream, CamelMimePart *part) -{ - CamelStreamFilter *filtered_stream; - CamelMimeFilter *html_filter; - CamelDataWrapper *dw = (CamelDataWrapper *)part; - - filtered_stream = camel_stream_filter_new_with_stream ((CamelStream *) stream); - html_filter = camel_mime_filter_tohtml_new (CAMEL_MIME_FILTER_TOHTML_CONVERT_NL - | CAMEL_MIME_FILTER_TOHTML_CONVERT_SPACES - | CAMEL_MIME_FILTER_TOHTML_ESCAPE_8BIT, 0); - camel_stream_filter_add(filtered_stream, html_filter); - camel_object_unref(html_filter); - - camel_stream_write_string((CamelStream *)stream, EFH_TABLE_OPEN "<tr><td><tt>"); - em_format_format_text(emf, (CamelStream *)filtered_stream, dw); - camel_object_unref(filtered_stream); - - camel_stream_write_string(stream, "</tt></td></tr></table>"); -} - -static void -efh_format_attachment(EMFormat *emf, CamelStream *stream, CamelMimePart *part, const char *mime_type, const EMFormatHandler *handle) -{ - char *text, *html; - - /* we display all inlined attachments only */ - - /* this could probably be cleaned up ... */ - camel_stream_write_string(stream, - "<table border=1 cellspacing=0 cellpadding=0><tr><td>" - "<table width=10 cellspacing=0 cellpadding=0>" - "<tr><td></td></tr></table></td>" - "<td><table width=3 cellspacing=0 cellpadding=0>" - "<tr><td></td></tr></table></td><td><font size=-1>\n"); - - /* output some info about it */ - text = em_format_describe_part(part, mime_type); - html = camel_text_to_html(text, ((EMFormatHTML *)emf)->text_html_flags & CAMEL_MIME_FILTER_TOHTML_CONVERT_URLS, 0); - camel_stream_write_string(stream, html); - g_free(html); - g_free(text); - - camel_stream_write_string(stream, "</font></td></tr><tr></table>"); - - if (handle && em_format_is_inline(emf, part)) - handle->handler(emf, stream, part, handle); -} - -static gboolean -efh_busy(EMFormat *emf) -{ - return (((EMFormatHTML *)emf)->priv->format_id != -1); -} diff --git a/mail/em-format-html.h b/mail/em-format-html.h deleted file mode 100644 index 4a981cd792..0000000000 --- a/mail/em-format-html.h +++ /dev/null @@ -1,158 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Authors: Michael Zucchi <notzed@ximian.com> - * - * Copyright 2003 Ximian, Inc. (www.ximian.com) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA. - * - */ - - -/* - Concrete class for formatting mails to html -*/ - -#ifndef _EM_FORMAT_HTML_H -#define _EM_FORMAT_HTML_H - -#include "em-format.h" - -typedef struct _EMFormatHTML EMFormatHTML; -typedef struct _EMFormatHTMLClass EMFormatHTMLClass; - -#if 0 -struct _EMFormatHTMLHandler { - EFrormatHandler base; -}; -#endif - -struct _GtkHTMLEmbedded; -struct _CamelMimePart; -struct _CamelMedium; -struct _CamelStream; - -/* A HTMLJob will be executed in another thread, in sequence, - It's job is to write to its stream, close it if successful, - then exit */ - -typedef struct _EMFormatHTMLJob EMFormatHTMLJob; - -struct _EMFormatHTMLJob { - struct _EMFormatHTMLJob *next, *prev; - - EMFormatHTML *format; - struct _CamelStream *stream; - - /* We need to track the state of the visibility tree at - the point this uri was generated */ - struct _EMFormatPURITree *puri_level; - struct _CamelURL *base; - - void (*callback)(struct _EMFormatHTMLJob *job, int cancelled); - union { - char *uri; - struct _CamelMedium *msg; - EMFormatPURI *puri; - struct _EMFormatPURITree *puri_level; - void *data; - } u; -}; - -/* Pending object (classid: url) */ -typedef struct _EMFormatHTMLPObject EMFormatHTMLPObject; - -typedef gboolean (*EMFormatHTMLPObjectFunc)(EMFormatHTML *md, struct _GtkHTMLEmbedded *eb, EMFormatHTMLPObject *pobject); - -struct _EMFormatHTMLPObject { - struct _EMFormatHTMLPObject *next, *prev; - - void (*free)(struct _EMFormatHTMLPObject *); - struct _EMFormatHTML *format; - - char *classid; - - EMFormatHTMLPObjectFunc func; - struct _CamelMimePart *part; -}; - -#define EM_FORMAT_HTML_HEADER_NOCOLUMNS (EM_FORMAT_HEADER_LAST) -#define EM_FORMAT_HTML_HEADER_HTML (EM_FORMAT_HEADER_LAST<<1) /* header already in html format */ -#define EM_FORMAT_HTML_HEADER_LAST (EM_FORMAT_HEADER_LAST<<8) - -/* xmailer_mask bits */ -#define EM_FORMAT_HTML_XMAILER_EVOLUTION (1<<0) -#define EM_FORMAT_HTML_XMAILER_OTHER (1<<1) -#define EM_FORMAT_HTML_XMAILER_RUPERT (1<<2) - -struct _EMFormatHTML { - EMFormat format; - - struct _EMFormatHTMLPrivate *priv; - - struct _GtkHTML *html; - - EDList pending_object_list; - - struct _CamelCipherValidity *valid; - struct _CamelCipherValidity *valid_parent; - - GSList *headers; - - guint32 text_html_flags; /* default flags for text to html conversion */ - guint32 body_colour; /* header box colour */ - guint32 text_colour; - guint32 frame_colour; - guint32 content_colour; - guint32 citation_colour; - unsigned int xmailer_mask:4; - unsigned int load_http:1; - unsigned int load_http_now:1; - unsigned int mark_citations:1; - unsigned int simple_headers:1; /* simple header format, no box/table */ - unsigned int hide_headers:1; /* no headers at all */ -}; - -struct _EMFormatHTMLClass { - EMFormatClass format_class; -}; - -GType em_format_html_get_type(void); -EMFormatHTML *em_format_html_new(void); - -void em_format_html_load_http(EMFormatHTML *emf); - -void em_format_html_set_load_http(EMFormatHTML *emf, int state); -void em_format_html_set_mark_citations(EMFormatHTML *emf, int state, guint32 citation_colour); -void em_format_html_set_xmailer_mask(EMFormatHTML *emf, unsigned int xmailer_mask); - -/* output headers */ -void em_format_html_format_headers(EMFormatHTML *efh, struct _CamelStream *stream, struct _CamelMedium *part); - -/* retrieves a pseudo-part icon wrapper for a file */ -struct _CamelMimePart *em_format_html_file_part(EMFormatHTML *efh, const char *mime_type, const char *path, const char *name); - -/* for implementers */ -EMFormatHTMLPObject *em_format_html_add_pobject(EMFormatHTML *efh, size_t size, const char *classid, struct _CamelMimePart *part, EMFormatHTMLPObjectFunc func); -EMFormatHTMLPObject *em_format_html_find_pobject(EMFormatHTML *emf, const char *classid); -EMFormatHTMLPObject *em_format_html_find_pobject_func(EMFormatHTML *emf, struct _CamelMimePart *part, EMFormatHTMLPObjectFunc func); -void em_format_html_remove_pobject(EMFormatHTML *emf, EMFormatHTMLPObject *pobject); -void em_format_html_clear_pobject(EMFormatHTML *emf); - -EMFormatHTMLJob *em_format_html_job_new(EMFormatHTML *emfh, void (*callback)(struct _EMFormatHTMLJob *job, int cancelled), void *data) -; -void em_format_html_job_queue(EMFormatHTML *emfh, struct _EMFormatHTMLJob *job); - -#endif /* ! EM_FORMAT_HTML_H */ diff --git a/mail/em-format-quote.c b/mail/em-format-quote.c deleted file mode 100644 index 1b26ff255e..0000000000 --- a/mail/em-format-quote.c +++ /dev/null @@ -1,289 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Authors: Jeffrey Stedfast <fejj@ximian.com> - * - * Copyright 2003 Ximian, Inc. (www.ximian.com) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA. - * - */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <string.h> - -#include <camel/camel-stream.h> -#include <camel/camel-stream-filter.h> -#include <camel/camel-mime-filter-tohtml.h> -#include <camel/camel-mime-filter-enriched.h> -#include "em-format-quote.h" - -struct _EMFormatQuotePrivate { - int dummy; -}; - -static void emfq_format_clone(EMFormat *, CamelMedium *, EMFormat *); -static void emfq_format_error(EMFormat *emf, CamelStream *stream, const char *txt); -static void emfq_format_message(EMFormat *, CamelStream *, CamelMedium *); -static void emfq_format_source(EMFormat *, CamelStream *, CamelMimePart *); -static void emfq_format_attachment(EMFormat *, CamelStream *, CamelMimePart *, const char *, const EMFormatHandler *); - -static void emfq_builtin_init(EMFormatQuoteClass *efhc); - -static EMFormatClass *emfq_parent; - -static void -emfq_init(GObject *o) -{ - EMFormatQuote *emfq =(EMFormatQuote *) o; - - emfq->priv = g_malloc0(sizeof(*emfq->priv)); - - /* we want to convert url's etc */ - emfq->text_html_flags = CAMEL_MIME_FILTER_TOHTML_PRE | CAMEL_MIME_FILTER_TOHTML_CONVERT_URLS - | CAMEL_MIME_FILTER_TOHTML_CONVERT_ADDRESSES; -} - -static void -emfq_finalise(GObject *o) -{ - EMFormatQuote *emfq =(EMFormatQuote *) o; - - if (emfq->stream) - camel_object_unref(emfq->stream); - g_free(emfq->credits); - g_free(emfq->priv); - - ((GObjectClass *) emfq_parent)->finalize(o); -} - -static void -emfq_base_init(EMFormatQuoteClass *emfqklass) -{ - emfq_builtin_init(emfqklass); -} - -static void -emfq_class_init(GObjectClass *klass) -{ - ((EMFormatClass *) klass)->format_clone = emfq_format_clone; - ((EMFormatClass *) klass)->format_error = emfq_format_error; - ((EMFormatClass *) klass)->format_message = emfq_format_message; - ((EMFormatClass *) klass)->format_source = emfq_format_source; - ((EMFormatClass *) klass)->format_attachment = emfq_format_attachment; - - klass->finalize = emfq_finalise; -} - -GType -em_format_quote_get_type(void) -{ - static GType type = 0; - - if (type == 0) { - static const GTypeInfo info = { - sizeof(EMFormatQuoteClass), - (GBaseInitFunc)emfq_base_init, NULL, - (GClassInitFunc)emfq_class_init, - NULL, NULL, - sizeof(EMFormatQuote), 0, - (GInstanceInitFunc) emfq_init - }; - - emfq_parent = g_type_class_ref(em_format_get_type()); - type = g_type_register_static(em_format_get_type(), "EMFormatQuote", &info, 0); - } - - return type; -} - -EMFormatQuote * -em_format_quote_new(const char *credits, CamelStream *stream, guint32 flags) -{ - EMFormatQuote *emfq; - - emfq = (EMFormatQuote *)g_object_new(em_format_quote_get_type(), NULL); - - emfq->credits = g_strdup(credits); - emfq->stream = stream; - camel_object_ref(stream); - emfq->flags = flags; - - return emfq; -} - -static void -emfq_format_clone(EMFormat *emf, CamelMedium *part, EMFormat *src) -{ -#define emfq ((EMFormatQuote *)emf) - - ((EMFormatClass *)emfq_parent)->format_clone(emf, part, src); - - camel_stream_reset(emfq->stream); - em_format_format_message(emf, emfq->stream, part); - camel_stream_flush(emfq->stream); - - g_signal_emit_by_name(emf, "complete"); -#undef emfq -} - -static void -emfq_format_error(EMFormat *emf, CamelStream *stream, const char *txt) -{ - /* FIXME: should we even bother writign error text for quoting? probably not... */ -} - -static void -emfq_format_message(EMFormat *emf, CamelStream *stream, CamelMedium *part) -{ - EMFormatQuote *emfq =(EMFormatQuote *) emf; - - if (emfq->credits) - camel_stream_printf(stream, "%s", emfq->credits); - - - if (emfq->flags & EM_FORMAT_QUOTE_CITE) - camel_stream_printf(stream, "<!--+GtkHTML:<DATA class=\"ClueFlow\" key=\"orig\" value=\"1\">-->\n" - "<blockquote type=cite>\n" - "<font color=\"#%06x\">\n", - emfq->citation_colour & 0xffffff); - - if (emfq->flags & EM_FORMAT_QUOTE_HEADERS) { - camel_stream_printf(stream, "<b>To: </b> Header goes here<br>"); - } - - em_format_part(emf, stream, (CamelMimePart *)part); - - if (emfq->flags & EM_FORMAT_QUOTE_CITE) - camel_stream_write_string(stream, "</blockquote></font><!--+GtkHTML:<DATA class=\"ClueFlow\" clear=\"orig\">-->"); -} - -static void -emfq_format_source(EMFormat *emf, CamelStream *stream, CamelMimePart *part) -{ - CamelStreamFilter *filtered_stream; - CamelMimeFilter *html_filter; - CamelDataWrapper *dw = (CamelDataWrapper *)part; - - filtered_stream = camel_stream_filter_new_with_stream ((CamelStream *) stream); - html_filter = camel_mime_filter_tohtml_new (CAMEL_MIME_FILTER_TOHTML_CONVERT_NL - | CAMEL_MIME_FILTER_TOHTML_CONVERT_SPACES - | CAMEL_MIME_FILTER_TOHTML_ESCAPE_8BIT, 0); - camel_stream_filter_add(filtered_stream, html_filter); - camel_object_unref(html_filter); - - em_format_format_text(emf, (CamelStream *)filtered_stream, dw); - camel_object_unref(filtered_stream); -} - -static void -emfq_format_attachment(EMFormat *emf, CamelStream *stream, CamelMimePart *part, const char *mime_type, const EMFormatHandler *handle) -{ - ; -} - -#include <camel/camel-medium.h> -#include <camel/camel-mime-part.h> -#include <camel/camel-multipart.h> -#include <camel/camel-url.h> - -static void -emfq_text_plain(EMFormatQuote *emfq, CamelStream *stream, CamelMimePart *part, EMFormatHandler *info) -{ - CamelStreamFilter *filtered_stream; - CamelMimeFilter *html_filter; - CamelContentType *type; - const char *format; - guint32 rgb = 0x737373, flags; - - flags = emfq->text_html_flags; - - /* Check for RFC 2646 flowed text. */ - type = camel_mime_part_get_content_type(part); - if (camel_content_type_is (type, "text", "plain") - && (format = camel_content_type_param (type, "format")) - && !g_ascii_strcasecmp(format, "flowed")) - flags |= CAMEL_MIME_FILTER_TOHTML_FORMAT_FLOWED; - - html_filter = camel_mime_filter_tohtml_new(flags, rgb); - filtered_stream = camel_stream_filter_new_with_stream(stream); - camel_stream_filter_add(filtered_stream, html_filter); - camel_object_unref(html_filter); - - em_format_format_text((EMFormat *)emfq, (CamelStream *)filtered_stream, camel_medium_get_content_object((CamelMedium *)part)); - camel_stream_flush((CamelStream *)filtered_stream); - camel_object_unref(filtered_stream); -} - -static void -emfq_text_enriched(EMFormatQuote *emfq, CamelStream *stream, CamelMimePart *part, EMFormatHandler *info) -{ - CamelStreamFilter *filtered_stream; - CamelMimeFilter *enriched; - CamelDataWrapper *dw; - guint32 flags = 0; - - dw = camel_medium_get_content_object((CamelMedium *)part); - - if (!strcmp(info->mime_type, "text/richtext")) { - flags = CAMEL_MIME_FILTER_ENRICHED_IS_RICHTEXT; - camel_stream_write_string( stream, "\n<!-- text/richtext -->\n"); - } else { - camel_stream_write_string( stream, "\n<!-- text/enriched -->\n"); - } - - enriched = camel_mime_filter_enriched_new(flags); - filtered_stream = camel_stream_filter_new_with_stream (stream); - camel_stream_filter_add(filtered_stream, enriched); - camel_object_unref(enriched); - - camel_stream_write_string(stream, "<br><hr><br>"); - em_format_format_text((EMFormat *)emfq, (CamelStream *)filtered_stream, dw); - camel_object_unref(filtered_stream); -} - -static void -emfq_text_html(EMFormat *emf, CamelStream *stream, CamelMimePart *part, EMFormatHandler *info) -{ - camel_stream_write_string(stream, "\n<!-- text/html -->\n"); - em_format_format_text(emf, stream, camel_medium_get_content_object((CamelMedium *)part)); -} - -static const char *type_remove_table[] = { - "message/external-body", - "multipart/appledouble", -}; - -static EMFormatHandler type_builtin_table[] = { - { "text/plain",(EMFormatFunc)emfq_text_plain }, - { "text/enriched",(EMFormatFunc)emfq_text_enriched }, - { "text/richtext",(EMFormatFunc)emfq_text_enriched }, - { "text/html",(EMFormatFunc)emfq_text_html }, -/* { "multipart/related",(EMFormatFunc)emfq_multipart_related },*/ -}; - -static void -emfq_builtin_init(EMFormatQuoteClass *efhc) -{ - int i; - - for (i = 0; i < sizeof(type_remove_table) / sizeof(type_remove_table[0]); i++) - em_format_class_remove_handler((EMFormatClass *) efhc, type_remove_table[i]); - - for (i=0;i<sizeof(type_builtin_table)/sizeof(type_builtin_table[0]);i++) - em_format_class_add_handler((EMFormatClass *)efhc, &type_builtin_table[i]); -} diff --git a/mail/em-format-quote.h b/mail/em-format-quote.h deleted file mode 100644 index 218937b935..0000000000 --- a/mail/em-format-quote.h +++ /dev/null @@ -1,56 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Authors: Jeffrey Stedfast <fejj@ximian.com> - * - * Copyright 2003 Ximian, Inc. (www.ximian.com) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA. - * - */ - - -#ifndef _EM_FORMAT_QUOTE_H -#define _EM_FORMAT_QUOTE_H - -#include "em-format.h" - -typedef struct _EMFormatQuote EMFormatQuote; -typedef struct _EMFormatQuoteClass EMFormatQuoteClass; - -#define EM_FORMAT_QUOTE_CITE (1<<0) -#define EM_FORMAT_QUOTE_HEADERS (1<<1) - -struct _EMFormatQuote { - EMFormat format; - - struct _EMFormatQuotePrivate *priv; - - char *credits; - struct _CamelStream *stream; - guint32 flags; - - guint32 text_html_flags; - guint32 citation_colour; -}; - -struct _EMFormatQuoteClass { - EMFormatClass format_class; -}; - -GType em_format_quote_get_type(void); - -EMFormatQuote *em_format_quote_new(const char *, struct _CamelStream *, guint32 flags); - -#endif /* !_EM_FORMAT_QUOTE_H */ diff --git a/mail/em-format.c b/mail/em-format.c deleted file mode 100644 index 2642b5becd..0000000000 --- a/mail/em-format.c +++ /dev/null @@ -1,1255 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Authors: Michael Zucchi <notzed@ximian.com> - * Jeffrey Stedfast <fejj@ximian.com> - * - * Copyright 2003 Ximian, Inc. (www.ximian.com) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA. - * - */ - - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <stdio.h> -#include <string.h> - -#include <libgnomevfs/gnome-vfs-mime.h> -#include <libgnomevfs/gnome-vfs-mime-utils.h> -#include <libgnomevfs/gnome-vfs-mime-handlers.h> - -#include <e-util/e-msgport.h> -#include <camel/camel-url.h> -#include <camel/camel-stream.h> -#include <camel/camel-stream-mem.h> -#include <camel/camel-multipart.h> -#include <camel/camel-multipart-encrypted.h> -#include <camel/camel-multipart-signed.h> -#include <camel/camel-medium.h> -#include <camel/camel-mime-message.h> -#include <camel/camel-gpg-context.h> -#include <camel/camel-smime-context.h> -#include <camel/camel-string-utils.h> -#include <camel/camel-stream-filter.h> -#include <camel/camel-stream-null.h> -#include <camel/camel-mime-filter-charset.h> -#include <camel/camel-mime-filter-windows.h> - -#include "em-format.h" - -#define d(x) - -static void emf_builtin_init(EMFormatClass *); -static const char *emf_snoop_part(CamelMimePart *part); - -static void emf_format_clone(EMFormat *emf, CamelMedium *msg, EMFormat *emfsource); -static gboolean emf_busy(EMFormat *emf); - -enum { - EMF_COMPLETE, - EMF_LAST_SIGNAL, -}; - -static guint emf_signals[EMF_LAST_SIGNAL]; -static GObjectClass *emf_parent; - -static void -emf_init(GObject *o) -{ - EMFormat *emf = (EMFormat *)o; - - emf->inline_table = g_hash_table_new(NULL, NULL); - e_dlist_init(&emf->header_list); - em_format_default_headers(emf); -} - -static void -emf_finalise(GObject *o) -{ - EMFormat *emf = (EMFormat *)o; - - if (emf->session) - camel_object_unref(emf->session); - - if (emf->inline_table) - g_hash_table_destroy(emf->inline_table); - - em_format_clear_headers(emf); - g_free(emf->charset); - - /* FIXME: check pending jobs */ - - ((GObjectClass *)emf_parent)->finalize(o); -} - -static void -emf_base_init(EMFormatClass *emfklass) -{ - emfklass->type_handlers = g_hash_table_new(g_str_hash, g_str_equal); - emf_builtin_init(emfklass); -} - -static void -emf_class_init(GObjectClass *klass) -{ - ((EMFormatClass *)klass)->type_handlers = g_hash_table_new(g_str_hash, g_str_equal); - emf_builtin_init((EMFormatClass *)klass); - - klass->finalize = emf_finalise; - ((EMFormatClass *)klass)->format_clone = emf_format_clone; - ((EMFormatClass *)klass)->busy = emf_busy; - - emf_signals[EMF_COMPLETE] = - g_signal_new("complete", - G_OBJECT_CLASS_TYPE (klass), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (EMFormatClass, complete), - NULL, NULL, - g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, 0); -} - -GType -em_format_get_type(void) -{ - static GType type = 0; - - if (type == 0) { - static const GTypeInfo info = { - sizeof(EMFormatClass), - (GBaseInitFunc)emf_base_init, NULL, - (GClassInitFunc)emf_class_init, - NULL, NULL, - sizeof(EMFormat), 0, - (GInstanceInitFunc)emf_init - }; - emf_parent = g_type_class_ref(G_TYPE_OBJECT); - type = g_type_register_static(G_TYPE_OBJECT, "EMFormat", &info, 0); - } - - return type; -} - -/** - * em_format_class_add_handler: - * @emfc: EMFormatClass - * @info: Callback information. - * - * Add a mime type handler to this class. This is only used by implementing - * classes. - * - * When a mime type described by @info is encountered, the callback will - * be invoked. Note that @info may be extended by sub-classes if - * they require additional context information. - * - * Use a mime type of "foo/ *" to insert a fallback handler for type "foo". - **/ -void -em_format_class_add_handler(EMFormatClass *emfc, EMFormatHandler *info) -{ - g_hash_table_insert(emfc->type_handlers, info->mime_type, info); - /* FIXME: do we care? This is really gui stuff */ - /* - if (info->applications == NULL) - info->applications = gnome_vfs_mime_get_short_list_applications(info->mime_type);*/ -} - - -/** - * em_format_class_remove_handler: - * @emfc: EMFormatClass - * @mime_type: mime-type of handler to remove - * - * Remove a mime type handler from this class. This is only used by - * implementing classes. - **/ -void -em_format_class_remove_handler (EMFormatClass *emfc, const char *mime_type) -{ - g_hash_table_remove (emfc->type_handlers, mime_type); -} - - -/** - * em_format_find_handler: - * @emf: - * @mime_type: - * - * Find a format handler by @mime_type. - * - * Return value: NULL if no handler is available. - **/ -const EMFormatHandler * -em_format_find_handler(EMFormat *emf, const char *mime_type) -{ - EMFormatClass *emfc = (EMFormatClass *)G_OBJECT_GET_CLASS(emf); - - return g_hash_table_lookup(emfc->type_handlers, mime_type); -} - -/** - * em_format_fallback_handler: - * @emf: - * @mime_type: - * - * Try to find a format handler based on the major type of the @mime_type. - * - * The subtype is replaced with "*" and a lookup performed. - * - * Return value: - **/ -const EMFormatHandler * -em_format_fallback_handler(EMFormat *emf, const char *mime_type) -{ - char *mime, *s; - - s = strchr(mime_type, '/'); - if (s == NULL) - mime = (char *)mime_type; - else { - size_t len = (s-mime_type)+1; - - mime = alloca(len+2); - strncpy(mime, mime_type, len); - strcpy(mime+len, "*"); - } - - return em_format_find_handler(emf, mime); -} - -/** - * em_format_add_puri: - * @emf: - * @size: - * @cid: Override the autogenerated content id. - * @part: - * @func: - * - * Add a pending-uri handler. When formatting parts that reference - * other parts, a pending-uri (PURI) can be used to track the reference. - * - * @size is used to allocate the structure, so that it can be directly - * subclassed by implementors. - * - * @cid can be used to override the key used to retreive the PURI, if NULL, - * then the content-location and the content-id of the @part are stored - * as lookup keys for the part. - * - * FIXME: This may need a free callback. - * - * Return value: A new PURI, with a referenced copy of @part, and the cid - * always set. The uri will be set if one is available. Clashes - * are resolved by forgetting the old PURI in the global index. - **/ -EMFormatPURI * -em_format_add_puri(EMFormat *emf, size_t size, const char *cid, CamelMimePart *part, EMFormatPURIFunc func) -{ - EMFormatPURI *puri; - const char *tmp; - static unsigned int uriid; - - g_assert(size >= sizeof(*puri)); - puri = g_malloc0(size); - - puri->format = emf; - puri->func = func; - puri->use_count = 0; - puri->cid = g_strdup(cid); - - if (part) { - camel_object_ref(part); - puri->part = part; - } - - if (part != NULL && cid == NULL) { - tmp = camel_mime_part_get_content_id(part); - if (tmp) - puri->cid = g_strdup_printf("cid:%s", tmp); - else - puri->cid = g_strdup_printf("em-no-cid-%u", uriid++); - - d(printf("built cid '%s'\n", puri->cid)); - - /* not quite same as old behaviour, it also put in the relative uri and a fallback for no parent uri */ - tmp = camel_mime_part_get_content_location(part); - puri->uri = NULL; - if (tmp == NULL) { - if (emf->base) - puri->uri = camel_url_to_string(emf->base, 0); - } else { - if (strchr(tmp, ':') == NULL && emf->base != NULL) { - CamelURL *uri; - - uri = camel_url_new_with_base(emf->base, tmp); - puri->uri = camel_url_to_string(uri, 0); - camel_url_free(uri); - } else { - puri->uri = g_strdup(tmp); - } - } - } - - g_assert(puri->cid != NULL); - g_assert(emf->pending_uri_level != NULL); - g_assert(emf->pending_uri_table != NULL); - - e_dlist_addtail(&emf->pending_uri_level->uri_list, (EDListNode *)puri); - - if (puri->uri) - g_hash_table_insert(emf->pending_uri_table, puri->uri, puri); - g_hash_table_insert(emf->pending_uri_table, puri->cid, puri); - - return puri; -} - -/** - * em_format_push_level: - * @emf: - * - * This is used to build a heirarchy of visible PURI objects based on - * the structure of the message. Used by multipart/alternative formatter. - * - * FIXME: This could probably also take a uri so it can automaticall update - * the base location. - **/ -void -em_format_push_level(EMFormat *emf) -{ - struct _EMFormatPURITree *purilist; - - d(printf("em_format_push_level\n")); - purilist = g_malloc0(sizeof(*purilist)); - e_dlist_init(&purilist->children); - e_dlist_init(&purilist->uri_list); - purilist->parent = emf->pending_uri_level; - if (emf->pending_uri_tree == NULL) { - emf->pending_uri_tree = purilist; - } else { - e_dlist_addtail(&emf->pending_uri_level->children, (EDListNode *)purilist); - } - emf->pending_uri_level = purilist; -} - -/** - * em_format_pull_level: - * @emf: - * - * Drop a level of visibility back to the parent. Note that - * no PURI values are actually freed. - **/ -void -em_format_pull_level(EMFormat *emf) -{ - d(printf("em_format_pull_level\n")); - emf->pending_uri_level = emf->pending_uri_level->parent; -} - -/** - * em_format_find_visible_puri: - * @emf: - * @uri: - * - * Search for a PURI based on the visibility defined by :push_level() - * and :pull_level(). - * - * Return value: - **/ -EMFormatPURI * -em_format_find_visible_puri(EMFormat *emf, const char *uri) -{ - EMFormatPURI *pw; - struct _EMFormatPURITree *ptree; - - d(printf("checking for visible uri '%s'\n", uri)); - - ptree = emf->pending_uri_level; - while (ptree) { - pw = (EMFormatPURI *)ptree->uri_list.head; - while (pw->next) { - d(printf(" pw->uri = '%s' pw->cid = '%s\n", pw->uri?pw->uri:"", pw->cid)); - if ((pw->uri && !strcmp(pw->uri, uri)) || !strcmp(pw->cid, uri)) - return pw; - pw = pw->next; - } - ptree = ptree->parent; - } - - return NULL; -} - -/** - * em_format_find_puri: - * @emf: - * @uri: - * - * Search for a PURI based on a uri. Both the content-id - * and content-location are checked. - * - * Return value: - **/ -EMFormatPURI * -em_format_find_puri(EMFormat *emf, const char *uri) -{ - return g_hash_table_lookup(emf->pending_uri_table, uri); -} - -static void -emf_clear_puri_node(struct _EMFormatPURITree *node) -{ - { - EMFormatPURI *pw, *pn; - - /* clear puri's at this level */ - pw = (EMFormatPURI *)node->uri_list.head; - pn = pw->next; - while (pn) { - g_free(pw->uri); - g_free(pw->cid); - if (pw->part) - camel_object_unref(pw->part); - g_free(pw); - pw = pn; - pn = pn->next; - } - } - - { - struct _EMFormatPURITree *cw, *cn; - - /* clear child nodes */ - cw = (struct _EMFormatPURITree *)node->children.head; - cn = cw->next; - while (cn) { - emf_clear_puri_node(cw); - cw = cn; - cn = cn->next; - } - } - - g_free(node); -} - -/** - * em_format_clear_puri_tree: - * @emf: - * - * For use by implementors to clear out the message structure - * data. - **/ -void -em_format_clear_puri_tree(EMFormat *emf) -{ - d(printf("clearing pending uri's\n")); - - if (emf->pending_uri_table) { - g_hash_table_destroy(emf->pending_uri_table); - emf_clear_puri_node(emf->pending_uri_tree); - emf->pending_uri_level = NULL; - emf->pending_uri_tree = NULL; - } - emf->pending_uri_table = g_hash_table_new(g_str_hash, g_str_equal); - em_format_push_level(emf); -} - -/* use mime_type == NULL to force showing as application/octet-stream */ -void -em_format_part_as(EMFormat *emf, CamelStream *stream, CamelMimePart *part, const char *mime_type) -{ - const EMFormatHandler *handle = NULL; - - if (mime_type != NULL) { - if (g_ascii_strcasecmp(mime_type, "application/octet-stream") == 0) - mime_type = emf_snoop_part(part); - - handle = em_format_find_handler(emf, mime_type); - if (handle == NULL) - handle = em_format_fallback_handler(emf, mime_type); - - if (handle != NULL - && !em_format_is_attachment(emf, part)) { - d(printf("running handler for type '%s'\n", mime_type)); - handle->handler(emf, stream, part, handle); - return; - } - d(printf("this type is an attachment? '%s'\n", mime_type)); - } else { - mime_type = "application/octet-stream"; - } - - ((EMFormatClass *)G_OBJECT_GET_CLASS(emf))->format_attachment(emf, stream, part, mime_type, handle); -} - -void -em_format_part(EMFormat *emf, CamelStream *stream, CamelMimePart *part) -{ - char *mime_type; - CamelDataWrapper *dw; - - dw = camel_medium_get_content_object((CamelMedium *)part); - mime_type = camel_data_wrapper_get_mime_type(dw); - camel_strdown(mime_type); - em_format_part_as(emf, stream, part, mime_type); - g_free(mime_type); -} - -static void -emf_clone_inlines(void *key, void *val, void *data) -{ - g_hash_table_insert(((EMFormat *)data)->inline_table, key, val); -} - -static void -emf_format_clone(EMFormat *emf, CamelMedium *msg, EMFormat *emfsource) -{ - em_format_clear_puri_tree(emf); - - if (emf != emfsource) { - g_hash_table_destroy(emf->inline_table); - emf->inline_table = g_hash_table_new(NULL, NULL); - if (emfsource) { - /* We clone the current state here */ - g_hash_table_foreach(emfsource->inline_table, emf_clone_inlines, emf); - emf->mode = emfsource->mode; - g_free(emf->charset); - emf->charset = g_strdup(emfsource->charset); - /* FIXME: clone headers shown */ - } - } - - if (msg != emf->message) { - if (emf->message) - camel_object_unref(emf->message); - if (msg) - camel_object_ref(msg); - emf->message = msg; - } -} - -static gboolean -emf_busy(EMFormat *emf) -{ - return FALSE; -} - -/** - * em_format_format_clone: - * @emf: Mail formatter. - * @msg: Mail message. - * @emfsource: Used as a basis for user-altered layout, e.g. inline viewed - * attachments. - * - * Format a message @msg. If @emfsource is non NULL, then the status of - * inlined expansion and so forth is copied direction from @emfsource. - * - * By passing the same value for @emf and @emfsource, you can perform - * a display refresh, or it can be used to generate an identical layout, - * e.g. to print what the user has shown inline. - **/ -/* e_format_format_clone is a macro */ - -/** - * em_format_set_session: - * @emf: - * @s: - * - * Set the CamelSession to be used for signature verification and decryption - * purposes. If this is not set, then signatures cannot be verified or - * encrypted messages viewed. - **/ -void -em_format_set_session(EMFormat *emf, struct _CamelSession *s) -{ - if (s) - camel_object_ref(s); - if (emf->session) - camel_object_unref(emf->session); - emf->session = s; -} - -/** - * em_format_set_mode: - * @emf: - * @type: - * - * Set display mode, EM_FORMAT_SOURCE, EM_FORMAT_ALLHEADERS, or - * EM_FORMAT_NORMAL. - **/ -void -em_format_set_mode(EMFormat *emf, em_format_mode_t type) -{ - if (emf->mode == type) - return; - - emf->mode = type; - - /* force redraw if type changed afterwards */ - if (emf->message) - em_format_format_clone(emf, emf->message, emf); -} - -/** - * em_format_set_charset: - * @emf: - * @charset: - * - * set override charset on formatter. message will be redisplayed if - * required. - **/ -void -em_format_set_charset(EMFormat *emf, const char *charset) -{ - if ((emf->charset && charset && g_ascii_strcasecmp(emf->charset, charset) == 0) - || (emf->charset == NULL && charset == NULL) - || (emf->charset == charset)) - return; - - g_free(emf->charset); - emf->charset = g_strdup(charset); - - if (emf->message) - em_format_format_clone(emf, emf->message, emf); -} - - -/** - * em_format_set_default_charset: - * @emf: - * @charset: - * - * Set the fallback, default system charset to use when no other charsets - * are present. Message will be redisplayed if required (and sometimes redisplayed - * when it isn't). - **/ -void -em_format_set_default_charset(EMFormat *emf, const char *charset) -{ - if ((emf->default_charset && charset && g_ascii_strcasecmp(emf->default_charset, charset) == 0) - || (emf->default_charset == NULL && charset == NULL) - || (emf->default_charset == charset)) - return; - - g_free(emf->default_charset); - emf->default_charset = g_strdup(charset); - - if (emf->message && emf->charset == NULL) - em_format_format_clone(emf, emf->message, emf); -} - -/** - * em_format_clear_headers: - * @emf: - * - * Clear the list of headers to be displayed. This will force all headers to - * be shown. - **/ -void -em_format_clear_headers(EMFormat *emf) -{ - EMFormatHeader *eh; - - while ((eh = (EMFormatHeader *)e_dlist_remhead(&emf->header_list))) - g_free(eh); -} - -static const struct { - const char *name; - guint32 flags; -} default_headers[] = { - { N_("From"), EM_FORMAT_HEADER_BOLD }, - { N_("Reply-To"), EM_FORMAT_HEADER_BOLD }, - { N_("To"), EM_FORMAT_HEADER_BOLD }, - { N_("Cc"), EM_FORMAT_HEADER_BOLD }, - { N_("Bcc"), EM_FORMAT_HEADER_BOLD }, - { N_("Subject"), EM_FORMAT_HEADER_BOLD }, - { N_("Date"), EM_FORMAT_HEADER_BOLD }, - { "x-evolution-mailer", 0 }, /* DO NOT translate */ -}; - -/** - * em_format_default_headers: - * @emf: - * - * Set the headers to show to the default list. - * - * From, Reply-To, To, Cc, Bcc, Subject and Date. - **/ -void -em_format_default_headers(EMFormat *emf) -{ - int i; - - em_format_clear_headers(emf); - for (i=0;i<sizeof(default_headers)/sizeof(default_headers[0]);i++) - em_format_add_header(emf, default_headers[i].name, default_headers[i].flags); -} - -/** - * em_format_add_header: - * @emf: - * @name: The name of the header, as it will appear during output. - * @flags: EM_FORMAT_HEAD_* defines to control display attributes. - * - * Add a specific header to show. If any headers are set, they will - * be displayed in the order set by this function. Certain known - * headers included in this list will be shown using special - * formatting routines. - **/ -void em_format_add_header(EMFormat *emf, const char *name, guint32 flags) -{ - EMFormatHeader *h; - - h = g_malloc(sizeof(*h) + strlen(name)); - h->flags = flags; - strcpy(h->name, name); - e_dlist_addtail(&emf->header_list, (EDListNode *)h); -} - -/** - * em_format_is_attachment: - * @emf: - * @part: Part to check. - * - * Returns true if the part is an attachment. - * - * A part is not considered an attachment if it is a - * multipart, or a text part with no filename. It is used - * to determine if an attachment header should be displayed for - * the part. - * - * Content-Disposition is not checked. - * - * Return value: TRUE/FALSE - **/ -int em_format_is_attachment(EMFormat *emf, CamelMimePart *part) -{ - /*CamelContentType *ct = camel_mime_part_get_content_type(part);*/ - CamelDataWrapper *dw = camel_medium_get_content_object((CamelMedium *)part); - - /*printf("checking is attachment %s/%s\n", ct->type, ct->subtype);*/ - return !(camel_content_type_is (dw->mime_type, "multipart", "*") - || camel_content_type_is(dw->mime_type, "application", "x-pkcs7-mime") - || (camel_content_type_is (dw->mime_type, "text", "*") - && camel_mime_part_get_filename(part) == NULL)); -} - -/** - * em_format_is_inline: - * @emf: - * @part: - * - * Returns true if the part should be displayed inline. Any part with - * a Content-Disposition of inline, or any message type is displayed - * inline. - * - * ::set_inline() called on the same part will override any calculated - * value. - * - * Return value: - **/ -int em_format_is_inline(EMFormat *emf, CamelMimePart *part) -{ - void *dummy, *override; - const char *tmp; - CamelContentType *ct; - - if (g_hash_table_lookup_extended(emf->inline_table, part, &dummy, &override)) - return GPOINTER_TO_INT(override); - - ct = camel_mime_part_get_content_type(part); - - /* TODO: make this depend on libnss supported */ - /* For some reason rfc2633 says we always add this as an attachment, which - stuffs us up since we don't want to treat it that way at all ... */ - if (camel_content_type_is(ct, "application", "x-pkcs7-mime")) - return TRUE; - - tmp = camel_mime_part_get_disposition(part); - if (tmp) - return g_ascii_strcasecmp(tmp, "inline") == 0; - - /* messages are always inline? */ - return camel_content_type_is (ct, "message", "*"); -} - -/** - * em_format_set_inline: - * @emf: - * @part: - * @state: - * - * Force the attachment @part to be expanded or hidden explictly to match - * @state. This is used only to record the change for a redraw or - * cloned layout render and does not force a redraw. - **/ -void em_format_set_inline(EMFormat *emf, CamelMimePart *part, int state) -{ - g_hash_table_insert(emf->inline_table, part, GINT_TO_POINTER(state)); -} - -/* should this be virtual? */ -void -em_format_format_content(EMFormat *emf, CamelStream *stream, CamelMimePart *part) -{ - CamelDataWrapper *dw = camel_medium_get_content_object((CamelMedium *)part); - - if (camel_content_type_is (dw->mime_type, "text", "*")) - em_format_format_text(emf, stream, dw); - else - camel_data_wrapper_decode_to_stream(dw, stream); -} - -/** - * em_format_format_content: - * @emf: - * @stream: Where to write the converted text - * @part: Part whose container is to be formatted - * - * Decode/output a part's content to @stream. - **/ -void -em_format_format_text(EMFormat *emf, CamelStream *stream, CamelDataWrapper *dw) -{ - CamelStreamFilter *filter_stream; - CamelMimeFilterCharset *filter; - const char *charset = NULL; - - if (emf->charset) { - charset = emf->charset; - } else if (dw->mime_type - && (charset = camel_content_type_param (dw->mime_type, "charset")) - && g_ascii_strncasecmp(charset, "iso-8859-", 9) == 0) { - CamelMimeFilterWindows *windows; - CamelStream *null; - - /* Since a few Windows mailers like to claim they sent - * out iso-8859-# encoded text when they really sent - * out windows-cp125#, do some simple sanity checking - * before we move on... */ - - null = camel_stream_null_new(); - filter_stream = camel_stream_filter_new_with_stream(null); - camel_object_unref(null); - - windows = (CamelMimeFilterWindows *)camel_mime_filter_windows_new(charset); - camel_stream_filter_add(filter_stream, (CamelMimeFilter *)windows); - - camel_data_wrapper_decode_to_stream(dw, (CamelStream *)filter_stream); - camel_stream_flush((CamelStream *)filter_stream); - camel_object_unref(filter_stream); - - charset = camel_mime_filter_windows_real_charset (windows); - camel_object_unref(windows); - } else if (charset == NULL) { - charset = emf->default_charset; - } - - filter_stream = camel_stream_filter_new_with_stream(stream); - - if ((filter = camel_mime_filter_charset_new_convert(charset, "UTF-8"))) { - camel_stream_filter_add(filter_stream, (CamelMimeFilter *) filter); - camel_object_unref(filter); - } - - camel_data_wrapper_decode_to_stream(dw, (CamelStream *)filter_stream); - camel_stream_flush((CamelStream *)filter_stream); - camel_object_unref(filter_stream); -} - -/** - * em_format_describe_part: - * @part: - * @mimetype: - * - * Generate a simple textual description of a part, @mime_type represents the - * the content. - * - * Return value: - **/ -char * -em_format_describe_part(CamelMimePart *part, const char *mime_type) -{ - GString *stext; - const char *text; - char *out; - - stext = g_string_new(""); - text = gnome_vfs_mime_get_description(mime_type); - g_string_append_printf(stext, _("%s attachment"), text?text:mime_type); - if ((text = camel_mime_part_get_filename (part))) - g_string_append_printf(stext, " (%s)", text); - if ((text = camel_mime_part_get_description(part))) - g_string_append_printf(stext, ", \"%s\"", text); - - out = stext->str; - g_string_free(stext, FALSE); - - return out; -} - -/* ********************************************************************** */ - -/* originally from mail-identify.c */ -static const char * -emf_snoop_part(CamelMimePart *part) -{ - const char *filename, *name_type = NULL, *magic_type = NULL; - CamelDataWrapper *dw; - - filename = camel_mime_part_get_filename (part); - if (filename) { - /* GNOME-VFS will misidentify TNEF attachments as MPEG */ - if (!strcmp (filename, "winmail.dat")) - return "application/vnd.ms-tnef"; - - name_type = gnome_vfs_mime_type_from_name(filename); - } - - dw = camel_medium_get_content_object((CamelMedium *)part); - if (!camel_data_wrapper_is_offline(dw)) { - CamelStreamMem *mem = (CamelStreamMem *)camel_stream_mem_new(); - - if (camel_data_wrapper_decode_to_stream(dw, (CamelStream *)mem) > 0) - magic_type = gnome_vfs_get_mime_type_for_data(mem->buffer->data, mem->buffer->len); - camel_object_unref(mem); - } - - d(printf("snooped part, magic_type '%s' name_type '%s'\n", magic_type, name_type)); - - /* If GNOME-VFS doesn't recognize the data by magic, but it - * contains English words, it will call it text/plain. If the - * filename-based check came up with something different, use - * that instead and if it returns "application/octet-stream" - * try to do better with the filename check. - */ - - if (magic_type) { - if (name_type - && (!strcmp(magic_type, "text/plain") - || !strcmp(magic_type, "application/octet-stream"))) - return name_type; - else - return magic_type; - } else - return name_type; - - /* We used to load parts to check their type, we dont anymore, - see bug #11778 for some discussion */ -} - -/* RFC 1740 */ -static void -emf_multipart_appledouble(EMFormat *emf, CamelStream *stream, CamelMimePart *part, const EMFormatHandler *info) -{ - CamelMultipart *mp = (CamelMultipart *)camel_medium_get_content_object((CamelMedium *)part); - - if (!CAMEL_IS_MULTIPART(mp)) { - em_format_format_source(emf, stream, part); - return; - } - - /* try the data fork for something useful, doubtful but who knows */ - em_format_part(emf, stream, camel_multipart_get_part(mp, 1)); -} - -/* RFC ??? */ -static void -emf_multipart_mixed(EMFormat *emf, CamelStream *stream, CamelMimePart *part, const EMFormatHandler *info) -{ - CamelMultipart *mp = (CamelMultipart *)camel_medium_get_content_object((CamelMedium *)part); - int i, nparts; - - if (!CAMEL_IS_MULTIPART(mp)) { - em_format_format_source(emf, stream, part); - return; - } - - nparts = camel_multipart_get_number(mp); - for (i = 0; i < nparts; i++) { - part = camel_multipart_get_part(mp, i); - em_format_part(emf, stream, part); - } -} - -/* RFC 1740 */ -static void -emf_multipart_alternative(EMFormat *emf, CamelStream *stream, CamelMimePart *part, const EMFormatHandler *info) -{ - CamelMultipart *mp = (CamelMultipart *)camel_medium_get_content_object((CamelMedium *)part); - int i, nparts; - CamelMimePart *best = NULL; - - if (!CAMEL_IS_MULTIPART(mp)) { - em_format_format_source(emf, stream, part); - return; - } - - /* as per rfc, find the last part we know how to display */ - nparts = camel_multipart_get_number(mp); - for (i = 0; i < nparts; i++) { - CamelMimePart *part = camel_multipart_get_part(mp, i); - CamelContentType *type = camel_mime_part_get_content_type (part); - char *mime_type = camel_content_type_simple (type); - - camel_strdown (mime_type); - - /*if (want_plain && !strcmp (mime_type, "text/plain")) - return part;*/ - - if (em_format_find_handler(emf, mime_type) - || (best == NULL && em_format_fallback_handler(emf, mime_type))) - best = part; - - g_free(mime_type); - } - - if (best) - em_format_part(emf, stream, best); - else - emf_multipart_mixed(emf, stream, part, info); -} - -static void -emf_multipart_encrypted(EMFormat *emf, CamelStream *stream, CamelMimePart *part, const EMFormatHandler *info) -{ - CamelMultipartEncrypted *mpe; - CamelMimePart *mime_part; - CamelCipherContext *cipher; - CamelException ex; - const char *protocol; - - /* Currently we only handle RFC2015-style PGP encryption. */ - protocol = camel_content_type_param (((CamelDataWrapper *) part)->mime_type, "protocol"); - if (!protocol || strcmp (protocol, "application/pgp-encrypted") != 0) - return emf_multipart_mixed(emf, stream, part, info); - - mpe = (CamelMultipartEncrypted *)camel_medium_get_content_object((CamelMedium *)part); - - if (!CAMEL_IS_MULTIPART_ENCRYPTED(mpe)) { - em_format_format_source(emf, stream, part); - return; - } - - camel_exception_init (&ex); - cipher = camel_gpg_context_new(emf->session); - mime_part = camel_multipart_encrypted_decrypt(mpe, cipher, &ex); - camel_object_unref(cipher); - - if (camel_exception_is_set(&ex)) { - /* FIXME: error handler */ - em_format_format_error(emf, stream, camel_exception_get_description(&ex)); - camel_exception_clear(&ex); - return; - } - - em_format_part(emf, stream, mime_part); - camel_object_unref(mime_part); -} - -static void -emf_write_related(EMFormat *emf, CamelStream *stream, EMFormatPURI *puri) -{ - em_format_format_content(emf, stream, puri->part); - camel_stream_close(stream); -} - -/* RFC 2387 */ -static void -emf_multipart_related(EMFormat *emf, CamelStream *stream, CamelMimePart *part, const EMFormatHandler *info) -{ - CamelMultipart *mp = (CamelMultipart *)camel_medium_get_content_object((CamelMedium *)part); - CamelMimePart *body_part, *display_part = NULL; - CamelContentType *content_type; - const char *location, *start; - int i, nparts; - CamelURL *base_save = NULL; - struct _EMFormatPURITree *ptree; - EMFormatPURI *puri, *purin; - - if (!CAMEL_IS_MULTIPART(mp)) { - em_format_format_source(emf, stream, part); - return; - } - - /* FIXME: put this stuff in a shared function */ - nparts = camel_multipart_get_number(mp); - content_type = camel_mime_part_get_content_type(part); - start = camel_content_type_param (content_type, "start"); - if (start && strlen(start)>2) { - int len; - const char *cid; - - /* strip <>'s */ - len = strlen (start) - 2; - start++; - - for (i=0; i<nparts; i++) { - body_part = camel_multipart_get_part(mp, i); - cid = camel_mime_part_get_content_id(body_part); - - if (cid && !strncmp(cid, start, len) && strlen(cid) == len) { - display_part = body_part; - break; - } - } - } else { - display_part = camel_multipart_get_part(mp, 0); - } - - if (display_part == NULL) { - emf_multipart_mixed(emf, stream, part, info); - return; - } - - /* stack of present location and pending uri's */ - location = camel_mime_part_get_content_location(part); - if (location) { - d(printf("setting content location %s\n", location)); - base_save = emf->base; - emf->base = camel_url_new(location, NULL); - } - em_format_push_level(emf); - - /* queue up the parts for possible inclusion */ - for (i = 0; i < nparts; i++) { - body_part = camel_multipart_get_part(mp, i); - if (body_part != display_part) { - puri = em_format_add_puri(emf, sizeof(EMFormatPURI), NULL, body_part, emf_write_related); - d(printf(" part '%s' '%s' added\n", puri->uri?puri->uri:"", puri->cid)); - } - } - - em_format_part(emf, stream, display_part); - camel_stream_flush(stream); - - ptree = emf->pending_uri_level; - puri = (EMFormatPURI *)ptree->uri_list.head; - purin = puri->next; - while (purin) { - if (purin->use_count == 0) { - d(printf("part '%s' '%s' used '%d'\n", purin->uri?purin->uri:"", purin->cid, purin->use_count)); - if (purin->func == emf_write_related) - em_format_part(emf, stream, puri->part); - else - printf("unreferenced uri generated by format code: %s\n", purin->uri?purin->uri:purin->cid); - } - puri = purin; - purin = purin->next; - } - em_format_pull_level(emf); - - if (location) { - camel_url_free(emf->base); - emf->base = base_save; - } -} - -/* this is only a fallback implementation, implementations should override */ -static void -emf_multipart_signed(EMFormat *emf, CamelStream *stream, CamelMimePart *part, const EMFormatHandler *info) -{ - CamelMimePart *cpart; - CamelMultipartSigned *mps; - CamelCipherValidity *valid = NULL; - CamelException ex; - const char *message = NULL; - gboolean good = FALSE; - - mps = (CamelMultipartSigned *)camel_medium_get_content_object((CamelMedium *)part); - if (!CAMEL_IS_MULTIPART_SIGNED(mps) - || (cpart = camel_multipart_get_part((CamelMultipart *)mps, CAMEL_MULTIPART_SIGNED_CONTENT)) == NULL) { - em_format_format_source(emf, stream, part); - return; - } - - em_format_part(emf, stream, cpart); - - /* FIXME: This sequence is also copied in em-format-html.c */ - - camel_exception_init(&ex); - if (emf->session == NULL) { - message = _("Session not initialised"); - } else { - CamelCipherContext *cipher = NULL; - - /* FIXME: Should be done via a plugin interface */ - if (g_ascii_strcasecmp("application/x-pkcs7-signature", mps->protocol) == 0) - cipher = camel_smime_context_new(emf->session); - else if (g_ascii_strcasecmp("application/pgp-signature", mps->protocol) == 0) - cipher = camel_gpg_context_new(emf->session); - - if (cipher == NULL) { - message = _("Unsupported signature format"); - } else { - valid = camel_cipher_verify(cipher, part, &ex); - camel_object_unref(cipher); - if (valid) { - good = camel_cipher_validity_get_valid(valid); - message = camel_cipher_validity_get_description(valid); - } else { - message = camel_exception_get_description(&ex); - } - } - } - - if (good) - em_format_format_error(emf, stream, _("This message is digitally signed and has been found to be authentic.")); - else - em_format_format_error(emf, stream, _("This message is digitally signed but can not be proven to be authentic.")); - - if (message) - em_format_format_error(emf, stream, message); - - camel_exception_clear(&ex); - camel_cipher_validity_free(valid); -} - -/* this is only a fallback, any implementer should implement */ -static void -emf_message_rfc822(EMFormat *emf, CamelStream *stream, CamelMimePart *part, const EMFormatHandler *info) -{ - CamelDataWrapper *dw = camel_medium_get_content_object((CamelMedium *)part); - - if (!CAMEL_IS_MIME_MESSAGE(dw)) { - em_format_format_source(emf, stream, part); - return; - } - - em_format_format_message(emf, stream, (CamelMedium *)dw); -} - -static EMFormatHandler type_builtin_table[] = { - { "multipart/alternative", emf_multipart_alternative }, - { "multipart/appledouble", emf_multipart_appledouble }, - { "multipart/encrypted", emf_multipart_encrypted }, - { "multipart/mixed", emf_multipart_mixed }, - { "multipart/signed", emf_multipart_signed }, - { "multipart/related", emf_multipart_related }, - { "multipart/*", emf_multipart_mixed }, - { "message/rfc822", emf_message_rfc822 }, - { "message/news", emf_message_rfc822 }, - { "message/*", emf_message_rfc822 }, -}; - -static void -emf_builtin_init(EMFormatClass *klass) -{ - int i; - - for (i=0;i<sizeof(type_builtin_table)/sizeof(type_builtin_table[0]);i++) - g_hash_table_insert(klass->type_handlers, type_builtin_table[i].mime_type, &type_builtin_table[i]); -} diff --git a/mail/em-format.h b/mail/em-format.h deleted file mode 100644 index cc0f6bdd75..0000000000 --- a/mail/em-format.h +++ /dev/null @@ -1,204 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Authors: Michael Zucchi <notzed@ximian.com> - * - * Copyright 2003 Ximian, Inc. (www.ximian.com) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA. - * - */ - -/* - Abstract class for formatting mime messages -*/ - -#ifndef _EM_FORMAT_H -#define _EM_FORMAT_H - -#include <glib-object.h> -#include "e-util/e-msgport.h" - -struct _CamelStream; -struct _CamelMimePart; -struct _CamelMedium; -struct _CamelSession; -struct _CamelURL; -struct _CamelDataWrapper; - -typedef struct _EMFormat EMFormat; -typedef struct _EMFormatClass EMFormatClass; - -typedef struct _EMFormatHandler EMFormatHandler; -typedef struct _EMFormatHeader EMFormatHeader; - -typedef void (*EMFormatFunc) (EMFormat *md, struct _CamelStream *stream, struct _CamelMimePart *part, const EMFormatHandler *info); - -typedef enum _em_format_mode_t { - EM_FORMAT_NORMAL, - EM_FORMAT_ALLHEADERS, - EM_FORMAT_SOURCE, -} em_format_mode_t; - -/* can be subclassed/extended ... */ -struct _EMFormatHandler { - char *mime_type; - EMFormatFunc handler; - GList *applications; /* gnome vfs short-list of applications, do we care? */ -}; - -typedef struct _EMFormatPURI EMFormatPURI; -typedef void (*EMFormatPURIFunc)(EMFormat *md, struct _CamelStream *stream, EMFormatPURI *puri); - -struct _EMFormatPURI { - struct _EMFormatPURI *next, *prev; - - struct _EMFormat *format; - - char *uri; /* will be the location of the part, may be empty */ - char *cid; /* will always be set, a fake one created if needed */ - - EMFormatPURIFunc func; - struct _CamelMimePart *part; - - unsigned int use_count; /* used by multipart/related to see if it was accessed */ -}; - -/* used to stack pending uri's for visibility (multipart/related) */ -struct _EMFormatPURITree { - struct _EMFormatPURITree *next, *prev, *parent; - - EDList uri_list; - EDList children; -}; - -struct _EMFormatHeader { - struct _EMFormatHeader *next, *prev; - - guint32 flags; /* E_FORMAT_HEADER_* */ - char name[1]; -}; - -#define EM_FORMAT_HEADER_BOLD (1<<0) -#define EM_FORMAT_HEADER_LAST (1<<4) /* reserve 4 slots */ - -struct _EMFormat { - GObject parent; - - struct _EMFormatPrivate *priv; - - struct _CamelMedium *message; /* the current message */ - - EDList header_list; /* if empty, then all */ - - struct _CamelSession *session; /* session, used for authentication when required */ - struct _CamelURL *base; /* current location (base url) */ - - /* for forcing inlining */ - GHashTable *inline_table; - - /* global lookup table for message */ - GHashTable *pending_uri_table; - - /* visibility tree, also stores every puri permanently */ - struct _EMFormatPURITree *pending_uri_tree; - /* current level to search from */ - struct _EMFormatPURITree *pending_uri_level; - - em_format_mode_t mode; /* source/headers/etc */ - char *charset; /* charset override */ - char *default_charset; /* charset fallback */ -}; - -struct _EMFormatClass { - GObjectClass parent_class; - - GHashTable *type_handlers; - - /* start formatting a message */ - void (*format_clone)(EMFormat *, struct _CamelMedium *, EMFormat *); - /* some internel error/inconsistency */ - void (*format_error)(EMFormat *, struct _CamelStream *, const char *msg); - - /* use for external structured parts */ - void (*format_attachment)(EMFormat *, struct _CamelStream *, struct _CamelMimePart *, const char *mime_type, const struct _EMFormatHandler *info); - /* for any message parts */ - void (*format_message)(EMFormat *, struct _CamelStream *, struct _CamelMedium *); - /* use for unparsable content */ - void (*format_source)(EMFormat *, struct _CamelStream *, struct _CamelMimePart *); - - /* returns true if the formatter is still busy with pending stuff */ - gboolean (*busy)(EMFormat *); - - /* signals */ - /* complete, alternative to polling busy, for asynchronous work */ - void (*complete)(EMFormat *); -}; - -/* helper entry point */ -void em_format_set_session(EMFormat *emf, struct _CamelSession *s); - -void em_format_set_mode(EMFormat *emf, em_format_mode_t type); -void em_format_set_charset(EMFormat *emf, const char *charset); -void em_format_set_default_charset(EMFormat *emf, const char *charset); - -void em_format_clear_headers(EMFormat *emf); /* also indicates to show all headers */ -void em_format_default_headers(EMFormat *emf); -void em_format_add_header(EMFormat *emf, const char *name, guint32 flags); - -/* FIXME: Need a 'clone' api to copy details about the current view (inlines etc) - Or maybe it should live with sub-classes? */ - -int em_format_is_attachment(EMFormat *emf, struct _CamelMimePart *part); -int em_format_is_inline(EMFormat *emf, struct _CamelMimePart *part); -/* FIXME: not sure about this api */ -void em_format_set_inline(EMFormat *emf, struct _CamelMimePart *part, int state); -char *em_format_describe_part(struct _CamelMimePart *part, const char *mimetype); - -/* for implementers */ -GType em_format_get_type(void); - -void em_format_class_add_handler(EMFormatClass *emfc, EMFormatHandler *info); -void em_format_class_remove_handler (EMFormatClass *emfc, const char *mime_type); -const EMFormatHandler *em_format_find_handler(EMFormat *emf, const char *mime_type); -const EMFormatHandler *em_format_fallback_handler(EMFormat *emf, const char *mime_type); - -/* puri is short for pending uri ... really */ -EMFormatPURI *em_format_add_puri(EMFormat *emf, size_t size, const char *uri, struct _CamelMimePart *part, EMFormatPURIFunc func); -EMFormatPURI *em_format_find_visible_puri(EMFormat *emf, const char *uri); -EMFormatPURI *em_format_find_puri(EMFormat *emf, const char *uri); -void em_format_clear_puri_tree(EMFormat *emf); -void em_format_push_level(EMFormat *emf); -void em_format_pull_level(EMFormat *emf); - -/* clones inline state/view and format, or use to redraw */ -#define em_format_format_clone(emf, msg, src) ((EMFormatClass *)G_OBJECT_GET_CLASS(emf))->format_clone((emf), (msg), (src)) -/* formats a new message */ -#define em_format_format(emf, msg) ((EMFormatClass *)G_OBJECT_GET_CLASS(emf))->format_clone((emf), (msg), NULL) -#define em_format_format_error(emf, stream, txt) ((EMFormatClass *)G_OBJECT_GET_CLASS(emf))->format_error((emf), (stream), (txt)) -#define em_format_format_attachment(emf, stream, msg, type, info) ((EMFormatClass *)G_OBJECT_GET_CLASS(emf))->format_attachment((emf), (stream), (msg), (type), (info)) -#define em_format_format_message(emf, stream, msg) ((EMFormatClass *)G_OBJECT_GET_CLASS(emf))->format_message((emf), (stream), (msg)) -#define em_format_format_source(emf, stream, msg) ((EMFormatClass *)G_OBJECT_GET_CLASS(emf))->format_source((emf), (stream), (msg)) - -#define em_format_busy(emf) ((EMFormatClass *)G_OBJECT_GET_CLASS(emf))->busy((emf)) - -/* raw content only */ -void em_format_format_content(EMFormat *emf, struct _CamelStream *stream, struct _CamelMimePart *part); -/* raw content text parts - should this just be checked/done by above? */ -void em_format_format_text(EMFormat *emf, struct _CamelStream *stream, struct _CamelDataWrapper *part); - -void em_format_part_as(EMFormat *emf, struct _CamelStream *stream, struct _CamelMimePart *part, const char *mime_type); -void em_format_part(EMFormat *emf, struct _CamelStream *stream, struct _CamelMimePart *part); - -#endif /* ! _EM_FORMAT_H */ diff --git a/mail/em-html-stream.c b/mail/em-html-stream.c deleted file mode 100644 index 955525c306..0000000000 --- a/mail/em-html-stream.c +++ /dev/null @@ -1,169 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Authors: Jeffrey Stedfast <fejj@ximian.com> - * Michael Zucchi <notzed@ximian.com> - * - * Copyright 2003 Ximian, Inc. (www.ximian.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public - * License as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - * - */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <stdio.h> -#include <gtkhtml/gtkhtml.h> -#include <gtkhtml/gtkhtml-stream.h> -#include <gtk/gtkmain.h> -#include "em-html-stream.h" - -#define d(x) - -static void em_html_stream_class_init (EMHTMLStreamClass *klass); -static void em_html_stream_init (CamelObject *object); -static void em_html_stream_finalize (CamelObject *object); - -static ssize_t emhs_sync_write(CamelStream *stream, const char *buffer, size_t n); -static int emhs_sync_close(CamelStream *stream); -static int emhs_sync_flush(CamelStream *stream); - -static EMSyncStreamClass *parent_class = NULL; - -CamelType -em_html_stream_get_type (void) -{ - static CamelType type = CAMEL_INVALID_TYPE; - - if (type == CAMEL_INVALID_TYPE) { - parent_class = (EMSyncStreamClass *)em_sync_stream_get_type(); - type = camel_type_register (em_sync_stream_get_type(), - "EMHTMLStream", - sizeof (EMHTMLStream), - sizeof (EMHTMLStreamClass), - (CamelObjectClassInitFunc) em_html_stream_class_init, - NULL, - (CamelObjectInitFunc) em_html_stream_init, - (CamelObjectFinalizeFunc) em_html_stream_finalize); - } - - return type; -} - -static void -em_html_stream_class_init (EMHTMLStreamClass *klass) -{ - ((EMSyncStreamClass *)klass)->sync_write = emhs_sync_write; - ((EMSyncStreamClass *)klass)->sync_flush = emhs_sync_flush; - ((EMSyncStreamClass *)klass)->sync_close = emhs_sync_close; -} - -static void -em_html_stream_init (CamelObject *object) -{ - /*EMHTMLStream *emhs = (EMHTMLStream *)object;*/ -} - -static void -emhs_cleanup(EMHTMLStream *emhs) -{ - emhs->html_stream = NULL; - emhs->sync.cancel = TRUE; - g_signal_handler_disconnect(emhs->html, emhs->destroy_id); - g_object_unref(emhs->html); - emhs->html = NULL; -} - -static void -em_html_stream_finalize (CamelObject *object) -{ - EMHTMLStream *emhs = (EMHTMLStream *)object; - - d(printf("%p: finalising stream\n", object)); - if (emhs->html_stream) { - d(printf("%p: html stream still open - error\n", object)); - /* set 'in finalise' flag */ - camel_stream_close((CamelStream *)emhs); - } -} - -static ssize_t -emhs_sync_write(CamelStream *stream, const char *buffer, size_t n) -{ - EMHTMLStream *emhs = EM_HTML_STREAM (stream); - - if (emhs->html == NULL) - return -1; - - if (emhs->html_stream == NULL) - emhs->html_stream = gtk_html_begin(emhs->html); - - gtk_html_stream_write(emhs->html_stream, buffer, n); - - return (ssize_t) n; -} - -static int -emhs_sync_flush(CamelStream *stream) -{ - EMHTMLStream *emhs = (EMHTMLStream *)stream; - - if (emhs->html_stream == NULL) - return -1; - - gtk_html_flush (emhs->html); - - return 0; -} - -static int -emhs_sync_close(CamelStream *stream) -{ - EMHTMLStream *emhs = (EMHTMLStream *)stream; - - if (emhs->html_stream == NULL) - return -1; - - gtk_html_stream_close(emhs->html_stream, GTK_HTML_STREAM_OK); - emhs_cleanup(emhs); - - return 0; -} - -static void -emhs_gtkhtml_destroy(struct _GtkHTML *html, EMHTMLStream *emhs) -{ - d(printf("%p: emhs gtkhtml destroy\n", emhs)); - emhs_cleanup(emhs); -} - -/* TODO: Could pass NULL for html_stream, and do a gtk_html_begin - on first data -> less flashing */ -CamelStream * -em_html_stream_new(struct _GtkHTML *html, struct _GtkHTMLStream *html_stream) -{ - EMHTMLStream *new; - - new = EM_HTML_STREAM (camel_object_new (EM_HTML_STREAM_TYPE)); - new->html_stream = html_stream; - new->html = html; - g_object_ref(html); - new->destroy_id = g_signal_connect(html, "destroy", G_CALLBACK(emhs_gtkhtml_destroy), new); - - em_sync_stream_set_buffer_size(&new->sync, 8192); - - return (CamelStream *)new; -} diff --git a/mail/em-html-stream.h b/mail/em-html-stream.h deleted file mode 100644 index dc4b59cde8..0000000000 --- a/mail/em-html-stream.h +++ /dev/null @@ -1,64 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Authors: Jeffrey Stedfast <fejj@ximian.com> - * - * Copyright 2001 Ximian, Inc. (www.ximian.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public - * License as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - * - */ - -#ifndef EM_HTML_STREAM_H -#define EM_HTML_STREAM_H - -#ifdef __cplusplus -extern "C" { -#pragma } -#endif /* __cplusplus */ - -#define EM_HTML_STREAM_TYPE (em_html_stream_get_type ()) -#define EM_HTML_STREAM(obj) (CAMEL_CHECK_CAST((obj), EM_HTML_STREAM_TYPE, EMHTMLStream)) -#define EM_HTML_STREAM_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), EM_HTML_STREAM_TYPE, EMHTMLStreamClass)) -#define EM_IS_HTML_STREAM(o) (CAMEL_CHECK_TYPE((o), EM_HTML_STREAM_TYPE)) - -struct _GtkHTML; -struct _GtkHTMLStream; - -#include "em-sync-stream.h" - -typedef struct _EMHTMLStream { - EMSyncStream sync; - - guint destroy_id; - struct _GtkHTML *html; - struct _GtkHTMLStream *html_stream; -} EMHTMLStream; - -typedef struct { - EMSyncStreamClass parent_class; - -} EMHTMLStreamClass; - - -CamelType em_html_stream_get_type (void); - -/* the html_stream is closed when we are finalised (with an error), or closed (ok) */ -CamelStream *em_html_stream_new(struct _GtkHTML *html, struct _GtkHTMLStream *html_stream); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* EM_HTML_STREAM_H */ diff --git a/mail/em-icon-stream.c b/mail/em-icon-stream.c deleted file mode 100644 index ca0e7b64eb..0000000000 --- a/mail/em-icon-stream.c +++ /dev/null @@ -1,208 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Authors: Jeffrey Stedfast <fejj@ximian.com> - * Michael Zucchi <notzed@ximian.com> - * - * Copyright 2003 Ximian, Inc. (www.ximian.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public - * License as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - * - */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <stdio.h> -#include <gdk-pixbuf/gdk-pixbuf.h> -#include <gdk-pixbuf/gdk-pixbuf-loader.h> -#ifdef HAVE_LIBGNOMEUI_GNOME_THUMBNAIL_H -#include <libgnomeui/gnome-thumbnail.h> -#endif -#include <gtk/gtkimage.h> -#include "em-icon-stream.h" - -#define d(x) - -static void em_icon_stream_class_init (EMIconStreamClass *klass); -static void em_icon_stream_init (CamelObject *object); -static void em_icon_stream_finalize (CamelObject *object); - -static ssize_t emis_sync_write(CamelStream *stream, const char *buffer, size_t n); -static int emis_sync_close(CamelStream *stream); -static int emis_sync_flush(CamelStream *stream); - -static EMSyncStreamClass *parent_class = NULL; - -CamelType -em_icon_stream_get_type (void) -{ - static CamelType type = CAMEL_INVALID_TYPE; - - if (type == CAMEL_INVALID_TYPE) { - parent_class = (EMSyncStreamClass *)em_sync_stream_get_type(); - type = camel_type_register (em_sync_stream_get_type(), - "EMIconStream", - sizeof (EMIconStream), - sizeof (EMIconStreamClass), - (CamelObjectClassInitFunc) em_icon_stream_class_init, - NULL, - (CamelObjectInitFunc) em_icon_stream_init, - (CamelObjectFinalizeFunc) em_icon_stream_finalize); - } - - return type; -} - -static void -em_icon_stream_class_init (EMIconStreamClass *klass) -{ - ((EMSyncStreamClass *)klass)->sync_write = emis_sync_write; - ((EMSyncStreamClass *)klass)->sync_flush = emis_sync_flush; - ((EMSyncStreamClass *)klass)->sync_close = emis_sync_close; -} - -static void -em_icon_stream_init (CamelObject *object) -{ - EMIconStream *emis = (EMIconStream *)object; - - emis->width = 24; - emis->height = 24; -} - -static void -emis_cleanup(EMIconStream *emis) -{ - if (emis->loader) { - gdk_pixbuf_loader_close(emis->loader, NULL); - g_object_unref(emis->loader); - emis->loader = NULL; - } - - if (emis->destroy_id) { - g_signal_handler_disconnect(emis->image, emis->destroy_id); - emis->destroy_id = 0; - } - - emis->image = NULL; - emis->sync.cancel = TRUE; -} - -static void -em_icon_stream_finalize(CamelObject *object) -{ - EMIconStream *emis = (EMIconStream *)object; - - emis_cleanup(emis); -} - -static ssize_t -emis_sync_write(CamelStream *stream, const char *buffer, size_t n) -{ - EMIconStream *emis = EM_ICON_STREAM (stream); - - if (emis->loader == NULL) - return -1; - - if (!gdk_pixbuf_loader_write(emis->loader, buffer, n, NULL)) { - emis_cleanup(emis); - return -1; - } - - return (ssize_t) n; -} - -static int -emis_sync_flush(CamelStream *stream) -{ - return 0; -} - -static int -emis_sync_close(CamelStream *stream) -{ - EMIconStream *emis = (EMIconStream *)stream; - int width, height, ratio; - GdkPixbuf *pixbuf, *mini; - - if (emis->loader == NULL) - return -1; - - gdk_pixbuf_loader_close(emis->loader, NULL); - - pixbuf = gdk_pixbuf_loader_get_pixbuf(emis->loader); - if (pixbuf == NULL) { - printf("couldn't get pixbuf from loader\n"); - emis_cleanup(emis); - return -1; - } - - width = gdk_pixbuf_get_width(pixbuf); - height = gdk_pixbuf_get_height(pixbuf); - - if (width != emis->width || height != emis->height) { - if (width >= height) { - if (width > emis->width) { - ratio = width / emis->width; - width = emis->width; - height /= ratio; - } - } else { - if (height > emis->height) { - ratio = height / emis->height; - height = emis->height; - width /= ratio; - } - } - -#ifdef HAVE_LIBGNOMEUI_GNOME_THUMBNAIL_H - mini = gnome_thumbnail_scale_down_pixbuf (pixbuf, width, height); -#else - mini = gdk_pixbuf_scale_simple(pixbuf, width, height, GDK_INTERP_BILINEAR); -#endif - gtk_image_set_from_pixbuf(emis->image, mini); - g_object_unref(mini); - } else { - gtk_image_set_from_pixbuf(emis->image, pixbuf); - } - - g_object_unref(emis->loader); - emis->loader = NULL; - - g_signal_handler_disconnect(emis->image, emis->destroy_id); - emis->destroy_id = 0; - - return 0; -} - -static void -emis_image_destroy(struct _GtkImage *image, EMIconStream *emis) -{ - emis_cleanup(emis); -} - -CamelStream * -em_icon_stream_new(GtkImage *image) -{ - EMIconStream *new; - - new = EM_ICON_STREAM(camel_object_new(EM_ICON_STREAM_TYPE)); - new->image = image; - new->destroy_id = g_signal_connect(image, "destroy", G_CALLBACK(emis_image_destroy), new); - new->loader = gdk_pixbuf_loader_new(); - - return (CamelStream *)new; -} diff --git a/mail/em-icon-stream.h b/mail/em-icon-stream.h deleted file mode 100644 index 3776732578..0000000000 --- a/mail/em-icon-stream.h +++ /dev/null @@ -1,62 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Authors: Michael Zucchi <notzed@ximian.com> - * - * Copyright 2003 Ximian, Inc. (www.ximian.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public - * License as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - * - */ - -#ifndef EM_ICON_STREAM_H -#define EM_ICON_STREAM_H - -#ifdef __cplusplus -extern "C" { -#pragma } -#endif /* __cplusplus */ - -#define EM_ICON_STREAM_TYPE (em_icon_stream_get_type ()) -#define EM_ICON_STREAM(obj) (CAMEL_CHECK_CAST((obj), EM_ICON_STREAM_TYPE, EMIconStream)) -#define EM_ICON_STREAM_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), EM_ICON_STREAM_TYPE, EMIconStreamClass)) -#define EM_IS_ICON_STREAM(o) (CAMEL_CHECK_TYPE((o), EM_ICON_STREAM_TYPE)) - -struct _GtkHTML; -struct _GtkIconStream; - -#include "em-sync-stream.h" - -typedef struct _EMIconStream { - EMSyncStream sync; - - unsigned int width, height; - guint destroy_id; - struct _GdkPixbufLoader *loader; - struct _GtkImage *image; -} EMIconStream; - -typedef struct { - EMSyncStreamClass parent_class; -} EMIconStreamClass; - -CamelType em_icon_stream_get_type (void); - -CamelStream *em_icon_stream_new(GtkImage *image); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* EM_ICON_STREAM_H */ diff --git a/mail/em-inline-filter.c b/mail/em-inline-filter.c deleted file mode 100644 index 3a38771efc..0000000000 --- a/mail/em-inline-filter.c +++ /dev/null @@ -1,335 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- * - * - * Authors: Michael Zucchi <notzed@ximian.com> - * - * Copyright 2003 Ximian, Inc. (www.ximian.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public - * License as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - * - */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <string.h> - -#include "em-inline-filter.h" -#include <camel/camel-mime-part.h> -#include <camel/camel-multipart.h> -#include <camel/camel-stream-mem.h> - -#define d(x) - -static void em_inline_filter_class_init (EMInlineFilterClass *klass); -static void em_inline_filter_init (CamelObject *object); -static void em_inline_filter_finalize (CamelObject *object); - -static void emif_filter(CamelMimeFilter *f, char *in, size_t len, size_t prespace, char **out, size_t *outlen, size_t *outprespace); -static void emif_complete(CamelMimeFilter *f, char *in, size_t len, size_t prespace, char **out, size_t *outlen, size_t *outprespace); -static void emif_reset(CamelMimeFilter *f); - -static CamelMimeFilterClass *parent_class = NULL; - -CamelType -em_inline_filter_get_type (void) -{ - static CamelType type = CAMEL_INVALID_TYPE; - - if (type == CAMEL_INVALID_TYPE) { - parent_class = (CamelMimeFilterClass *)camel_mime_filter_get_type(); - - type = camel_type_register(camel_mime_filter_get_type(), - "EMInlineFilter", - sizeof (EMInlineFilter), - sizeof (EMInlineFilterClass), - (CamelObjectClassInitFunc) em_inline_filter_class_init, - NULL, - (CamelObjectInitFunc) em_inline_filter_init, - (CamelObjectFinalizeFunc) em_inline_filter_finalize); - } - - return type; -} - -static void -em_inline_filter_class_init (EMInlineFilterClass *klass) -{ - ((CamelMimeFilterClass *)klass)->filter = emif_filter; - ((CamelMimeFilterClass *)klass)->complete = emif_complete; - ((CamelMimeFilterClass *)klass)->reset = emif_reset; -} - -static void -em_inline_filter_init (CamelObject *object) -{ - EMInlineFilter *emif = (EMInlineFilter *)object; - - emif->data = g_byte_array_new(); -} - - -static void -em_inline_filter_finalize (CamelObject *object) -{ - EMInlineFilter *emif = (EMInlineFilter *)object; - - emif_reset((CamelMimeFilter *)emif); - g_byte_array_free(emif->data, TRUE); - g_free(emif->filename); -} - -enum { - EMIF_PLAIN, - EMIF_UUENC, - EMIF_BINHEX, - EMIF_POSTSCRIPT, - EMIF_PGPSIGNED, -}; -const struct { - const char *name; - CamelTransferEncoding type; -} emif_types[] = { - { "text/plain", CAMEL_TRANSFER_ENCODING_DEFAULT, }, - { "application/octet-stream", CAMEL_TRANSFER_ENCODING_UUENCODE, }, - { "application/mac-binhex40", CAMEL_TRANSFER_ENCODING_7BIT, }, - { "application/postscript", CAMEL_TRANSFER_ENCODING_7BIT, }, - { "text/plain", CAMEL_TRANSFER_ENCODING_7BIT, }, -}; - -static void -emif_add_part(EMInlineFilter *emif, const char *data, int len) -{ - CamelTransferEncoding type; - CamelStream *mem; - CamelDataWrapper *dw; - CamelMimePart *part; - - if (emif->state == EMIF_PLAIN) - type = emif->base_encoding; - else - type = emif_types[emif->state].type; - - g_byte_array_append(emif->data, data, len); - mem = camel_stream_mem_new_with_byte_array(emif->data); - emif->data = g_byte_array_new(); - - dw = camel_data_wrapper_new(); - camel_data_wrapper_construct_from_stream(dw, mem); - camel_object_unref(mem); - camel_data_wrapper_set_mime_type(dw, emif_types[emif->state].name); - dw->encoding = type; - - part = camel_mime_part_new(); - camel_medium_set_content_object((CamelMedium *)part, dw); - camel_mime_part_set_encoding(part, type); - camel_object_unref(dw); - - if (emif->filename) { - camel_mime_part_set_filename(part, emif->filename); - g_free(emif->filename); - emif->filename = NULL; - } - - emif->parts = g_slist_append(emif->parts, part); -} - -static int -emif_scan(CamelMimeFilter *f, char *in, size_t len, int final) -{ - EMInlineFilter *emif = (EMInlineFilter *)f; - char *inptr = in, *inend = in+len; - char *data_start = in; - char *start = in; - - while (inptr < inend) { - start = inptr; - - while (inptr < inend && *inptr != '\n') - inptr++; - - if (inptr == inend) { - if (!final) { - camel_mime_filter_backup(f, start, inend-start); - inend = start; - } - break; - } - - *inptr++ = 0; - - switch(emif->state) { - case EMIF_PLAIN: - /* This could use some funky plugin shit, but this'll do for now */ - if (strncmp(start, "begin ", 6) == 0 - && start[6] >= '0' && start[6] <= '7') { - int i = 7; - - while (start[i] >='0' && start[i] <='7') - i++; - - inptr[-1] = '\n'; - - if (start[i++] != ' ') - break; - - emif_add_part(emif, data_start, start-data_start); - emif->filename = g_strndup(start+i, inptr-start-i-1); - data_start = start; - emif->state = EMIF_UUENC; - } else if (strncmp(start, "(This file must be converted with BinHex 4.0)", 45) == 0) { - inptr[-1] = '\n'; - emif_add_part(emif, data_start, start-data_start); - data_start = start; - emif->state = EMIF_BINHEX; - } else if (strncmp(start, "%!PS-Adobe-", 11) == 0) { - inptr[-1] = '\n'; - emif_add_part(emif, data_start, start-data_start); - data_start = start; - emif->state = EMIF_POSTSCRIPT; -#if 0 -/* This should be hooked in once someone can work out how to handle it. - Maybe we need a multipart_gpg_inline_signed or some crap, if it - can't be converted to a real multipart/signed */ - } else if (strncmp(start, "-----BEGIN PGP SIGNED MESSAGE-----", 34) == 0) { - inptr[-1] = '\n'; - emif_add_part(emif, data_start, start-data_start); - data_start = start; - emif->state = EMIF_PGPSIGNED; -#endif - } - break; - case EMIF_UUENC: - if (strcmp(start, "end") == 0) { - inptr[-1] = '\n'; - emif_add_part(emif, data_start, inptr-data_start); - data_start = inptr; - emif->state = EMIF_PLAIN; - } - break; - case EMIF_BINHEX: - if (inptr > (start+1) && inptr[-2] == ':') { - inptr[-1] = '\n'; - emif_add_part(emif, data_start, inptr-data_start); - data_start = inptr; - emif->state = EMIF_PLAIN; - } - break; - case EMIF_POSTSCRIPT: - if (strcmp(start, "%%EOF") == 0) { - inptr[-1] = '\n'; - emif_add_part(emif, data_start, inptr-data_start); - data_start = inptr; - emif->state = EMIF_PLAIN; - } - break; - case EMIF_PGPSIGNED: - /* This is currently a noop - it just turns it into a text part */ - if (strcmp(start, "-----END PGP SIGNATURE-----") == 0) { - inptr[-1] = '\n'; - emif_add_part(emif, data_start, inptr-data_start); - data_start = inptr; - emif->state = EMIF_PLAIN; - } - break; - } - - inptr[-1] = '\n'; - } - - if (final) { - emif_add_part(emif, data_start, inend-data_start); - } else { - g_byte_array_append(emif->data, data_start, inend-data_start); - } - - return 0; -} - -static void -emif_filter(CamelMimeFilter *f, char *in, size_t len, size_t prespace, char **out, size_t *outlen, size_t *outprespace) -{ - emif_scan(f, in, len, FALSE); - - *out = in; - *outlen = len; - *outprespace = prespace; -} - -static void -emif_complete(CamelMimeFilter *f, char *in, size_t len, size_t prespace, char **out, size_t *outlen, size_t *outprespace) -{ - emif_scan(f, in, len, TRUE); - - *out = in; - *outlen = len; - *outprespace = prespace; -} - -static void -emif_reset(CamelMimeFilter *f) -{ - EMInlineFilter *emif = (EMInlineFilter *)f; - GSList *l; - - l = emif->parts; - while (l) { - GSList *n = l->next; - - camel_object_unref(l->data); - g_slist_free_1(l); - - l = n; - } - emif->parts = NULL; - g_byte_array_set_size(emif->data, 0); -} - -/** - * em_inline_filter_new: - * @base_encoding: The base transfer-encoding of the - * raw data being processed. - * - * Create a filter which will scan a (text) stream for - * embedded parts. You can then retrieve the contents - * as a CamelMultipart object. - * - * Return value: - **/ -EMInlineFilter * -em_inline_filter_new(CamelTransferEncoding base_encoding) -{ - EMInlineFilter *emif; - - emif = (EMInlineFilter *)camel_object_new(em_inline_filter_get_type()); - emif->base_encoding = base_encoding; - - return emif; -} - -CamelMultipart * -em_inline_filter_get_multipart(EMInlineFilter *emif) -{ - GSList *l = emif->parts; - CamelMultipart *mp; - - mp = camel_multipart_new(); - while (l) { - camel_multipart_add_part(mp, l->data); - l = l->next; - } - - return mp; -} diff --git a/mail/em-inline-filter.h b/mail/em-inline-filter.h deleted file mode 100644 index 0afcdfa0b5..0000000000 --- a/mail/em-inline-filter.h +++ /dev/null @@ -1,62 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Authors: Michael Zucchi <notzed@ximian.com> - * - * Copyright 2003 Ximian, Inc. (www.ximian.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public - * License as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - * - */ - -#ifndef EM_INLINE_FILTER_H -#define EM_INLINE_FILTER_H - -#ifdef __cplusplus -extern "C" { -#pragma } -#endif /* __cplusplus */ - -#define EM_INLINE_FILTER_TYPE (em_inline_filter_get_type ()) -#define EM_INLINE_FILTER(obj) (CAMEL_CHECK_CAST((obj), EM_INLINE_FILTER_TYPE, EMInlineFilter)) -#define EM_INLINE_FILTER_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), EM_INLINE_FILTER_TYPE, EMInlineFilterClass)) -#define EM_IS_INLINE_FILTER(o) (CAMEL_CHECK_TYPE((o), EM_INLINE_FILTER_TYPE)) - -#include <camel/camel-mime-filter.h> -#include <camel/camel-mime-utils.h> - -typedef struct _EMInlineFilter { - CamelMimeFilter filter; - - int state; - - CamelTransferEncoding base_encoding; - GByteArray *data; - char *filename; - GSList *parts; -} EMInlineFilter; - -typedef struct _EMInlineFilterClass { - CamelMimeFilterClass filter_class; -} EMInlineFilterClass; - -CamelType em_inline_filter_get_type(void); -EMInlineFilter *em_inline_filter_new(CamelTransferEncoding base_encoding); -struct _CamelMultipart *em_inline_filter_get_multipart(EMInlineFilter *emif); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* EM_INLINE_FILTER_H */ diff --git a/mail/em-junk-filter.c b/mail/em-junk-filter.c deleted file mode 100644 index 7d6b9346e8..0000000000 --- a/mail/em-junk-filter.c +++ /dev/null @@ -1,352 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Author: - * Radek Doulik <rodo@ximian.com> - * - * Copyright 2003 Ximian, Inc. (www.ximian.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public - * License as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA - */ - -#include <sys/types.h> -#include <sys/stat.h> -#include <sys/wait.h> -#include <fcntl.h> -#include <errno.h> -#include <signal.h> -#include <string.h> -#include <pthread.h> - -#include <camel/camel-data-wrapper.h> -#include <camel/camel-stream-fs.h> - -#include "em-junk-filter.h" - -#define LOCK(x) pthread_mutex_lock(&x) -#define UNLOCK(x) pthread_mutex_unlock(&x) - -static pthread_mutex_t em_junk_sa_test_lock = PTHREAD_MUTEX_INITIALIZER; - -static const char * em_junk_sa_get_name (void); -static gboolean em_junk_sa_check_junk (CamelMimeMessage *msg); -static void em_junk_sa_report_junk (CamelMimeMessage *msg); -static void em_junk_sa_report_notjunk (CamelMimeMessage *msg); -static void em_junk_sa_commit_reports (void); - -static EMJunkPlugin spam_assassin_plugin = -{ - { - em_junk_sa_get_name, - 1, - em_junk_sa_check_junk, - em_junk_sa_report_junk, - em_junk_sa_report_notjunk, - em_junk_sa_commit_reports, - }, - NULL, - NULL -}; - -static gboolean em_junk_sa_tested = FALSE; -static gboolean em_junk_sa_use_spamc = FALSE; -static gboolean em_junk_sa_available = FALSE; -static gint em_junk_sa_spamd_port = -1; - -#define d(x) x - -static const char * -em_junk_sa_get_name (void) -{ - return _("Spamassassin (built-in)"); -} - -static int -pipe_to_sa (CamelMimeMessage *msg, gchar *in, int argc, gchar **argv) -{ - CamelStream *stream; - int result, status; - int in_fds[2]; - pid_t pid; - - d(printf ("pipe_to_sa %s %s %s %s\n", argc > 0 ? argv [0] : "", argc > 1 ? argv [1] : "", argc > 2 ? argv [2] : "", argc > 3 ? argv [3] : "")); - - if (argc < 1 || argv[0] == '\0') - return 0; - - if (pipe (in_fds) == -1) { - /* camel_exception_setv (fms->ex, CAMEL_EXCEPTION_SYSTEM, - _("Failed to create pipe to '%s': %s"), - argv[0]->value.string, g_strerror (errno)); */ - return -1; - } - - if (!(pid = fork ())) { - /* child process */ - int maxfd, fd; - - fd = open ("/dev/null", O_WRONLY); - - if (dup2 (in_fds[0], STDIN_FILENO) < 0 || - dup2 (fd, STDOUT_FILENO) < 0 || - dup2 (fd, STDERR_FILENO) < 0) - _exit (255); - - setsid (); - - maxfd = sysconf (_SC_OPEN_MAX); - if (maxfd > 0) { - for (fd = 0; fd < maxfd; fd++) { - if (fd != STDIN_FILENO && fd != STDOUT_FILENO && fd != STDERR_FILENO) - close (fd); - } - } - - execvp (argv [0], argv); - - d(printf ("Could not execute %s: %s\n", argv [0], g_strerror (errno))); - _exit (255); - } else if (pid < 0) { - /* camel_exception_setv (fms->ex, CAMEL_EXCEPTION_SYSTEM, - _("Failed to create create child process '%s': %s"), - argv[0]->value.string, g_strerror (errno)); */ - return -1; - } - - /* parent process */ - close (in_fds[0]); - fcntl (in_fds[1], F_SETFL, O_NONBLOCK); - - if (msg) { - stream = camel_stream_fs_new_with_fd (in_fds[1]); - - camel_data_wrapper_write_to_stream (CAMEL_DATA_WRAPPER (msg), stream); - camel_stream_flush (stream); - camel_object_unref (CAMEL_OBJECT (stream)); - } else if (in) { - write (in_fds [1], in, strlen (in)); - close (in_fds [1]); - } - - result = waitpid (pid, &status, 0); - - if (result == -1 && errno == EINTR) { - /* child process is hanging... */ - kill (pid, SIGTERM); - sleep (1); - result = waitpid (pid, &status, WNOHANG); - if (result == 0) { - /* ...still hanging, set phasers to KILL */ - kill (pid, SIGKILL); - sleep (1); - result = waitpid (pid, &status, WNOHANG); - } - } - - if (result != -1 && WIFEXITED (status)) - return WEXITSTATUS (status); - else - return -1; -} - - -#define NPORTS 1 - -static int -em_junk_sa_test_spamd_running (gint port) -{ - static gchar *sac_args [3] = { - "/bin/sh", - "-c", - NULL - }; - int retval; - - d(fprintf (stderr, "test if spamd is running (port %d)\n", port);) - sac_args [2] = port > 0 ? g_strdup_printf ("spamc -x -p %d", port) : g_strdup_printf ("spamc -x"); - - retval = pipe_to_sa (NULL, "From test@127.0.0.1", 3, sac_args) == 0; - g_free (sac_args [2]); - - return retval; -} - -static void -em_junk_sa_test_spamd () -{ - gint i, port = 7830; - static gchar *args [3] = { - "/bin/sh", - "-c", - "spamassassin --version" - }; - - if (pipe_to_sa (NULL, NULL, 3, args)) - em_junk_sa_available = FALSE; - else { - em_junk_sa_available = TRUE; - em_junk_sa_use_spamc = FALSE; - - /* if (em_junk_sa_test_spamd_running (-1)) { - em_junk_sa_use_spamc = TRUE; - em_junk_sa_spamd_port = -1; - } else { */ - for (i = 0; i < NPORTS; i ++) { - if (em_junk_sa_test_spamd_running (port)) { - em_junk_sa_use_spamc = TRUE; - em_junk_sa_spamd_port = port; - break; - } - port ++; - } - /* } */ - - if (!em_junk_sa_use_spamc) { - static gchar *sad_args [3] = { - "/bin/sh", - "-c", - NULL - }; - gint i, port = 7830; - - d(fprintf (stderr, "looks like spamd is not running\n");) - - for (i = 0; i < NPORTS; i ++) { - d(fprintf (stderr, "trying to run spamd at port %d\n", port)); - - sad_args [2] = g_strdup_printf ("spamd --port %d --local --daemonize", port); - if (!pipe_to_sa (NULL, NULL, 3, sad_args)) { - g_free (sad_args [2]); - em_junk_sa_use_spamc = TRUE; - em_junk_sa_spamd_port = port; - d(fprintf (stderr, "success at port %d\n", port)); - break; - } - g_free (sad_args [2]); - port ++; - } - } - - d(fprintf (stderr, "use spamd %d at port %d\n", em_junk_sa_use_spamc, em_junk_sa_spamd_port)); - } - - em_junk_sa_tested = TRUE; -} - -static gboolean -em_junk_sa_is_available () -{ - LOCK (em_junk_sa_test_lock); - if (!em_junk_sa_tested) - em_junk_sa_test_spamd (); - UNLOCK (em_junk_sa_test_lock); - - return em_junk_sa_available; -} - -static gboolean -em_junk_sa_check_junk (CamelMimeMessage *msg) -{ - static gchar *args [3] = { - "/bin/sh", - "-c", - NULL - }; - gint retval; - - d(fprintf (stderr, "em_junk_sa_check_junk\n")); - - if (!em_junk_sa_is_available ()) - return FALSE; - - args [2] = em_junk_sa_use_spamc - ? (em_junk_sa_spamd_port == -1 - ? g_strdup ("spamc -c") /* Exit with a non-zero exit code if the - tested message was junk */ - : g_strdup_printf ("spamc" - " -c" /* Exit with a non-zero exit code if the - tested message was junk */ - " -p %d", em_junk_sa_spamd_port)) - : g_strdup ("spamassassin" - " --exit-code" /* Exit with a non-zero exit code if the - tested message was junk */ - " --local"); /* Local tests only (no online tests) */ - - retval = pipe_to_sa (msg, NULL, 3, args); - - g_free (args [2]); - - return retval; -} - -static void -em_junk_sa_report_junk (CamelMimeMessage *msg) -{ - static gchar *args [3] = { - "/bin/sh", - "-c", - "sa-learn" - " --no-rebuild" /* do not rebuild db */ - " --spam" /* report junk */ - " --single" /* single message */ - " --local" /* local only */ - }; - - d(fprintf (stderr, "em_junk_sa_report_junk\n")); - - if (em_junk_sa_is_available ()) - pipe_to_sa (msg, NULL, 3, args); -} - -static void -em_junk_sa_report_notjunk (CamelMimeMessage *msg) -{ - static gchar *args [3] = { - "/bin/sh", - "-c", - "sa-learn" - " --no-rebuild" /* do not rebuild db */ - " --ham" /* report notjunk */ - " --single" /* single message */ - " --local" /* local only */ - }; - - d(fprintf (stderr, "em_junk_sa_report_notjunk\n")); - - if (em_junk_sa_is_available ()) - pipe_to_sa (msg, NULL, 3, args); -} - -static void -em_junk_sa_commit_reports (void) -{ - static gchar *args [3] = { - "/bin/sh", - "-c", - "sa-learn" - " --rebuild" /* do not rebuild db */ - " --local" /* local only */ - }; - - d(fprintf (stderr, "em_junk_sa_commit_reports\n");) - - if (em_junk_sa_is_available ()) - pipe_to_sa (NULL, NULL, 3, args); -} - -const EMJunkPlugin * -em_junk_filter_get_plugin (void) -{ - return &spam_assassin_plugin; -} diff --git a/mail/em-junk-filter.h b/mail/em-junk-filter.h deleted file mode 100644 index f62ca7bfad..0000000000 --- a/mail/em-junk-filter.h +++ /dev/null @@ -1,30 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Author: - * Radek Doulik <rodo@ximian.com> - * - * Copyright 2003 Ximian, Inc. (www.ximian.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public - * License as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA - */ - -#ifndef _EM_JUNK_FILTER_H -#define _EM_JUNK_FILTER_H - -#include "em-junk-plugin.h" - -const EMJunkPlugin * em_junk_filter_get_plugin (void); - -#endif diff --git a/mail/em-junk-plugin.c b/mail/em-junk-plugin.c deleted file mode 100644 index 5ea2a40119..0000000000 --- a/mail/em-junk-plugin.c +++ /dev/null @@ -1,24 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Author: - * Radek Doulik <rodo@ximian.com> - * - * Copyright 2003 Ximian, Inc. (www.ximian.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public - * License as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA - */ - -#include "em-junk-plugin.h" - diff --git a/mail/em-junk-plugin.h b/mail/em-junk-plugin.h deleted file mode 100644 index bd4af4cf9a..0000000000 --- a/mail/em-junk-plugin.h +++ /dev/null @@ -1,46 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Author: - * Radek Doulik <rodo@ximian.com> - * - * Copyright 2003 Ximian, Inc. (www.ximian.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public - * License as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA - */ - -#ifndef _EM_JUNK_PLUGIN_H -#define _EM_JUNK_PLUGIN_H - -#include <camel/camel-junk-plugin.h> -#include <gtk/gtkwidget.h> - -#define EM_JUNK_PLUGIN(x) ((EMJunkPlugin *) x) - -typedef struct _EMJunkPlugin EMJunkPlugin; - -struct _EMJunkPlugin -{ - CamelJunkPlugin csp; - - /* when called, it should return widget containing UI configuration. - plugin has to call (*changed_cb) (); whenever configuration - is changed to notify settings dialog about that change. - if setup_widget is NULL, it means there is no UI configuration */ - - GtkWidget (*setup_widget) (void (*changed_cb) ()); - void (*apply) (); -}; - -#endif diff --git a/mail/em-mailer-prefs.c b/mail/em-mailer-prefs.c deleted file mode 100644 index a4c5f2e25a..0000000000 --- a/mail/em-mailer-prefs.c +++ /dev/null @@ -1,484 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Authors: Jeffrey Stedfast <fejj@ximian.com> - * - * Copyright 2002-2003 Ximian, Inc. (www.ximian.com) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA. - * - */ - - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <string.h> - -#include "em-mailer-prefs.h" - -#include <gal/util/e-iconv.h> -#include <gtkhtml/gtkhtml-properties.h> -#include "widgets/misc/e-charset-picker.h" -#include <bonobo/bonobo-generic-factory.h> - -#include "mail-config.h" - - -static void em_mailer_prefs_class_init (EMMailerPrefsClass *class); -static void em_mailer_prefs_init (EMMailerPrefs *dialog); -static void em_mailer_prefs_finalise (GObject *obj); - -static GtkVBoxClass *parent_class = NULL; - - -GtkType -em_mailer_prefs_get_type (void) -{ - static GType type = 0; - - if (!type) { - GTypeInfo type_info = { - sizeof (EMMailerPrefsClass), - NULL, NULL, - (GClassInitFunc) em_mailer_prefs_class_init, - NULL, NULL, - sizeof (EMMailerPrefs), - 0, - (GInstanceInitFunc) em_mailer_prefs_init, - }; - - type = g_type_register_static (gtk_vbox_get_type (), "EMMailerPrefs", &type_info, 0); - } - - return type; -} - -static void -em_mailer_prefs_class_init (EMMailerPrefsClass *klass) -{ - GObjectClass *object_class; - - object_class = (GObjectClass *) klass; - parent_class = g_type_class_ref (gtk_vbox_get_type ()); - - object_class->finalize = em_mailer_prefs_finalise; -} - -static void -em_mailer_prefs_init (EMMailerPrefs *preferences) -{ - preferences->gconf = mail_config_get_gconf_client (); -} - -static void -em_mailer_prefs_finalise (GObject *obj) -{ - EMMailerPrefs *prefs = (EMMailerPrefs *) obj; - - g_object_unref (prefs->gui); - - ((GObjectClass *)(parent_class))->finalize (obj); -} - - -static void -colorpicker_set_color (GnomeColorPicker *color, const char *str) -{ - GdkColor colour; - guint32 rgb; - - gdk_color_parse (str, &colour); - rgb = ((colour.red & 0xff00) << 8) | (colour.green & 0xff00) | ((colour.blue & 0xff00) >> 8); - - gnome_color_picker_set_i8 (color, (rgb & 0xff0000) >> 16, (rgb & 0xff00) >> 8, rgb & 0xff, 0xff); -} - -static guint32 -colorpicker_get_color (GnomeColorPicker *color) -{ - guint8 r, g, b, a; - guint32 rgb = 0; - - gnome_color_picker_get_i8 (color, &r, &g, &b, &a); - - rgb = r; - rgb <<= 8; - rgb |= g; - rgb <<= 8; - rgb |= b; - - return rgb; -} - -static void -settings_changed (GtkWidget *widget, gpointer user_data) -{ - EMMailerPrefs *prefs = (EMMailerPrefs *) user_data; - - if (prefs->control) - evolution_config_control_changed (prefs->control); -} - -static void -font_share_changed (GtkWidget *w, gpointer user_data) -{ - EMMailerPrefs *prefs = (EMMailerPrefs *) user_data; - gboolean use_custom; - - use_custom = !gtk_toggle_button_get_active (prefs->font_share); - - gtk_widget_set_sensitive (GTK_WIDGET (prefs->font_fixed), use_custom); - gtk_widget_set_sensitive (GTK_WIDGET (prefs->font_variable), use_custom); - - if (prefs->control) - evolution_config_control_changed (prefs->control); -} - -static void -font_changed (GnomeFontPicker *fontpicker, gchar *arg1, gpointer user_data) -{ - EMMailerPrefs *prefs = (EMMailerPrefs *) user_data; - - if (prefs->control) - evolution_config_control_changed (prefs->control); -} - -static void -color_set (GtkWidget *widget, guint r, guint g, guint b, guint a, gpointer user_data) -{ - EMMailerPrefs *prefs = (EMMailerPrefs *) user_data; - - if (prefs->control) - evolution_config_control_changed (prefs->control); -} - -static void -restore_labels_clicked (GtkWidget *widget, gpointer user_data) -{ - EMMailerPrefs *prefs = (EMMailerPrefs *) user_data; - int i; - - for (i = 0; i < 5; i++) { - gtk_entry_set_text (prefs->labels[i].name, _(label_defaults[i].name)); - colorpicker_set_color (prefs->labels[i].color, label_defaults[i].colour); - } -} - -static void -menu_changed (GtkWidget *widget, gpointer user_data) -{ - EMMailerPrefs *prefs = (EMMailerPrefs *) user_data; - - if (prefs->control) - evolution_config_control_changed (prefs->control); -} - -static void -option_menu_connect (GtkOptionMenu *omenu, gpointer user_data) -{ - GtkWidget *menu, *item; - GList *items; - - menu = gtk_option_menu_get_menu (omenu); - - items = GTK_MENU_SHELL (menu)->children; - while (items) { - item = items->data; - g_signal_connect (item, "activate", G_CALLBACK (menu_changed), user_data); - items = items->next; - } -} - -static void -em_mailer_prefs_construct (EMMailerPrefs *prefs) -{ - GtkWidget *toplevel, *menu; - GSList *list; - GladeXML *gui; - gboolean bool; - char *font; - int i, val; - char *buf; - - gui = glade_xml_new (EVOLUTION_GLADEDIR "/mail-config.glade", "preferences_tab", NULL); - prefs->gui = gui; - - /* get our toplevel widget */ - toplevel = glade_xml_get_widget (gui, "toplevel"); - - /* reparent */ - gtk_widget_ref (toplevel); - gtk_container_remove (GTK_CONTAINER (toplevel->parent), toplevel); - gtk_container_add (GTK_CONTAINER (prefs), toplevel); - gtk_widget_unref (toplevel); - - /* General tab */ - - /* Message Display */ - prefs->timeout_toggle = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui, "chkMarkTimeout")); - bool = gconf_client_get_bool (prefs->gconf, "/apps/evolution/mail/display/mark_seen", NULL); - gtk_toggle_button_set_active (prefs->timeout_toggle, bool); - g_signal_connect (prefs->timeout_toggle, "toggled", G_CALLBACK (settings_changed), prefs); - - prefs->timeout = GTK_SPIN_BUTTON (glade_xml_get_widget (gui, "spinMarkTimeout")); - val = gconf_client_get_int (prefs->gconf, "/apps/evolution/mail/display/mark_seen_timeout", NULL); - gtk_spin_button_set_value (prefs->timeout, (1.0 * val) / 1000.0); - g_signal_connect (prefs->timeout, "value-changed", G_CALLBACK (settings_changed), prefs); - - prefs->charset = GTK_OPTION_MENU (glade_xml_get_widget (gui, "omenuCharset")); - buf = gconf_client_get_string (prefs->gconf, "/apps/evolution/mail/display/charset", NULL); - menu = e_charset_picker_new (buf && *buf ? buf : e_iconv_locale_charset ()); - gtk_option_menu_set_menu (prefs->charset, GTK_WIDGET (menu)); - option_menu_connect (prefs->charset, prefs); - g_free (buf); - - prefs->citation_highlight = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui, "chkHighlightCitations")); - bool = gconf_client_get_bool (prefs->gconf, "/apps/evolution/mail/display/mark_citations", NULL); - gtk_toggle_button_set_active (prefs->citation_highlight, bool); - g_signal_connect (prefs->citation_highlight, "toggled", G_CALLBACK (settings_changed), prefs); - - prefs->citation_color = GNOME_COLOR_PICKER (glade_xml_get_widget (gui, "colorpickerHighlightCitations")); - buf = gconf_client_get_string (prefs->gconf, "/apps/evolution/mail/display/citation_colour", NULL); - colorpicker_set_color (prefs->citation_color, buf ? buf : "#737373"); - g_signal_connect (prefs->citation_color, "color-set", G_CALLBACK (color_set), prefs); - g_free (buf); - - /* Deleting Mail */ - prefs->empty_trash = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui, "chkEmptyTrashOnExit")); - bool = gconf_client_get_bool (prefs->gconf, "/apps/evolution/mail/trash/empty_on_exit", NULL); - gtk_toggle_button_set_active (prefs->empty_trash, bool); - g_signal_connect (prefs->empty_trash, "toggled", G_CALLBACK (settings_changed), prefs); - - prefs->confirm_expunge = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui, "chkConfirmExpunge")); - bool = gconf_client_get_bool (prefs->gconf, "/apps/evolution/mail/prompts/expunge", NULL); - gtk_toggle_button_set_active (prefs->confirm_expunge, bool); - g_signal_connect (prefs->confirm_expunge, "toggled", G_CALLBACK (settings_changed), prefs); - - /* New Mail Notification */ - val = gconf_client_get_int (prefs->gconf, "/apps/evolution/mail/notify/type", NULL); - prefs->notify_not = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui, "radNotifyNot")); - gtk_toggle_button_set_active (prefs->notify_not, val == MAIL_CONFIG_NOTIFY_NOT); - g_signal_connect (prefs->notify_not, "toggled", G_CALLBACK (settings_changed), prefs); - - prefs->notify_beep = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui, "radNotifyBeep")); - gtk_toggle_button_set_active (prefs->notify_beep, val == MAIL_CONFIG_NOTIFY_BEEP); - g_signal_connect (prefs->notify_beep, "toggled", G_CALLBACK (settings_changed), prefs); - - prefs->notify_play_sound = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui, "radNotifyPlaySound")); - gtk_toggle_button_set_active (prefs->notify_play_sound, val == MAIL_CONFIG_NOTIFY_PLAY_SOUND); - g_signal_connect (prefs->notify_play_sound, "toggled", G_CALLBACK (settings_changed), prefs); - - prefs->notify_sound_file = GNOME_FILE_ENTRY (glade_xml_get_widget (gui, "fileNotifyPlaySound")); - buf = gconf_client_get_string (prefs->gconf, "/apps/evolution/mail/notify/sound", NULL); - gtk_entry_set_text (GTK_ENTRY (gnome_file_entry_gtk_entry (prefs->notify_sound_file)), buf ? buf : ""); - g_signal_connect (gnome_file_entry_gtk_entry (prefs->notify_sound_file), "changed", - G_CALLBACK (settings_changed), prefs); - g_free (buf); - - /* Mail Fonts */ - font = gconf_client_get_string (prefs->gconf, "/apps/evolution/mail/display/fonts/monospace", NULL); - prefs->font_fixed = GNOME_FONT_PICKER (glade_xml_get_widget (gui, "radFontFixed")); - gnome_font_picker_set_font_name (prefs->font_fixed, font); - g_signal_connect (prefs->font_fixed, "font-set", G_CALLBACK (font_changed), prefs); - - font = gconf_client_get_string (prefs->gconf, "/apps/evolution/mail/display/fonts/variable", NULL); - prefs->font_variable = GNOME_FONT_PICKER (glade_xml_get_widget (gui, "radFontVariable")); - gnome_font_picker_set_font_name (prefs->font_variable, font); - g_signal_connect (prefs->font_variable, "font-set", G_CALLBACK (font_changed), prefs); - - bool = gconf_client_get_bool (prefs->gconf, "/apps/evolution/mail/display/fonts/use_custom", NULL); - prefs->font_share = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui, "radFontUseSame")); - gtk_toggle_button_set_active (prefs->font_share, !bool); - g_signal_connect (prefs->font_share, "toggled", G_CALLBACK (font_share_changed), prefs); - font_share_changed (GTK_WIDGET (prefs->font_share), prefs); - - /* HTML Mail tab */ - - /* Loading Images */ - - val = gconf_client_get_int (prefs->gconf, "/apps/evolution/mail/display/load_http_images", NULL); - prefs->images_never = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui, "radImagesNever")); - gtk_toggle_button_set_active (prefs->images_never, val == MAIL_CONFIG_HTTP_NEVER); - g_signal_connect (prefs->images_never, "toggled", G_CALLBACK (settings_changed), prefs); - - prefs->images_sometimes = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui, "radImagesSometimes")); - gtk_toggle_button_set_active (prefs->images_sometimes, val == MAIL_CONFIG_HTTP_SOMETIMES); - g_signal_connect (prefs->images_sometimes, "toggled", G_CALLBACK (settings_changed), prefs); - - prefs->images_always = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui, "radImagesAlways")); - gtk_toggle_button_set_active (prefs->images_always, val == MAIL_CONFIG_HTTP_ALWAYS); - g_signal_connect (prefs->images_always, "toggled", G_CALLBACK (settings_changed), prefs); - - prefs->show_animated = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui, "chkShowAnimatedImages")); - bool = gconf_client_get_bool (prefs->gconf, "/apps/evolution/mail/display/animate_images", NULL); - gtk_toggle_button_set_active (prefs->show_animated, bool); - g_signal_connect (prefs->show_animated, "toggled", G_CALLBACK (settings_changed), prefs); - - prefs->prompt_unwanted_html = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui, "chkPromptWantHTML")); - bool = gconf_client_get_bool (prefs->gconf, "/apps/evolution/mail/prompts/unwanted_html", NULL); - gtk_toggle_button_set_active (prefs->prompt_unwanted_html, bool); - g_signal_connect (prefs->prompt_unwanted_html, "toggled", G_CALLBACK (settings_changed), prefs); - - i = 0; - list = mail_config_get_labels (); - while (list != NULL && i < 5) { - MailConfigLabel *label; - char *widget_name; - - label = list->data; - - widget_name = g_strdup_printf ("txtLabel%d", i); - prefs->labels[i].name = GTK_ENTRY (glade_xml_get_widget (gui, widget_name)); - g_free (widget_name); - - widget_name = g_strdup_printf ("colorLabel%d", i); - prefs->labels[i].color = GNOME_COLOR_PICKER (glade_xml_get_widget (gui, widget_name)); - g_free (widget_name); - - gtk_entry_set_text (prefs->labels[i].name, label->name); - g_signal_connect (prefs->labels[i].name, "changed", G_CALLBACK (settings_changed), prefs); - - colorpicker_set_color (prefs->labels[i].color, label->colour); - g_signal_connect (prefs->labels[i].color, "color_set", G_CALLBACK (color_set), prefs); - - i++; - list = list->next; - } - - prefs->restore_labels = GTK_BUTTON (glade_xml_get_widget (gui, "cmdRestoreLabels")); - g_signal_connect (prefs->restore_labels, "clicked", G_CALLBACK (restore_labels_clicked), prefs); - - /* Junk prefs */ - prefs->check_incoming = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui, "chkCheckIncomingMail")); - bool = gconf_client_get_bool (prefs->gconf, "/apps/evolution/mail/junk/check_incoming", NULL); - gtk_toggle_button_set_active (prefs->check_incoming, bool); - g_signal_connect (prefs->check_incoming, "toggled", G_CALLBACK (settings_changed), prefs); -} - - -GtkWidget * -em_mailer_prefs_new (void) -{ - EMMailerPrefs *new; - - new = (EMMailerPrefs *) g_object_new (em_mailer_prefs_get_type (), NULL); - em_mailer_prefs_construct (new); - - return (GtkWidget *) new; -} - - -void -em_mailer_prefs_apply (EMMailerPrefs *prefs) -{ - GtkWidget *entry, *menu; - char *string, buf[20]; - const char *cstring; - GSList *list, *l, *n; - guint32 rgb; - int i, val; - - /* General tab */ - - /* Message Display */ - gconf_client_set_bool (prefs->gconf, "/apps/evolution/mail/display/mark_seen", - gtk_toggle_button_get_active (prefs->timeout_toggle), NULL); - - val = (int) (gtk_spin_button_get_value (prefs->timeout) * 1000.0); - gconf_client_set_int (prefs->gconf, "/apps/evolution/mail/display/mark_seen_timeout", val, NULL); - - menu = gtk_option_menu_get_menu (prefs->charset); - if (!(string = e_charset_picker_get_charset (menu))) - string = g_strdup (e_iconv_locale_charset ()); - - gconf_client_set_string (prefs->gconf, "/apps/evolution/mail/display/charset", string, NULL); - g_free (string); - - gconf_client_set_bool (prefs->gconf, "/apps/evolution/mail/display/mark_citations", - gtk_toggle_button_get_active (prefs->citation_highlight), NULL); - - rgb = colorpicker_get_color (prefs->citation_color); - sprintf (buf,"#%06x", rgb & 0xffffff); - gconf_client_set_string (prefs->gconf, "/apps/evolution/mail/display/citation_colour", buf, NULL); - - /* Deleting Mail */ - gconf_client_set_bool (prefs->gconf, "/apps/evolution/mail/trash/empty_on_exit", - gtk_toggle_button_get_active (prefs->empty_trash), NULL); - - gconf_client_set_bool (prefs->gconf, "/apps/evolution/mail/prompts/expunge", - gtk_toggle_button_get_active (prefs->confirm_expunge), NULL); - - /* New Mail Notification */ - if (gtk_toggle_button_get_active (prefs->notify_not)) - val = MAIL_CONFIG_NOTIFY_NOT; - else if (gtk_toggle_button_get_active (prefs->notify_beep)) - val = MAIL_CONFIG_NOTIFY_BEEP; - else - val = MAIL_CONFIG_NOTIFY_PLAY_SOUND; - - gconf_client_set_int (prefs->gconf, "/apps/evolution/mail/notify/type", val, NULL); - - entry = gnome_file_entry_gtk_entry (GNOME_FILE_ENTRY (prefs->notify_sound_file)); - cstring = gtk_entry_get_text (GTK_ENTRY (entry)); - gconf_client_set_string (prefs->gconf, "/apps/evolution/mail/notify/sound", cstring, NULL); - - /* HTML Mail */ - if (gtk_toggle_button_get_active (prefs->images_always)) - val = MAIL_CONFIG_HTTP_ALWAYS; - else if (gtk_toggle_button_get_active (prefs->images_sometimes)) - val = MAIL_CONFIG_HTTP_SOMETIMES; - else - val = MAIL_CONFIG_HTTP_NEVER; - - gconf_client_set_int (prefs->gconf, "/apps/evolution/mail/display/load_http_images", val, NULL); - - gconf_client_set_string (prefs->gconf, "/apps/evolution/mail/display/fonts/variable", - gnome_font_picker_get_font_name (prefs->font_variable), NULL); - gconf_client_set_string (prefs->gconf, "/apps/evolution/mail/display/fonts/monospace", - gnome_font_picker_get_font_name (prefs->font_fixed), NULL); - gconf_client_set_bool (prefs->gconf, "/apps/evolution/mail/display/fonts/use_custom", - !gtk_toggle_button_get_active (prefs->font_share), NULL); - gconf_client_set_bool (prefs->gconf, "/apps/evolution/mail/display/animate_images", - gtk_toggle_button_get_active (prefs->show_animated), NULL); - - gconf_client_set_bool (prefs->gconf, "/apps/evolution/mail/prompts/unwanted_html", - gtk_toggle_button_get_active (prefs->prompt_unwanted_html), NULL); - - /* Labels and Colours */ - list = NULL; - for (i = 4; i >= 0; i--) { - cstring = gtk_entry_get_text (prefs->labels[i].name); - rgb = colorpicker_get_color (prefs->labels[i].color); - string = g_strdup_printf ("%s:#%06x", cstring, rgb & 0xffffff); - list = g_slist_prepend (list, string); - } - - gconf_client_set_list (prefs->gconf, "/apps/evolution/mail/labels", GCONF_VALUE_STRING, list, NULL); - - l = list; - while (l != NULL) { - n = l->next; - g_free (l->data); - g_slist_free_1 (l); - l = n; - } - - /* junk prefs */ - gconf_client_set_bool (prefs->gconf, "/apps/evolution/mail/junk/check_incoming", - gtk_toggle_button_get_active (prefs->check_incoming), NULL); - - gconf_client_suggest_sync (prefs->gconf, NULL); -} diff --git a/mail/em-mailer-prefs.h b/mail/em-mailer-prefs.h deleted file mode 100644 index 27de7b3ca9..0000000000 --- a/mail/em-mailer-prefs.h +++ /dev/null @@ -1,127 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Authors: Jeffrey Stedfast <fejj@ximian.com> - * - * Copyright 2002-2003 Ximian, Inc. (www.ximian.com) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA. - * - */ - - -#ifndef __EM_MAILER_PREFS_H__ -#define __EM_MAILER_PREFS_H__ - -#ifdef __cplusplus -extern "C" { -#pragma } -#endif /* __cplusplus */ - -#include <gtk/gtk.h> -#include <glade/glade.h> -#include <gconf/gconf-client.h> -#include <libgnomeui/gnome-file-entry.h> -#include <libgnomeui/gnome-color-picker.h> -#include <libgnomeui/gnome-font-picker.h> - -#include "evolution-config-control.h" - -#include <shell/Evolution.h> - -#define EM_MAILER_PREFS_TYPE (em_mailer_prefs_get_type ()) -#define EM_MAILER_PREFS(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), EM_MAILER_PREFS_TYPE, EMMailerPrefs)) -#define EM_MAILER_PREFS_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), EM_MAILER_PREFS_TYPE, EMMailerPrefsClass)) -#define EM_IS_MAILER_PREFS(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), EM_MAILER_PREFS_TYPE)) -#define EM_IS_MAILER_PREFS_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), EM_MAILER_PREFS_TYPE)) - -typedef struct _EMMailerPrefs EMMailerPrefs; -typedef struct _EMMailerPrefsClass EMMailerPrefsClass; - -struct _EMMailerPrefs { - GtkVBox parent_object; - - GNOME_Evolution_Shell shell; - - EvolutionConfigControl *control; - - GladeXML *gui; - GConfClient *gconf; - - /* General tab */ - - /* Message Display */ - GtkToggleButton *timeout_toggle; - GtkSpinButton *timeout; - GtkOptionMenu *charset; - GtkToggleButton *citation_highlight; - GnomeColorPicker *citation_color; - - /* Deleting Mail */ - GtkToggleButton *empty_trash; - GtkToggleButton *confirm_expunge; - - /* New Mail Notification */ - GtkToggleButton *notify_not; - GtkToggleButton *notify_beep; - GtkToggleButton *notify_play_sound; - GnomeFileEntry *notify_sound_file; - - /* HTML Mail tab */ - GnomeFontPicker *font_variable; - GnomeFontPicker *font_fixed; - GtkToggleButton *font_share; - - /* Loading Images */ - GtkToggleButton *images_always; - GtkToggleButton *images_sometimes; - GtkToggleButton *images_never; - - GtkToggleButton *show_animated; - GtkToggleButton *autodetect_links; - GtkToggleButton *prompt_unwanted_html; - - /* Labels and Colours tab */ - struct { - GtkEntry *name; - GnomeColorPicker *color; - } labels[5]; - GtkButton *restore_labels; - - /* Junk prefs */ - GtkToggleButton *check_incoming; -}; - -struct _EMMailerPrefsClass { - GtkVBoxClass parent_class; - - /* signals */ - -}; - - -GtkType em_mailer_prefs_get_type (void); - -GtkWidget *em_mailer_prefs_new (void); - -void em_mailer_prefs_apply (EMMailerPrefs *prefs); - -/* needed by global config */ -#define EM_MAILER_PREFS_CONTROL_ID "OAFIID:GNOME_Evolution_Mail_MailerPrefs_ConfigControl:" BASE_VERSION - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __EM_MAILER_PREFS_H__ */ diff --git a/mail/em-marshal.list b/mail/em-marshal.list deleted file mode 100644 index aed944ea0f..0000000000 --- a/mail/em-marshal.list +++ /dev/null @@ -1,5 +0,0 @@ -BOOLEAN:BOXED,POINTER,POINTER -VOID:STRING,STRING -BOOLEAN:POINTER -VOID:POINTER,POINTER -VOID:POINTER diff --git a/mail/em-message-browser.c b/mail/em-message-browser.c deleted file mode 100644 index 9a72fec0c5..0000000000 --- a/mail/em-message-browser.c +++ /dev/null @@ -1,214 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Authors: Michael Zucchi <notzed@ximian.com> - * - * Copyright 2003 Ximian, Inc. (www.ximian.com) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA. - * - */ - - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <gtk/gtkscrolledwindow.h> -#include <gtk/gtkbutton.h> - -#include <camel/camel-folder.h> - -#include <bonobo/bonobo-main.h> -#include <bonobo/bonobo-object.h> -#include <bonobo/bonobo-window.h> -#include <bonobo/bonobo-generic-factory.h> -#include <bonobo/bonobo-ui-component.h> -#include <bonobo/bonobo-ui-util.h> - -#include "em-format-html-display.h" -#include "em-message-browser.h" - -#include "evolution-shell-component-utils.h" /* Pixmap stuff, sigh */ - -struct _EMMessageBrowserPrivate { - GtkWidget *preview; /* container for message display */ -}; - -static void emmb_set_message(EMFolderView *emfv, const char *uid); -static void emmb_activate(EMFolderView *emfv, BonoboUIComponent *uic, int state); - -static EMFolderViewClass *emmb_parent; - -static void -emmb_init(GObject *o) -{ - EMMessageBrowser *emmb = (EMMessageBrowser *)o; - struct _EMMessageBrowserPrivate *p; - - p = emmb->priv = g_malloc0(sizeof(struct _EMMessageBrowserPrivate)); - - ((EMFolderView *)emmb)->preview_active = TRUE; - - g_slist_free(emmb->view.ui_files); - emmb->view.ui_files = g_slist_append(NULL, EVOLUTION_UIDIR "/evolution-mail-message.xml"); - emmb->view.ui_files = g_slist_append(emmb->view.ui_files, EVOLUTION_UIDIR "/evolution-mail-messagedisplay.xml"); - - /* currently: just use a scrolledwindow for preview widget */ - p->preview = gtk_scrolled_window_new(NULL, NULL); - gtk_scrolled_window_set_policy((GtkScrolledWindow *)p->preview, GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); - gtk_scrolled_window_set_shadow_type((GtkScrolledWindow *)p->preview, GTK_SHADOW_IN); - gtk_widget_show(p->preview); - - gtk_container_add((GtkContainer *)p->preview, (GtkWidget *)emmb->view.preview->formathtml.html); - gtk_widget_show((GtkWidget *)emmb->view.preview->formathtml.html); - - gtk_widget_show(p->preview); - - gtk_box_pack_start_defaults((GtkBox *)emmb, p->preview); -} - -static void -emmb_finalise(GObject *o) -{ - EMMessageBrowser *emmb = (EMMessageBrowser *)o; - - g_free(emmb->priv); - ((GObjectClass *)emmb_parent)->finalize(o); -} - -static void -emmb_destroy(GtkObject *o) -{ - EMMessageBrowser *emmb = (EMMessageBrowser *)o; - - if (emmb->view.list) { - gtk_widget_destroy((GtkWidget *)emmb->view.list); - emmb->view.list = NULL; - } - - ((GtkObjectClass *)emmb_parent)->destroy(o); -} - -static void -emmb_class_init(GObjectClass *klass) -{ - klass->finalize = emmb_finalise; - ((GtkObjectClass *)klass)->destroy = emmb_destroy; - ((EMFolderViewClass *)klass)->set_message = emmb_set_message; - ((EMFolderViewClass *)klass)->activate = emmb_activate; -} - -GType -em_message_browser_get_type(void) -{ - static GType type = 0; - - if (type == 0) { - static const GTypeInfo info = { - sizeof(EMMessageBrowserClass), - NULL, NULL, - (GClassInitFunc)emmb_class_init, - NULL, NULL, - sizeof(EMMessageBrowser), 0, - (GInstanceInitFunc)emmb_init - }; - emmb_parent = g_type_class_ref(em_folder_view_get_type()); - type = g_type_register_static(em_folder_view_get_type(), "EMMessageBrowser", &info, 0); - } - - return type; -} - -GtkWidget *em_message_browser_new(void) -{ - EMMessageBrowser *emmb = g_object_new(em_message_browser_get_type(), 0); - - return (GtkWidget *)emmb; -} - -GtkWidget *em_message_browser_window_new(void) -{ - EMMessageBrowser *emmb; - BonoboUIContainer *uicont; - BonoboUIComponent *uic; - - emmb = (EMMessageBrowser *)em_message_browser_new(); - gtk_widget_show((GtkWidget *)emmb); - /* FIXME: title set elsewhere? */ - emmb->window = g_object_new(bonobo_window_get_type(), "title", "Ximian Evolution", NULL); - bonobo_window_set_contents((BonoboWindow *)emmb->window, (GtkWidget *)emmb); - - uicont = bonobo_window_get_ui_container((BonoboWindow *)emmb->window); - uic = bonobo_ui_component_new_default(); - bonobo_ui_component_set_container(uic, BONOBO_OBJREF(uicont), NULL); - - em_folder_view_activate((EMFolderView *)emmb, uic, TRUE); - - /* FIXME: keep track of size changes for next instantation */ - gtk_window_set_default_size((GtkWindow *)emmb->window, 600, 400); - - /* cleanup? */ - - return (GtkWidget *)emmb; -} - -/* ********************************************************************** */ - -static void -emmb_set_message(EMFolderView *emfv, const char *uid) -{ - EMMessageBrowser *emmb = (EMMessageBrowser *) emfv; - CamelMessageInfo *info; - - emmb_parent->set_message(emfv, uid); - - info = camel_folder_get_message_info (emfv->folder, uid); - gtk_window_set_title ((GtkWindow *) emmb->window, camel_message_info_subject (info)); - camel_folder_free_message_info (emfv->folder, info); - - /* Well we don't know if it got displayed (yet) ... but whatever ... */ - camel_folder_set_message_flags(emfv->folder, uid, CAMEL_MESSAGE_SEEN, CAMEL_MESSAGE_SEEN); -} - -static void -emmb_close(BonoboUIComponent *uid, void *data, const char *path) -{ - EMMessageBrowser *emmb = data; - - gtk_widget_destroy(gtk_widget_get_toplevel((GtkWidget *)emmb)); -} - -static BonoboUIVerb emmb_verbs[] = { - BONOBO_UI_UNSAFE_VERB ("MessageBrowserClose", emmb_close), - BONOBO_UI_VERB_END -}; - -static void -emmb_activate(EMFolderView *emfv, BonoboUIComponent *uic, int state) -{ - if (state) { - emmb_parent->activate(emfv, uic, state); - - bonobo_ui_component_add_verb_list_with_data(uic, emmb_verbs, emfv); - bonobo_ui_component_set_prop(uic, "/commands/EditPaste", "sensitive", "0", NULL); - } else { - const BonoboUIVerb *v; - - for (v = &emmb_verbs[0]; v->cname; v++) - bonobo_ui_component_remove_verb(uic, v->cname); - - emmb_parent->activate(emfv, uic, state); - } -} diff --git a/mail/em-message-browser.h b/mail/em-message-browser.h deleted file mode 100644 index c36a87ee0b..0000000000 --- a/mail/em-message-browser.h +++ /dev/null @@ -1,30 +0,0 @@ - -#ifndef _EM_MESSAGE_BROWSER_H -#define _EM_MESSAGE_BROWSER_H - -#include "em-folder-view.h" - -typedef struct _EMMessageBrowser EMMessageBrowser; -typedef struct _EMMessageBrowserClass EMMessageBrowserClass; - -struct _EMMessageBrowser { - EMFolderView view; - - /* container, if setup */ - struct _GtkWidget *window; - - struct _EMMessageBrowserPrivate *priv; -}; - -struct _EMMessageBrowserClass { - EMFolderViewClass parent_class; -}; - -GType em_message_browser_get_type(void); - -GtkWidget *em_message_browser_new(void); - -/* also sets up a bonobo container window w/ docks and so on */ -GtkWidget *em_message_browser_window_new(void); - -#endif /* ! _EM_MESSAGE_BROWSER_H */ diff --git a/mail/em-migrate.c b/mail/em-migrate.c deleted file mode 100644 index 99bc315db0..0000000000 --- a/mail/em-migrate.c +++ /dev/null @@ -1,706 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Authors: Jeffrey Stedfast <fejj@ximian.com> - * - * Copyright 2003 Ximian, Inc. (www.ximian.com) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA. - * - */ - - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <stdio.h> -#include <string.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <unistd.h> -#include <dirent.h> -#include <errno.h> - -#include <gtk/gtk.h> - -#include <camel/camel.h> -#include <camel/camel-session.h> -#include <camel/camel-file-utils.h> - -#include <libxml/tree.h> -#include <libxml/parser.h> -#include <libxml/xmlmemory.h> - -#include <gal/util/e-xml-utils.h> - -#include "em-migrate.h" - - -#define EM_MIGRATE_SESSION_TYPE (em_migrate_session_get_type ()) -#define EM_MIGRATE_SESSION(obj) (CAMEL_CHECK_CAST((obj), EM_MIGRATE_SESSION_TYPE, EMMigrateSession)) -#define EM_MIGRATE_SESSION_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), EM_MIGRATE_SESSION_TYPE, EMMigrateSessionClass)) -#define EM_MIGRATE_IS_SESSION(o) (CAMEL_CHECK_TYPE((o), EM_MIGRATE_SESSION_TYPE)) - -typedef struct _EMMigrateSession { - CamelSession parent_object; - - CamelStore *store; /* new folder tree store */ - char *srcdir; /* old folder tree path */ -} EMMigrateSession; - -typedef struct _EMMigrateSessionClass { - CamelSessionClass parent_class; - -} EMMigrateSessionClass; - -static CamelType em_migrate_session_get_type (void); -static CamelSession *em_migrate_session_new (const char *path); - -static void -class_init (EMMigrateSessionClass *klass) -{ - ; -} - -static CamelType -em_migrate_session_get_type (void) -{ - static CamelType type = CAMEL_INVALID_TYPE; - - if (type == CAMEL_INVALID_TYPE) { - type = camel_type_register ( - camel_session_get_type (), - "EMMigrateSession", - sizeof (EMMigrateSession), - sizeof (EMMigrateSessionClass), - (CamelObjectClassInitFunc) class_init, - NULL, - NULL, - NULL); - } - - return type; -} - -static CamelSession * -em_migrate_session_new (const char *path) -{ - CamelSession *session; - - session = CAMEL_SESSION (camel_object_new (EM_MIGRATE_SESSION_TYPE)); - - camel_session_construct (session, path); - - return session; -} - - -static GtkWidget *window; -static GtkLabel *label; -static GtkProgressBar *progress; - -static void -em_migrate_setup_progress_dialog (void) -{ - GtkWidget *vbox, *hbox, *w; - - window = gtk_window_new (GTK_WINDOW_TOPLEVEL); - gtk_window_set_title ((GtkWindow *) window, _("Migrating...")); - gtk_window_set_modal ((GtkWindow *) window, TRUE); - gtk_container_set_border_width ((GtkContainer *) window, 6); - - vbox = gtk_vbox_new (FALSE, 6); - gtk_widget_show (vbox); - gtk_container_add ((GtkContainer *) window, vbox); - - w = gtk_label_new (_("The location and hierarchy of the Evolution mailbox " - "folders has changed since Evolution 1.x.\n\nPlease be " - "patient while Evolution migrates your folders...")); - gtk_label_set_line_wrap ((GtkLabel *) w, TRUE); - gtk_widget_show (w); - gtk_box_pack_start_defaults ((GtkBox *) vbox, w); - - hbox = gtk_hbox_new (FALSE, 6); - gtk_widget_show (hbox); - gtk_box_pack_start_defaults ((GtkBox *) vbox, hbox); - - label = (GtkLabel *) gtk_label_new (""); - gtk_widget_show ((GtkWidget *) label); - gtk_box_pack_start_defaults ((GtkBox *) hbox, (GtkWidget *) label); - - progress = (GtkProgressBar *) gtk_progress_bar_new (); - gtk_widget_show ((GtkWidget *) progress); - gtk_box_pack_start_defaults ((GtkBox *) hbox, (GtkWidget *) progress); - - gtk_widget_show (window); -} - -static void -em_migrate_close_progress_dialog (void) -{ - gtk_widget_destroy ((GtkWidget *) window); -} - -static void -em_migrate_set_folder_name (const char *folder_name) -{ - char *text; - - text = g_strdup_printf (_("Migrating `%s':"), folder_name); - gtk_label_set_text (label, text); - g_free (text); - - gtk_progress_bar_set_fraction (progress, 0.0); - - while (gtk_events_pending ()) - gtk_main_iteration (); -} - -static void -em_migrate_set_progress (double percent) -{ - char text[5]; - - snprintf (text, sizeof (text), "%d%%", (int) (percent * 100.0f)); - - gtk_progress_bar_set_fraction (progress, percent); - gtk_progress_bar_set_text (progress, text); - - while (gtk_events_pending ()) - gtk_main_iteration (); -} - - -static gboolean -is_mail_folder (const char *metadata) -{ - xmlNodePtr node; - xmlDocPtr doc; - char *type; - - if (!(doc = xmlParseFile (metadata))) { - g_warning ("Cannot parse `%s'", metadata); - return FALSE; - } - - if (!(node = xmlDocGetRootElement (doc))) { - g_warning ("`%s' corrupt: document contains no root node", metadata); - xmlFreeDoc (doc); - return FALSE; - } - - if (!node->name || strcmp (node->name, "efolder") != 0) { - g_warning ("`%s' corrupt: root node is not 'efolder'", metadata); - xmlFreeDoc (doc); - return FALSE; - } - - node = node->children; - while (node != NULL) { - if (node->name && !strcmp (node->name, "type")) { - type = xmlNodeGetContent (node); - if (!strcmp (type, "mail")) { - xmlFreeDoc (doc); - xmlFree (type); - - return TRUE; - } - - xmlFree (type); - - break; - } - - node = node->next; - } - - xmlFreeDoc (doc); - - return FALSE; -} - -static CamelStore * -get_local_store (CamelSession *session, const char *dirname, const char *metadata, char **namep, int *index, CamelException *ex) -{ - char *protocol, *name, *buf; - CamelStore *store; - struct stat st; - xmlNodePtr node; - xmlDocPtr doc; - - if (stat (metadata, &st) == -1 || !S_ISREG (st.st_mode)) { - camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, "`%s' is not a regular file", metadata); - return NULL; - } - - if (!(doc = xmlParseFile (metadata))) { - camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, "cannot parse `%s'", metadata); - return NULL; - } - - if (!(node = xmlDocGetRootElement (doc)) || strcmp (node->name, "folderinfo") != 0) { - camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, "`%s' is malformed", metadata); - xmlFreeDoc (doc); - return NULL; - } - - node = node->children; - while (node != NULL) { - if (node->name && !strcmp (node->name, "folder")) { - protocol = xmlGetProp (node, "type"); - name = xmlGetProp (node, "name"); - buf = xmlGetProp (node, "index"); - if (buf != NULL) { - *index = atoi (buf); - xmlFree (buf); - } else { - *index = 0; - } - - xmlFreeDoc (doc); - - buf = g_strdup_printf ("%s:%s", protocol, dirname); - xmlFree (protocol); - - if ((store = camel_session_get_store (session, buf, ex))) - *namep = g_strdup (name); - else - *namep = NULL; - - xmlFree (name); - - return store; - } - - node = node->next; - } - - xmlFreeDoc (doc); - - camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, "`%s' does not contain needed info", metadata); - - return NULL; -} - -static void -em_migrate_dir (EMMigrateSession *session, const char *dirname, const char *full_name) -{ - guint32 flags = CAMEL_STORE_FOLDER_CREATE; - CamelFolder *old_folder, *new_folder; - CamelStore *local_store; - struct dirent *dent; - CamelException ex; - char *path, *name; - GPtrArray *uids; - struct stat st; - int index, i; - DIR *dir; - - path = g_strdup_printf ("%s/folder-metadata.xml", dirname); - if (stat (path, &st) == -1 || !S_ISREG (st.st_mode)) { - g_free (path); - return; - } - - if (!is_mail_folder (path)) { - g_free (path); - - goto try_subdirs; - } - - g_free (path); - - camel_exception_init (&ex); - - /* get old store & folder */ - path = g_strdup_printf ("%s/local-metadata.xml", dirname); - if (!(local_store = get_local_store ((CamelSession *) session, dirname, path, &name, &index, &ex))) { - g_warning ("error opening old store for `%s': %s", full_name, ex.desc); - camel_exception_clear (&ex); - g_free (path); - - /* try subfolders anyway? */ - goto try_subdirs; - } - - g_free (path); - - if (!(old_folder = camel_store_get_folder (local_store, name, 0, &ex))) { - g_warning ("error opening old folder `%s': %s", full_name, ex.desc); - camel_object_unref (local_store); - camel_exception_clear (&ex); - g_free (name); - - /* try subfolders anyway? */ - goto try_subdirs; - } - - g_free (name); - - flags |= (index ? CAMEL_STORE_FOLDER_BODY_INDEX : 0); - if (!(new_folder = camel_store_get_folder (session->store, full_name, flags, &ex))) { - g_warning ("error creating new mbox folder `%s': %s", full_name, ex.desc); - camel_object_unref (local_store); - camel_object_unref (old_folder); - camel_exception_clear (&ex); - - /* try subfolders anyway? */ - goto try_subdirs; - } - - em_migrate_set_folder_name (full_name); - - uids = camel_folder_get_uids (old_folder); - for (i = 0; i < uids->len; i++) { - CamelMimeMessage *message; - CamelMessageInfo *info; - - if (!(info = camel_folder_get_message_info (old_folder, uids->pdata[i]))) - continue; - - if (!(message = camel_folder_get_message (old_folder, uids->pdata[i], &ex))) { - camel_folder_free_message_info (old_folder, info); - break; - } - - camel_folder_append_message (new_folder, message, info, NULL, &ex); - camel_folder_free_message_info (old_folder, info); - camel_object_unref (message); - - if (camel_exception_is_set (&ex)) - break; - - em_migrate_set_progress (((double) i + 1) / ((double) uids->len)); - } - camel_folder_free_uids (old_folder, uids); - - if (camel_exception_is_set (&ex)) { - g_warning ("error migrating folder `%s': %s", full_name, ex.desc); - camel_object_unref (local_store); - camel_object_unref (old_folder); - camel_object_unref (new_folder); - camel_exception_clear (&ex); - - /* try subfolders anyway? */ - goto try_subdirs; - } - - /*camel_object_unref (local_store);*/ - camel_object_unref (old_folder); - camel_object_unref (new_folder); - - try_subdirs: - - path = g_strdup_printf ("%s/subfolders", dirname); - if (stat (path, &st) == -1 || !S_ISDIR (st.st_mode)) { - g_free (path); - return; - } - - if (!(dir = opendir (path))) { - g_warning ("cannot open `%s': %s", path, strerror (errno)); - g_free (path); - return; - } - - while ((dent = readdir (dir))) { - char *full_path; - - if (dent->d_name[0] == '.') - continue; - - full_path = g_strdup_printf ("%s/%s", path, dent->d_name); - if (stat (full_path, &st) == -1 || !S_ISDIR (st.st_mode)) { - g_free (full_path); - continue; - } - - name = g_strdup_printf ("%s/%s", full_name, dent->d_name); - em_migrate_dir (session, full_path, name); - g_free (full_path); - g_free (name); - } - - closedir (dir); - - g_free (path); -} - -static void -em_migrate_local_folders (EMMigrateSession *session) -{ - struct dirent *dent; - struct stat st; - DIR *dir; - - if (!(dir = opendir (session->srcdir))) { - g_warning ("cannot open `%s': %s", session->srcdir, strerror (errno)); - return; - } - - em_migrate_setup_progress_dialog (); - - while ((dent = readdir (dir))) { - char *full_path; - - if (dent->d_name[0] == '.') - continue; - - full_path = g_strdup_printf ("%s/%s", session->srcdir, dent->d_name); - if (stat (full_path, &st) == -1 || !S_ISDIR (st.st_mode)) { - g_free (full_path); - continue; - } - - em_migrate_dir (session, full_path, dent->d_name); - g_free (full_path); - } - - closedir (dir); - - em_migrate_close_progress_dialog (); -} - - -static xmlNodePtr -xml_find_node (xmlNodePtr parent, const char *name) -{ - xmlNodePtr node; - - node = parent->children; - while (node != NULL) { - if (node->name && !strcmp (node->name, name)) - return node; - - node = node->next; - } - - return NULL; -} - -static char * -em_migrate_uri (const char *uri) -{ - char *path, *prefix, *p; - CamelURL *url; - - if (!strncmp (uri, "file:", 5)) { - url = camel_url_new (uri, NULL); - camel_url_set_protocol (url, "email"); - camel_url_set_user (url, "local"); - camel_url_set_host (url, "local"); - - prefix = g_build_filename (g_get_home_dir (), "evolution", "local", NULL); - g_assert (strncmp (url->path, prefix, strlen (prefix)) == 0); - path = g_strdup (url->path + strlen (prefix)); - g_free (prefix); - - /* modify the path in-place */ - p = path + strlen (path) - 12; - while (p > path) { - if (!strncmp (p, "/subfolders/", 12)) - memmove (p, p + 11, strlen (p + 11) + 1); - - p--; - } - - camel_url_set_path (url, path); - g_free (path); - - path = camel_url_to_string (url, 0); - camel_url_free (url); - - return path; - } else { - return em_uri_from_camel (uri); - } -} - -static int -em_migrate_filter_file (const char *evolution_dir, const char *filename, CamelException *ex) -{ - char *path, *uri, *new; - xmlNodePtr node; - xmlDocPtr doc; - int retval; - - path = g_strdup_printf ("%s/evolution/%s", g_get_home_dir (), filename); - - if (!(doc = xmlParseFile (path))) { - /* can't parse - this means nothing to upgrade */ - g_free (path); - return 0; - } - - g_free (path); - - if (!(node = xmlDocGetRootElement (doc))) { - /* document contains no root node - nothing to upgrade */ - xmlFreeDoc (doc); - return 0; - } - - if (!node->name || strcmp (node->name, "filteroptions") != 0) { - /* root node is not <filteroptions>, nothing to upgrade */ - xmlFreeDoc (doc); - return 0; - } - - if (!(node = xml_find_node (node, "ruleset"))) { - /* no ruleset node, nothing to upgrade */ - xmlFreeDoc (doc); - return 0; - } - - node = node->children; - while (node != NULL) { - if (node->name && !strcmp (node->name, "rule")) { - xmlNodePtr actionset, part, val, n; - - if ((actionset = xml_find_node (node, "actionset"))) { - /* filters.xml */ - part = actionset->children; - while (part != NULL) { - if (part->name && !strcmp (part->name, "part")) { - val = part->children; - while (val != NULL) { - if (val->name && !strcmp (val->name, "value")) { - char *type; - - type = xmlGetProp (val, "type"); - if (type && !strcmp (type, "folder")) { - if ((n = xml_find_node (val, "folder"))) { - uri = xmlGetProp (n, "uri"); - new = em_migrate_uri (uri); - xmlFree (uri); - - xmlSetProp (n, "uri", new); - g_free (new); - } - } - - xmlFree (type); - } - - val = val->next; - } - } - - part = part->next; - } - } else if ((actionset = xml_find_node (node, "sources"))) { - /* vfolders.xml */ - n = actionset->children; - while (n != NULL) { - if (n->name && !strcmp (n->name, "folder")) { - uri = xmlGetProp (n, "uri"); - new = em_uri_from_camel (uri); - xmlFree (uri); - - xmlSetProp (n, "uri", new); - g_free (new); - } - - n = n->next; - } - } - } - - node = node->next; - } - - path = g_strdup_printf ("%s/mail/%s", evolution_dir, filename); - if ((retval = e_xml_save_file (path, doc)) == -1) { - camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, - _("Failed to migrate `%s': %s"), - filename, g_strerror (errno)); - } - - g_free (path); - - xmlFreeDoc (doc); - - return retval; -} - - -int -em_migrate (MailComponent *component, CamelException *ex) -{ - const char *evolution_dir; - EMMigrateSession *session; - CamelException lex; - struct stat st; - char *path; - - evolution_dir = mail_component_peek_base_directory (component); - path = g_strdup_printf ("%s/mail", evolution_dir); - if (stat (path, &st) == -1) { - if (errno != ENOENT || camel_mkdir (path, 0777) == -1) { - camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, - _("Failed to create directory `%s': %s"), - path, g_strerror (errno)); - g_free (path); - return -1; - } - } - - camel_init (path, TRUE); - session = (EMMigrateSession *) em_migrate_session_new (path); - g_free (path); - - session->srcdir = g_strdup_printf ("%s/evolution/local", g_get_home_dir ()); - - path = g_strdup_printf ("mbox:%s/.evolution/mail/local", g_get_home_dir ()); - if (stat (path + 5, &st) == -1) { - if (errno != ENOENT || camel_mkdir (path + 5, 0777) == -1) { - camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, - _("Failed to create directory `%s': %s"), - path + 5, g_strerror (errno)); - g_free (session->srcdir); - camel_object_unref (session); - g_free (path); - return -1; - } - } - - camel_exception_init (&lex); - if (!(session->store = camel_session_get_store ((CamelSession *) session, path, &lex))) { - camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, - _("Failed to open store for `%s': %s"), - path, lex.desc); - g_free (session->srcdir); - camel_object_unref (session); - camel_exception_clear (&lex); - g_free (path); - return -1; - } - g_free (path); - - em_migrate_local_folders (session); - - camel_object_unref (session->store); - g_free (session->srcdir); - - camel_object_unref (session); - - if (em_migrate_filter_file (evolution_dir, "filters.xml", ex) == -1) - return -1; - - if (em_migrate_filter_file (evolution_dir, "vfolders.xml", ex) == -1) - return -1; - - return 0; -} diff --git a/mail/em-migrate.h b/mail/em-migrate.h deleted file mode 100644 index 2ea2b8420e..0000000000 --- a/mail/em-migrate.h +++ /dev/null @@ -1,42 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Authors: Jeffrey Stedfast <fejj@ximian.com> - * - * Copyright 2003 Ximian, Inc. (www.ximian.com) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA. - * - */ - - -#ifndef __EM_MIGRATE_H__ -#define __EM_MIGRATE_H__ - -#include "mail-component.h" - -#include <camel/camel-exception.h> - -#ifdef __cplusplus -extern "C" { -#pragma } -#endif /* __cplusplus */ - -int em_migrate (MailComponent *component, CamelException *ex); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __EM_MIGRATE_H__ */ diff --git a/mail/em-popup.c b/mail/em-popup.c deleted file mode 100644 index 8312be3770..0000000000 --- a/mail/em-popup.c +++ /dev/null @@ -1,839 +0,0 @@ - -#include <string.h> -#include <stdlib.h> - -#include <gtk/gtkmenu.h> -#include <gtk/gtkmenuitem.h> -#include <gtk/gtkimagemenuitem.h> -#include <gtk/gtkcheckmenuitem.h> -#include <gtk/gtkradiomenuitem.h> -#include <gtk/gtkseparatormenuitem.h> -#include <gtk/gtklabel.h> -#include <gtk/gtkimage.h> - -#include <libgnome/gnome-url.h> - -#include <glib.h> - -#include "em-popup.h" -#include "e-util/e-msgport.h" -#include "em-utils.h" - -#include <camel/camel-folder.h> -#include <camel/camel-mime-message.h> -#include <camel/camel-string-utils.h> -#include <camel/camel-url.h> - -static void emp_standard_menu_factory(EMPopup *emp, EMPopupTarget *target, void *data); - -struct _EMPopupFactory { - struct _EMPopupFactory *next, *prev; - - char *menuid; - EMPopupFactoryFunc factory; - void *factory_data; -}; - -struct _menu_node { - struct _menu_node *next, *prev; - - GSList *menu; - GDestroyNotify freefunc; -}; - -struct _EMPopupPrivate { - EDList menus; -}; - -static EDList emp_factories = E_DLIST_INITIALISER(emp_factories); - -static GObjectClass *emp_parent; - -static void -emp_init(GObject *o) -{ - EMPopup *emp = (EMPopup *)o; - struct _EMPopupPrivate *p; - - p = emp->priv = g_malloc0(sizeof(struct _EMPopupPrivate)); - - e_dlist_init(&p->menus); -} - -static void -emp_finalise(GObject *o) -{ - EMPopup *emp = (EMPopup *)o; - struct _EMPopupPrivate *p = emp->priv; - struct _menu_node *mnode, *nnode; - - g_free(emp->menuid); - - mnode = (struct _menu_node *)p->menus.head; - nnode = mnode->next; - while (nnode) { - if (mnode->freefunc) - mnode->freefunc(mnode->menu); - - g_free(mnode); - mnode = nnode; - nnode = nnode->next; - } - - g_free(p); - - ((GObjectClass *)emp_parent)->finalize(o); -} - -static void -emp_class_init(GObjectClass *klass) -{ - klass->finalize = emp_finalise; -} - -GType -em_popup_get_type(void) -{ - static GType type = 0; - - if (type == 0) { - static const GTypeInfo info = { - sizeof(EMPopupClass), - NULL, NULL, - (GClassInitFunc)emp_class_init, - NULL, NULL, - sizeof(EMPopup), 0, - (GInstanceInitFunc)emp_init - }; - emp_parent = g_type_class_ref(G_TYPE_OBJECT); - type = g_type_register_static(G_TYPE_OBJECT, "EMPopup", &info, 0); - - /* FIXME: this should probably sit somewhere in global setup */ - em_popup_static_add_factory(NULL, (EMPopupFactoryFunc)emp_standard_menu_factory, NULL); - } - - return type; -} - -EMPopup *em_popup_new(const char *menuid) -{ - EMPopup *emp = g_object_new(em_popup_get_type(), 0); - - emp->menuid = g_strdup(menuid); - - return emp; -} - -/** - * em_popup_add_items: - * @emp: - * @items: - * @freefunc: - * - * Add new EMPopupItems to the menu's. Any with the same path - * will override previously defined menu items, at menu building - * time. - **/ -void -em_popup_add_items(EMPopup *emp, GSList *items, GDestroyNotify freefunc) -{ - struct _menu_node *node; - - node = g_malloc(sizeof(*node)); - node->menu = items; - node->freefunc = freefunc; - e_dlist_addtail(&emp->priv->menus, (EDListNode *)node); -} - -/** - * em_popup_add_static_items: - * @emp: - * @target: Target of this menu. - * - * Will load up any matching menu items from an installed - * popup factory. If the menuid of @emp is NULL, then this - * has no effect. - * - **/ -void -em_popup_add_static_items(EMPopup *emp, EMPopupTarget *target) -{ - struct _EMPopupFactory *f; - - if (emp->menuid == NULL || target == NULL) - return; - - /* setup the menu itself */ - f = (struct _EMPopupFactory *)emp_factories.head; - while (f->next) { - if (f->menuid == NULL - || !strcmp(f->menuid, emp->menuid)) { - f->factory(emp, target, f->factory_data); - } - f = f->next; - } -} - -static int -emp_cmp(const void *ap, const void *bp) -{ - struct _EMPopupItem *a = *((void **)ap); - struct _EMPopupItem *b = *((void **)bp); - - return strcmp(a->path, b->path); -} - -/** - * em_popup_create: - * @menuitems: - * @hide_mask: used to hide menu items, not sure of it's utility, - * since you could just 'not add them' in the first place. Saves - * copying logic anyway. - * @disable_mask: used to disable menu items. - * - * TEMPORARY code to create a menu from a list of items. - * - * The menu items are merged based on their path element, and - * built into a menu tree. - * - * Return value: - **/ -GtkMenu * -em_popup_create_menu(EMPopup *emp, guint32 hide_mask, guint32 disable_mask) -{ - struct _EMPopupPrivate *p = emp->priv; - struct _menu_node *mnode, *nnode; - GPtrArray *items = g_ptr_array_new(); - GSList *l; - GString *ppath = g_string_new(""); - GtkMenu *topmenu; - GHashTable *menu_hash = g_hash_table_new(g_str_hash, g_str_equal), - *group_hash = g_hash_table_new(g_str_hash, g_str_equal); - /*char *domain = NULL;*/ - int i; - - /* FIXME: need to override old ones with new names */ - mnode = (struct _menu_node *)p->menus.head; - nnode = mnode->next; - while (nnode) { - for (l=mnode->menu; l; l = l->next) - g_ptr_array_add(items, l->data); - mnode = nnode; - nnode = nnode->next; - } - - qsort(items->pdata, items->len, sizeof(items->pdata[0]), emp_cmp); - - topmenu = (GtkMenu *)gtk_menu_new(); - for (i=0;i<items->len;i++) { - GtkWidget *label; - struct _EMPopupItem *item = items->pdata[i]; - GtkMenu *thismenu; - GtkMenuItem *menuitem; - char *tmp; - - /* for bar's, the mask is exclusive or */ - if (item->mask) { - if ((item->type & EM_POPUP_TYPE_MASK) == EM_POPUP_BAR) { - if ((item->mask & hide_mask) == item->mask) - continue; - } else if (item->mask & hide_mask) - continue; - } - - g_string_truncate(ppath, 0); - tmp = strrchr(item->path, '/'); - if (tmp) { - g_string_append_len(ppath, item->path, tmp-item->path); - thismenu = g_hash_table_lookup(menu_hash, ppath->str); - g_assert(thismenu != NULL); - } else { - thismenu = topmenu; - } - - switch (item->type & EM_POPUP_TYPE_MASK) { - case EM_POPUP_ITEM: - if (item->image) { - char *path; - GtkWidget *image; - - path = g_build_filename(EVOLUTION_IMAGES, (char *)item->image, NULL); - image = gtk_image_new_from_file(path); - g_free(path); - - gtk_widget_show(image); - menuitem = (GtkMenuItem *)gtk_image_menu_item_new(); - gtk_image_menu_item_set_image((GtkImageMenuItem *)menuitem, image); - } else { - menuitem = (GtkMenuItem *)gtk_menu_item_new(); - } - break; - case EM_POPUP_TOGGLE: - menuitem = (GtkMenuItem *)gtk_check_menu_item_new(); - gtk_check_menu_item_set_active((GtkCheckMenuItem *)menuitem, item->type & EM_POPUP_ACTIVE); - break; - case EM_POPUP_RADIO: - menuitem = (GtkMenuItem *)gtk_radio_menu_item_new(g_hash_table_lookup(group_hash, ppath->str)); - g_hash_table_insert(group_hash, ppath->str, gtk_radio_menu_item_get_group((GtkRadioMenuItem *)menuitem)); - gtk_check_menu_item_set_active((GtkCheckMenuItem *)menuitem, item->type & EM_POPUP_ACTIVE); - break; - case EM_POPUP_IMAGE: - menuitem = (GtkMenuItem *)gtk_image_menu_item_new(); - gtk_image_menu_item_set_image((GtkImageMenuItem *)menuitem, item->image); - break; - case EM_POPUP_SUBMENU: { - GtkMenu *submenu = (GtkMenu *)gtk_menu_new(); - - g_hash_table_insert(menu_hash, item->path, submenu); - menuitem = (GtkMenuItem *)gtk_menu_item_new(); - gtk_menu_item_set_submenu(menuitem, (GtkWidget *)submenu); - break; } - case EM_POPUP_BAR: - /* TODO: double-bar, end-bar stuff? */ - menuitem = (GtkMenuItem *)gtk_separator_menu_item_new(); - break; - default: - continue; - } - - if (item->label) { - label = gtk_label_new_with_mnemonic(item->label); - gtk_misc_set_alignment((GtkMisc *)label, 0.0, 0.5); - gtk_widget_show(label); - gtk_container_add((GtkContainer *)menuitem, label); - } - - if (item->activate) - g_signal_connect(menuitem, "activate", item->activate, item->activate_data); - - gtk_menu_shell_append((GtkMenuShell *)thismenu, (GtkWidget *)menuitem); - - if (item->mask & disable_mask) - gtk_widget_set_sensitive((GtkWidget *)menuitem, FALSE); - - gtk_widget_show((GtkWidget *)menuitem); - } - - g_string_free(ppath, TRUE); - g_ptr_array_free(items, TRUE); - g_hash_table_destroy(menu_hash); - g_hash_table_destroy(group_hash); - - return topmenu; -} - -static void -emp_popup_done(GtkWidget *w, EMPopup *emp) -{ - gtk_widget_destroy(w); - g_object_unref(emp); -} - -/** - * em_popup_create_menu_once: - * @emp: EMPopup, once the menu is shown, this cannot be - * considered a valid pointer. - * @target: If set, the target of the selection. Static menu - * items will be added. The target will be freed once complete. - * @hide_mask: - * @disable_mask: - * - * Like popup_create_menu, but automatically sets up the menu - * so that it is destroyed once a selection takes place, and - * the EMPopup is unreffed. - * - * Return value: A menu, to popup. - **/ -GtkMenu * -em_popup_create_menu_once(EMPopup *emp, EMPopupTarget *target, guint32 hide_mask, guint32 disable_mask) -{ - GtkMenu *menu; - - if (target) - em_popup_add_static_items(emp, target); - - menu = em_popup_create_menu(emp, hide_mask, disable_mask); - - if (target) - g_signal_connect_swapped(menu, "selection_done", G_CALLBACK(em_popup_target_free), target); - g_signal_connect(menu, "selection_done", G_CALLBACK(emp_popup_done), emp); - - return menu; -} - -/* ********************************************************************** */ - -/** - * em_popup_static_add_factory: - * @menuid: - * @func: - * @data: - * - * Add a popup factory which will be called to add_items() any - * extra menu's if wants to do the current PopupTarget. - * - * TODO: Make the menuid a pattern? - * - * Return value: A handle to the factory. - **/ -EMPopupFactory * -em_popup_static_add_factory(const char *menuid, EMPopupFactoryFunc func, void *data) -{ - struct _EMPopupFactory *f = g_malloc0(sizeof(*f)); - - f->menuid = g_strdup(menuid); - f->factory = func; - f->factory_data = data; - e_dlist_addtail(&emp_factories, (EDListNode *)f); - - return f; -} - -/** - * em_popup_static_remove_factory: - * @f: - * - * Remove a popup factory. - **/ -void -em_popup_static_remove_factory(EMPopupFactory *f) -{ - e_dlist_remove((EDListNode *)f); - g_free(f->menuid); - g_free(f); -} - -/** - * em_popup_target_new_select: - * @folder: The selection will ref this for the life of it. - * @folder_uri: - * @uids: The selection will free this when done with it. - * - * Create a new selection popup target. - * - * Return value: - **/ -EMPopupTarget * -em_popup_target_new_select(struct _CamelFolder *folder, const char *folder_uri, GPtrArray *uids) -{ - EMPopupTarget *t = g_malloc0(sizeof(*t)); - guint32 mask = ~0; - int i; - const char *tmp; - - t->type = EM_POPUP_TARGET_SELECT; - t->data.select.uids = uids; - t->data.select.folder = folder; - camel_object_ref(folder); - t->data.select.folder_uri = g_strdup(folder_uri); - - if (em_utils_folder_is_sent(folder, folder_uri)) - mask &= ~EM_POPUP_SELECT_RESEND; - - if (!(em_utils_folder_is_drafts(folder, folder_uri) - || em_utils_folder_is_outbox(folder, folder_uri))) - mask &= ~EM_POPUP_SELECT_ADD_SENDER; - - if (uids->len == 1) - mask &= ~EM_POPUP_SELECT_ONE; - - if (uids->len >= 1) - mask &= ~EM_POPUP_SELECT_MANY; - - for (i = 0; i < uids->len; i++) { - CamelMessageInfo *info = camel_folder_get_message_info(folder, uids->pdata[i]); - - if (info == NULL) - continue; - - if (info->flags & CAMEL_MESSAGE_SEEN) - mask &= ~EM_POPUP_SELECT_MARK_UNREAD; - else - mask &= ~EM_POPUP_SELECT_MARK_READ; - - if (info->flags & CAMEL_MESSAGE_DELETED) - mask &= ~EM_POPUP_SELECT_UNDELETE; - else - mask &= ~EM_POPUP_SELECT_DELETE; - - if (info->flags & CAMEL_MESSAGE_FLAGGED) - mask &= ~EM_POPUP_SELECT_MARK_UNIMPORTANT; - else - mask &= ~EM_POPUP_SELECT_MARK_IMPORTANT; - - if (info->flags & CAMEL_MESSAGE_JUNK) - mask &= ~EM_POPUP_SELECT_MARK_NOJUNK; - else - mask &= ~EM_POPUP_SELECT_MARK_JUNK; - - tmp = camel_tag_get (&info->user_tags, "follow-up"); - if (tmp && *tmp) { - mask &= ~EM_POPUP_SELECT_FLAG_CLEAR; - tmp = camel_tag_get(&info->user_tags, "completed-on"); - if (tmp == NULL || *tmp == 0) - mask &= ~EM_POPUP_SELECT_FLAG_COMPLETED; - } else - mask &= ~EM_POPUP_SELECT_FLAG_FOLLOWUP; - - if (i == 0 && uids->len == 1 - && (tmp = camel_message_info_mlist(info)) - && tmp[0] != 0) - mask &= ~EM_POPUP_SELECT_MAILING_LIST; - - camel_folder_free_message_info(folder, info); - } - - t->mask = mask; - - return t; -} - -EMPopupTarget * -em_popup_target_new_uri(const char *uri) -{ - EMPopupTarget *t = g_malloc0(sizeof(*t)); - guint32 mask = ~0; - - t->type = EM_POPUP_TARGET_URI; - t->data.uri = g_strdup(uri); - - if (g_ascii_strncasecmp(uri, "http:", 5) == 0 - || g_ascii_strncasecmp(uri, "https:", 6) == 0) - mask &= ~EM_POPUP_URI_HTTP; - if (g_ascii_strncasecmp(uri, "mailto:", 7) == 0) - mask &= ~EM_POPUP_URI_MAILTO; - else - mask &= ~EM_POPUP_URI_NOT_MAILTO; - - t->mask = mask; - - return t; -} - -EMPopupTarget * -em_popup_target_new_part(struct _CamelMimePart *part, const char *mime_type) -{ - EMPopupTarget *t = g_malloc0(sizeof(*t)); - guint32 mask = ~0; - - t->type = EM_POPUP_TARGET_PART; - t->data.part.part = part; - camel_object_ref(part); - if (mime_type) - t->data.part.mime_type = g_strdup(mime_type); - else - t->data.part.mime_type = camel_data_wrapper_get_mime_type((CamelDataWrapper *)part); - - camel_strdown(t->data.part.mime_type); - - if (CAMEL_IS_MIME_MESSAGE(camel_medium_get_content_object((CamelMedium *)part))) - mask &= ~EM_POPUP_PART_MESSAGE; - - if (strncmp(t->data.part.mime_type, "image/", 6) == 0) - mask &= ~EM_POPUP_PART_IMAGE; - - t->mask = mask; - - return t; -} - -void -em_popup_target_free(EMPopupTarget *t) -{ - switch (t->type) { - case EM_POPUP_TARGET_SELECT: - camel_object_unref(t->data.select.folder); - g_free(t->data.select.folder_uri); - if (t->data.select.uids) - em_utils_uids_free(t->data.select.uids); - break; - case EM_POPUP_TARGET_URI: - g_free(t->data.uri); - break; - case EM_POPUP_TARGET_PART: - camel_object_unref(t->data.part.part); - g_free(t->data.part.mime_type); - break; - } - - g_free(t); -} - -/* ********************************************************************** */ - -#if 0 -/* TODO: flesh these out where possible */ -static void -emp_popup_open(GtkWidget *w, EMFolderView *emfv) -{ - em_folder_view_open_selected(emfv); -} - -static void -emp_popup_resend(GtkWidget *w, EMPopupTarget *t) -{ - if (!em_utils_check_user_can_send_mail(t->widget)) - return; - - em_utils_edit_messages(t->widget, t->data.select.folder, em_utils_uids_copy(t->data.select.uids)); -} - -static void -emp_popup_saveas(GtkWidget *w, EMPopupTarget *t) -{ - em_utils_save_messages(t->widget, t->data.select.folder, em_utils_uids_copy(t->data.select.uids)); -} - -static EMPopupItem emp_standard_select_popups[] = { - /*{ EM_POPUP_ITEM, "00.select.00", N_("_Open"), G_CALLBACK(emp_popup_open), NULL, NULL, 0 },*/ - { EM_POPUP_ITEM, "00.select.01", N_("_Edit as New Message..."), G_CALLBACK(emp_popup_resend), NULL, NULL, EM_POPUP_SELECT_RESEND }, - { EM_POPUP_ITEM, "00.select.02", N_("_Save As..."), G_CALLBACK(emp_popup_saveas), NULL, "save-as-16.png", 0 }, -}; -#endif - -/* ********************************************************************** */ - -static void -emp_part_popup_saveas(GtkWidget *w, EMPopupTarget *t) -{ - em_utils_save_part(w, _("Save As..."), t->data.part.part); -} - -static void -emp_part_popup_set_background(GtkWidget *w, EMPopupTarget *t) -{ - /* set as background ... */ - printf("UNIMPLEMENTED: set background, but it would be cool, no?\n"); -} - -static void -emp_part_popup_reply_sender (GtkWidget *w, EMPopupTarget *t) -{ - CamelMimeMessage *message; - - message = (CamelMimeMessage *) camel_medium_get_content_object ((CamelMedium *) t->data.part.part); - em_utils_reply_to_message (message, REPLY_MODE_SENDER); -} - -static void -emp_part_popup_reply_list (GtkWidget *w, EMPopupTarget *t) -{ - CamelMimeMessage *message; - - message = (CamelMimeMessage *) camel_medium_get_content_object ((CamelMedium *) t->data.part.part); - em_utils_reply_to_message (message, REPLY_MODE_LIST); -} - -static void -emp_part_popup_reply_all (GtkWidget *w, EMPopupTarget *t) -{ - CamelMimeMessage *message; - - message = (CamelMimeMessage *) camel_medium_get_content_object ((CamelMedium *) t->data.part.part); - em_utils_reply_to_message (message, REPLY_MODE_ALL); -} - -static void -emp_part_popup_forward (GtkWidget *w, EMPopupTarget *t) -{ - CamelMimeMessage *message; - - message = (CamelMimeMessage *) camel_medium_get_content_object ((CamelMedium *) t->data.part.part); - em_utils_forward_message (message); -} - -static EMPopupItem emp_standard_object_popups[] = { - { EM_POPUP_ITEM, "00.part.00", N_("_Save As..."), G_CALLBACK(emp_part_popup_saveas), NULL, "save-as-16.png", 0 }, - { EM_POPUP_ITEM, "00.part.10", N_("Set as _Background"), G_CALLBACK(emp_part_popup_set_background), NULL, NULL, EM_POPUP_PART_IMAGE }, - { EM_POPUP_BAR, "10.part", NULL, NULL, NULL, NULL, EM_POPUP_PART_MESSAGE }, - { EM_POPUP_ITEM, "10.part.00", N_("_Reply to sender"), G_CALLBACK(emp_part_popup_reply_sender), NULL, "reply.xpm" , EM_POPUP_PART_MESSAGE }, - { EM_POPUP_ITEM, "10.part.01", N_("Reply to _List"), G_CALLBACK(emp_part_popup_reply_list), NULL, NULL, EM_POPUP_PART_MESSAGE}, - { EM_POPUP_ITEM, "10.part.03", N_("Reply to _All"), G_CALLBACK(emp_part_popup_reply_all), NULL, "reply_to_all.xpm", EM_POPUP_PART_MESSAGE}, - { EM_POPUP_BAR, "20.part", NULL, NULL, NULL, NULL, EM_POPUP_PART_MESSAGE }, - { EM_POPUP_ITEM, "20.part.00", N_("_Forward"), G_CALLBACK(emp_part_popup_forward), NULL, "forward.xpm", EM_POPUP_PART_MESSAGE }, - -}; - -static const EMPopupItem emp_standard_part_apps_bar = { EM_POPUP_BAR, "99.object" }; - -/* ********************************************************************** */ - -static void -emp_uri_popup_link_open(GtkWidget *w, EMPopupTarget *t) -{ - GError *err = NULL; - - gnome_url_show(t->data.uri, &err); - if (err) { - g_warning("gnome_url_show: %s", err->message); - g_error_free(err); - } -} - -static void -emp_uri_popup_address_send (GtkWidget *w, EMPopupTarget *t) -{ - em_utils_compose_new_message_with_mailto (t->data.uri); -} - -static void -emp_uri_popup_address_add(GtkWidget *w, EMPopupTarget *t) -{ - CamelURL *url; - - url = camel_url_new(t->data.uri, NULL); - if (url == NULL) { - g_warning("cannot parse url '%s'", t->data.uri); - return; - } - - if (url->path && url->path[0]) - em_utils_add_address(w, url->path); - - camel_url_free(url); -} - -static EMPopupItem emp_standard_uri_popups[] = { - { EM_POPUP_ITEM, "00.uri.00", N_("_Open Link in Browser"), G_CALLBACK(emp_uri_popup_link_open), NULL, NULL, EM_POPUP_URI_NOT_MAILTO }, - { EM_POPUP_ITEM, "00.uri.10", N_("Se_nd message to..."), G_CALLBACK(emp_uri_popup_address_send), NULL, NULL, EM_POPUP_URI_MAILTO }, - { EM_POPUP_ITEM, "00.uri.20", N_("_Add to Addressbook"), G_CALLBACK(emp_uri_popup_address_add), NULL, NULL, EM_POPUP_URI_MAILTO }, -}; - -/* ********************************************************************** */ - -#define LEN(x) (sizeof(x)/sizeof(x[0])) - -#include <libgnomevfs/gnome-vfs-mime-handlers.h> - -struct _open_in_item { - EMPopupItem item; - EMPopupTarget *target; - GnomeVFSMimeApplication *app; -}; - -static void -emp_apps_open_in(GtkWidget *w, struct _open_in_item *item) -{ - char *path; - - path = em_utils_temp_save_part(item->target->widget, item->target->data.part.part); - if (path) { - char *command; - int douri = (item->app->expects_uris == GNOME_VFS_MIME_APPLICATION_ARGUMENT_TYPE_URIS); - - command = g_strdup_printf(douri?"%s file://%s &":"%s %s &", item->app->command, path); - - /* FIXME: Do not use system here */ - system(command); - g_free(command); - g_free(path); - } -} - -static void -emp_apps_popup_free(GSList *free_list) -{ - while (free_list) { - GSList *n = free_list->next; - struct _open_in_item *item = free_list->data; - - g_free(item->item.path); - g_free(item->item.label); - g_free(item); - g_slist_free_1(free_list); - - free_list = n; - } -} - -static void -emp_standard_menu_factory(EMPopup *emp, EMPopupTarget *target, void *data) -{ - int i, len; - EMPopupItem *items; - GSList *menus = NULL; - - switch (target->type) { - case EM_POPUP_TARGET_SELECT: - return; -#if 0 - items = emp_standard_select_popups; - len = LEN(emp_standard_select_popups); - break; -#endif - case EM_POPUP_TARGET_URI: - items = emp_standard_uri_popups; - len = LEN(emp_standard_uri_popups); - break; - case EM_POPUP_TARGET_PART: { - GList *apps = gnome_vfs_mime_get_short_list_applications(target->data.part.mime_type); - - /* FIXME: use the snoop_part stuff from em-format.c */ - if (apps == NULL && strcmp(target->data.part.mime_type, "application/octet-stream") == 0) { - const char *filename, *name_type; - - filename = camel_mime_part_get_filename(target->data.part.part); - - if (filename) { - /* GNOME-VFS will misidentify TNEF attachments as MPEG */ - if (!strcmp (filename, "winmail.dat")) - name_type = "application/vnd.ms-tnef"; - else - name_type = gnome_vfs_mime_type_from_name(filename); - if (name_type) - apps = gnome_vfs_mime_get_short_list_applications(name_type); - } - } - - if (apps) { - GString *label = g_string_new(""); - GSList *open_menus = NULL; - GList *l; - - menus = g_slist_prepend(menus, (void *)&emp_standard_part_apps_bar); - - for (l = apps, i = 0; l; l = l->next, i++) { - GnomeVFSMimeApplication *app = l->data; - struct _open_in_item *item; - - if (app->requires_terminal) - continue; - - item = g_malloc0(sizeof(*item)); - item->item.type = EM_POPUP_ITEM; - item->item.path = g_strdup_printf("99.object.%02d", i); - item->item.label = g_strdup_printf(_("Open in %s..."), app->name); - item->item.activate = G_CALLBACK(emp_apps_open_in); - item->item.activate_data = item; - item->target = target; - item->app = app; - - open_menus = g_slist_prepend(open_menus, item); - } - - if (open_menus) - em_popup_add_items(emp, open_menus, (GDestroyNotify)emp_apps_popup_free); - - g_string_free(label, TRUE); - g_list_free(apps); - } - - items = emp_standard_object_popups; - len = LEN(emp_standard_object_popups); - break; } - default: - items = NULL; - len = 0; - g_assert_not_reached (); - } - - for (i=0;i<len;i++) { - if ((items[i].mask & target->mask) == 0) { - items[i].activate_data = target; - menus = g_slist_prepend(menus, &items[i]); - } - } - - if (menus) - em_popup_add_items(emp, menus, (GDestroyNotify)g_slist_free); -} diff --git a/mail/em-popup.h b/mail/em-popup.h deleted file mode 100644 index 831d586efe..0000000000 --- a/mail/em-popup.h +++ /dev/null @@ -1,171 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- - * - * Authors: Michel Zucchi <notzed@ximian.com> - * - * Copyright 2003 Ximian, Inc. (www.ximian.com) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA. - * - */ - -#ifndef __EM_POPUP_H__ -#define __EM_POPUP_H__ - -#include <glib-object.h> - -#ifdef __cplusplus -extern "C" { -#pragma } -#endif /* __cplusplus */ - -/* NB: This is TEMPORARY, to be replaced by EggMenu, if it does what we need? */ - -typedef struct _EMPopup EMPopup; -typedef struct _EMPopupClass EMPopupClass; - -typedef struct _EMPopupItem EMPopupItem; -typedef struct _EMPopupFactory EMPopupFactory; /* anonymous type */ -typedef struct _EMPopupTarget EMPopupTarget; - -typedef void (*EMPopupFactoryFunc)(EMPopup *emp, EMPopupTarget *target, void *data); - -/* Menu item descriptions */ -enum _em_popup_t { - EM_POPUP_ITEM = 0, - EM_POPUP_TOGGLE, - EM_POPUP_RADIO, - EM_POPUP_IMAGE, - EM_POPUP_SUBMENU, - EM_POPUP_BAR, - EM_POPUP_TYPE_MASK = 0xffff, - EM_POPUP_ACTIVE = 0x10000, -}; - -struct _EMPopupItem { - enum _em_popup_t type; - char *path; /* absolute path! must sort ascii-lexographically into the right spot */ - char *label; - GCallback activate; - void *activate_data; - void *image; /* char* for item type, GtkWidget * for image type */ - guint32 mask; -}; - -/* Current target description */ -/* Types of popup tagets */ -enum _em_popup_target_t { - EM_POPUP_TARGET_SELECT, - EM_POPUP_TARGET_URI, - EM_POPUP_TARGET_PART, - EM_POPUP_TARGET_FOLDER, -}; - -/* Flags that describe a TARGET_SELECT */ -enum { - EM_POPUP_SELECT_ONE = 1<<1, - EM_POPUP_SELECT_MANY = 1<<2, - EM_POPUP_SELECT_MARK_READ = 1<<3, - EM_POPUP_SELECT_MARK_UNREAD = 1<<4, - EM_POPUP_SELECT_DELETE = 1<<5, - EM_POPUP_SELECT_UNDELETE = 1<<6, - EM_POPUP_SELECT_MAILING_LIST = 1<<7, - EM_POPUP_SELECT_RESEND = 1<<8, - EM_POPUP_SELECT_MARK_IMPORTANT = 1<<9, - EM_POPUP_SELECT_MARK_UNIMPORTANT = 1<<10, - EM_POPUP_SELECT_FLAG_FOLLOWUP = 1<<11, - EM_POPUP_SELECT_FLAG_COMPLETED = 1<<12, - EM_POPUP_SELECT_FLAG_CLEAR = 1<<13, - EM_POPUP_SELECT_ADD_SENDER = 1<<14, - EM_POPUP_SELECT_MARK_JUNK = 1<<15, - EM_POPUP_SELECT_MARK_NOJUNK = 1<<16, - EM_POPUP_SELECT_LAST = 1<<18 /* reserve 2 slots */ -}; - -/* Flags that describe a TARGET_URI */ -enum { - EM_POPUP_URI_HTTP = 1<<0, - EM_POPUP_URI_MAILTO = 1<<1, - EM_POPUP_URI_NOT_MAILTO = 1<<2, -}; - -/* Flags that describe TARGET_PART */ -enum { - EM_POPUP_PART_MESSAGE = 1<<0, - EM_POPUP_PART_IMAGE = 1<<1, -}; - -/* Flags that describe TARGET_FOLDER */ -enum { - EM_POPUP_FOLDER_LOCAL = 1<<0, - EM_POPUP_FOLDER_REMOTE = 1<<1, - EM_POPUP_FOLDER_VFOLDER = 1<<2, -}; - -struct _EMPopupTarget { - enum _em_popup_target_t type; - guint32 mask; /* depends on type, see above */ - struct _GtkWidget *widget; /* used if you need a parent toplevel, if available */ - union { - char *uri; - struct { - struct _CamelFolder *folder; - char *folder_uri; - GPtrArray *uids; - } select; - struct { - char *mime_type; - struct _CamelMimePart *part; - } part; - struct { - char *folder_uri; - } folder; - } data; -}; - -/* The object */ -struct _EMPopup { - GObject object; - - struct _EMPopupPrivate *priv; - - char *menuid; -}; - -struct _EMPopupClass { - GObjectClass object_class; -}; - -GType em_popup_get_type(void); - -/* Static class methods */ -EMPopupFactory *em_popup_static_add_factory(const char *menuid, EMPopupFactoryFunc func, void *data); -void em_popup_static_remove_factory(EMPopupFactory *f); - -EMPopup *em_popup_new(const char *menuid); -void em_popup_add_items(EMPopup *, GSList *items, GDestroyNotify freefunc); -void em_popup_add_static_items(EMPopup *emp, EMPopupTarget *target); -struct _GtkMenu *em_popup_create_menu(EMPopup *, guint32 hide_mask, guint32 disable_mask); -struct _GtkMenu *em_popup_create_menu_once(EMPopup *emp, EMPopupTarget *, guint32 hide_mask, guint32 disable_mask); - -EMPopupTarget *em_popup_target_new_uri(const char *uri); -EMPopupTarget *em_popup_target_new_select(struct _CamelFolder *folder, const char *folder_uri, GPtrArray *uids); -EMPopupTarget *em_popup_target_new_part(struct _CamelMimePart *part, const char *mime_type); -void em_popup_target_free(EMPopupTarget *target); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __EM_POPUP_H__ */ diff --git a/mail/em-subscribe-editor.c b/mail/em-subscribe-editor.c deleted file mode 100644 index 1fb9066362..0000000000 --- a/mail/em-subscribe-editor.c +++ /dev/null @@ -1,853 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- - * em-subscribe-editor.c * - * - * Authors: Michael Zucchi <notzed@ximian.com> - * - * Copyright 2003 Ximian, Inc. (www.ximian.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public - * License as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - * - */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <string.h> - -#include <pthread.h> - -/*#include "evolution-shell-component-utils.h" - #include "mail.h"*/ -#include "mail-tools.h" -#include "mail-ops.h" -#include "mail-mt.h" -/*#include "mail-folder-cache.h"*/ -#include "camel/camel-exception.h" -#include "camel/camel-store.h" -#include "camel/camel-session.h" -#include "e-util/e-account-list.h" - -#include "em-subscribe-editor.h" - -#include "mail-config.h" - -#include <glade/glade.h> - -#include <gtk/gtkdialog.h> -#include <gtk/gtkscrolledwindow.h> -#include <gtk/gtkbox.h> -#include <gtk/gtklabel.h> -#include <gtk/gtktreeview.h> -#include <gtk/gtktreestore.h> -#include <gtk/gtktreeselection.h> -#include <gtk/gtkcellrenderertoggle.h> -#include <gtk/gtkcellrenderertext.h> -#include <gtk/gtkoptionmenu.h> -#include <gtk/gtkprogressbar.h> -#include <gtk/gtkmenuitem.h> - -#define d(x) - -typedef struct _EMSubscribeEditor EMSubscribeEditor; -struct _EMSubscribeEditor { - EDList stores; - - int busy; - guint busy_id; - - struct _EMSubscribe *current; /* the current one, if any */ - - GtkDialog *dialog; - GtkWidget *vbox; /* where new stores are added */ - GtkWidget *optionmenu; - GtkWidget *none_selected; /* 'please select a xxx' message */ - GtkWidget *none_selected_item; - GtkWidget *subscribe_button; - GtkWidget *unsubscribe_button; - GtkWidget *progress; -}; - -typedef struct _EMSubscribe EMSubscribe; -struct _EMSubscribe { - struct _EMSubscribe *next; - struct _EMSubscribe *prev; - - int ref_count; - int cancel; - - struct _EMSubscribeEditor *editor; /* parent object*/ - - char *store_uri; - int store_id; /* looking up a store */ - - CamelStore *store; - GHashTable *folders; - - GtkWidget *widget; /* widget to show for this store */ - GtkTreeView *tree; /* tree, if we have it */ - - /* list of all returns from get_folder_info, accessed by other structures */ - GSList *info_list; - - /* pending LISTs, EMSubscribeNode's */ - int pending_id; - EDList pending; - - /* queue of pending UN/SUBSCRIBEs, EMsg's */ - int subscribe_id; - EDList subscribe; - - /* working variables at runtime */ - int selected_count; - int selected_subscribed_count; - gboolean subscribed_state:1; /* for setting the selection*/ -}; - -typedef struct _EMSubscribeNode EMSubscribeNode; -struct _EMSubscribeNode { - struct _EMSubscribeNode *next; - struct _EMSubscribeNode *prev; - - CamelFolderInfo *info; - GtkTreePath *path; -}; - -static void sub_editor_busy(EMSubscribeEditor *se, int dir); -static int sub_queue_fill_level(EMSubscribe *sub, EMSubscribeNode *node); -static void sub_selection_changed(GtkTreeSelection *selection, EMSubscribe *sub); - -static void -sub_node_free(char *key, EMSubscribeNode *node, EMSubscribe *sub) -{ - d(printf("sub node free '%s'\n", node->info?node->info->full_name:"<unknown>")); - if (node->path) - gtk_tree_path_free(node->path); - g_free(node); -} - -static void -sub_ref(EMSubscribe *sub) -{ - sub->ref_count++; -} - -static void -sub_unref(EMSubscribe *sub) -{ - GSList *l; - - sub->ref_count--; - if (sub->ref_count == 0) { - d(printf("subscribe object finalised\n")); - /* we dont have to delete the "subscribe" task list, as it must be empty, - otherwise we wouldn't be unreffed (intentional circular reference) */ - if (sub->folders) { - g_hash_table_foreach(sub->folders, (GHFunc)sub_node_free, sub); - g_hash_table_destroy(sub->folders); - } - l = sub->info_list; - while (l) { - GSList *n = l->next; - - camel_store_free_folder_info(sub->store, (CamelFolderInfo *)l->data); - g_slist_free_1(l); - l = n; - } - if (sub->store) - camel_object_unref(sub->store); - g_free(sub->store_uri); - g_free(sub); - } -} - -/* ** Subscribe folder operation **************************************** */ - -struct _zsubscribe_msg { - struct _mail_msg msg; - - EMSubscribe *sub; - EMSubscribeNode *node; - int subscribe; - char *path; -}; - -static void -sub_folder_subscribe (struct _mail_msg *mm) -{ - struct _zsubscribe_msg *m = (struct _zsubscribe_msg *) mm; - - if (m->subscribe) - camel_store_subscribe_folder (m->sub->store, m->node->info->full_name, &mm->ex); - else - camel_store_unsubscribe_folder (m->sub->store, m->node->info->full_name, &mm->ex); -} - -static void -sub_folder_subscribed (struct _mail_msg *mm) -{ - struct _zsubscribe_msg *m = (struct _zsubscribe_msg *)mm, *next; - GtkTreeIter iter; - GtkTreeModel *model; - EMSubscribeNode *node; - gboolean subscribed, issub; - - m->sub->subscribe_id = -1; - if (m->sub->cancel) - return; - - if (!camel_exception_is_set(&mm->ex)) { - if (m->subscribe) - m->node->info->flags |= CAMEL_FOLDER_SUBSCRIBED; - else - m->node->info->flags &= ~CAMEL_FOLDER_SUBSCRIBED; - } - - /* make sure the tree view matches the correct state */ - model = gtk_tree_view_get_model(m->sub->tree); - if (gtk_tree_model_get_iter_from_string(model, &iter, m->path)) { - issub = (m->node->info->flags & CAMEL_FOLDER_SUBSCRIBED) != 0; - gtk_tree_model_get(model, &iter, 0, &subscribed, 2, &node, -1); - if (node == m->node) - gtk_tree_store_set((GtkTreeStore *)model, &iter, 0, issub, -1); - else - d(printf("node mismatch, or subscribe state changed failed\n")); - } - - /* queue any further ones, or if out, update the ui */ - next = (struct _zsubscribe_msg *)e_dlist_remhead(&m->sub->subscribe); - if (next) { - next->sub->subscribe_id = next->msg.seq; - e_thread_put(mail_thread_new, (EMsg *)next); - } else { - /* should it go off the model instead? */ - sub_selection_changed(gtk_tree_view_get_selection(m->sub->tree), m->sub); - } -} - -static void -sub_folder_free (struct _mail_msg *mm) -{ - struct _zsubscribe_msg *m = (struct _zsubscribe_msg *) mm; - - g_free(m->path); - sub_unref(m->sub); -} - -static struct _mail_msg_op sub_subscribe_folder_op = { - NULL, /*subscribe_folder_desc,*/ - sub_folder_subscribe, - sub_folder_subscribed, - sub_folder_free, -}; - -/* spath is tree path in string form */ -static int -sub_subscribe_folder (EMSubscribe *sub, EMSubscribeNode *node, int state, const char *spath) -{ - struct _zsubscribe_msg *m; - int id; - - m = mail_msg_new (&sub_subscribe_folder_op, NULL, sizeof(*m)); - m->sub = sub; - sub_ref(sub); - m->node = node; - m->subscribe = state; - m->path = g_strdup(spath); - - id = m->msg.seq; - if (sub->subscribe_id == -1) { - sub->subscribe_id = id; - d(printf("running subscribe folder '%s'\n", spath)); - e_thread_put (mail_thread_new, (EMsg *)m); - } else { - d(printf("queueing subscribe folder '%s'\n", spath)); - e_dlist_addtail(&sub->subscribe, (EDListNode *)m); - } - - return id; -} - -/* ********************************************************************** */ -static void -sub_fill_level(EMSubscribe *sub, CamelFolderInfo *info, GtkTreeIter *parent, int pending) -{ - CamelFolderInfo *fi; - GtkTreeStore *treestore; - GtkTreeIter iter; - EMSubscribeNode *node; - - treestore = (GtkTreeStore *)gtk_tree_view_get_model(sub->tree); - - /* first, fill a level up */ - fi = info; - while (fi) { - if (g_hash_table_lookup(sub->folders, fi->full_name) == NULL) { - gboolean state; - - gtk_tree_store_append(treestore, &iter, parent); - node = g_malloc0(sizeof(*node)); - node->info = fi; - /* FIXME: CAMEL_FOLDER_SUBSCRIBED not implemented properly in imap */ - state = camel_store_folder_subscribed(sub->store, fi->full_name); - /* state = (fi->flags & CAMEL_FOLDER_SUBSCRIBED) != 0; */ - gtk_tree_store_set(treestore, &iter, 0, state, 1, fi->name, 2, node, -1); - if ((fi->flags & CAMEL_FOLDER_NOINFERIORS) == 0) { - node->path = gtk_tree_model_get_path((GtkTreeModel *)treestore, &iter); - if (node->path) { - /* save time, if we have any children alread, dont re-scan */ - if (fi->child) { - d(printf("scanning child '%s'\n", fi->child->full_name)); - sub_fill_level(sub, fi->child, &iter, FALSE); - } else { - if (pending) - e_dlist_addtail(&sub->pending, (EDListNode *)node); - } - } - } - g_hash_table_insert(sub->folders, fi->full_name, node); - } - fi = fi->sibling; - } -} - -/* async query of folderinfo */ - -struct _emse_folderinfo_msg { - struct _mail_msg msg; - - EMSubscribe *sub; - EMSubscribeNode *node; - CamelFolderInfo *info; -}; - -static void -sub_folderinfo_get (struct _mail_msg *mm) -{ - struct _emse_folderinfo_msg *m = (struct _emse_folderinfo_msg *) mm; - - camel_operation_register(mm->cancel); - m->info = camel_store_get_folder_info (m->sub->store, m->node?m->node->info->full_name:"", CAMEL_STORE_FOLDER_INFO_FAST, &mm->ex); - camel_operation_unregister(mm->cancel); -} - -static void -sub_folderinfo_got(struct _mail_msg *mm) -{ - struct _emse_folderinfo_msg *m = (struct _emse_folderinfo_msg *) mm; - EMSubscribeNode *node; - - m->sub->pending_id = -1; - if (m->sub->cancel) - return; - - if (camel_exception_is_set (&mm->ex)) { - g_warning ("Error getting folder info from store: %s", - camel_exception_get_description (&mm->ex)); - } - - if (m->info) { - if (m->node) { - GtkTreeIter iter; - - gtk_tree_model_get_iter(gtk_tree_view_get_model(m->sub->tree), &iter, m->node->path); - sub_fill_level(m->sub, m->info, &iter, FALSE); - } else { - sub_fill_level(m->sub, m->info, NULL, TRUE); - } - } - - /* check for more to do */ - node = (EMSubscribeNode *)e_dlist_remhead(&m->sub->pending); - if (node) - sub_queue_fill_level(m->sub, node); -} - -static void -sub_folderinfo_free(struct _mail_msg *mm) -{ - struct _emse_folderinfo_msg *m = (struct _emse_folderinfo_msg *) mm; - - if (m->info) - m->sub->info_list = g_slist_prepend(m->sub->info_list, m->info); - - if (!m->sub->cancel) - sub_editor_busy(m->sub->editor, -1); - - sub_unref(m->sub); -} - -static struct _mail_msg_op sub_folderinfo_op = { - NULL, /*sub_folderinfo_desc, we do our own progress reporting/cancellation */ - sub_folderinfo_get, - sub_folderinfo_got, - sub_folderinfo_free, -}; - -static int -sub_queue_fill_level(EMSubscribe *sub, EMSubscribeNode *node) -{ - struct _emse_folderinfo_msg *m; - int id; - - d(printf("Starting get folderinfo of '%s'\n", node?node->info->full_name:"<root>")); - - m = mail_msg_new (&sub_folderinfo_op, NULL, sizeof(*m)); - sub_ref(sub); - m->sub = sub; - m->node = node; - - sub->pending_id = m->msg.seq; - - sub_editor_busy(sub->editor, 1); - - e_thread_put (mail_thread_new, (EMsg *)m); - return id; -} - -/* ********************************************************************** */ - -/* (un) subscribes the current selection */ -static void sub_do_subscribe(GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, void *data) -{ - EMSubscribe *sub = data; - EMSubscribeNode *node; - gboolean subscribed; - - gtk_tree_model_get(model, iter, 0, &subscribed, 2, &node, -1); - if (sub->subscribed_state ^ subscribed) { - char *spath; - - spath = gtk_tree_path_to_string(path); - gtk_tree_store_set((GtkTreeStore *)model, iter, 0, subscribed, -1); - sub_subscribe_folder(sub, node, sub->subscribed_state, spath); - g_free(spath); - } -} - -static void -sub_subscribe(EMSubscribe *sub, gboolean subscribed) -{ - GtkTreeSelection *selection; - - if (sub->tree == NULL) - return; - - sub->subscribed_state = subscribed; - selection = gtk_tree_view_get_selection (sub->tree); - gtk_tree_selection_selected_foreach(selection, sub_do_subscribe, sub); -} - -static void -sub_subscribe_toggled(GtkCellRendererToggle *render, const char *spath, EMSubscribe *sub) -{ - GtkTreeIter iter; - GtkTreeModel *model = gtk_tree_view_get_model(sub->tree); - EMSubscribeNode *node; - gboolean subscribed; - - d(printf("subscribe toggled?\n")); - - if (gtk_tree_model_get_iter_from_string(model, &iter, spath)) { - gtk_tree_model_get(model, &iter, 0, &subscribed, 2, &node, -1); - subscribed = !subscribed; - d(printf("new state is %s\n", subscribed?"subscribed":"not subscribed")); - gtk_tree_store_set((GtkTreeStore *)model, &iter, 0, subscribed, -1); - sub_subscribe_folder(sub, node, subscribed, spath); - } -} - -static void sub_do_changed(GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, void *data) -{ - EMSubscribe *sub = data; - EMSubscribeNode *node; - gboolean subscribed; - - gtk_tree_model_get(model, iter, 0, &subscribed, 2, &node, -1); - - if (subscribed) - sub->selected_subscribed_count++; - sub->selected_count++; -} - -static void -sub_selection_changed(GtkTreeSelection *selection, EMSubscribe *sub) -{ - int dosub = TRUE, dounsub = TRUE; - - sub->selected_count = 0; - sub->selected_subscribed_count = 0; - gtk_tree_selection_selected_foreach(selection, sub_do_changed, sub); - - if (sub->selected_count == 0) { - dosub = FALSE; - dounsub = FALSE; - } else if (sub->selected_subscribed_count == sub->selected_count) - dosub = FALSE; - else if (sub->selected_subscribed_count == 0) - dounsub = FALSE; - - gtk_widget_set_sensitive(sub->editor->subscribe_button, dosub); - gtk_widget_set_sensitive(sub->editor->unsubscribe_button, dounsub); -} - -static void -sub_row_expanded(GtkTreeView *tree, GtkTreeIter *iter, GtkTreePath *path, EMSubscribe *sub) -{ - EMSubscribeNode *node; - GtkTreeIter child; - GtkTreeModel *model = (GtkTreeModel *)gtk_tree_view_get_model(tree); - EDList list; - - gtk_tree_model_get(model, iter, 2, &node, -1); - if (node->path == NULL) { - d(printf("path '%s' already processed\n", node->info->full_name)); - return; - } - gtk_tree_path_free(node->path); - node->path = NULL; - - e_dlist_init(&list); - - /* add all children nodes to pending, and fire off a pending */ - /* we add them to the head of the pending list, to make it more interactive */ - gtk_tree_model_iter_children(model, &child, iter); - do { - gtk_tree_model_get(model, &child, 2, &node, -1); - if (node->path) - e_dlist_addtail(&list, (EDListNode *)node); - } while (gtk_tree_model_iter_next(model, &child)); - - while ( (node = (EMSubscribeNode *)e_dlist_remtail(&list)) ) - e_dlist_addhead(&sub->pending, (EDListNode *)node); - - if (sub->pending_id == -1 - && (node = (EMSubscribeNode *)e_dlist_remtail(&sub->pending))) - sub_queue_fill_level(sub, node); -} - -static void -sub_destroy(GtkWidget *w, EMSubscribe *sub) -{ - struct _zsubscribe_msg *m; - - d(printf("subscribe closed\n")); - sub->cancel = TRUE; - - if (sub->pending_id != -1) - mail_msg_cancel(sub->pending_id); - - if (sub->subscribe_id != -1) - mail_msg_cancel(sub->subscribe_id); - - while ( (m = (struct _zsubscribe_msg *)e_dlist_remhead(&sub->subscribe)) ) - mail_msg_free(m); - - sub_unref(sub); -} - -static EMSubscribe * -subscribe_new(EMSubscribeEditor *se, const char *uri) -{ - EMSubscribe *sub; - - sub = g_malloc0(sizeof(*sub)); - sub->store_uri = g_strdup(uri); - sub->editor = se; - sub->ref_count = 1; - sub->pending_id = -1; - e_dlist_init(&sub->pending); - sub->subscribe_id = -1; - e_dlist_init(&sub->subscribe); - sub->store_id = -1; - - return sub; -} - -static void -subscribe_set_store(EMSubscribe *sub, CamelStore *store) -{ - if (store == NULL || !camel_store_supports_subscriptions(store)) { - GtkWidget *w = gtk_label_new(_("This store does not support subscriptions, or the are not enabled.")); - - gtk_label_set_line_wrap((GtkLabel *)w, TRUE); - sub->widget = gtk_viewport_new(NULL, NULL); - gtk_viewport_set_shadow_type((GtkViewport *)sub->widget, GTK_SHADOW_IN); - gtk_container_add((GtkContainer *)sub->widget, w); - gtk_widget_show(w); - gtk_widget_show(sub->widget); - } else { - GtkTreeSelection *selection; - GtkCellRenderer *renderer; - GtkTreeStore *model; - - sub->store = store; - camel_object_ref(store); - sub->folders = g_hash_table_new(g_str_hash, g_str_equal); - - model = gtk_tree_store_new (3, G_TYPE_BOOLEAN, G_TYPE_STRING, G_TYPE_POINTER); - sub->tree = (GtkTreeView *) gtk_tree_view_new_with_model ((GtkTreeModel *) model); - gtk_widget_show ((GtkWidget *)sub->tree); - - sub->widget = gtk_scrolled_window_new (NULL, NULL); - gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sub->widget), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); - gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (sub->widget), GTK_SHADOW_IN); - gtk_container_add((GtkContainer *)sub->widget, (GtkWidget *)sub->tree); - gtk_widget_show(sub->widget); - - renderer = gtk_cell_renderer_toggle_new (); - g_object_set(renderer, "activatable", TRUE, NULL); - gtk_tree_view_insert_column_with_attributes (sub->tree, -1, _("Subscribed"), renderer, "active", 0, NULL); - g_signal_connect(renderer, "toggled", G_CALLBACK(sub_subscribe_toggled), sub); - - renderer = gtk_cell_renderer_text_new (); - gtk_tree_view_insert_column_with_attributes (sub->tree, -1, _("Folder"), renderer, "text", 1, NULL); - gtk_tree_view_set_expander_column(sub->tree, gtk_tree_view_get_column(sub->tree, 1)); - - selection = gtk_tree_view_get_selection (sub->tree); - gtk_tree_selection_set_mode (selection, GTK_SELECTION_MULTIPLE); - gtk_tree_view_set_headers_visible (sub->tree, FALSE); - - g_signal_connect(sub->tree, "row-expanded", G_CALLBACK(sub_row_expanded), sub); - g_signal_connect(sub->tree, "destroy", G_CALLBACK(sub_destroy), sub); - - sub_selection_changed(selection, sub); - g_signal_connect(selection, "changed", G_CALLBACK(sub_selection_changed), sub); - - sub_queue_fill_level(sub, NULL); - } - - gtk_box_pack_start((GtkBox *)sub->editor->vbox, sub->widget, TRUE, TRUE, 0); -} - -static void -sub_editor_destroy(GtkWidget *w, EMSubscribeEditor *se) -{ - /* need to clean out pending store opens */ - d(printf("editor destroyed, freeing editor\n")); - if (se->busy_id) - g_source_remove(se->busy_id); - - g_free(se); -} - -static void -sub_editor_close(GtkWidget *w, EMSubscribeEditor *se) -{ - gtk_widget_destroy((GtkWidget *)se->dialog); -} - -static void -sub_editor_refresh(GtkWidget *w, EMSubscribeEditor *se) -{ - EMSubscribe *sub = se->current; - GSList *l; - - d(printf("sub editor refresh?\n")); - if (sub == NULL || sub->store == NULL) - return; - - /* drop any currently pending */ - if (sub->pending_id != -1) - mail_msg_cancel(sub->pending_id); - - gtk_tree_store_clear((GtkTreeStore *)gtk_tree_view_get_model(sub->tree)); - - e_dlist_init(&sub->pending); - if (sub->folders) { - g_hash_table_foreach(sub->folders, (GHFunc)sub_node_free, sub); - g_hash_table_destroy(sub->folders); - } - sub->folders = g_hash_table_new(g_str_hash, g_str_equal); - - l = sub->info_list; - sub->info_list = NULL; - while (l) { - GSList *n = l->next; - - camel_store_free_folder_info(sub->store, (CamelFolderInfo *)l->data); - g_slist_free_1(l); - l = n; - } - - sub_queue_fill_level(sub, NULL); -} - -static void -sub_editor_subscribe(GtkWidget *w, EMSubscribeEditor *se) -{ - d(printf("subscribe clicked, current = %p\n", se->current)); - - if (se->current) - sub_subscribe(se->current, TRUE); -} - -static void -sub_editor_unsubscribe(GtkWidget *w, EMSubscribeEditor *se) -{ - d(printf("unsubscribe clicked\n")); - - if (se->current) - sub_subscribe(se->current, FALSE); -} - -static void -sub_editor_got_store(char *uri, CamelStore *store, void *data) -{ - struct _EMSubscribe *sub = data; - - if (!sub->cancel) - subscribe_set_store(sub, store); - sub_unref(sub); -} - -static void -sub_editor_menu_changed(GtkWidget *w, EMSubscribeEditor *se) -{ - int i, n; - struct _EMSubscribe *sub; - - d(printf("menu changed\n")); - - i = 1; - n = gtk_option_menu_get_history((GtkOptionMenu *)se->optionmenu); - if (n == 0) - gtk_widget_show(se->none_selected); - else { - gtk_widget_hide(se->none_selected); - gtk_widget_hide(se->none_selected_item); - } - - se->current = NULL; - sub = (struct _EMSubscribe *)se->stores.head; - while (sub->next) { - if (i == n) { - se->current = sub; - if (sub->widget) { - gtk_widget_show(sub->widget); - } else if (sub->store_id == -1) { - sub_ref(sub); - sub->store_id = mail_get_store(sub->store_uri, NULL, sub_editor_got_store, sub); - } - } else { - if (sub->widget) - gtk_widget_hide(sub->widget); - } - i++; - sub = sub->next; - } -} - -static gboolean sub_editor_timeout(EMSubscribeEditor *se) -{ - gtk_progress_bar_pulse((GtkProgressBar *)se->progress); - - return TRUE; -} - -static void sub_editor_busy(EMSubscribeEditor *se, int dir) -{ - int was; - - was = se->busy != 0; - se->busy += dir; - if (was && !se->busy) { - g_source_remove(se->busy_id); - se->busy_id = 0; - gtk_widget_hide(se->progress); - } else if (!was && se->busy) { - se->busy_id = g_timeout_add(1000/5, (GSourceFunc)sub_editor_timeout, se); - gtk_widget_show(se->progress); - } -} - -GtkDialog *em_subscribe_editor_new(void) -{ - EMSubscribeEditor *se; - EAccountList *accounts; - EIterator *iter; - GladeXML *xml; - GtkWidget *menu, *w; - - se = g_malloc0(sizeof(*se)); - e_dlist_init(&se->stores); - - xml = glade_xml_new (EVOLUTION_GLADEDIR "/subscribe-dialog.glade", "subscribe_dialog", NULL); - if (xml == NULL) { - /* ?? */ - return NULL; - } - se->dialog = (GtkDialog *)glade_xml_get_widget (xml, "subscribe_dialog"); - g_signal_connect(se->dialog, "destroy", G_CALLBACK(sub_editor_destroy), se); - - se->vbox = glade_xml_get_widget(xml, "tree_box"); - - se->subscribe_button = glade_xml_get_widget (xml, "subscribe_button"); - g_signal_connect(se->subscribe_button, "clicked", G_CALLBACK(sub_editor_subscribe), se); - se->unsubscribe_button = glade_xml_get_widget (xml, "unsubscribe_button"); - g_signal_connect(se->unsubscribe_button, "clicked", G_CALLBACK(sub_editor_unsubscribe), se); - - /* FIXME: This is just to get the shadow, is there a better way? */ - w = gtk_label_new(_("Please select a server.")); - se->none_selected = gtk_viewport_new(NULL, NULL); - gtk_viewport_set_shadow_type((GtkViewport *)se->none_selected, GTK_SHADOW_IN); - gtk_container_add((GtkContainer *)se->none_selected, w); - gtk_widget_show(w); - - gtk_box_pack_start((GtkBox *)se->vbox, se->none_selected, TRUE, TRUE, 0); - gtk_widget_show(se->none_selected); - - se->progress = glade_xml_get_widget(xml, "progress_bar"); - gtk_widget_hide(se->progress); - - w = glade_xml_get_widget(xml, "close_button"); - g_signal_connect(w, "clicked", G_CALLBACK(sub_editor_close), se); - - w = glade_xml_get_widget(xml, "refresh_button"); - g_signal_connect(w, "clicked", G_CALLBACK(sub_editor_refresh), se); - - /* setup stores menu */ - se->optionmenu = glade_xml_get_widget(xml, "store_menu"); - menu = gtk_menu_new(); - se->none_selected_item = w = gtk_menu_item_new_with_label(_("No server has been selected")); - gtk_widget_show(w); - gtk_menu_shell_append ((GtkMenuShell *)menu, w); - - accounts = mail_config_get_accounts (); - for (iter = e_list_get_iterator ((EList *) accounts); - e_iterator_is_valid (iter); - e_iterator_next (iter)) { - EAccount *account = (EAccount *) e_iterator_get (iter); - - /* setup url table, and store table? */ - if (account->enabled && account->source->url) { - d(printf("adding account '%s'\n", account->name)); - w = gtk_menu_item_new_with_label(account->name); - gtk_menu_shell_append ((GtkMenuShell *)menu, w); - gtk_widget_show(w); - e_dlist_addtail(&se->stores, (EDListNode *)subscribe_new(se, account->source->url)); - } else { - d(printf("not adding account '%s'\n", account->name)); - } - } - g_object_unref(iter); - - gtk_option_menu_set_menu((GtkOptionMenu *)se->optionmenu, menu); - g_signal_connect(se->optionmenu, "changed", G_CALLBACK(sub_editor_menu_changed), se); - - gtk_window_set_default_size((GtkWindow *)se->dialog, 350, 400); - - return se->dialog; -} diff --git a/mail/em-subscribe-editor.h b/mail/em-subscribe-editor.h deleted file mode 100644 index ca02f14bee..0000000000 --- a/mail/em-subscribe-editor.h +++ /dev/null @@ -1,9 +0,0 @@ - -#ifndef _EM_SUBSCRIBE_EDITOR_H -#define _EM_SUBSCRIBE_EDITOR_H - -#include <gtk/gtkdialog.h> - -GtkDialog *em_subscribe_editor_new(void); - -#endif /* ! _EM_SUBSCRIBE_EDITOR_H */ diff --git a/mail/em-sync-stream.c b/mail/em-sync-stream.c deleted file mode 100644 index df5659253e..0000000000 --- a/mail/em-sync-stream.c +++ /dev/null @@ -1,286 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Authors: Jeffrey Stedfast <fejj@ximian.com> - * Michael Zucchi <notzed@ximian.com> - * - * Copyright 2001 Ximian, Inc. (www.ximian.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public - * License as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - * - */ - - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <string.h> -#include <stdio.h> -#include <camel/camel-stream.h> -#include <camel/camel-object.h> -#include <gtk/gtkmain.h> -#include "em-sync-stream.h" - -#include "mail-mt.h" - -/*#define LOG_STREAM*/ - -#define d(x) - -#define EMSS_CLASS(x) ((EMSyncStreamClass *)(((CamelObject *)(x))->klass)) - -struct _EMSyncStreamPrivate { - /* FIXME: use a single data port/gui channel for all instances */ - /* TODO: possibly just use one of the mail-mt ports ... */ - struct _EMsgPort *data_port, *reply_port; - struct _GIOChannel *gui_channel; - guint gui_watch; - - char *buf_data; - int buf_used; - int buf_size; -}; - -/* Should probably expose messages to outside world ... so subclasses can extend */ -enum _write_msg_t { - EMSS_WRITE, - EMSS_FLUSH, - EMSS_CLOSE, -}; - -struct _write_msg { - EMsg msg; - - enum _write_msg_t op; - - const char *data; - size_t n; -}; - -static void em_sync_stream_class_init (EMSyncStreamClass *klass); -static void em_sync_stream_init (CamelObject *object); -static void em_sync_stream_finalize (CamelObject *object); - -static ssize_t stream_write(CamelStream *stream, const char *buffer, size_t n); -static int stream_close(CamelStream *stream); -static int stream_flush(CamelStream *stream); - -static CamelStreamClass *parent_class = NULL; - -CamelType -em_sync_stream_get_type (void) -{ - static CamelType type = CAMEL_INVALID_TYPE; - - if (type == CAMEL_INVALID_TYPE) { - type = camel_type_register (CAMEL_STREAM_TYPE, - "EMSyncStream", - sizeof (EMSyncStream), - sizeof (EMSyncStreamClass), - (CamelObjectClassInitFunc) em_sync_stream_class_init, - NULL, - (CamelObjectInitFunc) em_sync_stream_init, - (CamelObjectFinalizeFunc) em_sync_stream_finalize); - } - - return type; -} - -static void -em_sync_stream_class_init (EMSyncStreamClass *klass) -{ - CamelStreamClass *stream_class = CAMEL_STREAM_CLASS (klass); - - parent_class = (CamelStreamClass *) CAMEL_STREAM_TYPE; - - /* virtual method overload */ - stream_class->write = stream_write; - stream_class->flush = stream_flush; - stream_class->close = stream_close; -} - -static gboolean -emcs_gui_received(GIOChannel *source, GIOCondition cond, void *data) -{ - EMSyncStream *emss = data; - struct _EMSyncStreamPrivate *p = emss->priv; - struct _write_msg *msg; - - d(printf("%p: gui sync op job waiting\n", emss)); - - msg = (struct _write_msg *)e_msgport_get(p->data_port); - /* Should never happen ... */ - if (msg == NULL) - return TRUE; - - d(printf("%p: running sync op %d\n", emss, msg->op)); - - /* force out any pending data before doing anything else */ - if (p->buf_used > 0) { - EMSS_CLASS(emss)->sync_write((CamelStream *)emss, p->buf_data, p->buf_used); - p->buf_used = 0; - } - - /* FIXME: need to handle return values */ - - switch (msg->op) { - case EMSS_WRITE: - EMSS_CLASS(emss)->sync_write((CamelStream *)emss, msg->data, msg->n); - break; - case EMSS_FLUSH: - EMSS_CLASS(emss)->sync_flush((CamelStream *)emss); - break; - case EMSS_CLOSE: - EMSS_CLASS(emss)->sync_close((CamelStream *)emss); - break; - } - - e_msgport_reply((EMsg *)msg); - d(printf("%p: gui sync op jobs done\n", emss)); - - return TRUE; -} - -static void -em_sync_stream_init (CamelObject *object) -{ - EMSyncStream *emss = (EMSyncStream *)object; - struct _EMSyncStreamPrivate *p; - - p = emss->priv = g_malloc0(sizeof(*p)); - - p->data_port = e_msgport_new(); - p->reply_port = e_msgport_new(); - - p->gui_channel = g_io_channel_unix_new(e_msgport_fd(p->data_port)); - p->gui_watch = g_io_add_watch(p->gui_channel, G_IO_IN, emcs_gui_received, emss); - - d(printf("%p: new emss\n", emss)); -} - -static void -sync_op(EMSyncStream *emss, enum _write_msg_t op, const char *data, size_t n) -{ - struct _EMSyncStreamPrivate *p = emss->priv; - struct _write_msg msg; - - d(printf("%p: launching sync op %d\n", emss, op)); - - /* we do everything synchronous, we should never have any locks, and - this prevents overflow from banked up data */ - - msg.msg.reply_port = p->reply_port; - msg.op = op; - msg.data = data; - msg.n = n; - - e_msgport_put(p->data_port, &msg.msg); - e_msgport_wait(p->reply_port); - - g_assert(e_msgport_get(msg.msg.reply_port) == &msg.msg); - d(printf("%p: returned sync op %d\n", emss, op)); -} - -static void -em_sync_stream_finalize (CamelObject *object) -{ - EMSyncStream *emss = (EMSyncStream *)object; - struct _EMSyncStreamPrivate *p = emss->priv; - - /* TODO: is this stuff safe to do in another thread? */ - g_source_remove(p->gui_watch); - g_io_channel_unref(p->gui_channel); - - e_msgport_destroy(p->data_port); - e_msgport_destroy(p->reply_port); - - p->data_port = NULL; - p->reply_port = NULL; - - g_free(p->buf_data); - g_free(p); -} - -static ssize_t -stream_write (CamelStream *stream, const char *buffer, size_t n) -{ - EMSyncStream *emss = EM_SYNC_STREAM (stream); - struct _EMSyncStreamPrivate *p = emss->priv; - - if (emss->cancel) - return -1; - - if (pthread_self() == mail_gui_thread) - EMSS_CLASS(emss)->sync_write(stream, buffer, n); - else if (p->buf_size > 0) { - size_t left = p->buf_size-p->buf_used; - - if (n >= left) { - sync_op(emss, EMSS_WRITE, buffer, n); - } else { - memcpy(p->buf_data + p->buf_used, buffer, n); - p->buf_used += n; - } - } else { - sync_op(emss, EMSS_WRITE, buffer, n); - } - - return (ssize_t) n; -} - -static int -stream_flush(CamelStream *stream) -{ - EMSyncStream *emss = (EMSyncStream *)stream; - - if (emss->cancel) - return -1; - - if (pthread_self() == mail_gui_thread) - return ((EMSyncStreamClass *)(((CamelObject *)emss)->klass))->sync_flush(stream); - else - sync_op(emss, EMSS_FLUSH, NULL, 0); - - return 0; -} - -static int -stream_close(CamelStream *stream) -{ - EMSyncStream *emss = (EMSyncStream *)stream; - - if (emss->cancel) - return -1; - - d(printf("%p: closing stream\n", stream)); - - if (pthread_self() == mail_gui_thread) - return ((EMSyncStreamClass *)(((CamelObject *)emss)->klass))->sync_close(stream); - else - sync_op(emss, EMSS_CLOSE, NULL, 0); - - return 0; -} - -void -em_sync_stream_set_buffer_size(EMSyncStream *emss, size_t size) -{ - struct _EMSyncStreamPrivate *p = emss->priv; - - g_free(p->buf_data); - p->buf_data = g_malloc(size); - p->buf_size = size; - p->buf_used = 0; -} diff --git a/mail/em-sync-stream.h b/mail/em-sync-stream.h deleted file mode 100644 index abccae3311..0000000000 --- a/mail/em-sync-stream.h +++ /dev/null @@ -1,69 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- - * - * Authors: Michael Zucchi <notzed@ximian.com> - * - * Copyright 2003 Ximian, Inc. (www.ximian.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public - * License as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - * - */ - -/* -EMSyncStream - Abstract class. -A synchronous stream, that can be written from any thread, but whose -requests are always handled in the main gui thread in the correct order. -*/ - -#ifndef EM_SYNC_STREAM_H -#define EM_SYNC_STREAM_H - -#ifdef __cplusplus -extern "C" { -#pragma } -#endif /* __cplusplus */ - -#define EM_SYNC_STREAM_TYPE (em_sync_stream_get_type ()) -#define EM_SYNC_STREAM(obj) (CAMEL_CHECK_CAST((obj), EM_SYNC_STREAM_TYPE, EMSyncStream)) -#define EM_SYNC_STREAM_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), EM_SYNC_STREAM_TYPE, EMSyncStreamClass)) -#define EM_IS_SYNC_STREAM(o) (CAMEL_CHECK_TYPE((o), EM_SYNC_STREAM_TYPE)) - -#include <glib.h> -#include <camel/camel-stream.h> - -typedef struct _EMSyncStream { - CamelStream parent_stream; - - struct _EMSyncStreamPrivate *priv; - - int cancel; -} EMSyncStream; - -typedef struct { - CamelStreamClass parent_class; - - ssize_t (*sync_write) (CamelStream *stream, const char *buffer, size_t n); - int (*sync_close) (CamelStream *stream); - int (*sync_flush) (CamelStream *stream); - -} EMSyncStreamClass; - -CamelType em_sync_stream_get_type (void); -void em_sync_stream_set_buffer_size(EMSyncStream *, size_t size); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* EM_SYNC_STREAM_H */ diff --git a/mail/em-utils.c b/mail/em-utils.c deleted file mode 100644 index e2da2fa6d3..0000000000 --- a/mail/em-utils.c +++ /dev/null @@ -1,2324 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Authors: Jeffrey Stedfast <fejj@ximian.com> - * - * Copyright 2003 Ximian, Inc. (www.ximian.com) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA. - * - */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <stdio.h> -#include <string.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <errno.h> -#include <time.h> - -#include <camel/camel-stream-fs.h> -#include <camel/camel-url-scanner.h> - -#include <filter/filter-editor.h> - -#include "mail-component.h" -#include "mail-mt.h" -#include "mail-ops.h" -#include "mail-tools.h" -#include "mail-config.h" -#include "mail-config-druid.h" -#include "message-tag-followup.h" - -#include <e-util/e-mktemp.h> -#include <e-util/e-dialog-utils.h> - -#include "em-utils.h" -#include "em-composer-utils.h" -#include "em-format-quote.h" - -static EAccount *guess_account (CamelMimeMessage *message); - -/** - * em_utils_prompt_user: - * @parent: parent window - * @def: default response - * @promptkey: gconf key to check if we should prompt the user or not. - * @fmt: prompt format - * @Varargs: varargs - * - * Convenience function to query the user with a Yes/No dialog and a - * "Don't show this dialog again" checkbox. If the user checks that - * checkbox, then @promptkey is set to %FALSE, otherwise it is set to - * %TRUE. - * - * Returns %TRUE if the user clicks Yes or %FALSE otherwise. - **/ -gboolean -em_utils_prompt_user(GtkWindow *parent, int def, const char *promptkey, const char *fmt, ...) -{ - GtkWidget *mbox, *check = NULL; - va_list ap; - int button; - char *str; - GConfClient *gconf = mail_config_get_gconf_client(); - - if (promptkey - && !gconf_client_get_bool(gconf, promptkey, NULL)) - return TRUE; - - va_start (ap, fmt); - str = g_strdup_vprintf (fmt, ap); - va_end (ap); - mbox = gtk_message_dialog_new (parent, GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_QUESTION, GTK_BUTTONS_YES_NO, - "%s", str); - g_free (str); - gtk_dialog_set_default_response ((GtkDialog *) mbox, def); - if (promptkey) { - check = gtk_check_button_new_with_label (_("Don't show this message again.")); - gtk_box_pack_start ((GtkBox *)((GtkDialog *) mbox)->vbox, check, TRUE, TRUE, 10); - gtk_widget_show (check); - } - - button = gtk_dialog_run ((GtkDialog *) mbox); - if (promptkey) - gconf_client_set_bool(gconf, promptkey, !gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(check)), NULL); - - gtk_widget_destroy(mbox); - - return button == GTK_RESPONSE_YES; -} - -/** - * em_utils_uids_copy: - * @uids: array of uids - * - * Duplicates the array of uids held by @uids into a new - * GPtrArray. Use em_utils_uids_free() to free the resultant uid - * array. - * - * Returns a duplicate copy of @uids. - **/ -GPtrArray * -em_utils_uids_copy (GPtrArray *uids) -{ - GPtrArray *copy; - int i; - - copy = g_ptr_array_new (); - g_ptr_array_set_size (copy, uids->len); - - for (i = 0; i < uids->len; i++) - copy->pdata[i] = g_strdup (uids->pdata[i]); - - return copy; -} - -/** - * em_utils_uids_free: - * @uids: array of uids - * - * Frees the array of uids pointed to by @uids back to the system. - **/ -void -em_utils_uids_free (GPtrArray *uids) -{ - int i; - - for (i = 0; i < uids->len; i++) - g_free (uids->pdata[i]); - - g_ptr_array_free (uids, TRUE); -} - -static void -druid_destroy_cb (gpointer user_data, GObject *deadbeef) -{ - gtk_main_quit (); -} - -/** - * em_utils_configure_account: - * @parent: parent window for the druid to be a child of. - * - * Displays a druid allowing the user to configure an account. If - * @parent is non-NULL, then the druid will be created as a child - * window of @parent's toplevel window. - * - * Returns %TRUE if an account has been configured or %FALSE - * otherwise. - **/ -gboolean -em_utils_configure_account (GtkWidget *parent) -{ - MailConfigDruid *druid; - - druid = mail_config_druid_new (); - - if (parent != NULL) - e_dialog_set_transient_for ((GtkWindow *) druid, parent); - - g_object_weak_ref ((GObject *) druid, (GWeakNotify) druid_destroy_cb, NULL); - gtk_widget_show ((GtkWidget *) druid); - gtk_grab_add ((GtkWidget *) druid); - gtk_main (); - - return mail_config_is_configured (); -} - -/** - * em_utils_check_user_can_send_mail: - * @parent: parent window for the druid to be a child of. - * - * If no accounts have been configured, the user will be given a - * chance to configure an account. In the case that no accounts are - * configured, a druid will be created. If @parent is non-NULL, then - * the druid will be created as a child window of @parent's toplevel - * window. - * - * Returns %TRUE if the user has an account configured (to send mail) - * or %FALSE otherwise. - **/ -gboolean -em_utils_check_user_can_send_mail (GtkWidget *parent) -{ - EAccount *account; - - if (!mail_config_is_configured ()) { - if (!em_utils_configure_account (parent)) - return FALSE; - } - - if (!(account = mail_config_get_default_account ())) - return FALSE; - - /* Check for a transport */ - if (!account->transport->url) - return FALSE; - - return TRUE; -} - -/* Editing Filters/vFolders... */ - -static GtkWidget *filter_editor = NULL; - -static void -filter_editor_response (GtkWidget *dialog, int button, gpointer user_data) -{ - FilterContext *fc; - - if (button == GTK_RESPONSE_ACCEPT) { - char *user; - - fc = g_object_get_data ((GObject *) dialog, "context"); - user = g_strdup_printf ("%s/mail/filters.xml", - mail_component_peek_base_directory (mail_component_peek ())); - rule_context_save ((RuleContext *) fc, user); - g_free (user); - } - - gtk_widget_destroy (dialog); - - filter_editor = NULL; -} - -static const char *filter_source_names[] = { - "incoming", - "outgoing", - NULL, -}; - -/** - * em_utils_edit_filters: - * @parent: parent window - * - * Opens or raises the filters editor dialog so that the user may edit - * his/her filters. If @parent is non-NULL, then the dialog will be - * created as a child window of @parent's toplevel window. - **/ -void -em_utils_edit_filters (GtkWidget *parent) -{ - const char *base_directory = mail_component_peek_base_directory (mail_component_peek ()); - char *user, *system; - FilterContext *fc; - - if (filter_editor) { - gdk_window_raise (GTK_WIDGET (filter_editor)->window); - return; - } - - fc = filter_context_new (); - user = g_strdup_printf ("%s/mail/filters.xml", base_directory); - system = EVOLUTION_PRIVDATADIR "/filtertypes.xml"; - rule_context_load ((RuleContext *) fc, system, user); - g_free (user); - - if (((RuleContext *) fc)->error) { - e_notice (parent, GTK_MESSAGE_ERROR, - _("Error loading filter information:\n%s"), - ((RuleContext *) fc)->error); - return; - } - - filter_editor = (GtkWidget *) filter_editor_new (fc, filter_source_names); - if (parent != NULL) - e_dialog_set_transient_for ((GtkWindow *) filter_editor, parent); - - gtk_window_set_title (GTK_WINDOW (filter_editor), _("Filters")); - g_object_set_data_full ((GObject *) filter_editor, "context", fc, (GtkDestroyNotify) g_object_unref); - g_signal_connect (filter_editor, "response", G_CALLBACK (filter_editor_response), NULL); - gtk_widget_show (GTK_WIDGET (filter_editor)); -} - -/* Composing messages... */ - -static EMsgComposer * -create_new_composer (void) -{ - EMsgComposer *composer; - - composer = e_msg_composer_new (); - - em_composer_utils_setup_default_callbacks (composer); - - return composer; -} - -/** - * em_utils_compose_new_message: - * - * Opens a new composer window as a child window of @parent's toplevel - * window. - **/ -void -em_utils_compose_new_message (void) -{ - GtkWidget *composer; - - composer = (GtkWidget *) create_new_composer (); - - gtk_widget_show (composer); -} - -/** - * em_utils_compose_new_message_with_mailto: - * @url: mailto url - * - * Opens a new composer window as a child window of @parent's toplevel - * window. If @url is non-NULL, the composer fields will be filled in - * according to the values in the mailto url. - **/ -void -em_utils_compose_new_message_with_mailto (const char *url) -{ - EMsgComposer *composer; - - if (url != NULL) - composer = e_msg_composer_new_from_url (url); - else - composer = e_msg_composer_new (); - - em_composer_utils_setup_default_callbacks (composer); - - gtk_widget_show ((GtkWidget *) composer); -} - -/** - * em_utils_post_to_url: - * @url: mailto url - * - * Opens a new composer window as a child window of @parent's toplevel - * window. If @url is non-NULL, the composer will default to posting - * mail to the folder specified by @url. - **/ -void -em_utils_post_to_url (const char *url) -{ - EMsgComposer *composer; - - composer = e_msg_composer_new_post (); - - if (url != NULL) - e_msg_composer_hdrs_set_post_to ((EMsgComposerHdrs *) ((EMsgComposer *) composer)->hdrs, url); - - em_composer_utils_setup_default_callbacks (composer); - - e_msg_composer_unset_changed (composer); - e_msg_composer_drop_editor_undo (composer); - - gtk_widget_show ((GtkWidget *) composer); -} - -/* Editing messages... */ - -static void -edit_message (CamelMimeMessage *message, CamelFolder *drafts, const char *uid) -{ - EMsgComposer *composer; - - composer = e_msg_composer_new_with_message (message); - em_composer_utils_setup_callbacks (composer, NULL, NULL, 0, 0, drafts, uid); - e_msg_composer_unset_changed (composer); - e_msg_composer_drop_editor_undo (composer); - - gtk_widget_show (GTK_WIDGET (composer)); -} - -/** - * em_utils_edit_message: - * @message: message to edit - * - * Opens a composer filled in with the headers/mime-parts/etc of - * @message. - **/ -void -em_utils_edit_message (CamelMimeMessage *message) -{ - g_return_if_fail (CAMEL_IS_MIME_MESSAGE (message)); - - edit_message (message, NULL, NULL); -} - -static void -edit_messages (CamelFolder *folder, GPtrArray *uids, GPtrArray *msgs, void *user_data) -{ - int i; - - if (msgs == NULL) - return; - - for (i = 0; i < msgs->len; i++) { - camel_medium_remove_header (CAMEL_MEDIUM (msgs->pdata[i]), "X-Mailer"); - - edit_message (msgs->pdata[i], folder, uids->pdata[i]); - } -} - -/** - * em_utils_edit_messages: - * @folder: folder containing messages to edit - * @uids: uids of messages to edit - * - * Opens a composer for each message to be edited. - **/ -void -em_utils_edit_messages (CamelFolder *folder, GPtrArray *uids) -{ - g_return_if_fail (CAMEL_IS_FOLDER (folder)); - g_return_if_fail (uids != NULL); - - mail_get_messages (folder, uids, edit_messages, NULL); -} - -/* Forwarding messages... */ - -static void -forward_attached (CamelFolder *folder, GPtrArray *messages, CamelMimePart *part, char *subject, void *user_data) -{ - EMsgComposer *composer; - - if (part == NULL) - return; - - composer = create_new_composer (); - e_msg_composer_set_headers (composer, NULL, NULL, NULL, NULL, subject); - e_msg_composer_attach (composer, part); - - e_msg_composer_unset_changed (composer); - e_msg_composer_drop_editor_undo (composer); - - gtk_widget_show (GTK_WIDGET (composer)); -} - -/** - * em_utils_forward_attached: - * @folder: folder containing messages to forward - * @uids: uids of messages to forward - * - * If there is more than a single message in @uids, a multipart/digest - * will be constructed and attached to a new composer window preset - * with the appropriate header defaults for forwarding the first - * message in the list. If only one message is to be forwarded, it is - * forwarded as a simple message/rfc822 attachment. - **/ -void -em_utils_forward_attached (CamelFolder *folder, GPtrArray *uids) -{ - g_return_if_fail (CAMEL_IS_FOLDER (folder)); - g_return_if_fail (uids != NULL); - - mail_build_attachment (folder, uids, forward_attached, NULL); -} - -static void -forward_non_attached (GPtrArray *messages, int style) -{ - CamelMimeMessage *message; - CamelDataWrapper *wrapper; - EMsgComposer *composer; - char *subject, *text; - int i; - guint32 flags; - - if (messages->len == 0) - return; - - flags = EM_FORMAT_QUOTE_HEADERS; - if (style == MAIL_CONFIG_FORWARD_QUOTED) - flags |= EM_FORMAT_QUOTE_CITE; - - for (i = 0; i < messages->len; i++) { - message = messages->pdata[i]; - subject = mail_tool_generate_forward_subject (message); - - text = em_utils_message_to_html (message, _("-------- Forwarded Message --------"), flags); - - if (text) { - composer = create_new_composer (); - e_msg_composer_set_headers (composer, NULL, NULL, NULL, NULL, subject); - e_msg_composer_set_body_text (composer, text); - - wrapper = camel_medium_get_content_object (CAMEL_MEDIUM (message)); - if (CAMEL_IS_MULTIPART (wrapper)) - e_msg_composer_add_message_attachments (composer, message, FALSE); - - e_msg_composer_unset_changed (composer); - e_msg_composer_drop_editor_undo (composer); - - gtk_widget_show (GTK_WIDGET (composer)); - - g_free (text); - } - - g_free (subject); - } -} - -static void -forward_inline (CamelFolder *folder, GPtrArray *uids, GPtrArray *messages, void *user_data) -{ - forward_non_attached (messages, MAIL_CONFIG_FORWARD_INLINE); -} - -/** - * em_utils_forward_inline: - * @folder: folder containing messages to forward - * @uids: uids of messages to forward - * - * Forwards each message in the 'inline' form, each in its own composer window. - **/ -void -em_utils_forward_inline (CamelFolder *folder, GPtrArray *uids) -{ - g_return_if_fail (CAMEL_IS_FOLDER (folder)); - g_return_if_fail (uids != NULL); - - mail_get_messages (folder, uids, forward_inline, NULL); -} - -static void -forward_quoted (CamelFolder *folder, GPtrArray *uids, GPtrArray *messages, void *user_data) -{ - forward_non_attached (messages, MAIL_CONFIG_FORWARD_QUOTED); -} - -/** - * em_utils_forward_quoted: - * @folder: folder containing messages to forward - * @uids: uids of messages to forward - * - * Forwards each message in the 'quoted' form (each line starting with - * a "> "), each in its own composer window. - **/ -void -em_utils_forward_quoted (CamelFolder *folder, GPtrArray *uids) -{ - g_return_if_fail (CAMEL_IS_FOLDER (folder)); - g_return_if_fail (uids != NULL); - - mail_get_messages (folder, uids, forward_quoted, NULL); -} - -/** - * em_utils_forward_message: - * @parent: parent window - * @message: message to be forwarded - * - * Forwards a message in the user's configured default style. - **/ -void -em_utils_forward_message (CamelMimeMessage *message) -{ - GPtrArray *messages; - CamelMimePart *part; - GConfClient *gconf; - char *subject; - int mode; - - messages = g_ptr_array_new (); - g_ptr_array_add (messages, message); - - gconf = mail_config_get_gconf_client (); - mode = gconf_client_get_int (gconf, "/apps/evolution/mail/format/forward_style", NULL); - - switch (mode) { - case MAIL_CONFIG_FORWARD_ATTACHED: - default: - part = mail_tool_make_message_attachment (message); - - subject = mail_tool_generate_forward_subject (message); - - forward_attached (NULL, messages, part, subject, NULL); - camel_object_unref (part); - g_free (subject); - break; - case MAIL_CONFIG_FORWARD_INLINE: - forward_non_attached (messages, MAIL_CONFIG_FORWARD_INLINE); - break; - case MAIL_CONFIG_FORWARD_QUOTED: - forward_non_attached (messages, MAIL_CONFIG_FORWARD_QUOTED); - break; - } - - g_ptr_array_free (messages, TRUE); -} - -/** - * em_utils_forward_messages: - * @folder: folder containing messages to forward - * @uids: uids of messages to forward - * - * Forwards a group of messages in the user's configured default - * style. - **/ -void -em_utils_forward_messages (CamelFolder *folder, GPtrArray *uids) -{ - GConfClient *gconf; - int mode; - - gconf = mail_config_get_gconf_client (); - mode = gconf_client_get_int (gconf, "/apps/evolution/mail/format/forward_style", NULL); - - switch (mode) { - case MAIL_CONFIG_FORWARD_ATTACHED: - default: - em_utils_forward_attached (folder, uids); - break; - case MAIL_CONFIG_FORWARD_INLINE: - em_utils_forward_inline (folder, uids); - break; - case MAIL_CONFIG_FORWARD_QUOTED: - em_utils_forward_quoted (folder, uids); - break; - } -} - -/* Redirecting messages... */ - -static EMsgComposer * -redirect_get_composer (CamelMimeMessage *message) -{ - EMsgComposer *composer; - EAccount *account; - - /* QMail will refuse to send a message if it finds one of - it's Delivered-To headers in the message, so remove all - Delivered-To headers. Fixes bug #23635. */ - while (camel_medium_get_header (CAMEL_MEDIUM (message), "Delivered-To")) - camel_medium_remove_header (CAMEL_MEDIUM (message), "Delivered-To"); - - account = guess_account (message); - - composer = e_msg_composer_new_redirect (message, account ? account->name : NULL); - - em_composer_utils_setup_default_callbacks (composer); - - return composer; -} - -/** - * em_utils_redirect_message: - * @message: message to redirect - * - * Opens a composer to redirect @message (Note: only headers will be - * editable). Adds Resent-From/Resent-To/etc headers. - **/ -void -em_utils_redirect_message (CamelMimeMessage *message) -{ - EMsgComposer *composer; - CamelDataWrapper *wrapper; - - g_return_if_fail (CAMEL_IS_MIME_MESSAGE (message)); - - composer = redirect_get_composer (message); - - wrapper = camel_medium_get_content_object (CAMEL_MEDIUM (message)); - if (CAMEL_IS_MULTIPART (wrapper)) - e_msg_composer_add_message_attachments (composer, message, FALSE); - - gtk_widget_show (GTK_WIDGET (composer)); - e_msg_composer_unset_changed (composer); - e_msg_composer_drop_editor_undo (composer); -} - -static void -redirect_msg (CamelFolder *folder, const char *uid, CamelMimeMessage *message, void *user_data) -{ - if (message == NULL) - return; - - em_utils_redirect_message (message); -} - -/** - * em_utils_redirect_message_by_uid: - * @folder: folder containing message to be redirected - * @uid: uid of message to be redirected - * - * Opens a composer to redirect the message (Note: only headers will - * be editable). Adds Resent-From/Resent-To/etc headers. - **/ -void -em_utils_redirect_message_by_uid (CamelFolder *folder, const char *uid) -{ - g_return_if_fail (CAMEL_IS_FOLDER (folder)); - g_return_if_fail (uid != NULL); - - mail_get_message (folder, uid, redirect_msg, NULL, mail_thread_new); -} - -/* Replying to messages... */ - -static GHashTable * -generate_account_hash (void) -{ - GHashTable *account_hash; - EAccount *account, *def; - EAccountList *accounts; - EIterator *iter; - - accounts = mail_config_get_accounts (); - account_hash = g_hash_table_new (camel_strcase_hash, camel_strcase_equal); - - /* add the default account to the hash first */ - if ((def = mail_config_get_default_account ())) { - if (def->id->address) - g_hash_table_insert (account_hash, (char *) def->id->address, (void *) def); - } - - iter = e_list_get_iterator ((EList *) accounts); - while (e_iterator_is_valid (iter)) { - account = (EAccount *) e_iterator_get (iter); - - if (account->id->address) { - EAccount *acnt; - - /* Accounts with identical email addresses that are enabled - * take precedence over the accounts that aren't. If all - * accounts with matching email addresses are disabled, then - * the first one in the list takes precedence. The default - * account always takes precedence no matter what. - */ - acnt = g_hash_table_lookup (account_hash, account->id->address); - if (acnt && acnt != def && !acnt->enabled && account->enabled) { - g_hash_table_remove (account_hash, acnt->id->address); - acnt = NULL; - } - - if (!acnt) - g_hash_table_insert (account_hash, (char *) account->id->address, (void *) account); - } - - e_iterator_next (iter); - } - - g_object_unref (iter); - - return account_hash; -} - -static EABDestination ** -em_utils_camel_address_to_destination (CamelInternetAddress *iaddr) -{ - EABDestination *dest, **destv; - int n, i, j; - - if (iaddr == NULL) - return NULL; - - if ((n = camel_address_length ((CamelAddress *) iaddr)) == 0) - return NULL; - - destv = g_malloc (sizeof (EABDestination *) * (n + 1)); - for (i = 0, j = 0; i < n; i++) { - const char *name, *addr; - - if (camel_internet_address_get (iaddr, i, &name, &addr)) { - dest = eab_destination_new (); - eab_destination_set_name (dest, name); - eab_destination_set_email (dest, addr); - - destv[j++] = dest; - } - } - - if (j == 0) { - g_free (destv); - return NULL; - } - - destv[j] = NULL; - - return destv; -} - -static EMsgComposer * -reply_get_composer (CamelMimeMessage *message, EAccount *account, - CamelInternetAddress *to, CamelInternetAddress *cc) -{ - const char *message_id, *references; - EABDestination **tov, **ccv; - EMsgComposer *composer; - char *subject; - - g_return_val_if_fail (CAMEL_IS_MIME_MESSAGE (message), NULL); - g_return_val_if_fail (to == NULL || CAMEL_IS_INTERNET_ADDRESS (to), NULL); - g_return_val_if_fail (cc == NULL || CAMEL_IS_INTERNET_ADDRESS (cc), NULL); - - composer = e_msg_composer_new (); - - /* construct the tov/ccv */ - tov = em_utils_camel_address_to_destination (to); - ccv = em_utils_camel_address_to_destination (cc); - - /* Set the subject of the new message. */ - if ((subject = (char *) camel_mime_message_get_subject (message))) { - if (strncasecmp (subject, "Re: ", 4) != 0) - subject = g_strdup_printf ("Re: %s", subject); - else - subject = g_strdup (subject); - } else { - subject = g_strdup (""); - } - - e_msg_composer_set_headers (composer, account ? account->name : NULL, tov, ccv, NULL, subject); - - g_free (subject); - - /* Add In-Reply-To and References. */ - message_id = camel_medium_get_header (CAMEL_MEDIUM (message), "Message-Id"); - references = camel_medium_get_header (CAMEL_MEDIUM (message), "References"); - if (message_id) { - char *reply_refs; - - e_msg_composer_add_header (composer, "In-Reply-To", message_id); - - if (references) - reply_refs = g_strdup_printf ("%s %s", references, message_id); - else - reply_refs = g_strdup (message_id); - - e_msg_composer_add_header (composer, "References", reply_refs); - g_free (reply_refs); - } else if (references) { - e_msg_composer_add_header (composer, "References", references); - } - - e_msg_composer_drop_editor_undo (composer); - - return composer; -} - -static EAccount * -guess_account (CamelMimeMessage *message) -{ - const CamelInternetAddress *to, *cc; - GHashTable *account_hash; - EAccount *account = NULL; - const char *addr; - int i; - - to = camel_mime_message_get_recipients (message, CAMEL_RECIPIENT_TYPE_TO); - cc = camel_mime_message_get_recipients (message, CAMEL_RECIPIENT_TYPE_CC); - - if (to == NULL && cc == NULL) - return NULL; - - account_hash = generate_account_hash (); - - if (to) { - for (i = 0; camel_internet_address_get (to, i, NULL, &addr); i++) { - account = g_hash_table_lookup (account_hash, addr); - if (account) - goto found; - } - } - - if (cc) { - for (i = 0; camel_internet_address_get (cc, i, NULL, &addr); i++) { - account = g_hash_table_lookup (account_hash, addr); - if (account) - goto found; - } - } - - found: - - g_hash_table_destroy (account_hash); - - return account; -} - -static void -get_reply_sender (CamelMimeMessage *message, CamelInternetAddress **to) -{ - const CamelInternetAddress *reply_to; - const char *name, *addr; - int i; - - reply_to = camel_mime_message_get_reply_to (message); - if (!reply_to) - reply_to = camel_mime_message_get_from (message); - - if (reply_to) { - *to = camel_internet_address_new (); - - for (i = 0; camel_internet_address_get (reply_to, i, &name, &addr); i++) - camel_internet_address_add (*to, name, addr); - } -} - -static gboolean -get_reply_list (CamelMimeMessage *message, CamelInternetAddress **to) -{ - const char *header, *p; - char *addr; - - /* Examples: - * - * List-Post: <mailto:list@host.com> - * List-Post: <mailto:moderator@host.com?subject=list%20posting> - * List-Post: NO (posting not allowed on this list) - */ - if (!(header = camel_medium_get_header ((CamelMedium *) message, "List-Post"))) - return FALSE; - - while (*header == ' ' || *header == '\t') - header++; - - /* check for NO */ - if (!strncasecmp (header, "NO", 2)) - return FALSE; - - /* Search for the first mailto angle-bracket enclosed URL. - * (See rfc2369, Section 2, paragraph 3 for details) */ - if (!(header = camel_strstrcase (header, "<mailto:"))) - return FALSE; - - header += 8; - - p = header; - while (*p && !strchr ("?>", *p)) - p++; - - addr = g_strndup (header, p - header); - - *to = camel_internet_address_new (); - camel_internet_address_add (*to, NULL, addr); - - g_free (addr); - - return TRUE; -} - -static void -concat_unique_addrs (CamelInternetAddress *dest, const CamelInternetAddress *src, GHashTable *rcpt_hash) -{ - const char *name, *addr; - int i; - - for (i = 0; camel_internet_address_get (src, i, &name, &addr); i++) { - if (!g_hash_table_lookup (rcpt_hash, addr)) { - camel_internet_address_add (dest, name, addr); - g_hash_table_insert (rcpt_hash, (char *) addr, GINT_TO_POINTER (1)); - } - } -} - -static void -get_reply_all (CamelMimeMessage *message, CamelInternetAddress **to, CamelInternetAddress **cc) -{ - const CamelInternetAddress *reply_to, *to_addrs, *cc_addrs; - const char *name, *addr; - GHashTable *rcpt_hash; - int i; - - rcpt_hash = generate_account_hash (); - - reply_to = camel_mime_message_get_reply_to (message); - if (!reply_to) - reply_to = camel_mime_message_get_from (message); - - to_addrs = camel_mime_message_get_recipients (message, CAMEL_RECIPIENT_TYPE_TO); - cc_addrs = camel_mime_message_get_recipients (message, CAMEL_RECIPIENT_TYPE_CC); - - *to = camel_internet_address_new (); - *cc = camel_internet_address_new (); - - if (reply_to) { - for (i = 0; camel_internet_address_get (reply_to, i, &name, &addr); i++) { - /* ignore references to the Reply-To address in the To and Cc lists */ - if (addr && !g_hash_table_lookup (rcpt_hash, addr)) { - /* In the case that we are doing a Reply-To-All, we do not want - to include the user's email address because replying to oneself - is kinda silly. */ - - camel_internet_address_add (*to, name, addr); - g_hash_table_insert (rcpt_hash, (char *) addr, GINT_TO_POINTER (1)); - } - } - } - - concat_unique_addrs (*cc, to_addrs, rcpt_hash); - concat_unique_addrs (*cc, cc_addrs, rcpt_hash); - - /* promote the first Cc: address to To: if To: is empty */ - if (camel_address_length ((CamelAddress *) *to) == 0 && camel_address_length ((CamelAddress *) *cc) > 0) { - camel_internet_address_get (*cc, 0, &name, &addr); - camel_internet_address_add (*to, name, addr); - camel_address_remove ((CamelAddress *) *cc, 0); - } - - g_hash_table_destroy (rcpt_hash); -} - -static void -composer_set_body (EMsgComposer *composer, CamelMimeMessage *message) -{ - const CamelInternetAddress *sender; - char *text, *credits, format[256]; - const char *name, *addr; - CamelMimePart *part; - GConfClient *gconf; - time_t date; - int date_offset; - - gconf = mail_config_get_gconf_client (); - - switch (gconf_client_get_int (gconf, "/apps/evolution/mail/format/reply_style", NULL)) { - case MAIL_CONFIG_REPLY_DO_NOT_QUOTE: - /* do nothing */ - break; - case MAIL_CONFIG_REPLY_ATTACH: - /* attach the original message as an attachment */ - part = mail_tool_make_message_attachment (message); - e_msg_composer_attach (composer, part); - camel_object_unref (part); - break; - case MAIL_CONFIG_REPLY_QUOTED: - default: - /* do what any sane user would want when replying... */ - sender = camel_mime_message_get_from (message); - if (sender != NULL && camel_address_length (CAMEL_ADDRESS (sender)) > 0) { - camel_internet_address_get (sender, 0, &name, &addr); - } else { - name = _("an unknown sender"); - } - - date = camel_mime_message_get_date(message, &date_offset); - /* Convert to UTC */ - date += (date_offset / 100) * 60 * 60; - date += (date_offset % 100) * 60; - - /* translators: attribution string used when quoting messages, - it must contain a single single %%+05d followed by a single '%%s' */ - e_utf8_strftime(format, sizeof(format), _("On %a, %Y-%m-%d at %H:%M %%+05d, %%s wrote:"), gmtime(&date)); - credits = g_strdup_printf(format, date_offset, name && *name ? name : addr); - text = em_utils_message_to_html(message, credits, EM_FORMAT_QUOTE_CITE); - g_free (credits); - e_msg_composer_set_body_text(composer, text); - g_free (text); - break; - } - - e_msg_composer_drop_editor_undo (composer); -} - -/** - * em_utils_reply_to_message: - * @message: message to reply to - * @mode: reply mode - * - * Creates a new composer ready to reply to @message. - **/ -void -em_utils_reply_to_message (CamelMimeMessage *message, int mode) -{ - CamelInternetAddress *to = NULL, *cc = NULL; - EMsgComposer *composer; - EAccount *account; - - account = guess_account (message); - - switch (mode) { - case REPLY_MODE_SENDER: - get_reply_sender (message, &to); - break; - case REPLY_MODE_LIST: - if (get_reply_list (message, &to)) - break; - case REPLY_MODE_ALL: - get_reply_all (message, &to, &cc); - break; - } - - composer = reply_get_composer (message, account, to, cc); - e_msg_composer_add_message_attachments (composer, message, TRUE); - - if (to != NULL) - camel_object_unref (to); - - if (cc != NULL) - camel_object_unref (cc); - - composer_set_body (composer, message); - - em_composer_utils_setup_default_callbacks (composer); - - gtk_widget_show (GTK_WIDGET (composer)); - e_msg_composer_unset_changed (composer); -} - -static void -reply_to_message (CamelFolder *folder, const char *uid, CamelMimeMessage *message, void *user_data) -{ - CamelInternetAddress *to = NULL, *cc = NULL; - EMsgComposer *composer; - EAccount *account; - guint32 flags; - int mode; - - mode = GPOINTER_TO_INT (user_data); - - account = guess_account (message); - flags = CAMEL_MESSAGE_ANSWERED | CAMEL_MESSAGE_SEEN; - - switch (mode) { - case REPLY_MODE_SENDER: - get_reply_sender (message, &to); - break; - case REPLY_MODE_LIST: - flags |= CAMEL_MESSAGE_ANSWERED_ALL; - if (get_reply_list (message, &to)) - break; - case REPLY_MODE_ALL: - flags |= CAMEL_MESSAGE_ANSWERED_ALL; - get_reply_all (message, &to, &cc); - break; - } - - composer = reply_get_composer (message, account, to, cc); - e_msg_composer_add_message_attachments (composer, message, TRUE); - - if (to != NULL) - camel_object_unref (to); - - if (cc != NULL) - camel_object_unref (cc); - - composer_set_body (composer, message); - - em_composer_utils_setup_callbacks (composer, folder, uid, flags, flags, NULL, NULL); - - gtk_widget_show (GTK_WIDGET (composer)); - e_msg_composer_unset_changed (composer); -} - -/** - * em_utils_reply_to_message_by_uid: - * @folder: folder containing message to reply to - * @uid: message uid - * @mode: reply mode - * - * Creates a new composer ready to reply to the message referenced by - * @folder and @uid. - **/ -void -em_utils_reply_to_message_by_uid (CamelFolder *folder, const char *uid, int mode) -{ - g_return_if_fail (CAMEL_IS_FOLDER (folder)); - g_return_if_fail (uid != NULL); - - mail_get_message (folder, uid, reply_to_message, GINT_TO_POINTER (mode), mail_thread_new); -} - -/* Posting replies... */ - -static void -post_reply_to_message (CamelFolder *folder, const char *uid, CamelMimeMessage *message, void *user_data) -{ - /* FIXME: would be nice if this shared more code with reply_get_composer() */ - const char *message_id, *references; - CamelInternetAddress *to = NULL; - EABDestination **tov = NULL; - EMsgComposer *composer; - char *subject, *url; - EAccount *account; - guint32 flags; - - account = guess_account (message); - flags = CAMEL_MESSAGE_ANSWERED | CAMEL_MESSAGE_SEEN; - - get_reply_sender (message, &to); - - composer = e_msg_composer_new_post (); - - /* construct the tov/ccv */ - tov = em_utils_camel_address_to_destination (to); - - /* Set the subject of the new message. */ - if ((subject = (char *) camel_mime_message_get_subject (message))) { - if (strncasecmp (subject, "Re: ", 4) != 0) - subject = g_strdup_printf ("Re: %s", subject); - else - subject = g_strdup (subject); - } else { - subject = g_strdup (""); - } - - e_msg_composer_set_headers (composer, account ? account->name : NULL, tov, NULL, NULL, subject); - - g_free (subject); - - url = mail_tools_folder_to_url (folder); - e_msg_composer_hdrs_set_post_to ((EMsgComposerHdrs *) composer->hdrs, url); - g_free (url); - - /* Add In-Reply-To and References. */ - message_id = camel_medium_get_header (CAMEL_MEDIUM (message), "Message-Id"); - references = camel_medium_get_header (CAMEL_MEDIUM (message), "References"); - if (message_id) { - char *reply_refs; - - e_msg_composer_add_header (composer, "In-Reply-To", message_id); - - if (references) - reply_refs = g_strdup_printf ("%s %s", references, message_id); - else - reply_refs = g_strdup (message_id); - - e_msg_composer_add_header (composer, "References", reply_refs); - g_free (reply_refs); - } else if (references) { - e_msg_composer_add_header (composer, "References", references); - } - - e_msg_composer_drop_editor_undo (composer); - - e_msg_composer_add_message_attachments (composer, message, TRUE); - - if (to != NULL) - camel_object_unref (to); - - composer_set_body (composer, message); - - em_composer_utils_setup_callbacks (composer, folder, uid, flags, flags, NULL, NULL); - - gtk_widget_show (GTK_WIDGET (composer)); - e_msg_composer_unset_changed (composer); -} - -/** - * em_utils_post_reply_to_message_by_uid: - * @folder: folder containing message to reply to - * @uid: message uid - * @mode: reply mode - * - * Creates a new composer (post mode) ready to reply to the message - * referenced by @folder and @uid. - **/ -void -em_utils_post_reply_to_message_by_uid (CamelFolder *folder, const char *uid) -{ - g_return_if_fail (CAMEL_IS_FOLDER (folder)); - g_return_if_fail (uid != NULL); - - mail_get_message (folder, uid, post_reply_to_message, NULL, mail_thread_new); -} - -/* Saving messages... */ - -static GtkFileSelection * -emu_get_save_filesel (GtkWidget *parent, const char *title, const char *name) -{ - GtkFileSelection *filesel; - char *gdir, *mname = NULL, *filename; - const char *realname, *dir; - GConfClient *gconf; - - filesel = (GtkFileSelection *)gtk_file_selection_new(title); - if (parent) - e_dialog_set_transient_for((GtkWindow *)filesel, parent); - - gconf = gconf_client_get_default(); - dir = gdir = gconf_client_get_string(gconf, "/apps/evolution/mail/save_dir", NULL); - g_object_unref(gconf); - if (dir == NULL) - dir = g_get_home_dir(); - - if (name && name[0]) { - realname = mname = g_strdup(name); - e_filename_make_safe(mname); - } else { - realname = "/"; - } - - filename = g_build_filename(dir, realname, NULL); - gtk_file_selection_set_filename(filesel, filename); - g_free(filename); - g_free(mname); - g_free (gdir); - - return filesel; -} - -static void -emu_update_save_path(const char *filename) -{ - char *dir = g_path_get_dirname(filename); - GConfClient *gconf = gconf_client_get_default(); - - gconf_client_set_string(gconf, "/apps/evolution/mail/save_dir", dir, NULL); - g_object_unref(gconf); - g_free(dir); -} - -static gboolean -emu_can_save(GtkWindow *parent, const char *path) -{ - struct stat st; - - if (path[0] == 0) - return FALSE; - - /* make sure we can actually save to it... */ - if (stat (path, &st) != -1 && !S_ISREG (st.st_mode)) - return FALSE; - - if (access (path, F_OK) == 0) { - if (access (path, W_OK) != 0) { - e_notice (parent, GTK_MESSAGE_ERROR, - _("Cannot save to `%s'\n %s"), path, g_strerror (errno)); - return FALSE; - } - - return em_utils_prompt_user (parent, GTK_RESPONSE_NO, NULL, - _("`%s' already exists.\nOverwrite it?"), path); - } - - return TRUE; -} - -static void -emu_save_part_response(GtkFileSelection *filesel, int response, CamelMimePart *part) -{ - if (response == GTK_RESPONSE_OK) { - const char *path = gtk_file_selection_get_filename(filesel); - - if (!emu_can_save((GtkWindow *)filesel, path)) - return; - - emu_update_save_path(path); - /* FIXME: popup error if it fails? */ - mail_save_part(part, path, NULL, NULL); - } - - gtk_widget_destroy((GtkWidget *)filesel); - camel_object_unref(part); -} - -/** - * em_utils_save_part: - * @parent: parent window - * @prompt: prompt string - * @part: part to save - * - * Saves a mime part to disk (prompting the user for filename). - **/ -void -em_utils_save_part(GtkWidget *parent, const char *prompt, CamelMimePart *part) -{ - const char *name; - GtkFileSelection *filesel; - - name = camel_mime_part_get_filename(part); - if (name == NULL) { - if (CAMEL_IS_MIME_MESSAGE(part)) { - name = camel_mime_message_get_subject((CamelMimeMessage *)part); - if (name == NULL) - name = _("message"); - } else { - name = _("attachment"); - } - } - - filesel = emu_get_save_filesel(parent, prompt, name); - camel_object_ref(part); - g_signal_connect(filesel, "response", G_CALLBACK(emu_save_part_response), part); - gtk_widget_show((GtkWidget *)filesel); -} - - -struct _save_messages_data { - CamelFolder *folder; - GPtrArray *uids; -}; - -static void -emu_save_messages_response(GtkFileSelection *filesel, int response, struct _save_messages_data *data) -{ - if (response == GTK_RESPONSE_OK) { - const char *path = gtk_file_selection_get_filename(filesel); - - if (!emu_can_save((GtkWindow *)filesel, path)) - return; - - emu_update_save_path(path); - mail_save_messages(data->folder, data->uids, path, NULL, NULL); - data->uids = NULL; - } - - camel_object_unref(data->folder); - if (data->uids) - em_utils_uids_free(data->uids); - g_free(data); - gtk_widget_destroy((GtkWidget *)filesel); -} - -/** - * em_utils_save_messages: - * @parent: parent window - * @folder: folder containing messages to save - * @uids: uids of messages to save - * - * Saves a group of messages to disk in mbox format (prompting the - * user for filename). - **/ -void -em_utils_save_messages (GtkWidget *parent, CamelFolder *folder, GPtrArray *uids) -{ - struct _save_messages_data *data; - GtkFileSelection *filesel; - - g_return_if_fail (CAMEL_IS_FOLDER (folder)); - g_return_if_fail (uids != NULL); - - filesel = emu_get_save_filesel(parent, _("Save Message..."), NULL); - camel_object_ref(folder); - - data = g_malloc(sizeof(struct _save_messages_data)); - data->folder = folder; - data->uids = uids; - - g_signal_connect(filesel, "response", G_CALLBACK(emu_save_messages_response), data); - gtk_widget_show((GtkWidget *)filesel); -} - -/* ********************************************************************** */ - -static void -emu_add_address_cb(BonoboListener *listener, const char *name, const CORBA_any *any, CORBA_Environment *ev, void *data) -{ - char *type = bonobo_event_subtype(name); - - if (!strcmp(type, "Destroy")) - gtk_widget_destroy((GtkWidget *)data); - - g_free(type); -} - -/** - * em_utils_add_address: - * @parent: - * @email: - * - * Add address @email to the addressbook. - **/ -void em_utils_add_address(struct _GtkWidget *parent, const char *email) -{ - GtkWidget *win; - GtkWidget *control; - /*GtkWidget *socket;*/ - - win = gtk_window_new(GTK_WINDOW_TOPLEVEL); - gtk_window_set_title((GtkWindow *)win, _("Add address")); - - control = bonobo_widget_new_control("OAFIID:GNOME_Evolution_Addressbook_AddressPopup:" BASE_VERSION, CORBA_OBJECT_NIL); - bonobo_widget_set_property((BonoboWidget *)control, "email", TC_CORBA_string, email, NULL); - - bonobo_event_source_client_add_listener(bonobo_widget_get_objref((BonoboWidget *)control), emu_add_address_cb, NULL, NULL, win); - - /*socket = find_socket (GTK_CONTAINER (control)); - g_object_weak_ref ((GObject *) socket, (GWeakNotify) gtk_widget_destroy, win);*/ - - gtk_container_add((GtkContainer *)win, control); - gtk_widget_show_all(win); -} - -/* ********************************************************************** */ -/* Flag-for-Followup... */ - -/* tag-editor callback data */ -struct ted_t { - MessageTagEditor *editor; - CamelFolder *folder; - GPtrArray *uids; -}; - -static void -ted_free (struct ted_t *ted) -{ - camel_object_unref (ted->folder); - em_utils_uids_free (ted->uids); - g_free (ted); -} - -static void -tag_editor_response (GtkWidget *dialog, int button, struct ted_t *ted) -{ - CamelFolder *folder; - CamelTag *tags, *t; - GPtrArray *uids; - int i; - - if (button == GTK_RESPONSE_OK && (tags = message_tag_editor_get_tag_list (ted->editor))) { - folder = ted->folder; - uids = ted->uids; - - camel_folder_freeze (folder); - for (i = 0; i < uids->len; i++) { - for (t = tags; t; t = t->next) - camel_folder_set_message_user_tag (folder, uids->pdata[i], t->name, t->value); - } - - camel_folder_thaw (folder); - camel_tag_list_free (&tags); - } - - gtk_widget_destroy (dialog); -} - -/** - * em_utils_flag_for_followup: - * @parent: parent window - * @folder: folder containing messages to flag - * @uids: uids of messages to flag - * - * Open the Flag-for-Followup editor for the messages specified by - * @folder and @uids. - **/ -void -em_utils_flag_for_followup (GtkWidget *parent, CamelFolder *folder, GPtrArray *uids) -{ - GtkWidget *editor; - struct ted_t *ted; - int i; - - g_return_if_fail (CAMEL_IS_FOLDER (folder)); - g_return_if_fail (uids != NULL); - - editor = (GtkWidget *) message_tag_followup_new (); - - if (parent != NULL) - e_dialog_set_transient_for ((GtkWindow *) editor, parent); - - camel_object_ref (folder); - - ted = g_new (struct ted_t, 1); - ted->editor = MESSAGE_TAG_EDITOR (editor); - ted->folder = folder; - ted->uids = uids; - - for (i = 0; i < uids->len; i++) { - CamelMessageInfo *info; - - info = camel_folder_get_message_info (folder, uids->pdata[i]); - message_tag_followup_append_message (MESSAGE_TAG_FOLLOWUP (editor), - camel_message_info_from (info), - camel_message_info_subject (info)); - } - - /* special-case... */ - if (uids->len == 1) { - CamelMessageInfo *info; - - info = camel_folder_get_message_info (folder, uids->pdata[0]); - if (info) { - if (info->user_tags) - message_tag_editor_set_tag_list (MESSAGE_TAG_EDITOR (editor), info->user_tags); - camel_folder_free_message_info (folder, info); - } - } - - g_signal_connect (editor, "response", G_CALLBACK (tag_editor_response), ted); - g_object_weak_ref ((GObject *) editor, (GWeakNotify) ted_free, ted); - - gtk_widget_show (editor); -} - -/** - * em_utils_flag_for_followup_clear: - * @parent: parent window - * @folder: folder containing messages to unflag - * @uids: uids of messages to unflag - * - * Clears the Flag-for-Followup flag on the messages referenced by - * @folder and @uids. - **/ -void -em_utils_flag_for_followup_clear (GtkWidget *parent, CamelFolder *folder, GPtrArray *uids) -{ - int i; - - g_return_if_fail (CAMEL_IS_FOLDER (folder)); - g_return_if_fail (uids != NULL); - - camel_folder_freeze (folder); - for (i = 0; i < uids->len; i++) { - camel_folder_set_message_user_tag (folder, uids->pdata[i], "follow-up", ""); - camel_folder_set_message_user_tag (folder, uids->pdata[i], "due-by", ""); - camel_folder_set_message_user_tag (folder, uids->pdata[i], "completed-on", ""); - } - camel_folder_thaw (folder); - - em_utils_uids_free (uids); -} - -/** - * em_utils_flag_for_followup_completed: - * @parent: parent window - * @folder: folder containing messages to 'complete' - * @uids: uids of messages to 'complete' - * - * Sets the completed state (and date/time) for each message - * referenced by @folder and @uids that is marked for - * Flag-for-Followup. - **/ -void -em_utils_flag_for_followup_completed (GtkWidget *parent, CamelFolder *folder, GPtrArray *uids) -{ - char *now; - int i; - - g_return_if_fail (CAMEL_IS_FOLDER (folder)); - g_return_if_fail (uids != NULL); - - now = camel_header_format_date (time (NULL), 0); - - camel_folder_freeze (folder); - for (i = 0; i < uids->len; i++) { - const char *tag; - - tag = camel_folder_get_message_user_tag (folder, uids->pdata[i], "follow-up"); - if (tag == NULL || *tag == '\0') - continue; - - camel_folder_set_message_user_tag (folder, uids->pdata[i], "completed-on", now); - } - camel_folder_thaw (folder); - - g_free (now); - - em_utils_uids_free (uids); -} - -#include "camel/camel-stream-mem.h" -#include "camel/camel-stream-filter.h" -#include "camel/camel-mime-filter-from.h" - -/* This kind of sucks, because for various reasons most callers need to run synchronously - in the gui thread, however this could take a long, blocking time, to run */ -static int -em_utils_write_messages_to_stream(CamelFolder *folder, GPtrArray *uids, CamelStream *stream) -{ - CamelStreamFilter *filtered_stream; - CamelMimeFilterFrom *from_filter; - int i, res = 0; - - from_filter = camel_mime_filter_from_new(); - filtered_stream = camel_stream_filter_new_with_stream(stream); - camel_stream_filter_add(filtered_stream, (CamelMimeFilter *)from_filter); - camel_object_unref(from_filter); - - for (i=0; i<uids->len; i++) { - CamelMimeMessage *message; - char *from; - - message = camel_folder_get_message(folder, uids->pdata[i], NULL); - if (message == NULL) { - res = -1; - break; - } - - /* we need to flush after each stream write since we are writing to the same stream */ - from = camel_mime_message_build_mbox_from(message); - - if (camel_stream_write_string(stream, from) == -1 - || camel_stream_flush(stream) == -1 - || camel_data_wrapper_write_to_stream((CamelDataWrapper *)message, (CamelStream *)filtered_stream) == -1 - || camel_stream_flush((CamelStream *)filtered_stream) == -1) - res = -1; - - g_free(from); - camel_object_unref(message); - - if (res == -1) - break; - } - - camel_object_unref(filtered_stream); - - return res; -} - -/* This kind of sucks, because for various reasons most callers need to run synchronously - in the gui thread, however this could take a long, blocking time, to run */ -static int -em_utils_read_messages_from_stream(CamelFolder *folder, CamelStream *stream) -{ - CamelException *ex = camel_exception_new(); - CamelMimeParser *mp = camel_mime_parser_new(); - int res = -1; - - camel_mime_parser_scan_from(mp, TRUE); - camel_mime_parser_init_with_stream(mp, stream); - camel_object_unref(stream); - - while (camel_mime_parser_step(mp, 0, 0) == CAMEL_MIME_PARSER_STATE_FROM) { - CamelMimeMessage *msg; - - /* NB: de-from filter, once written */ - msg = camel_mime_message_new(); - if (camel_mime_part_construct_from_parser((CamelMimePart *)msg, mp) == -1) { - camel_object_unref(msg); - break; - } - - camel_folder_append_message(folder, msg, NULL, NULL, ex); - camel_object_unref(msg); - - if (camel_exception_is_set (ex)) - break; - - camel_mime_parser_step(mp, 0, 0); - } - - camel_object_unref(mp); - if (!camel_exception_is_set(ex)) - res = 0; - camel_exception_free(ex); - - return res; -} - -/** - * em_utils_selection_set_mailbox: - * @data: selection data - * @folder: folder containign messages to copy into the selection - * @uids: uids of the messages to copy into the selection - * - * Creates a mailbox-format selection. - * Warning: Could be BIG! - * Warning: This could block the ui for an extended period. - **/ -void -em_utils_selection_set_mailbox(GtkSelectionData *data, CamelFolder *folder, GPtrArray *uids) -{ - CamelStream *stream; - - stream = camel_stream_mem_new(); - if (em_utils_write_messages_to_stream(folder, uids, stream) == 0) - gtk_selection_data_set(data, data->target, 8, - ((CamelStreamMem *)stream)->buffer->data, - ((CamelStreamMem *)stream)->buffer->len); - - camel_object_unref(stream); -} - -/** - * em_utils_selection_get_mailbox: - * @data: selection data - * @folder: - * - * Receive a mailbox selection/dnd - * Warning: Could be BIG! - * Warning: This could block the ui for an extended period. - * FIXME: Exceptions? - **/ -void -em_utils_selection_get_mailbox(GtkSelectionData *data, CamelFolder *folder) -{ - CamelStream *stream; - - if (data->data == NULL || data->length == -1) - return; - - /* TODO: a stream mem with read-only access to existing data? */ - /* NB: Although copying would let us run this async ... which it should */ - stream = camel_stream_mem_new_with_buffer(data->data, data->length); - em_utils_read_messages_from_stream(folder, stream); - camel_object_unref(stream); -} - -/** - * em_utils_selection_set_uidlist: - * @data: selection data - * @uri: - * @uids: - * - * Sets a "x-uid-list" format selection data. - * - * FIXME: be nice if this could take a folder argument rather than uri - **/ -void -em_utils_selection_set_uidlist(GtkSelectionData *data, const char *uri, GPtrArray *uids) -{ - GByteArray *array = g_byte_array_new(); - int i; - - /* format: "uri\0uid1\0uid2\0uid3\0...\0uidn\0" */ - - g_byte_array_append(array, uri, strlen(uri)+1); - - for (i=0; i<uids->len; i++) - g_byte_array_append(array, uids->pdata[i], strlen(uids->pdata[i])+1); - - gtk_selection_data_set(data, data->target, 8, array->data, array->len); - g_byte_array_free(array, TRUE); -} - -/** - * em_utils_selection_get_uidlist: - * @data: selection data - * @urip: Pointer to uri string, to be free'd by caller - * @uidsp: Pointer to an array of uid's. - * - * Convert an x-uid-list type to a uri and a uid list. - * - * Return value: The number of uid's found. If 0, then @urip and - * @uidsp will be empty. - **/ -int -em_utils_selection_get_uidlist(GtkSelectionData *data, char **urip, GPtrArray **uidsp) -{ - /* format: "uri\0uid1\0uid2\0uid3\0...\0uidn" */ - char *inptr, *inend; - GPtrArray *uids; - int res; - - *urip = NULL; - *uidsp = NULL; - - if (data == NULL || data->data == NULL || data->length == -1) - return 0; - - uids = g_ptr_array_new(); - - inptr = data->data; - inend = data->data + data->length; - while (inptr < inend) { - char *start = inptr; - - while (inptr < inend && *inptr) - inptr++; - - if (start > (char *)data->data) - g_ptr_array_add(uids, g_strndup(start, inptr-start)); - - inptr++; - } - - if (uids->len == 0) { - g_ptr_array_free(uids, TRUE); - res = 0; - } else { - *urip = g_strdup(data->data); - *uidsp = uids; - res = uids->len; - } - - return res; -} - -/** - * em_utils_selection_set_urilist: - * @data: - * @folder: - * @uids: - * - * Set the selection data @data to a uri which points to a file, which is - * a berkely mailbox format mailbox. The file is automatically cleaned - * up when the application quits. - **/ -void -em_utils_selection_set_urilist(GtkSelectionData *data, CamelFolder *folder, GPtrArray *uids) -{ - const char *tmpdir; - CamelStream *fstream; - char *uri, *p; - int fd; - - tmpdir = e_mkdtemp("drag-n-drop-XXXXXX"); - if (tmpdir == NULL) - return; - - /* FIXME: this used to save a single message with the subject - as the filename but it was unsafe, and makes this messier, - the pain */ - - p = uri = g_alloca (strlen (tmpdir) + 16); - p += sprintf (uri, "file:///%s/mbox", tmpdir); - - fd = open(uri + 7, O_WRONLY | O_CREAT | O_EXCL, 0666); - if (fd == -1) - return; - - fstream = camel_stream_fs_new_with_fd(fd); - if (fstream) { - /* terminate with \r\n to be compliant with the spec */ - strcpy (p, "\r\n"); - - if (em_utils_write_messages_to_stream(folder, uids, fstream) == 0) - gtk_selection_data_set(data, data->target, 8, uri, strlen(uri)); - - camel_object_unref(fstream); - } -} - -static void -emu_save_part_done(CamelMimePart *part, char *name, int done, void *data) -{ - ((int *)data)[0] = done; -} - -/** - * em_utils_temp_save_part: - * @parent: - * @part: - * - * Save a part's content to a temporary file, and return the - * filename. - * - * Return value: NULL if anything failed. - **/ -char * -em_utils_temp_save_part(GtkWidget *parent, CamelMimePart *part) -{ - const char *tmpdir, *filename; - char *path, *mfilename = NULL; - int done; - - tmpdir = e_mkdtemp("evolution-tmp-XXXXXX"); - if (tmpdir == NULL) { - e_notice(parent, GTK_MESSAGE_ERROR, - _("Could not create temporary directory: %s"), - g_strerror (errno)); - - return NULL; - } - - filename = camel_mime_part_get_filename (part); - if (filename == NULL) { - /* This is the default filename used for temporary file creation */ - filename = _("Unknown"); - } else { - mfilename = g_strdup(filename); - e_filename_make_safe(mfilename); - filename = mfilename; - } - - path = g_build_filename(tmpdir, filename, NULL); - g_free(mfilename); - - /* FIXME: This doesn't handle default charsets */ - mail_msg_wait(mail_save_part(part, path, emu_save_part_done, &done)); - - if (!done) { - /* mail_save_part should popup an error box automagically */ - g_free(path); - path = NULL; - } - - return path; -} - -extern CamelFolder *drafts_folder, *sent_folder, *outbox_folder; - -/** - * em_utils_folder_is_drafts: - * @folder: folder - * @uri: uri for this folder, if known - * - * Decides if @folder is a Drafts folder. - * - * Returns %TRUE if this is a Drafts folder or %FALSE otherwise. - **/ -gboolean -em_utils_folder_is_drafts(CamelFolder *folder, const char *uri) -{ - EAccountList *accounts; - EAccount *account; - EIterator *iter; - int is = FALSE; - - if (folder == drafts_folder) - return TRUE; - - if (uri == NULL) - return FALSE; - - accounts = mail_config_get_accounts(); - iter = e_list_get_iterator((EList *)accounts); - while (e_iterator_is_valid(iter)) { - account = (EAccount *)e_iterator_get(iter); - if (account->drafts_folder_uri && - camel_store_uri_cmp(folder->parent_store, account->drafts_folder_uri, uri)) { - is = TRUE; - break; - } - - e_iterator_next(iter); - } - - g_object_unref(iter); - - return is; -} - -/** - * em_utils_folder_is_sent: - * @folder: folder - * @uri: uri for this folder, if known - * - * Decides if @folder is a Sent folder - * - * Returns %TRUE if this is a Sent folder or %FALSE otherwise. - **/ -gboolean -em_utils_folder_is_sent(CamelFolder *folder, const char *uri) -{ - EAccountList *accounts; - EAccount *account; - EIterator *iter; - int is = FALSE; - - if (folder == sent_folder) - return TRUE; - - if (uri == NULL) - return FALSE; - - accounts = mail_config_get_accounts(); - iter = e_list_get_iterator((EList *)accounts); - while (e_iterator_is_valid(iter)) { - account = (EAccount *)e_iterator_get(iter); - if (account->sent_folder_uri && - camel_store_uri_cmp(folder->parent_store, account->sent_folder_uri, uri)) { - is = TRUE; - break; - } - - e_iterator_next(iter); - } - - g_object_unref(iter); - - return is; -} - -/** - * em_utils_folder_is_outbox: - * @folder: folder - * @uri: uri for this folder, if known - * - * Decides if @folder is an Outbox folder - * - * Returns %TRUE if this is an Outbox folder or %FALSE otherwise. - **/ -gboolean -em_utils_folder_is_outbox(CamelFolder *folder, const char *uri) -{ - /* <Highlander>There can be only one.</Highlander> */ - return folder == outbox_folder; -} - -/** - * em_utils_adjustment_page: - * @adj: - * @down: - * - * Move an adjustment up/down forward/back one page. - **/ -void -em_utils_adjustment_page(GtkAdjustment *adj, gboolean down) -{ - float page_size = adj->page_size - adj->step_increment; - - if (down) { - if (adj->value < adj->upper - adj->page_size - page_size) - adj->value += page_size; - else if (adj->upper >= adj->page_size) - adj->value = adj->upper - adj->page_size; - else - adj->value = adj->lower; - } else { - if (adj->value > adj->lower + page_size) - adj->value -= page_size; - else - adj->value = adj->lower; - } - - gtk_adjustment_value_changed(adj); -} - -/* ********************************************************************** */ -static char *emu_proxy_uri; - -static void -emu_set_proxy(GConfClient *client) -{ - char *server; - int port; - - if (!gconf_client_get_bool(client, "/system/http_proxy/use_http_proxy", NULL)) { - g_free(emu_proxy_uri); - emu_proxy_uri = NULL; - - return; - } - - /* TODO: Should lock ... */ - - server = gconf_client_get_string(client, "/system/http_proxy/host", NULL); - port = gconf_client_get_int(client, "/system/http_proxy/port", NULL); - - if (server && server[0]) { - g_free(emu_proxy_uri); - - if (gconf_client_get_bool(client, "/system/http_proxy/use_authentication", NULL)) { - char *user = gconf_client_get_string(client, "/system/http_proxy/authentication_user", NULL); - char *pass = gconf_client_get_string(client, "/system/http_proxy/authentication_password", NULL); - - emu_proxy_uri = g_strdup_printf("http://%s:%s@%s:%d", user, pass, server, port); - g_free(user); - g_free(pass); - } else { - emu_proxy_uri = g_strdup_printf("http://%s:%d", server, port); - } - } - - g_free(server); -} - -static void -emu_proxy_changed(GConfClient *client, guint32 cnxn_id, GConfEntry *entry, gpointer user_data) -{ - emu_set_proxy(client); -} - -/** - * em_utils_get_proxy_uri: - * - * Get the system proxy uri. - * - * Return value: Must be freed when finished with. - **/ -char * -em_utils_get_proxy_uri(void) -{ - static int init; - - if (!init) { - GConfClient *client = gconf_client_get_default(); - - gconf_client_add_dir(client, "/system/http_proxy", GCONF_CLIENT_PRELOAD_ONELEVEL, NULL); - gconf_client_notify_add(client, "/system/http_proxy", emu_proxy_changed, NULL, NULL, NULL); - emu_set_proxy(client); - g_object_unref(client); - init = TRUE; - } - - return g_strdup(emu_proxy_uri); -} - -/** - * em_utils_part_to_html: - * @part: - * - * Converts a mime part's contents into html text. If @credits is given, - * then it will be used as an attribution string, and the - * content will be cited. Otherwise no citation or attribution - * will be performed. - * - * Return Value: The part in displayable html format. - **/ -char * -em_utils_part_to_html(CamelMimePart *part) -{ - EMFormatQuote *emfq; - CamelStreamMem *mem; - GByteArray *buf; - char *text; - - buf = g_byte_array_new (); - mem = (CamelStreamMem *) camel_stream_mem_new (); - camel_stream_mem_set_byte_array (mem, buf); - - emfq = em_format_quote_new(NULL, (CamelStream *)mem, 0); - em_format_part((EMFormat *) emfq, (CamelStream *) mem, part); - g_object_unref (emfq); - - camel_stream_write ((CamelStream *) mem, "", 1); - camel_object_unref (mem); - - text = buf->data; - g_byte_array_free (buf, FALSE); - - return text; -} - -/** - * em_utils_message_to_html: - * @message: - * @credits: - * @flags: EMFormatQuote flags - * - * Convert a message to html, quoting if the @credits attribution - * string is given. - * - * Return value: The html version. - **/ -char * -em_utils_message_to_html(CamelMimeMessage *message, const char *credits, guint32 flags) -{ - EMFormatQuote *emfq; - CamelStreamMem *mem; - GByteArray *buf; - char *text; - - buf = g_byte_array_new (); - mem = (CamelStreamMem *) camel_stream_mem_new (); - camel_stream_mem_set_byte_array (mem, buf); - - emfq = em_format_quote_new(credits, (CamelStream *)mem, flags); - em_format_format((EMFormat *)emfq, (CamelMedium *)message); - g_object_unref (emfq); - - camel_stream_write ((CamelStream *) mem, "", 1); - camel_object_unref (mem); - - text = buf->data; - g_byte_array_free (buf, FALSE); - - return text; -} - -/* ********************************************************************** */ - -/** - * em_utils_expunge_folder: - * @parent: parent window - * @folder: folder to expunge - * - * Expunges @folder. - **/ -void -em_utils_expunge_folder (GtkWidget *parent, CamelFolder *folder) -{ - char *name; - - camel_object_get(folder, NULL, CAMEL_OBJECT_DESCRIPTION, &name, 0); - - if (!em_utils_prompt_user(parent, GTK_RESPONSE_NO, "/apps/evolution/mail/prompts/expunge", - _("This operation will permanently remove all deleted messages " - "in the folder `%s'. If you continue, you " - "will not be able to recover these messages.\n" - "\nReally erase these messages?"), name)) - return; - - mail_expunge_folder(folder, NULL, NULL); -} - -/** - * em_utils_empty_trash: - * @parent: parent window - * - * Empties all Trash folders. - **/ -void -em_utils_empty_trash (GtkWidget *parent) -{ - extern CamelSession *session; - CamelProvider *provider; - EAccountList *accounts; - EAccount *account; - EIterator *iter; - CamelException ex; - - if (!em_utils_prompt_user(parent, GTK_RESPONSE_NO, "/apps/evolution/mail/prompts/empty_trash", - _("This operation will permanently remove all deleted messages " - "in all folders. If you continue, you will not be able to " - "recover these messages.\n" - "\nReally erase these messages?"))) - return; - - camel_exception_init (&ex); - - /* expunge all remote stores */ - accounts = mail_config_get_accounts (); - iter = e_list_get_iterator ((EList *) accounts); - while (e_iterator_is_valid (iter)) { - account = (EAccount *) e_iterator_get (iter); - - /* make sure this is a valid source */ - if (account->enabled && account->source->url) { - provider = camel_session_get_provider (session, account->source->url, &ex); - if (provider) { - /* make sure this store is a remote store */ - if (provider->flags & CAMEL_PROVIDER_IS_STORAGE && - provider->flags & CAMEL_PROVIDER_IS_REMOTE) { - mail_empty_trash (account, NULL, NULL); - } - } - - /* clear the exception for the next round */ - camel_exception_clear (&ex); - } - - e_iterator_next (iter); - } - - g_object_unref (iter); - - /* Now empty the local trash folder */ - mail_empty_trash (NULL, NULL, NULL); -} diff --git a/mail/em-utils.h b/mail/em-utils.h deleted file mode 100644 index 502b52e19d..0000000000 --- a/mail/em-utils.h +++ /dev/null @@ -1,127 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Authors: Jeffrey Stedfast <fejj@ximian.com> - * - * Copyright 2003 Ximian, Inc. (www.ximian.com) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA. - * - */ - - -#ifndef __EM_UTILS_H__ -#define __EM_UTILS_H__ - -#include <glib.h> - -#ifdef __cplusplus -extern "C" { -#pragma } -#endif /* __cplusplus */ - -struct _GtkWidget; -struct _GtkWindow; -struct _CamelFolder; -struct _CamelStream; -struct _CamelMimeMessage; -struct _CamelMimePart; -struct _GtkSelectionData; -struct _GtkAdjustment; -struct _EMsgComposer; - -gboolean em_utils_prompt_user(struct _GtkWindow *parent, int def, const char *promptkey, const char *fmt, ...); - -GPtrArray *em_utils_uids_copy (GPtrArray *uids); -void em_utils_uids_free (GPtrArray *uids); - -gboolean em_utils_configure_account (struct _GtkWidget *parent); -gboolean em_utils_check_user_can_send_mail (struct _GtkWidget *parent); - -void em_utils_edit_filters (struct _GtkWidget *parent); -void em_utils_edit_vfolders (struct _GtkWidget *parent); - -void em_utils_composer_send_cb(struct _EMsgComposer *composer, gpointer user_data); -void em_utils_composer_save_draft_cb(struct _EMsgComposer *composer, int quit, gpointer user_data); - -void em_utils_compose_new_message (void); - -/* FIXME: mailto? url? should make up its mind what its called. imho use 'uri' */ -void em_utils_compose_new_message_with_mailto (const char *url); -void em_utils_post_to_url (const char *url); - -void em_utils_edit_message (struct _CamelMimeMessage *message); -void em_utils_edit_messages (struct _CamelFolder *folder, GPtrArray *uids); - -void em_utils_forward_attached (struct _CamelFolder *folder, GPtrArray *uids); -void em_utils_forward_inline (struct _CamelFolder *folder, GPtrArray *uids); -void em_utils_forward_quoted (struct _CamelFolder *folder, GPtrArray *uids); - -void em_utils_forward_message (struct _CamelMimeMessage *msg); -void em_utils_forward_messages (struct _CamelFolder *folder, GPtrArray *uids); - -void em_utils_redirect_message (struct _CamelMimeMessage *message); -void em_utils_redirect_message_by_uid (struct _CamelFolder *folder, const char *uid); - -enum { - REPLY_MODE_SENDER, - REPLY_MODE_ALL, - REPLY_MODE_LIST -}; - -void em_utils_reply_to_message (struct _CamelMimeMessage *message, int mode); -void em_utils_reply_to_message_by_uid (struct _CamelFolder *folder, const char *uid, int mode); - -void em_utils_post_reply_to_message_by_uid (struct _CamelFolder *folder, const char *uid); - -void em_utils_save_part(struct _GtkWidget *parent, const char *prompt, struct _CamelMimePart *part); -void em_utils_save_messages (struct _GtkWidget *parent, struct _CamelFolder *folder, GPtrArray *uids); - -void em_utils_add_address(struct _GtkWidget *parent, const char *email); - -void em_utils_flag_for_followup (struct _GtkWidget *parent, struct _CamelFolder *folder, GPtrArray *uids); -void em_utils_flag_for_followup_clear (struct _GtkWidget *parent, struct _CamelFolder *folder, GPtrArray *uids); -void em_utils_flag_for_followup_completed (struct _GtkWidget *parent, struct _CamelFolder *folder, GPtrArray *uids); - -/* This stuff that follows probably doesn't belong here, then again, the stuff above probably belongs elsewhere */ - -void em_utils_selection_set_mailbox(struct _GtkSelectionData *data, struct _CamelFolder *folder, GPtrArray *uids); -void em_utils_selection_get_mailbox(struct _GtkSelectionData *data, struct _CamelFolder *folder); -/* FIXME: be nice if these also worked on struct _CamelFolder's, no easy way to get uri from folder yet tho */ -void em_utils_selection_set_uidlist(struct _GtkSelectionData *data, const char *uri, GPtrArray *uids); -int em_utils_selection_get_uidlist(struct _GtkSelectionData *data, char **uri, GPtrArray **uidsp); -void em_utils_selection_set_urilist(struct _GtkSelectionData *data, struct _CamelFolder *folder, GPtrArray *uids); - -char *em_utils_temp_save_part(struct _GtkWidget *parent, struct _CamelMimePart *part); - -gboolean em_utils_folder_is_drafts(struct _CamelFolder *folder, const char *uri); -gboolean em_utils_folder_is_sent(struct _CamelFolder *folder, const char *uri); -gboolean em_utils_folder_is_outbox(struct _CamelFolder *folder, const char *uri); - -void em_utils_adjustment_page(struct _GtkAdjustment *adj, gboolean down); - -char *em_utils_get_proxy_uri(void); - -/* FIXME: should this have an override charset? */ -char *em_utils_part_to_html(struct _CamelMimePart *part); -char *em_utils_message_to_html(struct _CamelMimeMessage *msg, const char *credits, guint32 flags); - -void em_utils_expunge_folder (struct _GtkWidget *parent, struct _CamelFolder *folder); -void em_utils_empty_trash (struct _GtkWidget *parent); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __EM_UTILS_H__ */ diff --git a/mail/evolution-mail.schemas.in.in b/mail/evolution-mail.schemas.in.in deleted file mode 100644 index 297d158d6b..0000000000 --- a/mail/evolution-mail.schemas.in.in +++ /dev/null @@ -1,654 +0,0 @@ -<gconfschemafile> - <schemalist> - - <!-- Composer settings --> - - <schema> - <key>/schemas/apps/evolution/mail/composer/charset</key> - <applyto>/apps/evolution/mail/composer/charset</applyto> - <owner>evolution-mail</owner> - <type>string</type> - <default></default> - <locale name="C"> - <short>Default charset in which to compose messages</short> - <long> - Default charset in which to compose messages. - </long> - </locale> - </schema> - - <schema> - <key>/schemas/apps/evolution/mail/composer/send_html</key> - <applyto>/apps/evolution/mail/composer/send_html</applyto> - <owner>evolution-mail</owner> - <type>bool</type> - <default>false</default> - <locale name="C"> - <short>Send HTML mail by default</short> - <long> - Send HTML mail by default. - </long> - </locale> - </schema> - - <schema> - <key>/schemas/apps/evolution/mail/composer/magic_links</key> - <applyto>/apps/evolution/mail/composer/magic_links</applyto> - <owner>evolution-mail</owner> - <type>bool</type> - <default>true</default> - <locale name="C"> - <short>Automatic link recognition</short> - <long> - Recognize links in text and replace them. - </long> - </locale> - </schema> - - <schema> - <key>/schemas/apps/evolution/mail/composer/magic_smileys</key> - <applyto>/apps/evolution/mail/composer/send_smileys</applyto> - <owner>evolution-mail</owner> - <type>bool</type> - <default>false</default> - <locale name="C"> - <short>Automatic smiley recognition</short> - <long> - Recognize smileys in text and replace them with images. - </long> - </locale> - </schema> - - <schema> - <key>/schemas/apps/evolution/mail/composer/inline_spelling</key> - <applyto>/apps/evolution/mail/composer/inline_spelling</applyto> - <owner>evolution-mail</owner> - <type>bool</type> - <default>true</default> - <locale name="C"> - <short>Spell check inline</short> - <long> - Draw spelling error indicators on words as you type. - </long> - </locale> - </schema> - - <schema> - <key>/schemas/apps/evolution/mail/composer/view/From</key> - <applyto>/apps/evolution/mail/composer/view/From</applyto> - <owner>evolution-mail</owner> - <type>bool</type> - <default>true</default> - <locale name="C"> - <short>View/From menu item is checked</short> - <long> - View/From menu item is checked. - </long> - </locale> - </schema> - - <schema> - <key>/schemas/apps/evolution/mail/composer/view/PostTo</key> - <applyto>/apps/evolution/mail/composer/view/PostTo</applyto> - <owner>evolution-mail</owner> - <type>bool</type> - <default>true</default> - <locale name="C"> - <short>View/PostTo menu item is checked</short> - <long> - View/PostTo menu item is checked. - </long> - </locale> - </schema> - - <schema> - <key>/schemas/apps/evolution/mail/composer/view/ReplyTo</key> - <applyto>/apps/evolution/mail/composer/view/ReplyTo</applyto> - <owner>evolution-mail</owner> - <type>bool</type> - <default>false</default> - <locale name="C"> - <short>View/ReplyTo menu item is checked</short> - <long> - View/ReplyTo menu item is checked. - </long> - </locale> - </schema> - - <schema> - <key>/schemas/apps/evolution/mail/composer/view/Cc</key> - <applyto>/apps/evolution/mail/composer/view/Cc</applyto> - <owner>evolution-mail</owner> - <type>bool</type> - <default>false</default> - <locale name="C"> - <short>View/Cc menu item is checked</short> - <long> - View/Cc menu item is checked. - </long> - </locale> - </schema> - - <schema> - <key>/schemas/apps/evolution/mail/composer/view/Bcc</key> - <applyto>/apps/evolution/mail/composer/view/Bcc</applyto> - <owner>evolution-mail</owner> - <type>bool</type> - <default>false</default> - <locale name="C"> - <short>View/Bcc menu item is checked</short> - <long> - View/Bcc menu item is checked. - </long> - </locale> - </schema> - - <!-- Display Settings --> - - <schema> - <key>/schemas/apps/evolution/mail/display/mark_citations</key> - <applyto>/apps/evolution/mail/display/mark_citations</applyto> - <owner>evolution-mail</owner> - <type>bool</type> - <default>true</default> - <locale name="C"> - <short>Mark citations in the message "Preview"</short> - <long> - Mark citations in the message "Preview". - </long> - </locale> - </schema> - - <schema> - <key>/schemas/apps/evolution/mail/display/citation_colour</key> - <applyto>/apps/evolution/mail/display/citation_colour</applyto> - <owner>evolution-mail</owner> - <type>string</type> - <default>#737373</default> - <locale name="C"> - <short>Citation highlight colour</short> - <long> - Citation highlight colour. - </long> - </locale> - </schema> - - <schema> - <key>/schemas/apps/evolution/mail/display/caret_mode</key> - <applyto>/apps/evolution/mail/display/caret_mode</applyto> - <owner>evolution-mail</owner> - <type>bool</type> - <default>false</default> - <locale name="C"> - <short>Enable/disable caret mode</short> - <long> - Enable caret mode, so that you can see a cursor when reading mail. - </long> - </locale> - </schema> - - <schema> - <key>/schemas/apps/evolution/mail/display/charset</key> - <applyto>/apps/evolution/mail/display/charset</applyto> - <owner>evolution-mail</owner> - <type>string</type> - <default></default> - <locale name="C"> - <short>Default charset in which to display messages</short> - <long> - Default charset in which to display messages. - </long> - </locale> - </schema> - - <schema> - <key>/schemas/apps/evolution/mail/display/load_http_images</key> - <applyto>/apps/evolution/mail/display/load_http_images</applyto> - <owner>evolution-mail</owner> - <type>int</type> - <default>0</default> - <locale name="C"> - <short>Load images for HTML messages over http</short> - <long> - Load images for HTML messages over http(s). Possible values are: - 0 - Never load images off the net - 1 - Load images if sender is in the addressbook - 2 - Always load images off the net - </long> - </locale> - </schema> - - <schema> - <key>/schemas/apps/evolution/mail/display/animate_images</key> - <applyto>/apps/evolution/mail/display/animate_images</applyto> - <owner>evolution-mail</owner> - <type>bool</type> - <default>true</default> - <locale name="C"> - <short>Show Animations</short> - <long> - Show animated images as animations. - </long> - </locale> - </schema> - - <schema> - <key>/schemas/apps/evolution/mail/display/mime_types</key> - <applyto>/apps/evolution/mail/display/mime_types</applyto> - <owner>evolution-mail</owner> - <type>list</type> - <list_type>string</list_type> - <default>[]</default> - <locale name="C"> - <short>List of mime types to check for bonobo component viewers</short> - <long> - If there isn't a builtin viewer for a particular mime-type inside Evolution, - any mime-types appearing in this list which map to a bonobo-component viewer - in GNOME's mime-type database may be used for displaying content. - </long> - </locale> - </schema> - - <schema> - <key>/schemas/apps/evolution/mail/display/xmailer_mask</key> - <applyto>/apps/evolution/mail/display/xmailer_mask</applyto> - <owner>evolution-mail</owner> - <type>int</type> - <default>0</default> - <locale name="C"> - <short>S3kr3t 0pt10n</short> - <long> - S3kr3t 0pt10n. - </long> - </locale> - </schema> - - <schema> - <key>/schemas/apps/evolution/mail/display/mark_seen</key> - <applyto>/apps/evolution/mail/display/mark_seen</applyto> - <owner>evolution-mail</owner> - <type>bool</type> - <default>true</default> - <locale name="C"> - <short>Mark as Seen after specified timeout</short> - <long> - Mark as Seen after specified timeout. - </long> - </locale> - </schema> - - <schema> - <key>/schemas/apps/evolution/mail/display/mark_seen_timeout</key> - <applyto>/apps/evolution/mail/display/mark_seen_timeout</applyto> - <owner>evolution-mail</owner> - <type>int</type> - <default>1500</default> - <locale name="C"> - <short>Timeout for marking message as Seen</short> - <long> - Timeout for marking message as Seen. - </long> - </locale> - </schema> - - <schema> - <key>/schemas/apps/evolution/mail/display/show_deleted</key> - <applyto>/apps/evolution/mail/display/show_deleted</applyto> - <owner>evolution-mail</owner> - <type>bool</type> - <default>false</default> - <locale name="C"> - <short>Show deleted messages in the message-list</short> - <long> - Show deleted messages (with a strike-through) in the message-list. - </long> - </locale> - </schema> - - <schema> - <key>/schemas/apps/evolution/mail/display/show_preview</key> - <applyto>/apps/evolution/mail/display/show_preview</applyto> - <owner>evolution-mail</owner> - <type>bool</type> - <default>true</default> - <locale name="C"> - <short>Show the "Preview" pane</short> - <long> - Show the "Preview" pane. - </long> - </locale> - </schema> - - <schema> - <key>/schemas/apps/evolution/mail/display/paned_size</key> - <applyto>/apps/evolution/mail/display/paned_size</applyto> - <owner>evolution-mail</owner> - <type>int</type> - <default>144</default> - <locale name="C"> - <short>Height of the message-list pane</short> - <long> - Height of the message-list pane. - </long> - </locale> - </schema> - - <schema> - <key>/schemas/apps/evolution/mail/display/fonts/variable</key> - <applyto>/apps/evolution/mail/display/fonts/variable</applyto> - <owner>evolution-mail</owner> - <type>string</type> - <default>Sans 12</default> - <locale name="C"> - <short>Variable width font</short> - <long> - The variable width font for mail display - </long> - </locale> - </schema> - - <schema> - <key>/schemas/apps/evolution/mail/display/fonts/monospace</key> - <applyto>/apps/evolution/mail/display/fonts/monospace</applyto> - <owner>evolution-mail</owner> - <type>string</type> - <default>Monospace 12</default> - <locale name="C"> - <short>Terminal font</short> - <long> - The terminal font for mail display - </long> - </locale> - </schema> - - <schema> - <key>/schemas/apps/evolution/mail/display/fonts/use_custom</key> - <applyto>/apps/evolution/mail/display/fonts/use_custom</applyto> - <owner>evolution-mail</owner> - <type>bool</type> - <default>false</default> - <locale name="C"> - <short>Use custom fonts</short> - <long> - Use custom fonts for displaying mail - </long> - </locale> - </schema> - - <schema> - <key>/schemas/apps/evolution/mail/display/thread_list</key> - <applyto>/apps/evolution/mail/display/thread_list</applyto> - <owner>evolution-mail</owner> - <type>bool</type> - <default>false</default> - <locale name="C"> - <short>Thread the message-list</short> - <long> - Thread the message list. - </long> - </locale> - </schema> - - <schema> - <key>/schemas/apps/evolution/mail/display/thread_subject</key> - <applyto>/apps/evolution/mail/display/thread_subject</applyto> - <owner>evolution-mail</owner> - <type>bool</type> - <default>false</default> - <locale name="C"> - <short>Thread the message-list based on Subject</short> - <long> - Whether or not to fall back on threading by subjects when the - messages do not contain In-Reply-To or References headers. - </long> - </locale> - </schema> - - <!-- Filter logging --> - - <schema> - <key>/schemas/apps/evolution/mail/filters/log</key> - <applyto>/apps/evolution/mail/filters/log</applyto> - <owner>evolution-mail</owner> - <type>bool</type> - <default>false</default> - <locale name="C"> - <short>Log filter actions</short> - <long> - Log filter actions to the specified log file. - </long> - </locale> - </schema> - - <schema> - <key>/schemas/apps/evolution/mail/filters/logfile</key> - <applyto>/apps/evolution/mail/filters/logfile</applyto> - <owner>evolution-mail</owner> - <type>string</type> - <default></default> - <locale name="C"> - <short>Logfile to log filter actions</short> - <long> - Logfile to log filter actions. - </long> - </locale> - </schema> - - <!-- Format settings --> - - <schema> - <key>/schemas/apps/evolution/mail/format/forward_style</key> - <applyto>/apps/evolution/mail/format/forward_style</applyto> - <owner>evolution-mail</owner> - <type>int</type> - <default>0</default> - <locale name="C"> - <short>Default forward style</short> - <long> - - </long> - </locale> - </schema> - - <schema> - <key>/schemas/apps/evolution/mail/format/reply_style</key> - <applyto>/apps/evolution/mail/format/reply_style</applyto> - <owner>evolution-mail</owner> - <type>int</type> - <default>0</default> - <locale name="C"> - <short>Default reply style</short> - <long> - - </long> - </locale> - </schema> - - <schema> - <key>/schemas/apps/evolution/mail/format/message_display_style</key> - <applyto>/apps/evolution/mail/format/message_display_style</applyto> - <owner>evolution-mail</owner> - <type>int</type> - <default>0</default> - <locale name="C"> - <short>Message-display style (normal, full headers, source)</short> - <long> - - </long> - </locale> - </schema> - - <!-- New Mail Notification settings --> - - <schema> - <key>/schemas/apps/evolution/mail/notify/type</key> - <applyto>/apps/evolution/mail/notify/type</applyto> - <owner>evolution-mail</owner> - <type>int</type> - <default>0</default> - <locale name="C"> - <short>New Mail Notify type</short> - <long> - Specifies the type of New Mail Notification the user wishes to use. - </long> - </locale> - </schema> - - <schema> - <key>/schemas/apps/evolution/mail/notify/sound</key> - <applyto>/apps/evolution/mail/notify/sound</applyto> - <owner>evolution-mail</owner> - <type>string</type> - <default></default> - <locale name="C"> - <short>New Mail Notify sound file</short> - <long> - Sound file to play when new mail arrives. - </long> - </locale> - </schema> - - <!-- Prompt settings --> - - <schema> - <key>/schemas/apps/evolution/mail/prompts/empty_subject</key> - <applyto>/apps/evolution/mail/prompts/empty_subject</applyto> - <owner>evolution-mail</owner> - <type>bool</type> - <default>true</default> - <locale name="C"> - <short>Prompt on empty subject</short> - <long> - Prompt the user when he or she tries to send a message - without a Subject. - </long> - </locale> - </schema> - - <schema> - <key>/schemas/apps/evolution/mail/prompts/expunge</key> - <applyto>/apps/evolution/mail/prompts/expunge</applyto> - <owner>evolution-mail</owner> - <type>bool</type> - <default>true</default> - <locale name="C"> - <short>Prompt when user expunges</short> - <long> - Prompt the user when he or she tries to expunge a folder. - </long> - </locale> - </schema> - - <schema> - <key>/schemas/apps/evolution/mail/prompts/only_bcc</key> - <applyto>/apps/evolution/mail/prompts/only_bcc</applyto> - <owner>evolution-mail</owner> - <type>bool</type> - <default>true</default> - <locale name="C"> - <short>Prompt when user only fills Bcc</short> - <long> - Prompt when user tries to send a message with no To or Cc recipients. - </long> - </locale> - </schema> - - <schema> - <key>/schemas/apps/evolution/mail/prompts/unwanted_html</key> - <applyto>/apps/evolution/mail/prompts/unwanted_html</applyto> - <owner>evolution-mail</owner> - <type>bool</type> - <default>true</default> - <locale name="C"> - <short>Prompt when user tries to send unwanted HTML</short> - <long> - Prompt when user tries to send HTML mail to recipients that - may not want to receive HTML mail. - </long> - </locale> - </schema> - - <!-- Trash settings --> - - <schema> - <key>/schemas/apps/evolution/mail/trash/empty_on_exit</key> - <applyto>/apps/evolution/mail/trash/empty_on_exit</applyto> - <owner>evolution-mail</owner> - <type>bool</type> - <default>false</default> - <locale name="C"> - <short>Empty Trash folders on exit</short> - <long> - Empty all Trash folders when exiting Evolution. - </long> - </locale> - </schema> - - <!-- Labels and Colours --> - - <schema> - <key>/schemas/apps/evolution/mail/labels</key> - <applyto>/apps/evolution/mail/labels</applyto> - <owner>evolution-mail</owner> - <type>list</type> - <list_type>string</list_type> - <default>[Important:#ff0000,Work:#ff8c00,Personal:#008b00,To Do:#0000ff,Later:#8b008b]</default> - <locale name="C"> - <short>List of Labels and their associated colours</short> - <long> - List of labels known to the mail component of - Evolution. The list contains strings containing name:colour - where colour uses the HTML hex encoding. - </long> - </locale> - </schema> - - <!-- Junk --> - - <schema> - <key>/schemas/apps/evolution/mail/junk/check_incoming</key> - <applyto>/apps/evolution/mail/junk/check_incoming</applyto> - <owner>evolution-mail</owner> - <type>bool</type> - <default>true</default> - <locale name="C"> - <short>Check incoming mail being junk</short> - <long> - Run junk test on incoming mail - </long> - </locale> - </schema> - - <!-- Account settings --> - - <schema> - <key>/schemas/apps/evolution/mail/default_account</key> - <applyto>/apps/evolution/mail/default_account</applyto> - <owner>evolution-mail</owner> - <type>string</type> - <locale name="C"> - <short>UID string of the default account.</short> - <long> - UID string of the default account. - </long> - </locale> - </schema> - - <schema> - <key>/schemas/apps/evolution/mail/accounts</key> - <applyto>/apps/evolution/mail/accounts</applyto> - <owner>evolution-mail</owner> - <type>list</type> - <list_type>string</list_type> - <locale name="C"> - <short>List of accounts</short> - <long> - List of accounts known to the mail component of - Evolution. The list contains strings naming - subdirectories relative to /apps/evolution/mail/accounts. - </long> - </locale> - </schema> - - </schemalist> -</gconfschemafile> diff --git a/mail/evolution-mbox-upgrade.c b/mail/evolution-mbox-upgrade.c deleted file mode 100644 index 8d8c76cdc8..0000000000 --- a/mail/evolution-mbox-upgrade.c +++ /dev/null @@ -1,420 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Authors: Jeffrey Stedfast <fejj@ximian.com> - * - * Copyright 2003 Ximian, Inc. (www.ximian.com) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA. - * - */ - - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <stdio.h> -#include <string.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <unistd.h> -#include <dirent.h> -#include <errno.h> - -#include <camel/camel.h> -#include <camel/camel-session.h> -#include <camel/camel-file-utils.h> - -#include <libxml/tree.h> -#include <libxml/parser.h> -#include <libxml/xmlmemory.h> - -#define EM_MIGRATE_SESSION_TYPE (em_migrate_session_get_type ()) -#define EM_MIGRATE_SESSION(obj) (CAMEL_CHECK_CAST((obj), EM_MIGRATE_SESSION_TYPE, EMMigrateSession)) -#define EM_MIGRATE_SESSION_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), EM_MIGRATE_SESSION_TYPE, EMMigrateSessionClass)) -#define EM_MIGRATE_IS_SESSION(o) (CAMEL_CHECK_TYPE((o), EM_MIGRATE_SESSION_TYPE)) - -typedef struct _EMMigrateSession { - CamelSession parent_object; - - CamelStore *store; /* new folder tree store */ - char *srcdir; /* old folder tree path */ -} EMMigrateSession; - -typedef struct _EMMigrateSessionClass { - CamelSessionClass parent_class; - -} EMMigrateSessionClass; - -CamelType em_migrate_session_get_type (void); -CamelSession *em_migrate_session_new (const char *path); - -static void -class_init (EMMigrateSessionClass *klass) -{ - ; -} - -CamelType -em_migrate_session_get_type (void) -{ - static CamelType type = CAMEL_INVALID_TYPE; - - if (type == CAMEL_INVALID_TYPE) { - type = camel_type_register ( - camel_session_get_type (), - "EMMigrateSession", - sizeof (EMMigrateSession), - sizeof (EMMigrateSessionClass), - (CamelObjectClassInitFunc) class_init, - NULL, - NULL, - NULL); - } - - return type; -} - -CamelSession * -em_migrate_session_new (const char *path) -{ - CamelSession *session; - - session = CAMEL_SESSION (camel_object_new (EM_MIGRATE_SESSION_TYPE)); - - camel_session_construct (session, path); - - return session; -} - -static gboolean -is_mail_folder (const char *metadata) -{ - xmlNodePtr node; - xmlDocPtr doc; - char *type; - - if (!(doc = xmlParseFile (metadata))) { - g_warning ("Cannot parse `%s'", metadata); - return FALSE; - } - - if (!(node = xmlDocGetRootElement (doc))) { - g_warning ("`%s' corrupt: document contains no root node", metadata); - xmlFreeDoc (doc); - return FALSE; - } - - if (!node->name || strcmp (node->name, "efolder") != 0) { - g_warning ("`%s' corrupt: root node is not 'efolder'", metadata); - xmlFreeDoc (doc); - return FALSE; - } - - node = node->children; - while (node != NULL) { - if (node->name && !strcmp (node->name, "type")) { - type = xmlNodeGetContent (node); - if (!strcmp (type, "mail")) { - xmlFreeDoc (doc); - xmlFree (type); - - return TRUE; - } - - xmlFree (type); - - break; - } - - node = node->next; - } - - xmlFreeDoc (doc); - - return FALSE; -} - -static CamelStore * -get_local_store (CamelSession *session, const char *dirname, const char *metadata, char **namep, int *index, CamelException *ex) -{ - char *protocol, *name, *buf; - CamelStore *store; - struct stat st; - xmlNodePtr node; - xmlDocPtr doc; - - if (stat (metadata, &st) == -1 || !S_ISREG (st.st_mode)) { - camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, "`%s' is not a regular file", metadata); - return NULL; - } - - if (!(doc = xmlParseFile (metadata))) { - camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, "cannot parse `%s'", metadata); - return NULL; - } - - if (!(node = xmlDocGetRootElement (doc)) || strcmp (node->name, "folderinfo") != 0) { - camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, "`%s' is malformed", metadata); - xmlFreeDoc (doc); - return NULL; - } - - node = node->children; - while (node != NULL) { - if (node->name && !strcmp (node->name, "folder")) { - protocol = xmlGetProp (node, "type"); - name = xmlGetProp (node, "name"); - buf = xmlGetProp (node, "index"); - if (buf != NULL) { - *index = atoi (buf); - xmlFree (buf); - } else { - *index = 0; - } - - xmlFreeDoc (doc); - - buf = g_strdup_printf ("%s:%s", protocol, dirname); - xmlFree (protocol); - - if ((store = camel_session_get_store (session, buf, ex))) - *namep = g_strdup (name); - else - *namep = NULL; - - xmlFree (name); - - return store; - } - - node = node->next; - } - - xmlFreeDoc (doc); - - camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, "`%s' does not contain needed info", metadata); - - return NULL; -} - -static void -em_migrate_dir (EMMigrateSession *session, const char *dirname, const char *full_name) -{ - guint32 flags = CAMEL_STORE_FOLDER_CREATE; - CamelFolder *old_folder, *new_folder; - CamelStore *local_store; - struct dirent *dent; - CamelException ex; - char *path, *name; - GPtrArray *uids; - struct stat st; - int index; - DIR *dir; - - path = g_strdup_printf ("%s/folder-metadata.xml", dirname); - if (stat (path, &st) == -1 || !S_ISREG (st.st_mode)) { - g_free (path); - return; - } - - if (!is_mail_folder (path)) { - g_free (path); - - goto try_subdirs; - } - - g_free (path); - - camel_exception_init (&ex); - - /* get old store & folder */ - path = g_strdup_printf ("%s/local-metadata.xml", dirname); - if (!(local_store = get_local_store ((CamelSession *) session, dirname, path, &name, &index, &ex))) { - g_warning ("error opening old store for `%s': %s", full_name, ex.desc); - camel_exception_clear (&ex); - g_free (path); - - /* try subfolders anyway? */ - goto try_subdirs; - } - - g_free (path); - - if (!(old_folder = camel_store_get_folder (local_store, name, 0, &ex))) { - g_warning ("error opening old folder `%s': %s", full_name, ex.desc); - camel_object_unref (local_store); - camel_exception_clear (&ex); - g_free (name); - - /* try subfolders anyway? */ - goto try_subdirs; - } - - g_free (name); - - flags |= (index ? CAMEL_STORE_FOLDER_BODY_INDEX : 0); - if (!(new_folder = camel_store_get_folder (session->store, full_name, flags, &ex))) { - g_warning ("error creating new mbox folder `%s': %s", full_name, ex.desc); - camel_object_unref (local_store); - camel_object_unref (old_folder); - camel_exception_clear (&ex); - - /* try subfolders anyway? */ - goto try_subdirs; - } - - uids = camel_folder_get_uids (old_folder); - camel_folder_transfer_messages_to (old_folder, uids, new_folder, NULL, FALSE, &ex); - camel_folder_free_uids (old_folder, uids); - - if (camel_exception_is_set (&ex)) { - g_warning ("error migrating folder `%s': %s", full_name, ex.desc); - camel_object_unref (local_store); - camel_object_unref (old_folder); - camel_object_unref (new_folder); - camel_exception_clear (&ex); - - /* try subfolders anyway? */ - goto try_subdirs; - } - - /*camel_object_unref (local_store);*/ - camel_object_unref (old_folder); - camel_object_unref (new_folder); - - try_subdirs: - - path = g_strdup_printf ("%s/subfolders", dirname); - if (stat (path, &st) == -1 || !S_ISDIR (st.st_mode)) { - g_free (path); - return; - } - - if (!(dir = opendir (path))) { - g_warning ("cannot open `%s': %s", path, strerror (errno)); - g_free (path); - return; - } - - while ((dent = readdir (dir))) { - char *full_path; - - if (dent->d_name[0] == '.') - continue; - - full_path = g_strdup_printf ("%s/%s", path, dent->d_name); - if (stat (full_path, &st) == -1 || !S_ISDIR (st.st_mode)) { - g_free (full_path); - continue; - } - - name = g_strdup_printf ("%s/%s", full_name, dent->d_name); - em_migrate_dir (session, full_path, name); - g_free (full_path); - g_free (name); - } - - closedir (dir); - - g_free (path); -} - -static void -em_migrate (EMMigrateSession *session) -{ - struct dirent *dent; - struct stat st; - DIR *dir; - - if (!(dir = opendir (session->srcdir))) { - g_warning ("cannot open `%s': %s", session->srcdir, strerror (errno)); - return; - } - - while ((dent = readdir (dir))) { - char *full_path; - - if (dent->d_name[0] == '.') - continue; - - full_path = g_strdup_printf ("%s/%s", session->srcdir, dent->d_name); - if (stat (full_path, &st) == -1 || !S_ISDIR (st.st_mode)) { - g_free (full_path); - continue; - } - - em_migrate_dir (session, full_path, dent->d_name); - g_free (full_path); - } - - closedir (dir); -} - -int main (int argc, char **argv) -{ - EMMigrateSession *session; - CamelException ex; - struct stat st; - char *path; - - g_thread_init (NULL); - - path = g_strdup_printf ("%s/.evolution/mail", g_get_home_dir ()); - if (stat (path, &st) == -1) { - if (errno != ENOENT || camel_mkdir (path, 0777) == -1) { - g_warning ("Failed to create directory `%s': %s", path, strerror (errno)); - g_free (path); - return -1; - } - } - - camel_init (path, TRUE); - session = (EMMigrateSession *) em_migrate_session_new (path); - g_free (path); - - session->srcdir = g_strdup_printf ("%s/evolution/local", g_get_home_dir ()); - - path = g_strdup_printf ("mbox:%s/.evolution/mail/local", g_get_home_dir ()); - if (stat (path + 5, &st) == -1) { - if (errno != ENOENT || camel_mkdir (path + 5, 0777) == -1) { - g_warning ("Failed to create directory `%s': %s", path + 5, strerror (errno)); - g_free (session->srcdir); - camel_object_unref (session); - g_free (path); - return -1; - } - } - - camel_exception_init (&ex); - if (!(session->store = camel_session_get_store ((CamelSession *) session, path, &ex))) { - g_warning ("Failed to open store for `%s': %s", path, ex.desc); - g_free (session->srcdir); - camel_object_unref (session); - camel_exception_clear (&ex); - g_free (path); - return -1; - } - g_free (path); - - em_migrate (session); - - camel_object_unref (session->store); - g_free (session->srcdir); - - camel_object_unref (session); - - return 0; -} diff --git a/mail/importers/.cvsignore b/mail/importers/.cvsignore deleted file mode 100644 index ebc3104d83..0000000000 --- a/mail/importers/.cvsignore +++ /dev/null @@ -1,15 +0,0 @@ -.deps -.libs -.pure -Makefile -Makefile.in -*.bb -*.bbg -*.da -*.gcov -*.server -*.server.in -*.lo -*.la -Mailer.h -Mailer-*.c
\ No newline at end of file diff --git a/mail/importers/GNOME_Evolution_Mail_Elm_Intelligent_Importer.server.in.in b/mail/importers/GNOME_Evolution_Mail_Elm_Intelligent_Importer.server.in.in deleted file mode 100644 index c9f1c985d1..0000000000 --- a/mail/importers/GNOME_Evolution_Mail_Elm_Intelligent_Importer.server.in.in +++ /dev/null @@ -1,26 +0,0 @@ -<oaf_info> - -<oaf_server iid="OAFIID:GNOME_Evolution_Mail_Elm_Intelligent_Importer_Factory:@VERSION@" - type="exe" - location="@BINDIR@/evolution-@VERSION@"> - - <oaf_attribute name="repo_ids" type="stringv"> - <item value="IDL:GNOME/ObjectFactory:1.0"/> - </oaf_attribute> - - <oaf_attribute name="name" type="string" - _value="Evolution Elm importer"/> -</oaf_server> - -<oaf_server iid="OAFIID:GNOME_Evolution_Mail_Elm_Intelligent_Importer:@VERSION@" - type="factory" - location="OAFIID:GNOME_Evolution_Mail_Elm_Intelligent_Importer_Factory:@VERSION@"> - - <oaf_attribute name="repo_ids" type="stringv"> - <item value="IDL:GNOME/Evolution/IntelligentImporter:@VERSION@"/> - </oaf_attribute> - - <oaf_attribute name="name" type="string" - _value="Evolution Elm importer"/> -</oaf_server> -</oaf_info> diff --git a/mail/importers/GNOME_Evolution_Mail_Mbox_Importer.server.in.in b/mail/importers/GNOME_Evolution_Mail_Mbox_Importer.server.in.in deleted file mode 100644 index 72e634bd6a..0000000000 --- a/mail/importers/GNOME_Evolution_Mail_Mbox_Importer.server.in.in +++ /dev/null @@ -1,29 +0,0 @@ -<oaf_info> - -<oaf_server iid="OAFIID:GNOME_Evolution_Mail_Mbox_ImporterFactory:@VERSION@" - type="exe" - location="@BINDIR@/evolution-@VERSION@"> - - <oaf_attribute name="repo_ids" type="stringv"> - <item value="IDL:GNOME/ObjectFactory:1.0"/> - </oaf_attribute> - - <oaf_attribute name="name" type="string" - _value="Evolution mbox importer"/> -</oaf_server> - -<oaf_server iid="OAFIID:GNOME_Evolution_Mail_Mbox_Importer:@VERSION@" - type="factory" - location="OAFIID:GNOME_Evolution_Mail_Mbox_ImporterFactory:@VERSION@"> - - <oaf_attribute name="repo_ids" type="stringv"> - <item value="IDL:GNOME/Evolution/Importer:@VERSION@"/> - </oaf_attribute> - - <oaf_attribute name="evolution:menu_name" type="string" - _value="MBox (mbox)"/> - <oaf_attribute name="name" type="string" - _value="Evolution mbox importer"/> -</oaf_server> - -</oaf_info> diff --git a/mail/importers/GNOME_Evolution_Mail_Netscape_Intelligent_Importer.server.in.in b/mail/importers/GNOME_Evolution_Mail_Netscape_Intelligent_Importer.server.in.in deleted file mode 100644 index 83302a5402..0000000000 --- a/mail/importers/GNOME_Evolution_Mail_Netscape_Intelligent_Importer.server.in.in +++ /dev/null @@ -1,26 +0,0 @@ -<oaf_info> - -<oaf_server iid="OAFIID:GNOME_Evolution_Mail_Netscape_Intelligent_Importer_Factory:@VERSION@" - type="exe" - location="@BINDIR@/evolution-@VERSION@"> - - <oaf_attribute name="repo_ids" type="stringv"> - <item value="IDL:GNOME/ObjectFactory:1.0"/> - </oaf_attribute> - - <oaf_attribute name="name" type="string" - _value="Evolution Netscape Mail importer"/> -</oaf_server> - -<oaf_server iid="OAFIID:GNOME_Evolution_Mail_Netscape_Intelligent_Importer:@VERSION@" - type="factory" - location="OAFIID:GNOME_Evolution_Mail_Netscape_Intelligent_Importer_Factory:@VERSION@"> - - <oaf_attribute name="repo_ids" type="stringv"> - <item value="IDL:GNOME/Evolution/IntelligentImporter:@VERSION@"/> - </oaf_attribute> - - <oaf_attribute name="name" type="string" - _value="Evolution Netscape Mail importer"/> -</oaf_server> -</oaf_info> diff --git a/mail/importers/GNOME_Evolution_Mail_Outlook_Importer.server.in.in b/mail/importers/GNOME_Evolution_Mail_Outlook_Importer.server.in.in deleted file mode 100644 index 49963ca2a6..0000000000 --- a/mail/importers/GNOME_Evolution_Mail_Outlook_Importer.server.in.in +++ /dev/null @@ -1,29 +0,0 @@ -<oaf_info> - -<oaf_server iid="OAFIID:GNOME_Evolution_Mail_Outlook_ImporterFactory:@VERSION@" - type="exe" - location="@BINDIR@/evolution-@VERSION@"> - - <oaf_attribute name="repo_ids" type="stringv"> - <item value="IDL:GNOME/ObjectFactory:1.0"/> - </oaf_attribute> - - <oaf_attribute name="name" type="string" - _value="Evolution Outlook Express 4 importer"/> -</oaf_server> - -<oaf_server iid="OAFIID:GNOME_Evolution_Mail_Outlook_Importer:@VERSION@" - type="factory" - location="OAFIID:GNOME_Evolution_Mail_Outlook_ImporterFactory:@VERSION@"> - - <oaf_attribute name="repo_ids" type="stringv"> - <item value="IDL:GNOME/Evolution/Importer:@VERSION@"/> - </oaf_attribute> - - <oaf_attribute name="evolution:menu_name" type="string" - _value="Outlook Express 4 (.mbx)"/> - <oaf_attribute name="name" type="string" - _value="Evolution Outlook Express 4 importer"/> -</oaf_server> - -</oaf_info> diff --git a/mail/importers/GNOME_Evolution_Mail_Pine_Intelligent_Importer.server.in.in b/mail/importers/GNOME_Evolution_Mail_Pine_Intelligent_Importer.server.in.in deleted file mode 100644 index b81789c291..0000000000 --- a/mail/importers/GNOME_Evolution_Mail_Pine_Intelligent_Importer.server.in.in +++ /dev/null @@ -1,26 +0,0 @@ -<oaf_info> - -<oaf_server iid="OAFIID:GNOME_Evolution_Mail_Pine_Intelligent_Importer_Factory:@VERSION@" - type="exe" - location="@BINDIR@/evolution-@VERSION@"> - - <oaf_attribute name="repo_ids" type="stringv"> - <item value="IDL:GNOME/ObjectFactory:1.0"/> - </oaf_attribute> - - <oaf_attribute name="name" type="string" - _value="Evolution Pine importer"/> -</oaf_server> - -<oaf_server iid="OAFIID:GNOME_Evolution_Mail_Pine_Intelligent_Importer:@VERSION@" - type="factory" - location="OAFIID:GNOME_Evolution_Mail_Pine_Intelligent_Importer_Factory:@VERSION@"> - - <oaf_attribute name="repo_ids" type="stringv"> - <item value="IDL:GNOME/Evolution/IntelligentImporter:@VERSION@"/> - </oaf_attribute> - - <oaf_attribute name="name" type="string" - _value="Evolution Pine importer"/> -</oaf_server> -</oaf_info> diff --git a/mail/importers/Makefile.am b/mail/importers/Makefile.am deleted file mode 100644 index 2e2f8881f2..0000000000 --- a/mail/importers/Makefile.am +++ /dev/null @@ -1,102 +0,0 @@ -importersdir = $(privlibdir)/evolution-mail-importers - -importers_LTLIBRARIES = liboutlook.la libmbox.la \ - libevolution-elm-importer.la \ - libevolution-pine-importer.la \ - libevolution-netscape-importer.la - -INCLUDES = -I.. \ - -I$(srcdir)/.. \ - -I$(top_srcdir) \ - -I$(top_srcdir)/shell \ - -I$(top_builddir)/shell \ - -DG_LOG_DOMAIN=\"evolution-mail-importer\" \ - -I$(top_srcdir)/addressbook/backend \ - -I$(top_builddir)/addressbook/backend \ - -DEVOLUTION_PRIVDATADIR=\""$(privdatadir)"\" \ - $(IMPORTERS_CFLAGS) - -liboutlook_la_SOURCES = \ - evolution-outlook-importer.c -liboutlook_la_LDFLAGS = -avoid-version -module - -libmbox_la_SOURCES = evolution-mbox-importer.c \ - mozilla-status-headers.h -libmbox_la_LDFLAGS = -avoid-version -module - -IDLS = \ - $(top_srcdir)/mail/Mailer.idl - -MAIL_GENERATED_H = \ - Mailer.h -MAIL_GENERATED_C = \ - Mailer-common.c \ - Mailer-skels.c \ - Mailer-stubs.c -MAIL_GENERATED = $(MAIL_GENERATED_C) $(MAIL_GENERATED_H) - -$(MAIL_GENERATED_H): $(IDLS) - $(ORBIT_IDL) -I $(srcdir) $(IDL_INCLUDES) $(top_srcdir)/mail/Mailer.idl -$(MAIL_GENERATED_C): $(MAIL_GENERATED_H) - -libevolution_netscape_importer_la_SOURCES = \ - $(MAIL_GENERATED) \ - netscape-importer.c - -libevolution_netscape_importer_la_LDFLAGS = -avoid-version -module - -libevolution_netscape_importer_la_LIBADD = \ - $(top_builddir)/shell/importer/libevolution-importer.la \ - $(top_builddir)/camel/libcamel.la \ - $(top_builddir)/e-util/libeutil.la \ - $(top_builddir)/filter/libfilter.la \ - $(top_builddir)/shell/libeshell.la \ - $(IMPORTERS_LIBS) - -libevolution_elm_importer_la_SOURCES = \ - elm-importer.c - -libevolution_elm_importer_la_LDFLAGS = -avoid-version -module - -libevolution_elm_importer_la_LIBADD = \ - $(top_builddir)/shell/importer/libevolution-importer.la \ - $(top_builddir)/e-util/libeutil.la \ - $(IMPORTERS_LIBS) - -libevolution_pine_importer_la_SOURCES = \ - pine-importer.c - -libevolution_pine_importer_la_LDFLAGS = -avoid-version -module - -libevolution_pine_importer_la_LIBADD = \ - $(top_builddir)/shell/importer/libevolution-importer.la \ - $(top_builddir)/addressbook/backend/ebook/libebook.la \ - $(top_builddir)/camel/libcamel.la \ - $(IMPORTERS_LIBS) - -# evolution_gnomecard_importer_SOURCES = \ -# evolution-gnomecard-importer.c - -# evolution_gnomecard_importer_LDADD = \ -# $(top_builddir)/shell/importer/libevolution-importer.la \ -# $(top_builddir)/addressbook/backend/ebook/libebook.la \ -# $(top_builddir)/camel/libcamel.la \ -# $(IMPORTERS_LIBS) - - -server_in_files = GNOME_Evolution_Mail_Mbox_Importer.server.in.in \ - GNOME_Evolution_Mail_Outlook_Importer.server.in.in \ - GNOME_Evolution_Mail_Netscape_Intelligent_Importer.server.in.in \ - GNOME_Evolution_Mail_Elm_Intelligent_Importer.server.in.in \ - GNOME_Evolution_Mail_Pine_Intelligent_Importer.server.in.in -server_DATA = $(server_in_files:.server.in.in=_$(BASE_VERSION).server) -@EVO_SERVER_RULE@ -@INTLTOOL_SERVER_RULE@ - -BUILT_SOURCES = $(MAIL_GENERATED) $(server_DATA) -CLEANFILES = $(BUILT_SOURCES) - -EXTRA_DIST = $(server_in_files) - -dist-hook: - cd $(distdir); rm -f $(BUILT_SOURCES) diff --git a/mail/importers/elm-importer.c b/mail/importers/elm-importer.c deleted file mode 100644 index 1386e3a26f..0000000000 --- a/mail/importers/elm-importer.c +++ /dev/null @@ -1,593 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* elm-importer.c - * - * Authors: - * Iain Holmes <iain@ximian.com> - * - * Copyright 2001 Ximian, Inc. (www.ximian.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public - * License as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA - */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <stdio.h> -#include <errno.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <unistd.h> -#include <dirent.h> - -#include <glib.h> -#include <gnome.h> - -#include <gconf/gconf.h> -#include <gconf/gconf-client.h> - -#include <bonobo/bonobo-object.h> -#include <bonobo/bonobo-control.h> -#include <bonobo/bonobo-context.h> -#include <bonobo/bonobo-generic-factory.h> -#include <bonobo/bonobo-main.h> -#include <bonobo/bonobo-exception.h> -#include <bonobo/bonobo-moniker-util.h> - -#include <bonobo-activation/bonobo-activation.h> - -#include <importer/evolution-intelligent-importer.h> -#include <importer/evolution-importer-client.h> -#include <importer/GNOME_Evolution_Importer.h> - -#include "mail/mail-importer.h" - -#define ELM_INTELLIGENT_IMPORTER_IID "OAFIID:GNOME_Evolution_Mail_Elm_Intelligent_Importer_Factory:" BASE_VERSION -#define MBOX_IMPORTER_IID "OAFIID:GNOME_Evolution_Mail_Mbox_Importer:" BASE_VERSION -#define KEY "elm-mail-imported" - -/*#define SUPER_IMPORTER_DEBUG*/ -#ifdef SUPER_IMPORTER_DEBUG -#define d(x) x -#else -#define d(x) -#endif - -typedef struct { - EvolutionIntelligentImporter *ii; - - GList *dir_list; - - int progress_count; - int more; - EvolutionImporterResult result; - - GNOME_Evolution_Importer importer; - EvolutionImporterListener *listener; - - GtkWidget *mail; - gboolean do_mail; - - GtkWidget *dialog; - GtkWidget *label; - GtkWidget *progressbar; -} ElmImporter; - -typedef struct { - char *parent; - char *foldername; - char *path; -} ElmFolder; - -static GHashTable *elm_prefs = NULL; - -void mail_importer_module_init (void); - -static void import_next (ElmImporter *importer); - -static GtkWidget * -create_importer_gui (ElmImporter *importer) -{ - GtkWidget *dialog; - - dialog = gnome_message_box_new (_("Evolution is importing your old Elm mail"), GNOME_MESSAGE_BOX_INFO, NULL); - gtk_window_set_title (GTK_WINDOW (dialog), _("Importing...")); - - importer->label = gtk_label_new (_("Please wait")); - importer->progressbar = gtk_progress_bar_new (); - gtk_progress_set_activity_mode (GTK_PROGRESS (importer->progressbar), TRUE); - gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (dialog)->vbox), importer->label, FALSE, FALSE, 0); - gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (dialog)->vbox), importer->progressbar, FALSE, FALSE, 0); - - return dialog; -} - -static void -elm_store_settings (ElmImporter *importer) -{ - GConfClient *gconf; - - gconf = gconf_client_get_default (); - gconf_client_set_bool (gconf, "/apps/evolution/importer/elm/mail", importer->do_mail, NULL); -} - -static void -elm_restore_settings (ElmImporter *importer) -{ - GConfClient *gconf = gconf_client_get_default (); - - importer->do_mail = gconf_client_get_bool (gconf, "/apps/evolution/importer/elm/mail", NULL); -} - -static void -importer_cb (EvolutionImporterListener *listener, - EvolutionImporterResult result, - gboolean more_items, - void *data) -{ - ElmImporter *importer = (ElmImporter *) data; - - importer->result = result; - importer->more = more_items; -} - -static gboolean -elm_import_file (ElmImporter *importer, - const char *path, - const char *folderpath) -{ - CORBA_boolean result; - CORBA_Environment ev; - CORBA_Object objref; - char *str, *uri; - struct stat st; - - str = g_strdup_printf (_("Importing %s as %s"), path, folderpath); - gtk_label_set_text (GTK_LABEL (importer->label), str); - g_free (str); - while (g_main_context_iteration(NULL, FALSE)) - ; - - uri = mail_importer_make_local_folder(folderpath); - if (!uri) - return FALSE; - - /* if its a dir, we just create it, but dont add anything */ - if (lstat(path, &st) == 0 && S_ISDIR(st.st_mode)) { - g_free(uri); - /* this is ok, we return false to say we haven't launched an async task */ - return FALSE; - } - - CORBA_exception_init(&ev); - - result = GNOME_Evolution_Importer_loadFile (importer->importer, path, uri, "", &ev); - g_free(uri); - if (ev._major != CORBA_NO_EXCEPTION || result == FALSE) { - g_warning ("Exception here: %s", CORBA_exception_id (&ev)); - CORBA_exception_free (&ev); - return FALSE; - } - - /* process all items in a direct loop */ - importer->listener = evolution_importer_listener_new (importer_cb, importer); - objref = bonobo_object_corba_objref (BONOBO_OBJECT (importer->listener)); - do { - importer->progress_count++; - if ((importer->progress_count & 0xf) == 0) - gtk_progress_bar_pulse(GTK_PROGRESS_BAR(importer->progressbar)); - - importer->result = -1; - GNOME_Evolution_Importer_processItem (importer->importer, objref, &ev); - if (ev._major != CORBA_NO_EXCEPTION) { - g_warning ("Exception: %s", CORBA_exception_id (&ev)); - break; - } - - while (importer->result == -1 || g_main_context_pending(NULL)) - g_main_context_iteration(NULL, TRUE); - } while (importer->more); - - bonobo_object_unref((BonoboObject *)importer->listener); - - CORBA_exception_free (&ev); - - return FALSE; -} - -static void -parse_elm_rc (const char *elmrc) -{ - static gboolean parsed = FALSE; - char line[4096]; - FILE *handle; - gboolean exists; - - if (parsed == TRUE) - return; - - elm_prefs = g_hash_table_new (g_str_hash, g_str_equal); - - exists = g_file_exists (elmrc); - if (exists == FALSE) { - parsed = TRUE; - return; - } - - handle = fopen (elmrc, "r"); - if (handle == NULL) { - parsed = TRUE; - return; - } - - while (fgets (line, 4096, handle) != NULL) { - char *linestart, *end; - char *key, *value; - if (*line == '#' && - (line[1] != '#' && line[2] != '#')) { - continue; - } else if (*line == '\n') { - continue; - } else if (*line == '#' && line[1] == '#' && line[2] == '#') { - linestart = line + 4; - } else { - linestart = line; - } - - end = strstr (linestart, " = "); - if (end == NULL) { - g_warning ("Broken line"); - continue; - } - - *end = 0; - key = g_strdup (linestart); - - linestart = end + 3; - end = strchr (linestart, '\n'); - if (end == NULL) { - g_warning ("Broken line"); - g_free (key); - continue; - } - - *end = 0; - value = g_strdup (linestart); - - g_hash_table_insert (elm_prefs, key, value); - } - - parsed = TRUE; - fclose (handle); -} - -static char * -elm_get_rc_value (const char *value) -{ - if (elm_prefs == NULL) - return NULL; - - return g_hash_table_lookup (elm_prefs, value); -} - -static gboolean -elm_can_import (EvolutionIntelligentImporter *ii, - void *closure) -{ - ElmImporter *importer = closure; - char *elmdir, *maildir, *aliasfile; - char *elmrc; - gboolean exists, mailexists, aliasexists; - gboolean mail; - struct stat st; - GConfClient *gconf = gconf_client_get_default(); - - mail = gconf_client_get_bool(gconf, "/apps/evolution/importer/elm/mail-imported", NULL); - if (mail) - return FALSE; - - importer->do_mail = !mail; - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (importer->mail), - importer->do_mail); - - elmdir = gnome_util_prepend_user_home (".elm"); - exists = lstat(elmdir, &st) == 0 && S_ISDIR(st.st_mode); - - g_free (elmdir); - if (exists == FALSE) - return FALSE; - - elmrc = gnome_util_prepend_user_home (".elm/elmrc"); - parse_elm_rc (elmrc); - - maildir = elm_get_rc_value ("maildir"); - if (maildir == NULL) { - maildir = g_strdup ("Mail"); - } else { - maildir = g_strdup (maildir); - } - - if (!g_path_is_absolute (maildir)) { - elmdir = gnome_util_prepend_user_home (maildir); - } else { - elmdir = g_strdup (maildir); - } - - g_free (maildir); - - mailexists = lstat(elmdir, &st) == 0 && S_ISDIR(st.st_mode); - g_free (elmdir); - - aliasfile = gnome_util_prepend_user_home (".elm/aliases"); - aliasexists = lstat(aliasfile, &st) == 0 && S_ISREG(st.st_mode); - g_free (aliasfile); - - exists = (aliasexists || mailexists); - - return exists; -} - -static void -import_next (ElmImporter *importer) -{ - ElmFolder *data; - -trynext: - if (importer->dir_list) { - char *folder; - GList *l; - int ok; - - l = importer->dir_list; - data = l->data; - - folder = g_concat_dir_and_file (data->parent, data->foldername); - - importer->dir_list = l->next; - g_list_free_1(l); - - ok = elm_import_file (importer, data->path, folder); - g_free (folder); - g_free (data->parent); - g_free (data->path); - g_free (data->foldername); - g_free (data); - /* its ugly, but so is everything else in this file */ - if (!ok) - goto trynext; - } else { - bonobo_object_unref((BonoboObject *)importer->ii); - } -} - -static void -scan_dir (ElmImporter *importer, - const char *orig_parent, - const char *dirname) -{ - DIR *maildir; - struct stat buf; - struct dirent *current; - char *str; - - maildir = opendir (dirname); - if (maildir == NULL) { - g_warning ("Could not open %s\nopendir returned: %s", - dirname, g_strerror (errno)); - return; - } - - str = g_strdup_printf (_("Scanning %s"), dirname); - gtk_label_set_text (GTK_LABEL (importer->label), str); - g_free (str); - - while (gtk_events_pending ()) { - gtk_main_iteration (); - } - - current = readdir (maildir); - while (current) { - ElmFolder *pf; - char *fullname; - - /* Ignore . and .. */ - if (current->d_name[0] == '.') { - if (current->d_name[1] == '\0' || - (current->d_name[1] == '.' && current->d_name[2] == '\0')) { - current = readdir (maildir); - continue; - } - } - - fullname = g_concat_dir_and_file (dirname, current->d_name); - if (stat (fullname, &buf) == -1) { - g_warning ("Could not stat %s\nstat returned: %s", - fullname, g_strerror (errno)); - current = readdir (maildir); - g_free (fullname); - continue; - } - - if (S_ISREG (buf.st_mode)) { - pf = g_new (ElmFolder, 1); - pf->path = g_strdup (fullname); - pf->parent = g_strdup (orig_parent); - pf->foldername = g_strdup (current->d_name); - importer->dir_list = g_list_append (importer->dir_list, pf); - } else if (S_ISDIR (buf.st_mode)) { - char *subdir; - - pf = g_new (ElmFolder, 1); - pf->path = NULL; - pf->parent = g_strdup (orig_parent); - pf->foldername = g_strdup (current->d_name); - importer->dir_list = g_list_append (importer->dir_list, pf); - - subdir = g_concat_dir_and_file (orig_parent, current->d_name); - scan_dir (importer, subdir, fullname); - g_free (subdir); - } - - g_free (fullname); - current = readdir (maildir); - } -} - -static void -elm_create_structure (EvolutionIntelligentImporter *ii, - void *closure) -{ - ElmImporter *importer = closure; - char *maildir; - - /* Reference our object so when the shell release_unrefs us - we will still exist and not go byebye */ - bonobo_object_ref (BONOBO_OBJECT (ii)); - - elm_store_settings (importer); - - if (importer->do_mail == TRUE) { - char *elmdir; - GConfClient *gconf = gconf_client_get_default(); - - importer->dialog = create_importer_gui (importer); - gtk_widget_show_all (importer->dialog); - while (gtk_events_pending ()) { - gtk_main_iteration (); - } - - gconf_client_set_bool(gconf, "/apps/evolution/importer/elm/mail-imported", TRUE, NULL); - - maildir = elm_get_rc_value ("maildir"); - if (maildir == NULL) { - maildir = g_strdup ("Mail"); - } else { - maildir = g_strdup (maildir); - } - - if (!g_path_is_absolute (maildir)) { - elmdir = gnome_util_prepend_user_home (maildir); - } else { - elmdir = g_strdup (maildir); - } - - g_free (maildir); - - scan_dir (importer, "/", elmdir); - g_free (elmdir); - - /* Import them */ - import_next (importer); - } - - bonobo_object_unref (BONOBO_OBJECT (ii)); -} - -static void -elm_destroy_cb (ElmImporter *importer, GtkObject *object) -{ - elm_store_settings (importer); - - if (importer->dialog) - gtk_widget_destroy(importer->dialog); - - bonobo_object_release_unref (importer->importer, NULL); -} - -/* Fun initialisation stuff */ -/* Fun control stuff */ -static void -checkbox_toggle_cb (GtkToggleButton *tb, - gboolean *do_item) -{ - *do_item = gtk_toggle_button_get_active (tb); -} - -static BonoboControl * -create_checkboxes_control (ElmImporter *importer) -{ - GtkWidget *hbox; - BonoboControl *control; - - hbox = gtk_vbox_new (FALSE, 2); - - importer->mail = gtk_check_button_new_with_label (_("Mail")); - gtk_signal_connect (GTK_OBJECT (importer->mail), "toggled", - GTK_SIGNAL_FUNC (checkbox_toggle_cb), - &importer->do_mail); - - gtk_box_pack_start (GTK_BOX (hbox), importer->mail, FALSE, FALSE, 0); - - gtk_widget_show_all (hbox); - control = bonobo_control_new (hbox); - return control; -} - -static BonoboObject * -elm_factory_fn (BonoboGenericFactory *_factory, - const char *id, - void *closure) -{ - EvolutionIntelligentImporter *importer; - BonoboControl *control; - ElmImporter *elm; - CORBA_Environment ev; - char *message = N_("Evolution has found Elm mail files\n" - "Would you like to import them into Evolution?"); - - elm = g_new0 (ElmImporter, 1); - - CORBA_exception_init (&ev); - - elm_restore_settings (elm); - - elm->importer = bonobo_activation_activate_from_id (MBOX_IMPORTER_IID, 0, NULL, &ev); - if (ev._major != CORBA_NO_EXCEPTION) { - g_free (elm); - g_warning ("Could not start MBox importer\n%s", - CORBA_exception_id (&ev)); - CORBA_exception_free (&ev); - return NULL; - } - CORBA_exception_free (&ev); - - importer = evolution_intelligent_importer_new (elm_can_import, - elm_create_structure, - _("Elm"), - _(message), elm); - g_object_weak_ref(G_OBJECT (importer), (GWeakNotify)elm_destroy_cb, elm); - elm->ii = importer; - - control = create_checkboxes_control (elm); - bonobo_object_add_interface (BONOBO_OBJECT (importer), - BONOBO_OBJECT (control)); - return BONOBO_OBJECT (importer); -} - -void -mail_importer_module_init (void) -{ - static gboolean initialised = FALSE; - BonoboGenericFactory *factory; - - if (initialised == TRUE) - return; - - factory = bonobo_generic_factory_new (ELM_INTELLIGENT_IMPORTER_IID, - elm_factory_fn, NULL); - if (factory == NULL) - g_warning ("Could not initialise Elm Intelligent Mail Importer."); - initialised = TRUE; -} diff --git a/mail/importers/evolution-mbox-importer.c b/mail/importers/evolution-mbox-importer.c deleted file mode 100644 index 83323703af..0000000000 --- a/mail/importers/evolution-mbox-importer.c +++ /dev/null @@ -1,335 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* evolution-mbox-importer.c - * - * Authors: Iain Holmes <iain@ximian.com> - * - * Copyright (C) 2001 Ximian, Inc. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public - * License as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <stdio.h> -#include <ctype.h> -#include <string.h> - -#include <bonobo/bonobo-object.h> -#include <bonobo/bonobo-generic-factory.h> - -#include <camel/camel-exception.h> -#include <camel/camel-mime-message.h> -#include <camel/camel-mime-parser.h> -#include <camel/camel-mime-part.h> - -#include <importer/evolution-importer.h> -#include <importer/GNOME_Evolution_Importer.h> - -#include "mozilla-status-headers.h" - -#include "mail/mail-importer.h" -#include "mail-tools.h" - -#include "e-util/e-path.h" - -/* #define IMPORTER_DEBUG */ -#ifdef IMPORTER_DEBUG -#define IN g_print ("=====> %s (%d)\n", G_GNUC_FUNCTION, __LINE__) -#define OUT g_print ("<==== %s (%d)\n", G_GNUC_FUNCTION, __LINE__) -#else -#define IN -#define OUT -#endif - -#define MBOX_FACTORY_IID "OAFIID:GNOME_Evolution_Mail_Mbox_ImporterFactory:" BASE_VERSION - -typedef struct { - MailImporter importer; /* Parent */ - - char *filename; - int num; - GNOME_Evolution_Storage_Result create_result; - - CamelMimeParser *mp; - gboolean is_folder; -} MboxImporter; - -void mail_importer_module_init (void); - -/* EvolutionImporter methods */ - - -static CamelMessageInfo * -get_info_from_mozilla (const char *mozilla_status, - gboolean *deleted) -{ - unsigned int status; - CamelMessageInfo *info; - - *deleted = FALSE; - - status = strtoul (mozilla_status, NULL, 16); - if (status == 0) { - return camel_message_info_new (); - } - - if (status & MSG_FLAG_EXPUNGED) { - *deleted = TRUE; - - return NULL; - } - - info = camel_message_info_new (); - - if (status & MSG_FLAG_READ) - info->flags |= CAMEL_MESSAGE_SEEN; - - if (status & MSG_FLAG_MARKED) - info->flags |= CAMEL_MESSAGE_FLAGGED; - - if (status & MSG_FLAG_REPLIED) - info->flags |= CAMEL_MESSAGE_ANSWERED; - - return info; -} - -static void -process_item_fn (EvolutionImporter *eimporter, - CORBA_Object listener, - void *closure, - CORBA_Environment *ev) -{ - MboxImporter *mbi = (MboxImporter *) closure; - MailImporter *importer = (MailImporter *) mbi; - gboolean done = FALSE; - CamelException *ex; - const char *mozilla_status; - - if (importer->folder == NULL) { - GNOME_Evolution_ImporterListener_notifyResult (listener, - GNOME_Evolution_ImporterListener_BAD_FILE, - FALSE, ev); - } - - if (mbi->is_folder == TRUE) { - GNOME_Evolution_ImporterListener_notifyResult (listener, - GNOME_Evolution_ImporterListener_OK, - FALSE, ev); - return; - } - - ex = camel_exception_new (); - if (camel_mime_parser_step (mbi->mp, 0, 0) == CAMEL_MIME_PARSER_STATE_FROM) { - /* Import the next message */ - CamelMimeMessage *msg; - CamelMessageInfo *info; - gboolean deleted; - - IN; - msg = camel_mime_message_new (); - if (camel_mime_part_construct_from_parser (CAMEL_MIME_PART (msg), mbi->mp) == -1) { - g_warning ("Failed message %d", mbi->num); - camel_object_unref (CAMEL_OBJECT (msg)); - done = TRUE; - } else { - mozilla_status = camel_medium_get_header (CAMEL_MEDIUM (msg), "X-Mozilla-Status"); - if (mozilla_status != NULL) { - info = get_info_from_mozilla (mozilla_status, &deleted); - } else { - deleted = FALSE; - info = camel_message_info_new (); - } - - if (deleted == FALSE) { - /* write the mesg */ - camel_folder_append_message (importer->folder, msg, info, NULL, ex); - } - - if (info) - camel_message_info_free (info); - - camel_object_unref (msg); - if (camel_exception_is_set (ex)) { - g_warning ("Failed message %d", mbi->num); - done = TRUE; - } - } - OUT; - } else { - IN; - /* all messages have now been imported */ - camel_folder_sync (importer->folder, FALSE, ex); - camel_folder_thaw (importer->folder); - importer->frozen = FALSE; - done = TRUE; - OUT; - } - - if (!done) - camel_mime_parser_step (mbi->mp, 0, 0); - - camel_exception_free (ex); - - GNOME_Evolution_ImporterListener_notifyResult (listener, - GNOME_Evolution_ImporterListener_OK, - !done, ev); - return; -} - -static gboolean -support_format_fn (EvolutionImporter *importer, - const char *filename, - void *closure) -{ - char signature[6]; - gboolean ret = FALSE; - int fd, n; - - fd = open (filename, O_RDONLY); - if (fd == -1) - return FALSE; - - n = read (fd, signature, 5); - if (n > 0) { - signature[n] = '\0'; - if (!g_strncasecmp (signature, "From ", 5)) - ret = TRUE; - } - - close (fd); - - return ret; -} - -static void -importer_destroy_cb (void *data, GObject *object) -{ - MboxImporter *mbi = data; - MailImporter *importer = data; - - if (importer->folder) { - if (importer->frozen) { - camel_folder_sync (importer->folder, FALSE, NULL); - camel_folder_thaw (importer->folder); - } - - camel_object_unref (importer->folder); - } - - g_free (mbi->filename); - if (mbi->mp) - camel_object_unref (mbi->mp); - - g_free (mbi); -} - -static gboolean -load_file_fn (EvolutionImporter *eimporter, - const char *filename, - const char *uri, - const char *folder_type, - void *closure) -{ - MboxImporter *mbi; - MailImporter *importer; - struct stat buf; - int fd; - - mbi = (MboxImporter *) closure; - importer = (MailImporter *) mbi; - - mbi->filename = g_strdup (filename); - - fd = open (filename, O_RDONLY); - if (fd == -1) { - g_warning ("Cannot open file"); - return FALSE; - } - - fstat (fd, &buf); - if (S_ISREG (buf.st_mode)) { - mbi->mp = camel_mime_parser_new (); - camel_mime_parser_scan_from (mbi->mp, TRUE); - if (camel_mime_parser_init_with_fd (mbi->mp, fd) == -1) { - g_warning ("Unable to process spool folder"); - goto fail; - } - mbi->is_folder = FALSE; - } else { - mbi->is_folder = TRUE; - } - - importer->mstream = NULL; - if (uri == NULL || *uri == '\0') - importer->folder = mail_tool_get_local_inbox (NULL); - else - importer->folder = mail_tool_uri_to_folder(uri, 0, NULL); - - if (importer->folder == NULL) { - g_warning ("Bad folder\n"); - goto fail; - } - - if (importer->folder != NULL) { - camel_folder_freeze (importer->folder); - importer->frozen = TRUE; - } - - return TRUE; - - fail: - camel_object_unref (mbi->mp); - mbi->mp = NULL; - - return FALSE; -} - -static BonoboObject * -mbox_factory_fn (BonoboGenericFactory *_factory, - const char *cid, - void *closure) -{ - EvolutionImporter *importer; - MboxImporter *mbox; - - mbox = g_new0 (MboxImporter, 1); - importer = evolution_importer_new (support_format_fn, load_file_fn, - process_item_fn, NULL, mbox); - g_object_weak_ref(G_OBJECT(importer), importer_destroy_cb, mbox); - - return BONOBO_OBJECT (importer); -} - -/* Entry point */ -void -mail_importer_module_init (void) -{ - static gboolean initialised = FALSE; - BonoboGenericFactory *factory; - - if (initialised == TRUE) - return; - - factory = bonobo_generic_factory_new (MBOX_FACTORY_IID, - mbox_factory_fn, NULL); - - if (factory == NULL) - g_warning ("Could not initialise mbox importer factory."); - - initialised = TRUE; -} - diff --git a/mail/importers/evolution-outlook-importer.c b/mail/importers/evolution-outlook-importer.c deleted file mode 100644 index 62d99bb149..0000000000 --- a/mail/importers/evolution-outlook-importer.c +++ /dev/null @@ -1,318 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* evolution-outlook-importer.c - * - * Authors: Iain Holmes <iain@ximian.com> - * - * Copyright (C) 2001 Ximian, Inc. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public - * License as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <bonobo/bonobo-object.h> -#include <bonobo/bonobo-generic-factory.h> - -#include <stdio.h> - -#include <importer/evolution-importer.h> -#include <importer/GNOME_Evolution_Importer.h> - -#include <camel/camel-exception.h> - -#include "e-util/e-memory.h" - -#include "mail-importer.h" -#include "mail-tools.h" - - -#define OUTLOOK_FACTORY_IID "OAFIID:GNOME_Evolution_Mail_Outlook_ImporterFactory:" BASE_VERSION - -extern char *evolution_dir; -typedef struct { - MailImporter importer; - - char *filename; - gboolean oe4; /* Is file OE4 or not? */ - FILE *handle; - long pos; - off_t size; - - gboolean busy; -} OutlookImporter; - -struct oe_msg_segmentheader { - int self; - int increase; - int include; - int next; - int usenet; -}; - -typedef struct oe_msg_segmentheader oe_msg_segmentheader; - -/* Prototype */ - -void mail_importer_module_init (void); - - -/* EvolutionImporter methods */ - -/* Based on code from liboe 0.92 (STABLE) - Copyright (C) 2000 Stephan B. Nedregård (stephan@micropop.com) - Modified 2001 Iain Holmes <iain@ximian.com> - Copyright (C) 2001 Ximian, Inc. */ - -static void -process_item_fn (EvolutionImporter *eimporter, - CORBA_Object listener, - void *closure, - CORBA_Environment *ev) -{ - OutlookImporter *oli = (OutlookImporter *) closure; - MailImporter *importer = (MailImporter *) oli; - oe_msg_segmentheader *header; - gboolean more = TRUE; - char *cb, *sfull, *s; - long end_pos = 0; - int i; - - if (oli->busy == TRUE) { - GNOME_Evolution_ImporterListener_notifyResult (listener, - GNOME_Evolution_ImporterListener_BUSY, - more, ev); - return; - } - - oli->busy = TRUE; - header = g_new (oe_msg_segmentheader, 1); - fread (header, 16, 1, oli->handle); - - /* Write a From line */ - mail_importer_add_line (importer, - "From evolution-outlook-importer", FALSE); - end_pos = oli->pos + header->include; - if (end_pos >= oli->size) { - end_pos = oli->size; - more = FALSE; - } - - oli->pos += 4; - - cb = g_new (char, 4); - sfull = g_new (char, 65536); - s = sfull; - - while (oli->pos < end_pos) { - fread (cb, 1, 4, oli->handle); - for (i = 0; i < 4; i++, oli->pos++) { - if (*(cb + i ) != 0x0d) { - *s++ = *(cb + i); - - if (*(cb + i) == 0x0a) { - *s = '\0'; - mail_importer_add_line (importer, - sfull, FALSE); - s = sfull; - } - } - } - } - - if (s != sfull) { - *s = '\0'; - mail_importer_add_line (importer, sfull, FALSE); - s = sfull; - } - - mail_importer_add_line (importer, "\n", TRUE); - - oli->pos = end_pos; - fseek (oli->handle, oli->pos, SEEK_SET); - - g_free (header); - g_free (sfull); - g_free (cb); - - GNOME_Evolution_ImporterListener_notifyResult (listener, - GNOME_Evolution_ImporterListener_OK, - more, ev); - if (more == FALSE) { - CamelException *ex; - - ex = camel_exception_new (); - camel_folder_thaw (importer->folder); - camel_folder_sync (importer->folder, FALSE, ex); - camel_exception_free (ex); - fclose (oli->handle); - oli->handle = NULL; - } - - oli->busy = FALSE; - return; -} - - -/* EvolutionImporterFactory methods */ - -static gboolean -support_format_fn (EvolutionImporter *importer, - const char *filename, - void *closure) -{ - FILE *handle; - int signature[4]; - - /* Outlook Express sniffer. - Taken from liboe 0.92 (STABLE) - Copyright (C) 2000 Stephan B. Nedregård (stephan@micropop.com) */ - - handle = fopen (filename, "rb"); - if (handle == NULL) - return FALSE; /* Can't open file: Can't support it :) */ - - /* SIGNATURE */ - fread (&signature, 16, 1, handle); - if ((signature[0]!=0xFE12ADCF) || /* OE 5 & OE 5 BETA SIGNATURE */ - (signature[1]!=0x6F74FDC5) || - (signature[2]!=0x11D1E366) || - (signature[3]!=0xC0004E9A)) { - if ((signature[0]==0x36464D4A) && - (signature[1]==0x00010003)) /* OE4 SIGNATURE */ { - fclose (handle); - return TRUE; /* OE 4 */ - } - fclose (handle); - return FALSE; /* Not Outlook 4 or 5 */ - } - - fclose (handle); - return FALSE; /* Can't handle OE 5 yet */ -} - -static void -importer_destroy_cb (void *data, GObject *object) -{ - OutlookImporter *oli = data; - MailImporter *importer = data; - - if (importer->folder) - camel_object_unref (importer->folder); - - g_free (oli->filename); - if (oli->handle) - fclose (oli->handle); - - g_free (oli); -} - -static gboolean -load_file_fn (EvolutionImporter *eimporter, - const char *filename, - const char *uri, - const char *folder_type, - void *closure) -{ - OutlookImporter *oli; - MailImporter *importer; - struct stat buf; - long pos = 0x54; - - oli = (OutlookImporter *) closure; - importer = (MailImporter *) oli; - - oli->filename = g_strdup (filename); - /* Will return TRUE if oe4 format */ - oli->oe4 = support_format_fn (NULL, filename, NULL); - if (oli->oe4 == FALSE) { - g_warning ("Not OE4 format"); - return FALSE; - } - - oli->handle = fopen (filename, "rb"); - if (oli->handle == NULL) { - g_warning ("Cannot open the file"); - return FALSE; - } - - /* Get size of file */ - if (stat (filename, &buf) == -1) { - g_warning ("Cannot stat file"); - return FALSE; - } - - oli->size = buf.st_size; - - /* Set the fposition to the begining */ - fseek (oli->handle, pos, SEEK_SET); - oli->pos = pos; - - importer->mstream = NULL; - - if (uri == NULL || *uri == 0) - importer->folder = mail_tool_get_local_inbox (NULL); - else - importer->folder = mail_tool_uri_to_folder (uri, 0, NULL); - - if (importer->folder == NULL){ - g_warning ("Bad folder"); - return FALSE; - } - - camel_folder_freeze (importer->folder); - oli->busy = FALSE; - return TRUE; -} - -static BonoboObject * -outlook_factory_fn (BonoboGenericFactory *_factory, - const char *cid, - void *closure) -{ - EvolutionImporter *importer; - OutlookImporter *oli; - - oli = g_new0 (OutlookImporter, 1); - - importer = evolution_importer_new (support_format_fn, load_file_fn, - process_item_fn, NULL, oli); - g_object_weak_ref((GObject *)importer, importer_destroy_cb, oli); - - return BONOBO_OBJECT (importer); -} - -/* Entry point */ -void -mail_importer_module_init (void) -{ - static gboolean initialised = FALSE; - BonoboGenericFactory *factory; - - if (initialised == TRUE) - return; - - factory = bonobo_generic_factory_new (OUTLOOK_FACTORY_IID, - outlook_factory_fn, NULL); - - if (factory == NULL) - g_warning ("Could not initialise Outlook importer factory."); - - initialised = TRUE; -} - - diff --git a/mail/importers/mozilla-status-headers.h b/mail/importers/mozilla-status-headers.h deleted file mode 100644 index f459d6ec8f..0000000000 --- a/mail/importers/mozilla-status-headers.h +++ /dev/null @@ -1,29 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* mozilla-status-headers.h - * - * Authors: Iain Holmes <iain@ximian.com> - * - * Copyright (C) 2001 Ximian, Inc. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public - * License as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -/* Defines copied from nsMsgMessageFlags.h in Mozilla source. */ - -/* Evolution only cares about these headers I think */ -#define MSG_FLAG_READ 0x0001 -#define MSG_FLAG_REPLIED 0x0002 -#define MSG_FLAG_MARKED 0x0004 -#define MSG_FLAG_EXPUNGED 0x0008 diff --git a/mail/importers/netscape-importer.c b/mail/importers/netscape-importer.c deleted file mode 100644 index a0610ca1b4..0000000000 --- a/mail/importers/netscape-importer.c +++ /dev/null @@ -1,2162 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* netscape-importer.c - * - * Authors: - * Iain Holmes <iain@ximian.com> - * Christian Kreibich <cK@whoop.org> (email filter import) - * - * Copyright 2001 Ximian, Inc. (www.ximian.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public - * License as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA - */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <stdio.h> -#include <errno.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <pwd.h> -#include <ctype.h> -#include <unistd.h> -#include <dirent.h> - -#include <glib.h> -#include <gnome.h> - -#include <gconf/gconf.h> -#include <gconf/gconf-client.h> - -#include <bonobo/bonobo-main.h> -#include <bonobo/bonobo-object.h> -#include <bonobo/bonobo-generic-factory.h> -#include <bonobo/bonobo-control.h> -#include <bonobo/bonobo-context.h> -#include <bonobo/bonobo-exception.h> -#include <bonobo/bonobo-moniker-util.h> - -#include <bonobo-activation/bonobo-activation.h> - -#include <importer/evolution-intelligent-importer.h> -#include <importer/GNOME_Evolution_Importer.h> -#include <importer/evolution-importer-client.h> - -#include <filter/filter-context.h> -#include <filter/filter-filter.h> -#include <filter/filter-rule.h> -#include <filter/filter-option.h> -#include <filter/filter-folder.h> -#include <filter/filter-int.h> -#include <shell/evolution-shell-client.h> - -#include "Mailer.h" -#include "mail/mail-importer.h" - -static char *nsmail_dir = NULL; -static GHashTable *user_prefs = NULL; - -/* This is rather ugly -- libfilter needs this symbol: */ -EvolutionShellClient *global_shell_client = NULL; - -static char *filter_name = N_("Priority Filter \"%s\""); - -#define FACTORY_IID "OAFIID:GNOME_Evolution_Mail_Netscape_Intelligent_Importer_Factory:" BASE_VERSION -#define MBOX_IMPORTER_IID "OAFIID:GNOME_Evolution_Mail_Mbox_Importer:" BASE_VERSION -#define MAIL_CONFIG_IID "OAFIID:GNOME_Evolution_MailConfig:" BASE_VERSION - -#define KEY "netscape-mail-imported" - -/*#define SUPER_IMPORTER_DEBUG*/ -#ifdef SUPER_IMPORTER_DEBUG -#define d(x) x -#else -#define d(x) -#endif - -#define MAXLEN 4096 - -typedef struct { - EvolutionIntelligentImporter *ii; - - GList *dir_list; - - int progress_count; - int more; - EvolutionImporterResult result; - - GNOME_Evolution_Importer importer; - EvolutionImporterListener *listener; - - /* Checkboxes */ - GtkWidget *mail; - gboolean do_mail; -/* - GtkWidget *addrs; - gboolean do_addrs; -*/ - GtkWidget *filters; - gboolean do_filters; - GtkWidget *settings; - gboolean do_settings; - - /*Bonobo_ConfigDatabase db;*/ - - /* GUI */ - GtkWidget *dialog; - GtkWidget *label; - GtkWidget *progressbar; -} NsImporter; - - -/* Email filter datastructures ---------------------------------------------- */ - - -typedef enum { - MOVE_TO_FOLDER, CHANGE_PRIORITY, DELETE, - MARK_READ, IGNORE_THREAD, WATCH_THREAD -} NsFilterActionType; - -static char* ns_filter_action_types[] = -{ - "Move to folder", "Change priority", "Delete", - "Mark read", "Ignore thread", "Watch thread" -}; - - -typedef enum { - HIGHEST, HIGH, NORMAL, LOW, LOWEST, FREE, NONE -} NsFilterActionValueType; - -static char *ns_filter_action_value_types[] = -{ - "Highest", "High", "Normal", "Low", "Lowest" -}; - - -typedef enum { - FROM, SUBJECT, TO, CC, TO_OR_CC, BODY, DATE, PRIORITY, - STATUS, AGE_IN_DAYS, X_MSG_HEADER -} NsFilterConditionType; - -static char *ns_filter_condition_types[] = -{ - "from", "subject", "to", "CC", "to or CC", "body", "date", - "priority", "age in days" -}; - - -typedef enum { - CONTAINS, CONTAINS_NOT, IS, IS_NOT, BEGINS_WITH, ENDS_WITH, - IS_BEFORE, IS_AFTER, IS_GREATER_THAN, IS_LESS_THAN, READ, - REPLIED, IS_HIGHER_THAN, IS_LOWER_THAN -} NsFilterConditionPropertyType; - -static char *ns_filter_condition_property_types[] = -{ - "contains", "doesn't contain", "is", "isn't", "begins with", - "ends with", "is before", "is after", "is greater than", - "is less than", "read", "replied", "is higher than", - "is lower than" -}; - - -typedef struct -{ - NsFilterConditionType type; - NsFilterConditionPropertyType prop; - NsFilterActionValueType prop_val_id; /* for dealing with priority levels */ - char *prop_val_str; -} NsFilterCondition; - -typedef struct { - char *name; - char *description; - - gboolean enabled; - - NsFilterActionType action; - NsFilterActionValueType action_val_id; - char *action_val_str; - - enum _filter_grouping_t grouping; - GList *conditions; /* List of NSFilterConditions */ -} NsFilter; - - -/* Prototypes ------------------------------------------------------------- */ -void mail_importer_module_init (void); - -static void netscape_filter_cleanup (NsFilter *nsf); -static char *fix_netscape_folder_names (const char *original_name); -static void import_next (NsImporter *importer); - - -/* Email filter stuff ----------------------------------------------------- */ - -static gboolean -netscape_filter_flatfile_get_entry (FILE *f, char *key, char *val) -{ - char line[MAXLEN]; - char *ptr = NULL; - char *ptr2 = NULL; - - if (fgets (line, MAXLEN, f)) { - - ptr = strchr(line, '='); - *ptr = '\0'; - - memcpy (key, line, strlen(line)+1); - - ptr += 2; /* Skip '=' and '"' */ - ptr2 = strrchr (ptr, '"'); - *ptr2 = '\0'; - - memcpy (val, ptr, strlen(ptr)+1); - - d(g_warning ("Parsing key/val '%s' '%s'", key, val)); - return TRUE; - - } - - *key = '\0'; *val = '\0'; - return FALSE; -} - -/* This function parses the filtering condition strings. - Netscape describes the conditions that determine when - to apply a filter through a string of the form - - " OR (type, property, value) OR (type, property, value) ... " - - or - " AND (type, property, value) AND (type, property, value) ... " - - where type can be "subject", "from", "to", "CC" etc, property - is "contains" etc, and value is the according pattern. -*/ -static void -netscape_filter_parse_conditions (NsFilter *nsf, FILE *f, char *condition) -{ - char *ptr = condition, *ptr2 = NULL; - char type[MAXLEN]; - char prop[MAXLEN]; - char val[MAXLEN]; - NsFilterCondition *cond; - - if ( (ptr = strstr (condition, "OR")) == NULL) { - nsf->grouping = FILTER_GROUP_ALL; - } else { - nsf->grouping = FILTER_GROUP_ANY; - } - - ptr = condition; - while ( (ptr = strchr (ptr, '(')) != NULL) { - - /* Move ptr to start of type */ - ptr++; - - /* Move ptr2 up to next comma: */ - if ( (ptr2 = strchr (ptr, ',')) == NULL) - continue; - - memcpy (type, ptr, ptr2-ptr); - type[ptr2-ptr] = '\0'; - - /* Move ptr to start of property */ - ptr = ptr2 + 1; - - /* Move ptr2 up to next comma: */ - if ( (ptr2 = strchr (ptr, ',')) == NULL) - continue; - - memcpy (prop, ptr, ptr2-ptr); - prop[ptr2-ptr] = '\0'; - - /* Move ptr to start of value */ - ptr = ptr2 + 1; - - /* Move ptr2 to end of value: */ - if ( (ptr2 = strchr (ptr, ')')) == NULL) - continue; - - memcpy (val, ptr, ptr2-ptr); - val[ptr2-ptr] = '\0'; - - cond = g_new0 (NsFilterCondition, 1); - - if (!strcmp (type, ns_filter_condition_types[FROM])) { - cond->type = FROM; - } else if (!strcmp (type, ns_filter_condition_types[SUBJECT])) { - cond->type = SUBJECT; - } else if (!strcmp (type, ns_filter_condition_types[TO])) { - cond->type = TO; - } else if (!strcmp (type, ns_filter_condition_types[CC])) { - cond->type = CC; - } else if (!strcmp (type, ns_filter_condition_types[TO_OR_CC])) { - cond->type = TO_OR_CC; - } else if (!strcmp (type, ns_filter_condition_types[BODY])) { - cond->type = BODY; - } else if (!strcmp (type, ns_filter_condition_types[DATE])) { - cond->type = DATE; - } else if (!strcmp (type, ns_filter_condition_types[PRIORITY])) { - cond->type = PRIORITY; - } else if (!strcmp (type, ns_filter_condition_types[STATUS])) { - cond->type = STATUS; - } else if (!strcmp (type, ns_filter_condition_types[AGE_IN_DAYS])) { - cond->type = AGE_IN_DAYS; - } else if (!strcmp (type, ns_filter_condition_types[X_MSG_HEADER])) { - cond->type = X_MSG_HEADER; - } else { - d(g_warning ("Unknown condition type '%s' encountered -- skipping.", type)); - g_free (cond); - continue; - } - - - if (!strcmp (prop, ns_filter_condition_property_types[CONTAINS])) { - cond->prop = CONTAINS; - } else if (!strcmp (prop, ns_filter_condition_property_types[CONTAINS_NOT])) { - cond->prop = CONTAINS_NOT; - } else if (!strcmp (prop, ns_filter_condition_property_types[IS])) { - cond->prop = IS; - } else if (!strcmp (prop, ns_filter_condition_property_types[IS_NOT])) { - cond->prop = IS_NOT; - } else if (!strcmp (prop, ns_filter_condition_property_types[BEGINS_WITH])) { - cond->prop = BEGINS_WITH; - } else if (!strcmp (prop, ns_filter_condition_property_types[ENDS_WITH])) { - cond->prop = ENDS_WITH; - } else if (!strcmp (prop, ns_filter_condition_property_types[IS_BEFORE])) { - cond->prop = IS_BEFORE; - } else if (!strcmp (prop, ns_filter_condition_property_types[IS_AFTER])) { - cond->prop = IS_AFTER; - } else if (!strcmp (prop, ns_filter_condition_property_types[IS_GREATER_THAN])) { - cond->prop = IS_GREATER_THAN; - } else if (!strcmp (prop, ns_filter_condition_property_types[IS_LESS_THAN])) { - cond->prop = IS_LESS_THAN; - } else if (!strcmp (prop, ns_filter_condition_property_types[READ])) { - cond->prop = READ; - } else if (!strcmp (prop, ns_filter_condition_property_types[REPLIED])) { - cond->prop = REPLIED; - } else if (!strcmp (prop, ns_filter_condition_property_types[IS_HIGHER_THAN])) { - cond->prop = IS_HIGHER_THAN; - } else if (!strcmp (prop, ns_filter_condition_property_types[IS_LOWER_THAN])) { - cond->prop = IS_LOWER_THAN; - } else { - d(g_warning ("Unknown condition property '%s' encountered -- skipping.", prop)); - g_free (cond); - continue; - } - - cond->prop_val_id = FREE; - - if (!strcmp (val, ns_filter_action_value_types[LOWEST])) { - cond->prop_val_id = LOWEST; - } else if (!strcmp (val, ns_filter_action_value_types[LOW])) { - cond->prop_val_id = LOW; - } else if (!strcmp (val, ns_filter_action_value_types[NORMAL])) { - cond->prop_val_id = NORMAL; - } else if (!strcmp (val, ns_filter_action_value_types[HIGH])) { - cond->prop_val_id = HIGH; - } else if (!strcmp (val, ns_filter_action_value_types[HIGHEST])) { - cond->prop_val_id = HIGHEST; - } - - cond->prop_val_str = g_strdup (val); - nsf->conditions = g_list_append (nsf->conditions, cond); - } -} - - -static NsFilter * -netscape_filter_read_next (FILE *mailrule_handle) -{ - NsFilter *nsf; - char key[MAXLEN]; - char val[MAXLEN]; - - key[0] = '\0'; - - for ( ; ; ) { - - /* Skip stuff at the beginning, until beginning of next filter - is read: */ - - do { - if (!netscape_filter_flatfile_get_entry (mailrule_handle, key, val)) - return NULL; - - } while (strcmp(key, "name")); - - nsf = g_new0 (NsFilter, 1); - nsf->name = g_strdup (val); - - - /* Read value for "enabled" setting */ - - if (!netscape_filter_flatfile_get_entry (mailrule_handle, key, val)) - goto cleanup; - if (strcmp (key, "enabled")) { - goto cleanup; - } - if (strcmp (val, "true")) - nsf->enabled = TRUE; - else - nsf->enabled = FALSE; - - - /* Read filter description */ - - if (!netscape_filter_flatfile_get_entry (mailrule_handle, key, val)) - goto cleanup; - if (strcmp (key, "description")) { - goto cleanup; - } - nsf->description = g_strdup (val); - - - /* Skip one line -- it's a "type" entry and always seems to be "1"? */ - - if (!netscape_filter_flatfile_get_entry (mailrule_handle, key, val)) - goto cleanup; - if (strcmp (key, "type")) { - goto cleanup; - } - - /* Read filter action and handle action value accordingly */ - - if (!netscape_filter_flatfile_get_entry (mailrule_handle, key, val)) - goto cleanup; - if (strcmp (key, "action")) { - goto cleanup; - } - if (!strcmp (val, ns_filter_action_types[MOVE_TO_FOLDER])) { - - if (!netscape_filter_flatfile_get_entry (mailrule_handle, key, val)) - goto cleanup; - if (strcmp (key, "actionValue")) { - goto cleanup; - } - nsf->action = MOVE_TO_FOLDER; - nsf->action_val_id = FREE; - nsf->action_val_str = g_strdup(val); - } - else if (!strcmp (val, ns_filter_action_types[CHANGE_PRIORITY])) { - - if (!netscape_filter_flatfile_get_entry (mailrule_handle, key, val)) - goto cleanup; - if (strcmp (key, "actionValue")) { - goto cleanup; - } - - nsf->action = CHANGE_PRIORITY; - - if (!strcmp (val, ns_filter_action_value_types[LOWEST])) { - nsf->action_val_id = LOWEST; - } else if (!strcmp (val, ns_filter_action_value_types[LOW])) { - nsf->action_val_id = LOW; - } else if (!strcmp (val, ns_filter_action_value_types[NORMAL])) { - nsf->action_val_id = NORMAL; - } else if (!strcmp (val, ns_filter_action_value_types[HIGH])) { - nsf->action_val_id = HIGH; - } else if (!strcmp (val, ns_filter_action_value_types[HIGHEST])) { - nsf->action_val_id = HIGHEST; - } else { - d(g_warning ("Unknown Netscape filter action value '%s' for action '%s'", - val, ns_filter_action_types[CHANGE_PRIORITY])); - goto cleanup; - } - - nsf->action_val_str = NULL; - - } - else if (!strcmp (val, ns_filter_action_types[DELETE])) { - - nsf->action = DELETE; - nsf->action_val_id = NONE; - } - else if (!strcmp (val, ns_filter_action_types[MARK_READ])) { - - nsf->action = MARK_READ; - nsf->action_val_id = NONE; - } - else if (!strcmp (val, ns_filter_action_types[IGNORE_THREAD])) { - - nsf->action = IGNORE_THREAD; - nsf->action_val_id = NONE; - } - else if (!strcmp (val, ns_filter_action_types[WATCH_THREAD])) { - - nsf->action = WATCH_THREAD; - nsf->action_val_id = NONE; - } - else { - d(g_warning ("Unknown Netscape filter action '%s'", val)); - goto cleanup; - } - - - /* Read conditions, the fun part ... */ - - if (!netscape_filter_flatfile_get_entry (mailrule_handle, key, val)) - goto cleanup; - if (strcmp (key, "condition")) { - goto cleanup; - } - netscape_filter_parse_conditions (nsf, mailrule_handle, val); - - return nsf; - - cleanup: - netscape_filter_cleanup (nsf); - } - - return NULL; -} - - -static void -netscape_filter_cleanup (NsFilter *nsf) -{ - GList *l; - - g_free (nsf->name); - g_free (nsf->description); - g_free (nsf->action_val_str); - - for (l = nsf->conditions; l; l = l->next) { - - NsFilterCondition *cond = (NsFilterCondition *)l->data; - - g_free (cond->prop_val_str); - g_free (cond); - } - - g_list_free (nsf->conditions); - g_free (nsf); -} - - -static gboolean -netscape_filter_set_opt_for_cond (NsFilterCondition *cond, FilterOption* op) -{ - switch (cond->prop) { - case CONTAINS: - filter_option_set_current (op, "contains"); - break; - case CONTAINS_NOT: - filter_option_set_current (op, "does not contain"); - break; - case IS: - filter_option_set_current (op, "is"); - break; - case IS_NOT: - filter_option_set_current (op, "is not"); - break; - case BEGINS_WITH: - filter_option_set_current (op, "starts with"); - break; - case ENDS_WITH: - filter_option_set_current (op, "ends with"); - break; - default: - return FALSE; - } - - return TRUE; -} - - -/* Translates a string of the form - folder1.sbd/folder2.sbd/.../folderN.sbd/folder - - into one that looks like this: - - folder1/folder2/.../folderN/folder -*/ -static char* -netscape_filter_strip_sbd (char *ns_folder) -{ - char *folder_copy; - char s[MAXLEN]; - char *ptr, *ptr2; - char *fixed_folder; - - folder_copy = g_strdup (ns_folder); - ptr = folder_copy; - s[0] = '\0'; - - while (ptr) { - if ( (ptr2 = strstr (ptr, ".sbd")) == NULL) - break; - - *ptr2 = '\0'; - strcat (s, ptr); - - ptr = ptr2 + 4; /* skip ".sbd" */ - } - - fixed_folder = fix_netscape_folder_names (ptr); - strcat (s, fixed_folder); - g_free (folder_copy); - g_free (fixed_folder); - - d(g_warning ("Stripped '%s' to '%s'", ns_folder, s)); - - return g_strdup (s); -} - - -static char * -netscape_filter_map_folder_to_uri (char *folder) -{ - char *folder_copy; - char s[MAXLEN]; - char *ptr, *ptr2; - - folder_copy = g_strdup (folder); - ptr = folder_copy; - - g_snprintf (s, MAXLEN, "file://%s/evolution/local/", g_get_home_dir ()); - - while (ptr) { - if ( (ptr2 = strchr (ptr, '/')) == NULL) - break; - - *ptr2 = '\0'; - strcat (s, ptr); - strcat (s, "/subfolders/"); - - ptr = ptr2 + 1; - } - - strcat (s, ptr); - g_free (folder_copy); - - d(g_warning ("Mapped '%s' to '%s'", folder, s)); - - return g_strdup (s); -} - - -static void -netscape_filter_change_priority_warning (void) -{ - GtkWidget *dialog; - static gboolean already_shown = FALSE; - - if (!already_shown) { - already_shown = TRUE; - dialog = gnome_ok_dialog (_("Some of your Netscape email filters are based on\n" - "email priorities, which are not used in Evolution.\n" - "Instead, Evolution provides scores in the range of\n" - "-3 to 3 that can be assigned to emails and filtered\n" - "accordingly.\n" - "\n" - "As a workaround, a set of filters called \"Priority Filter\"\n" - "was added that converts Netscape's email priorities into\n" - "Evolution's scores, and the affected filters use scores instead\n" - "of priorities. Check the imported filters to make sure\n" - "everything still works as intended.")); - gnome_dialog_run_and_close (GNOME_DIALOG (dialog)); - } -} - - -static void -netscape_filter_threads_action_not_supported (void) -{ - GtkWidget *dialog; - static gboolean already_shown = FALSE; - - if (!already_shown) { - already_shown = TRUE; - dialog = gnome_ok_dialog (_("Some of your Netscape email filters use\n" - "the \"Ignore Thread\" or \"Watch Thread\"\n" - "feature, which is not supported in Evolution.\n" - "These filters will be dropped.")); - gnome_dialog_run_and_close (GNOME_DIALOG (dialog)); - } -} - - -static void -netscape_filter_body_is_not_supported (void) -{ - GtkWidget *dialog; - static gboolean already_shown = FALSE; - - if (!already_shown) { - already_shown = TRUE; - dialog = gnome_ok_dialog (_("Some of your Netscape email filters test the\n" - "body of emails for (in)equality to a given string,\n" - "which is not supported in Evolution. Those filters\n" - "were modified to test whether that string is or is not\n" - "contained in the message body.")); - gnome_dialog_run_and_close (GNOME_DIALOG (dialog)); - } -} - - -static FilterRule* -netscape_create_priority_converter (FilterContext *fc, NsFilterActionValueType priority) -{ - FilterFilter *ff; - FilterPart *fp; - FilterRule *fr; - FilterElement *el; - char s[MAXLEN]; - int v; - - ff = filter_filter_new (); - fr = FILTER_RULE(ff); - - g_snprintf (s, MAXLEN, filter_name, ns_filter_action_value_types[priority]); - filter_rule_set_name (fr, s); - filter_rule_set_source (fr, FILTER_SOURCE_INCOMING); - - fp = rule_context_create_part (RULE_CONTEXT(fc), "header"); - filter_rule_add_part (fr, fp); - el = filter_part_find_element (fp, "header-field"); - filter_input_set_value ((FilterInput*)el, "X-Priority"); - el = filter_part_find_element (fp, "header-type"); - filter_option_set_current ((FilterOption*)el, "contains"); - el = filter_part_find_element (fp, "word"); - filter_input_set_value ((FilterInput*)el, - ns_filter_action_value_types[priority]); - - fp = filter_context_create_action (fc, "score"); - el = filter_part_find_element (fp, "score"); - - switch (priority) { - case LOWEST: - v = -2; - break; - case LOW: - v = -1; - break; - case NORMAL: - v = 0; - break; - case HIGH: - v = 1; - break; - case HIGHEST: - v = 2; - break; - default: - g_object_unref((ff)); - return NULL; - } - - filter_int_set_value((FilterInt *)el, v); - filter_filter_add_action (ff, fp); - - return FILTER_RULE(ff); -} - - -static void -netscape_add_priority_workaround_filters (FilterContext *fc) -{ - FilterRule *fr; - - fr = netscape_create_priority_converter (fc, LOWEST); - rule_context_add_rule (RULE_CONTEXT(fc), FILTER_RULE(fr)); - rule_context_rank_rule (RULE_CONTEXT(fc), FILTER_RULE(fr), FILTER_SOURCE_INCOMING, 0); - - fr = netscape_create_priority_converter (fc, LOW); - rule_context_add_rule (RULE_CONTEXT(fc), FILTER_RULE(fr)); - rule_context_rank_rule (RULE_CONTEXT(fc), FILTER_RULE(fr), FILTER_SOURCE_INCOMING, 1); - - fr = netscape_create_priority_converter (fc, HIGH); - rule_context_add_rule (RULE_CONTEXT(fc), FILTER_RULE(fr)); - rule_context_rank_rule (RULE_CONTEXT(fc), FILTER_RULE(fr), FILTER_SOURCE_INCOMING, 2); - - fr = netscape_create_priority_converter (fc, HIGHEST); - rule_context_add_rule (RULE_CONTEXT(fc), FILTER_RULE(fr)); - rule_context_rank_rule (RULE_CONTEXT(fc), FILTER_RULE(fr), FILTER_SOURCE_INCOMING, 3); -} - - -static gboolean -netscape_filter_score_set (NsFilterCondition *cond, FilterInt *el) -{ - int v; - - switch (cond->prop_val_id) { - case LOWEST: - v = -2; - break; - case LOW: - v = -1; - break; - case NORMAL: - v = 0; - break; - case HIGH: - v = 1; - break; - case HIGHEST: - v = 2; - break; - default: - return FALSE; - } - - filter_int_set_value(el, v); - - return TRUE; -} - - -static FilterFilter * -netscape_filter_to_evol_filter (FilterContext *fc, NsFilter *nsf, gboolean *priority_needed) -{ - RuleContext *rc = RULE_CONTEXT(fc); - FilterFilter *ff = NULL; - FilterPart *fp; - FilterRule *fr; - FilterElement *el; - GList *l; - gboolean part_added = FALSE, action_added = FALSE; - - - ff = filter_filter_new (); - fr = FILTER_RULE(ff); - - filter_rule_set_name (fr, nsf->name); - filter_rule_set_source (fr, FILTER_SOURCE_INCOMING); - fr->grouping = nsf->grouping; - - - /* build and add partset */ - - for (l = nsf->conditions; l; l = l->next) { - - NsFilterCondition *cond = (NsFilterCondition*) l->data; - - fp = NULL; - - switch (cond->type) { - case FROM: - fp = rule_context_create_part (rc, "sender"); - filter_rule_add_part (fr, fp); - el = filter_part_find_element (fp, "sender-type"); - - if (!netscape_filter_set_opt_for_cond (cond, (FilterOption*)el)) { - filter_rule_remove_part (fr, fp); - g_object_unref((fp)); - continue; - } - - el = filter_part_find_element (fp, "sender"); - filter_input_set_value ((FilterInput *)el, cond->prop_val_str); - part_added = TRUE; - break; - - case SUBJECT: - fp = rule_context_create_part (rc, "subject"); - filter_rule_add_part (fr, fp); - el = filter_part_find_element (fp, "subject-type"); - - if (!netscape_filter_set_opt_for_cond (cond, (FilterOption*)el)) { - filter_rule_remove_part (fr, fp); - g_object_unref((fp)); - continue; - } - - el = filter_part_find_element (fp, "subject"); - filter_input_set_value ((FilterInput *)el, cond->prop_val_str); - part_added = TRUE; - break; - case TO: - case CC: - case TO_OR_CC: - fp = rule_context_create_part (rc, "to"); - filter_rule_add_part (fr, fp); - el = filter_part_find_element (fp, "recipient-type"); - - if (!netscape_filter_set_opt_for_cond (cond, (FilterOption*)el)) { - filter_rule_remove_part (fr, fp); - g_object_unref((fp)); - continue; - } - - el = filter_part_find_element (fp, "recipient"); - filter_input_set_value ((FilterInput *)el, cond->prop_val_str); - part_added = TRUE; - break; - case BODY: - fp = rule_context_create_part (rc, "body"); - filter_rule_add_part (fr, fp); - el = filter_part_find_element (fp, "body-type"); - - switch (cond->prop) { - case CONTAINS: - filter_option_set_current ((FilterOption*)el, "contains"); - break; - case CONTAINS_NOT: - filter_option_set_current ((FilterOption*)el, "not contains"); - break; - case IS: - netscape_filter_body_is_not_supported (); - filter_option_set_current ((FilterOption*)el, "contains"); - break; - case IS_NOT: - netscape_filter_body_is_not_supported (); - filter_option_set_current ((FilterOption*)el, "not contains"); - break; - default: - g_warning("Body rule dropped"); - filter_rule_remove_part (fr, fp); - g_object_unref((fp)); - continue; - } - - el = filter_part_find_element (fp, "word"); - filter_input_set_value ((FilterInput *)el, cond->prop_val_str); - part_added = TRUE; - break; - case DATE: - fp = rule_context_create_part (rc, "sent-date"); - filter_rule_add_part (fr, fp); - el = filter_part_find_element (fp, "date-spec-type"); - - switch (cond->prop) { - case IS: - filter_option_set_current ((FilterOption*)el, "is"); - break; - case IS_NOT: - filter_option_set_current ((FilterOption*)el, "is-not"); - break; - case IS_BEFORE: - filter_option_set_current ((FilterOption*)el, "before"); - break; - case IS_AFTER: - filter_option_set_current ((FilterOption*)el, "after"); - break; - default: - filter_rule_remove_part (fr, fp); - g_object_unref((fp)); - continue; - } - - el = filter_part_find_element (fp, "versus"); - filter_input_set_value ((FilterInput *)el, cond->prop_val_str); - part_added = TRUE; - break; - case PRIORITY: - switch (cond->prop) { - case IS: - *priority_needed = TRUE; - fp = rule_context_create_part (rc, "score"); - filter_rule_add_part (fr, fp); - el = filter_part_find_element (fp, "score-type"); - filter_option_set_current ((FilterOption*)el, "is"); - el = filter_part_find_element (fp, "versus"); - - if (!netscape_filter_score_set(cond, (FilterInt*)el)) { - filter_rule_remove_part (fr, fp); - g_object_unref((fp)); - continue; - } - - break; - case IS_NOT: - *priority_needed = TRUE; - fp = rule_context_create_part (rc, "score"); - filter_rule_add_part (fr, fp); - el = filter_part_find_element (fp, "score-type"); - filter_option_set_current ((FilterOption*)el, "is-not"); - el = filter_part_find_element (fp, "versus"); - - if (!netscape_filter_score_set(cond, (FilterInt*)el)) { - filter_rule_remove_part (fr, fp); - g_object_unref((fp)); - continue; - } - - break; - case IS_HIGHER_THAN: - *priority_needed = TRUE; - fp = rule_context_create_part (rc, "score"); - filter_rule_add_part (fr, fp); - el = filter_part_find_element (fp, "score-type"); - filter_option_set_current ((FilterOption*)el, "greater-than"); - el = filter_part_find_element (fp, "versus"); - - if (!netscape_filter_score_set(cond, (FilterInt*)el)) { - filter_rule_remove_part (fr, fp); - g_object_unref((fp)); - continue; - } - - break; - case IS_LOWER_THAN: - *priority_needed = TRUE; - fp = rule_context_create_part (rc, "score"); - filter_rule_add_part (fr, fp); - el = filter_part_find_element (fp, "score-type"); - filter_option_set_current ((FilterOption*)el, "less-than"); - el = filter_part_find_element (fp, "versus"); - - if (!netscape_filter_score_set(cond, (FilterInt*)el)) { - filter_rule_remove_part (fr, fp); - g_object_unref((fp)); - continue; - } - break; - default: - filter_rule_remove_part (fr, fp); - g_object_unref((fp)); - continue; - } - part_added = TRUE; - break; - - case STATUS: - fp = rule_context_create_part (rc, "status"); - filter_rule_add_part (fr, fp); - el = filter_part_find_element (fp, "match-type"); - - switch (cond->prop) { - case IS: - filter_option_set_current ((FilterOption*)el, "is"); - el = filter_part_find_element (fp, "flag"); - - if (!strcmp (cond->prop_val_str, - ns_filter_condition_property_types[READ])) { - filter_option_set_current ((FilterOption*)el, "Seen"); - } else if (!strcmp (cond->prop_val_str, - ns_filter_condition_property_types[REPLIED])) { - filter_option_set_current ((FilterOption*)el, "Answered"); - } - break; - case IS_NOT: - filter_option_set_current ((FilterOption*)el, "is not"); - el = filter_part_find_element (fp, "flag"); - - if (!strcmp (cond->prop_val_str, - ns_filter_condition_property_types[READ])) { - filter_option_set_current ((FilterOption*)el, "Seen"); - } else if (!strcmp (cond->prop_val_str, - ns_filter_condition_property_types[REPLIED])) { - filter_option_set_current ((FilterOption*)el, "Answered"); - } - default: - filter_rule_remove_part (fr, fp); - g_object_unref((fp)); - continue; - } - part_added = TRUE; - break; - case AGE_IN_DAYS: - /* I guess we can skip that -- Netscape crashes anyway - whenever you try to use that setting ... :) */ - break; - case X_MSG_HEADER: - fp = rule_context_create_part (rc, "header"); - filter_rule_add_part (fr, fp); - el = filter_part_find_element (fp, "header-field"); - filter_input_set_value ((FilterInput *)el, cond->prop_val_str); - el = filter_part_find_element (fp, "header-type"); - filter_option_set_current ((FilterOption*)el, "exists"); - part_added = TRUE; - break; - default: - continue; - } - } - - if (!part_added) { - g_object_unref((ff)); - return NULL; - } - - /* build and add actionset */ - - switch (nsf->action) { - case MOVE_TO_FOLDER: - { - char *evol_folder; - char *evol_folder_uri; - - fp = filter_context_create_action (fc, "move-to-folder"); - filter_filter_add_action (ff, fp); - el = filter_part_find_element (fp, "folder"); - - evol_folder = netscape_filter_strip_sbd (nsf->action_val_str); - evol_folder_uri = netscape_filter_map_folder_to_uri (evol_folder); - filter_folder_set_value ((FilterFolder *)el, evol_folder_uri); - g_free (evol_folder); - g_free (evol_folder_uri); - - action_added = TRUE; - } - break; - case CHANGE_PRIORITY: - fp = filter_context_create_action (fc, "score"); - el = filter_part_find_element (fp, "score"); - - switch (nsf->action_val_id) { - case LOWEST: - filter_int_set_value((FilterInt *)el, -2); - action_added = TRUE; - break; - case LOW: - filter_int_set_value((FilterInt *)el, -1); - action_added = TRUE; - break; - case NORMAL: - filter_int_set_value((FilterInt *)el, 0); - action_added = TRUE; - break; - case HIGH: - filter_int_set_value((FilterInt *)el, 1); - action_added = TRUE; - break; - case HIGHEST: - filter_int_set_value((FilterInt *)el, 2); - action_added = TRUE; - break; - default: - g_object_unref((fp)); - } - if (action_added) { - *priority_needed = TRUE; - filter_filter_add_action (ff, fp); - } - break; - case DELETE: - fp = filter_context_create_action (fc, "delete"); - filter_filter_add_action (ff, fp); - action_added = TRUE; - break; - case MARK_READ: - fp = filter_context_create_action (fc, "set-status"); - el = filter_part_find_element (fp, "flag"); - filter_option_set_current ((FilterOption *)el, "Seen"); - filter_filter_add_action (ff, fp); - action_added = TRUE; - break; - case IGNORE_THREAD: - case WATCH_THREAD: - netscape_filter_threads_action_not_supported (); - break; - default: - break; - } - - if (!action_added) { - g_object_unref((ff)); - return NULL; - } - - return ff; -} - - -static void -netscape_import_filters (NsImporter *importer) -{ - FilterContext *fc; - char *user, *system; - FILE *mailrule_handle; - char *ns_mailrule; - NsFilter *nsf; - FilterFilter *ff; - gboolean priority_needed = FALSE; - - ns_mailrule = gnome_util_prepend_user_home (".netscape/mailrule"); - mailrule_handle = fopen (ns_mailrule, "r"); - g_free (ns_mailrule); - - if (mailrule_handle == NULL) { - d(g_warning ("No .netscape/mailrule found.")); - user_prefs = NULL; - return; - } - - fc = filter_context_new (); - user = g_concat_dir_and_file (g_get_home_dir (), - "evolution/filters.xml"); - system = EVOLUTION_PRIVDATADIR "/filtertypes.xml"; - - if (rule_context_load ((RuleContext *)fc, system, user) < 0) { - g_warning ("Could not load rule context."); - goto exit; - } - - while ( (nsf = netscape_filter_read_next (mailrule_handle)) != NULL) { - - if ( (ff = netscape_filter_to_evol_filter (fc, nsf, &priority_needed)) != NULL) - rule_context_add_rule (RULE_CONTEXT(fc), FILTER_RULE(ff)); - netscape_filter_cleanup (nsf); - } - - if (priority_needed) { - netscape_filter_change_priority_warning (); - netscape_add_priority_workaround_filters (fc); - } - - if (rule_context_save(RULE_CONTEXT(fc), user) < 0) { - g_warning ("Could not save user's rule context."); - } - - exit: - g_free(user); - g_object_unref((fc)); - -} - - - - -/* Email folder & accounts stuff ----------------------------------------------- */ - - -static GtkWidget * -create_importer_gui (NsImporter *importer) -{ - GtkWidget *dialog; - - dialog = gnome_message_box_new (_("Evolution is importing your old Netscape data"), GNOME_MESSAGE_BOX_INFO, NULL); - gtk_window_set_title (GTK_WINDOW (dialog), _("Importing...")); - - importer->label = gtk_label_new (_("Please wait")); - importer->progressbar = gtk_progress_bar_new (); - gtk_progress_set_activity_mode (GTK_PROGRESS (importer->progressbar), TRUE); - gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (dialog)->vbox), - importer->label, FALSE, FALSE, 0); - gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (dialog)->vbox), - importer->progressbar, FALSE, FALSE, 0); - - return dialog; -} - -static void -netscape_store_settings (NsImporter *importer) -{ - GConfClient *gconf = gconf_client_get_default(); - - gconf_client_set_bool(gconf, "/apps/evolution/importer/netscape/mail", importer->do_mail, NULL); - gconf_client_set_bool(gconf, "/apps/evolution/importer/netscape/settings", importer->do_settings, NULL); - gconf_client_set_bool(gconf, "/apps/evolution/importer/netscape/filters", importer->do_filters, NULL); -} - -static void -netscape_restore_settings (NsImporter *importer) -{ - GConfClient *gconf = gconf_client_get_default(); - - importer->do_mail = gconf_client_get_bool(gconf, "/apps/evolution/importer/netscape/mail", NULL); - importer->do_settings = gconf_client_get_bool(gconf, "/apps/evolution/importer/netscape/settings", NULL); - importer->do_filters = gconf_client_get_bool(gconf, "/apps/evolution/importer/netscape/filters", NULL); -} - -static const char * -netscape_get_string (const char *strname) -{ - return g_hash_table_lookup (user_prefs, strname); -} - -static int -netscape_get_integer (const char *strname) -{ - char *intstr; - - intstr = g_hash_table_lookup (user_prefs, strname); - if (intstr == NULL) { - return 0; - } else { - return atoi (intstr); - } -} - -static gboolean -netscape_get_boolean (const char *strname) -{ - char *boolstr; - - boolstr = g_hash_table_lookup (user_prefs, strname); - - if (boolstr == NULL) { - return FALSE; - } else { - if (strcasecmp (boolstr, "false") == 0) { - return FALSE; - } else if (strcasecmp (boolstr, "true") == 0) { - return TRUE; - } - } - - return FALSE; -} - -static char * -netscape_get_key (const char *line) -{ - char *line_dup; - char *start, *end; - char *key; - - line_dup = g_strdup (line); - start = strchr (line_dup, '\"'); - if (start == NULL) - goto die; - start++; - if (*start == '\0') - goto die; - - end = strchr (start, '\"'); - if (end == NULL) - goto die; - *end = '\0'; - - key = g_strdup (start); - g_free (line_dup); - - d(g_warning ("Found key: %s", key)); - return key; - - die: - g_free (line_dup); - g_warning ("Broken line: %s", line); - return NULL; -} - -static char * -netscape_get_value (const char *line) -{ - char *line_dup; - char *start, *end; - char *value; - - line_dup = g_strdup (line); - start = strchr (line_dup, ','); - if (start == NULL) - goto die; - start++; - if (*start == '\0') - goto die; - - if (*start == ' ') - start++; - if (*start == '\0') - goto die; - - if (*start == '\"') - start++; - if (*start == '\0') - goto die; - - /* Start should now be the start of the value */ - end = strrchr (start, ')'); - if (end == NULL) - goto die; - *end = '\0'; - if (*(end - 1) == '\"') - *(end - 1) = '\0'; - - if (start == (end - 1)) { - g_free (line_dup); - return NULL; - } - - value = g_strdup (start); - g_free (line_dup); - - d(g_warning ("Found value: %s", value)); - return value; - - die: - g_free (line_dup); - g_warning ("Broken line: %s", line); - return NULL; -} - -static void -netscape_init_prefs (void) -{ - FILE *prefs_handle; - char *nsprefs; - char line[MAXLEN]; - - user_prefs = g_hash_table_new (g_str_hash, g_str_equal); - - nsprefs = gnome_util_prepend_user_home (".netscape/preferences.js"); - prefs_handle = fopen (nsprefs, "r"); - g_free (nsprefs); - - if (prefs_handle == NULL) { - d(g_warning ("No .netscape/preferences.js")); - g_hash_table_destroy (user_prefs); - user_prefs = NULL; - return; - } - - /* Find the user mail dir */ - while (fgets (line, MAXLEN, prefs_handle)) { - char *key, *value; - - if (*line == 0) { - continue; - } - - if (*line == '/' && line[1] == '/') { - continue; - } - - key = netscape_get_key (line); - value = netscape_get_value (line); - - if (key == NULL) - continue; - - g_hash_table_insert (user_prefs, key, value); - } - - return; -} - -static char * -get_user_fullname (void) -{ - char *uname, *gecos, *special; - struct passwd *pwd; - - uname = getenv ("USER"); - pwd = getpwnam (uname); - - if (strcmp (pwd->pw_gecos, "") == 0) { - return g_strdup (uname); - } - - special = strchr (pwd->pw_gecos, ','); - if (special == NULL) { - gecos = g_strdup (pwd->pw_gecos); - } else { - gecos = g_strndup (pwd->pw_gecos, special - pwd->pw_gecos); - } - - special = strchr (gecos, '&'); - if (special == NULL) { - return gecos; - } else { - char *capname, *expanded, *noamp; - - capname = g_strdup (uname); - capname[0] = toupper ((int) capname[0]); - noamp = g_strndup (gecos, special - gecos - 1); - expanded = g_strconcat (noamp, capname, NULL); - - g_free (noamp); - g_free (capname); - g_free (gecos); - - return expanded; - } -} - -static void -netscape_import_accounts (NsImporter *importer) -{ - char *username; - const char *nstr; - const char *imap; - GNOME_Evolution_MailConfig_Account account; - GNOME_Evolution_MailConfig_Service source, transport; - GNOME_Evolution_MailConfig_Identity id; - CORBA_Object objref; - CORBA_Environment ev; - - if (user_prefs == NULL) { - netscape_init_prefs (); - if (user_prefs == NULL) - return; - } - - CORBA_exception_init (&ev); - objref = bonobo_activation_activate_from_id (MAIL_CONFIG_IID, 0, NULL, &ev); - if (ev._major != CORBA_NO_EXCEPTION) { - g_warning ("Error starting mail config"); - CORBA_exception_free (&ev); - return; - } - - if (objref == CORBA_OBJECT_NIL) { - g_warning ("Error activating mail config"); - return; - } - - /* Create identify structure */ - nstr = netscape_get_string ("mail.identity.username"); - if (nstr != NULL) { - username = g_strdup (nstr); - } else { - username = get_user_fullname (); - } - - id.name = CORBA_string_dup (username); - nstr = netscape_get_string ("mail.identity.useremail"); - id.address = CORBA_string_dup (nstr ? nstr : ""); - nstr = netscape_get_string ("mail.identity.organization"); - id.organization = CORBA_string_dup (nstr ? nstr : ""); - nstr = netscape_get_string ("mail.signature_file"); - /* FIXME rodo id.signature = CORBA_string_dup (nstr ? nstr : ""); - id.html_signature = CORBA_string_dup (""); - id.has_html_signature = FALSE; */ - - /* Create transport */ - nstr = netscape_get_string ("network.hosts.smtp_server"); - if (nstr != NULL) { - char *url; - const char *nstr2; - - nstr2 = netscape_get_string ("mail.smtp_name"); - if (nstr2) { - url = g_strconcat ("smtp://", nstr2, "@", nstr, NULL); - } else { - url = g_strconcat ("smtp://", nstr, NULL); - } - transport.url = CORBA_string_dup (url); - transport.keep_on_server = FALSE; - transport.auto_check = FALSE; - transport.auto_check_time = 10; - transport.save_passwd = FALSE; - transport.enabled = TRUE; - g_free (url); - } else { - transport.url = CORBA_string_dup (""); - transport.keep_on_server = FALSE; - transport.auto_check = FALSE; - transport.auto_check_time = 0; - transport.save_passwd = FALSE; - transport.enabled = FALSE; - } - - /* Create account */ - account.name = CORBA_string_dup (username); - account.id = id; - account.transport = transport; - - account.drafts_folder_uri = CORBA_string_dup (""); - account.sent_folder_uri = CORBA_string_dup (""); - - /* Create POP3 source */ - nstr = netscape_get_string ("network.hosts.pop_server"); - if (nstr != NULL && *nstr != 0) { - char *url; - gboolean bool; - const char *nstr2; - - nstr2 = netscape_get_string ("mail.pop_name"); - if (nstr2) { - url = g_strconcat ("pop://", nstr2, "@", nstr, NULL); - } else { - url = g_strconcat ("pop://", nstr, NULL); - } - source.url = CORBA_string_dup (url); - bool = netscape_get_boolean ("mail.leave_on_server"); - g_warning ("mail.leave_on_server: %s", bool ? "true" : "false"); - source.keep_on_server = netscape_get_boolean ("mail.leave_on_server"); - source.auto_check = TRUE; - source.auto_check_time = 10; - bool = netscape_get_boolean ("mail.remember_password"); - g_warning ("mail.remember_password: %s", bool ? "true" : "false"); - source.save_passwd = netscape_get_boolean ("mail.remember_password"); - source.enabled = TRUE; - g_free (url); - } else { - /* Are there IMAP accounts? */ - imap = netscape_get_string ("network.hosts.imap_servers"); - if (imap != NULL) { - char **servers; - int i; - - servers = g_strsplit (imap, ",", 1024); - for (i = 0; servers[i] != NULL; i++) { - GNOME_Evolution_MailConfig_Service imapsource; - char *serverstr, *name, *url; - const char *username; - - /* Create a server for each of these */ - serverstr = g_strdup_printf ("mail.imap.server.%s.", servers[i]); - name = g_strconcat (serverstr, "userName", NULL); - username = netscape_get_string (name); - g_free (name); - - if (username) - url = g_strconcat ("imap://", username, - "@", servers[i], NULL); - else - url = g_strconcat ("imap://", servers[i], NULL); - - imapsource.url = CORBA_string_dup (url); - - imapsource.keep_on_server = netscape_get_boolean ("mail.leave_on_server"); - - name = g_strconcat (serverstr, "check_new_mail", NULL); - imapsource.auto_check = netscape_get_boolean (name); - g_free (name); - - name = g_strconcat (serverstr, "check_time", NULL); - imapsource.auto_check_time = netscape_get_integer (name); - g_free (name); - - name = g_strconcat (serverstr, "remember_password", NULL); - imapsource.save_passwd = netscape_get_boolean (name); - g_free (name); - imapsource.enabled = TRUE; - - account.source = imapsource; - - GNOME_Evolution_MailConfig_addAccount (objref, &account, &ev); - if (ev._major != CORBA_NO_EXCEPTION) { - g_warning ("Error setting account: %s", CORBA_exception_id (&ev)); - CORBA_exception_free (&ev); - return; - } - - g_free (url); - g_free (serverstr); - } - - CORBA_exception_free (&ev); - g_strfreev (servers); - return; - } else { - char *url, *path; - - /* Using Movemail */ - path = getenv ("MAIL"); - url = g_strconcat ("mbox://", path, NULL); - source.url = CORBA_string_dup (url); - g_free (url); - - source.keep_on_server = netscape_get_boolean ("mail.leave_on_server"); - source.auto_check = TRUE; - source.auto_check_time = 10; - source.save_passwd = netscape_get_boolean ("mail.remember_password"); - source.enabled = FALSE; - } - } - account.source = source; - - GNOME_Evolution_MailConfig_addAccount (objref, &account, &ev); - if (ev._major != CORBA_NO_EXCEPTION) { - g_warning ("Error setting account: %s", CORBA_exception_id (&ev)); - CORBA_exception_free (&ev); - return; - } - - g_free (username); - CORBA_exception_free (&ev); -} - -static gboolean -is_dir_empty (const char *path) -{ - DIR *base; - struct stat buf; - struct dirent *contents; - - base = opendir (path); - if (base == NULL) { - return TRUE; /* Can't open dir */ - } - - while ((contents = readdir(base)) != NULL) { - char *fullpath; - - if (strcmp (contents->d_name, ".") == 0 || - strcmp (contents->d_name, "..") == 0) { - continue; - } - - fullpath = g_build_filename(path, contents->d_name, NULL); - if (lstat (fullpath, &buf) == -1) { - g_free(fullpath); - continue; - } - - if ((S_ISDIR (buf.st_mode) && !is_dir_empty (fullpath)) - || (S_ISREG(buf.st_mode) && buf.st_size != 0)) { - g_free (fullpath); - closedir (base); - return FALSE; - } - - g_free (fullpath); - } - - closedir (base); - return TRUE; -} - -static gboolean -netscape_can_import (EvolutionIntelligentImporter *ii, - void *closure) -{ - if (user_prefs == NULL) { - netscape_init_prefs (); - } - - if (user_prefs == NULL) { - d(g_warning ("No netscape dir")); - return FALSE; - } - - nsmail_dir = g_hash_table_lookup (user_prefs, "mail.directory"); - if (nsmail_dir == NULL) { - return FALSE; - } else { - return !is_dir_empty (nsmail_dir); - } -} - -static void -importer_cb (EvolutionImporterListener *listener, - EvolutionImporterResult result, - gboolean more_items, - void *data) -{ - NsImporter *importer = (NsImporter *) data; - - importer->result = result; - importer->more = more_items; -} - -static gboolean -netscape_import_file (NsImporter *importer, - const char *path, - const char *folderpath) -{ - CORBA_boolean result; - CORBA_Environment ev; - CORBA_Object objref; - char *str, *uri; - - /* Do import of mail folder */ - d(g_warning ("Importing %s as %s", path, folderpath)); - - CORBA_exception_init (&ev); - - str = g_strdup_printf (_("Importing %s as %s"), path, folderpath); - gtk_label_set_text (GTK_LABEL (importer->label), str); - g_free (str); - while (g_main_context_iteration(NULL, FALSE)) - ; - - uri = mail_importer_make_local_folder(folderpath); - if (!uri) - return FALSE; - - result = GNOME_Evolution_Importer_loadFile (importer->importer, path, uri, "", &ev); - g_free(uri); - if (ev._major != CORBA_NO_EXCEPTION || result == FALSE) { - g_warning ("Exception here: %s", CORBA_exception_id (&ev)); - CORBA_exception_free (&ev); - return FALSE; - } - - /* process all items in a direct loop */ - importer->listener = evolution_importer_listener_new (importer_cb, importer); - objref = bonobo_object_corba_objref (BONOBO_OBJECT (importer->listener)); - do { - importer->progress_count++; - if ((importer->progress_count & 0xf) == 0) - gtk_progress_bar_pulse(GTK_PROGRESS_BAR(importer->progressbar)); - - importer->result = -1; - GNOME_Evolution_Importer_processItem (importer->importer, objref, &ev); - if (ev._major != CORBA_NO_EXCEPTION) { - g_warning ("Exception: %s", CORBA_exception_id (&ev)); - break; - } - - while (importer->result == -1 || g_main_context_pending(NULL)) - g_main_context_iteration(NULL, TRUE); - } while (importer->more); - bonobo_object_unref((BonoboObject *)importer->listener); - CORBA_exception_free (&ev); - - return FALSE; -} - -typedef struct { - NsImporter *importer; - char *parent; - char *path; - char *foldername; -} NetscapeCreateDirectoryData; - -static void -import_next (NsImporter *importer) -{ - NetscapeCreateDirectoryData *data; - -trynext: - if (importer->dir_list) { - char *folder; - GList *l; - int ok; - - l = importer->dir_list; - data = l->data; - - folder = g_build_filename(data->parent, data->foldername, NULL); - - importer->dir_list = l->next; - g_list_free_1(l); - - ok = netscape_import_file (importer, data->path, folder); - g_free (folder); - g_free (data->parent); - g_free (data->path); - g_free (data->foldername); - g_free (data); - if (!ok) - goto trynext; - } else { - bonobo_object_unref((BonoboObject *)importer->ii); - } -} - -/* We don't allow any mail to be imported into a reservered Evolution folder name */ -static char *reserved_names[] = { - N_("Trash"), - N_("Calendar"), - N_("Contacts"), - N_("Tasks"), - NULL -}; - -static char * -fix_netscape_folder_names (const char *original_name) -{ - int i; - - for (i = 0; reserved_names[i] != NULL; i++) { - if (strcmp (original_name, _(reserved_names[i])) == 0) { - return g_strdup_printf ("Netscape-%s", - _(reserved_names[i])); - } - } - - if (strcmp (original_name, "Unsent Messages") == 0) { - return g_strdup ("Outbox"); - } - - return g_strdup (original_name); -} - -/* This function basically flattens the tree structure. - It makes a list of all the directories that are to be imported. */ -static void -scan_dir (NsImporter *importer, - const char *orig_parent, - const char *dirname) -{ - DIR *nsmail; - struct stat buf; - struct dirent *current; - char *str; - - nsmail = opendir (dirname); - if (nsmail == NULL) { - d(g_warning ("Could not open %s\nopendir returned: %s", - dirname, g_strerror (errno))); - return; - } - - str = g_strdup_printf (_("Scanning %s"), dirname); - gtk_label_set_text (GTK_LABEL (importer->label), str); - g_free (str); - - while (gtk_events_pending ()) { - gtk_main_iteration (); - } - - current = readdir (nsmail); - while (current) { - char *fullname, *foldername; - - /* Ignore things which start with . - which should be ., .., and the summaries. */ - if (current->d_name[0] =='.') { - current = readdir (nsmail); - continue; - } - - if (*orig_parent == '/') { - foldername = fix_netscape_folder_names (current->d_name); - } else { - foldername = g_strdup (current->d_name); - } - - fullname = g_concat_dir_and_file (dirname, current->d_name); - if (stat (fullname, &buf) == -1) { - d(g_warning ("Could not stat %s\nstat returned:%s", - fullname, g_strerror (errno))); - current = readdir (nsmail); - g_free (fullname); - continue; - } - - if (S_ISREG (buf.st_mode)) { - char *sbd, *parent; - NetscapeCreateDirectoryData *data; - - d(g_print ("File: %s\n", fullname)); - - data = g_new0 (NetscapeCreateDirectoryData, 1); - data->importer = importer; - data->parent = g_strdup (orig_parent); - data->path = g_strdup (fullname); - data->foldername = g_strdup (foldername); - - importer->dir_list = g_list_append (importer->dir_list, - data); - - - parent = g_concat_dir_and_file (orig_parent, - data->foldername); - - /* Check if a .sbd folder exists */ - sbd = g_strconcat (fullname, ".sbd", NULL); - if (g_file_exists (sbd)) { - scan_dir (importer, parent, sbd); - } - - g_free (parent); - g_free (sbd); - } - - g_free (fullname); - g_free (foldername); - current = readdir (nsmail); - } -} - - -static void -netscape_create_structure (EvolutionIntelligentImporter *ii, - void *closure) -{ - NsImporter *importer = closure; - GConfClient *gconf = gconf_client_get_default(); - - g_return_if_fail (nsmail_dir != NULL); - - /* Reference our object so when the shell release_unrefs us - we will still exist and not go byebye */ - bonobo_object_ref (BONOBO_OBJECT (ii)); - - netscape_store_settings (importer); - - /* Create a dialog if we're going to be active */ - /* Importing mail filters is not a criterion because it makes - little sense to import the filters but not the mail folders. */ - if (importer->do_settings == TRUE || - importer->do_mail == TRUE) { - importer->dialog = create_importer_gui (importer); - gtk_widget_show_all (importer->dialog); - while (gtk_events_pending ()) { - gtk_main_iteration (); - } - } - - if (importer->do_settings == TRUE) { - gconf_client_set_bool(gconf, "/apps/evolution/importer/netscape/settings-imported", TRUE, NULL); - netscape_import_accounts (importer); - } - - if (importer->do_mail == TRUE) { - - /* Import the mail filters if needed ... */ - if (importer->do_filters == TRUE) { - gconf_client_set_bool(gconf, "/apps/evolution/importer/netscape/filters-imported", TRUE, NULL); - gtk_label_set_text (GTK_LABEL (importer->label), - _("Scanning mail filters")); - - netscape_import_filters (importer); - } - - gconf_client_set_bool(gconf, "/apps/evolution/importer/netscape/mail-imported", TRUE, NULL); - - /* Scan the nsmail folder and find out what folders - need to be imported */ - - gtk_label_set_text (GTK_LABEL (importer->label), - _("Scanning directory")); - while (gtk_events_pending ()) { - gtk_main_iteration (); - } - - scan_dir (importer, "/", nsmail_dir); - - /* Import them */ - gtk_label_set_text (GTK_LABEL (importer->label), - _("Starting import")); - while (gtk_events_pending ()) { - gtk_main_iteration (); - } - import_next (importer); - } - - if (importer->do_mail == FALSE) { - /* Destroy it here if we weren't importing mail - otherwise the mail importer destroys itself - once the mail in imported */ - bonobo_object_unref (BONOBO_OBJECT (ii)); - } - - bonobo_object_unref (BONOBO_OBJECT (ii)); -} - -static void -netscape_destroy_cb (NsImporter *importer, GObject *object) -{ - netscape_store_settings (importer); - - if (importer->importer != CORBA_OBJECT_NIL) { - bonobo_object_release_unref (importer->importer, NULL); - } - - if (importer->dialog) - gtk_widget_destroy(importer->dialog); - - g_free(importer); -} - -/* Fun initialisation stuff */ - -/* Fun with aggregation */ -static void -checkbox_toggle_cb (GtkToggleButton *tb, - NsImporter *importer) -{ - /* Some extra logic here to make the filters choice - depending on the mail choice */ - if (GTK_WIDGET(tb) == importer->mail) { - importer->do_mail = gtk_toggle_button_get_active (tb); - - if (importer->do_mail == FALSE) { - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(importer->filters), FALSE); - gtk_widget_set_sensitive(GTK_WIDGET(importer->filters), FALSE); - importer->do_filters = FALSE; - } else { - gtk_widget_set_sensitive(GTK_WIDGET(importer->filters), TRUE); - } - - } else if (GTK_WIDGET(tb) == importer->settings) { - importer->do_settings = gtk_toggle_button_get_active (tb); - - } else if (GTK_WIDGET(tb) == importer->filters) { - importer->do_filters = gtk_toggle_button_get_active (tb); - - } - /* *do_item = gtk_toggle_button_get_active (tb); */ -} - -static BonoboControl * -create_checkboxes_control (NsImporter *importer) -{ - GtkWidget *hbox; - BonoboControl *control; - - hbox = gtk_hbox_new (FALSE, 2); - - importer->mail = gtk_check_button_new_with_label (_("Mail")); - g_signal_connect((importer->mail), "toggled", - G_CALLBACK (checkbox_toggle_cb), - importer); - - importer->settings = gtk_check_button_new_with_label (_("Settings")); - g_signal_connect((importer->settings), "toggled", - G_CALLBACK (checkbox_toggle_cb), - importer); - - importer->filters = gtk_check_button_new_with_label (_("Mail Filters")); - gtk_widget_set_sensitive(GTK_WIDGET(importer->filters), FALSE); - g_signal_connect((importer->filters), "toggled", - G_CALLBACK (checkbox_toggle_cb), - importer); - - gtk_box_pack_start (GTK_BOX (hbox), importer->mail, FALSE, FALSE, 0); - gtk_box_pack_start (GTK_BOX (hbox), importer->settings, FALSE, FALSE, 0); - gtk_box_pack_start (GTK_BOX (hbox), importer->filters, FALSE, FALSE, 0); - - gtk_widget_show_all (hbox); - control = bonobo_control_new (hbox); - return control; -} - -static BonoboObject * -factory_fn (BonoboGenericFactory *_factory, - const char *iid, - void *closure) -{ - EvolutionIntelligentImporter *importer; - BonoboControl *control; - NsImporter *netscape; - CORBA_Environment ev; - char *message = N_("Evolution has found Netscape mail files.\n" - "Would you like them to be imported into Evolution?"); - - netscape = g_new0 (NsImporter, 1); - - CORBA_exception_init (&ev); - - netscape_restore_settings (netscape); - - netscape->importer = bonobo_activation_activate_from_id (MBOX_IMPORTER_IID, 0, NULL, &ev); - if (ev._major != CORBA_NO_EXCEPTION) { - g_warning ("Could not start MBox importer\n%s", CORBA_exception_id (&ev)); - CORBA_exception_free (&ev); - return NULL; - } - CORBA_exception_free (&ev); - - importer = evolution_intelligent_importer_new (netscape_can_import, - netscape_create_structure, - "Netscape", - _(message), netscape); - g_object_weak_ref(G_OBJECT (importer), (GWeakNotify)netscape_destroy_cb, netscape); - netscape->ii = importer; - - control = create_checkboxes_control (netscape); - bonobo_object_add_interface (BONOBO_OBJECT (importer), - BONOBO_OBJECT (control)); - return BONOBO_OBJECT (importer); -} - -void -mail_importer_module_init (void) -{ - BonoboGenericFactory *factory; - static int init = FALSE; - - if (init) - return; - - factory = bonobo_generic_factory_new (FACTORY_IID, factory_fn, NULL); - if (factory == NULL) - g_warning("Could not initialise Netscape intelligent mail importer"); - init = 1; -} diff --git a/mail/importers/pine-importer.c b/mail/importers/pine-importer.c deleted file mode 100644 index 89cfcc2fdc..0000000000 --- a/mail/importers/pine-importer.c +++ /dev/null @@ -1,643 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* pine-importer.c - * - * Authors: - * Iain Holmes <iain@ximian.com> - * - * Copyright 2001 Ximian, Inc. (www.ximian.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public - * License as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA - */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <stdio.h> -#include <errno.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <unistd.h> -#include <dirent.h> -#include <ctype.h> -#include <string.h> - -#include <glib.h> - -#include <libgnomeui/gnome-messagebox.h> -#include <gtk/gtk.h> - -#include <gconf/gconf.h> -#include <gconf/gconf-client.h> - -#include <bonobo/bonobo-object.h> -#include <bonobo/bonobo-generic-factory.h> -#include <bonobo/bonobo-control.h> -#include <bonobo/bonobo-context.h> -#include <bonobo/bonobo-main.h> -#include <bonobo/bonobo-exception.h> -#include <bonobo/bonobo-moniker-util.h> - -#include <importer/evolution-intelligent-importer.h> -#include <importer/evolution-importer-client.h> -#include <importer/GNOME_Evolution_Importer.h> - -#include "mail/mail-importer.h" - -#include <ebook/e-book.h> -#include <ebook/e-card-simple.h> - -#define PINE_INTELLIGENT_IMPORTER_IID "OAFIID:GNOME_Evolution_Mail_Pine_Intelligent_Importer_Factory:" BASE_VERSION -#define MBOX_IMPORTER_IID "OAFIID:GNOME_Evolution_Mail_Mbox_Importer:" BASE_VERSION -#define KEY "pine-mail-imported" - -/*#define SUPER_IMPORTER_DEBUG*/ -#ifdef SUPER_IMPORTER_DEBUG -#define d(x) x -#else -#define d(x) -#endif - -typedef struct { - EvolutionIntelligentImporter *ii; - - GList *dir_list; - - int progress_count; - int more; - EvolutionImporterResult result; - - GNOME_Evolution_Importer importer; - EvolutionImporterListener *listener; - - GtkWidget *mail; - gboolean do_mail; - GtkWidget *address; - gboolean do_address; - - EBook *book; - - /* GUI */ - GtkWidget *dialog; - GtkWidget *label; - GtkWidget *progressbar; -} PineImporter; - -typedef struct { - char *parent; - char *foldername; - char *path; - gboolean folder; -} PineFolder; - -void mail_importer_module_init (void); - -static void import_next (PineImporter *importer); - -static GtkWidget * -create_importer_gui (PineImporter *importer) -{ - GtkWidget *dialog; - - dialog = gnome_message_box_new (_("Evolution is importing your old Pine data"), GNOME_MESSAGE_BOX_INFO, NULL); - gtk_window_set_title (GTK_WINDOW (dialog), _("Importing...")); - - importer->label = gtk_label_new (_("Please wait")); - importer->progressbar = gtk_progress_bar_new (); - gtk_progress_set_activity_mode (GTK_PROGRESS (importer->progressbar), TRUE); - gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (dialog)->vbox), - importer->label, FALSE, FALSE, 0); - gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (dialog)->vbox), - importer->progressbar, FALSE, FALSE, 0); - return dialog; -} - -static void -pine_store_settings (PineImporter *importer) -{ - GConfClient *gconf = gconf_client_get_default (); - - gconf_client_set_bool (gconf, "/apps/evolution/importer/pine/mail", importer->do_mail, NULL); - gconf_client_set_bool (gconf, "/apps/evolution/importer/pine/address", importer->do_address, NULL); -} - -static void -pine_restore_settings (PineImporter *importer) -{ - GConfClient *gconf = gconf_client_get_default (); - - importer->do_mail = gconf_client_get_bool (gconf, "/apps/evolution/importer/pine/mail", NULL); - importer->do_address = gconf_client_get_bool (gconf, "/apps/evolution/importer/pine/address", NULL); -} - -static void -add_card_cb (EBook *book, - EBookStatus status, - const char *id, - gpointer closure) -{ - g_object_unref (closure); -} - -static void -parse_line (EBook *book, - char *line) -{ - char **strings; - ECardName *name; - ECard *card; - EList *list; - - card = e_card_new (""); - strings = g_strsplit (line, "\t", 3); - if (strings[0] && strings[1] && strings[2]) { - name = e_card_name_from_string (strings[1]); - g_object_set (card, - "nickname", strings[0], - "full_name", strings[1], - "name", name, NULL); - g_object_get (card, - "email", &list, - NULL); - e_list_append (list, strings[2]); - g_strfreev (strings); - e_book_add_card (book, card, add_card_cb, card); - } -} - -static void -import_addressfile (EBook *book, - EBookStatus status, - gpointer user_data) -{ - char *addressbook; - FILE *handle; - char line[2 * 1024]; - int which = 0; - char *lastline = NULL; - PineImporter *importer = user_data; - - addressbook = g_build_filename(g_get_home_dir(), ".addressbook", NULL); - handle = fopen (addressbook, "r"); - g_free (addressbook); - - if (handle == NULL) { - g_warning ("Cannot open .addressbook"); - return; - } - - while (fgets (line + which * 1024, 1024, handle)) { - int length; - char *thisline = line + which * 1024; - - importer->progress_count++; - if ((importer->progress_count & 0xf) == 0) - gtk_progress_bar_pulse(GTK_PROGRESS_BAR(importer->progressbar)); - - length = strlen (thisline); - if (thisline[length - 1] == '\n') { - line[--length] = 0; - } - - if (lastline && *thisline && isspace ((int) *thisline)) { - char *temp; - - while (*thisline && isspace ((int) *thisline)) { - thisline++; - } - temp = lastline; - lastline = g_strdup_printf ("%s%s", lastline, thisline); - g_free (temp); - continue; - } - - if (lastline) { - parse_line (book, lastline); - g_free (lastline); - } - - lastline = g_strdup (thisline); - } - - if (lastline) { - parse_line (book, lastline); - g_free (lastline); - } - - fclose (handle); -} - -static void -import_addressbook (PineImporter *importer) -{ - char *path, *uri; - - importer->book = e_book_new (); - if (importer->book == NULL) { - g_warning ("Could not create EBook."); - return; - } - - path = g_build_filename(g_get_home_dir (), - "evolution/local/Contacts/addressbook.db", NULL); - uri = g_strdup_printf ("file://%s", path); - g_free (path); - - e_book_load_uri (importer->book, uri, import_addressfile, importer); - g_free (uri); -} - -static void -importer_cb (EvolutionImporterListener *listener, - EvolutionImporterResult result, - gboolean more_items, - void *data) -{ - PineImporter *importer = (PineImporter *) data; - - importer->result = result; - importer->more = more_items; -} - -static gboolean -pine_import_file (PineImporter *importer, - const char *path, - const char *folderpath, - gboolean folder) -{ - CORBA_boolean result; - CORBA_Environment ev; - CORBA_Object objref; - char *str, *uri; - struct stat st; - - CORBA_exception_init (&ev); - - str = g_strdup_printf (_("Importing %s as %s"), path, folderpath); - gtk_label_set_text (GTK_LABEL (importer->label), str); - g_free (str); - while (g_main_context_iteration(NULL, FALSE)) - ; - - uri = mail_importer_make_local_folder(folderpath); - if (!uri) - return FALSE; - - /* only create dirs, dont try to import them */ - if (lstat(path, &st) == 0 && S_ISDIR(st.st_mode)) { - g_free(uri); - /* this is ok, we return false to say we haven't launched an async task */ - return FALSE; - } - - result = GNOME_Evolution_Importer_loadFile (importer->importer, path, uri, "", &ev); - g_free(uri); - if (ev._major != CORBA_NO_EXCEPTION || result == FALSE) { - g_warning ("Exception here: %s\n%s, %s", CORBA_exception_id (&ev), path, folderpath); - CORBA_exception_free (&ev); - return FALSE; - } - - /* process all items in a direct loop */ - importer->listener = evolution_importer_listener_new (importer_cb, importer); - objref = bonobo_object_corba_objref (BONOBO_OBJECT (importer->listener)); - do { - importer->progress_count++; - if ((importer->progress_count & 0xf) == 0) - gtk_progress_bar_pulse(GTK_PROGRESS_BAR(importer->progressbar)); - - importer->result = -1; - GNOME_Evolution_Importer_processItem (importer->importer, objref, &ev); - if (ev._major != CORBA_NO_EXCEPTION) { - g_warning ("Exception: %s", CORBA_exception_id (&ev)); - break; - } - - while (importer->result == -1 || g_main_context_pending(NULL)) - g_main_context_iteration(NULL, TRUE); - } while (importer->more); - bonobo_object_unref((BonoboObject *)importer->listener); - - CORBA_exception_free (&ev); - - return FALSE; -} - -static gboolean -pine_can_import (EvolutionIntelligentImporter *ii, - void *closure) -{ - PineImporter *importer = closure; - char *maildir, *addrfile; - gboolean md_exists = FALSE, addr_exists = FALSE; - struct stat st; - - maildir = g_build_filename(g_get_home_dir(), "mail", NULL); - md_exists = lstat(maildir, &st) == 0 && S_ISDIR(st.st_mode); - importer->do_mail = md_exists; - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (importer->mail), - importer->do_mail); - - gtk_widget_set_sensitive (importer->mail, md_exists); - g_free (maildir); - - addrfile = g_build_filename(g_get_home_dir(), ".addressbook", NULL); - addr_exists = lstat(addrfile, &st) == 0 && S_ISREG(st.st_mode); - g_free (addrfile); - gtk_widget_set_sensitive (importer->address, addr_exists); - - return md_exists || addr_exists; -} - -static void -import_next (PineImporter *importer) -{ - PineFolder *data; - -trynext: - if (importer->dir_list) { - char *folder; - GList *l; - int ok; - - l = importer->dir_list; - data = l->data; - folder = g_build_filename(data->parent, data->foldername, NULL); - importer->dir_list = l->next; - g_list_free_1(l); - - ok = pine_import_file (importer, data->path, folder, data->folder); - - g_free (folder); - g_free (data->parent); - g_free (data->path); - g_free (data->foldername); - g_free (data); - if (!ok) - goto trynext; - } else { - bonobo_object_unref((BonoboObject *)importer->ii); - } -} - -/* Pine uses sent-mail and saved-mail whereas Evolution uses Sent and Drafts */ -static char * -maybe_replace_name (const char *original_name) -{ - if (strcmp (original_name, "sent-mail") == 0) { - return g_strdup ("Sent"); - } else if (strcmp (original_name, "saved-messages") == 0) { - return g_strdup ("Drafts"); - } - - return g_strdup (original_name); -} - -static void -scan_dir (PineImporter *importer, - const char *dirname, - const char *orig_parent) -{ - DIR *maildir; - struct stat buf; - struct dirent *current; - char *str; - - maildir = opendir (dirname); - if (maildir == NULL) { - g_warning ("Could not open %s\nopendir returned: %s", - dirname, g_strerror (errno)); - return; - } - - str = g_strdup_printf (_("Scanning %s"), dirname); - gtk_label_set_text (GTK_LABEL (importer->label), str); - g_free (str); - - while (gtk_events_pending ()) { - gtk_main_iteration (); - } - - current = readdir (maildir); - while (current) { - PineFolder *pf; - char *fullname, *foldername; - - /* Ignore . and .. */ - if (current->d_name[0] == '.') { - if (current->d_name[1] == '\0' || - (current->d_name[1] == '.' && current->d_name[2] == '\0')) { - current = readdir (maildir); - continue; - } - } - - if (*orig_parent == '/') { - foldername = maybe_replace_name (current->d_name); - } else { - foldername = g_strdup (current->d_name); - } - - fullname = g_build_filename(dirname, current->d_name, NULL); - if (stat (fullname, &buf) == -1) { - g_warning ("Could not stat %s\nstat returned: %s", - fullname, g_strerror (errno)); - current = readdir (maildir); - g_free (fullname); - continue; - } - - if (S_ISREG (buf.st_mode)) { - pf = g_new (PineFolder, 1); - pf->path = g_strdup (fullname); - pf->parent = g_strdup (orig_parent); - pf->foldername = g_strdup (foldername); - pf->folder = FALSE; - importer->dir_list = g_list_append (importer->dir_list, pf); - } else if (S_ISDIR (buf.st_mode)) { - char *subdir; - - pf = g_new (PineFolder, 1); - pf->path = g_strdup (fullname); - pf->parent = g_strdup (orig_parent); - pf->foldername = g_strdup (foldername); - pf->folder = TRUE; - importer->dir_list = g_list_append (importer->dir_list, pf); - - subdir = g_build_filename (orig_parent, foldername, NULL); - scan_dir (importer, fullname, subdir); - g_free (subdir); - } - - g_free (fullname); - g_free (foldername); - current = readdir (maildir); - } -} - -static void -pine_create_structure (EvolutionIntelligentImporter *ii, - void *closure) -{ - PineImporter *importer = closure; - char *maildir; - GConfClient *gconf = gconf_client_get_default (); - - bonobo_object_ref (BONOBO_OBJECT (ii)); - pine_store_settings (importer); - - /* Create a dialog */ - if (importer->do_address == TRUE || - importer->do_mail == TRUE) { - importer->dialog = create_importer_gui (importer); - gtk_widget_show_all (importer->dialog); - while (gtk_events_pending ()) { - gtk_main_iteration (); - } - } - - if (importer->do_address == TRUE) { - gconf_client_set_bool(gconf, "/apps/evolution/importer/pine/address-imported", TRUE, NULL); - import_addressbook (importer); - } - - if (importer->do_mail == TRUE) { - gconf_client_set_bool(gconf, "/apps/evolution/importer/pine/mail-imported", TRUE, NULL); - maildir = g_build_filename(g_get_home_dir(), "mail", NULL); - gtk_label_set_text (GTK_LABEL (importer->label), - _("Scanning directory")); - while (gtk_events_pending ()) { - gtk_main_iteration (); - } - - scan_dir (importer, maildir, "/"); - g_free (maildir); - - /* Import them */ - import_next (importer); - } - - if (importer->do_mail == FALSE && importer->do_address == FALSE) { - /* Destroy it here if we weren't importing mail - otherwise the mail importer destroys itself - once the mail is imported */ - bonobo_object_unref (BONOBO_OBJECT (ii)); - } - bonobo_object_unref (BONOBO_OBJECT (ii)); -} - -static void -pine_destroy_cb (PineImporter *importer, GtkObject *object) -{ - pine_store_settings (importer); - - if (importer->dialog) - gtk_widget_destroy(importer->dialog); - - if (importer->importer != CORBA_OBJECT_NIL) { - bonobo_object_release_unref (importer->importer, NULL); - } -} - -/* Fun inity stuff */ - -/* Fun control stuff */ -static void -checkbox_toggle_cb (GtkToggleButton *tb, - gboolean *do_item) -{ - *do_item = gtk_toggle_button_get_active (tb); -} - -static BonoboControl * -create_checkboxes_control (PineImporter *importer) -{ - GtkWidget *hbox; - BonoboControl *control; - - hbox = gtk_hbox_new (FALSE, 2); - - importer->mail = gtk_check_button_new_with_label (_("Mail")); - gtk_signal_connect (GTK_OBJECT (importer->mail), "toggled", - GTK_SIGNAL_FUNC (checkbox_toggle_cb), - &importer->do_mail); - - importer->address = gtk_check_button_new_with_label (_("Addressbook")); - gtk_signal_connect (GTK_OBJECT (importer->address), "toggled", - GTK_SIGNAL_FUNC (checkbox_toggle_cb), - &importer->do_address); - - gtk_box_pack_start (GTK_BOX (hbox), importer->mail, FALSE, FALSE, 0); - gtk_box_pack_start (GTK_BOX (hbox), importer->address, FALSE, FALSE, 0); - - gtk_widget_show_all (hbox); - control = bonobo_control_new (hbox); - return control; -} - -static BonoboObject * -factory_fn (BonoboGenericFactory *_factory, - const char *iid, - void *closure) -{ - EvolutionIntelligentImporter *importer; - BonoboControl *control; - PineImporter *pine; - CORBA_Environment ev; - char *message = N_("Evolution has found Pine mail files.\n" - "Would you like to import them into Evolution?"); - - pine = g_new0 (PineImporter, 1); - - CORBA_exception_init (&ev); - pine_restore_settings (pine); - - pine->importer = bonobo_activation_activate_from_id (MBOX_IMPORTER_IID, 0, NULL, &ev); - if (ev._major != CORBA_NO_EXCEPTION) { - g_warning ("Could not start MBox importer\n%s", - CORBA_exception_id (&ev)); - CORBA_exception_free (&ev); - return NULL; - } - CORBA_exception_free (&ev); - - importer = evolution_intelligent_importer_new (pine_can_import, - pine_create_structure, - _("Pine"), - _(message), pine); - g_object_weak_ref((GObject *)importer, (GWeakNotify)pine_destroy_cb, pine); - pine->ii = importer; - - control = create_checkboxes_control (pine); - bonobo_object_add_interface (BONOBO_OBJECT (importer), - BONOBO_OBJECT (control)); - return BONOBO_OBJECT (importer); -} - -void -mail_importer_module_init (void) -{ - BonoboGenericFactory *factory; - static int init = FALSE; - - if (init) - return; - - factory = bonobo_generic_factory_new (PINE_INTELLIGENT_IMPORTER_IID, - factory_fn, NULL); - if (factory == NULL) - g_warning ("Could not initialise Pine Intelligent Mail Importer."); - init = TRUE; -} diff --git a/mail/local-config.glade b/mail/local-config.glade deleted file mode 100644 index bc63ea7b47..0000000000 --- a/mail/local-config.glade +++ /dev/null @@ -1,325 +0,0 @@ -<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*--> -<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd"> - -<glade-interface> - -<widget class="GtkDialog" id="dialog_format"> - <property name="border_width">6</property> - <property name="visible">True</property> - <property name="title" translatable="yes"></property> - <property name="type">GTK_WINDOW_TOPLEVEL</property> - <property name="window_position">GTK_WIN_POS_NONE</property> - <property name="modal">False</property> - <property name="resizable">True</property> - <property name="destroy_with_parent">False</property> - <property name="has_separator">True</property> - - <child internal-child="vbox"> - <widget class="GtkVBox" id="dialog-vbox1"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">6</property> - - <child internal-child="action_area"> - <widget class="GtkHButtonBox" id="dialog-action_area1"> - <property name="visible">True</property> - <property name="layout_style">GTK_BUTTONBOX_END</property> - - <child> - <widget class="GtkButton" id="cancel_format"> - <property name="visible">True</property> - <property name="can_default">True</property> - <property name="can_focus">True</property> - <property name="label">gtk-cancel</property> - <property name="use_stock">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="response_id">-6</property> - </widget> - </child> - - <child> - <widget class="GtkButton" id="apply_format"> - <property name="visible">True</property> - <property name="can_default">True</property> - <property name="can_focus">True</property> - <property name="label">gtk-ok</property> - <property name="use_stock">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="response_id">-5</property> - </widget> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="pack_type">GTK_PACK_END</property> - </packing> - </child> - - <child> - <widget class="GtkHBox" id="hbox1"> - <property name="border_width">3</property> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">12</property> - - <child> - <widget class="GtkAlignment" id="alignment2"> - <property name="visible">True</property> - <property name="xalign">0.5</property> - <property name="yalign">0</property> - <property name="xscale">1</property> - <property name="yscale">0</property> - - <child> - <widget class="GtkImage" id="pixmap1"> - <property name="visible">True</property> - <property name="pixbuf">mail-config-druid.png</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label4"> - <property name="visible">True</property> - <property name="label" translatable="yes">Note: When converting between mailbox formats, a failure -(such as lack of disk space) may not be automatically -recoverable. Please use this feature with care.</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkHSeparator" id="hseparator1"> - <property name="visible">True</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkTable" id="table_format"> - <property name="border_width">2</property> - <property name="visible">True</property> - <property name="n_rows">3</property> - <property name="n_columns">2</property> - <property name="homogeneous">False</property> - <property name="row_spacing">6</property> - <property name="column_spacing">6</property> - - <child> - <widget class="GtkLabel" id="label8"> - <property name="visible">True</property> - <property name="label" translatable="yes">New store format:</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_RIGHT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">1</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label9"> - <property name="visible">True</property> - <property name="label" translatable="yes">Current store format:</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_RIGHT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">1</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label_format"> - <property name="visible">True</property> - <property name="label" translatable="yes">mbox</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">7.45058e-09</property> - <property name="yalign">0.5</property> - <property name="xpad">8</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label11"> - <property name="visible">True</property> - <property name="label" translatable="yes"></property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_RIGHT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">1</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">2</property> - <property name="bottom_attach">3</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkCheckButton" id="check_index_body"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">Index body contents</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="active">False</property> - <property name="inconsistent">False</property> - <property name="draw_indicator">True</property> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">2</property> - <property name="bottom_attach">3</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkAlignment" id="alignment4"> - <property name="visible">True</property> - <property name="xalign">7.45058e-09</property> - <property name="yalign">0.5</property> - <property name="xscale">0</property> - <property name="yscale">1</property> - - <child> - <widget class="GtkOptionMenu" id="option_format"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="history">0</property> - - <child internal-child="menu"> - <widget class="GtkMenu" id="convertwidget1"> - <property name="visible">True</property> - - <child> - <widget class="GtkMenuItem" id="convertwidget2"> - <property name="visible">True</property> - <property name="label" translatable="yes">mbox</property> - <property name="use_underline">True</property> - </widget> - </child> - - <child> - <widget class="GtkMenuItem" id="convertwidget3"> - <property name="visible">True</property> - <property name="label" translatable="yes">maildir</property> - <property name="use_underline">True</property> - </widget> - </child> - - <child> - <widget class="GtkMenuItem" id="convertwidget4"> - <property name="visible">True</property> - <property name="label" translatable="yes">mh</property> - <property name="use_underline">True</property> - </widget> - </child> - </widget> - </child> - </widget> - </child> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="y_options"></property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - </widget> - </child> -</widget> - -</glade-interface> diff --git a/mail/mail-account-editor.c b/mail/mail-account-editor.c deleted file mode 100644 index 11cdb56f94..0000000000 --- a/mail/mail-account-editor.c +++ /dev/null @@ -1,225 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Authors: - * Jeffrey Stedfast <fejj@ximian.com> - * Dan Winship <danw@ximian.com> - * - * Copyright 2001-2003 Ximian, Inc. (www.ximian.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public - * License as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - * - */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <camel/camel-url.h> -#include <e-util/e-dialog-utils.h> - -#include "mail-account-editor.h" -#include "mail-session.h" - -static void mail_account_editor_class_init (MailAccountEditorClass *class); -static void mail_account_editor_finalize (GObject *obj); - -static GtkDialogClass *parent_class = NULL; - -GType -mail_account_editor_get_type () -{ - static GtkType type = 0; - - if (!type) { - GTypeInfo type_info = { - sizeof (MailAccountEditorClass), - NULL, NULL, - (GClassInitFunc) mail_account_editor_class_init, - NULL, NULL, - sizeof (MailAccountEditor), - 0, - NULL - }; - - type = g_type_register_static (gtk_dialog_get_type (), "MailAccountEditor", &type_info, 0); - } - - return type; -} - -static void -mail_account_editor_class_init (MailAccountEditorClass *klass) -{ - GObjectClass *gobject_class = G_OBJECT_CLASS (klass); - - parent_class = g_type_class_ref(gtk_dialog_get_type ()); - - gobject_class->finalize = mail_account_editor_finalize; -} - -static void -mail_account_editor_finalize (GObject *obj) -{ - MailAccountEditor *editor = (MailAccountEditor *) obj; - - mail_account_gui_destroy (editor->gui); - - G_OBJECT_CLASS (parent_class)->finalize (obj); -} - -static gboolean -apply_changes (MailAccountEditor *editor) -{ - GtkWidget *incomplete; - int page = -1; - - if (!mail_account_gui_identity_complete (editor->gui, &incomplete) || - !mail_account_gui_management_complete (editor->gui, &incomplete)) - page = 0; - else if (!mail_account_gui_source_complete (editor->gui, &incomplete)) - page = 1; - else if (!mail_account_gui_transport_complete (editor->gui, &incomplete)) - page = 3; - - if (page != -1) { - gtk_notebook_set_current_page (editor->notebook, page); - gtk_widget_grab_focus (incomplete); - e_notice (editor, GTK_MESSAGE_ERROR, _("You have not filled in all of the required information.")); - return FALSE; - } - - if (mail_account_gui_save (editor->gui) == FALSE) - return FALSE; - - gtk_dialog_set_response_sensitive (GTK_DIALOG (editor), - GTK_RESPONSE_APPLY, FALSE); - - /* save any changes we may have */ - mail_config_write (); - - /* FIXME: #1549: if the account was a remote store, delete it from the folder-tree and re-add it */ - /* FIXME: preferably, we'd only do this if there were changes... oh well */ - - return TRUE; -} - -static void -editor_response_cb (GtkWidget *widget, int button, gpointer user_data) -{ - MailAccountEditor *editor = user_data; - - switch (button) { - case GTK_RESPONSE_APPLY: - apply_changes (editor); - return; - case GTK_RESPONSE_OK: - apply_changes (editor); - default: - gtk_widget_destroy (GTK_WIDGET (editor)); - } -} - -static void -mail_account_editor_changed (GtkWidget *widget, MailAccountEditor *editor) -{ - gtk_dialog_set_response_sensitive (GTK_WIDGET (editor), GTK_RESPONSE_APPLY, TRUE); -} - -static void -construct (MailAccountEditor *editor, EAccount *account, EMAccountPrefs *dialog) -{ - EAccountService *source = account->source; - - editor->gui = mail_account_gui_new (account, dialog); - - /* get our toplevel widget and reparent it */ - editor->notebook = GTK_NOTEBOOK (glade_xml_get_widget (editor->gui->xml, "account_editor_notebook")); - gtk_widget_reparent (GTK_WIDGET (editor->notebook), GTK_DIALOG (editor)->vbox); - - /* give our dialog an OK button and title */ - gtk_window_set_title (GTK_WINDOW (editor), _("Evolution Account Editor")); - gtk_window_set_resizable (GTK_WINDOW (editor), TRUE); - gtk_window_set_modal (GTK_WINDOW (editor), FALSE); - gtk_dialog_add_buttons (GTK_DIALOG (editor), - GTK_STOCK_APPLY, GTK_RESPONSE_APPLY, - GTK_STOCK_CLOSE, GTK_RESPONSE_CANCEL, - GTK_STOCK_OK, GTK_RESPONSE_OK, - NULL); - - g_signal_connect (editor, "response", G_CALLBACK (editor_response_cb), editor); - - g_signal_connect (editor->gui->account_name, "changed", G_CALLBACK (mail_account_editor_changed), editor); - g_signal_connect (editor->gui->default_account, "toggled", G_CALLBACK (mail_account_editor_changed), editor); - g_signal_connect (editor->gui->full_name, "changed", G_CALLBACK (mail_account_editor_changed), editor); - g_signal_connect (editor->gui->email_address, "changed", G_CALLBACK (mail_account_editor_changed), editor); - g_signal_connect (editor->gui->reply_to, "changed", G_CALLBACK (mail_account_editor_changed), editor); - g_signal_connect (editor->gui->organization, "changed", G_CALLBACK (mail_account_editor_changed), editor); - - g_signal_connect (editor->gui->source.type, "changed", G_CALLBACK (mail_account_editor_changed), editor); - g_signal_connect (editor->gui->source.hostname, "changed", G_CALLBACK (mail_account_editor_changed), editor); - g_signal_connect (editor->gui->source.username, "changed", G_CALLBACK (mail_account_editor_changed), editor); - g_signal_connect (editor->gui->source.path, "changed", G_CALLBACK (mail_account_editor_changed), editor); - g_signal_connect (editor->gui->source.use_ssl, "changed", G_CALLBACK (mail_account_editor_changed), editor); - g_signal_connect (editor->gui->source.authtype, "changed", G_CALLBACK (mail_account_editor_changed), editor); - g_signal_connect (editor->gui->source.remember, "toggled", G_CALLBACK (mail_account_editor_changed), editor); - - g_signal_connect (editor->gui->source_auto_check, "toggled", G_CALLBACK (mail_account_editor_changed), editor); - g_signal_connect (editor->gui->source_auto_check_min, "value-changed", G_CALLBACK (mail_account_editor_changed), editor); - - g_signal_connect (editor->gui->transport.type, "changed", G_CALLBACK (mail_account_editor_changed), editor); - g_signal_connect (editor->gui->transport.hostname, "changed", G_CALLBACK (mail_account_editor_changed), editor); - g_signal_connect (editor->gui->transport.username, "changed", G_CALLBACK (mail_account_editor_changed), editor); - g_signal_connect (editor->gui->transport_needs_auth, "toggled", G_CALLBACK (mail_account_editor_changed), editor); - g_signal_connect (editor->gui->transport.use_ssl, "changed", G_CALLBACK (mail_account_editor_changed), editor); - g_signal_connect (editor->gui->transport.authtype, "changed", G_CALLBACK (mail_account_editor_changed), editor); - g_signal_connect (editor->gui->transport.remember, "toggled", G_CALLBACK (mail_account_editor_changed), editor); - - g_signal_connect (editor->gui->drafts_folder_button, "clicked", G_CALLBACK (mail_account_editor_changed), editor); - g_signal_connect (editor->gui->sent_folder_button, "clicked", G_CALLBACK (mail_account_editor_changed), editor); - g_signal_connect (editor->gui->always_cc, "toggled", G_CALLBACK (mail_account_editor_changed), editor); - g_signal_connect (editor->gui->cc_addrs, "changed", G_CALLBACK (mail_account_editor_changed), editor); - g_signal_connect (editor->gui->always_bcc, "toggled", G_CALLBACK (mail_account_editor_changed), editor); - g_signal_connect (editor->gui->bcc_addrs, "changed", G_CALLBACK (mail_account_editor_changed), editor); - - g_signal_connect (editor->gui->pgp_key, "changed", G_CALLBACK (mail_account_editor_changed), editor); - g_signal_connect (editor->gui->pgp_encrypt_to_self, "toggled", G_CALLBACK (mail_account_editor_changed), editor); - g_signal_connect (editor->gui->pgp_always_sign, "toggled", G_CALLBACK (mail_account_editor_changed), editor); - g_signal_connect (editor->gui->pgp_no_imip_sign, "toggled", G_CALLBACK (mail_account_editor_changed), editor); - g_signal_connect (editor->gui->pgp_always_trust, "toggled", G_CALLBACK (mail_account_editor_changed), editor); - - mail_account_gui_setup (editor->gui, GTK_WIDGET (editor)); - - mail_account_gui_build_extra_conf (editor->gui, source->url); - - gtk_dialog_set_response_sensitive (GTK_DIALOG (editor), - GTK_RESPONSE_APPLY, FALSE); - - gtk_widget_grab_focus (GTK_WIDGET (editor->gui->account_name)); -} - -MailAccountEditor * -mail_account_editor_new (EAccount *account, GtkWindow *parent, EMAccountPrefs *dialog) -{ - MailAccountEditor *new; - - new = (MailAccountEditor *) g_object_new (mail_account_editor_get_type (), NULL); - gtk_window_set_transient_for ((GtkWindow *) new, parent); - construct (new, account, dialog); - - return new; -} diff --git a/mail/mail-account-editor.h b/mail/mail-account-editor.h deleted file mode 100644 index ff66a47703..0000000000 --- a/mail/mail-account-editor.h +++ /dev/null @@ -1,67 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Authors: Jeffrey Stedfast <fejj@ximian.com> - * - * Copyright 2001-2003 Ximian, Inc. (www.ximian.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public - * License as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - * - */ - -#ifndef MAIL_ACCOUNT_EDITOR_H -#define MAIL_ACCOUNT_EDITOR_H - -#ifdef __cplusplus -extern "C" { -#pragma } -#endif /* __cplusplus */ - -#include <gtk/gtk.h> -#include <libgnomeui/gnome-file-entry.h> - -#include "mail-account-gui.h" -#include "em-account-prefs.h" - -#define MAIL_ACCOUNT_EDITOR_TYPE (mail_account_editor_get_type ()) -#define MAIL_ACCOUNT_EDITOR(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), MAIL_ACCOUNT_EDITOR_TYPE, MailAccountEditor)) -#define MAIL_ACCOUNT_EDITOR_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), MAIL_ACCOUNT_EDITOR_TYPE, MailAccountEditorClass)) -#define MAIL_IS_ACCOUNT_EDITOR(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), MAIL_ACCOUNT_EDITOR_TYPE)) -#define MAIL_IS_ACCOUNT_EDITOR_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), MAIL_ACCOUNT_EDITOR_TYPE)) - -struct _MailAccountEditor { - GtkDialog parent_object; - - MailAccountGui *gui; - GtkNotebook *notebook; -}; - -typedef struct _MailAccountEditor MailAccountEditor; - -typedef struct { - GtkDialogClass parent_class; - - /* signals */ - -} MailAccountEditorClass; - -GtkType mail_account_editor_get_type (void); - -MailAccountEditor *mail_account_editor_new (EAccount *account, GtkWindow *parent, EMAccountPrefs *dialog); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* MAIL_ACCOUNT_EDITOR_H */ diff --git a/mail/mail-account-gui.c b/mail/mail-account-gui.c deleted file mode 100644 index 40858ec792..0000000000 --- a/mail/mail-account-gui.c +++ /dev/null @@ -1,2105 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Authors: - * Dan Winship <danw@ximian.com> - * Jeffrey Stedfast <fejj@ximian.com> - * - * Copyright 2001 Ximian, Inc. (www.ximian.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public - * License as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - * - */ - - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <string.h> -#include <stdarg.h> - -#include <gconf/gconf.h> -#include <gconf/gconf-client.h> - -#include <e-util/e-account-list.h> -#include <e-util/e-dialog-utils.h> - -#include "em-folder-selection-button.h" -#include "mail-account-gui.h" -#include "mail-session.h" -#include "mail-send-recv.h" -#include "mail-signature-editor.h" -#include "mail-component.h" -#include "em-composer-prefs.h" -#include "mail-config.h" -#include "mail-ops.h" -#include "mail-mt.h" -#include "mail.h" - -#if defined (HAVE_NSS) -#include "smime/gui/e-cert-selector.h" -#endif - -#define d(x) - -extern char *default_drafts_folder_uri, *default_sent_folder_uri; - -static void save_service (MailAccountGuiService *gsvc, GHashTable *extra_conf, EAccountService *service); -static void service_changed (GtkEntry *entry, gpointer user_data); - -struct { - char *label; - char *value; -} ssl_options[] = { - { N_("Always"), "always" }, - { N_("Whenever Possible"), "when-possible" }, - { N_("Never"), "never" } -}; - -static int num_ssl_options = sizeof (ssl_options) / sizeof (ssl_options[0]); - -static gboolean -is_email (const char *address) -{ - /* This is supposed to check if the address's domain could be - an FQDN but alas, it's not worth the pain and suffering. */ - const char *at; - - at = strchr (address, '@'); - /* make sure we have an '@' and that it's not the first or last char */ - if (!at || at == address || *(at + 1) == '\0') - return FALSE; - - return TRUE; -} - -static GtkWidget * -get_focused_widget (GtkWidget *def, ...) -{ - GtkWidget *widget, *ret = NULL; - va_list args; - - va_start (args, def); - widget = va_arg (args, GtkWidget *); - while (widget) { - if (GTK_WIDGET_HAS_FOCUS (widget)) { - ret = widget; - break; - } - - widget = va_arg (args, GtkWidget *); - } - va_end (args); - - if (ret) - return ret; - else - return def; -} - -gboolean -mail_account_gui_identity_complete (MailAccountGui *gui, GtkWidget **incomplete) -{ - const char *text; - - text = gtk_entry_get_text (gui->full_name); - if (!text || !*text) { - if (incomplete) - *incomplete = get_focused_widget (GTK_WIDGET (gui->full_name), - GTK_WIDGET (gui->email_address), - GTK_WIDGET (gui->reply_to), - NULL); - return FALSE; - } - - text = gtk_entry_get_text (gui->email_address); - if (!text || !is_email (text)) { - if (incomplete) - *incomplete = get_focused_widget (GTK_WIDGET (gui->email_address), - GTK_WIDGET (gui->full_name), - GTK_WIDGET (gui->reply_to), - NULL); - return FALSE; - } - - /* make sure that if the reply-to field is filled in, that it is valid */ - text = gtk_entry_get_text (gui->reply_to); - if (text && *text && !is_email (text)) { - if (incomplete) - *incomplete = get_focused_widget (GTK_WIDGET (gui->reply_to), - GTK_WIDGET (gui->email_address), - GTK_WIDGET (gui->full_name), - NULL); - return FALSE; - } - - return TRUE; -} - -static void -auto_detected_foreach (gpointer key, gpointer value, gpointer user_data) -{ - g_free (key); - g_free (value); -} - -static gboolean -service_complete (MailAccountGuiService *service, GHashTable *extra_config, GtkWidget **incomplete) -{ - const CamelProvider *prov = service->provider; - GtkWidget *path; - const char *text; - - if (!prov) - return TRUE; - - /* transports don't have a path */ - if (service->path) - path = GTK_WIDGET (service->path); - else - path = NULL; - - if (CAMEL_PROVIDER_NEEDS (prov, CAMEL_URL_PART_HOST)) { - text = gtk_entry_get_text (service->hostname); - if (!text || !*text) { - if (incomplete) - *incomplete = get_focused_widget (GTK_WIDGET (service->hostname), - GTK_WIDGET (service->username), - path, - NULL); - return FALSE; - } - } - - if (CAMEL_PROVIDER_NEEDS (prov, CAMEL_URL_PART_USER)) { - text = gtk_entry_get_text (service->username); - if (!text || !*text) { - if (incomplete) - *incomplete = get_focused_widget (GTK_WIDGET (service->username), - GTK_WIDGET (service->hostname), - path, - NULL); - return FALSE; - } - } - - if (CAMEL_PROVIDER_NEEDS (prov, CAMEL_URL_PART_PATH)) { - if (!path) { - d(printf ("aagh, transports aren't supposed to have paths.\n")); - return TRUE; - } - - text = gtk_entry_get_text (service->path); - if (!text || !*text) { - if (incomplete) - *incomplete = get_focused_widget (GTK_WIDGET (service->path), - GTK_WIDGET (service->hostname), - GTK_WIDGET (service->username), - NULL); - return FALSE; - } - } - - return TRUE; -} - -gboolean -mail_account_gui_source_complete (MailAccountGui *gui, GtkWidget **incomplete) -{ - return service_complete (&gui->source, gui->extra_config, incomplete); -} - -void -mail_account_gui_auto_detect_extra_conf (MailAccountGui *gui) -{ - MailAccountGuiService *service = &gui->source; - CamelProvider *prov = service->provider; - GHashTable *auto_detected; - GtkWidget *path; - CamelURL *url; - char *text; - const char *tmp; - - if (!prov) - return; - - /* transports don't have a path */ - if (service->path) - path = GTK_WIDGET (service->path); - else - path = NULL; - - url = g_new0 (CamelURL, 1); - camel_url_set_protocol (url, prov->protocol); - - if (CAMEL_PROVIDER_ALLOWS (prov, CAMEL_URL_PART_HOST)) { - text = g_strdup (gtk_entry_get_text (service->hostname)); - if (*text) { - char *port; - - port = strchr (text, ':'); - if (port) { - *port++ = '\0'; - camel_url_set_port (url, atoi (port)); - } - - camel_url_set_host (url, text); - } - g_free (text); - } - - if (CAMEL_PROVIDER_ALLOWS (prov, CAMEL_URL_PART_USER)) { - text = g_strdup (gtk_entry_get_text (service->username)); - g_strstrip (text); - camel_url_set_user (url, text); - g_free (text); - } - - if (path && CAMEL_PROVIDER_ALLOWS (prov, CAMEL_URL_PART_PATH)) { - tmp = gtk_entry_get_text (service->path); - if (tmp && *tmp) - camel_url_set_path (url, tmp); - } - - camel_provider_auto_detect (prov, url, &auto_detected, NULL); - camel_url_free (url); - - if (auto_detected) { - CamelProviderConfEntry *entries; - GtkToggleButton *toggle; - GtkSpinButton *spin; - GtkEntry *entry; - char *value; - int i; - - entries = service->provider->extra_conf; - - for (i = 0; entries[i].type != CAMEL_PROVIDER_CONF_END; i++) { - if (!entries[i].name) - continue; - - value = g_hash_table_lookup (auto_detected, entries[i].name); - if (!value) - continue; - - switch (entries[i].type) { - case CAMEL_PROVIDER_CONF_CHECKBOX: - toggle = g_hash_table_lookup (gui->extra_config, entries[i].name); - gtk_toggle_button_set_active (toggle, atoi (value)); - break; - - case CAMEL_PROVIDER_CONF_ENTRY: - entry = g_hash_table_lookup (gui->extra_config, entries[i].name); - if (value) - gtk_entry_set_text (entry, value); - break; - - case CAMEL_PROVIDER_CONF_CHECKSPIN: - { - gboolean enable; - double val; - char *name; - - toggle = g_hash_table_lookup (gui->extra_config, entries[i].name); - name = g_strdup_printf ("%s_value", entries[i].name); - spin = g_hash_table_lookup (gui->extra_config, name); - g_free (name); - - enable = *value++ == 'y'; - gtk_toggle_button_set_active (toggle, enable); - g_assert (*value == ':'); - val = strtod (++value, NULL); - gtk_spin_button_set_value (spin, val); - } - break; - default: - break; - } - } - - g_hash_table_foreach (auto_detected, auto_detected_foreach, NULL); - g_hash_table_destroy (auto_detected); - } -} - -gboolean -mail_account_gui_transport_complete (MailAccountGui *gui, GtkWidget **incomplete) -{ - if (!gui->transport.provider) { - if (incomplete) - *incomplete = GTK_WIDGET (gui->transport.type); - return FALSE; - } - - /* If it's both source and transport, there's nothing extra to - * configure on the transport page. - */ - if (CAMEL_PROVIDER_IS_STORE_AND_TRANSPORT (gui->transport.provider)) { - if (gui->transport.provider == gui->source.provider) - return TRUE; - if (incomplete) - *incomplete = GTK_WIDGET (gui->transport.type); - return FALSE; - } - - if (!service_complete (&gui->transport, NULL, incomplete)) - return FALSE; - - /* FIXME? */ - if (gtk_toggle_button_get_active (gui->transport_needs_auth) && - CAMEL_PROVIDER_ALLOWS (gui->transport.provider, CAMEL_URL_PART_USER)) { - const char *text = gtk_entry_get_text (gui->transport.username); - - if (!text || !*text) { - if (incomplete) - *incomplete = get_focused_widget (GTK_WIDGET (gui->transport.username), - GTK_WIDGET (gui->transport.hostname), - NULL); - return FALSE; - } - } - - return TRUE; -} - -gboolean -mail_account_gui_management_complete (MailAccountGui *gui, GtkWidget **incomplete) -{ - const char *text; - - text = gtk_entry_get_text (gui->account_name); - if (text && *text) - return TRUE; - - if (incomplete) - *incomplete = GTK_WIDGET (gui->account_name); - - return FALSE; -} - - -static void -service_authtype_changed (GtkWidget *widget, gpointer user_data) -{ - MailAccountGuiService *service = user_data; - CamelServiceAuthType *authtype; - - service->authitem = widget; - authtype = g_object_get_data ((GObject *) widget, "authtype"); - - gtk_widget_set_sensitive (GTK_WIDGET (service->remember), authtype->need_password); -} - -static void -build_auth_menu (MailAccountGuiService *service, GList *all_authtypes, - GList *supported_authtypes, gboolean check_supported) -{ - GtkWidget *menu, *item, *first = NULL; - CamelServiceAuthType *current, *authtype, *sauthtype; - int history = 0, i; - GList *l, *s; - - if (service->authitem) - current = g_object_get_data ((GObject *) service->authitem, "authtype"); - else - current = NULL; - - service->authitem = NULL; - - menu = gtk_menu_new (); - - for (l = all_authtypes, i = 0; l; l = l->next, i++) { - authtype = l->data; - - item = gtk_menu_item_new_with_label (authtype->name); - for (s = supported_authtypes; s; s = s->next) { - sauthtype = s->data; - if (!strcmp (authtype->name, sauthtype->name)) - break; - } - - if (check_supported && !s) { - gtk_widget_set_sensitive (item, FALSE); - } else if (current && !strcmp (authtype->name, current->name)) { - first = item; - history = i; - } else if (!first) { - first = item; - history = i; - } - - g_object_set_data ((GObject *) item, "authtype", authtype); - g_signal_connect (item, "activate", G_CALLBACK (service_authtype_changed), service); - - gtk_menu_shell_append(GTK_MENU_SHELL(menu), item); - - gtk_widget_show (item); - } - - gtk_option_menu_remove_menu (service->authtype); - gtk_option_menu_set_menu (service->authtype, menu); - - if (first) { - gtk_option_menu_set_history (service->authtype, history); - g_signal_emit_by_name (first, "activate"); - } -} - -static void -transport_provider_set_available (MailAccountGui *gui, CamelProvider *provider, - gboolean available) -{ - GtkWidget *menuitem; - - menuitem = g_object_get_data ((GObject *) gui->transport.type, provider->protocol); - g_return_if_fail (menuitem != NULL); - - gtk_widget_set_sensitive (menuitem, available); - - if (available) { - gpointer number = g_object_get_data ((GObject *) menuitem, "number"); - - g_signal_emit_by_name (menuitem, "activate"); - gtk_option_menu_set_history (gui->transport.type, GPOINTER_TO_UINT (number)); - } -} - -static void -source_type_changed (GtkWidget *widget, gpointer user_data) -{ - MailAccountGui *gui = user_data; - GtkWidget *file_entry, *label, *frame, *dwidget = NULL; - CamelProvider *provider; - - provider = g_object_get_data ((GObject *) widget, "provider"); - - /* If the previously-selected provider has a linked transport, - * disable it. - */ - if (gui->source.provider && - CAMEL_PROVIDER_IS_STORE_AND_TRANSPORT (gui->source.provider)) - transport_provider_set_available (gui, gui->source.provider, FALSE); - - gui->source.provider = provider; - - if (provider) - gtk_label_set_text (gui->source.description, provider->description); - else - gtk_label_set_text (gui->source.description, ""); - - frame = glade_xml_get_widget (gui->xml, "source_frame"); - if (provider) { - gtk_widget_show (frame); - - /* hostname */ - label = glade_xml_get_widget (gui->xml, "source_host_label"); - - if (CAMEL_PROVIDER_ALLOWS (provider, CAMEL_URL_PART_HOST)) { - dwidget = GTK_WIDGET (gui->source.hostname); - gtk_widget_show (GTK_WIDGET (gui->source.hostname)); - gtk_widget_show (label); - } else { - gtk_widget_hide (GTK_WIDGET (gui->source.hostname)); - gtk_widget_hide (label); - } - - /* username */ - label = glade_xml_get_widget (gui->xml, "source_user_label"); - - if (CAMEL_PROVIDER_ALLOWS (provider, CAMEL_URL_PART_USER)) { - if (!dwidget) - dwidget = GTK_WIDGET (gui->source.username); - gtk_widget_show (GTK_WIDGET (gui->source.username)); - gtk_widget_show (label); - } else { - gtk_widget_hide (GTK_WIDGET (gui->source.username)); - gtk_widget_hide (label); - } - - /* path */ - label = glade_xml_get_widget (gui->xml, "source_path_label"); - file_entry = glade_xml_get_widget (gui->xml, "source_path_entry"); - - if (CAMEL_PROVIDER_ALLOWS (provider, CAMEL_URL_PART_PATH)) { - if (!dwidget) - dwidget = GTK_WIDGET (gui->source.path); - - gtk_widget_show (GTK_WIDGET (file_entry)); - gtk_widget_show (label); - } else { - gtk_entry_set_text (gui->source.path, ""); - gtk_widget_hide (GTK_WIDGET (file_entry)); - gtk_widget_hide (label); - } - - /* ssl */ -#ifdef HAVE_SSL - if (provider && provider->flags & CAMEL_PROVIDER_SUPPORTS_SSL) - gtk_widget_show (gui->source.ssl_hbox); - else - gtk_widget_hide (gui->source.ssl_hbox); - gtk_widget_hide (gui->source.no_ssl); -#else - gtk_widget_hide (gui->source.ssl_hbox); - gtk_widget_show (gui->source.no_ssl); -#endif - - /* auth */ - frame = glade_xml_get_widget (gui->xml, "source_auth_frame"); - if (provider && CAMEL_PROVIDER_ALLOWS (provider, CAMEL_URL_PART_AUTH)) { - build_auth_menu (&gui->source, provider->authtypes, NULL, FALSE); - gtk_widget_show (frame); - } else - gtk_widget_hide (frame); - } else { - gtk_widget_hide (frame); - frame = glade_xml_get_widget (gui->xml, "source_auth_frame"); - gtk_widget_hide (frame); - } - - g_signal_emit_by_name (gui->source.username, "changed"); - - if (dwidget) - gtk_widget_grab_focus (dwidget); - - mail_account_gui_build_extra_conf (gui, gui && gui->account && gui->account->source ? gui->account->source->url : NULL); - - if (provider && CAMEL_PROVIDER_IS_STORE_AND_TRANSPORT (provider)) - transport_provider_set_available (gui, provider, TRUE); -} - - -static void -transport_needs_auth_toggled (GtkToggleButton *toggle, gpointer data) -{ - MailAccountGui *gui = data; - gboolean need = gtk_toggle_button_get_active (toggle); - GtkWidget *widget; - - widget = glade_xml_get_widget (gui->xml, "transport_auth_frame"); - gtk_widget_set_sensitive (widget, need); - if (need) - service_changed (NULL, &gui->transport); -} - -static void -transport_type_changed (GtkWidget *widget, gpointer user_data) -{ - MailAccountGui *gui = user_data; - CamelProvider *provider; - GtkWidget *label, *frame; - - provider = g_object_get_data ((GObject *) widget, "provider"); - gui->transport.provider = provider; - - /* description */ - gtk_label_set_text (gui->transport.description, provider->description); - - frame = glade_xml_get_widget (gui->xml, "transport_frame"); - if (!CAMEL_PROVIDER_IS_STORE_AND_TRANSPORT (provider) && - (CAMEL_PROVIDER_ALLOWS (provider, CAMEL_URL_PART_HOST) || - (CAMEL_PROVIDER_ALLOWS (provider, CAMEL_URL_PART_AUTH) && - !CAMEL_PROVIDER_NEEDS (provider, CAMEL_URL_PART_AUTH)))) { - gtk_widget_show (frame); - - label = glade_xml_get_widget (gui->xml, "transport_host_label"); - if (CAMEL_PROVIDER_ALLOWS (provider, CAMEL_URL_PART_HOST)) { - gtk_widget_grab_focus (GTK_WIDGET (gui->transport.hostname)); - gtk_widget_show (GTK_WIDGET (gui->transport.hostname)); - gtk_widget_show (label); - } else { - gtk_widget_hide (GTK_WIDGET (gui->transport.hostname)); - gtk_widget_hide (label); - } - - /* ssl */ -#ifdef HAVE_SSL - if (provider && provider->flags & CAMEL_PROVIDER_SUPPORTS_SSL) - gtk_widget_show (gui->transport.ssl_hbox); - else - gtk_widget_hide (gui->transport.ssl_hbox); - gtk_widget_hide (gui->transport.no_ssl); -#else - gtk_widget_hide (gui->transport.ssl_hbox); - gtk_widget_show (gui->transport.no_ssl); -#endif - - /* auth */ - if (CAMEL_PROVIDER_ALLOWS (provider, CAMEL_URL_PART_AUTH) && - !CAMEL_PROVIDER_NEEDS (provider, CAMEL_URL_PART_AUTH)) - gtk_widget_show (GTK_WIDGET (gui->transport_needs_auth)); - else - gtk_widget_hide (GTK_WIDGET (gui->transport_needs_auth)); - } else - gtk_widget_hide (frame); - - frame = glade_xml_get_widget (gui->xml, "transport_auth_frame"); - if (!CAMEL_PROVIDER_IS_STORE_AND_TRANSPORT (provider) && - CAMEL_PROVIDER_ALLOWS (provider, CAMEL_URL_PART_AUTH)) { - gtk_widget_show (frame); - - label = glade_xml_get_widget (gui->xml, "transport_user_label"); - if (CAMEL_PROVIDER_ALLOWS (provider, CAMEL_URL_PART_USER)) { - gtk_widget_show (GTK_WIDGET (gui->transport.username)); - gtk_widget_show (label); - } else { - gtk_widget_hide (GTK_WIDGET (gui->transport.username)); - gtk_widget_hide (label); - } - - build_auth_menu (&gui->transport, provider->authtypes, NULL, FALSE); - transport_needs_auth_toggled (gui->transport_needs_auth, gui); - } else - gtk_widget_hide (frame); - - g_signal_emit_by_name (gui->transport.hostname, "changed"); -} - -static void -service_changed (GtkEntry *entry, gpointer user_data) -{ - MailAccountGuiService *service = user_data; - - gtk_widget_set_sensitive (GTK_WIDGET (service->check_supported), - service_complete (service, NULL, NULL)); -} - -static void -service_check_supported (GtkButton *button, gpointer user_data) -{ - MailAccountGuiService *gsvc = user_data; - EAccountService *service; - GList *authtypes = NULL; - GtkWidget *authitem; - GtkWidget *window; - - service = g_new0 (EAccountService, 1); - - /* This is sort of a hack, when checking for supported AUTH - types we don't want to use whatever authtype is selected - because it may not be available. */ - authitem = gsvc->authitem; - gsvc->authitem = NULL; - - save_service (gsvc, NULL, service); - - gsvc->authitem = authitem; - - window = gtk_widget_get_ancestor (GTK_WIDGET (button), GTK_TYPE_WINDOW); - - if (mail_config_check_service (service->url, gsvc->provider_type, &authtypes, GTK_WINDOW (window))) { - build_auth_menu (gsvc, gsvc->provider->authtypes, authtypes, TRUE); - if (!authtypes) { - /* provider doesn't support any authtypes */ - gtk_widget_set_sensitive (GTK_WIDGET (gsvc->check_supported), FALSE); - } - g_list_free (authtypes); - } - - g_free (service->url); - g_free (service); -} - - -static void -toggle_sensitivity (GtkToggleButton *toggle, GtkWidget *widget) -{ - gtk_widget_set_sensitive (widget, gtk_toggle_button_get_active (toggle)); -} - -static void -setup_toggle (GtkWidget *widget, const char *depname, MailAccountGui *gui) -{ - GtkToggleButton *toggle; - - if (!strcmp (depname, "UNIMPLEMENTED")) { - gtk_widget_set_sensitive (widget, FALSE); - return; - } - - toggle = g_hash_table_lookup (gui->extra_config, depname); - g_signal_connect (toggle, "toggled", G_CALLBACK (toggle_sensitivity), widget); - toggle_sensitivity (toggle, widget); -} - -void -mail_account_gui_build_extra_conf (MailAccountGui *gui, const char *url_string) -{ - CamelURL *url; - GtkWidget *mailcheck_frame, *mailcheck_hbox; - GtkWidget *hostname_label, *username_label, *path_label; - GtkWidget *hostname, *username, *path; - GtkTable *main_table, *cur_table; - CamelProviderConfEntry *entries; - GList *children, *child; - char *name; - int i, rows; - - if (url_string) - url = camel_url_new (url_string, NULL); - else - url = NULL; - - hostname_label = glade_xml_get_widget (gui->xml, "source_host_label"); - gtk_label_set_text_with_mnemonic (GTK_LABEL (hostname_label), _("_Host:")); - hostname = glade_xml_get_widget (gui->xml, "source_host"); - - username_label = glade_xml_get_widget (gui->xml, "source_user_label"); - gtk_label_set_text_with_mnemonic (GTK_LABEL (username_label), _("User_name:")); - username = glade_xml_get_widget (gui->xml, "source_user"); - - path_label = glade_xml_get_widget (gui->xml, "source_path_label"); - gtk_label_set_text_with_mnemonic (GTK_LABEL (path_label), _("_Path:")); - path = glade_xml_get_widget (gui->xml, "source_path"); - - /* Remove the contents of the extra_table except for the - * mailcheck_frame. - */ - main_table = (GtkTable *)glade_xml_get_widget (gui->xml, "extra_table"); - mailcheck_frame = glade_xml_get_widget (gui->xml, "extra_mailcheck_frame"); - children = gtk_container_get_children (GTK_CONTAINER (main_table)); - for (child = children; child; child = child->next) { - if (child->data != (gpointer)mailcheck_frame) { - gtk_container_remove (GTK_CONTAINER (main_table), - child->data); - } - } - g_list_free (children); - gtk_table_resize (main_table, 1, 2); - - /* Remove any additional mailcheck items. */ - cur_table = (GtkTable *)glade_xml_get_widget (gui->xml, "extra_mailcheck_table"); - mailcheck_hbox = glade_xml_get_widget (gui->xml, "extra_mailcheck_hbox"); - children = gtk_container_get_children (GTK_CONTAINER (cur_table)); - for (child = children; child; child = child->next) { - if (child->data != (gpointer)mailcheck_hbox) { - gtk_container_remove (GTK_CONTAINER (cur_table), - child->data); - } - } - g_list_free (children); - gtk_table_resize (cur_table, 1, 2); - - if (!gui->source.provider) { - gtk_widget_set_sensitive (GTK_WIDGET (main_table), FALSE); - if (url) - camel_url_free (url); - return; - } else - gtk_widget_set_sensitive (GTK_WIDGET (main_table), TRUE); - - /* Set up our hash table. */ - if (gui->extra_config) - g_hash_table_destroy (gui->extra_config); - gui->extra_config = g_hash_table_new (g_str_hash, g_str_equal); - - entries = gui->source.provider->extra_conf; - if (!entries) - goto done; - - cur_table = main_table; - rows = main_table->nrows; - for (i = 0; ; i++) { - switch (entries[i].type) { - case CAMEL_PROVIDER_CONF_SECTION_START: - { - GtkWidget *frame; - - if (entries[i].name && !strcmp (entries[i].name, "mailcheck")) - cur_table = (GtkTable *)glade_xml_get_widget (gui->xml, "extra_mailcheck_table"); - else { - frame = gtk_frame_new (entries[i].text); - gtk_container_set_border_width (GTK_CONTAINER (frame), 3); - gtk_table_attach (main_table, frame, 0, 2, - rows, rows + 1, - GTK_EXPAND | GTK_FILL, 0, 0, 0); - - cur_table = (GtkTable *)gtk_table_new (0, 2, FALSE); - rows = 0; - gtk_table_set_row_spacings (cur_table, 4); - gtk_table_set_col_spacings (cur_table, 8); - gtk_container_set_border_width (GTK_CONTAINER (cur_table), 3); - - gtk_container_add (GTK_CONTAINER (frame), GTK_WIDGET (cur_table)); - } - break; - } - case CAMEL_PROVIDER_CONF_SECTION_END: - cur_table = main_table; - rows = main_table->nrows; - break; - - case CAMEL_PROVIDER_CONF_LABEL: - if (entries[i].name && entries[i].text) { - GtkWidget *label; - - if (!strcmp (entries[i].name, "username")) { - gtk_label_set_text_with_mnemonic (GTK_LABEL (username_label), entries[i].text); - } else if (!strcmp (entries[i].name, "hostname")) { - gtk_label_set_text_with_mnemonic (GTK_LABEL (hostname_label), entries[i].text); - } else if (!strcmp (entries[i].name, "path")) { - gtk_label_set_text_with_mnemonic (GTK_LABEL (path_label), entries[i].text); - } else { - /* make a new label */ - label = gtk_label_new (entries[i].text); - gtk_table_resize (cur_table, cur_table->nrows + 1, 2); - gtk_table_attach (cur_table, label, 0, 2, rows, rows + 1, - GTK_EXPAND | GTK_FILL, 0, 0, 0); - rows++; - } - } - break; - - case CAMEL_PROVIDER_CONF_CHECKBOX: - { - GtkWidget *checkbox; - gboolean active; - - checkbox = gtk_check_button_new_with_label (entries[i].text); - if (url) - active = camel_url_get_param (url, entries[i].name) != NULL; - else - active = atoi (entries[i].value); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (checkbox), active); - - gtk_table_attach (cur_table, checkbox, 0, 2, rows, rows + 1, - GTK_EXPAND | GTK_FILL, 0, 0, 0); - rows++; - g_hash_table_insert (gui->extra_config, entries[i].name, checkbox); - if (entries[i].depname) - setup_toggle (checkbox, entries[i].depname, gui); - break; - } - - case CAMEL_PROVIDER_CONF_ENTRY: - { - GtkWidget *label, *entry; - const char *text; - - if (!strcmp (entries[i].name, "username")) { - gtk_label_set_text_with_mnemonic (GTK_LABEL (username_label), entries[i].text); - label = username_label; - entry = username; - } else if (!strcmp (entries[i].name, "hostname")) { - gtk_label_set_text_with_mnemonic (GTK_LABEL (hostname_label), entries[i].text); - label = hostname_label; - entry = hostname; - } else if (!strcmp (entries[i].name, "path")) { - gtk_label_set_text_with_mnemonic (GTK_LABEL (path_label), entries[i].text); - label = path_label; - entry = path; - } else { - /* make a new text entry with label */ - label = gtk_label_new (entries[i].text); - gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.0); - entry = gtk_entry_new (); - - gtk_table_attach (cur_table, label, 0, 1, rows, rows + 1, - GTK_FILL, 0, 0, 0); - gtk_table_attach (cur_table, entry, 1, 2, rows, rows + 1, - GTK_EXPAND | GTK_FILL, 0, 0, 0); - rows++; - } - - if (url) - text = camel_url_get_param (url, entries[i].name); - else - text = entries[i].value; - - if (text) - gtk_entry_set_text (GTK_ENTRY (entry), text); - - if (entries[i].depname) { - setup_toggle (entry, entries[i].depname, gui); - setup_toggle (label, entries[i].depname, gui); - } - - g_hash_table_insert (gui->extra_config, entries[i].name, entry); - - break; - } - - case CAMEL_PROVIDER_CONF_CHECKSPIN: - { - GtkWidget *hbox, *checkbox, *spin, *label; - GtkObject *adj; - char *data, *pre, *post, *p; - double min, def, max; - gboolean enable; - - /* FIXME: this is pretty fucked... */ - data = entries[i].text; - p = strstr (data, "%s"); - g_return_if_fail (p != NULL); - - pre = g_strndup (data, p - data); - post = p + 2; - - data = entries[i].value; - enable = *data++ == 'y'; - g_return_if_fail (*data == ':'); - min = strtod (data + 1, &data); - g_return_if_fail (*data == ':'); - def = strtod (data + 1, &data); - g_return_if_fail (*data == ':'); - max = strtod (data + 1, NULL); - - if (url) { - const char *val; - - val = camel_url_get_param (url, entries[i].name); - if (!val) - enable = FALSE; - else { - enable = TRUE; - def = atof (val); - } - } - - hbox = gtk_hbox_new (FALSE, 0); - checkbox = gtk_check_button_new_with_label (pre); - g_free (pre); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (checkbox), enable); - adj = gtk_adjustment_new (def, min, max, 1, 1, 1); - spin = gtk_spin_button_new (GTK_ADJUSTMENT (adj), 1, 0); - label = gtk_label_new (post); - - gtk_box_pack_start (GTK_BOX (hbox), checkbox, FALSE, TRUE, 0); - gtk_box_pack_start (GTK_BOX (hbox), spin, FALSE, FALSE, 0); - gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, TRUE, 4); - - gtk_table_attach (cur_table, hbox, 0, 2, rows, rows + 1, - GTK_EXPAND | GTK_FILL, 0, 0, 0); - rows++; - g_hash_table_insert (gui->extra_config, entries[i].name, checkbox); - name = g_strdup_printf ("%s_value", entries[i].name); - g_hash_table_insert (gui->extra_config, name, spin); - if (entries[i].depname) { - setup_toggle (checkbox, entries[i].depname, gui); - setup_toggle (spin, entries[i].depname, gui); - setup_toggle (label, entries[i].depname, gui); - } - break; - } - - case CAMEL_PROVIDER_CONF_END: - goto done; - } - } - - done: - gtk_widget_show_all (GTK_WIDGET (main_table)); - if (url) - camel_url_free (url); -} - -static void -extract_values (MailAccountGuiService *source, GHashTable *extra_config, CamelURL *url) -{ - CamelProviderConfEntry *entries; - GtkToggleButton *toggle; - GtkEntry *entry; - GtkSpinButton *spin; - char *name; - int i; - - if (!source->provider || !source->provider->extra_conf) - return; - entries = source->provider->extra_conf; - - for (i = 0; ; i++) { - if (entries[i].depname) { - toggle = g_hash_table_lookup (extra_config, entries[i].depname); - if (!toggle || !gtk_toggle_button_get_active (toggle)) - continue; - } - - switch (entries[i].type) { - case CAMEL_PROVIDER_CONF_CHECKBOX: - toggle = g_hash_table_lookup (extra_config, entries[i].name); - if (gtk_toggle_button_get_active (toggle)) - camel_url_set_param (url, entries[i].name, ""); - break; - - case CAMEL_PROVIDER_CONF_ENTRY: - if (strcmp (entries[i].name, "username") == 0 - || strcmp (entries[i].name, "hostname") == 0 - || strcmp (entries[i].name, "path") == 0) { - break; - } - entry = g_hash_table_lookup (extra_config, entries[i].name); - camel_url_set_param (url, entries[i].name, gtk_entry_get_text (entry)); - break; - - case CAMEL_PROVIDER_CONF_CHECKSPIN: - toggle = g_hash_table_lookup (extra_config, entries[i].name); - if (!gtk_toggle_button_get_active (toggle)) - break; - name = g_strdup_printf ("%s_value", entries[i].name); - spin = g_hash_table_lookup (extra_config, name); - g_free (name); - name = g_strdup_printf ("%d", gtk_spin_button_get_value_as_int (spin)); - camel_url_set_param (url, entries[i].name, name); - g_free (name); - break; - - case CAMEL_PROVIDER_CONF_END: - return; - - default: - break; - } - } -} - -static void -folder_selected (EMFolderSelectionButton *button, gpointer user_data) -{ - char **folder_name = user_data; - - g_free (*folder_name); - *folder_name = g_strdup(em_folder_selection_button_get_selection(button)); -} - -static void -default_folders_clicked (GtkButton *button, gpointer user_data) -{ - MailAccountGui *gui = user_data; - - /* Drafts folder */ - g_free (gui->drafts_folder_uri); - gui->drafts_folder_uri = g_strdup (default_drafts_folder_uri); - em_folder_selection_button_set_selection((EMFolderSelectionButton *)gui->drafts_folder_button, gui->drafts_folder_uri); - - /* Sent folder */ - g_free (gui->sent_folder_uri); - gui->sent_folder_uri = g_strdup (default_sent_folder_uri); - em_folder_selection_button_set_selection((EMFolderSelectionButton *)gui->sent_folder_button, gui->sent_folder_uri); -} - -GtkWidget *mail_account_gui_folder_selector_button_new (char *widget_name, char *string1, char *string2, int int1, int int2); - -GtkWidget * -mail_account_gui_folder_selector_button_new (char *widget_name, - char *string1, char *string2, - int int1, int int2) -{ - return (GtkWidget *)em_folder_selection_button_new(_("Select Folder"), NULL); -} - -static gboolean -setup_service (MailAccountGuiService *gsvc, EAccountService *service) -{ - CamelURL *url = camel_url_new (service->url, NULL); - gboolean has_auth = FALSE; - - if (url == NULL || gsvc->provider == NULL) - return FALSE; - - if (url->user && CAMEL_PROVIDER_ALLOWS (gsvc->provider, CAMEL_URL_PART_USER)) - gtk_entry_set_text (gsvc->username, url->user); - - if (url->host && CAMEL_PROVIDER_ALLOWS (gsvc->provider, CAMEL_URL_PART_HOST)) { - char *hostname; - - if (url->port) - hostname = g_strdup_printf ("%s:%d", url->host, url->port); - else - hostname = g_strdup (url->host); - - gtk_entry_set_text (gsvc->hostname, hostname); - g_free (hostname); - } - - if (url->path && CAMEL_PROVIDER_ALLOWS (gsvc->provider, CAMEL_URL_PART_PATH)) - gtk_entry_set_text (gsvc->path, url->path); - - if (gsvc->provider->flags & CAMEL_PROVIDER_SUPPORTS_SSL) { - GList *children, *item; - const char *use_ssl; - int i; - - use_ssl = camel_url_get_param (url, "use_ssl"); - if (!use_ssl) - use_ssl = "never"; - else if (!*use_ssl) /* old config code just used an empty string as the value */ - use_ssl = "always"; - - children = gtk_container_get_children(GTK_CONTAINER (gtk_option_menu_get_menu (gsvc->use_ssl))); - for (item = children, i = 0; item; item = item->next, i++) { - if (!strcmp (use_ssl, ssl_options[i].value)) { - gtk_option_menu_set_history (gsvc->use_ssl, i); - g_signal_emit_by_name (item->data, "activate", gsvc); - break; - } - } - } - - if (url->authmech && CAMEL_PROVIDER_ALLOWS (gsvc->provider, CAMEL_URL_PART_AUTH)) { - GList *children, *item; - CamelServiceAuthType *authtype; - int i; - - children = gtk_container_get_children(GTK_CONTAINER (gtk_option_menu_get_menu (gsvc->authtype))); - for (item = children, i = 0; item; item = item->next, i++) { - authtype = g_object_get_data ((GObject *) item->data, "authtype"); - if (!authtype) - continue; - if (!strcmp (authtype->authproto, url->authmech)) { - gtk_option_menu_set_history (gsvc->authtype, i); - g_signal_emit_by_name (item->data, "activate"); - break; - } - } - g_list_free (children); - - has_auth = TRUE; - } - camel_url_free (url); - - gtk_toggle_button_set_active (gsvc->remember, service->save_passwd); - - return has_auth; -} - -static gint -provider_compare (const CamelProvider *p1, const CamelProvider *p2) -{ - /* sort providers based on "location" (ie. local or remote) */ - if (p1->flags & CAMEL_PROVIDER_IS_REMOTE) { - if (p2->flags & CAMEL_PROVIDER_IS_REMOTE) - return 0; - return -1; - } else { - if (p2->flags & CAMEL_PROVIDER_IS_REMOTE) - return 1; - return 0; - } -} - -static void -ssl_option_activate (GtkWidget *widget, gpointer user_data) -{ - MailAccountGuiService *service = user_data; - - service->ssl_selected = widget; -} - -static void -construct_ssl_menu (MailAccountGuiService *service) -{ - GtkWidget *menu, *item = NULL; - int i; - - menu = gtk_menu_new (); - - for (i = 0; i < num_ssl_options; i++) { - item = gtk_menu_item_new_with_label (_(ssl_options[i].label)); - g_object_set_data ((GObject *) item, "use_ssl", ssl_options[i].value); - g_signal_connect (item, "activate", G_CALLBACK (ssl_option_activate), service); - gtk_widget_show (item); - gtk_menu_shell_append(GTK_MENU_SHELL(menu), item); - } - - gtk_option_menu_remove_menu (service->use_ssl); - gtk_option_menu_set_menu (service->use_ssl, menu); - - gtk_option_menu_set_history (service->use_ssl, i - 1); - g_signal_emit_by_name (item, "activate", service); -} - -static void -clear_menu (GtkWidget *menu) -{ - while (GTK_MENU_SHELL (menu)->children) - gtk_container_remove (GTK_CONTAINER (menu), GTK_MENU_SHELL (menu)->children->data); -} - -static inline int -sig_get_index (MailConfigSignature *sig) -{ - return sig ? sig->id + 2 : 0; -} - -static inline int -sig_gui_get_index (MailAccountGui *gui) -{ - if (gui->auto_signature) - return 1; - return sig_get_index (gui->def_signature); -} - -static void -sig_fill_options (MailAccountGui *gui) -{ - GtkWidget *menu; - GtkWidget *mi; - GSList *l; - MailConfigSignature *sig; - - menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (gui->sig_option_menu)); - - if (menu) - clear_menu (menu); - else - menu = gtk_menu_new (); - - gtk_menu_shell_append(GTK_MENU_SHELL(menu), gtk_menu_item_new_with_label (_("None"))); - gtk_menu_shell_append(GTK_MENU_SHELL(menu), gtk_menu_item_new_with_label (_("Autogenerated"))); - /* gtk_menu_shell_append(GTK_MENU_SHELL(menu), gtk_menu_item_new_with_label (_("Random"))); */ - - for (l = mail_config_get_signature_list (); l; l = l->next) { - sig = l->data; - mi = gtk_menu_item_new_with_label (sig->name); - g_object_set_data ((GObject *) mi, "sig", sig); - gtk_widget_show (mi); - gtk_menu_shell_append(GTK_MENU_SHELL(menu), mi); - } -} - -static void -sig_changed (GtkWidget *w, MailAccountGui *gui) -{ - GtkWidget *active; - int index; - - active = gtk_menu_get_active (GTK_MENU (w)); - index = g_list_index (GTK_MENU_SHELL (w)->children, active); - - gui->def_signature = (MailConfigSignature *) g_object_get_data(G_OBJECT(active), "sig"); - gui->auto_signature = index == 1 ? TRUE : FALSE; -} - -static void -sig_switch_to_list (GtkWidget *w, MailAccountGui *gui) -{ - gtk_window_set_transient_for (GTK_WINDOW (gtk_widget_get_toplevel (w)), NULL); - gdk_window_raise (GTK_WIDGET (gui->dialog)->window); - gtk_notebook_set_current_page (GTK_NOTEBOOK (glade_xml_get_widget (gui->dialog->gui, "notebook")), 3); -} - -static void -sig_add_new_signature (GtkWidget *w, MailAccountGui *gui) -{ - GConfClient *gconf; - gboolean send_html; - GtkWidget *parent; - - if (!gui->dialog) - return; - - sig_switch_to_list (w, gui); - - gconf = mail_config_get_gconf_client (); - send_html = gconf_client_get_bool (gconf, "/apps/evolution/mail/composer/send_html", NULL); - - parent = gtk_widget_get_toplevel (w); - parent = GTK_WIDGET_TOPLEVEL (parent) ? parent : NULL; - - gui->def_signature = em_composer_prefs_new_signature ((GtkWindow *) parent, send_html, NULL); - gui->auto_signature = FALSE; - - gtk_option_menu_set_history (GTK_OPTION_MENU (gui->sig_option_menu), sig_gui_get_index (gui)); -} - -static void -setup_signatures (MailAccountGui *gui) -{ - MailConfigSignature *sig; - GSList *signatures; - - signatures = mail_config_get_signature_list (); - sig = g_slist_nth_data (signatures, gui->account->id->def_signature); - - gui->def_signature = sig; - gui->auto_signature = gui->account->id->auto_signature; - gtk_option_menu_set_history (GTK_OPTION_MENU (gui->sig_option_menu), sig_gui_get_index (gui)); -} - -static void -sig_event_client (MailConfigSigEvent event, MailConfigSignature *sig, MailAccountGui *gui) -{ - switch (event) { - case MAIL_CONFIG_SIG_EVENT_ADDED: { - GtkWidget *menu; - GtkWidget *mi; - - d(printf ("accounts ADDED\n")); - mi = gtk_menu_item_new_with_label (sig->name); - g_object_set_data ((GObject *) mi, "sig", sig); - gtk_widget_show (mi); - menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (gui->sig_option_menu)); - gtk_menu_shell_append(GTK_MENU_SHELL(menu), mi); - - break; - } - case MAIL_CONFIG_SIG_EVENT_NAME_CHANGED: { - GtkWidget *menu; - GtkWidget *mi; - - d(printf ("gui NAME CHANGED\n")); - menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (gui->sig_option_menu)); - gtk_widget_ref (menu); - gtk_option_menu_remove_menu (GTK_OPTION_MENU (gui->sig_option_menu)); - mi = g_list_nth_data (GTK_MENU_SHELL (menu)->children, sig_get_index (sig)); - gtk_label_set_text (GTK_LABEL (GTK_BIN (mi)->child), sig->name); - gtk_option_menu_set_menu (GTK_OPTION_MENU (gui->sig_option_menu), menu); - gtk_widget_unref (menu); - gtk_option_menu_set_history (GTK_OPTION_MENU (gui->sig_option_menu), - sig_gui_get_index (gui)); - - break; - } - case MAIL_CONFIG_SIG_EVENT_DELETED: { - GtkWidget *menu; - GtkWidget *mi; - - d(printf ("gui DELETED\n")); - - if (sig == gui->def_signature) { - gui->def_signature = NULL; - gui->auto_signature = TRUE; - gtk_option_menu_set_history (GTK_OPTION_MENU (gui->sig_option_menu), - sig_gui_get_index (gui)); - } - - menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (gui->sig_option_menu)); - mi = g_list_nth_data (GTK_MENU_SHELL (menu)->children, sig_get_index (sig)); - gtk_container_remove (GTK_CONTAINER (menu), mi); - - break; - } - default: - ; - } -} - -static void -prepare_signatures (MailAccountGui *gui) -{ - gui->sig_option_menu = glade_xml_get_widget (gui->xml, "sigOption"); - sig_fill_options (gui); - g_signal_connect (gtk_option_menu_get_menu (GTK_OPTION_MENU (gui->sig_option_menu)), - "selection-done", G_CALLBACK(sig_changed), gui); - - glade_xml_signal_connect_data (gui->xml, "sigAddNewClicked", - G_CALLBACK (sig_add_new_signature), gui); - - if (!gui->dialog) { - gtk_widget_hide (glade_xml_get_widget (gui->xml, "sigLabel")); - gtk_widget_hide (glade_xml_get_widget (gui->xml, "sigOption")); - gtk_widget_hide (glade_xml_get_widget (gui->xml, "sigAddNew")); - } else { - mail_config_signature_register_client ((MailConfigSignatureClient) sig_event_client, gui); - } -} - -#if defined (HAVE_NSS) -static void -smime_changed(MailAccountGui *gui) -{ - int act; - const char *tmp; - - tmp = gtk_entry_get_text(gui->smime_sign_key); - act = tmp && tmp[0]; - gtk_widget_set_sensitive((GtkWidget *)gui->smime_sign_key_clear, act); - gtk_widget_set_sensitive((GtkWidget *)gui->smime_sign_default, act); - if (!act) - gtk_toggle_button_set_active(gui->smime_sign_default, FALSE); - - tmp = gtk_entry_get_text(gui->smime_encrypt_key); - act = tmp && tmp[0]; - gtk_widget_set_sensitive((GtkWidget *)gui->smime_encrypt_key_clear, act); - gtk_widget_set_sensitive((GtkWidget *)gui->smime_encrypt_default, act); - gtk_widget_set_sensitive((GtkWidget *)gui->smime_encrypt_to_self, act); - if (!act) { - gtk_toggle_button_set_active(gui->smime_encrypt_default, FALSE); - gtk_toggle_button_set_active(gui->smime_encrypt_to_self, FALSE); - } -} - -static void -smime_sign_key_selected(GtkWidget *dialog, const char *key, MailAccountGui *gui) -{ - if (key != NULL) { - gtk_entry_set_text(gui->smime_sign_key, key); - smime_changed(gui); - } - - gtk_widget_destroy(dialog); -} - -static void -smime_sign_key_select(GtkWidget *button, MailAccountGui *gui) -{ - GtkWidget *w; - - w = e_cert_selector_new(E_CERT_SELECTOR_SIGNER, gtk_entry_get_text(gui->smime_sign_key)); - gtk_window_set_modal((GtkWindow *)w, TRUE); - gtk_window_set_transient_for((GtkWindow *)w, (GtkWindow *)gui->dialog); - g_signal_connect(w, "selected", G_CALLBACK(smime_sign_key_selected), gui); - gtk_widget_show(w); -} - -static void -smime_sign_key_clear(GtkWidget *w, MailAccountGui *gui) -{ - gtk_entry_set_text(gui->smime_sign_key, ""); - smime_changed(gui); -} - -static void -smime_encrypt_key_selected(GtkWidget *dialog, const char *key, MailAccountGui *gui) -{ - if (key != NULL) { - gtk_entry_set_text(gui->smime_encrypt_key, key); - smime_changed(gui); - } - - gtk_widget_destroy(dialog); -} - -static void -smime_encrypt_key_select(GtkWidget *button, MailAccountGui *gui) -{ - GtkWidget *w; - - w = e_cert_selector_new(E_CERT_SELECTOR_SIGNER, gtk_entry_get_text(gui->smime_encrypt_key)); - gtk_window_set_modal((GtkWindow *)w, TRUE); - gtk_window_set_transient_for((GtkWindow *)w, (GtkWindow *)gui->dialog); - g_signal_connect(w, "selected", G_CALLBACK(smime_encrypt_key_selected), gui); - gtk_widget_show(w); -} - -static void -smime_encrypt_key_clear(GtkWidget *w, MailAccountGui *gui) -{ - gtk_entry_set_text(gui->smime_encrypt_key, ""); - smime_changed(gui); -} -#endif - -MailAccountGui * -mail_account_gui_new (EAccount *account, EMAccountPrefs *dialog) -{ - MailAccountGui *gui; - GtkWidget *button; - - g_object_ref (account); - - gui = g_new0 (MailAccountGui, 1); - gui->account = account; - gui->dialog = dialog; - gui->xml = glade_xml_new (EVOLUTION_GLADEDIR "/mail-config.glade", NULL, NULL); - - /* Management */ - gui->account_name = GTK_ENTRY (glade_xml_get_widget (gui->xml, "management_name")); - gui->default_account = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui->xml, "management_default")); - if (account->name) - gtk_entry_set_text (gui->account_name, account->name); - if (!mail_config_get_default_account () - || (account == mail_config_get_default_account ())) - gtk_toggle_button_set_active (gui->default_account, TRUE); - - /* Identity */ - gui->full_name = GTK_ENTRY (glade_xml_get_widget (gui->xml, "identity_full_name")); - gui->email_address = GTK_ENTRY (glade_xml_get_widget (gui->xml, "identity_address")); - gui->reply_to = GTK_ENTRY (glade_xml_get_widget (gui->xml, "identity_reply_to")); - gui->organization = GTK_ENTRY (glade_xml_get_widget (gui->xml, "identity_organization")); - - prepare_signatures (gui); - - if (account->id->name) - gtk_entry_set_text (gui->full_name, account->id->name); - if (account->id->address) - gtk_entry_set_text (gui->email_address, account->id->address); - if (account->id->reply_to) - gtk_entry_set_text (gui->reply_to, account->id->reply_to); - if (account->id->organization) - gtk_entry_set_text (gui->organization, account->id->organization); - - setup_signatures (gui); - - /* Source */ - gui->source.provider_type = CAMEL_PROVIDER_STORE; - gui->source.type = GTK_OPTION_MENU (glade_xml_get_widget (gui->xml, "source_type_omenu")); - gui->source.description = GTK_LABEL (glade_xml_get_widget (gui->xml, "source_description")); - gui->source.hostname = GTK_ENTRY (glade_xml_get_widget (gui->xml, "source_host")); - g_signal_connect (gui->source.hostname, "changed", - G_CALLBACK (service_changed), &gui->source); - gui->source.username = GTK_ENTRY (glade_xml_get_widget (gui->xml, "source_user")); - g_signal_connect (gui->source.username, "changed", - G_CALLBACK (service_changed), &gui->source); - gui->source.path = GTK_ENTRY (glade_xml_get_widget (gui->xml, "source_path")); - g_signal_connect (gui->source.path, "changed", - G_CALLBACK (service_changed), &gui->source); - gui->source.ssl_hbox = glade_xml_get_widget (gui->xml, "source_ssl_hbox"); - gui->source.use_ssl = GTK_OPTION_MENU (glade_xml_get_widget (gui->xml, "source_use_ssl")); - construct_ssl_menu (&gui->source); - gui->source.no_ssl = glade_xml_get_widget (gui->xml, "source_ssl_disabled"); - gui->source.authtype = GTK_OPTION_MENU (glade_xml_get_widget (gui->xml, "source_auth_omenu")); - gui->source.remember = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui->xml, "source_remember_password")); - gui->source.check_supported = GTK_BUTTON (glade_xml_get_widget (gui->xml, "source_check_supported")); - g_signal_connect (gui->source.check_supported, "clicked", - G_CALLBACK (service_check_supported), &gui->source); - gui->source_auto_check = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui->xml, "extra_auto_check")); - gui->source_auto_check_min = GTK_SPIN_BUTTON (glade_xml_get_widget (gui->xml, "extra_auto_check_min")); - - /* Transport */ - gui->transport.provider_type = CAMEL_PROVIDER_TRANSPORT; - gui->transport.type = GTK_OPTION_MENU (glade_xml_get_widget (gui->xml, "transport_type_omenu")); - gui->transport.description = GTK_LABEL (glade_xml_get_widget (gui->xml, "transport_description")); - gui->transport.hostname = GTK_ENTRY (glade_xml_get_widget (gui->xml, "transport_host")); - g_signal_connect (gui->transport.hostname, "changed", - G_CALLBACK (service_changed), &gui->transport); - gui->transport.username = GTK_ENTRY (glade_xml_get_widget (gui->xml, "transport_user")); - g_signal_connect (gui->transport.username, "changed", - G_CALLBACK (service_changed), &gui->transport); - gui->transport.ssl_hbox = glade_xml_get_widget (gui->xml, "transport_ssl_hbox"); - gui->transport.use_ssl = GTK_OPTION_MENU (glade_xml_get_widget (gui->xml, "transport_use_ssl")); - construct_ssl_menu (&gui->transport); - gui->transport.no_ssl = glade_xml_get_widget (gui->xml, "transport_ssl_disabled"); - gui->transport_needs_auth = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui->xml, "transport_needs_auth")); - g_signal_connect (gui->transport_needs_auth, "toggled", - G_CALLBACK (transport_needs_auth_toggled), gui); - gui->transport.authtype = GTK_OPTION_MENU (glade_xml_get_widget (gui->xml, "transport_auth_omenu")); - gui->transport.remember = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui->xml, "transport_remember_password")); - gui->transport.check_supported = GTK_BUTTON (glade_xml_get_widget (gui->xml, "transport_check_supported")); - g_signal_connect (gui->transport.check_supported, "clicked", - G_CALLBACK (service_check_supported), &gui->transport); - - /* Drafts folder */ - gui->drafts_folder_button = GTK_BUTTON (glade_xml_get_widget (gui->xml, "drafts_button")); - g_signal_connect (gui->drafts_folder_button, "selected", G_CALLBACK (folder_selected), &gui->drafts_folder_uri); - if (account->drafts_folder_uri) - gui->drafts_folder_uri = g_strdup (account->drafts_folder_uri); - else - gui->drafts_folder_uri = g_strdup (default_drafts_folder_uri); - em_folder_selection_button_set_selection((EMFolderSelectionButton *)gui->drafts_folder_button, gui->drafts_folder_uri); - - /* Sent folder */ - gui->sent_folder_button = GTK_BUTTON (glade_xml_get_widget (gui->xml, "sent_button")); - g_signal_connect (gui->sent_folder_button, "selected", G_CALLBACK (folder_selected), &gui->sent_folder_uri); - if (account->sent_folder_uri) - gui->sent_folder_uri = g_strdup (account->sent_folder_uri); - else - gui->sent_folder_uri = g_strdup (default_sent_folder_uri); - em_folder_selection_button_set_selection((EMFolderSelectionButton *)gui->sent_folder_button, gui->sent_folder_uri); - - /* Special Folders "Reset Defaults" button */ - button = glade_xml_get_widget (gui->xml, "default_folders_button"); - g_signal_connect (button, "clicked", G_CALLBACK (default_folders_clicked), gui); - - /* Always Cc */ - gui->always_cc = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui->xml, "always_cc")); - gtk_toggle_button_set_active (gui->always_cc, account->always_cc); - gui->cc_addrs = GTK_ENTRY (glade_xml_get_widget (gui->xml, "cc_addrs")); - if (account->cc_addrs) - gtk_entry_set_text (gui->cc_addrs, account->cc_addrs); - - /* Always Bcc */ - gui->always_bcc = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui->xml, "always_bcc")); - gtk_toggle_button_set_active (gui->always_bcc, account->always_bcc); - gui->bcc_addrs = GTK_ENTRY (glade_xml_get_widget (gui->xml, "bcc_addrs")); - if (account->bcc_addrs) - gtk_entry_set_text (gui->bcc_addrs, account->bcc_addrs); - - /* Security */ - gui->pgp_key = GTK_ENTRY (glade_xml_get_widget (gui->xml, "pgp_key")); - if (account->pgp_key) - gtk_entry_set_text (gui->pgp_key, account->pgp_key); - gui->pgp_encrypt_to_self = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui->xml, "pgp_encrypt_to_self")); - gtk_toggle_button_set_active (gui->pgp_encrypt_to_self, account->pgp_encrypt_to_self); - gui->pgp_always_sign = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui->xml, "pgp_always_sign")); - gtk_toggle_button_set_active (gui->pgp_always_sign, account->pgp_always_sign); - gui->pgp_no_imip_sign = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui->xml, "pgp_no_imip_sign")); - gtk_toggle_button_set_active (gui->pgp_no_imip_sign, account->pgp_no_imip_sign); - gui->pgp_always_trust = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui->xml, "pgp_always_trust")); - gtk_toggle_button_set_active (gui->pgp_always_trust, account->pgp_always_trust); - -#if defined (HAVE_NSS) - gui->smime_sign_key = (GtkEntry *)glade_xml_get_widget (gui->xml, "smime_sign_key"); - if (account->smime_sign_key) - gtk_entry_set_text(gui->smime_sign_key, account->smime_sign_key); - gui->smime_sign_key_select = (GtkButton *)glade_xml_get_widget (gui->xml, "smime_sign_key_select"); - gui->smime_sign_key_clear = (GtkButton *)glade_xml_get_widget (gui->xml, "smime_sign_key_clear"); - g_signal_connect(gui->smime_sign_key_select, "clicked", G_CALLBACK(smime_sign_key_select), gui); - g_signal_connect(gui->smime_sign_key_clear, "clicked", G_CALLBACK(smime_sign_key_clear), gui); - - gui->smime_sign_default = (GtkToggleButton *)glade_xml_get_widget (gui->xml, "smime_sign_default"); - gtk_toggle_button_set_active(gui->smime_sign_default, account->smime_sign_default); - - gui->smime_encrypt_key = (GtkEntry *)glade_xml_get_widget (gui->xml, "smime_encrypt_key"); - if (account->smime_encrypt_key) - gtk_entry_set_text(gui->smime_encrypt_key, account->smime_encrypt_key); - gui->smime_encrypt_key_select = (GtkButton *)glade_xml_get_widget (gui->xml, "smime_encrypt_key_select"); - gui->smime_encrypt_key_clear = (GtkButton *)glade_xml_get_widget (gui->xml, "smime_encrypt_key_clear"); - g_signal_connect(gui->smime_encrypt_key_select, "clicked", G_CALLBACK(smime_encrypt_key_select), gui); - g_signal_connect(gui->smime_encrypt_key_clear, "clicked", G_CALLBACK(smime_encrypt_key_clear), gui); - - gui->smime_encrypt_default = (GtkToggleButton *)glade_xml_get_widget (gui->xml, "smime_encrypt_default"); - gtk_toggle_button_set_active(gui->smime_encrypt_default, account->smime_encrypt_default); - gui->smime_encrypt_to_self = (GtkToggleButton *)glade_xml_get_widget (gui->xml, "smime_encrypt_to_self"); - gtk_toggle_button_set_active(gui->smime_encrypt_to_self, account->smime_encrypt_to_self); - smime_changed(gui); -#else - { - /* Since we don't have NSS, hide the S/MIME config options */ - GtkWidget *frame; - - frame = glade_xml_get_widget (gui->xml, "smime_frame"); - gtk_widget_destroy (frame); - } -#endif /* HAVE_NSS */ - - return gui; -} - -void -mail_account_gui_setup (MailAccountGui *gui, GtkWidget *top) -{ - GtkWidget *stores, *transports, *item; - GtkWidget *fstore = NULL, *ftransport = NULL; - int si = 0, hstore = 0, ti = 0, htransport = 0; - int max_width = 0; - char *max_authname = NULL; - char *source_proto, *transport_proto; - GList *providers, *l; - - if (gui->account->source && gui->account->source->url) { - source_proto = gui->account->source->url; - source_proto = g_strndup (source_proto, strcspn (source_proto, ":")); - } else - source_proto = NULL; - - if (gui->account->transport && gui->account->transport->url) { - transport_proto = gui->account->transport->url; - transport_proto = g_strndup (transport_proto, strcspn (transport_proto, ":")); - } else - transport_proto = NULL; - - /* Construct source/transport option menus */ - stores = gtk_menu_new (); - transports = gtk_menu_new (); - providers = camel_session_list_providers (session, TRUE); - - /* sort the providers, remote first */ - providers = g_list_sort (providers, (GCompareFunc) provider_compare); - - for (l = providers; l; l = l->next) { - CamelProvider *provider = l->data; - - if (!(!strcmp (provider->domain, "mail") || !strcmp (provider->domain, "news"))) - continue; - - item = NULL; - if (provider->object_types[CAMEL_PROVIDER_STORE] && provider->flags & CAMEL_PROVIDER_IS_SOURCE) { - item = gtk_menu_item_new_with_label (provider->name); - g_object_set_data ((GObject *) gui->source.type, provider->protocol, item); - g_object_set_data ((GObject *) item, "provider", provider); - g_object_set_data ((GObject *) item, "number", GUINT_TO_POINTER (si)); - g_signal_connect (item, "activate", G_CALLBACK (source_type_changed), gui); - - gtk_menu_shell_append(GTK_MENU_SHELL(stores), item); - - gtk_widget_show (item); - - if (!fstore) { - fstore = item; - hstore = si; - } - - if (source_proto && !strcasecmp (provider->protocol, source_proto)) { - fstore = item; - hstore = si; - } - - si++; - } - - if (provider->object_types[CAMEL_PROVIDER_TRANSPORT]) { - item = gtk_menu_item_new_with_label (provider->name); - g_object_set_data ((GObject *) gui->transport.type, provider->protocol, item); - g_object_set_data ((GObject *) item, "provider", provider); - g_object_set_data ((GObject *) item, "number", GUINT_TO_POINTER (ti)); - g_signal_connect (item, "activate", G_CALLBACK (transport_type_changed), gui); - - gtk_menu_shell_append(GTK_MENU_SHELL(transports), item); - - gtk_widget_show (item); - - if (CAMEL_PROVIDER_IS_STORE_AND_TRANSPORT (provider)) - gtk_widget_set_sensitive (item, FALSE); - - if (!ftransport) { - ftransport = item; - htransport = ti; - } - - if (transport_proto && !strcasecmp (provider->protocol, transport_proto)) { - ftransport = item; - htransport = ti; - } - - ti++; - } - - if (item && provider->authtypes) { - /*GdkFont *font = GTK_WIDGET (item)->style->font;*/ - CamelServiceAuthType *at; - int width; - GList *a; - - for (a = provider->authtypes; a; a = a->next) { - at = a->data; - - /* Just using string length is probably good enough, - as we only use the width of the widget, not the string */ - /*width = gdk_string_width (font, at->name);*/ - width = strlen(at->name) * 14; - if (width > max_width) { - max_authname = at->name; - max_width = width; - } - } - } - } - g_list_free (providers); - - /* add a "None" option to the stores menu */ - item = gtk_menu_item_new_with_label (_("None")); - g_object_set_data ((GObject *) item, "provider", NULL); - g_signal_connect (item, "activate", G_CALLBACK (source_type_changed), gui); - - gtk_menu_shell_append(GTK_MENU_SHELL(stores), item); - - gtk_widget_show (item); - - if (!fstore || !source_proto) { - fstore = item; - hstore = si; - } - - /* set the menus on the optionmenus */ - gtk_option_menu_remove_menu (gui->source.type); - gtk_option_menu_set_menu (gui->source.type, stores); - - gtk_option_menu_remove_menu (gui->transport.type); - gtk_option_menu_set_menu (gui->transport.type, transports); - - /* Force the authmenus to the width of the widest element */ - if (max_authname) { - GtkWidget *menu; - GtkRequisition size_req; - - menu = gtk_menu_new (); - item = gtk_menu_item_new_with_label (max_authname); - gtk_menu_shell_append(GTK_MENU_SHELL(menu), item); - gtk_widget_show_all (menu); - gtk_option_menu_set_menu (gui->source.authtype, menu); - gtk_widget_show (GTK_WIDGET (gui->source.authtype)); - gtk_widget_size_request (GTK_WIDGET (gui->source.authtype), - &size_req); - - gtk_widget_set_size_request (GTK_WIDGET (gui->source.authtype), - size_req.width, -1); - gtk_widget_set_size_request (GTK_WIDGET (gui->transport.authtype), - size_req.width, -1); - } - - if (top != NULL) { - gtk_widget_show_all (top); - } - - if (fstore) { - g_signal_emit_by_name (fstore, "activate"); - gtk_option_menu_set_history (gui->source.type, hstore); - } - - if (ftransport) { - g_signal_emit_by_name (ftransport, "activate"); - gtk_option_menu_set_history (gui->transport.type, htransport); - } - - if (source_proto) { - setup_service (&gui->source, gui->account->source); - gui->source.provider_type = CAMEL_PROVIDER_STORE; - g_free (source_proto); - if (gui->account->source->auto_check) { - gtk_toggle_button_set_active (gui->source_auto_check, TRUE); - gtk_spin_button_set_value (gui->source_auto_check_min, - gui->account->source->auto_check_time); - } - } - - if (transport_proto) { - if (setup_service (&gui->transport, gui->account->transport)) - gtk_toggle_button_set_active (gui->transport_needs_auth, TRUE); - gui->transport.provider_type = CAMEL_PROVIDER_TRANSPORT; - g_free (transport_proto); - } -} - -static void -save_service (MailAccountGuiService *gsvc, GHashTable *extra_config, EAccountService *service) -{ - CamelURL *url; - const char *str; - - if (!gsvc->provider) { - g_free (service->url); - service->url = NULL; - return; - } - - url = g_new0 (CamelURL, 1); - url->protocol = g_strdup (gsvc->provider->protocol); - - if (CAMEL_PROVIDER_ALLOWS (gsvc->provider, CAMEL_URL_PART_USER)) { - str = gtk_entry_get_text (gsvc->username); - if (str && *str) - url->user = g_strstrip (g_strdup (str)); - } - - if (CAMEL_PROVIDER_ALLOWS (gsvc->provider, CAMEL_URL_PART_AUTH) && - GTK_WIDGET_IS_SENSITIVE (gsvc->authtype) && gsvc->authitem && url->user) { - CamelServiceAuthType *authtype; - - authtype = g_object_get_data(G_OBJECT(gsvc->authitem), "authtype"); - if (authtype && authtype->authproto && *authtype->authproto) - url->authmech = g_strdup (authtype->authproto); - - service->save_passwd = gtk_toggle_button_get_active (gsvc->remember); - } - - if (CAMEL_PROVIDER_ALLOWS (gsvc->provider, CAMEL_URL_PART_HOST)) { - char *pport; - - str = gtk_entry_get_text (gsvc->hostname); - if (str && *str) { - pport = strchr (str, ':'); - if (pport) { - url->host = g_strndup (str, pport - str); - url->port = atoi (pport + 1); - } else - url->host = g_strdup (str); - } - } - - if (CAMEL_PROVIDER_ALLOWS (gsvc->provider, CAMEL_URL_PART_PATH)) { - str = gtk_entry_get_text (gsvc->path); - if (str && *str) - url->path = g_strdup (str); - } - - if (gsvc->provider->flags & CAMEL_PROVIDER_SUPPORTS_SSL) { - const char *use_ssl; - - use_ssl = g_object_get_data(G_OBJECT(gsvc->ssl_selected), "use_ssl"); - - /* set the value to either "always" or "when-possible" - but don't bother setting it for "never" */ - if (strcmp (use_ssl, "never")) - camel_url_set_param (url, "use_ssl", use_ssl); - } - - if (extra_config) - extract_values (gsvc, extra_config, url); - - g_free (service->url); - service->url = camel_url_to_string (url, 0); - - /* Temporary until keep_on_server moves into the POP provider */ - if (camel_url_get_param (url, "keep_on_server")) - service->keep_on_server = TRUE; - - camel_url_free (url); -} - -static void -add_new_store (char *uri, CamelStore *store, void *user_data) -{ - MailComponent *component = mail_component_peek (); - EAccount *account = user_data; - - if (store == NULL) - return; - - mail_component_add_store (component, store, account->name); -} - -gboolean -mail_account_gui_save (MailAccountGui *gui) -{ - EAccount *account, *new; - CamelProvider *provider = NULL; - gboolean is_new = FALSE; - const char *new_name; - gboolean is_storage; - GSList *signatures; - - if (!mail_account_gui_identity_complete (gui, NULL) || - !mail_account_gui_source_complete (gui, NULL) || - !mail_account_gui_transport_complete (gui, NULL) || - !mail_account_gui_management_complete (gui, NULL)) - return FALSE; - - new = gui->account; - - /* this would happen at an inconvenient time in the druid, - * but the druid performs its own check so this can't happen - * here. */ - - new_name = gtk_entry_get_text (gui->account_name); - account = mail_config_get_account_by_name (new_name); - - if (account && account != new) { - e_notice (gui->account_name, GTK_MESSAGE_ERROR, _("You may not create two accounts with the same name.")); - return FALSE; - } - - account = new; - - new = e_account_new (); - new->name = g_strdup (new_name); - new->enabled = account->enabled; - - /* construct the identity */ - new->id->name = g_strdup (gtk_entry_get_text (gui->full_name)); - new->id->address = g_strdup (gtk_entry_get_text (gui->email_address)); - new->id->reply_to = g_strdup (gtk_entry_get_text (gui->reply_to)); - new->id->organization = g_strdup (gtk_entry_get_text (gui->organization)); - - /* signatures */ - signatures = mail_config_get_signature_list (); - new->id->def_signature = g_slist_index (signatures, gui->def_signature); - new->id->auto_signature = gui->auto_signature; - - /* source */ - save_service (&gui->source, gui->extra_config, new->source); - if (new->source->url) - provider = camel_session_get_provider (session, new->source->url, NULL); - - new->source->auto_check = gtk_toggle_button_get_active (gui->source_auto_check); - if (new->source->auto_check) - new->source->auto_check_time = gtk_spin_button_get_value_as_int (gui->source_auto_check_min); - - /* transport */ - if (CAMEL_PROVIDER_IS_STORE_AND_TRANSPORT (gui->transport.provider)) { - /* The transport URI is the same as the source URI. */ - save_service (&gui->source, gui->extra_config, new->transport); - } else - save_service (&gui->transport, NULL, new->transport); - - /* Check to make sure that the Drafts folder uri is "valid" before assigning it */ - if (mail_config_get_account_by_source_url (gui->drafts_folder_uri) || - !strncmp (gui->drafts_folder_uri, "file:", 5)) { - new->drafts_folder_uri = g_strdup (gui->drafts_folder_uri); - } else { - /* assign defaults - the uri is unknown to us (probably pointed to an old source url) */ - new->drafts_folder_uri = g_strdup (default_drafts_folder_uri); - } - - /* Check to make sure that the Sent folder uri is "valid" before assigning it */ - if (mail_config_get_account_by_source_url (gui->sent_folder_uri) || - !strncmp (gui->sent_folder_uri, "file:", 5)) { - new->sent_folder_uri = g_strdup (gui->sent_folder_uri); - } else { - /* assign defaults - the uri is unknown to us (probably pointed to an old source url) */ - new->sent_folder_uri = g_strdup (default_sent_folder_uri); - } - - new->always_cc = gtk_toggle_button_get_active (gui->always_cc); - new->cc_addrs = g_strdup (gtk_entry_get_text (gui->cc_addrs)); - new->always_bcc = gtk_toggle_button_get_active (gui->always_bcc); - new->bcc_addrs = g_strdup (gtk_entry_get_text (gui->bcc_addrs)); - - new->pgp_key = g_strdup (gtk_entry_get_text (gui->pgp_key)); - new->pgp_encrypt_to_self = gtk_toggle_button_get_active (gui->pgp_encrypt_to_self); - new->pgp_always_sign = gtk_toggle_button_get_active (gui->pgp_always_sign); - new->pgp_no_imip_sign = gtk_toggle_button_get_active (gui->pgp_no_imip_sign); - new->pgp_always_trust = gtk_toggle_button_get_active (gui->pgp_always_trust); - -#if defined (HAVE_NSS) - new->smime_sign_default = gtk_toggle_button_get_active (gui->smime_sign_default); - new->smime_sign_key = g_strdup (gtk_entry_get_text (gui->smime_sign_key)); - - new->smime_encrypt_default = gtk_toggle_button_get_active (gui->smime_encrypt_default); - new->smime_encrypt_key = g_strdup (gtk_entry_get_text (gui->smime_encrypt_key)); - new->smime_encrypt_to_self = gtk_toggle_button_get_active (gui->smime_encrypt_to_self); -#endif /* HAVE_NSS */ - - is_storage = provider && (provider->flags & CAMEL_PROVIDER_IS_STORAGE) && - !(provider->flags & CAMEL_PROVIDER_IS_EXTERNAL); - - if (!mail_config_find_account (account)) { - /* this is a new account so add it to our account-list */ - is_new = TRUE; - } else if (account->source->url) { - /* this means the account was edited - if the old and - new source urls are not identical, replace the old - store with the new store */ -#define sources_equal(old,new) (new->url && !strcmp (old->url, new->url)) - if (!sources_equal (account->source, new->source)) { - /* Remove the old store from the folder-tree */ - mail_component_remove_store_by_uri (mail_component_peek (), account->source->url); - } - } - - /* update the old account with the new settings */ - e_account_import (account, new); - g_object_unref (new); - - if (is_new) { - mail_config_add_account (account); - } else { - e_account_list_change (mail_config_get_accounts (), account); - } - - /* if the account provider is something we can stick - in the folder-tree and not added by some other - component, then get the CamelStore and add it to - the folder-tree */ - if (is_storage && account->enabled) - mail_get_store (account->source->url, NULL, add_new_store, account); - - if (gtk_toggle_button_get_active (gui->default_account)) - mail_config_set_default_account (account); - - mail_config_save_accounts (); - mail_config_write_account_sig (account, -1); - - mail_autoreceive_setup (); - - return TRUE; -} - -void -mail_account_gui_destroy (MailAccountGui *gui) -{ - if (gui->dialog) - mail_config_signature_unregister_client ((MailConfigSignatureClient) sig_event_client, gui); - - g_object_unref (gui->xml); - g_object_unref (gui->account); - - if (gui->extra_config) - g_hash_table_destroy (gui->extra_config); - - g_free (gui->drafts_folder_uri); - g_free (gui->sent_folder_uri); - g_free (gui); -} diff --git a/mail/mail-account-gui.h b/mail/mail-account-gui.h deleted file mode 100644 index 3574eddf28..0000000000 --- a/mail/mail-account-gui.h +++ /dev/null @@ -1,143 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Authors: - * Jeffrey Stedfast <fejj@ximian.com> - * Dan Winship <danw@ximian.com> - * - * Copyright 2001-2003 Ximian, Inc. (www.ximian.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public - * License as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - * - */ - -#ifndef MAIL_ACCOUNT_GUI_H -#define MAIL_ACCOUNT_GUI_H - -#ifdef __cplusplus -extern "C" { -#pragma } -#endif /* __cplusplus */ - -#include <gtk/gtk.h> -#include <libgnomeui/gnome-file-entry.h> -#include <glade/glade-xml.h> -#include <camel/camel-provider.h> - -#include "mail-config.h" -#include "em-account-prefs.h" - -typedef struct { - GtkOptionMenu *type; - GtkLabel *description; - GtkEntry *hostname; - GtkEntry *username; - GtkEntry *path; - GtkOptionMenu *use_ssl; - GtkWidget *ssl_selected; - GtkWidget *ssl_hbox; - GtkWidget *no_ssl; - GtkOptionMenu *authtype; - GtkWidget *authitem; - GtkToggleButton *remember; - GtkButton *check_supported; - - CamelProvider *provider; - CamelProviderType provider_type; -} MailAccountGuiService; - -typedef struct { - EAccount *account; - EMAccountPrefs *dialog; - GladeXML *xml; - - /* identity */ - GtkEntry *full_name; - GtkEntry *email_address; - GtkEntry *reply_to; - GtkEntry *organization; - - /* signatures */ - GtkWidget *sig_option_menu; - - MailConfigSignature *def_signature; - gboolean auto_signature; - - /* incoming mail */ - MailAccountGuiService source; - GtkToggleButton *source_auto_check; - GtkSpinButton *source_auto_check_min; - - /* extra incoming config */ - GHashTable *extra_config; - - /* outgoing mail */ - MailAccountGuiService transport; - GtkToggleButton *transport_needs_auth; - - /* account management */ - GtkEntry *account_name; - GtkToggleButton *default_account; - - /* special folders */ - GtkButton *drafts_folder_button; - char *drafts_folder_uri; - GtkButton *sent_folder_button; - char *sent_folder_uri; - - /* always cc/bcc */ - GtkToggleButton *always_cc; - GtkEntry *cc_addrs; - GtkToggleButton *always_bcc; - GtkEntry *bcc_addrs; - - /* Security */ - GtkEntry *pgp_key; - GtkToggleButton *pgp_encrypt_to_self; - GtkToggleButton *pgp_always_sign; - GtkToggleButton *pgp_no_imip_sign; - GtkToggleButton *pgp_always_trust; - - GtkToggleButton *smime_sign_default; - GtkEntry *smime_sign_key; - GtkButton *smime_sign_key_select; - GtkButton *smime_sign_key_clear; - GtkButton *smime_sign_select; - GtkToggleButton *smime_encrypt_default; - GtkToggleButton *smime_encrypt_to_self; - GtkEntry *smime_encrypt_key; - GtkButton *smime_encrypt_key_select; - GtkButton *smime_encrypt_key_clear; -} MailAccountGui; - - -MailAccountGui *mail_account_gui_new (EAccount *account, EMAccountPrefs *dialog); -void mail_account_gui_setup (MailAccountGui *gui, GtkWidget *top); -gboolean mail_account_gui_save (MailAccountGui *gui); -void mail_account_gui_destroy (MailAccountGui *gui); - -gboolean mail_account_gui_identity_complete (MailAccountGui *gui, GtkWidget **incomplete); -gboolean mail_account_gui_source_complete (MailAccountGui *gui, GtkWidget **incomplete); -gboolean mail_account_gui_transport_complete (MailAccountGui *gui, GtkWidget **incomplete); -gboolean mail_account_gui_management_complete (MailAccountGui *gui, GtkWidget **incomplete); - -void mail_account_gui_build_extra_conf (MailAccountGui *gui, const char *url); - -void mail_account_gui_auto_detect_extra_conf (MailAccountGui *gui); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* MAIL_ACCOUNT_GUI_H */ diff --git a/mail/mail-autofilter.c b/mail/mail-autofilter.c deleted file mode 100644 index 79ab30f5dd..0000000000 --- a/mail/mail-autofilter.c +++ /dev/null @@ -1,444 +0,0 @@ -/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ -/* mail-autofilter.c - * - * Copyright (C) 2000 Ximian, Inc. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public - * License as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - * - * Authors: - * Michael Zucchi <notzed@ximian.com> - * Ettore Perazzoli <ettore@ximian.com> - */ - -/* Code for autogenerating rules or filters from a message. */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <ctype.h> -#include <string.h> - -#include <glib.h> -#include <libgnome/gnome-i18n.h> -#include <libgnomeui/gnome-app.h> -#include <libgnomeui/gnome-app-helper.h> -#include <libgnomeui/gnome-popup-menu.h> - -#include "mail-vfolder.h" -#include "mail-autofilter.h" -#include "mail-component.h" - -#include "camel/camel.h" - -#include "filter/vfolder-context.h" -#include "filter/vfolder-rule.h" -#include "filter/vfolder-editor.h" - -#include "filter/filter-context.h" -#include "filter/filter-filter.h" -#include "filter/filter-editor.h" -#include "filter/filter-option.h" - - -static void -rule_match_recipients (RuleContext *context, FilterRule *rule, CamelInternetAddress *iaddr) -{ - FilterPart *part; - FilterElement *element; - int i; - const char *real, *addr; - char *namestr; - - /* address types etc should handle multiple values */ - for (i = 0; camel_internet_address_get (iaddr, i, &real, &addr); i++) { - part = rule_context_create_part (context, "to"); - filter_rule_add_part ((FilterRule *)rule, part); - element = filter_part_find_element (part, "recipient-type"); - filter_option_set_current ((FilterOption *)element, "contains"); - element = filter_part_find_element (part, "recipient"); - filter_input_set_value ((FilterInput *)element, addr); - - namestr = g_strdup_printf (_("Mail to %s"), real && real[0] ? real : addr); - filter_rule_set_name (rule, namestr); - g_free (namestr); - } -} - - -/* remove 're' part of a subject */ -static const char * -strip_re (const char *subject) -{ - const unsigned char *s, *p; - - s = (unsigned char *) subject; - - while (*s) { - while (isspace (*s)) - s++; - if (s[0] == 0) - break; - if ((s[0] == 'r' || s[0] == 'R') - && (s[1] == 'e' || s[1] == 'E')) { - p = s+2; - while (isdigit (*p) || (ispunct (*p) && (*p != ':'))) - p++; - if (*p == ':') { - s = p + 1; - } else - break; - } else - break; - } - - return (char *) s; -} - -#if 0 -int -reg_match (char *str, char *regstr) -{ - regex_t reg; - int error; - int ret; - - error = regcomp(®, regstr, REG_EXTENDED|REG_ICASE|REG_NOSUB); - if (error != 0) { - return 0; - } - error = regexec(®, str, 0, NULL, 0); - regfree(®); - return (error == 0); -} -#endif - -static void -rule_add_subject (RuleContext *context, FilterRule *rule, const char *text) -{ - FilterPart *part; - FilterElement *element; - - /* dont match on empty strings ever */ - if (*text == 0) - return; - part = rule_context_create_part (context, "subject"); - filter_rule_add_part ((FilterRule *)rule, part); - element = filter_part_find_element (part, "subject-type"); - filter_option_set_current ((FilterOption *)element, "contains"); - element = filter_part_find_element (part, "subject"); - filter_input_set_value ((FilterInput *)element, text); -} - -static void -rule_add_sender (RuleContext *context, FilterRule *rule, const char *text) -{ - FilterPart *part; - FilterElement *element; - - /* dont match on empty strings ever */ - if (*text == 0) - return; - part = rule_context_create_part (context, "sender"); - filter_rule_add_part ((FilterRule *)rule, part); - element = filter_part_find_element (part, "sender-type"); - filter_option_set_current ((FilterOption *)element, "contains"); - element = filter_part_find_element (part, "sender"); - filter_input_set_value ((FilterInput *)element, text); -} - -/* do a bunch of things on the subject to try and detect mailing lists, remove - unneeded stuff, etc */ -static void -rule_match_subject (RuleContext *context, FilterRule *rule, const char *subject) -{ - const char *s; - const char *s1, *s2; - char *tmp; - - s = strip_re (subject); - /* dont match on empty subject */ - if (*s == 0) - return; - - /* [blahblah] is probably a mailing list, match on it separately */ - s1 = strchr (s, '['); - s2 = strchr (s, ']'); - if (s1 && s2 && s1 < s2) { - /* probably a mailing list, match on the mailing list name */ - tmp = g_alloca (s2 - s1 + 2); - memcpy (tmp, s1, s2 - s1 + 1); - tmp[s2 - s1 + 1] = 0; - g_strstrip (tmp); - rule_add_subject (context, rule, tmp); - s = s2 + 1; - } - /* Froblah: at the start is probably something important (e.g. bug number) */ - s1 = strchr (s, ':'); - if (s1) { - tmp = g_alloca (s1 - s + 1); - memcpy (tmp, s, s1-s); - tmp[s1 - s] = 0; - g_strstrip (tmp); - rule_add_subject (context, rule, tmp); - s = s1+1; - } - - /* just lump the rest together */ - tmp = g_alloca (strlen (s) + 1); - strcpy (tmp, s); - g_strstrip (tmp); - rule_add_subject (context, rule, tmp); -} - -static void -rule_match_mlist(RuleContext *context, FilterRule *rule, const char *mlist) -{ - FilterPart *part; - FilterElement *element; - - if (mlist[0] == 0) - return; - - part = rule_context_create_part(context, "mlist"); - filter_rule_add_part(rule, part); - - element = filter_part_find_element(part, "mlist-type"); - filter_option_set_current((FilterOption *)element, "is"); - - element = filter_part_find_element (part, "mlist"); - filter_input_set_value((FilterInput *)element, mlist); -} - -static void -rule_match_thread (RuleContext *context, FilterRule *rule, const char *msgid) -{ - FilterElement *element; - FilterPart *part; - - if (msgid[0] == 0) - return; - - part = rule_context_create_part (context, "header"); - filter_rule_add_part (rule, part); - - element = filter_part_find_element (part, "header-type"); - filter_option_set_current ((FilterOption *) element, "contains"); - - element = filter_part_find_element (part, "header-field"); - filter_input_set_value ((FilterInput *) element, "References"); - - element = filter_part_find_element (part, "word"); - filter_input_set_value ((FilterInput *) element, msgid); -} - -static void -rule_from_message (FilterRule *rule, RuleContext *context, CamelMimeMessage *msg, int flags) -{ - CamelInternetAddress *addr; - - rule->grouping = FILTER_GROUP_ANY; - - if (flags & AUTO_SUBJECT) { - const char *subject = msg->subject ? msg->subject : ""; - char *namestr; - - rule_match_subject (context, rule, subject); - - namestr = g_strdup_printf (_("Subject is %s"), strip_re (subject)); - filter_rule_set_name (rule, namestr); - g_free (namestr); - } - /* should parse the from address into an internet address? */ - if (flags & AUTO_FROM) { - const CamelInternetAddress *from; - int i; - const char *name, *addr; - char *namestr; - - from = camel_mime_message_get_from (msg); - for (i = 0; camel_internet_address_get (from, i, &name, &addr); i++) { - rule_add_sender (context, rule, addr); - if (name == NULL || name[0] == '\0') - name = addr; - namestr = g_strdup_printf(_("Mail from %s"), name); - filter_rule_set_name (rule, namestr); - g_free (namestr); - } - } - if (flags & AUTO_TO) { - addr = (CamelInternetAddress *)camel_mime_message_get_recipients (msg, CAMEL_RECIPIENT_TYPE_TO); - rule_match_recipients (context, rule, addr); - addr = (CamelInternetAddress *)camel_mime_message_get_recipients (msg, CAMEL_RECIPIENT_TYPE_CC); - rule_match_recipients (context, rule, addr); - } - if (flags & AUTO_MLIST) { - char *name, *mlist; - - mlist = camel_header_raw_check_mailing_list (&((CamelMimePart *)msg)->headers); - if (mlist) { - rule_match_mlist(context, rule, mlist); - name = g_strdup_printf (_("%s mailing list"), mlist); - filter_rule_set_name(rule, name); - g_free(name); - } - g_free(mlist); - } - if (flags & AUTO_THREAD) { - const char *msgid = NULL, *refs = NULL; - char *name; - - if (!(refs = camel_medium_get_header ((CamelMedium *) msg, "References"))) { - if (!(refs = camel_medium_get_header ((CamelMedium *) msg, "In-Reply-To"))) - msgid = camel_mime_message_get_message_id (msg); - } - - if (refs || msgid) { - struct _camel_header_references *r = NULL; - - if (refs) { - r = camel_header_references_decode (refs); - msgid = r->id; - } - - rule_match_thread (context, rule, msgid); - name = g_strdup_printf (_("Replies to %s"), msgid); - - if (r) - camel_header_references_list_clear (&r); - } - } -} - -FilterRule * -vfolder_rule_from_message (VfolderContext *context, CamelMimeMessage *msg, int flags, const char *source) -{ - VfolderRule *rule; - - rule = vfolder_rule_new (); - vfolder_rule_add_source (rule, source); - rule_from_message ((FilterRule *)rule, (RuleContext *)context, msg, flags); - - return (FilterRule *)rule; -} - -FilterRule * -filter_rule_from_message (FilterContext *context, CamelMimeMessage *msg, int flags) -{ - FilterFilter *rule; - FilterPart *part; - - rule = filter_filter_new (); - rule_from_message ((FilterRule *)rule, (RuleContext *)context, msg, flags); - - part = filter_context_next_action (context, NULL); - filter_filter_add_action (rule, filter_part_clone (part)); - - return (FilterRule *)rule; -} - -void -filter_gui_add_from_message (CamelMimeMessage *msg, const char *source, int flags) -{ - FilterContext *fc; - char *user, *system; - FilterRule *rule; - - g_return_if_fail (msg != NULL); - - fc = filter_context_new (); - user = g_strdup_printf ("%s/mail/filters.xml", - mail_component_peek_base_directory (mail_component_peek ())); - system = EVOLUTION_PRIVDATADIR "/filtertypes.xml"; - rule_context_load ((RuleContext *)fc, system, user); - rule = filter_rule_from_message (fc, msg, flags); - - filter_rule_set_source (rule, source); - - rule_context_add_rule_gui ((RuleContext *)fc, rule, _("Add Filter Rule"), user); - g_free (user); - g_object_unref (fc); -} - -void -mail_filter_rename_uri(CamelStore *store, const char *olduri, const char *newuri) -{ - GCompareFunc uri_cmp = CAMEL_STORE_CLASS(CAMEL_OBJECT_GET_CLASS(store))->compare_folder_name; - FilterContext *fc; - char *user, *system; - GList *changed; - - fc = filter_context_new (); - user = g_strdup_printf ("%s/mail/filters.xml", mail_component_peek_base_directory (mail_component_peek ())); - system = EVOLUTION_PRIVDATADIR "/filtertypes.xml"; - rule_context_load ((RuleContext *)fc, system, user); - - changed = rule_context_rename_uri((RuleContext *)fc, olduri, newuri, uri_cmp); - if (changed) { - printf("Folder rename '%s' -> '%s' changed filters, resaving\n", olduri, newuri); - if (rule_context_save((RuleContext *)fc, user) == -1) - g_warning("Could not write out changed filter rules\n"); - rule_context_free_uri_list((RuleContext *)fc, changed); - } - - g_free(user); - g_object_unref (fc); -} - -void -mail_filter_delete_uri(CamelStore *store, const char *uri) -{ - GCompareFunc uri_cmp = CAMEL_STORE_CLASS(CAMEL_OBJECT_GET_CLASS(store))->compare_folder_name; - FilterContext *fc; - char *user, *system; - GList *deleted; - - fc = filter_context_new (); - user = g_strdup_printf ("%s/mail/filters.xml", mail_component_peek_base_directory (mail_component_peek ())); - system = EVOLUTION_PRIVDATADIR "/filtertypes.xml"; - rule_context_load ((RuleContext *)fc, system, user); - - deleted = rule_context_delete_uri ((RuleContext *) fc, uri, uri_cmp); - if (deleted) { - GtkWidget *dialog; - GString *s; - GList *l; - - s = g_string_new (_("The following filter rule(s):\n")); - l = deleted; - while (l) { - g_string_append_printf (s, " %s\n", (char *)l->data); - l = l->next; - } - g_string_append_printf (s, _("Used the removed folder:\n '%s'\n" - "And have been updated."), uri); - - dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_INFO, - GTK_BUTTONS_CLOSE, "%s", s->str); - g_signal_connect_swapped (dialog, "response", G_CALLBACK (gtk_widget_destroy), dialog); - - g_string_free (s, TRUE); - - gtk_widget_show (dialog); - - printf("Folder deleterename '%s' changed filters, resaving\n", uri); - if (rule_context_save ((RuleContext *) fc, user) == -1) - g_warning ("Could not write out changed filter rules\n"); - rule_context_free_uri_list ((RuleContext *) fc, deleted); - } - - g_free (user); - g_object_unref (fc); -} diff --git a/mail/mail-autofilter.h b/mail/mail-autofilter.h deleted file mode 100644 index a5c2575338..0000000000 --- a/mail/mail-autofilter.h +++ /dev/null @@ -1,51 +0,0 @@ -/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ -/* mail-autofilter.h - * - * Copyright (C) 2000 Ximian, Inc. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public - * License as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - * - * Authors: - * Michael Zucchi <notzed@ximian.com> - * Ettore Perazzoli <ettore@ximian.com> - */ - -#ifndef _MAIL_AUTOFILTER_H -#define _MAIL_AUTOFILTER_H - -#include <filter/filter-rule.h> -#include <filter/filter-context.h> -#include <filter/vfolder-context.h> -#include <camel/camel-mime-message.h> - -enum { - AUTO_SUBJECT = 1, - AUTO_FROM = 2, - AUTO_TO = 4, - AUTO_MLIST = 8, - AUTO_THREAD = 16, -}; - -FilterRule *vfolder_rule_from_message(VfolderContext *context, CamelMimeMessage *msg, int flags, const char *source); -FilterRule *filter_rule_from_message(FilterContext *context, CamelMimeMessage *msg, int flags); - -/* easiest place to put this */ -void filter_gui_add_from_message (CamelMimeMessage *msg, const char *source, int flags); - -/* Also easiest place for these, we should really share a global rule context for this stuff ... */ -void mail_filter_rename_uri(CamelStore *store, const char *olduri, const char *newuri); -void mail_filter_delete_uri(CamelStore *store, const char *uri); - -#endif diff --git a/mail/mail-component-factory.c b/mail/mail-component-factory.c deleted file mode 100644 index d2130ef7ce..0000000000 --- a/mail/mail-component-factory.c +++ /dev/null @@ -1,106 +0,0 @@ -/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ -/* mail-component-factory.c - * - * Authors: Ettore Perazzoli <ettore@ximian.com> - * - * Copyright (C) 2003 Ximian, Inc. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public - * License as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include "em-utils.h" -#include "evolution-composer.h" -#include "mail-component.h" -#include "em-account-prefs.h" -#include "em-composer-prefs.h" -#include "em-mailer-prefs.h" - -#include "mail-config-druid.h" -#include "mail-config-factory.h" -#include "mail-config.h" -#include "mail-mt.h" - -#include <bonobo-activation/bonobo-activation.h> -#include <bonobo/bonobo-shlib-factory.h> - -#include <string.h> - - -#define FACTORY_ID "OAFIID:GNOME_Evolution_Mail_Factory:" BASE_VERSION - -#define COMPONENT_ID "OAFIID:GNOME_Evolution_Mail_Component:" BASE_VERSION -#define COMPOSER_ID "OAFIID:GNOME_Evolution_Mail_Composer:" BASE_VERSION -#define FOLDER_INFO_ID "OAFIID:GNOME_Evolution_FolderInfo:" BASE_VERSION -#define MAIL_CONFIG_ID "OAFIID:GNOME_Evolution_MailConfig:" BASE_VERSION -#define WIZARD_ID "OAFIID:GNOME_Evolution_Mail_Wizard:" BASE_VERSION - - -static BonoboObject * -factory (BonoboGenericFactory *factory, - const char *component_id, - void *closure) -{ - /* EPFIXME this is messy. The IDs are defined all over the place - without a logic... */ - - if (strcmp (component_id, COMPONENT_ID) == 0) { - MailComponent *component = mail_component_peek (); - - bonobo_object_ref (BONOBO_OBJECT (component)); - return BONOBO_OBJECT (component); - } else if (strcmp(component_id, MAIL_CONFIG_ID) == 0) { - return (BonoboObject *)g_object_new (evolution_mail_config_get_type (), NULL); - } else if (strcmp(component_id, WIZARD_ID) == 0) { - return evolution_mail_config_wizard_new(); - } else if (strcmp (component_id, EM_ACCOUNT_PREFS_CONTROL_ID) == 0 - || strcmp (component_id, EM_MAILER_PREFS_CONTROL_ID) == 0 - || strcmp (component_id, EM_COMPOSER_PREFS_CONTROL_ID) == 0) { - return mail_config_control_factory_cb (factory, component_id, CORBA_OBJECT_NIL); - } else if (strcmp(component_id, COMPOSER_ID) == 0) { - /* FIXME: how to remove need for callbacks, probably make the composer more tightly integrated with mail */ - return (BonoboObject *) evolution_composer_new (em_utils_composer_send_cb, em_utils_composer_save_draft_cb); - } - - g_warning (FACTORY_ID ": Don't know what to do with %s", component_id); - return NULL; -} - -static Bonobo_Unknown -make_factory (PortableServer_POA poa, const char *iid, gpointer impl_ptr, CORBA_Environment *ev) -{ - static int init = 0; - - if (!init) { - mail_config_init (); - mail_msg_init (); - init = 1; - } - - return bonobo_shlib_factory_std (FACTORY_ID, poa, impl_ptr, factory, NULL, ev); -} - -static BonoboActivationPluginObject plugin_list[] = { - { FACTORY_ID, make_factory}, - { NULL } -}; - -const BonoboActivationPlugin Bonobo_Plugin_info = { - plugin_list, "Evolution Mail component factory" -}; diff --git a/mail/mail-component.c b/mail/mail-component.c deleted file mode 100644 index 3967ed8a1b..0000000000 --- a/mail/mail-component.c +++ /dev/null @@ -1,900 +0,0 @@ -/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ -/* mail-component.c - * - * Copyright (C) 2003 Ximian Inc. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public - * License as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - * - * Author: Ettore Perazzoli <ettore@ximian.com> - */ - - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <stdlib.h> -#include <string.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <unistd.h> -#include <fcntl.h> -#include <errno.h> - -#include "em-popup.h" -#include "em-utils.h" -#include "em-format.h" -#include "em-folder-tree.h" -#include "em-folder-browser.h" -#include "em-folder-selector.h" -#include "em-folder-selection.h" -#include "em-migrate.h" - -#include "mail-config.h" -#include "mail-component.h" -#include "mail-folder-cache.h" -#include "mail-vfolder.h" -#include "mail-mt.h" -#include "mail-ops.h" -#include "mail-tools.h" -#include "mail-send-recv.h" -#include "mail-session.h" - -#include "e-task-bar.h" - -#include <gtk/gtklabel.h> - -#include <e-util/e-mktemp.h> -#include <e-util/e-dialog-utils.h> - -#include <gal/e-table/e-tree.h> -#include <gal/e-table/e-tree-memory.h> - -#include <camel/camel.h> -#include <camel/camel-file-utils.h> - -#include <bonobo/bonobo-control.h> -#include <bonobo/bonobo-widget.h> - - -#define d(x) x - - -#define PARENT_TYPE bonobo_object_get_type () -static BonoboObjectClass *parent_class = NULL; - -struct _MailComponentPrivate { - char *base_directory; - - EMFolderTreeModel *model; - - EActivityHandler *activity_handler; - - MailAsyncEvent *async_event; - GHashTable *store_hash; /* display_name by store */ - - RuleContext *search_context; - - char *context_path; /* current path for right-click menu */ - - CamelStore *local_store; -}; - -/* Utility functions. */ - -static void -add_store (MailComponent *component, const char *name, CamelStore *store, CamelException *ex) -{ - camel_object_ref (store); - g_hash_table_insert (component->priv->store_hash, store, g_strdup (name)); - em_folder_tree_model_add_store (component->priv->model, store, name); - mail_note_store (store, NULL, NULL, NULL); -} - -static void -load_accounts (MailComponent *component, EAccountList *accounts) -{ - EIterator *iter; - - /* Load each service (don't connect!). Check its provider and - * see if this belongs in the shell's folder list. If so, add - * it. - */ - - iter = e_list_get_iterator ((EList *) accounts); - while (e_iterator_is_valid (iter)) { - EAccountService *service; - EAccount *account; - const char *name; - - account = (EAccount *) e_iterator_get (iter); - service = account->source; - name = account->name; - - if (account->enabled && service->url != NULL) - mail_component_load_store_by_uri (component, service->url, name); - - e_iterator_next (iter); - } - - g_object_unref (iter); -} - -static void -store_go_online (gpointer key, gpointer value, gpointer data) -{ - CamelStore *store = key; - CamelService *service = CAMEL_SERVICE (store); - - if (! (service->provider->flags & CAMEL_PROVIDER_IS_REMOTE) - || (service->provider->flags & CAMEL_PROVIDER_IS_EXTERNAL)) - return; - - if ((CAMEL_IS_DISCO_STORE (service) - && camel_disco_store_status (CAMEL_DISCO_STORE (service)) == CAMEL_DISCO_STORE_OFFLINE) - || service->status != CAMEL_SERVICE_DISCONNECTED) { - mail_store_set_offline (store, FALSE, NULL, NULL); - mail_note_store (store, NULL, NULL, NULL); - } -} - -static void -go_online (MailComponent *component) -{ - camel_session_set_online (session, TRUE); - mail_session_set_interactive (TRUE); - mail_component_stores_foreach (component, store_go_online, NULL); -} - -static void -setup_search_context (MailComponent *component) -{ - MailComponentPrivate *priv = component->priv; - char *user = g_strdup_printf ("%s/evolution/searches.xml", g_get_home_dir ()); /* EPFIXME should be somewhere else. */ - char *system = g_strdup (EVOLUTION_PRIVDATADIR "/vfoldertypes.xml"); - - priv->search_context = rule_context_new (); - g_object_set_data_full (G_OBJECT (priv->search_context), "user", user, g_free); - g_object_set_data_full (G_OBJECT (priv->search_context), "system", system, g_free); - - rule_context_add_part_set (priv->search_context, "partset", filter_part_get_type (), - rule_context_add_part, rule_context_next_part); - - rule_context_add_rule_set (priv->search_context, "ruleset", filter_rule_get_type (), - rule_context_add_rule, rule_context_next_rule); - - rule_context_load (priv->search_context, system, user); -} - -/* Local store setup. */ -char *default_drafts_folder_uri; -CamelFolder *drafts_folder = NULL; -char *default_sent_folder_uri; -CamelFolder *sent_folder = NULL; -char *default_outbox_folder_uri; -CamelFolder *outbox_folder = NULL; -char *default_inbox_folder_uri; -CamelFolder *inbox_folder = NULL; - -static struct { - char *base; - char **uri; - CamelFolder **folder; -} default_folders[] = { - { "Inbox", &default_inbox_folder_uri, &inbox_folder }, - { "Drafts", &default_drafts_folder_uri, &drafts_folder }, - { "Outbox", &default_outbox_folder_uri, &outbox_folder }, - { "Sent", &default_sent_folder_uri, &sent_folder }, -}; - -static void -setup_local_store(MailComponent *component) -{ - MailComponentPrivate *p = component->priv; - CamelException ex; - char *store_uri; - int i; - - g_assert(p->local_store == NULL); - - /* EPFIXME It should use base_directory once we have moved it. */ - store_uri = g_strconcat("mbox:", g_get_home_dir (), "/.evolution/mail/local", NULL); - p->local_store = mail_component_load_store_by_uri (component, store_uri, _("On this Computer")); - camel_object_ref (p->local_store); - - camel_exception_init (&ex); - for (i=0;i<sizeof(default_folders)/sizeof(default_folders[0]);i++) { - /* FIXME: should this uri be account relative? */ - *default_folders[i].uri = g_strdup_printf("%s#%s", store_uri, default_folders[i].base); - *default_folders[i].folder = camel_store_get_folder(p->local_store, default_folders[i].base, - CAMEL_STORE_FOLDER_CREATE, &ex); - camel_exception_clear(&ex); - } - - g_free(store_uri); -} - -static void -folder_selected_cb (EMFolderTree *emft, const char *path, const char *uri, EMFolderView *view) -{ - if (!path || !strcmp (path, "/")) - em_folder_view_set_folder (view, NULL, NULL); - else - em_folder_view_set_folder_uri (view, uri); -} - -static void -view_control_activate_cb (BonoboControl *control, gboolean activate, EMFolderView *view) -{ - BonoboUIComponent *uic; - - uic = bonobo_control_get_ui_component (control); - g_assert (uic != NULL); - - if (activate) { - Bonobo_UIContainer container; - - container = bonobo_control_get_remote_ui_container (control, NULL); - bonobo_ui_component_set_container (uic, container, NULL); - bonobo_object_release_unref (container, NULL); - - g_assert (container == bonobo_ui_component_get_container(uic)); - g_return_if_fail (container != CORBA_OBJECT_NIL); - - em_folder_view_activate (view, uic, activate); - } else { - em_folder_view_activate (view, uic, activate); - bonobo_ui_component_unset_container (uic, NULL); - } -} - - -/* GObject methods. */ - -static void -impl_dispose (GObject *object) -{ - MailComponentPrivate *priv = MAIL_COMPONENT (object)->priv; - - if (priv->activity_handler != NULL) { - g_object_unref (priv->activity_handler); - priv->activity_handler = NULL; - } - - if (priv->search_context != NULL) { - g_object_unref (priv->search_context); - priv->search_context = NULL; - } - - if (priv->local_store != NULL) { - camel_object_unref (CAMEL_OBJECT (priv->local_store)); - priv->local_store = NULL; - } - - (* G_OBJECT_CLASS (parent_class)->dispose) (object); -} - -static void -store_hash_free (gpointer key, gpointer value, gpointer user_data) -{ - CamelStore *store = key; - char *name = value; - - g_free (name); - camel_object_unref (store); -} - -static void -impl_finalize (GObject *object) -{ - MailComponentPrivate *priv = MAIL_COMPONENT (object)->priv; - - g_free (priv->base_directory); - - mail_async_event_destroy (priv->async_event); - - g_hash_table_foreach (priv->store_hash, store_hash_free, NULL); - g_hash_table_destroy (priv->store_hash); - - if (mail_async_event_destroy (priv->async_event) == -1) { - g_warning("Cannot destroy async event: would deadlock"); - g_warning(" system may be unstable at exit"); - } - - g_free (priv->context_path); - g_free (priv); - - (* G_OBJECT_CLASS (parent_class)->finalize) (object); -} - - -/* Evolution::Component CORBA methods. */ - -static void -impl_createControls (PortableServer_Servant servant, - Bonobo_Control *corba_tree_control, - Bonobo_Control *corba_view_control, - Bonobo_Control *corba_statusbar_control, - CORBA_Environment *ev) -{ - MailComponent *mail_component = MAIL_COMPONENT (bonobo_object_from_servant (servant)); - MailComponentPrivate *priv = mail_component->priv; - BonoboControl *tree_control; - BonoboControl *view_control; - BonoboControl *statusbar_control; - GtkWidget *tree_widget; - GtkWidget *view_widget; - GtkWidget *statusbar_widget; - - view_widget = em_folder_browser_new (); - tree_widget = (GtkWidget *) em_folder_tree_new_with_model (priv->model); - em_folder_tree_enable_drag_and_drop ((EMFolderTree *) tree_widget); - em_format_set_session ((EMFormat *) ((EMFolderView *) view_widget)->preview, session); - - statusbar_widget = e_task_bar_new (); - e_activity_handler_attach_task_bar (priv->activity_handler, E_TASK_BAR (statusbar_widget)); - - gtk_widget_show (tree_widget); - gtk_widget_show (view_widget); - gtk_widget_show (statusbar_widget); - - tree_control = bonobo_control_new (tree_widget); - view_control = bonobo_control_new (view_widget); - statusbar_control = bonobo_control_new (statusbar_widget); - - *corba_tree_control = CORBA_Object_duplicate (BONOBO_OBJREF (tree_control), ev); - *corba_view_control = CORBA_Object_duplicate (BONOBO_OBJREF (view_control), ev); - *corba_statusbar_control = CORBA_Object_duplicate (BONOBO_OBJREF (statusbar_control), ev); - - g_signal_connect (view_control, "activate", G_CALLBACK (view_control_activate_cb), view_widget); - - g_signal_connect (tree_widget, "folder-selected", G_CALLBACK (folder_selected_cb), view_widget); -} - - -static GNOME_Evolution_CreatableItemTypeList * -impl__get_userCreatableItems (PortableServer_Servant servant, CORBA_Environment *ev) -{ - GNOME_Evolution_CreatableItemTypeList *list = GNOME_Evolution_CreatableItemTypeList__alloc (); - - list->_length = 1; - list->_maximum = list->_length; - list->_buffer = GNOME_Evolution_CreatableItemTypeList_allocbuf (list->_length); - - CORBA_sequence_set_release (list, FALSE); - - list->_buffer[0].id = "message"; - list->_buffer[0].description = _("New Mail Message"); - list->_buffer[0].menuDescription = _("_Mail Message"); - list->_buffer[0].tooltip = _("Compose a new mail message"); - list->_buffer[0].menuShortcut = 'm'; - list->_buffer[0].iconName = "new-message.xpm"; - - return list; -} - -static void -impl_requestCreateItem (PortableServer_Servant servant, - const CORBA_char *item_type_name, - CORBA_Environment *ev) -{ - if (strcmp (item_type_name, "message") != 0) { - CORBA_exception_set (ev, CORBA_USER_EXCEPTION, - ex_GNOME_Evolution_Component_UnknownType, NULL); - return; - } - - em_utils_compose_new_message (); -} - -static void -impl_handleURI (PortableServer_Servant servant, const CORBA_char *uri, CORBA_Environment *ev) -{ - if (!strncmp (uri, "mailto:", 7)) { - em_utils_compose_new_message_with_mailto (uri); - } -} - -static void -impl_sendAndReceive (PortableServer_Servant servant, CORBA_Environment *ev) -{ - mail_send_receive (); -} - - -/* Initialization. */ - -static void -mail_component_class_init (MailComponentClass *class) -{ - POA_GNOME_Evolution_Component__epv *epv = &class->epv; - GObjectClass *object_class = G_OBJECT_CLASS (class); - - parent_class = g_type_class_peek_parent (class); - - object_class->dispose = impl_dispose; - object_class->finalize = impl_finalize; - - epv->createControls = impl_createControls; - epv->_get_userCreatableItems = impl__get_userCreatableItems; - epv->requestCreateItem = impl_requestCreateItem; - epv->handleURI = impl_handleURI; - epv->sendAndReceive = impl_sendAndReceive; -} - -static void -mail_component_init (MailComponent *component) -{ - MailComponentPrivate *priv; - EAccountList *accounts; - struct stat st; - char *mail_dir; - - priv = g_new0 (MailComponentPrivate, 1); - component->priv = priv; - - priv->base_directory = g_build_filename (g_get_home_dir (), ".evolution", NULL); - if (camel_mkdir (priv->base_directory, 0777) == -1 && errno != EEXIST) - abort (); - - priv->model = em_folder_tree_model_new (priv->base_directory); - - priv->activity_handler = e_activity_handler_new (); - - /* EPFIXME: Turn into an object? */ - mail_session_init (priv->base_directory); - - priv->async_event = mail_async_event_new(); - priv->store_hash = g_hash_table_new (NULL, NULL); - - /* migrate evolution 1.x folders to 2.0's location/format */ - mail_dir = g_strdup_printf ("%s/mail", priv->base_directory); - if (stat (mail_dir, &st) == -1) { - CamelException ex; - - camel_exception_init (&ex); - if (em_migrate (component, &ex) == -1) { - GtkWidget *dialog; - - dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_WARNING, GTK_BUTTONS_CLOSE, - _("The following error occured while migrating your mail data:\n%s"), - camel_exception_get_description (&ex)); - - g_signal_connect (dialog, "response", G_CALLBACK (gtk_widget_destroy), dialog); - gtk_widget_show (dialog); - - camel_exception_clear (&ex); - } - } - g_free (mail_dir); - - setup_local_store (component); - - accounts = mail_config_get_accounts (); - load_accounts(component, accounts); - - /* mail_autoreceive_setup (); EPFIXME keep it off for testing */ - - setup_search_context (component); - - /* EPFIXME not sure about this. */ - go_online (component); -} - - -/* Public API. */ - -MailComponent * -mail_component_peek (void) -{ - static MailComponent *component = NULL; - - if (component == NULL) { - component = g_object_new (mail_component_get_type (), NULL); - - /* FIXME: this should all be initialised in a starutp routine, not from the peek function, - this covers much of the ::init method's content too */ - vfolder_load_storage (); - } - - return component; -} - - -const char * -mail_component_peek_base_directory (MailComponent *component) -{ - return component->priv->base_directory; -} - -RuleContext * -mail_component_peek_search_context (MailComponent *component) -{ - return component->priv->search_context; -} - -EActivityHandler * -mail_component_peek_activity_handler (MailComponent *component) -{ - return component->priv->activity_handler; -} - -void -mail_component_add_store (MailComponent *component, CamelStore *store, const char *name) -{ - CamelException ex; - - camel_exception_init (&ex); - - if (name == NULL) { - char *service_name; - - service_name = camel_service_get_name ((CamelService *) store, TRUE); - add_store (component, service_name, store, &ex); - g_free (service_name); - } else { - add_store (component, name, store, &ex); - } - - camel_exception_clear (&ex); -} - - -/** - * mail_component_load_store_by_uri: - * @component: mail component - * @uri: uri of store - * @name: name of store (used for display purposes) - * - * Return value: Pointer to the newly added CamelStore. The caller is supposed - * to ref the object if it wants to store it. - **/ -CamelStore * -mail_component_load_store_by_uri (MailComponent *component, const char *uri, const char *name) -{ - CamelException ex; - CamelStore *store; - CamelProvider *prov; - - camel_exception_init (&ex); - - /* Load the service (don't connect!). Check its provider and - * see if this belongs in the shell's folder list. If so, add - * it. - */ - - prov = camel_session_get_provider (session, uri, &ex); - if (prov == NULL) { - /* EPFIXME: real error dialog */ - g_warning ("couldn't get service %s: %s\n", uri, - camel_exception_get_description (&ex)); - camel_exception_clear (&ex); - return NULL; - } - - if (!(prov->flags & CAMEL_PROVIDER_IS_STORAGE) || - (prov->flags & CAMEL_PROVIDER_IS_EXTERNAL)) - return NULL; - - store = (CamelStore *) camel_session_get_service (session, uri, CAMEL_PROVIDER_STORE, &ex); - if (store == NULL) { - /* EPFIXME: real error dialog */ - g_warning ("couldn't get service %s: %s\n", uri, - camel_exception_get_description (&ex)); - camel_exception_clear (&ex); - return NULL; - } - - if (name != NULL) { - add_store (component, name, store, &ex); - } else { - char *service_name; - - service_name = camel_service_get_name ((CamelService *) store, TRUE); - add_store (component, service_name, store, &ex); - g_free (service_name); - } - - if (camel_exception_is_set (&ex)) { - /* EPFIXME: real error dialog */ - g_warning ("Cannot load store: %s", - camel_exception_get_description (&ex)); - camel_exception_clear (&ex); - } - - camel_object_unref (store); - - return store; -} - - -static void -store_disconnect (CamelStore *store, void *event_data, void *user_data) -{ - camel_service_disconnect (CAMEL_SERVICE (store), TRUE, NULL); - camel_object_unref (store); -} - -void -mail_component_remove_store (MailComponent *component, CamelStore *store) -{ - MailComponentPrivate *priv = component->priv; - char *name; - - /* Because the store_hash holds a reference to each store - * used as a key in it, none of them will ever be gc'ed, meaning - * any call to camel_session_get_{service,store} with the same - * URL will always return the same object. So this works. - */ - - if (!(name = g_hash_table_lookup (priv->store_hash, store))) - return; - - g_hash_table_remove (priv->store_hash, store); - g_free (name); - - /* so i guess potentially we could have a race, add a store while one - being removed. ?? */ - mail_note_store_remove (store); - - em_folder_tree_model_remove_store (priv->model, store); - - mail_async_event_emit (priv->async_event, MAIL_ASYNC_THREAD, (MailAsyncFunc) store_disconnect, store, NULL, NULL); -} - - -void -mail_component_remove_store_by_uri (MailComponent *component, const char *uri) -{ - CamelProvider *prov; - CamelStore *store; - - if (!(prov = camel_session_get_provider (session, uri, NULL))) - return; - - if (!(prov->flags & CAMEL_PROVIDER_IS_STORAGE) || - (prov->flags & CAMEL_PROVIDER_IS_EXTERNAL)) - return; - - store = (CamelStore *) camel_session_get_service (session, uri, CAMEL_PROVIDER_STORE, NULL); - if (store != NULL) { - mail_component_remove_store (component, store); - camel_object_unref (store); - } -} - - -int -mail_component_get_store_count (MailComponent *component) -{ - return g_hash_table_size (component->priv->store_hash); -} - - -void -mail_component_stores_foreach (MailComponent *component, GHFunc func, void *user_data) -{ - g_hash_table_foreach (component->priv->store_hash, func, user_data); -} - - -void -mail_component_remove_folder (MailComponent *component, CamelStore *store, const char *path) -{ - /* FIXME: implement me. but first, am I really even needed? */ -} - - -EMFolderTreeModel * -mail_component_get_tree_model (MailComponent *component) -{ - g_object_ref (component->priv->model); - return component->priv->model; -} - -struct _CamelFolder * -mail_component_get_local_inbox(MailComponent *mc, struct _CamelException *ex) -{ - return camel_store_get_folder(mc->priv->local_store, "Inbox", 0, ex); -} - -extern struct _CamelSession *session; - -char *em_uri_from_camel(const char *curi) -{ - CamelURL *curl; - EAccount *account; - const char *uid, *path; - char *euri; - CamelProvider *provider; - - provider = camel_session_get_provider(session, curi, NULL); - if (provider == NULL) - return g_strdup(curi); - - curl = camel_url_new(curi, NULL); - if (curl == NULL) - return g_strdup(curi); - - account = mail_config_get_account_by_source_url(curi); - uid = (account == NULL)?"local@local":account->uid; - path = (provider->url_flags & CAMEL_URL_FRAGMENT_IS_PATH)?curl->fragment:curl->path; - if (path[0] == '/') - path++; - euri = g_strdup_printf("email://%s/%s", uid, path); - - d(printf("em uri from camel '%s' -> '%s'\n", curi, euri)); - - return euri; -} - -char *em_uri_to_camel(const char *euri) -{ - EAccountList *accounts; - const EAccount *account; - EAccountService *service; - CamelProvider *provider; - CamelURL *eurl, *curl; - char *uid, *curi; - - eurl = camel_url_new(euri, NULL); - if (eurl == NULL) - return g_strdup(euri); - - if (strcmp(eurl->protocol, "email") != 0) { - camel_url_free(eurl); - return g_strdup(euri); - } - - g_assert(eurl->user != NULL); - g_assert(eurl->host != NULL); - - if (strcmp(eurl->user, "local") == 0 && strcmp(eurl->host, "local") == 0) { - curi = g_strdup_printf("mbox:%s/.evolution/mail/local#%s", g_get_home_dir(), eurl->path[0]=='/'?eurl->path+1:eurl->path); - camel_url_free(eurl); - return curi; - } - - uid = g_strdup_printf("%s@%s", eurl->user, eurl->host); - - accounts = mail_config_get_accounts(); - account = e_account_list_find(accounts, E_ACCOUNT_FIND_UID, uid); - g_free(uid); - - if (account == NULL) { - camel_url_free(eurl); - return g_strdup(euri); - } - - service = account->source; - provider = camel_session_get_provider(session, service->url, NULL); - - curl = camel_url_new(service->url, NULL); - if (provider->url_flags & CAMEL_URL_FRAGMENT_IS_PATH) - camel_url_set_fragment(curl, eurl->path[0]=='/'?eurl->path+1:eurl->path); - else - camel_url_set_path(curl, eurl->path); - - curi = camel_url_to_string(curl, 0); - - camel_url_free(eurl); - camel_url_free(curl); - - d(printf("em uri to camel '%s' -> '%s'\n", euri, curi)); - - return curi; -} - - -CamelFolder * -mail_component_get_folder_from_evomail_uri (MailComponent *component, - guint32 flags, - const char *evomail_uri, - CamelException *ex) -{ - CamelException local_ex; - EAccountList *accounts; - EIterator *iter; - const char *p; - const char *q; - const char *folder_name; - char *uid; - - camel_exception_init (&local_ex); - - if (strncmp (evomail_uri, "evomail:", 8) != 0) - return NULL; - - p = evomail_uri + 8; - while (*p == '/') - p ++; - - q = strchr (p, '/'); - if (q == NULL) - return NULL; - - uid = g_strndup (p, q - p); - folder_name = q + 1; - - /* since we have no explicit account for 'local' folders, make one up */ - if (strcmp(uid, "local") == 0) { - g_free(uid); - return camel_store_get_folder(component->priv->local_store, folder_name, flags, ex); - } - - accounts = mail_config_get_accounts (); - iter = e_list_get_iterator ((EList *) accounts); - while (e_iterator_is_valid (iter)) { - EAccount *account = (EAccount *) e_iterator_get (iter); - EAccountService *service = account->source; - CamelProvider *provider; - CamelStore *store; - - if (strcmp (account->uid, uid) != 0) - continue; - - provider = camel_session_get_provider (session, service->url, &local_ex); - if (provider == NULL) - goto fail; - - store = (CamelStore *) camel_session_get_service (session, service->url, CAMEL_PROVIDER_STORE, &local_ex); - if (store == NULL) - goto fail; - - g_free (uid); - return camel_store_get_folder (store, folder_name, flags, ex); - } - - fail: - camel_exception_clear (&local_ex); - g_free (uid); - return NULL; -} - - -char * -mail_component_evomail_uri_from_folder (MailComponent *component, - CamelFolder *folder) -{ - CamelStore *store = camel_folder_get_parent_store (folder); - EAccount *account; - char *service_url; - char *evomail_uri; - const char *uid; - - if (store == NULL) - return NULL; - - service_url = camel_service_get_url (CAMEL_SERVICE (store)); - account = mail_config_get_account_by_source_url (service_url); - - if (account == NULL) { - /* since we have no explicit account for 'local' folders, make one up */ - /* TODO: check the folder is really a local one, folder->parent_store == local_store? */ - uid = "local"; - /*g_free (service_url); - return NULL;*/ - } else { - uid = account->uid; - } - - evomail_uri = g_strconcat ("evomail:///", uid, "/", camel_folder_get_full_name (folder), NULL); - g_free (service_url); - - return evomail_uri; -} - - -BONOBO_TYPE_FUNC_FULL (MailComponent, GNOME_Evolution_Component, PARENT_TYPE, mail_component) diff --git a/mail/mail-component.h b/mail/mail-component.h deleted file mode 100644 index 545ddf11d4..0000000000 --- a/mail/mail-component.h +++ /dev/null @@ -1,99 +0,0 @@ -/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ -/* mail-component.h - * - * Copyright (C) 2003 Ximian Inc. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public - * License as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - * - * Authors: - * Michael Zucchi <notzed@ximian.com> - * Jeffrey Stedfast <fejj@ximian.com> - * Ettore Perazzoli <ettore@ximian.com> - */ - -#ifndef _MAIL_COMPONENT_H_ -#define _MAIL_COMPONENT_H_ - -#include <camel/camel-store.h> -#include <filter/rule-context.h> -#include <bonobo/bonobo-object.h> - -#include "e-activity-handler.h" - -#include "Evolution.h" - -#define MAIL_TYPE_COMPONENT (mail_component_get_type ()) -#define MAIL_COMPONENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MAIL_TYPE_COMPONENT, MailComponent)) -#define MAIL_COMPONENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MAIL_TYPE_COMPONENT, MailComponentClass)) -#define MAIL_IS_COMPONENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MAIL_TYPE_COMPONENT)) -#define MAIL_IS_COMPONENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), MAIL_TYPE_COMPONENT)) - -typedef struct _MailComponent MailComponent; -typedef struct _MailComponentPrivate MailComponentPrivate; -typedef struct _MailComponentClass MailComponentClass; - -struct _MailComponent { - BonoboObject parent; - - MailComponentPrivate *priv; -}; - -struct _MailComponentClass { - BonoboObjectClass parent_class; - - POA_GNOME_Evolution_Component__epv epv; -}; - -GType mail_component_get_type (void); - -MailComponent *mail_component_peek (void); - -const char *mail_component_peek_base_directory (MailComponent *component); -RuleContext *mail_component_peek_search_context (MailComponent *component); -EActivityHandler *mail_component_peek_activity_handler (MailComponent *component); - -void mail_component_add_store (MailComponent *component, - CamelStore *store, - const char *name); -CamelStore *mail_component_load_store_by_uri (MailComponent *component, - const char *uri, - const char *name); - -void mail_component_remove_store (MailComponent *component, - CamelStore *store); -void mail_component_remove_store_by_uri (MailComponent *component, - const char *uri); - -int mail_component_get_store_count (MailComponent *component); -void mail_component_stores_foreach (MailComponent *component, - GHFunc func, - void *data); - -void mail_component_remove_folder (MailComponent *component, CamelStore *store, const char *path); - -struct _EMFolderTreeModel *mail_component_get_tree_model (MailComponent *component); -struct _CamelFolder *mail_component_get_local_inbox(MailComponent *mc, struct _CamelException *ex); - -char *em_uri_from_camel (const char *curi); -char *em_uri_to_camel (const char *euri); - -CamelFolder *mail_component_get_folder_from_evomail_uri (MailComponent *component, - guint32 flags, - const char *evomail_uri, - CamelException *ex); -char *mail_component_evomail_uri_from_folder (MailComponent *component, - CamelFolder *folder); - -#endif /* _MAIL_COMPONENT_H_ */ diff --git a/mail/mail-config-druid.c b/mail/mail-config-druid.c deleted file mode 100644 index 368742f157..0000000000 --- a/mail/mail-config-druid.c +++ /dev/null @@ -1,768 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Authors: - * Jeffrey Stedfast <fejj@ximian.com> - * Dan Winship <danw@ximian.com> - * Iain Holmes <iain@ximian.com> - * - * Copyright 2001 Ximian, Inc. (www.ximian.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public - * License as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - * - */ - - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <sys/types.h> -#include <sys/utsname.h> -#include <string.h> -#include <unistd.h> - -#include <gal/util/e-util.h> -#include <glade/glade.h> -#include <gtkhtml/gtkhtml.h> -#include <libgnomeui/gnome-dialog.h> -#include <libgnomeui/gnome-dialog-util.h> -#include <libgnomeui/gnome-druid.h> -#include <libgnomeui/gnome-druid-page-standard.h> -#include <bonobo/bonobo-exception.h> - -#include "mail-config-druid.h" -#include "mail-config.h" -#include "mail-ops.h" -#include "mail.h" -#include "mail-session.h" - -#include <evolution-wizard.h> -#include <e-util/e-account.h> - -typedef enum { - MAIL_CONFIG_WIZARD_PAGE_NONE = -1, - MAIL_CONFIG_WIZARD_PAGE_IDENTITY, - MAIL_CONFIG_WIZARD_PAGE_SOURCE, - MAIL_CONFIG_WIZARD_PAGE_EXTRA, - MAIL_CONFIG_WIZARD_PAGE_TRANSPORT, - MAIL_CONFIG_WIZARD_PAGE_MANAGEMENT, - - MAIL_CONFIG_WIZARD_NUM_PAGES -} MailConfigWizardPage; - -typedef struct { - /* Only one of these will be set */ - GnomeDruid *druid; - EvolutionWizard *corba_wizard; - - MailAccountGui *gui; - - GPtrArray *interior_pages; - GnomeDruidPage *last_page; - - gboolean identity_copied; - CamelProvider *last_source; - MailConfigWizardPage page; -} MailConfigWizard; - - - - -static void -config_wizard_set_buttons_sensitive (MailConfigWizard *mcw, - gboolean prev_sensitive, - gboolean next_sensitive) -{ - if (mcw->corba_wizard) { - evolution_wizard_set_buttons_sensitive (mcw->corba_wizard, - prev_sensitive, - next_sensitive, - TRUE, NULL); - } else { - gnome_druid_set_buttons_sensitive (mcw->druid, - prev_sensitive, - next_sensitive, - TRUE, FALSE); - } -} - -static void -config_wizard_set_page (MailConfigWizard *mcw, MailConfigWizardPage page) -{ - if (mcw->corba_wizard) - evolution_wizard_set_page (mcw->corba_wizard, page, NULL); - else { - if (page < mcw->interior_pages->len) - gnome_druid_set_page (mcw->druid, mcw->interior_pages->pdata[page]); - else - gnome_druid_set_page (mcw->druid, mcw->last_page); - } -} - -/* Identity Page */ -static void -identity_changed (GtkWidget *widget, gpointer data) -{ - MailConfigWizard *mcw = data; - GtkWidget *incomplete; - gboolean next_sensitive; - - if (mcw->page != MAIL_CONFIG_WIZARD_PAGE_IDENTITY) - return; - - next_sensitive = mail_account_gui_identity_complete (mcw->gui, &incomplete); - - config_wizard_set_buttons_sensitive (mcw, TRUE, next_sensitive); -} - -static void -identity_prepare (MailConfigWizard *mcw) -{ - mcw->page = MAIL_CONFIG_WIZARD_PAGE_IDENTITY; - - if (!gtk_entry_get_text (mcw->gui->full_name)) { - char *uname; - - uname = g_locale_to_utf8 (g_get_real_name (), -1, NULL, NULL, NULL); - gtk_entry_set_text (mcw->gui->full_name, uname ? uname : ""); - g_free (uname); - } - identity_changed (NULL, mcw); -} - -static gboolean -identity_next (MailConfigWizard *mcw) -{ - if (!mcw->identity_copied) { - char *username; - const char *user; - - /* Copy the username part of the email address into - * the Username field of the source and transport pages. - */ - user = gtk_entry_get_text (mcw->gui->email_address); - username = g_strndup (user, strcspn (user, "@")); - gtk_entry_set_text (mcw->gui->source.username, username); - gtk_entry_set_text (mcw->gui->transport.username, username); - g_free (username); - - mcw->identity_copied = TRUE; - } - - return FALSE; -} - -static void -identity_activate_cb (GtkEntry *ent, gpointer user_data) -{ - MailConfigWizard *mcw = user_data; - - if (mail_account_gui_identity_complete (mcw->gui, NULL) && - !identity_next (mcw)) - config_wizard_set_page (mcw, MAIL_CONFIG_WIZARD_PAGE_SOURCE); -} - -/* Incoming mail Page */ -static void -source_changed (GtkWidget *widget, gpointer data) -{ - MailConfigWizard *mcw = data; - GtkWidget *incomplete; - gboolean next_sensitive; - - if (mcw->page != MAIL_CONFIG_WIZARD_PAGE_SOURCE) - return; - - next_sensitive = mail_account_gui_source_complete (mcw->gui, &incomplete); - - config_wizard_set_buttons_sensitive (mcw, TRUE, next_sensitive); -} - -static void -source_prepare (MailConfigWizard *mcw) -{ - mcw->page = MAIL_CONFIG_WIZARD_PAGE_SOURCE; - source_changed (NULL, mcw); -} - -static gboolean -source_next (MailConfigWizard *mcw) -{ - /* FIXME: if online, check that the data is good. */ - - if (mcw->gui->source.provider && mcw->gui->source.provider->extra_conf) - return FALSE; - - /* Otherwise, skip to transport page. */ - config_wizard_set_page (mcw, MAIL_CONFIG_WIZARD_PAGE_TRANSPORT); - return TRUE; -} - -static void -source_activate_cb (GtkEntry *ent, gpointer user_data) -{ - MailConfigWizard *mcw = user_data; - - if (mail_account_gui_source_complete (mcw->gui, NULL) && - !source_next (mcw)) - config_wizard_set_page (mcw, MAIL_CONFIG_WIZARD_PAGE_EXTRA); -} - -/* Extra Config Page */ -static void -extra_prepare (MailConfigWizard *mcw) -{ - mcw->page = MAIL_CONFIG_WIZARD_PAGE_EXTRA; - if (mcw->gui->source.provider != mcw->last_source) { - mcw->last_source = mcw->gui->source.provider; - mail_account_gui_auto_detect_extra_conf (mcw->gui); - } -} - -/* Transport Page */ -static gboolean -transport_next (MailConfigWizard *mcw) -{ - /* FIXME: if online, check that the data is good. */ - return FALSE; -} - -static gboolean -transport_back (MailConfigWizard *mcw) -{ - if (mcw->gui->source.provider && mcw->gui->source.provider->extra_conf) - return FALSE; - else { - config_wizard_set_page (mcw, MAIL_CONFIG_WIZARD_PAGE_SOURCE); - return TRUE; - } -} - -static void -transport_changed (GtkWidget *widget, gpointer data) -{ - MailConfigWizard *mcw = data; - GtkWidget *incomplete; - gboolean next_sensitive; - - if (mcw->page != MAIL_CONFIG_WIZARD_PAGE_TRANSPORT) - return; - - next_sensitive = mail_account_gui_transport_complete (mcw->gui, &incomplete); - - config_wizard_set_buttons_sensitive (mcw, TRUE, next_sensitive); -} - -static void -transport_prepare (MailConfigWizard *mcw) -{ - mcw->page = MAIL_CONFIG_WIZARD_PAGE_TRANSPORT; - transport_changed (NULL, mcw); -} - -static void -transport_activate_cb (GtkEntry *ent, gpointer user_data) -{ - MailConfigWizard *mcw = user_data; - - if (mail_account_gui_transport_complete (mcw->gui, NULL) && - !transport_next (mcw)) - config_wizard_set_page (mcw, MAIL_CONFIG_WIZARD_PAGE_MANAGEMENT); -} - -/* Management page */ -static gboolean -management_check (MailConfigWizard *mcw) -{ - gboolean next_sensitive; - const char *text; - - text = gtk_entry_get_text (mcw->gui->account_name); - next_sensitive = text && *text; - - /* no accounts with the same name */ - if (next_sensitive && mail_config_get_account_by_name (text)) - next_sensitive = FALSE; - - config_wizard_set_buttons_sensitive (mcw, TRUE, next_sensitive); - return next_sensitive; -} - -static void -management_prepare (MailConfigWizard *mcw) -{ - const char *name, *text; - - mcw->page = MAIL_CONFIG_WIZARD_PAGE_MANAGEMENT; - - text = gtk_entry_get_text (mcw->gui->account_name); - if (!text || *text == '\0') { - name = gtk_entry_get_text(mcw->gui->email_address); - if (name && *name) { - if (mail_config_get_account_by_name (name)) { - char *template; - unsigned int i = 1, len; - - /* length of name + 1 char for ' ' + 1 char - for '(' + 10 chars for %d + 1 char for ')' - + 1 char for nul */ - len = strlen (name); - template = alloca (len + 14); - strcpy (template, name); - name = template; - do { - sprintf (template + len, " (%d)", i++); - } while (mail_config_get_account_by_name (name) && i != 0); - } - - gtk_entry_set_text(mcw->gui->account_name, name); - } - } - - management_check (mcw); -} - -static void -management_changed (GtkWidget *widget, gpointer data) -{ - MailConfigWizard *mcw = data; - - if (mcw->page != MAIL_CONFIG_WIZARD_PAGE_MANAGEMENT) - return; - - management_check (mcw); -} - -static void -management_activate_cb (GtkEntry *ent, gpointer user_data) -{ - MailConfigWizard *mcw = user_data; - - if (management_check (mcw)) - config_wizard_set_page (mcw, mcw->page + 1); -} - - -#define WIZARD_ICON(name) (EVOLUTION_IMAGES "/mail-config-druid-" name ".png") - -static struct { - const char *page_name, *title, *icon_path; - void (*prepare_func) (MailConfigWizard *mcw); - gboolean (*back_func) (MailConfigWizard *mcw); - gboolean (*next_func) (MailConfigWizard *mcw); - const char *help_text; -} wizard_pages[] = { - { "identity_page", N_("Identity"), WIZARD_ICON ("identity"), - identity_prepare, NULL, identity_next, - N_("Please enter your name and email address below. " - "The \"optional\" fields below do not need to be " - "filled in, unless you wish to include this " - "information in email you send.") - }, - - { "source_page", N_("Receiving Mail"), WIZARD_ICON ("receive"), - source_prepare, NULL, source_next, - N_("Please enter information about your incoming " - "mail server below. If you are not sure, ask your " - "system administrator or Internet Service Provider.") - }, - - { "extra_page", N_("Receiving Mail"), WIZARD_ICON ("receive"), - extra_prepare, NULL, NULL, - N_("Please select among the following options") - }, - - { "transport_page", N_("Sending Mail"), WIZARD_ICON ("send"), - transport_prepare, transport_back, transport_next, - N_("Please enter information about the way you will " - "send mail. If you are not sure, ask your system " - "administrator or Internet Service Provider.") - }, - - { "management_page", N_("Account Management"), WIZARD_ICON ("account-name"), - management_prepare, NULL, NULL, - N_("You are almost done with the mail configuration " - "process. The identity, incoming mail server and " - "outgoing mail transport method which you provided " - "will be grouped together to make an Evolution mail " - "account. Please enter a name for this account in " - "the space below. This name will be used for display " - "purposes only.") - } -}; -static const int num_wizard_pages = sizeof (wizard_pages) / sizeof (wizard_pages[0]); - -static GtkWidget * -get_page (GladeXML *xml, int page_num) -{ - GtkWidget *vbox, *widget; - - vbox = gtk_vbox_new (FALSE, 4); - - widget = gtk_label_new (_(wizard_pages[page_num].help_text)); - gtk_label_set_line_wrap (GTK_LABEL (widget), TRUE); - gtk_label_set_justify (GTK_LABEL (widget), GTK_JUSTIFY_FILL); - gtk_box_pack_start (GTK_BOX (vbox), widget, FALSE, FALSE, 0); - gtk_widget_show_all (vbox); - - switch (page_num) { - case MAIL_CONFIG_WIZARD_PAGE_IDENTITY: - widget = glade_xml_get_widget (xml, "identity_required_frame"); - gtk_container_set_border_width (GTK_CONTAINER (widget), 0); - gtk_widget_reparent (widget, vbox); - gtk_box_set_child_packing (GTK_BOX (vbox), widget, FALSE, FALSE, 0, GTK_PACK_START); - widget = glade_xml_get_widget (xml, "identity_optional_frame"); - gtk_container_set_border_width (GTK_CONTAINER (widget), 0); - gtk_widget_reparent (widget, vbox); - gtk_box_set_child_packing (GTK_BOX (vbox), widget, FALSE, FALSE, 0, GTK_PACK_START); - break; - - case MAIL_CONFIG_WIZARD_PAGE_SOURCE: - widget = glade_xml_get_widget (xml, "source_vbox"); - gtk_container_set_border_width (GTK_CONTAINER (widget), 0); - gtk_widget_reparent (widget, vbox); - break; - - case MAIL_CONFIG_WIZARD_PAGE_EXTRA: - widget = glade_xml_get_widget (xml, "extra_table"); - gtk_container_set_border_width (GTK_CONTAINER (widget), 0); - gtk_widget_reparent (widget, vbox); - break; - - case MAIL_CONFIG_WIZARD_PAGE_TRANSPORT: - widget = glade_xml_get_widget (xml, "transport_vbox"); - gtk_container_set_border_width (GTK_CONTAINER (widget), 0); - gtk_widget_reparent (widget, vbox); - break; - - case MAIL_CONFIG_WIZARD_PAGE_MANAGEMENT: - widget = glade_xml_get_widget (xml, "management_frame"); - gtk_container_set_border_width (GTK_CONTAINER (widget), 0); - gtk_widget_reparent (widget, vbox); - break; - - default: - g_return_val_if_reached (NULL); - } - - return vbox; -} - - -static MailConfigWizard * -config_wizard_new (void) -{ - MailConfigWizard *mcw; - const char *user; - EAccountService *xport; - struct utsname uts; - EAccount *account; - - /* Create a new account object with some defaults */ - account = e_account_new (); - account->enabled = TRUE; - - account->id->name = g_locale_to_utf8 (g_get_real_name (), -1, NULL, NULL, NULL); - user = g_get_user_name (); - if (user && !uname (&uts) && strchr (uts.nodename, '.')) - account->id->address = g_strdup_printf ("%s@%s", user, uts.nodename); - - if ((xport = mail_config_get_default_transport ())) { - account->transport->url = g_strdup (xport->url); - account->transport->save_passwd = xport->save_passwd; - } - - /* Create the config wizard object */ - mcw = g_new0 (MailConfigWizard, 1); - mcw->gui = mail_account_gui_new (account, NULL); - g_object_unref (account); - - /* Set up gui */ - g_signal_connect (mcw->gui->account_name, "changed", - G_CALLBACK (management_changed), mcw); - g_signal_connect (mcw->gui->full_name, "changed", - G_CALLBACK (identity_changed), mcw); - g_signal_connect (mcw->gui->email_address, "changed", - G_CALLBACK (identity_changed), mcw); - g_signal_connect (mcw->gui->reply_to,"changed", - G_CALLBACK (identity_changed), mcw); - g_signal_connect (mcw->gui->source.hostname, "changed", - G_CALLBACK (source_changed), mcw); - g_signal_connect (mcw->gui->source.username, "changed", - G_CALLBACK (source_changed), mcw); - g_signal_connect (mcw->gui->source.path, "changed", - G_CALLBACK (source_changed), mcw); - g_signal_connect (mcw->gui->transport.hostname, "changed", - G_CALLBACK (transport_changed), mcw); - g_signal_connect (mcw->gui->transport.username, "changed", - G_CALLBACK (transport_changed), mcw); - g_signal_connect (mcw->gui->transport_needs_auth, "toggled", - G_CALLBACK (transport_changed), mcw); - - g_signal_connect (mcw->gui->account_name, "activate", - G_CALLBACK (management_activate_cb), mcw); - - g_signal_connect (mcw->gui->full_name, "activate", - G_CALLBACK (identity_activate_cb), mcw); - g_signal_connect (mcw->gui->email_address, "activate", - G_CALLBACK (identity_activate_cb), mcw); - g_signal_connect (mcw->gui->reply_to,"activate", - G_CALLBACK (identity_activate_cb), mcw); - g_signal_connect (mcw->gui->organization, "activate", - G_CALLBACK (identity_activate_cb), mcw); - - g_signal_connect (mcw->gui->source.hostname, "activate", - G_CALLBACK (source_activate_cb), mcw); - g_signal_connect (mcw->gui->source.username, "activate", - G_CALLBACK (source_activate_cb), mcw); - g_signal_connect (mcw->gui->source.path, "activate", - G_CALLBACK (source_activate_cb), mcw); - - g_signal_connect (mcw->gui->transport.hostname, "activate", - G_CALLBACK (transport_activate_cb), mcw); - g_signal_connect (mcw->gui->transport.username, "activate", - G_CALLBACK (transport_activate_cb), mcw); - - return mcw; -} - -static void -free_config_wizard (MailConfigWizard *mcw) -{ - mail_account_gui_destroy (mcw->gui); - - if (mcw->interior_pages) - g_ptr_array_free (mcw->interior_pages, TRUE); - - g_free (mcw); -} - -/* In-proc config druid */ - -static void -druid_cancel (GnomeDruid *druid, gpointer user_data) -{ - MailConfigWizard *mcw = user_data; - GtkWidget *window; - - window = glade_xml_get_widget (mcw->gui->xml, "account_druid"); - gtk_widget_destroy (window); - - free_config_wizard (mcw); -} - -static void -druid_finish (GnomeDruidPage *page, GnomeDruid *druid, gpointer user_data) -{ - MailConfigWizard *mcw = user_data; - - mail_account_gui_save (mcw->gui); - druid_cancel (druid, user_data); -} - -static void -druid_prepare (GnomeDruidPage *page, GnomeDruid *druid, gpointer data) -{ - MailConfigWizard *mcw = g_object_get_data (G_OBJECT (druid), "MailConfigWizard"); - int page_num = GPOINTER_TO_INT (data); - - if (wizard_pages[page_num].prepare_func) - wizard_pages[page_num].prepare_func (mcw); -} - -static gboolean -druid_back (GnomeDruidPage *page, GnomeDruid *druid, gpointer data) -{ - MailConfigWizard *mcw = g_object_get_data (G_OBJECT (druid), "MailConfigWizard"); - int page_num = GPOINTER_TO_INT (data); - - if (wizard_pages[page_num].back_func) - return wizard_pages[page_num].back_func (mcw); - else - return FALSE; -} - -static gboolean -druid_next (GnomeDruidPage *page, GnomeDruid *druid, gpointer data) -{ - MailConfigWizard *mcw = g_object_get_data (G_OBJECT (druid), "MailConfigWizard"); - int page_num = GPOINTER_TO_INT (data); - - if (wizard_pages[page_num].next_func) - return wizard_pages[page_num].next_func (mcw); - else - return FALSE; -} - - -MailConfigDruid * -mail_config_druid_new (void) -{ - MailConfigWizard *mcw; - GtkWidget *new, *page; - int i; - - mcw = config_wizard_new (); - mcw->druid = (GnomeDruid *)glade_xml_get_widget (mcw->gui->xml, "druid"); - g_object_set_data (G_OBJECT (mcw->druid), "MailConfigWizard", mcw); - gtk_widget_show_all (GTK_WIDGET (mcw->druid)); - - mcw->interior_pages = g_ptr_array_new (); - for (i = 0; i < num_wizard_pages; i++) { - page = glade_xml_get_widget (mcw->gui->xml, - wizard_pages[i].page_name); - g_ptr_array_add (mcw->interior_pages, page); - gtk_box_pack_start (GTK_BOX (GNOME_DRUID_PAGE_STANDARD (page)->vbox), - get_page (mcw->gui->xml, i), - FALSE, FALSE, 0); - g_signal_connect (page, "back", G_CALLBACK (druid_back), - GINT_TO_POINTER (i)); - g_signal_connect (page, "next", G_CALLBACK (druid_next), - GINT_TO_POINTER (i)); - - /* At least in 2.0 (and probably 2.2 too), - * GnomeDruidPageStandard is broken and you need to - * connect_after to "prepare" or else its default - * method will run after your signal handler and - * undo its button sensitivity changes. - */ - g_signal_connect_after (page, "prepare", - G_CALLBACK (druid_prepare), - GINT_TO_POINTER (i)); - } - g_signal_connect (mcw->druid, "cancel", G_CALLBACK (druid_cancel), mcw); - - mcw->last_page = (GnomeDruidPage *)glade_xml_get_widget (mcw->gui->xml, "finish_page"); - g_signal_connect (mcw->last_page, "finish", G_CALLBACK (druid_finish), mcw); - - gnome_druid_set_buttons_sensitive (mcw->druid, FALSE, TRUE, TRUE, FALSE); - /*gtk_widget_show_all (GTK_WIDGET (mcw->druid));*/ - mail_account_gui_setup (mcw->gui, NULL); - - new = glade_xml_get_widget (mcw->gui->xml, "account_druid"); - gtk_window_set_type_hint ((GtkWindow *) new, GDK_WINDOW_TYPE_HINT_DIALOG); - - return (MailConfigDruid *) new; -} - - -/* CORBA wizard */ - -static void -wizard_next_cb (EvolutionWizard *wizard, - int page_num, - MailConfigWizard *mcw) -{ - if (page_num >= MAIL_CONFIG_WIZARD_PAGE_MANAGEMENT) - return; - - if (wizard_pages[page_num].next_func && - wizard_pages[page_num].next_func (mcw)) - return; - - evolution_wizard_set_page (wizard, page_num + 1, NULL); -} - -static void -wizard_prepare_cb (EvolutionWizard *wizard, - int page_num, - MailConfigWizard *mcw) -{ - if (wizard_pages[page_num].prepare_func) - wizard_pages[page_num].prepare_func (mcw); -} - -static void -wizard_back_cb (EvolutionWizard *wizard, - int page_num, - MailConfigWizard *mcw) -{ - if (page_num >= MAIL_CONFIG_WIZARD_NUM_PAGES) { - evolution_wizard_set_page (wizard, MAIL_CONFIG_WIZARD_PAGE_MANAGEMENT, NULL); - return; - } - - if (wizard_pages[page_num].back_func && - wizard_pages[page_num].back_func (mcw)) - return; - - if (page_num > 0) - evolution_wizard_set_page (wizard, page_num - 1, NULL); -} - -static void -wizard_finish_cb (EvolutionWizard *wizard, - MailConfigWizard *w) -{ - MailAccountGui *gui = w->gui; - - /* Save the settings for that account */ - if (mail_account_gui_save (gui) == FALSE) - /* problem. Um, how to keep the druid alive? */ - return; - - /* Write out the config info */ - mail_config_write (); - mail_account_gui_destroy (gui); - w->gui = NULL; -} - -static void -wizard_cancel_cb (EvolutionWizard *wizard, - MailConfigWizard *mcw) -{ - mail_account_gui_destroy (mcw->gui); - mcw->gui = NULL; -} - -static void -wizard_help_cb (EvolutionWizard *wizard, - int page_num, - MailConfigWizard *mcw) -{ -} - -BonoboObject * -evolution_mail_config_wizard_new (void) -{ - EvolutionWizard *wizard; - MailConfigWizard *mcw; - GdkPixbuf *icon; - int i; - - mcw = config_wizard_new (); - mail_account_gui_setup (mcw->gui, NULL); - - wizard = evolution_wizard_new (); - for (i = 0; i < MAIL_CONFIG_WIZARD_NUM_PAGES; i++) { - icon = gdk_pixbuf_new_from_file (wizard_pages[i].icon_path, NULL); - evolution_wizard_add_page (wizard, _(wizard_pages[i].title), - icon, get_page (mcw->gui->xml, i)); - g_object_unref (icon); - } - - g_object_set_data_full (G_OBJECT (wizard), "MailConfigWizard", - mcw, (GDestroyNotify)free_config_wizard); - mcw->corba_wizard = wizard; - - g_signal_connect (wizard, "next", G_CALLBACK (wizard_next_cb), mcw); - g_signal_connect (wizard, "prepare", G_CALLBACK (wizard_prepare_cb), mcw); - g_signal_connect (wizard, "back", G_CALLBACK (wizard_back_cb), mcw); - g_signal_connect (wizard, "finish", G_CALLBACK (wizard_finish_cb), mcw); - g_signal_connect (wizard, "cancel", G_CALLBACK (wizard_cancel_cb), mcw); - g_signal_connect (wizard, "help", G_CALLBACK (wizard_help_cb), mcw); - - return BONOBO_OBJECT (wizard); -} diff --git a/mail/mail-config-druid.h b/mail/mail-config-druid.h deleted file mode 100644 index f429e98acf..0000000000 --- a/mail/mail-config-druid.h +++ /dev/null @@ -1,68 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Authors: Jeffrey Stedfast <fejj@ximian.com> - * - * Copyright 2001 Ximian, Inc. (www.ximian.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public - * License as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - * - */ - -#ifndef MAIL_CONFIG_DRUID_H -#define MAIL_CONFIG_DRUID_H - -#ifdef __cplusplus -extern "C" { -#pragma } -#endif /* __cplusplus */ - -#include <camel.h> -#include <glade/glade.h> -#include <libgnomeui/gnome-druid.h> -#include <libgnomeui/gnome-file-entry.h> -#include <bonobo/bonobo-listener.h> -#include <bonobo/bonobo-control.h> -#include <bonobo/bonobo-widget.h> -#include <bonobo/bonobo-generic-factory.h> -#include <bonobo/bonobo-context.h> -#include "shell/Evolution.h" -#include "mail-account-gui.h" - -typedef GtkWindow MailConfigDruid; - -MailConfigDruid *mail_config_druid_new (void); - -char *mail_config_druid_get_account_name (MailConfigDruid *druid); -gboolean mail_config_druid_get_default_account (MailConfigDruid *druid); - -char *mail_config_druid_get_source_url (MailConfigDruid *druid); - -gboolean mail_config_druid_get_keep_mail_on_server (MailConfigDruid *druid); -gboolean mail_config_druid_get_save_source_password (MailConfigDruid *druid); -gboolean mail_config_druid_get_auto_check (MailConfigDruid *druid); -gint mail_config_druid_get_auto_check_minutes (MailConfigDruid *druid); - -char *mail_config_druid_get_transport_url (MailConfigDruid *druid); -gboolean mail_config_druid_get_save_transport_password (MailConfigDruid *druid); -gboolean mail_config_druid_get_transport_requires_auth (MailConfigDruid *druid); - - -BonoboObject *evolution_mail_config_wizard_new (void); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* MAIL_CONFIG_DRUID_H */ diff --git a/mail/mail-config-factory.c b/mail/mail-config-factory.c deleted file mode 100644 index 9a6170796a..0000000000 --- a/mail/mail-config-factory.c +++ /dev/null @@ -1,105 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Authors: Jeffrey Stedfast <fejj@ximian.com> - * - * Copyright 2002 Ximian, Inc. (www.ximian.com) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA. - * - */ - - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <string.h> - -#include "em-account-prefs.h" -#include "em-composer-prefs.h" -#include "em-mailer-prefs.h" - -#include "mail-config-factory.h" - -#define CONFIG_CONTROL_FACTORY_ID "OAFIID:GNOME_Evolution_Mail_ConfigControlFactory:" BASE_VERSION - - -typedef void (*ApplyFunc) (GtkWidget *prefs); - -struct _config_data { - GtkWidget *prefs; - ApplyFunc apply; -}; - -static void -config_control_destroy_cb (struct _config_data *data, GObject *deadbeef) -{ - g_object_unref (data->prefs); - g_free (data); -} - -static void -config_control_apply_cb (EvolutionConfigControl *config_control, void *user_data) -{ - struct _config_data *data = user_data; - - data->apply (data->prefs); -} - -BonoboObject * -mail_config_control_factory_cb (BonoboGenericFactory *factory, const char *component_id, void *user_data) -{ - GNOME_Evolution_Shell shell = (GNOME_Evolution_Shell) user_data; - EvolutionConfigControl *control; - struct _config_data *data; - GtkWidget *prefs = NULL; - - data = g_new (struct _config_data, 1); - - if (!strcmp (component_id, EM_ACCOUNT_PREFS_CONTROL_ID)) { - prefs = em_account_prefs_new (shell); - data->apply = (ApplyFunc) em_account_prefs_apply; - } else if (!strcmp (component_id, EM_MAILER_PREFS_CONTROL_ID)) { - prefs = em_mailer_prefs_new (); - data->apply = (ApplyFunc) em_mailer_prefs_apply; - } else if (!strcmp (component_id, EM_COMPOSER_PREFS_CONTROL_ID)) { - prefs = em_composer_prefs_new (); - data->apply = (ApplyFunc) em_composer_prefs_apply; - } else { - g_assert_not_reached (); - } - - data->prefs = prefs; - g_object_ref (prefs); - - gtk_widget_show_all (prefs); - - control = evolution_config_control_new (prefs); - - if (!strcmp (component_id, EM_ACCOUNT_PREFS_CONTROL_ID)) { - /* nothing to do here... */ - } else if (!strcmp (component_id, EM_MAILER_PREFS_CONTROL_ID)) { - EM_MAILER_PREFS (prefs)->control = control; - } else if (!strcmp (component_id, EM_COMPOSER_PREFS_CONTROL_ID)) { - EM_COMPOSER_PREFS (prefs)->control = control; - } else { - g_assert_not_reached (); - } - - g_signal_connect (control, "apply", G_CALLBACK (config_control_apply_cb), data); - g_object_weak_ref ((GObject *) control, (GWeakNotify) config_control_destroy_cb, data); - - return BONOBO_OBJECT (control); -} diff --git a/mail/mail-config-factory.h b/mail/mail-config-factory.h deleted file mode 100644 index e726a51976..0000000000 --- a/mail/mail-config-factory.h +++ /dev/null @@ -1,45 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Authors: Jeffrey Stedfast <fejj@ximian.com> - * - * Copyright 2002-2003 Ximian, Inc. (www.ximian.com) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA. - * - */ - - -#ifndef __MAIL_CONFIG_FACTORY_H__ -#define __MAIL_CONFIG_FACTORY_H__ - -#ifdef __cplusplus -extern "C" { -#pragma } -#endif /* __cplusplus */ - -#include <bonobo/bonobo-generic-factory.h> -#include "evolution-config-control.h" - -#include <shell/Evolution.h> - -gboolean mail_config_register_factory (GNOME_Evolution_Shell shell); - -BonoboObject *mail_config_control_factory_cb (BonoboGenericFactory *factory, const char *component_id, void *user_data); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __MAIL_CONFIG_FACTORY_H__ */ diff --git a/mail/mail-config.c b/mail/mail-config.c deleted file mode 100644 index 6fa378e25b..0000000000 --- a/mail/mail-config.c +++ /dev/null @@ -1,1524 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Authors: Jeffrey Stedfast <fejj@ximian.com> - * Radek Doulik <rodo@ximian.com> - * - * Copyright 2001 Ximian, Inc. (www.ximian.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public - * License as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - * - */ - - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <pwd.h> -#include <ctype.h> -#include <sys/wait.h> -#include <signal.h> -#include <errno.h> -#include <string.h> - -#include <glib.h> -#include <gtk/gtkdialog.h> -#include <gtkhtml/gtkhtml.h> -#include <glade/glade.h> - -#include <libxml/tree.h> -#include <libxml/parser.h> - -#include <bonobo/bonobo-object.h> -#include <bonobo/bonobo-generic-factory.h> -#include <bonobo/bonobo-context.h> -#include <bonobo/bonobo-moniker-util.h> -#include <bonobo/bonobo-exception.h> - -#include <gal/util/e-util.h> -#include <gal/widgets/e-gui-utils.h> -#include <e-util/e-url.h> -#include <e-util/e-passwords.h> - -#include "mail.h" -#include "mail-component.h" -#include "mail-config.h" -#include "mail-mt.h" -#include "mail-tools.h" - -/* Note, the first element of each MailConfigLabel must NOT be translated */ -MailConfigLabel label_defaults[5] = { - { "important", N_("Important"), "#ff0000" }, /* red */ - { "work", N_("Work"), "#ff8c00" }, /* orange */ - { "personal", N_("Personal"), "#008b00" }, /* forest green */ - { "todo", N_("To Do"), "#0000ff" }, /* blue */ - { "later", N_("Later"), "#8b008b" } /* magenta */ -}; - -typedef struct { - GConfClient *gconf; - - gboolean corrupt; - - EAccountList *accounts; - - GSList *signatures; - int sig_nextid; - gboolean signature_info; - - GSList *labels; - guint label_notify_id; - - guint font_notify_id; - guint spell_notify_id; - - GPtrArray *mime_types; - guint mime_types_notify_id; -} MailConfig; - -static MailConfig *config = NULL; -static guint config_write_timeout = 0; - -#define MAIL_CONFIG_RC "/gtkrc-mail-fonts" - -/* signatures */ -MailConfigSignature * -signature_copy (const MailConfigSignature *sig) -{ - MailConfigSignature *ns; - - g_return_val_if_fail (sig != NULL, NULL); - - ns = g_new (MailConfigSignature, 1); - - ns->id = sig->id; - ns->name = g_strdup (sig->name); - ns->filename = g_strdup (sig->filename); - ns->script = g_strdup (sig->script); - ns->html = sig->html; - - return ns; -} - -void -signature_destroy (MailConfigSignature *sig) -{ - g_free (sig->name); - g_free (sig->filename); - g_free (sig->script); - g_free (sig); -} - -static char * -xml_get_prop (xmlNodePtr node, const char *name) -{ - char *buf, *val; - - buf = xmlGetProp (node, name); - val = g_strdup (buf); - xmlFree (buf); - - return val; -} - -static char * -xml_get_content (xmlNodePtr node) -{ - char *buf, *val; - - buf = xmlNodeGetContent (node); - val = g_strdup (buf); - xmlFree (buf); - - return val; -} - -void -mail_config_save_accounts (void) -{ - e_account_list_save (config->accounts); -} - -static MailConfigSignature * -signature_new_from_xml (char *in, int id) -{ - MailConfigSignature *sig; - xmlNodePtr node, cur; - xmlDocPtr doc; - char *buf; - - if (!(doc = xmlParseDoc (in))) - return NULL; - - node = doc->children; - if (strcmp (node->name, "signature") != 0) { - xmlFreeDoc (doc); - return NULL; - } - - sig = g_new0 (MailConfigSignature, 1); - sig->name = xml_get_prop (node, "name"); - sig->id = id; - - buf = xml_get_prop (node, "format"); - if (!strcmp (buf, "text/html")) - sig->html = TRUE; - else - sig->html = FALSE; - g_free (buf); - - cur = node->children; - while (cur) { - if (!strcmp (cur->name, "filename")) { - g_free (sig->filename); - sig->filename = xml_get_content (cur); - } else if (!strcmp (cur->name, "script")) { - g_free (sig->script); - sig->script = xml_get_content (cur); - } - - cur = cur->next; - } - - xmlFreeDoc (doc); - - return sig; -} - -static void -config_read_signatures (void) -{ - GSList *list, *l, *tail, *n; - int i = 0; - - config->signatures = NULL; - - tail = NULL; - list = gconf_client_get_list (config->gconf, "/apps/evolution/mail/signatures", - GCONF_VALUE_STRING, NULL); - - l = list; - while (l != NULL) { - MailConfigSignature *sig; - - if ((sig = signature_new_from_xml ((char *) l->data, i++))) { - n = g_slist_alloc (); - n->next = NULL; - n->data = sig; - - if (tail == NULL) - config->signatures = n; - else - tail->next = n; - tail = n; - } - - n = l->next; - g_slist_free_1 (l); - l = n; - } - - config->sig_nextid = i + 1; -} - -static char * -signature_to_xml (MailConfigSignature *sig) -{ - char *xmlbuf, *tmp; - xmlNodePtr root; - xmlDocPtr doc; - int n; - - doc = xmlNewDoc ("1.0"); - - root = xmlNewDocNode (doc, NULL, "signature", NULL); - xmlDocSetRootElement (doc, root); - - xmlSetProp (root, "name", sig->name); - xmlSetProp (root, "format", sig->html ? "text/html" : "text/plain"); - - if (sig->filename) - xmlNewTextChild (root, NULL, "filename", sig->filename); - - if (sig->script) - xmlNewTextChild (root, NULL, "script", sig->script); - - xmlDocDumpMemory (doc, (xmlChar **) &xmlbuf, &n); - xmlFreeDoc (doc); - - /* remap to glib memory */ - tmp = g_malloc (n + 1); - memcpy (tmp, xmlbuf, n); - tmp[n] = '\0'; - xmlFree (xmlbuf); - - return tmp; -} - -static void -config_write_signatures (void) -{ - GSList *list, *tail, *n, *l; - char *xmlbuf; - - list = NULL; - tail = NULL; - - l = config->signatures; - while (l != NULL) { - if ((xmlbuf = signature_to_xml ((MailConfigSignature *) l->data))) { - n = g_slist_alloc (); - n->data = xmlbuf; - n->next = NULL; - - if (tail == NULL) - list = n; - else - tail->next = n; - tail = n; - } - - l = l->next; - } - - gconf_client_set_list (config->gconf, "/apps/evolution/mail/signatures", GCONF_VALUE_STRING, list, NULL); - - l = list; - while (l != NULL) { - n = l->next; - g_free (l->data); - g_slist_free_1 (l); - l = n; - } - - gconf_client_suggest_sync (config->gconf, NULL); -} - -static void -config_clear_labels (void) -{ - MailConfigLabel *label; - GSList *list, *n; - - list = config->labels; - while (list != NULL) { - label = list->data; - g_free(label->tag); - g_free (label->name); - g_free (label->colour); - g_free (label); - - n = list->next; - g_slist_free_1 (list); - list = n; - } - - config->labels = NULL; -} - -static void -config_cache_labels (void) -{ - GSList *labels, *list, *tail, *n; - MailConfigLabel *label; - char *buf, *colour; - int num = 0; - - tail = labels = NULL; - - list = gconf_client_get_list (config->gconf, "/apps/evolution/mail/labels", GCONF_VALUE_STRING, NULL); - - while (list != NULL) { - buf = list->data; - - if (num < 5 && (colour = strrchr (buf, ':'))) { - label = g_new (MailConfigLabel, 1); - - *colour++ = '\0'; - label->tag = g_strdup(label_defaults[num].tag); - label->name = g_strdup (buf); - label->colour = g_strdup (colour); - - n = g_slist_alloc (); - n->next = NULL; - n->data = label; - - if (tail == NULL) - labels = n; - else - tail->next = n; - - tail = n; - - num++; - } - - g_free (buf); - - n = list->next; - g_slist_free_1 (list); - list = n; - } - - while (num < 5) { - /* complete the list with defaults */ - label = g_new (MailConfigLabel, 1); - label->tag = g_strdup (label_defaults[num].tag); - label->name = g_strdup (_(label_defaults[num].name)); - label->colour = g_strdup (label_defaults[num].colour); - - n = g_slist_alloc (); - n->next = NULL; - n->data = label; - - if (tail == NULL) - labels = n; - else - tail->next = n; - - tail = n; - - num++; - } - - config->labels = labels; -} - -static void -config_clear_mime_types (void) -{ - int i; - - for (i = 0; i < config->mime_types->len; i++) - g_free (config->mime_types->pdata[i]); - - g_ptr_array_set_size (config->mime_types, 0); -} - -static void -config_cache_mime_types (void) -{ - GSList *n, *nn; - - n = gconf_client_get_list (config->gconf, "/apps/evolution/mail/display/mime_types", GCONF_VALUE_STRING, NULL); - while (n != NULL) { - nn = n->next; - g_ptr_array_add (config->mime_types, n->data); - g_slist_free_1 (n); - n = nn; - } - - g_ptr_array_add (config->mime_types, NULL); -} - -#define CONFIG_GET_SPELL_VALUE(t,x,prop,f,c) G_STMT_START { \ - val = gconf_client_get_without_default (config->gconf, "/GNOME/Spell" x, NULL); \ - if (val) { f; prop = c (gconf_value_get_ ## t (val)); \ - gconf_value_free (val); } } G_STMT_END - -static void -config_write_style (void) -{ - GConfValue *val; - char *filename; - FILE *rc; - gboolean custom; - char *fix_font; - char *var_font; - gint red = 0xffff, green = 0, blue = 0; - - /* - * This is the wrong way to get the path but it needs to - * always be the same as the gtk_rc_parse call and evolution_dir - * may not have been set yet - * - * filename = g_build_filename (evolution_dir, MAIL_CONFIG_RC, NULL); - * - * EPFIXME this kludge needs to go away. - */ - filename = g_build_filename (g_get_home_dir (), "evolution", MAIL_CONFIG_RC, NULL); - - rc = fopen (filename, "w"); - - if (!rc) { - g_warning ("unable to open %s", filename); - g_free (filename); - return; - } - g_free (filename); - - custom = gconf_client_get_bool (config->gconf, "/apps/evolution/mail/display/fonts/use_custom", NULL); - var_font = gconf_client_get_string (config->gconf, "/apps/evolution/mail/display/fonts/variable", NULL); - fix_font = gconf_client_get_string (config->gconf, "/apps/evolution/mail/display/fonts/monospace", NULL); - - CONFIG_GET_SPELL_VALUE (int, "/spell_error_color_red", red, (void)0, (int)); - CONFIG_GET_SPELL_VALUE (int, "/spell_error_color_green", green, (void)0, (int)); - CONFIG_GET_SPELL_VALUE (int, "/spell_error_color_blue", blue, (void)0, (int)); - - fprintf (rc, "style \"evolution-mail-custom-fonts\" {\n"); - fprintf (rc, " GtkHTML::spell_error_color = \"#%02x%02x%02x\"\n", - 0xff & (red >> 8), 0xff & (green >> 8), 0xff & (blue >> 8)); - - if (custom && var_font && fix_font) { - fprintf (rc, - " GtkHTML::fixed_font_name = \"%s\"\n" - " font_name = \"%s\"\n", - fix_font, var_font); - } - fprintf (rc, "}\n\n"); - - fprintf (rc, "widget \"*.MailDisplay.*.GtkHTML\" style \"evolution-mail-custom-fonts\"\n"); - fprintf (rc, "widget \"*.FolderBrowser.*.GtkHTML\" style \"evolution-mail-custom-fonts\"\n"); - fprintf (rc, "widget \"*.BonoboPlug.*.GtkHTML\" style \"evolution-mail-custom-fonts\"\n"); - fprintf (rc, "widget \"*.EvolutionMailPrintHTMLWidget\" style \"evolution-mail-custom-fonts\"\n"); - - if (fclose (rc) == 0) - gtk_rc_reparse_all (); -} - -static void -gconf_labels_changed (GConfClient *client, guint cnxn_id, - GConfEntry *entry, gpointer user_data) -{ - config_clear_labels (); - config_cache_labels (); -} - -static void -gconf_style_changed (GConfClient *client, guint cnxn_id, - GConfEntry *entry, gpointer user_data) -{ - config_write_style (); -} - -static void -gconf_mime_types_changed (GConfClient *client, guint cnxn_id, - GConfEntry *entry, gpointer user_data) -{ - config_clear_mime_types (); - config_cache_mime_types (); -} - -/* Config struct routines */ -void -mail_config_init (void) -{ - char *filename; - - if (config) - return; - - config = g_new0 (MailConfig, 1); - config->gconf = gconf_client_get_default (); - config->mime_types = g_ptr_array_new (); - - mail_config_clear (); - - /* - EPFIXME: This kludge needs to go away. - filename = g_build_filename (evolution_dir, MAIL_CONFIG_RC, NULL); - */ - filename = g_build_filename (g_get_home_dir (), "evolution", MAIL_CONFIG_RC, NULL); - gtk_rc_parse (filename); - g_free (filename); - - gconf_client_add_dir (config->gconf, "/apps/evolution/mail/display/fonts", - GCONF_CLIENT_PRELOAD_ONELEVEL, NULL); - gconf_client_add_dir (config->gconf, "/GNOME/Spell", - GCONF_CLIENT_PRELOAD_ONELEVEL, NULL); - config->font_notify_id = gconf_client_notify_add (config->gconf, "/apps/evolution/mail/display/fonts", - gconf_style_changed, NULL, NULL, NULL); - config->spell_notify_id = gconf_client_notify_add (config->gconf, "/GNOME/Spell", - gconf_style_changed, NULL, NULL, NULL); - - gconf_client_add_dir (config->gconf, "/apps/evolution/mail/labels", - GCONF_CLIENT_PRELOAD_ONELEVEL, NULL); - config->label_notify_id = - gconf_client_notify_add (config->gconf, "/apps/evolution/mail/labels", - gconf_labels_changed, NULL, NULL, NULL); - - gconf_client_add_dir (config->gconf, "/apps/evolution/mail/mime_types", - GCONF_CLIENT_PRELOAD_ONELEVEL, NULL); - config->mime_types_notify_id = - gconf_client_notify_add (config->gconf, "/apps/evolution/mail/mime_types", - gconf_mime_types_changed, NULL, NULL, NULL); - - config_cache_labels (); - config_read_signatures (); - config_cache_mime_types (); - - config->accounts = e_account_list_new (config->gconf); -} - -void -mail_config_clear (void) -{ - if (!config) - return; - - if (config->accounts) { - g_object_unref (config->accounts); - config->accounts = NULL; - } - - config_clear_labels (); - config_clear_mime_types (); -} - -void -mail_config_write_account_sig (EAccount *account, int id) -{ - /* FIXME: what is this supposed to do? */ - ; -} - -void -mail_config_write (void) -{ - if (!config) - return; - - config_write_signatures (); - e_account_list_save (config->accounts); - - gconf_client_suggest_sync (config->gconf, NULL); -} - -void -mail_config_write_on_exit (void) -{ - EAccount *account; - EIterator *iter; - - if (config_write_timeout) { - g_source_remove (config_write_timeout); - config_write_timeout = 0; - mail_config_write (); - } - - /* Passwords */ - - /* then we make sure the ones we want to remember are in the - session cache */ - iter = e_list_get_iterator ((EList *) config->accounts); - while (e_iterator_is_valid (iter)) { - char *passwd; - - account = (EAccount *) e_iterator_get (iter); - - if (account->source->save_passwd && account->source->url) { - passwd = mail_session_get_password (account->source->url); - mail_session_forget_password (account->source->url); - mail_session_add_password (account->source->url, passwd); - g_free (passwd); - } - - if (account->transport->save_passwd && account->transport->url) { - passwd = mail_session_get_password (account->transport->url); - mail_session_forget_password (account->transport->url); - mail_session_add_password (account->transport->url, passwd); - g_free (passwd); - } - - e_iterator_next (iter); - } - - g_object_unref (iter); - - /* then we clear out our component passwords */ - e_passwords_clear_component_passwords ("Mail"); - - /* then we remember them */ - iter = e_list_get_iterator ((EList *) config->accounts); - while (e_iterator_is_valid (iter)) { - account = (EAccount *) e_iterator_get (iter); - - if (account->source->save_passwd && account->source->url) - mail_session_remember_password (account->source->url); - - if (account->transport->save_passwd && account->transport->url) - mail_session_remember_password (account->transport->url); - - e_iterator_next (iter); - } - - /* now do cleanup */ - mail_config_clear (); - - g_object_unref (config->gconf); - g_ptr_array_free (config->mime_types, TRUE); - - g_free (config); -} - -/* Accessor functions */ -GConfClient * -mail_config_get_gconf_client (void) -{ - return config->gconf; -} - -gboolean -mail_config_is_configured (void) -{ - return e_list_length ((EList *) config->accounts) > 0; -} - -gboolean -mail_config_is_corrupt (void) -{ - return config->corrupt; -} - -GSList * -mail_config_get_labels (void) -{ - return config->labels; -} - -const char * -mail_config_get_label_color_by_name (const char *name) -{ - MailConfigLabel *label; - GSList *node; - - node = config->labels; - while (node != NULL) { - label = node->data; - if (!strcmp (label->tag, name)) - return label->colour; - node = node->next; - } - - return NULL; -} - -const char * -mail_config_get_label_color_by_index (int index) -{ - MailConfigLabel *label; - - label = g_slist_nth_data (config->labels, index); - - if (label) - return label->colour; - - return NULL; -} - -const char ** -mail_config_get_allowable_mime_types (void) -{ - return (const char **) config->mime_types->pdata; -} - -gboolean -mail_config_find_account (EAccount *account) -{ - EAccount *acnt; - EIterator *iter; - - iter = e_list_get_iterator ((EList *) config->accounts); - while (e_iterator_is_valid (iter)) { - acnt = (EAccount *) e_iterator_get (iter); - if (acnt == account) { - g_object_unref (iter); - return TRUE; - } - - e_iterator_next (iter); - } - - g_object_unref (iter); - - return FALSE; -} - -EAccount * -mail_config_get_default_account (void) -{ - if (config == NULL) - mail_config_init (); - - if (!config->accounts) - return NULL; - - /* should probably return const */ - return (EAccount *)e_account_list_get_default(config->accounts); -} - -EAccount * -mail_config_get_account_by_name (const char *account_name) -{ - return (EAccount *)e_account_list_find(config->accounts, E_ACCOUNT_FIND_NAME, account_name); -} - -EAccount * -mail_config_get_account_by_uid (const char *uid) -{ - return (EAccount *) e_account_list_find (config->accounts, E_ACCOUNT_FIND_UID, uid); -} - -EAccount * -mail_config_get_account_by_source_url (const char *source_url) -{ - CamelProvider *provider; - EAccount *account; - CamelURL *source; - EIterator *iter; - - g_return_val_if_fail (source_url != NULL, NULL); - - provider = camel_session_get_provider (session, source_url, NULL); - if (!provider) - return NULL; - - source = camel_url_new (source_url, NULL); - if (!source) - return NULL; - - iter = e_list_get_iterator ((EList *) config->accounts); - while (e_iterator_is_valid (iter)) { - account = (EAccount *) e_iterator_get (iter); - - if (account->source && account->source->url) { - CamelURL *url; - - url = camel_url_new (account->source->url, NULL); - if (url && provider->url_equal (url, source)) { - camel_url_free (url); - camel_url_free (source); - g_object_unref (iter); - - return account; - } - - if (url) - camel_url_free (url); - } - - e_iterator_next (iter); - } - - g_object_unref (iter); - - camel_url_free (source); - - return NULL; -} - -EAccount * -mail_config_get_account_by_transport_url (const char *transport_url) -{ - CamelProvider *provider; - CamelURL *transport; - EAccount *account; - EIterator *iter; - - g_return_val_if_fail (transport_url != NULL, NULL); - - provider = camel_session_get_provider (session, transport_url, NULL); - if (!provider) - return NULL; - - transport = camel_url_new (transport_url, NULL); - if (!transport) - return NULL; - - iter = e_list_get_iterator ((EList *) config->accounts); - while (e_iterator_is_valid (iter)) { - account = (EAccount *) e_iterator_get (iter); - - if (account->transport && account->transport->url) { - CamelURL *url; - - url = camel_url_new (account->transport->url, NULL); - if (url && provider->url_equal (url, transport)) { - camel_url_free (url); - camel_url_free (transport); - g_object_unref (iter); - - return account; - } - - if (url) - camel_url_free (url); - } - - e_iterator_next (iter); - } - - g_object_unref (iter); - - camel_url_free (transport); - - return NULL; -} - -EAccountList * -mail_config_get_accounts (void) -{ - g_assert (config != NULL); - - return config->accounts; -} - -void -mail_config_add_account (EAccount *account) -{ - e_account_list_add(config->accounts, account); - mail_config_save_accounts (); -} - -void -mail_config_remove_account (EAccount *account) -{ - e_account_list_remove(config->accounts, account); - mail_config_save_accounts (); -} - -void -mail_config_set_default_account (EAccount *account) -{ - e_account_list_set_default(config->accounts, account); -} - -EAccountIdentity * -mail_config_get_default_identity (void) -{ - EAccount *account; - - account = mail_config_get_default_account (); - if (account) - return account->id; - else - return NULL; -} - -EAccountService * -mail_config_get_default_transport (void) -{ - EAccount *account; - EIterator *iter; - - account = mail_config_get_default_account (); - if (account && account->transport && account->transport->url) - return account->transport; - - /* return the first account with a transport? */ - iter = e_list_get_iterator ((EList *) config->accounts); - while (e_iterator_is_valid (iter)) { - account = (EAccount *) e_iterator_get (iter); - - if (account->transport && account->transport->url) { - g_object_unref (iter); - - return account->transport; - } - - e_iterator_next (iter); - } - - g_object_unref (iter); - - return NULL; -} - -static char * -uri_to_evname (const char *uri, const char *prefix) -{ - const char *base_directory = mail_component_peek_base_directory (mail_component_peek ()); - char *safe; - char *tmp; - - safe = g_strdup (uri); - e_filename_make_safe (safe); - /* blah, easiest thing to do */ - if (prefix[0] == '*') - tmp = g_strdup_printf ("%s/mail/%s%s.xml", base_directory, prefix + 1, safe); - else - tmp = g_strdup_printf ("%s/mail/%s%s", base_directory, prefix, safe); - g_free (safe); - return tmp; -} - -void -mail_config_uri_renamed (GCompareFunc uri_cmp, const char *old, const char *new) -{ - EAccount *account; - EIterator *iter; - int i, work = 0; - char *oldname, *newname; - char *cachenames[] = { "config/hidestate-", - "config/et-expanded-", - "config/et-header-", - "*views/current_view-", - "*views/custom_view-", - NULL }; - - iter = e_list_get_iterator ((EList *) config->accounts); - while (e_iterator_is_valid (iter)) { - account = (EAccount *) e_iterator_get (iter); - - if (account->sent_folder_uri && uri_cmp (account->sent_folder_uri, old)) { - g_free (account->sent_folder_uri); - account->sent_folder_uri = g_strdup (new); - work = 1; - } - - if (account->drafts_folder_uri && uri_cmp (account->drafts_folder_uri, old)) { - g_free (account->drafts_folder_uri); - account->drafts_folder_uri = g_strdup (new); - work = 1; - } - - e_iterator_next (iter); - } - - g_object_unref (iter); - - /* ignore return values or if the files exist or - * not, doesn't matter */ - - for (i = 0; cachenames[i]; i++) { - oldname = uri_to_evname (old, cachenames[i]); - newname = uri_to_evname (new, cachenames[i]); - /*printf ("** renaming %s to %s\n", oldname, newname);*/ - rename (oldname, newname); - g_free (oldname); - g_free (newname); - } - - /* nasty ... */ - if (work) - mail_config_write (); -} - -void -mail_config_uri_deleted (GCompareFunc uri_cmp, const char *uri) -{ - EAccount *account; - EIterator *iter; - int work = 0; - /* assumes these can't be removed ... */ - extern char *default_sent_folder_uri, *default_drafts_folder_uri; - - iter = e_list_get_iterator ((EList *) config->accounts); - while (e_iterator_is_valid (iter)) { - account = (EAccount *) e_iterator_get (iter); - - if (account->sent_folder_uri && uri_cmp (account->sent_folder_uri, uri)) { - g_free (account->sent_folder_uri); - account->sent_folder_uri = g_strdup (default_sent_folder_uri); - work = 1; - } - - if (account->drafts_folder_uri && uri_cmp (account->drafts_folder_uri, uri)) { - g_free (account->drafts_folder_uri); - account->drafts_folder_uri = g_strdup (default_drafts_folder_uri); - work = 1; - } - - e_iterator_next (iter); - } - - /* nasty again */ - if (work) - mail_config_write (); -} - -void -mail_config_service_set_save_passwd (EAccountService *service, gboolean save_passwd) -{ - service->save_passwd = save_passwd; -} - -char * -mail_config_folder_to_safe_url (CamelFolder *folder) -{ - char *url; - - url = mail_tools_folder_to_url (folder); - e_filename_make_safe (url); - - return url; -} - -char * -mail_config_folder_to_cachename (CamelFolder *folder, const char *prefix) -{ - char *url, *basename, *filename; - const char *evolution_dir; - - evolution_dir = mail_component_peek_base_directory (mail_component_peek ()); - - url = mail_config_folder_to_safe_url (folder); - basename = g_strdup_printf ("%s%s", prefix, url); - filename = g_build_filename (evolution_dir, "mail", "config", basename, NULL); - g_free (basename); - g_free (url); - - return filename; -} - - -/* Async service-checking/authtype-lookup code. */ -struct _check_msg { - struct _mail_msg msg; - - const char *url; - CamelProviderType type; - GList **authtypes; - gboolean *success; -}; - -static char * -check_service_describe (struct _mail_msg *mm, int complete) -{ - return g_strdup (_("Checking Service")); -} - -static void -check_service_check (struct _mail_msg *mm) -{ - struct _check_msg *m = (struct _check_msg *)mm; - CamelService *service = NULL; - - camel_operation_register(mm->cancel); - - service = camel_session_get_service (session, m->url, m->type, &mm->ex); - if (!service) { - camel_operation_unregister(mm->cancel); - return; - } - - if (m->authtypes) - *m->authtypes = camel_service_query_auth_types (service, &mm->ex); - else - camel_service_connect (service, &mm->ex); - - camel_object_unref (service); - *m->success = !camel_exception_is_set(&mm->ex); - - camel_operation_unregister(mm->cancel); -} - -static struct _mail_msg_op check_service_op = { - check_service_describe, - check_service_check, - NULL, - NULL -}; - -static void -check_response (GtkDialog *dialog, int button, gpointer data) -{ - int *msg_id = data; - - mail_msg_cancel (*msg_id); -} - -/** - * mail_config_check_service: - * @url: service url - * @type: provider type - * @authtypes: set to list of supported authtypes on return if non-%NULL. - * - * Checks the service for validity. If @authtypes is non-%NULL, it will - * be filled in with a list of supported authtypes. - * - * Return value: %TRUE on success or %FALSE on error. - **/ -gboolean -mail_config_check_service (const char *url, CamelProviderType type, GList **authtypes, GtkWindow *window) -{ - static GtkWidget *dialog = NULL; - gboolean ret = FALSE; - struct _check_msg *m; - GtkWidget *label; - int id; - - if (dialog) { - gdk_window_raise (dialog->window); - *authtypes = NULL; - return FALSE; - } - - m = mail_msg_new (&check_service_op, NULL, sizeof(*m)); - m->url = url; - m->type = type; - m->authtypes = authtypes; - m->success = &ret; - - id = m->msg.seq; - e_thread_put(mail_thread_new, (EMsg *)m); - - dialog = gtk_dialog_new_with_buttons(_("Connecting to server..."), window, - GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, - NULL); - label = gtk_label_new (_("Connecting to server...")); - gtk_box_pack_start (GTK_BOX(GTK_DIALOG (dialog)->vbox), - label, TRUE, TRUE, 10); - g_signal_connect(dialog, "response", G_CALLBACK (check_response), &id); - gtk_widget_show_all (dialog); - - mail_msg_wait(id); - - gtk_widget_destroy (dialog); - dialog = NULL; - - return ret; -} - -static gboolean -do_config_write (gpointer data) -{ - config_write_timeout = 0; - mail_config_write (); - return FALSE; -} - -GSList * -mail_config_get_signature_list (void) -{ - return config->signatures; -} - -static char * -get_new_signature_filename (void) -{ - const char *base_directory; - char *filename, *id; - struct stat st; - int i; - - base_directory = mail_component_peek_base_directory (mail_component_peek ()); - filename = g_build_filename (base_directory, "signatures", NULL); - if (lstat (filename, &st)) { - if (errno == ENOENT) { - if (mkdir (filename, 0700)) - g_warning ("Fatal problem creating %s directory.", filename); - } else - g_warning ("Fatal problem with %s directory.", filename); - } - g_free (filename); - - filename = g_malloc (strlen (base_directory) + sizeof ("/signatures/signature-") + 12); - id = g_stpcpy (filename, base_directory); - id = g_stpcpy (id, "/signatures/signature-"); - - for (i = 0; i < (INT_MAX - 1); i++) { - sprintf (id, "%d", i); - if (lstat (filename, &st) == -1 && errno == ENOENT) { - int fd; - - fd = creat (filename, 0600); - if (fd >= 0) { - close (fd); - return filename; - } - } - } - - g_free (filename); - - return NULL; -} - - -MailConfigSignature * -mail_config_signature_new (gboolean html, const char *script) -{ - MailConfigSignature *sig; - - sig = g_new0 (MailConfigSignature, 1); - - sig->id = config->sig_nextid++; - sig->name = g_strdup (_("Unnamed")); - if (script) - sig->script = g_strdup (script); - else - sig->filename = get_new_signature_filename (); - sig->html = html; - - return sig; -} - - -void -mail_config_signature_add (MailConfigSignature *sig) -{ - g_assert (g_slist_find (config->signatures, sig) == NULL); - - config->signatures = g_slist_append (config->signatures, sig); - config_write_signatures (); - mail_config_signature_emit_event (MAIL_CONFIG_SIG_EVENT_ADDED, sig); -} - -static void -delete_unused_signature_file (const char *filename) -{ - char *signatures_dir; - int len; - - signatures_dir = g_strconcat (mail_component_peek_base_directory (mail_component_peek ()), - "/signatures", NULL); - - /* remove signature file if it's in evolution dir and no other signature uses it */ - len = strlen (signatures_dir); - if (filename && !strncmp (filename, signatures_dir, len)) { - gboolean only_one = TRUE; - GSList *node; - - node = config->signatures; - while (node != NULL) { - MailConfigSignature *sig = node->data; - - if (sig->filename && !strcmp (filename, sig->filename)) { - only_one = FALSE; - break; - } - - node = node->next; - } - - if (only_one) - unlink (filename); - } - - g_free (signatures_dir); -} - -void -mail_config_signature_delete (MailConfigSignature *sig) -{ - EAccount *account; - EIterator *iter; - GSList *node, *next; - gboolean after = FALSE; - int index; - - index = g_slist_index (config->signatures, sig); - - iter = e_list_get_iterator ((EList *) config->accounts); - while (e_iterator_is_valid (iter)) { - account = (EAccount *) e_iterator_get (iter); - - if (account->id->def_signature == index) - account->id->def_signature = -1; - else if (account->id->def_signature > index) - account->id->def_signature--; - - e_iterator_next (iter); - } - - g_object_unref (iter); - - node = config->signatures; - while (node != NULL) { - next = node->next; - - if (after) { - ((MailConfigSignature *) node->data)->id--; - } else if (node->data == sig) { - config->signatures = g_slist_remove_link (config->signatures, node); - config->sig_nextid--; - after = TRUE; - } - - node = next; - } - - config_write_signatures (); - delete_unused_signature_file (sig->filename); - /* printf ("signatures: %d\n", config->signatures); */ - mail_config_signature_emit_event (MAIL_CONFIG_SIG_EVENT_DELETED, sig); - signature_destroy (sig); -} - -void -mail_config_signature_set_filename (MailConfigSignature *sig, const char *filename) -{ - char *old_filename = sig->filename; - - sig->filename = g_strdup (filename); - if (old_filename) { - delete_unused_signature_file (old_filename); - g_free (old_filename); - } - config_write_signatures (); -} - -void -mail_config_signature_set_name (MailConfigSignature *sig, const char *name) -{ - g_free (sig->name); - sig->name = g_strdup (name); - - config_write_signatures (); - - mail_config_signature_emit_event (MAIL_CONFIG_SIG_EVENT_NAME_CHANGED, sig); -} - -static GList *clients = NULL; - -/* uh...the following code is snot. this needs to be fixed. I just don't feel like doing it right now. */ - -void -mail_config_signature_register_client (MailConfigSignatureClient client, gpointer data) -{ - clients = g_list_append (clients, client); - clients = g_list_append (clients, data); -} - -void -mail_config_signature_unregister_client (MailConfigSignatureClient client, gpointer data) -{ - GList *link; - - if ((link = g_list_find (clients, data)) != NULL) { - clients = g_list_remove_link (clients, link->prev); - clients = g_list_remove_link (clients, link); - } -} - -void -mail_config_signature_emit_event (MailConfigSigEvent event, MailConfigSignature *sig) -{ - GList *l, *next; - - for (l = clients; l; l = next) { - next = l->next->next; - (*((MailConfigSignatureClient) l->data)) (event, sig, l->next->data); - } -} - -gchar * -mail_config_signature_run_script (gchar *script) -{ - int result, status; - int in_fds[2]; - pid_t pid; - - if (pipe (in_fds) == -1) { - g_warning ("Failed to create pipe to '%s': %s", script, g_strerror (errno)); - return NULL; - } - - if (!(pid = fork ())) { - /* child process */ - int maxfd, i; - - close (in_fds [0]); - if (dup2 (in_fds[1], STDOUT_FILENO) < 0) - _exit (255); - close (in_fds [1]); - - setsid (); - - maxfd = sysconf (_SC_OPEN_MAX); - for (i = 3; i < maxfd; i++) { - if (i != STDIN_FILENO && i != STDOUT_FILENO && i != STDERR_FILENO) - fcntl (i, F_SETFD, FD_CLOEXEC); - } - - execlp (script, script, NULL); - g_warning ("Could not execute %s: %s\n", script, g_strerror (errno)); - _exit (255); - } else if (pid < 0) { - g_warning ("Failed to create create child process '%s': %s", script, g_strerror (errno)); - return NULL; - } else { - CamelStreamFilter *filtered_stream; - CamelStreamMem *memstream; - CamelMimeFilter *charenc; - CamelStream *stream; - GByteArray *buffer; - char *charset; - char *content; - - /* parent process */ - close (in_fds[1]); - - stream = camel_stream_fs_new_with_fd (in_fds[0]); - - memstream = (CamelStreamMem *) camel_stream_mem_new (); - buffer = g_byte_array_new (); - camel_stream_mem_set_byte_array (memstream, buffer); - - camel_stream_write_to_stream (stream, (CamelStream *) memstream); - camel_object_unref (stream); - - /* signature scripts are supposed to generate UTF-8 content, but because users - are known to not ever read the manual... we try to do our best if the - content isn't valid UTF-8 by assuming that the content is in the user's - preferred charset. */ - if (!g_utf8_validate (buffer->data, buffer->len, NULL)) { - stream = (CamelStream *) memstream; - memstream = (CamelStreamMem *) camel_stream_mem_new (); - camel_stream_mem_set_byte_array (memstream, g_byte_array_new ()); - - filtered_stream = camel_stream_filter_new_with_stream (stream); - camel_object_unref (stream); - - charset = gconf_client_get_string (config->gconf, "/apps/evolution/mail/composer/charset", NULL); - charenc = (CamelMimeFilter *) camel_mime_filter_charset_new_convert (charset, "utf-8"); - camel_stream_filter_add (filtered_stream, charenc); - camel_object_unref (charenc); - g_free (charset); - - camel_stream_write_to_stream ((CamelStream *) filtered_stream, (CamelStream *) memstream); - camel_object_unref (filtered_stream); - g_byte_array_free (buffer, TRUE); - - buffer = memstream->buffer; - } - - camel_object_unref (memstream); - - g_byte_array_append (buffer, "", 1); - content = buffer->data; - g_byte_array_free (buffer, FALSE); - - /* wait for the script process to terminate */ - result = waitpid (pid, &status, 0); - - if (result == -1 && errno == EINTR) { - /* child process is hanging... */ - kill (pid, SIGTERM); - sleep (1); - result = waitpid (pid, &status, WNOHANG); - if (result == 0) { - /* ...still hanging, set phasers to KILL */ - kill (pid, SIGKILL); - sleep (1); - result = waitpid (pid, &status, WNOHANG); - } - } - - return content; - } -} - -void -mail_config_signature_set_html (MailConfigSignature *sig, gboolean html) -{ - if (sig->html != html) { - sig->html = html; - config_write_signatures (); - mail_config_signature_emit_event (MAIL_CONFIG_SIG_EVENT_HTML_CHANGED, sig); - } -} diff --git a/mail/mail-config.glade b/mail/mail-config.glade deleted file mode 100644 index 7b451f0a56..0000000000 --- a/mail/mail-config.glade +++ /dev/null @@ -1,6020 +0,0 @@ -<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*--> -<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd"> - -<glade-interface> -<requires lib="gnome"/> - -<widget class="GtkWindow" id="account_druid"> - <property name="title" translatable="yes">Evolution Account Assistant</property> - <property name="type">GTK_WINDOW_TOPLEVEL</property> - <property name="window_position">GTK_WIN_POS_NONE</property> - <property name="modal">False</property> - <property name="resizable">True</property> - <property name="destroy_with_parent">False</property> - - <child> - <widget class="GnomeDruid" id="druid"> - <property name="border_width">4</property> - <property name="visible">True</property> - <property name="show_help">False</property> - - <child> - <widget class="GnomeDruidPageEdge" id="start_page"> - <property name="visible">True</property> - <property name="position">GNOME_EDGE_START</property> - <property name="title" translatable="yes">Mail Configuration</property> - <property name="text" translatable="yes">Welcome to the Evolution Mail Configuration Assistant. - -Click "Forward" to begin. </property> - </widget> - </child> - - <child> - <widget class="GnomeDruidPageStandard" id="identity_page"> - <property name="visible">True</property> - <property name="title" translatable="yes">Identity</property> - <property name="logo">mail-config-druid-identity.png</property> - - <child internal-child="vbox"> - <widget class="GtkVBox" id="druid_identity_vbox"> - <property name="border_width">16</property> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">0</property> - - <child> - <placeholder/> - </child> - </widget> - </child> - </widget> - </child> - - <child> - <widget class="GnomeDruidPageStandard" id="source_page"> - <property name="visible">True</property> - <property name="title" translatable="yes">Receiving Email</property> - <property name="logo">mail-config-druid-receive.png</property> - - <child internal-child="vbox"> - <widget class="GtkVBox" id="druid_source_vbox"> - <property name="border_width">16</property> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">0</property> - - <child> - <placeholder/> - </child> - </widget> - </child> - </widget> - </child> - - <child> - <widget class="GnomeDruidPageStandard" id="extra_page"> - <property name="visible">True</property> - <property name="title" translatable="yes">Receiving Email</property> - <property name="logo">mail-config-druid-receive.png</property> - - <child internal-child="vbox"> - <widget class="GtkVBox" id="druid_extra_vbox"> - <property name="border_width">16</property> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">0</property> - - <child> - <placeholder/> - </child> - </widget> - </child> - </widget> - </child> - - <child> - <widget class="GnomeDruidPageStandard" id="transport_page"> - <property name="visible">True</property> - <property name="title" translatable="yes">Sending Email</property> - <property name="logo">mail-config-druid-send.png</property> - - <child internal-child="vbox"> - <widget class="GtkVBox" id="druid_transport_vbox"> - <property name="border_width">16</property> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">0</property> - - <child> - <placeholder/> - </child> - </widget> - </child> - </widget> - </child> - - <child> - <widget class="GnomeDruidPageStandard" id="management_page"> - <property name="visible">True</property> - <property name="title" translatable="yes">Account Management</property> - <property name="logo">mail-config-druid-account-name.png</property> - - <child internal-child="vbox"> - <widget class="GtkVBox" id="druid_management_vbox"> - <property name="border_width">16</property> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">0</property> - - <child> - <placeholder/> - </child> - </widget> - </child> - </widget> - </child> - - <child> - <widget class="GnomeDruidPageEdge" id="finish_page"> - <property name="visible">True</property> - <property name="position">GNOME_EDGE_FINISH</property> - <property name="title" translatable="yes">Done</property> - <property name="text" translatable="yes">Congratulations, your mail configuration is complete. - -You are now ready to send and receive email -using Evolution. - -Click "Apply" to save your settings.</property> - </widget> - </child> - </widget> - </child> -</widget> - -<widget class="GtkWindow" id="account_editor"> - <property name="title" translatable="yes">Account Editor</property> - <property name="type">GTK_WINDOW_TOPLEVEL</property> - <property name="window_position">GTK_WIN_POS_NONE</property> - <property name="modal">False</property> - <property name="resizable">True</property> - <property name="destroy_with_parent">False</property> - - <child> - <widget class="GtkNotebook" id="account_editor_notebook"> - <property name="border_width">6</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="show_tabs">True</property> - <property name="show_border">True</property> - <property name="tab_pos">GTK_POS_TOP</property> - <property name="scrollable">False</property> - <property name="enable_popup">False</property> - - <child> - <widget class="GtkVBox" id="vboxIdentityBorder"> - <property name="border_width">6</property> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">3</property> - - <child> - <widget class="GtkVBox" id="identity_vbox"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">3</property> - - <child> - <widget class="GtkFrame" id="management_frame"> - <property name="visible">True</property> - <property name="label_xalign">0</property> - <property name="label_yalign">0.5</property> - <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property> - - <child> - <widget class="GtkVBox" id="account_vbox"> - <property name="border_width">6</property> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">3</property> - - <child> - <widget class="GtkLabel" id="management_description_label"> - <property name="visible">True</property> - <property name="label" translatable="yes">Type the name by which you would like to refer to this account. -For example: "Work" or "Personal"</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">3</property> - <property name="ypad">3</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkHBox" id="hboxIdentityName"> - <property name="border_width">3</property> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">4</property> - - <child> - <widget class="GtkLabel" id="management_name_label"> - <property name="visible">True</property> - <property name="label" translatable="yes">_Name:</property> - <property name="use_underline">True</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_RIGHT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="mnemonic_widget">management_name</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkEntry" id="management_name"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="editable">True</property> - <property name="visibility">True</property> - <property name="max_length">0</property> - <property name="text" translatable="yes"></property> - <property name="has_frame">True</property> - <property name="invisible_char" translatable="yes">*</property> - <property name="activates_default">False</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkCheckButton" id="management_default"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">_Make this my default account</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="active">False</property> - <property name="inconsistent">False</property> - <property name="draw_indicator">True</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - </widget> - </child> - - <child> - <widget class="GtkLabel" id="label1"> - <property name="visible">True</property> - <property name="label" translatable="yes">Account Information</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="type">label_item</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkFrame" id="identity_required_frame"> - <property name="visible">True</property> - <property name="label_xalign">0</property> - <property name="label_yalign">0.5</property> - <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property> - - <child> - <widget class="GtkTable" id="identity_required_table"> - <property name="border_width">6</property> - <property name="visible">True</property> - <property name="n_rows">2</property> - <property name="n_columns">2</property> - <property name="homogeneous">False</property> - <property name="row_spacing">6</property> - <property name="column_spacing">6</property> - - <child> - <widget class="GtkEntry" id="identity_address"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="editable">True</property> - <property name="visibility">True</property> - <property name="max_length">0</property> - <property name="text" translatable="yes"></property> - <property name="has_frame">True</property> - <property name="invisible_char" translatable="yes">*</property> - <property name="activates_default">False</property> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="identity_address_label"> - <property name="visible">True</property> - <property name="label" translatable="yes">Email _address:</property> - <property name="use_underline">True</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="mnemonic_widget">identity_address</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="identity_full_name_label"> - <property name="visible">True</property> - <property name="label" translatable="yes">_Full name:</property> - <property name="use_underline">True</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="mnemonic_widget">identity_full_name</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkEntry" id="identity_full_name"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="editable">True</property> - <property name="visibility">True</property> - <property name="max_length">0</property> - <property name="text" translatable="yes"></property> - <property name="has_frame">True</property> - <property name="invisible_char" translatable="yes">*</property> - <property name="activates_default">False</property> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="y_options"></property> - </packing> - </child> - </widget> - </child> - - <child> - <widget class="GtkLabel" id="label2"> - <property name="visible">True</property> - <property name="label" translatable="yes">Required Information</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="type">label_item</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkFrame" id="identity_optional_frame"> - <property name="visible">True</property> - <property name="label_xalign">0</property> - <property name="label_yalign">0.5</property> - <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property> - - <child> - <widget class="GtkTable" id="identity_optional_table"> - <property name="border_width">6</property> - <property name="visible">True</property> - <property name="n_rows">3</property> - <property name="n_columns">2</property> - <property name="homogeneous">False</property> - <property name="row_spacing">6</property> - <property name="column_spacing">6</property> - - <child> - <widget class="GtkLabel" id="identity_organization_label"> - <property name="visible">True</property> - <property name="label" translatable="yes">Or_ganization:</property> - <property name="use_underline">True</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="mnemonic_widget">identity_organization</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="sigLabel"> - <property name="visible">True</property> - <property name="label" translatable="yes">_Default signature:</property> - <property name="use_underline">True</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">2</property> - <property name="bottom_attach">3</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkEntry" id="identity_organization"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="editable">True</property> - <property name="visibility">True</property> - <property name="max_length">0</property> - <property name="text" translatable="yes"></property> - <property name="has_frame">True</property> - <property name="invisible_char" translatable="yes">*</property> - <property name="activates_default">False</property> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="reply_to_label"> - <property name="visible">True</property> - <property name="label" translatable="yes">Re_ply-To:</property> - <property name="use_underline">True</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="mnemonic_widget">identity_reply_to</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkEntry" id="identity_reply_to"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="editable">True</property> - <property name="visibility">True</property> - <property name="max_length">0</property> - <property name="text" translatable="yes"></property> - <property name="has_frame">True</property> - <property name="invisible_char" translatable="yes">*</property> - <property name="activates_default">False</property> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkHBox" id="hbox169"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">5</property> - - <child> - <widget class="GtkOptionMenu" id="sigOption"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="history">0</property> - - <child internal-child="menu"> - <widget class="GtkMenu" id="convertwidget1"> - <property name="visible">True</property> - - <child> - <widget class="GtkMenuItem" id="convertwidget2"> - <property name="visible">True</property> - <property name="label" translatable="yes">Default</property> - <property name="use_underline">True</property> - </widget> - </child> - </widget> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkButton" id="sigAddNew"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">Add new signature...</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <signal name="clicked" handler="sigAddNewClicked"/> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="pack_type">GTK_PACK_END</property> - </packing> - </child> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">2</property> - <property name="bottom_attach">3</property> - <property name="x_options">fill</property> - <property name="y_options">fill</property> - </packing> - </child> - </widget> - </child> - - <child> - <widget class="GtkLabel" id="label3"> - <property name="visible">True</property> - <property name="label" translatable="yes">Optional Information</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="type">label_item</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">True</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - </widget> - <packing> - <property name="tab_expand">False</property> - <property name="tab_fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label31"> - <property name="visible">True</property> - <property name="label" translatable="yes">_Identity</property> - <property name="use_underline">True</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="type">tab</property> - </packing> - </child> - - <child> - <widget class="GtkVBox" id="vboxSourceBorder"> - <property name="border_width">6</property> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">3</property> - - <child> - <widget class="GtkVBox" id="source_vbox"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">3</property> - - <child> - <widget class="GtkTable" id="table3"> - <property name="visible">True</property> - <property name="n_rows">1</property> - <property name="n_columns">2</property> - <property name="homogeneous">False</property> - <property name="row_spacing">0</property> - <property name="column_spacing">3</property> - - <child> - <widget class="GtkLabel" id="source_type_label"> - <property name="visible">True</property> - <property name="label" translatable="yes">Server _Type: </property> - <property name="use_underline">True</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_RIGHT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">1</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="mnemonic_widget">source_type_omenu</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkOptionMenu" id="source_type_omenu"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="history">0</property> - - <child internal-child="menu"> - <widget class="GtkMenu" id="convertwidget3"> - <property name="visible">True</property> - - <child> - <widget class="GtkMenuItem" id="convertwidget4"> - <property name="visible">True</property> - <property name="label" translatable="yes">POP</property> - <property name="use_underline">True</property> - </widget> - </child> - - <child> - <widget class="GtkMenuItem" id="convertwidget5"> - <property name="visible">True</property> - <property name="label" translatable="yes">IMAPv4 </property> - <property name="use_underline">True</property> - </widget> - </child> - - <child> - <widget class="GtkMenuItem" id="convertwidget6"> - <property name="visible">True</property> - <property name="label" translatable="yes">Standard Unix mbox</property> - <property name="use_underline">True</property> - </widget> - </child> - - <child> - <widget class="GtkMenuItem" id="convertwidget7"> - <property name="visible">True</property> - <property name="label" translatable="yes">Qmail maildir </property> - <property name="use_underline">True</property> - </widget> - </child> - - <child> - <widget class="GtkMenuItem" id="convertwidget8"> - <property name="visible">True</property> - <property name="label" translatable="yes">None</property> - <property name="use_underline">True</property> - </widget> - </child> - </widget> - </child> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="x_options"></property> - <property name="y_options"></property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkHBox" id="hboxSourceDescription"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">3</property> - - <child> - <widget class="GtkLabel" id="label442"> - <property name="visible">True</property> - <property name="label" translatable="yes">Description:</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="source_description"> - <property name="visible">True</property> - <property name="label" translatable="yes">description</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkFrame" id="source_frame"> - <property name="visible">True</property> - <property name="label_xalign">0</property> - <property name="label_yalign">0.5</property> - <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property> - - <child> - <widget class="GtkTable" id="table4"> - <property name="border_width">6</property> - <property name="visible">True</property> - <property name="n_rows">5</property> - <property name="n_columns">2</property> - <property name="homogeneous">False</property> - <property name="row_spacing">6</property> - <property name="column_spacing">6</property> - - <child> - <widget class="GtkLabel" id="source_host_label"> - <property name="visible">True</property> - <property name="label" translatable="yes">_Host:</property> - <property name="use_underline">True</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="mnemonic_widget">source_host</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="source_user_label"> - <property name="visible">True</property> - <property name="label" translatable="yes">User_name:</property> - <property name="use_underline">True</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="mnemonic_widget">source_user</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkEntry" id="source_host"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="editable">True</property> - <property name="visibility">True</property> - <property name="max_length">0</property> - <property name="text" translatable="yes"></property> - <property name="has_frame">True</property> - <property name="invisible_char" translatable="yes">*</property> - <property name="activates_default">False</property> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkEntry" id="source_user"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="editable">True</property> - <property name="visibility">True</property> - <property name="max_length">0</property> - <property name="text" translatable="yes"></property> - <property name="has_frame">True</property> - <property name="invisible_char" translatable="yes">*</property> - <property name="activates_default">False</property> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="source_path_label"> - <property name="visible">True</property> - <property name="label" translatable="yes">_Path:</property> - <property name="use_underline">True</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="mnemonic_widget">source_path</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">2</property> - <property name="bottom_attach">3</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GnomeFileEntry" id="source_path_entry"> - <property name="visible">True</property> - <property name="max_saved">10</property> - <property name="browse_dialog_title" translatable="yes">Mailbox location</property> - <property name="directory_entry">False</property> - <property name="modal">False</property> - - <child internal-child="entry"> - <widget class="GtkEntry" id="source_path"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="editable">True</property> - <property name="visibility">True</property> - <property name="max_length">0</property> - <property name="text" translatable="yes"></property> - <property name="has_frame">True</property> - <property name="invisible_char" translatable="yes">*</property> - <property name="activates_default">False</property> - </widget> - </child> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">2</property> - <property name="bottom_attach">3</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="source_ssl_disabled"> - <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="label" translatable="yes">(SSL is not supported in this build of Evolution)</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">2</property> - <property name="top_attach">4</property> - <property name="bottom_attach">5</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkHBox" id="source_ssl_hbox"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">6</property> - - <child> - <widget class="GtkLabel" id="lblSourceUseSSL"> - <property name="visible">True</property> - <property name="label" translatable="yes">_Use secure connection (SSL):</property> - <property name="use_underline">True</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="mnemonic_widget">source_use_ssl</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkOptionMenu" id="source_use_ssl"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="history">0</property> - - <child internal-child="menu"> - <widget class="GtkMenu" id="convertwidget9"> - <property name="visible">True</property> - - <child> - <widget class="GtkMenuItem" id="convertwidget10"> - <property name="visible">True</property> - <property name="label" translatable="yes">Always</property> - <property name="use_underline">True</property> - </widget> - </child> - - <child> - <widget class="GtkMenuItem" id="convertwidget11"> - <property name="visible">True</property> - <property name="label" translatable="yes">Whenever Possible</property> - <property name="use_underline">True</property> - </widget> - </child> - - <child> - <widget class="GtkMenuItem" id="convertwidget12"> - <property name="visible">True</property> - <property name="label" translatable="yes">Never</property> - <property name="use_underline">True</property> - </widget> - </child> - </widget> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">2</property> - <property name="top_attach">3</property> - <property name="bottom_attach">4</property> - <property name="x_options">fill</property> - </packing> - </child> - </widget> - </child> - - <child> - <widget class="GtkLabel" id="label443"> - <property name="visible">True</property> - <property name="label" translatable="yes">Configuration</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="type">label_item</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkFrame" id="source_auth_frame"> - <property name="visible">True</property> - <property name="label_xalign">0</property> - <property name="label_yalign">0.5</property> - <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property> - - <child> - <widget class="GtkVBox" id="vbox60"> - <property name="border_width">6</property> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">6</property> - - <child> - <widget class="GtkHBox" id="hbox44"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">3</property> - - <child> - <widget class="GtkLabel" id="source_auth_label"> - <property name="visible">True</property> - <property name="label" translatable="yes">_Authentication type: </property> - <property name="use_underline">True</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="mnemonic_widget">source_auth_omenu</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkOptionMenu" id="source_auth_omenu"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="history">0</property> - - <child internal-child="menu"> - <widget class="GtkMenu" id="convertwidget13"> - <property name="visible">True</property> - - <child> - <widget class="GtkMenuItem" id="convertwidget14"> - <property name="visible">True</property> - <property name="label" translatable="yes">Password</property> - <property name="use_underline">True</property> - </widget> - </child> - - <child> - <widget class="GtkMenuItem" id="convertwidget15"> - <property name="visible">True</property> - <property name="label" translatable="yes">Kerberos </property> - <property name="use_underline">True</property> - </widget> - </child> - </widget> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkAlignment" id="alignment1"> - <property name="visible">True</property> - <property name="xalign">1</property> - <property name="yalign">0.5</property> - <property name="xscale">1</property> - <property name="yscale">1</property> - - <child> - <widget class="GtkButton" id="source_check_supported"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes"> _Check for supported types </property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - </widget> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="pack_type">GTK_PACK_END</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkCheckButton" id="source_remember_password"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">Re_member this password</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="active">False</property> - <property name="inconsistent">False</property> - <property name="draw_indicator">True</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="lblNote"> - <property name="visible">True</property> - <property name="label" translatable="yes">Note: you will not be prompted for a password until you connect for the first time</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.03</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - </widget> - </child> - - <child> - <widget class="GtkLabel" id="label444"> - <property name="visible">True</property> - <property name="label" translatable="yes">Authentication</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="type">label_item</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - </widget> - <packing> - <property name="tab_expand">False</property> - <property name="tab_fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label32"> - <property name="visible">True</property> - <property name="label" translatable="yes">_Receiving Mail</property> - <property name="use_underline">True</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="type">tab</property> - </packing> - </child> - - <child> - <widget class="GtkVBox" id="vboxExtraTableBorder"> - <property name="border_width">6</property> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">3</property> - - <child> - <widget class="GtkTable" id="extra_table"> - <property name="visible">True</property> - <property name="n_rows">1</property> - <property name="n_columns">2</property> - <property name="homogeneous">False</property> - <property name="row_spacing">4</property> - <property name="column_spacing">8</property> - - <child> - <widget class="GtkFrame" id="extra_mailcheck_frame"> - <property name="visible">True</property> - <property name="label_xalign">0</property> - <property name="label_yalign">0.5</property> - <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property> - - <child> - <widget class="GtkTable" id="extra_mailcheck_table"> - <property name="border_width">6</property> - <property name="visible">True</property> - <property name="n_rows">1</property> - <property name="n_columns">2</property> - <property name="homogeneous">False</property> - <property name="row_spacing">6</property> - <property name="column_spacing">6</property> - - <child> - <widget class="GtkHBox" id="extra_mailcheck_hbox"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">6</property> - - <child> - <widget class="GtkCheckButton" id="extra_auto_check"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">_Automatically check for new mail every</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="active">False</property> - <property name="inconsistent">False</property> - <property name="draw_indicator">True</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkSpinButton" id="extra_auto_check_min"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="climb_rate">1</property> - <property name="digits">0</property> - <property name="numeric">True</property> - <property name="update_policy">GTK_UPDATE_ALWAYS</property> - <property name="snap_to_ticks">False</property> - <property name="wrap">False</property> - <property name="adjustment">10 1 1440 1 10 10</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label36"> - <property name="visible">True</property> - <property name="label" translatable="yes">minute(s)</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">2</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - </packing> - </child> - </widget> - </child> - - <child> - <widget class="GtkLabel" id="label445"> - <property name="visible">True</property> - <property name="label" translatable="yes">Checking for New Mail</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="type">label_item</property> - </packing> - </child> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">2</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="y_options">fill</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">True</property> - </packing> - </child> - </widget> - <packing> - <property name="tab_expand">False</property> - <property name="tab_fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label33"> - <property name="visible">True</property> - <property name="label" translatable="yes">Receiving _Options</property> - <property name="use_underline">True</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="type">tab</property> - </packing> - </child> - - <child> - <widget class="GtkVBox" id="vboxTransportBorder"> - <property name="border_width">6</property> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">3</property> - - <child> - <widget class="GtkVBox" id="transport_vbox"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">3</property> - - <child> - <widget class="GtkTable" id="table5"> - <property name="visible">True</property> - <property name="n_rows">1</property> - <property name="n_columns">2</property> - <property name="homogeneous">False</property> - <property name="row_spacing">0</property> - <property name="column_spacing">3</property> - - <child> - <widget class="GtkLabel" id="transport_type_label"> - <property name="visible">True</property> - <property name="label" translatable="yes">Server _Type: </property> - <property name="use_underline">True</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_RIGHT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">1</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="mnemonic_widget">transport_type_omenu</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkOptionMenu" id="transport_type_omenu"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="history">0</property> - - <child internal-child="menu"> - <widget class="GtkMenu" id="convertwidget16"> - <property name="visible">True</property> - - <child> - <widget class="GtkMenuItem" id="convertwidget17"> - <property name="visible">True</property> - <property name="label" translatable="yes">SMTP</property> - <property name="use_underline">True</property> - </widget> - </child> - - <child> - <widget class="GtkMenuItem" id="convertwidget18"> - <property name="visible">True</property> - <property name="label" translatable="yes">Sendmail</property> - <property name="use_underline">True</property> - </widget> - </child> - </widget> - </child> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="x_options"></property> - <property name="y_options"></property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkHBox" id="hboxTransportDescription"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">3</property> - - <child> - <widget class="GtkLabel" id="label50"> - <property name="visible">True</property> - <property name="label" translatable="yes">Description:</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_RIGHT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">1</property> - <property name="yalign">0</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="transport_description"> - <property name="visible">True</property> - <property name="label" translatable="yes">description</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">7.45058e-09</property> - <property name="yalign">0</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkFrame" id="transport_frame"> - <property name="visible">True</property> - <property name="label_xalign">0</property> - <property name="label_yalign">0.5</property> - <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property> - - <child> - <widget class="GtkVBox" id="vbox12"> - <property name="border_width">6</property> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">3</property> - - <child> - <widget class="GtkTable" id="table6"> - <property name="visible">True</property> - <property name="n_rows">1</property> - <property name="n_columns">2</property> - <property name="homogeneous">False</property> - <property name="row_spacing">4</property> - <property name="column_spacing">4</property> - - <child> - <widget class="GtkLabel" id="transport_host_label"> - <property name="visible">True</property> - <property name="label" translatable="yes">_Host:</property> - <property name="use_underline">True</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_RIGHT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">1</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="mnemonic_widget">transport_host</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkEntry" id="transport_host"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="editable">True</property> - <property name="visibility">True</property> - <property name="max_length">0</property> - <property name="text" translatable="yes"></property> - <property name="has_frame">True</property> - <property name="invisible_char" translatable="yes">*</property> - <property name="activates_default">False</property> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="y_options"></property> - </packing> - </child> - </widget> - <packing> - <property name="padding">4</property> - <property name="expand">False</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkHBox" id="transport_ssl_hbox"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">6</property> - - <child> - <widget class="GtkLabel" id="lblTransportUseSSL"> - <property name="visible">True</property> - <property name="label" translatable="yes">_Use secure connection (SSL):</property> - <property name="use_underline">True</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="mnemonic_widget">transport_use_ssl</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkOptionMenu" id="transport_use_ssl"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="history">0</property> - - <child internal-child="menu"> - <widget class="GtkMenu" id="convertwidget19"> - <property name="visible">True</property> - - <child> - <widget class="GtkMenuItem" id="convertwidget20"> - <property name="visible">True</property> - <property name="label" translatable="yes">Always</property> - <property name="use_underline">True</property> - </widget> - </child> - - <child> - <widget class="GtkMenuItem" id="convertwidget21"> - <property name="visible">True</property> - <property name="label" translatable="yes">Whenever Possible</property> - <property name="use_underline">True</property> - </widget> - </child> - - <child> - <widget class="GtkMenuItem" id="convertwidget22"> - <property name="visible">True</property> - <property name="label" translatable="yes">Never</property> - <property name="use_underline">True</property> - </widget> - </child> - </widget> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="transport_ssl_disabled"> - <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="label" translatable="yes">(SSL is not supported in this build of evolution)</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkCheckButton" id="transport_needs_auth"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">Ser_ver requires authentication</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="active">False</property> - <property name="inconsistent">False</property> - <property name="draw_indicator">True</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - </widget> - </child> - - <child> - <widget class="GtkLabel" id="label446"> - <property name="visible">True</property> - <property name="label" translatable="yes">Server Configuration</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="type">label_item</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkFrame" id="transport_auth_frame"> - <property name="visible">True</property> - <property name="label_xalign">0</property> - <property name="label_yalign">0.5</property> - <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property> - - <child> - <widget class="GtkVBox" id="vbox61"> - <property name="border_width">6</property> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">3</property> - - <child> - <widget class="GtkHBox" id="hbox49"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">3</property> - - <child> - <widget class="GtkLabel" id="transport_auth_label"> - <property name="visible">True</property> - <property name="label" translatable="yes">_Authentication Type: </property> - <property name="use_underline">True</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="mnemonic_widget">transport_auth_omenu</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkOptionMenu" id="transport_auth_omenu"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="history">0</property> - - <child internal-child="menu"> - <widget class="GtkMenu" id="convertwidget23"> - <property name="visible">True</property> - - <child> - <widget class="GtkMenuItem" id="convertwidget24"> - <property name="visible">True</property> - <property name="label" translatable="yes">Password</property> - <property name="use_underline">True</property> - </widget> - </child> - - <child> - <widget class="GtkMenuItem" id="convertwidget25"> - <property name="visible">True</property> - <property name="label" translatable="yes">Kerberos </property> - <property name="use_underline">True</property> - </widget> - </child> - </widget> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkAlignment" id="alignment2"> - <property name="visible">True</property> - <property name="xalign">1</property> - <property name="yalign">0.5</property> - <property name="xscale">1</property> - <property name="yscale">1</property> - - <child> - <widget class="GtkButton" id="transport_check_supported"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes"> _Check for supported types </property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - </widget> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="pack_type">GTK_PACK_END</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkHBox" id="hbox52"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">3</property> - - <child> - <widget class="GtkLabel" id="transport_user_label"> - <property name="visible">True</property> - <property name="label" translatable="yes">User_name:</property> - <property name="use_underline">True</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_RIGHT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">1</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="mnemonic_widget">transport_user</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkEntry" id="transport_user"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="editable">True</property> - <property name="visibility">True</property> - <property name="max_length">0</property> - <property name="text" translatable="yes"></property> - <property name="has_frame">True</property> - <property name="invisible_char" translatable="yes">*</property> - <property name="activates_default">False</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkCheckButton" id="transport_remember_password"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">Remember this _password</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="active">False</property> - <property name="inconsistent">False</property> - <property name="draw_indicator">True</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - </widget> - </child> - - <child> - <widget class="GtkLabel" id="label447"> - <property name="visible">True</property> - <property name="label" translatable="yes">Authentication</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="type">label_item</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">True</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - </widget> - <packing> - <property name="tab_expand">False</property> - <property name="tab_fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label34"> - <property name="visible">True</property> - <property name="label" translatable="yes">_Sending Mail</property> - <property name="use_underline">True</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="type">tab</property> - </packing> - </child> - - <child> - <widget class="GtkVBox" id="vboxFoldersBorder"> - <property name="border_width">6</property> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">3</property> - - <child> - <widget class="GtkVBox" id="folders_vbox"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">3</property> - - <child> - <widget class="GtkFrame" id="folders_frame"> - <property name="visible">True</property> - <property name="label_xalign">0</property> - <property name="label_yalign">0.5</property> - <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property> - - <child> - <widget class="GtkTable" id="folders_table"> - <property name="border_width">6</property> - <property name="visible">True</property> - <property name="n_rows">3</property> - <property name="n_columns">2</property> - <property name="homogeneous">False</property> - <property name="row_spacing">6</property> - <property name="column_spacing">6</property> - - <child> - <widget class="GtkLabel" id="drafts_label"> - <property name="visible">True</property> - <property name="label" translatable="yes">Drafts _folder:</property> - <property name="use_underline">True</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="mnemonic_widget">drafts_button</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="sent_label"> - <property name="visible">True</property> - <property name="label" translatable="yes">Sent _messages folder:</property> - <property name="use_underline">True</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="mnemonic_widget">sent_button</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="Custom" id="drafts_button"> - <property name="visible">True</property> - <property name="creation_function">mail_account_gui_folder_selector_button_new</property> - <property name="int1">0</property> - <property name="int2">0</property> - <property name="last_modification_time">Wed, 03 Apr 2002 23:03:41 GMT</property> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="y_options">fill</property> - </packing> - </child> - - <child> - <widget class="Custom" id="sent_button"> - <property name="visible">True</property> - <property name="creation_function">mail_account_gui_folder_selector_button_new</property> - <property name="int1">0</property> - <property name="int2">0</property> - <property name="last_modification_time">Wed, 03 Apr 2002 23:03:59 GMT</property> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="y_options">fill</property> - </packing> - </child> - - <child> - <widget class="GtkButton" id="default_folders_button"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">Restore Defaults</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">2</property> - <property name="bottom_attach">3</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - </widget> - </child> - - <child> - <widget class="GtkLabel" id="label448"> - <property name="visible">True</property> - <property name="label" translatable="yes">Sent and Draft Messages</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="type">label_item</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkFrame" id="frame2"> - <property name="visible">True</property> - <property name="label_xalign">0</property> - <property name="label_yalign">0.5</property> - <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property> - - <child> - <widget class="GtkVBox" id="vbox67"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">0</property> - - <child> - <widget class="GtkHBox" id="hbox61"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">0</property> - - <child> - <widget class="GtkTable" id="table8"> - <property name="border_width">6</property> - <property name="visible">True</property> - <property name="n_rows">2</property> - <property name="n_columns">2</property> - <property name="homogeneous">False</property> - <property name="row_spacing">6</property> - <property name="column_spacing">6</property> - - <child> - <widget class="GtkCheckButton" id="always_cc"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">Always _carbon-copy (Cc) to:</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="active">False</property> - <property name="inconsistent">False</property> - <property name="draw_indicator">True</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkCheckButton" id="always_bcc"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">Always _blind carbon-copy (Bcc) to:</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="active">False</property> - <property name="inconsistent">False</property> - <property name="draw_indicator">True</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkEntry" id="cc_addrs"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="editable">True</property> - <property name="visibility">True</property> - <property name="max_length">0</property> - <property name="text" translatable="yes"></property> - <property name="has_frame">True</property> - <property name="invisible_char" translatable="yes">*</property> - <property name="activates_default">False</property> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkEntry" id="bcc_addrs"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="editable">True</property> - <property name="visibility">True</property> - <property name="max_length">0</property> - <property name="text" translatable="yes"></property> - <property name="has_frame">True</property> - <property name="invisible_char" translatable="yes">*</property> - <property name="activates_default">False</property> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="y_options"></property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - </widget> - </child> - - <child> - <widget class="GtkLabel" id="label449"> - <property name="visible">True</property> - <property name="label" translatable="yes">Composing Messages</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="type">label_item</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">True</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - </widget> - <packing> - <property name="tab_expand">False</property> - <property name="tab_fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label35"> - <property name="visible">True</property> - <property name="label" translatable="yes">_Defaults</property> - <property name="use_underline">True</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="type">tab</property> - </packing> - </child> - - <child> - <widget class="GtkVBox" id="vboxSecurityBorder"> - <property name="border_width">6</property> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">3</property> - - <child> - <widget class="GtkVBox" id="security_vbox"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">3</property> - - <child> - <widget class="GtkFrame" id="pgp_frame"> - <property name="visible">True</property> - <property name="label_xalign">0</property> - <property name="label_yalign">0.5</property> - <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property> - - <child> - <widget class="GtkVBox" id="vboxPGP"> - <property name="border_width">6</property> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">3</property> - - <child> - <widget class="GtkHBox" id="hbox63"> - <property name="border_width">3</property> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">6</property> - - <child> - <widget class="GtkLabel" id="pgp_key_id_label"> - <property name="visible">True</property> - <property name="label" translatable="yes">PGP/GPG _Key ID:</property> - <property name="use_underline">True</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="mnemonic_widget">pgp_key</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkEntry" id="pgp_key"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="editable">True</property> - <property name="visibility">True</property> - <property name="max_length">0</property> - <property name="text" translatable="yes"></property> - <property name="has_frame">True</property> - <property name="invisible_char" translatable="yes">*</property> - <property name="activates_default">False</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkCheckButton" id="pgp_always_sign"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">_Always sign outgoing messages when using this account</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="active">False</property> - <property name="inconsistent">False</property> - <property name="draw_indicator">True</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkCheckButton" id="pgp_no_imip_sign"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">Don't sign _meeting requests (for Outlook compatibility)</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="active">False</property> - <property name="inconsistent">False</property> - <property name="draw_indicator">True</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkCheckButton" id="pgp_encrypt_to_self"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">Al_ways encrypt to myself when sending encrypted mail</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="active">True</property> - <property name="inconsistent">False</property> - <property name="draw_indicator">True</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkCheckButton" id="pgp_always_trust"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">Always _trust keys in my keyring when encrypting</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="active">False</property> - <property name="inconsistent">False</property> - <property name="draw_indicator">True</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - </widget> - </child> - - <child> - <widget class="GtkLabel" id="label450"> - <property name="visible">True</property> - <property name="label" translatable="yes">Pretty Good Privacy (PGP/GPG)</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="type">label_item</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkFrame" id="smime_frame"> - <property name="visible">True</property> - <property name="label_xalign">0</property> - <property name="label_yalign">0.5</property> - <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property> - - <child> - <widget class="GtkTable" id="smime_table"> - <property name="border_width">6</property> - <property name="visible">True</property> - <property name="n_rows">6</property> - <property name="n_columns">4</property> - <property name="homogeneous">False</property> - <property name="row_spacing">5</property> - <property name="column_spacing">9</property> - - <child> - <widget class="GtkLabel" id="label469"> - <property name="visible">True</property> - <property name="label" translatable="yes">Si_gning certificate:</property> - <property name="use_underline">True</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="mnemonic_widget">smime_sign_key</property> - <accessibility> - <atkrelation target="smime_sign_key" type="label-for"/> - </accessibility> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkEntry" id="smime_sign_key"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="editable">True</property> - <property name="visibility">True</property> - <property name="max_length">0</property> - <property name="text" translatable="yes"></property> - <property name="has_frame">True</property> - <property name="invisible_char" translatable="yes">*</property> - <property name="activates_default">False</property> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label470"> - <property name="visible">True</property> - <property name="label" translatable="yes">Encry_ption certificate:</property> - <property name="use_underline">True</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="mnemonic_widget">smime_encrypt_key</property> - <accessibility> - <atkrelation target="smime_encrypt_key" type="label-for"/> - </accessibility> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">5</property> - <property name="bottom_attach">6</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkEntry" id="smime_encrypt_key"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="editable">True</property> - <property name="visibility">True</property> - <property name="max_length">0</property> - <property name="text" translatable="yes"></property> - <property name="has_frame">True</property> - <property name="invisible_char" translatable="yes">*</property> - <property name="activates_default">False</property> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">5</property> - <property name="bottom_attach">6</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkButton" id="smime_encrypt_key_select"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - - <child> - <widget class="GtkAlignment" id="alignment28"> - <property name="visible">True</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xscale">0</property> - <property name="yscale">0</property> - - <child> - <widget class="GtkHBox" id="hbox175"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">2</property> - - <child> - <widget class="GtkImage" id="image3"> - <property name="visible">True</property> - <property name="stock">gtk-open</property> - <property name="icon_size">4</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="button98"> - <property name="visible">True</property> - <property name="label" translatable="yes">_Select...</property> - <property name="use_underline">True</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - </widget> - </child> - </widget> - </child> - </widget> - <packing> - <property name="left_attach">2</property> - <property name="right_attach">3</property> - <property name="top_attach">5</property> - <property name="bottom_attach">6</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkButton" id="smime_sign_key_select"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - - <child> - <widget class="GtkAlignment" id="alignment29"> - <property name="visible">True</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xscale">0</property> - <property name="yscale">0</property> - - <child> - <widget class="GtkHBox" id="hbox176"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">2</property> - - <child> - <widget class="GtkImage" id="image4"> - <property name="visible">True</property> - <property name="stock">gtk-open</property> - <property name="icon_size">4</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label472"> - <property name="visible">True</property> - <property name="label" translatable="yes">_Select...</property> - <property name="use_underline">True</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - </widget> - </child> - </widget> - </child> - </widget> - <packing> - <property name="left_attach">2</property> - <property name="right_attach">3</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkButton" id="smime_sign_key_clear"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label">gtk-clear</property> - <property name="use_stock">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - </widget> - <packing> - <property name="left_attach">3</property> - <property name="right_attach">4</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkButton" id="smime_encrypt_key_clear"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label">gtk-clear</property> - <property name="use_stock">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - </widget> - <packing> - <property name="left_attach">3</property> - <property name="right_attach">4</property> - <property name="top_attach">5</property> - <property name="bottom_attach">6</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkCheckButton" id="smime_encrypt_to_self"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">A_lso encrypt to self when sending encrypted mail</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="active">False</property> - <property name="inconsistent">False</property> - <property name="draw_indicator">True</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">4</property> - <property name="top_attach">4</property> - <property name="bottom_attach">5</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkCheckButton" id="smime_encrypt_default"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">_Encrypt outgoing messages (by default)</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="active">False</property> - <property name="inconsistent">False</property> - <property name="draw_indicator">True</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">4</property> - <property name="top_attach">3</property> - <property name="bottom_attach">4</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkHSeparator" id="hseparator3"> - <property name="visible">True</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">4</property> - <property name="top_attach">2</property> - <property name="bottom_attach">3</property> - <property name="y_padding">3</property> - <property name="x_options">fill</property> - <property name="y_options">fill</property> - </packing> - </child> - - <child> - <widget class="GtkCheckButton" id="smime_sign_default"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">Digitally _sign outgoing messages (by default)</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="active">False</property> - <property name="inconsistent">False</property> - <property name="draw_indicator">True</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">4</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - </widget> - </child> - - <child> - <widget class="GtkLabel" id="label451"> - <property name="visible">True</property> - <property name="label" translatable="yes">Secure MIME (S/MIME)</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="type">label_item</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">True</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - </widget> - <packing> - <property name="tab_expand">False</property> - <property name="tab_fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="lblSecurity"> - <property name="visible">True</property> - <property name="label" translatable="yes">S_ecurity</property> - <property name="use_underline">True</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="type">tab</property> - </packing> - </child> - </widget> - </child> -</widget> - -<widget class="GtkWindow" id="accounts_tab"> - <property name="title" translatable="yes">Email Accounts</property> - <property name="type">GTK_WINDOW_TOPLEVEL</property> - <property name="window_position">GTK_WIN_POS_NONE</property> - <property name="modal">False</property> - <property name="resizable">True</property> - <property name="destroy_with_parent">False</property> - - <child> - <widget class="GtkHBox" id="toplevel"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">6</property> - - <child> - <widget class="Custom" id="etableMailAccounts"> - <property name="visible">True</property> - <property name="creation_function">em_account_prefs_treeview_new</property> - <property name="int1">0</property> - <property name="int2">0</property> - <property name="last_modification_time">Wed, 29 Oct 2003 17:47:08 GMT</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkVBox" id="vboxMailFunctions"> - <property name="border_width">3</property> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">0</property> - - <child> - <widget class="GtkLabel" id="lblMailSpacer"> - <property name="visible">True</property> - <property name="label" translatable="yes"> -</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkVButtonBox" id="vbuttonboxMailAccounts"> - <property name="visible">True</property> - <property name="layout_style">GTK_BUTTONBOX_START</property> - <property name="spacing">3</property> - - <child> - <widget class="GtkButton" id="cmdAccountAdd"> - <property name="visible">True</property> - <property name="can_default">True</property> - <property name="can_focus">True</property> - <property name="label">gtk-add</property> - <property name="use_stock">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - </widget> - </child> - - <child> - <widget class="GtkButton" id="cmdAccountEdit"> - <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="can_default">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">_Edit</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - </widget> - </child> - - <child> - <widget class="GtkButton" id="cmdAccountDelete"> - <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="can_default">True</property> - <property name="can_focus">True</property> - <property name="label">gtk-remove</property> - <property name="use_stock">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - </widget> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label421"> - <property name="visible">True</property> - <property name="label" translatable="yes"> -</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkVButtonBox" id="vbuttonboxMailExtras"> - <property name="visible">True</property> - <property name="layout_style">GTK_BUTTONBOX_START</property> - <property name="spacing">3</property> - - <child> - <widget class="GtkButton" id="cmdAccountDefault"> - <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="can_default">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">De_fault</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - </widget> - </child> - - <child> - <widget class="GtkButton" id="cmdAccountAble"> - <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="can_default">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">E_nable</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - </widget> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">True</property> - </packing> - </child> - </widget> - </child> -</widget> - -<widget class="GtkWindow" id="preferences_tab"> - <property name="title" translatable="yes">Mail Preferences</property> - <property name="type">GTK_WINDOW_TOPLEVEL</property> - <property name="window_position">GTK_WIN_POS_NONE</property> - <property name="modal">False</property> - <property name="resizable">True</property> - <property name="destroy_with_parent">False</property> - - <child> - <widget class="GtkNotebook" id="toplevel"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="show_tabs">True</property> - <property name="show_border">True</property> - <property name="tab_pos">GTK_POS_TOP</property> - <property name="scrollable">False</property> - <property name="enable_popup">False</property> - - <child> - <widget class="GtkVBox" id="vboxGeneral"> - <property name="border_width">6</property> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">3</property> - - <child> - <widget class="GtkFrame" id="frame3"> - <property name="visible">True</property> - <property name="label_xalign">0</property> - <property name="label_yalign">0.5</property> - <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property> - - <child> - <widget class="GtkVBox" id="vboxMessageFonts"> - <property name="border_width">6</property> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">3</property> - - <child> - <widget class="GtkCheckButton" id="radFontUseSame"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">_Use the same fonts as other applications</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="active">False</property> - <property name="inconsistent">False</property> - <property name="draw_indicator">True</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkTable" id="tblScreen"> - <property name="visible">True</property> - <property name="n_rows">2</property> - <property name="n_columns">2</property> - <property name="homogeneous">False</property> - <property name="row_spacing">3</property> - <property name="column_spacing">3</property> - - <child> - <widget class="GtkLabel" id="lblScreenVariable"> - <property name="visible">True</property> - <property name="label" translatable="yes">_Standard Font:</property> - <property name="use_underline">True</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_RIGHT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="mnemonic_widget">radFontVariable</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GnomeFontPicker" id="radFontFixed"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="title" translatable="yes">Select HTML fixed width font</property> - <property name="mode">GNOME_FONT_PICKER_MODE_FONT_INFO</property> - <property name="show_size">True</property> - <property name="use_font_in_label">False</property> - <property name="label_font_size">14</property> - <signal name="font_set" handler="changed"/> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GnomeFontPicker" id="radFontVariable"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="title" translatable="yes">Select HTML variable width font</property> - <property name="mode">GNOME_FONT_PICKER_MODE_FONT_INFO</property> - <property name="show_size">True</property> - <property name="use_font_in_label">False</property> - <property name="label_font_size">14</property> - <signal name="font_set" handler="changed"/> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label444"> - <property name="visible">True</property> - <property name="label" translatable="yes">_Terminal Font:</property> - <property name="use_underline">True</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_RIGHT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="mnemonic_widget">radFontFixed</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - </widget> - </child> - - <child> - <widget class="GtkLabel" id="label460"> - <property name="visible">True</property> - <property name="label" translatable="yes">Message Fonts</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="type">label_item</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkFrame" id="frameMessageDisplay"> - <property name="visible">True</property> - <property name="label_xalign">0</property> - <property name="label_yalign">0.5</property> - <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property> - - <child> - <widget class="GtkVBox" id="vboxMessageDisplay"> - <property name="border_width">6</property> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">3</property> - - <child> - <widget class="GtkHBox" id="hboxReadTimeout"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">3</property> - - <child> - <widget class="GtkCheckButton" id="chkMarkTimeout"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">_Mark messages as read after</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="active">False</property> - <property name="inconsistent">False</property> - <property name="draw_indicator">True</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkSpinButton" id="spinMarkTimeout"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="climb_rate">1</property> - <property name="digits">1</property> - <property name="numeric">True</property> - <property name="update_policy">GTK_UPDATE_IF_VALID</property> - <property name="snap_to_ticks">False</property> - <property name="wrap">False</property> - <property name="adjustment">1.5 0 10 1 1 1</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="lblSeconds"> - <property name="visible">True</property> - <property name="label" translatable="yes">seconds</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkHBox" id="hboxDefaultCharset"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">3</property> - - <child> - <widget class="GtkLabel" id="lblDefaultCharset"> - <property name="visible">True</property> - <property name="label" translatable="yes">Default character _encoding:</property> - <property name="use_underline">True</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="mnemonic_widget">omenuCharset</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkOptionMenu" id="omenuCharset"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="history">0</property> - - <child internal-child="menu"> - <widget class="GtkMenu" id="convertwidget26"> - <property name="visible">True</property> - - <child> - <widget class="GtkMenuItem" id="convertwidget27"> - <property name="visible">True</property> - <property name="label" translatable="yes">Baltic (ISO-8859-13)</property> - <property name="use_underline">True</property> - </widget> - </child> - - <child> - <widget class="GtkMenuItem" id="convertwidget28"> - <property name="visible">True</property> - <property name="label" translatable="yes">Baltic (ISO-8859-4)</property> - <property name="use_underline">True</property> - </widget> - </child> - </widget> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkHBox" id="hboxHighlightColor"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">3</property> - - <child> - <widget class="GtkCheckButton" id="chkHighlightCitations"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">Highlight _quotations with</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="active">True</property> - <property name="inconsistent">False</property> - <property name="draw_indicator">True</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GnomeColorPicker" id="colorpickerHighlightCitations"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="dither">True</property> - <property name="use_alpha">False</property> - <property name="title" translatable="yes">Pick a color</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="lblColor"> - <property name="visible">True</property> - <property name="label" translatable="yes">color</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - </widget> - </child> - - <child> - <widget class="GtkLabel" id="label452"> - <property name="visible">True</property> - <property name="label" translatable="yes">Message Display</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="type">label_item</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkFrame" id="frameDeletingMail"> - <property name="visible">True</property> - <property name="label_xalign">0</property> - <property name="label_yalign">0.5</property> - <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property> - - <child> - <widget class="GtkVBox" id="vboxDeletingMail"> - <property name="border_width">6</property> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">3</property> - - <child> - <widget class="GtkCheckButton" id="chkEmptyTrashOnExit"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">Empty _trash folders on exit</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="active">False</property> - <property name="inconsistent">False</property> - <property name="draw_indicator">True</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkCheckButton" id="chkConfirmExpunge"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">_Confirm when expunging a folder</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="active">False</property> - <property name="inconsistent">False</property> - <property name="draw_indicator">True</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - </widget> - </child> - - <child> - <widget class="GtkLabel" id="label453"> - <property name="visible">True</property> - <property name="label" translatable="yes">Deleting Mail</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="type">label_item</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkFrame" id="frameNewMailNotify"> - <property name="visible">True</property> - <property name="label_xalign">0</property> - <property name="label_yalign">0.5</property> - <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property> - - <child> - <widget class="GtkVBox" id="vboxNewMailNotify"> - <property name="border_width">6</property> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">3</property> - - <child> - <widget class="GtkRadioButton" id="radNotifyNot"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">_Do not notify me when new mail arrives</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="active">True</property> - <property name="inconsistent">False</property> - <property name="draw_indicator">True</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkRadioButton" id="radNotifyBeep"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">_Beep when new mail arrives</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="active">False</property> - <property name="inconsistent">False</property> - <property name="draw_indicator">True</property> - <property name="group">radNotifyNot</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkRadioButton" id="radNotifyPlaySound"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">_Play sound file when new mail arrives</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="active">False</property> - <property name="inconsistent">False</property> - <property name="draw_indicator">True</property> - <property name="group">radNotifyNot</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkHBox" id="hbox154"> - <property name="border_width">3</property> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">3</property> - - <child> - <widget class="GtkLabel" id="lblNotifyFilename"> - <property name="visible">True</property> - <property name="label" translatable="yes">Specify _filename:</property> - <property name="use_underline">True</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="mnemonic_widget">txtNotifyPlaySound</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GnomeFileEntry" id="fileNotifyPlaySound"> - <property name="visible">True</property> - <property name="max_saved">10</property> - <property name="browse_dialog_title" translatable="yes">Execute Command...</property> - <property name="directory_entry">False</property> - <property name="modal">False</property> - - <child internal-child="entry"> - <widget class="GtkEntry" id="txtNotifyPlaySound"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="editable">True</property> - <property name="visibility">True</property> - <property name="max_length">0</property> - <property name="text" translatable="yes"></property> - <property name="has_frame">True</property> - <property name="invisible_char" translatable="yes">*</property> - <property name="activates_default">False</property> - </widget> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - </widget> - </child> - - <child> - <widget class="GtkLabel" id="label454"> - <property name="visible">True</property> - <property name="label" translatable="yes">New Mail Notification</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="type">label_item</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - </widget> - <packing> - <property name="tab_expand">False</property> - <property name="tab_fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="lblGeneral"> - <property name="visible">True</property> - <property name="label" translatable="yes">_General</property> - <property name="use_underline">True</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="type">tab</property> - </packing> - </child> - - <child> - <widget class="GtkVBox" id="vboxHtmlMail"> - <property name="border_width">6</property> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">3</property> - - <child> - <widget class="GtkFrame" id="frameLoadingImages"> - <property name="visible">True</property> - <property name="label_xalign">0</property> - <property name="label_yalign">0.5</property> - <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property> - - <child> - <widget class="GtkVBox" id="vboxLoadingImages"> - <property name="border_width">6</property> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">3</property> - - <child> - <widget class="GtkRadioButton" id="radImagesNever"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">_Never load images off the net</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="active">True</property> - <property name="inconsistent">False</property> - <property name="draw_indicator">True</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkRadioButton" id="radImagesSometimes"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">_Load images if sender is in addressbook</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="active">False</property> - <property name="inconsistent">False</property> - <property name="draw_indicator">True</property> - <property name="group">radImagesNever</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkRadioButton" id="radImagesAlways"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">_Always load images off the net</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="active">False</property> - <property name="inconsistent">False</property> - <property name="draw_indicator">True</property> - <property name="group">radImagesNever</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - </widget> - </child> - - <child> - <widget class="GtkLabel" id="label455"> - <property name="visible">True</property> - <property name="label" translatable="yes">Loading Images</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="type">label_item</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkCheckButton" id="chkShowAnimatedImages"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">_Show animated images</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="active">False</property> - <property name="inconsistent">False</property> - <property name="draw_indicator">True</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkCheckButton" id="chkPromptWantHTML"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">_Prompt when sending HTML messages to contacts that don't want them</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="active">False</property> - <property name="inconsistent">False</property> - <property name="draw_indicator">True</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - </widget> - <packing> - <property name="tab_expand">False</property> - <property name="tab_fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="lblHtmlMail"> - <property name="visible">True</property> - <property name="label" translatable="yes">_HTML Mail</property> - <property name="use_underline">True</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="type">tab</property> - </packing> - </child> - - <child> - <widget class="GtkVBox" id="vboxColours"> - <property name="border_width">6</property> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">3</property> - - <child> - <widget class="GtkFrame" id="frameColours"> - <property name="visible">True</property> - <property name="label_xalign">0</property> - <property name="label_yalign">0.5</property> - <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property> - - <child> - <widget class="GtkTable" id="tableColours"> - <property name="border_width">6</property> - <property name="visible">True</property> - <property name="n_rows">6</property> - <property name="n_columns">3</property> - <property name="homogeneous">False</property> - <property name="row_spacing">3</property> - <property name="column_spacing">3</property> - - <child> - <widget class="GnomeColorPicker" id="colorLabel0"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="dither">True</property> - <property name="use_alpha">False</property> - <property name="title" translatable="yes">Pick a color</property> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GnomeColorPicker" id="colorLabel1"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="dither">True</property> - <property name="use_alpha">False</property> - <property name="title" translatable="yes">Pick a color</property> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GnomeColorPicker" id="colorLabel2"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="dither">True</property> - <property name="use_alpha">False</property> - <property name="title" translatable="yes">Pick a color</property> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">2</property> - <property name="bottom_attach">3</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GnomeColorPicker" id="colorLabel3"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="dither">True</property> - <property name="use_alpha">False</property> - <property name="title" translatable="yes">Pick a color</property> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">3</property> - <property name="bottom_attach">4</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GnomeColorPicker" id="colorLabel4"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="dither">True</property> - <property name="use_alpha">False</property> - <property name="title" translatable="yes">Pick a color</property> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">4</property> - <property name="bottom_attach">5</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkEntry" id="txtLabel0"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="editable">True</property> - <property name="visibility">True</property> - <property name="max_length">0</property> - <property name="text" translatable="yes">Important</property> - <property name="has_frame">True</property> - <property name="invisible_char" translatable="yes">*</property> - <property name="activates_default">False</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkEntry" id="txtLabel1"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="editable">True</property> - <property name="visibility">True</property> - <property name="max_length">0</property> - <property name="text" translatable="yes">Work</property> - <property name="has_frame">True</property> - <property name="invisible_char" translatable="yes">*</property> - <property name="activates_default">False</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkEntry" id="txtLabel2"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="editable">True</property> - <property name="visibility">True</property> - <property name="max_length">0</property> - <property name="text" translatable="yes">Personal</property> - <property name="has_frame">True</property> - <property name="invisible_char" translatable="yes">*</property> - <property name="activates_default">False</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">2</property> - <property name="bottom_attach">3</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkEntry" id="txtLabel3"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="editable">True</property> - <property name="visibility">True</property> - <property name="max_length">0</property> - <property name="text" translatable="yes">To Do</property> - <property name="has_frame">True</property> - <property name="invisible_char" translatable="yes">*</property> - <property name="activates_default">False</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">3</property> - <property name="bottom_attach">4</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkEntry" id="txtLabel4"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="editable">True</property> - <property name="visibility">True</property> - <property name="max_length">0</property> - <property name="text" translatable="yes">Later</property> - <property name="has_frame">True</property> - <property name="invisible_char" translatable="yes">*</property> - <property name="activates_default">False</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">4</property> - <property name="bottom_attach">5</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkButton" id="cmdRestoreLabels"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">_Restore defaults</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - </widget> - <packing> - <property name="left_attach">2</property> - <property name="right_attach">3</property> - <property name="top_attach">5</property> - <property name="bottom_attach">6</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - </widget> - </child> - - <child> - <widget class="GtkLabel" id="label456"> - <property name="visible">True</property> - <property name="label" translatable="yes">Labels and Colors</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="type">label_item</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - </widget> - <packing> - <property name="tab_expand">False</property> - <property name="tab_fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="lblColours"> - <property name="visible">True</property> - <property name="label" translatable="yes">C_olors</property> - <property name="use_underline">True</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="type">tab</property> - </packing> - </child> - - <child> - <widget class="GtkVBox" id="vbox161"> - <property name="border_width">6</property> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">6</property> - - <child> - <widget class="GtkVBox" id="vbox162"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">3</property> - - <child> - <widget class="GtkCheckButton" id="chkCheckIncomingMail"> - <property name="visible">True</property> - <property name="tooltip" translatable="yes">Checks incoming mail messages to be Junk</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">Check _Incoming Mail</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="active">False</property> - <property name="inconsistent">False</property> - <property name="draw_indicator">True</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkFrame" id="frameFilterOptions"> - <property name="visible">True</property> - <property name="label_xalign">0</property> - <property name="label_yalign">0.5</property> - <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property> - - <child> - <placeholder/> - </child> - - <child> - <widget class="GtkLabel" id="label474"> - <property name="visible">True</property> - <property name="label" translatable="yes">Filter Options</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="type">label_item</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">True</property> - </packing> - </child> - </widget> - <packing> - <property name="tab_expand">False</property> - <property name="tab_fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label473"> - <property name="visible">True</property> - <property name="label" translatable="yes">_Junk</property> - <property name="use_underline">True</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="type">tab</property> - </packing> - </child> - </widget> - </child> -</widget> - -<widget class="GtkWindow" id="composer_tab"> - <property name="title" translatable="yes">Message Composer</property> - <property name="type">GTK_WINDOW_TOPLEVEL</property> - <property name="window_position">GTK_WIN_POS_NONE</property> - <property name="modal">False</property> - <property name="resizable">True</property> - <property name="destroy_with_parent">False</property> - - <child> - <widget class="GtkNotebook" id="toplevel"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="show_tabs">True</property> - <property name="show_border">True</property> - <property name="tab_pos">GTK_POS_TOP</property> - <property name="scrollable">False</property> - <property name="enable_popup">False</property> - - <child> - <widget class="GtkVBox" id="vboxGeneral"> - <property name="border_width">6</property> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">3</property> - - <child> - <widget class="GtkFrame" id="frameBehavior"> - <property name="visible">True</property> - <property name="label_xalign">0</property> - <property name="label_yalign">0.5</property> - <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property> - - <child> - <widget class="GtkVBox" id="vboxBehavior"> - <property name="border_width">6</property> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">3</property> - - <child> - <widget class="GtkTable" id="tableForwardsReplies"> - <property name="visible">True</property> - <property name="n_rows">3</property> - <property name="n_columns">2</property> - <property name="homogeneous">False</property> - <property name="row_spacing">3</property> - <property name="column_spacing">3</property> - - <child> - <widget class="GtkLabel" id="lblForwardStyle"> - <property name="visible">True</property> - <property name="label" translatable="yes">_Forward style:</property> - <property name="use_underline">True</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="lblReplyStyle"> - <property name="visible">True</property> - <property name="label" translatable="yes">_Reply style:</property> - <property name="use_underline">True</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkAlignment" id="alignment25"> - <property name="visible">True</property> - <property name="xalign">7.45058e-09</property> - <property name="yalign">0.5</property> - <property name="xscale">0</property> - <property name="yscale">1</property> - - <child> - <widget class="GtkHBox" id="hboxReplyStyle"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">0</property> - - <child> - <widget class="GtkOptionMenu" id="omenuReplyStyle"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="history">0</property> - - <child internal-child="menu"> - <widget class="GtkMenu" id="convertwidget33"> - <property name="visible">True</property> - - <child> - <widget class="GtkMenuItem" id="convertwidget34"> - <property name="visible">True</property> - <property name="label" translatable="yes">Quote original message</property> - <property name="use_underline">True</property> - </widget> - </child> - - <child> - <widget class="GtkMenuItem" id="convertwidget35"> - <property name="visible">True</property> - <property name="label" translatable="yes">Do not quote original message</property> - <property name="use_underline">True</property> - </widget> - </child> - - <child> - <widget class="GtkMenuItem" id="convertwidget36"> - <property name="visible">True</property> - <property name="label" translatable="yes">Attach original message</property> - <property name="use_underline">True</property> - </widget> - </child> - </widget> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - </widget> - </child> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkHBox" id="hboxForwardStyle"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">0</property> - - <child> - <widget class="GtkOptionMenu" id="omenuForwardStyle"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="history">0</property> - - <child internal-child="menu"> - <widget class="GtkMenu" id="convertwidget37"> - <property name="visible">True</property> - - <child> - <widget class="GtkMenuItem" id="convertwidget38"> - <property name="visible">True</property> - <property name="label" translatable="yes">Attachment</property> - <property name="use_underline">True</property> - </widget> - </child> - - <child> - <widget class="GtkMenuItem" id="convertwidget39"> - <property name="visible">True</property> - <property name="label" translatable="yes">Inline</property> - <property name="use_underline">True</property> - </widget> - </child> - - <child> - <widget class="GtkMenuItem" id="convertwidget40"> - <property name="visible">True</property> - <property name="label" translatable="yes">Quoted</property> - <property name="use_underline">True</property> - </widget> - </child> - </widget> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="x_options">fill</property> - <property name="y_options">fill</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="lblCharset"> - <property name="visible">True</property> - <property name="label" translatable="yes">C_haracter set:</property> - <property name="use_underline">True</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="mnemonic_widget">omenuCharset</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">2</property> - <property name="bottom_attach">3</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkOptionMenu" id="omenuCharset"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="history">0</property> - - <child internal-child="menu"> - <widget class="GtkMenu" id="convertwidget41"> - <property name="visible">True</property> - - <child> - <widget class="GtkMenuItem" id="convertwidget42"> - <property name="visible">True</property> - <property name="label" translatable="yes">Baltic (ISO-8859-13)</property> - <property name="use_underline">True</property> - </widget> - </child> - - <child> - <widget class="GtkMenuItem" id="convertwidget43"> - <property name="visible">True</property> - <property name="label" translatable="yes">Baltic (ISO-8859-4)</property> - <property name="use_underline">True</property> - </widget> - </child> - </widget> - </child> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">2</property> - <property name="bottom_attach">3</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkCheckButton" id="chkSendHTML"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">Format messages in _HTML</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="active">False</property> - <property name="inconsistent">False</property> - <property name="draw_indicator">True</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkCheckButton" id="chkAutoSmileys"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">_Automatically insert smiley images</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="active">False</property> - <property name="inconsistent">False</property> - <property name="draw_indicator">True</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - </widget> - </child> - - <child> - <widget class="GtkLabel" id="label457"> - <property name="visible">True</property> - <property name="label" translatable="yes">Default Behavior</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="type">label_item</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkFrame" id="frameAlerts"> - <property name="visible">True</property> - <property name="label_xalign">0</property> - <property name="label_yalign">0.5</property> - <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property> - - <child> - <widget class="GtkVBox" id="vboxAlerts"> - <property name="border_width">6</property> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">3</property> - - <child> - <widget class="GtkCheckButton" id="chkPromptEmptySubject"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">_Prompt when sending messages with an empty subject line</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="active">False</property> - <property name="inconsistent">False</property> - <property name="draw_indicator">True</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkCheckButton" id="chkPromptBccOnly"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">Pr_ompt when sending messages with only Bcc recipients defined</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="active">False</property> - <property name="inconsistent">False</property> - <property name="draw_indicator">True</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - </widget> - </child> - - <child> - <widget class="GtkLabel" id="label458"> - <property name="visible">True</property> - <property name="label" translatable="yes">Alerts</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="type">label_item</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">True</property> - </packing> - </child> - </widget> - <packing> - <property name="tab_expand">False</property> - <property name="tab_fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="lblGeneral"> - <property name="visible">True</property> - <property name="label" translatable="yes">_General</property> - <property name="use_underline">True</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="type">tab</property> - </packing> - </child> - - <child> - <widget class="GtkVBox" id="vboxSignatures"> - <property name="border_width">3</property> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">3</property> - - <child> - <widget class="GtkHBox" id="hboxSignatures"> - <property name="border_width">6</property> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">6</property> - - <child> - <widget class="GtkScrolledWindow" id="scrolledwindow46"> - <property name="visible">True</property> - <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property> - <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property> - <property name="shadow_type">GTK_SHADOW_IN</property> - <property name="window_placement">GTK_CORNER_TOP_LEFT</property> - - <child> - <widget class="GtkTreeView" id="clistSignatures"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="headers_visible">True</property> - <property name="rules_hint">False</property> - <property name="reorderable">False</property> - <property name="enable_search">True</property> - </widget> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkVBox" id="vboxSignatureButtons"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">3</property> - - <child> - <widget class="GtkLabel" id="label455"> - <property name="visible">True</property> - <property name="label" translatable="yes"></property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkVButtonBox" id="vbuttonbox25"> - <property name="visible">True</property> - <property name="layout_style">GTK_BUTTONBOX_START</property> - <property name="spacing">3</property> - - <child> - <widget class="GtkButton" id="cmdSignatureAdd"> - <property name="visible">True</property> - <property name="can_default">True</property> - <property name="can_focus">True</property> - <property name="label">gtk-add</property> - <property name="use_stock">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - </widget> - </child> - - <child> - <widget class="GtkButton" id="cmdSignatureAddScript"> - <property name="visible">True</property> - <property name="can_default">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">Add Sc_ript</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <signal name="clicked" handler="cmdSignatureAddScriptClicked"/> - </widget> - </child> - - <child> - <widget class="GtkButton" id="cmdSignatureEdit"> - <property name="visible">True</property> - <property name="can_default">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">_Edit</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - </widget> - </child> - - <child> - <widget class="GtkButton" id="cmdSignatureDelete"> - <property name="visible">True</property> - <property name="can_default">True</property> - <property name="can_focus">True</property> - <property name="label">gtk-remove</property> - <property name="use_stock">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - </widget> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkHBox" id="hbox162"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">3</property> - - <child> - <widget class="GtkFrame" id="frameSignaturePreview"> - <property name="visible">True</property> - <property name="label_xalign">0</property> - <property name="label_yalign">0.5</property> - <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property> - - <child> - <widget class="GtkScrolledWindow" id="scrolled-sig"> - <property name="visible">True</property> - <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property> - <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property> - <property name="shadow_type">GTK_SHADOW_NONE</property> - <property name="window_placement">GTK_CORNER_TOP_LEFT</property> - - <child> - <placeholder/> - </child> - </widget> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - </widget> - <packing> - <property name="tab_expand">False</property> - <property name="tab_fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="lblSignatures"> - <property name="visible">True</property> - <property name="label" translatable="yes">_Signatures</property> - <property name="use_underline">True</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="type">tab</property> - </packing> - </child> - - <child> - <widget class="GtkVBox" id="vboxSpellChecking"> - <property name="border_width">6</property> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">6</property> - - <child> - <widget class="GtkHBox" id="hboxImageAndHelp"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">12</property> - - <child> - <widget class="GtkImage" id="pixmapSpellInfo"> - <property name="visible">True</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="lblSpellChecking"> - <property name="visible">True</property> - <property name="label" translatable="yes">This page allows you to configure spell checking behavior and language. The list of languages here reflects only the languages for which you have a dictionary installed.</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">True</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkHSeparator" id="hseparator1"> - <property name="visible">True</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkHBox" id="hboxLanguages"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">6</property> - - <child> - <widget class="GtkScrolledWindow" id="scrolledwindow48"> - <property name="visible">True</property> - <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property> - <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property> - <property name="shadow_type">GTK_SHADOW_IN</property> - <property name="window_placement">GTK_CORNER_TOP_LEFT</property> - - <child> - <widget class="GtkTreeView" id="clistSpellCheckLanguage"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="headers_visible">True</property> - <property name="rules_hint">False</property> - <property name="reorderable">False</property> - <property name="enable_search">True</property> - <signal name="select_row" handler="spellLanguageSelectRow"/> - <signal name="unselect_row" handler="spellLanguageUnselectRow"/> - </widget> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkVBox" id="vbox159"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">5</property> - - <child> - <widget class="GtkLabel" id="label454"> - <property name="visible">True</property> - <property name="label" translatable="yes"></property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkVButtonBox" id="vbuttonbox26"> - <property name="visible">True</property> - <property name="layout_style">GTK_BUTTONBOX_START</property> - <property name="spacing">0</property> - - <child> - <widget class="GtkButton" id="buttonSpellCheckEnable"> - <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="can_default">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">_Enable</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <signal name="clicked" handler="spellLanguageEnable"/> - </widget> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">True</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkFrame" id="frameSpellChecking"> - <property name="visible">True</property> - <property name="label_xalign">0</property> - <property name="label_yalign">0.5</property> - <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property> - - <child> - <widget class="GtkVBox" id="vboxOptions"> - <property name="border_width">6</property> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">3</property> - - <child> - <widget class="GtkCheckButton" id="chkEnableSpellChecking"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">Check spelling while I _type</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="active">False</property> - <property name="inconsistent">False</property> - <property name="draw_indicator">True</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkHBox" id="hboxSpellCheckColor"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">6</property> - - <child> - <widget class="GtkLabel" id="lblSpellCheckColor"> - <property name="visible">True</property> - <property name="label" translatable="yes">Color for _misspelled words:</property> - <property name="use_underline">True</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="mnemonic_widget">colorpickerSpellCheckColor</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GnomeColorPicker" id="colorpickerSpellCheckColor"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="dither">True</property> - <property name="use_alpha">False</property> - <property name="title" translatable="yes">Pick a color</property> - <signal name="color_set" handler="spellColorSet"/> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">True</property> - </packing> - </child> - </widget> - </child> - - <child> - <widget class="GtkLabel" id="label459"> - <property name="visible">True</property> - <property name="label" translatable="yes">Options</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="type">label_item</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - </widget> - <packing> - <property name="tab_expand">False</property> - <property name="tab_fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label450"> - <property name="visible">True</property> - <property name="label" translatable="yes">Spell _Checking</property> - <property name="use_underline">True</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="type">tab</property> - </packing> - </child> - </widget> - </child> -</widget> - -<widget class="GtkWindow" id="font_tab"> - <property name="title" translatable="yes">Font Properties</property> - <property name="type">GTK_WINDOW_TOPLEVEL</property> - <property name="window_position">GTK_WIN_POS_NONE</property> - <property name="modal">False</property> - <property name="resizable">True</property> - <property name="destroy_with_parent">False</property> - - <child> - <widget class="GtkVBox" id="toplevel"> - <property name="border_width">4</property> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">4</property> - - <child> - <placeholder/> - </child> - - <child> - <widget class="GtkFrame" id="frame4"> - <property name="visible">True</property> - <property name="label_xalign">0</property> - <property name="label_yalign">0.5</property> - <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property> - - <child> - <widget class="GtkTable" id="tblPrint"> - <property name="border_width">4</property> - <property name="visible">True</property> - <property name="n_rows">2</property> - <property name="n_columns">2</property> - <property name="homogeneous">False</property> - <property name="row_spacing">4</property> - <property name="column_spacing">6</property> - - <child> - <widget class="GtkLabel" id="lblPrintVariable"> - <property name="visible">True</property> - <property name="label" translatable="yes">V_ariable-width:</property> - <property name="use_underline">True</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="mnemonic_widget">print_variable</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="lblPrintFixed"> - <property name="visible">True</property> - <property name="label" translatable="yes">Fi_xed -width:</property> - <property name="use_underline">True</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="mnemonic_widget">print_fixed</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GnomeFontPicker" id="print_fixed"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="title" translatable="yes">Select HTML fixed width font for printing</property> - <property name="mode">GNOME_FONT_PICKER_MODE_FONT_INFO</property> - <property name="show_size">True</property> - <property name="use_font_in_label">False</property> - <property name="label_font_size">14</property> - <signal name="font_set" handler="changed"/> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GnomeFontPicker" id="print_variable"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="title" translatable="yes">Select HTML variable width font for printing</property> - <property name="mode">GNOME_FONT_PICKER_MODE_FONT_INFO</property> - <property name="show_size">True</property> - <property name="use_font_in_label">False</property> - <property name="label_font_size">14</property> - <signal name="font_set" handler="changed"/> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - </widget> - </child> - - <child> - <widget class="GtkLabel" id="label461"> - <property name="visible">True</property> - <property name="label" translatable="yes">Printed Fonts</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="type">label_item</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - </widget> - </child> -</widget> - -<widget class="GtkDialog" id="add_script_signature"> - <property name="title" translatable="yes"></property> - <property name="type">GTK_WINDOW_TOPLEVEL</property> - <property name="window_position">GTK_WIN_POS_NONE</property> - <property name="modal">False</property> - <property name="resizable">True</property> - <property name="destroy_with_parent">False</property> - <property name="has_separator">True</property> - - <child internal-child="vbox"> - <widget class="GtkVBox" id="dialog-vbox1"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">6</property> - - <child internal-child="action_area"> - <widget class="GtkHButtonBox" id="dialog-action_area1"> - <property name="visible">True</property> - <property name="layout_style">GTK_BUTTONBOX_END</property> - - <child> - <widget class="GtkButton" id="button_add_script_add"> - <property name="visible">True</property> - <property name="can_default">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">_Add Signature</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="response_id">0</property> - </widget> - </child> - - <child> - <widget class="GtkButton" id="button_add_script_cancel"> - <property name="visible">True</property> - <property name="can_default">True</property> - <property name="can_focus">True</property> - <property name="label">gtk-cancel</property> - <property name="use_stock">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="response_id">0</property> - </widget> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="pack_type">GTK_PACK_END</property> - </packing> - </child> - - <child> - <widget class="GtkVBox" id="vbox160"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">0</property> - - <child> - <widget class="GtkVBox" id="vbox_add_script_signature"> - <property name="border_width">6</property> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">6</property> - - <child> - <widget class="GtkHBox" id="hboxImageAndHelp"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">12</property> - - <child> - <widget class="GtkImage" id="pixmap1"> - <property name="visible">True</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label456"> - <property name="visible">True</property> - <property name="label" translatable="yes">The output of this script will be used as your -signature. The name you specify will be used -for display purposes only. </property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">True</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkTable" id="tblNameScript"> - <property name="visible">True</property> - <property name="n_rows">2</property> - <property name="n_columns">2</property> - <property name="homogeneous">False</property> - <property name="row_spacing">6</property> - <property name="column_spacing">6</property> - - <child> - <widget class="GtkLabel" id="label459"> - <property name="visible">True</property> - <property name="label" translatable="yes">_Name:</property> - <property name="use_underline">True</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="mnemonic_widget">entry_add_script_name</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label460"> - <property name="visible">True</property> - <property name="label" translatable="yes">_Script:</property> - <property name="use_underline">True</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="mnemonic_widget">combo-entry2</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkEntry" id="entry_add_script_name"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="editable">True</property> - <property name="visibility">True</property> - <property name="max_length">0</property> - <property name="text" translatable="yes"></property> - <property name="has_frame">True</property> - <property name="invisible_char" translatable="yes">*</property> - <property name="activates_default">False</property> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GnomeFileEntry" id="fileentry_add_script_script"> - <property name="visible">True</property> - <property name="history_id">evolution_script_signature</property> - <property name="max_saved">10</property> - <property name="directory_entry">False</property> - <property name="modal">False</property> - - <child internal-child="entry"> - <widget class="GtkEntry" id="combo-entry2"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="editable">True</property> - <property name="visibility">True</property> - <property name="max_length">0</property> - <property name="text" translatable="yes"></property> - <property name="has_frame">True</property> - <property name="invisible_char" translatable="yes">*</property> - <property name="activates_default">False</property> - </widget> - </child> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="y_options"></property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - </widget> - </child> -</widget> - -<widget class="GtkWindow" id="sa_options"> - <property name="title" translatable="yes">window1</property> - <property name="type">GTK_WINDOW_TOPLEVEL</property> - <property name="window_position">GTK_WIN_POS_NONE</property> - <property name="modal">False</property> - <property name="resizable">True</property> - <property name="destroy_with_parent">False</property> - - <child> - <widget class="GtkVBox" id="vbox163"> - <property name="border_width">6</property> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">3</property> - - <child> - <widget class="GtkCheckButton" id="chkLocalTestsOnly"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">_Local Tests Only</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="active">False</property> - <property name="inconsistent">False</property> - <property name="draw_indicator">True</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkCheckButton" id="chkUseDaemon"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">Use _Daemon</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="active">False</property> - <property name="inconsistent">False</property> - <property name="draw_indicator">True</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - </widget> - </child> -</widget> - -</glade-interface> diff --git a/mail/mail-config.h b/mail/mail-config.h deleted file mode 100644 index 36891eccb4..0000000000 --- a/mail/mail-config.h +++ /dev/null @@ -1,186 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Authors: Jeffrey Stedfast <fejj@ximian.com> - * - * Copyright 2001 Ximian, Inc. (www.ximian.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public - * License as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - * - */ - -#ifndef MAIL_CONFIG_H -#define MAIL_CONFIG_H - -#include <gtk/gtk.h> - -#include <gconf/gconf.h> -#include <gconf/gconf-client.h> - -#include <camel/camel.h> - -#include "e-util/e-account.h" -#include "e-util/e-account-list.h" - -#ifdef __cplusplus -extern "C" { -#pragma } -#endif /* __cplusplus */ - -typedef struct { - int id; - char *name; - char *filename; - char *script; - gboolean html; -} MailConfigSignature; - - -typedef enum { - MAIL_CONFIG_HTTP_NEVER, - MAIL_CONFIG_HTTP_SOMETIMES, - MAIL_CONFIG_HTTP_ALWAYS -} MailConfigHTTPMode; - -typedef enum { - MAIL_CONFIG_FORWARD_ATTACHED, - MAIL_CONFIG_FORWARD_INLINE, - MAIL_CONFIG_FORWARD_QUOTED -} MailConfigForwardStyle; - -typedef enum { - MAIL_CONFIG_REPLY_QUOTED, - MAIL_CONFIG_REPLY_DO_NOT_QUOTE, - MAIL_CONFIG_REPLY_ATTACH -} MailConfigReplyStyle; - -typedef enum { - MAIL_CONFIG_DISPLAY_NORMAL, - MAIL_CONFIG_DISPLAY_FULL_HEADERS, - MAIL_CONFIG_DISPLAY_SOURCE, - MAIL_CONFIG_DISPLAY_MAX -} MailConfigDisplayStyle; - -typedef enum { - MAIL_CONFIG_NOTIFY_NOT, - MAIL_CONFIG_NOTIFY_BEEP, - MAIL_CONFIG_NOTIFY_PLAY_SOUND, -} MailConfigNewMailNotify; - -typedef enum { - MAIL_CONFIG_XMAILER_NONE = 0, - MAIL_CONFIG_XMAILER_EVO = 1, - MAIL_CONFIG_XMAILER_OTHER = 2, - MAIL_CONFIG_XMAILER_RUPERT_APPROVED = 4 -} MailConfigXMailerDisplayStyle; - -typedef struct { - char *tag; - char *name; - char *colour; -} MailConfigLabel; - -#define LABEL_DEFAULTS_NUM 5 -extern MailConfigLabel label_defaults[5]; - -/* signatures */ -MailConfigSignature *signature_copy (const MailConfigSignature *sig); -void signature_destroy (MailConfigSignature *sig); - -/* Configuration */ -void mail_config_init (void); -void mail_config_clear (void); -void mail_config_write (void); -void mail_config_write_on_exit (void); - -GConfClient *mail_config_get_gconf_client (void); - -/* General Accessor functions */ -gboolean mail_config_is_configured (void); -gboolean mail_config_is_corrupt (void); - -GSList *mail_config_get_labels (void); -const char *mail_config_get_label_color_by_name (const char *name); -const char *mail_config_get_label_color_by_index (int index); - -const char **mail_config_get_allowable_mime_types (void); - -void mail_config_service_set_save_passwd (EAccountService *service, gboolean save_passwd); - -gboolean mail_config_find_account (EAccount *account); -EAccount *mail_config_get_default_account (void); -EAccount *mail_config_get_account_by_name (const char *account_name); -EAccount *mail_config_get_account_by_uid (const char *uid); -EAccount *mail_config_get_account_by_source_url (const char *url); -EAccount *mail_config_get_account_by_transport_url (const char *url); -EAccountList *mail_config_get_accounts (void); -void mail_config_add_account (EAccount *account); -void mail_config_remove_account (EAccount *account); - -void mail_config_set_default_account (EAccount *account); - -EAccountIdentity *mail_config_get_default_identity (void); -EAccountService *mail_config_get_default_transport (void); - -void mail_config_save_accounts (void); - -GSList *mail_config_get_signature_list (void); -MailConfigSignature *mail_config_signature_new (gboolean html, const char *script); -void mail_config_signature_add (MailConfigSignature *sig); -void mail_config_signature_delete (MailConfigSignature *sig); -void mail_config_signature_set_name (MailConfigSignature *sig, const char *name); -void mail_config_signature_set_html (MailConfigSignature *sig, gboolean html); -void mail_config_signature_set_filename (MailConfigSignature *sig, const char *filename); - - -/* uri's got changed by the store, etc */ -void mail_config_uri_renamed (GCompareFunc uri_cmp, const char *old, const char *new); -void mail_config_uri_deleted (GCompareFunc uri_cmp, const char *uri); - - -/* static utility functions */ -char *mail_config_folder_to_cachename (CamelFolder *folder, const char *prefix); -char *mail_config_folder_to_safe_url (CamelFolder *folder); - -gboolean mail_config_check_service (const char *url, CamelProviderType type, GList **authtypes, GtkWindow *window); - - - -GtkType evolution_mail_config_get_type (void); - -gboolean evolution_mail_config_factory_init (void); - - -typedef enum { - MAIL_CONFIG_SIG_EVENT_NAME_CHANGED, - MAIL_CONFIG_SIG_EVENT_CONTENT_CHANGED, - MAIL_CONFIG_SIG_EVENT_HTML_CHANGED, - MAIL_CONFIG_SIG_EVENT_ADDED, - MAIL_CONFIG_SIG_EVENT_DELETED -} MailConfigSigEvent; - -typedef void (*MailConfigSignatureClient)(MailConfigSigEvent, MailConfigSignature *sig, gpointer data); - -void mail_config_signature_register_client (MailConfigSignatureClient client, gpointer data); -void mail_config_signature_unregister_client (MailConfigSignatureClient client, gpointer data); -void mail_config_signature_emit_event (MailConfigSigEvent event, MailConfigSignature *sig); - -void mail_config_write_account_sig (EAccount *account, int i); -char *mail_config_signature_run_script (char *script); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* MAIL_CONFIG_H */ diff --git a/mail/mail-crypto.c b/mail/mail-crypto.c deleted file mode 100644 index c77bc14425..0000000000 --- a/mail/mail-crypto.c +++ /dev/null @@ -1,52 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Authors: Jeffrey Stedfast <fejj@ximian.com> - * - * Copyright 2001 Ximian, Inc. (www.ximian.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public - * License as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - * - */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <stdlib.h> -#include <string.h> - -#include "mail-crypto.h" -#include "mail-session.h" -#include "mail-config.h" - - -/** - * mail_crypto_get_pgp_cipher_context: - * @account: Account that will be using this context - * - * Constructs a new GnuPG cipher context with the appropriate - * options set based on the account provided. - **/ -CamelCipherContext * -mail_crypto_get_pgp_cipher_context (EAccount *account) -{ - CamelCipherContext *cipher; - - cipher = camel_gpg_context_new (session); - if (account) - camel_gpg_context_set_always_trust ((CamelGpgContext *) cipher, account->pgp_always_trust); - - return cipher; -} diff --git a/mail/mail-crypto.h b/mail/mail-crypto.h deleted file mode 100644 index a380f65863..0000000000 --- a/mail/mail-crypto.h +++ /dev/null @@ -1,42 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Authors: Jeffrey Stedfast <fejj@ximian.com> - * - * Copyright 2000 Ximian, Inc. (www.ximian.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public - * License as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - * - */ - -#ifndef MAIL_CRYPTO_H -#define MAIL_CRYPTO_H - -#include <camel/camel.h> -#include "mail-config.h" - -#ifdef __cplusplus -extern "C" { -#pragma } -#endif /* __cplusplus */ - - -/* PGP/MIME convenience wrappers */ -CamelCipherContext *mail_crypto_get_pgp_cipher_context (EAccount *account); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* ! MAIL_CRYPTO_H */ diff --git a/mail/mail-folder-cache.c b/mail/mail-folder-cache.c deleted file mode 100644 index 23f6221544..0000000000 --- a/mail/mail-folder-cache.c +++ /dev/null @@ -1,956 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- - * - * Authors: Peter Williams <peterw@ximian.com> - * Michael Zucchi <notzed@ximian.com> - * - * Copyright 2000,2001 Ximian, Inc. (www.ximian.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public - * License as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#ifdef G_LOG_DOMAIN -#undef G_LOG_DOMAIN -#endif -#define G_LOG_DOMAIN "folder tree" - -#include <pthread.h> -#include <string.h> -#include <time.h> - -#include <libgnome/gnome-sound.h> -#include <bonobo/bonobo-exception.h> -#include <camel/camel-store.h> -#include <camel/camel-folder.h> -#include <camel/camel-vtrash-folder.h> -#include <camel/camel-vee-store.h> -#include <camel/camel-disco-store.h> - -#include "mail-mt.h" -#include "mail-folder-cache.h" -#include "mail-ops.h" -#include "mail-session.h" - -/* For notifications of changes */ -#include "mail-vfolder.h" -#include "mail-autofilter.h" -#include "mail-config.h" - -#define w(x) -#define d(x) /*(printf("%s(%d):%s: ", __FILE__, __LINE__, __PRETTY_FUNCTION__), (x))*/ - -/* note that many things are effectively serialised by having them run in - the main loop thread which they need to do because of corba/gtk calls */ -#define LOCK(x) pthread_mutex_lock(&x) -#define UNLOCK(x) pthread_mutex_unlock(&x) - -static pthread_mutex_t info_lock = PTHREAD_MUTEX_INITIALIZER; - -struct _folder_info { - struct _store_info *store_info; /* 'parent' link */ - - char *path; /* shell path */ - char *full_name; /* full name of folder/folderinfo */ - char *uri; /* uri of folder */ - - CamelFolder *folder; /* if known */ -}; - -/* pending list of updates */ -struct _folder_update { - struct _folder_update *next; - struct _folder_update *prev; - - unsigned int remove:1; /* removing from vfolders */ - unsigned int delete:1; /* deleting as well? */ - unsigned int add:1; /* add to vfolder */ - unsigned int unsub:1; /* unsubcribing? */ - unsigned int new:1; /* new mail arrived? */ - - char *path; - char *name; - char *uri; - char *oldpath; - char *olduri; - - int unread; - CamelStore *store; -}; - -struct _store_info { - GHashTable *folders; /* by full_name */ - GHashTable *folders_uri; /* by uri */ - - CamelStore *store; /* the store for these folders */ - - /* Outstanding folderinfo requests */ - EDList folderinfo_updates; -}; - -static void folder_changed(CamelObject *o, gpointer event_data, gpointer user_data); -static void folder_renamed(CamelObject *o, gpointer event_data, gpointer user_data); -static void folder_finalised(CamelObject *o, gpointer event_data, gpointer user_data); -static void message_changed (CamelObject *o, gpointer event_data, gpointer user_data); - -static guint ping_id = 0; -static gboolean ping_cb (gpointer user_data); - -static guint notify_id = 0; -static int notify_type = -1; - -static time_t last_notify = 0; -static guint notify_idle_id = 0; -static gboolean notify_idle_cb (gpointer user_data); - - -/* Store to storeinfo table, active stores */ -static GHashTable *stores = NULL; - -/* List of folder changes to be executed in gui thread */ -static EDList updates = E_DLIST_INITIALISER(updates); -static int update_id = -1; - -/* hack for people who LIKE to have unsent count */ -static int count_sent = FALSE; -static int count_trash = FALSE; - -static void -free_update(struct _folder_update *up) -{ - g_free(up->path); - g_free(up->name); - g_free(up->uri); - if (up->store) - camel_object_unref(up->store); - g_free(up->oldpath); - g_free(up->olduri); - g_free(up); -} - -static gboolean -notify_idle_cb (gpointer user_data) -{ - GConfClient *gconf; - char *filename; - - gconf = mail_config_get_gconf_client (); - - switch (notify_type) { - case MAIL_CONFIG_NOTIFY_PLAY_SOUND: - filename = gconf_client_get_string (gconf, "/apps/evolution/mail/notify/sound", NULL); - if (filename != NULL) { - gnome_sound_play (filename); - g_free (filename); - } - break; - case MAIL_CONFIG_NOTIFY_BEEP: - gdk_beep (); - break; - default: - break; - } - - time (&last_notify); - - notify_idle_id = 0; - - return FALSE; -} - -static void -notify_type_changed (GConfClient *client, guint cnxn_id, - GConfEntry *entry, gpointer user_data) -{ - notify_type = gconf_client_get_int (client, "/apps/evolution/mail/notify/type", NULL); -} - -static void -real_flush_updates(void *o, void *event_data, void *data) -{ - struct _folder_update *up; - struct _store_info *si; - time_t now; - - LOCK(info_lock); - while ((up = (struct _folder_update *)e_dlist_remhead(&updates))) { - si = g_hash_table_lookup(stores, up->store); - - UNLOCK(info_lock); - - if (up->remove) { - if (up->delete) { - mail_vfolder_delete_uri(up->store, up->uri); - mail_filter_delete_uri(up->store, up->uri); - mail_config_uri_deleted(CAMEL_STORE_CLASS(CAMEL_OBJECT_GET_CLASS(up->store))->compare_folder_name, up->uri); - - } else - mail_vfolder_add_uri(up->store, up->uri, TRUE); - } else { - /* We can tell the vfolder code though */ - if (up->olduri && up->add) { - d(printf("renaming folder '%s' to '%s'\n", up->olduri, up->uri)); - mail_vfolder_rename_uri(up->store, up->olduri, up->uri); - mail_filter_rename_uri(up->store, up->olduri, up->uri); - mail_config_uri_renamed(CAMEL_STORE_CLASS(CAMEL_OBJECT_GET_CLASS(up->store))->compare_folder_name, - up->olduri, up->uri); - } - - if (!up->olduri && up->add) - mail_vfolder_add_uri(up->store, up->uri, FALSE); - } - - /* new mail notification */ - if (notify_type == -1) { - /* need to track the user's new-mail-notification settings... */ - GConfClient *gconf; - - gconf = mail_config_get_gconf_client (); - gconf_client_add_dir (gconf, "/apps/evolution/mail/notify", - GCONF_CLIENT_PRELOAD_ONELEVEL, NULL); - notify_id = gconf_client_notify_add (gconf, "/apps/evolution/mail/notify", - notify_type_changed, NULL, NULL, NULL); - notify_type = gconf_client_get_int (gconf, "/apps/evolution/mail/notify/type", NULL); - } - - time (&now); - if (notify_type != 0 && up->new && notify_idle_id == 0 && (now - last_notify >= 5)) - notify_idle_id = g_idle_add_full (G_PRIORITY_LOW, notify_idle_cb, NULL, NULL); - - free_update(up); - - LOCK(info_lock); - } - update_id = -1; - UNLOCK(info_lock); -} - -static void -flush_updates(void) -{ - if (update_id == -1 && !e_dlist_empty(&updates)) - update_id = mail_async_event_emit(mail_async_event, MAIL_ASYNC_GUI, (MailAsyncFunc)real_flush_updates, 0, 0, 0); -} - -static void -unset_folder_info(struct _folder_info *mfi, int delete, int unsub) -{ - struct _folder_update *up; - - d(printf("unset folderinfo '%s'\n", mfi->uri)); - - if (mfi->folder) { - CamelFolder *folder = mfi->folder; - - camel_object_unhook_event(folder, "folder_changed", folder_changed, mfi); - camel_object_unhook_event(folder, "message_changed", message_changed, mfi); - camel_object_unhook_event(folder, "renamed", folder_renamed, mfi); - camel_object_unhook_event(folder, "finalize", folder_finalised, mfi); - } - - if (strstr(mfi->uri, ";noselect") == NULL) { - up = g_malloc0(sizeof(*up)); - - up->remove = TRUE; - up->delete = delete; - up->unsub = unsub; - up->store = mfi->store_info->store; - up->path = g_strdup (mfi->path); - camel_object_ref(up->store); - up->uri = g_strdup(mfi->uri); - - e_dlist_addtail(&updates, (EDListNode *)up); - flush_updates(); - } -} - -static void -free_folder_info(struct _folder_info *mfi) -{ - g_free(mfi->path); - g_free(mfi->full_name); - g_free(mfi->uri); - g_free(mfi); -} - -/* This is how unread counts work (and don't work): - * - * camel_folder_unread_message_count() only gives a correct answer if - * the store is paying attention to the folder. (Some stores always - * pay attention to all folders, but IMAP can only pay attention to - * one folder at a time.) But it doesn't have any way to know when - * it's lying, so it's only safe to call it when you know for sure - * that the store is paying attention to the folder, such as when it's - * just been created, or you get a folder_changed or message_changed - * signal on it. - * - * camel_store_get_folder_info() always gives correct answers for the - * folders it checks, but it can also return -1 for a folder, meaning - * it didn't check, and so you should stick with your previous answer. - * - * update_1folder is called from three places: with info != NULL when - * the folder is created (or get_folder_info), with info == NULL when - * a folder changed event is emitted. - * - * So if info is NULL, camel_folder_unread_message_count is correct, - * and if it's not NULL and its unread_message_count isn't -1, then - * it's correct. */ - -static void -update_1folder(struct _folder_info *mfi, int new, CamelFolderInfo *info) -{ - struct _store_info *si; - struct _folder_update *up; - CamelFolder *folder; - int unread = -1; - extern CamelFolder *outbox_folder, *sent_folder; - - si = mfi->store_info; - - folder = mfi->folder; - if (folder) { - if ((count_trash && CAMEL_IS_VTRASH_FOLDER (folder)) - || folder == outbox_folder - || (count_sent && folder == sent_folder)) { - unread = camel_folder_get_message_count(folder); - } else { - if (info) - unread = info->unread_message_count; - else - unread = camel_folder_get_unread_message_count (folder); - } - } else if (info) - unread = info->unread_message_count; - - d(printf("folder updated: unread %d: '%s'\n", unread, mfi->full_name)); - - if (unread == -1) - return; - - up = g_malloc0(sizeof(*up)); - up->path = g_strdup(mfi->path); - up->unread = unread; - up->new = new ? 1 : 0; - up->store = mfi->store_info->store; - camel_object_ref(up->store); - e_dlist_addtail(&updates, (EDListNode *)up); - flush_updates(); -} - -static void -setup_folder(CamelFolderInfo *fi, struct _store_info *si) -{ - struct _folder_info *mfi; - struct _folder_update *up; - - mfi = g_hash_table_lookup(si->folders, fi->full_name); - if (mfi) { - update_1folder(mfi, 0, fi); - } else { - /* always 'add it', but only 'add it' to non-local stores */ - /*d(printf("Adding new folder: %s (%s) %d unread\n", fi->path, fi->url, fi->unread_message_count));*/ - mfi = g_malloc0(sizeof(*mfi)); - mfi->path = g_strdup(fi->path); - mfi->full_name = g_strdup(fi->full_name); - mfi->uri = g_strdup(fi->url); - mfi->store_info = si; - g_hash_table_insert(si->folders, mfi->full_name, mfi); - g_hash_table_insert(si->folders_uri, mfi->uri, mfi); - - up = g_malloc0(sizeof(*up)); - up->path = g_strdup(mfi->path); - up->name = g_strdup(fi->name); - up->uri = g_strdup(fi->url); - up->unread = (fi->unread_message_count==-1)?0:fi->unread_message_count; - up->store = si->store; - camel_object_ref(up->store); - if (strstr(fi->url, ";noselect") == NULL) - up->add = TRUE; - - e_dlist_addtail(&updates, (EDListNode *)up); - flush_updates(); - } -} - -static void -create_folders(CamelFolderInfo *fi, struct _store_info *si) -{ - d(printf("Setup new folder: %s\n %s\n", fi->url, fi->full_name)); - - setup_folder(fi, si); - - if (fi->child) - create_folders(fi->child, si); - if (fi->sibling) - create_folders(fi->sibling, si); -} - -static void -folder_changed (CamelObject *o, gpointer event_data, gpointer user_data) -{ - extern CamelFolder *outbox_folder, *sent_folder; - CamelFolderChangeInfo *changes = event_data; - CamelFolder *folder = (CamelFolder *) o; - struct _folder_info *mfi = user_data; - int new = 0; - - if (mfi->folder != folder) - return; - - if (!CAMEL_IS_VTRASH_FOLDER (folder) && folder != outbox_folder && folder != sent_folder && changes && changes->uid_added) - new = changes->uid_added->len; - - LOCK(info_lock); - update_1folder(mfi, new, NULL); - UNLOCK(info_lock); -} - -static void -message_changed (CamelObject *o, gpointer event_data, gpointer user_data) -{ - struct _folder_info *mfi = user_data; - - if (mfi->folder != CAMEL_FOLDER (o)) - return; - - LOCK(info_lock); - update_1folder(mfi, 0, NULL); - UNLOCK(info_lock); -} - -static void -folder_finalised(CamelObject *o, gpointer event_data, gpointer user_data) -{ - struct _folder_info *mfi = user_data; - - d(printf("Folder finalised '%s'!\n", ((CamelFolder *)o)->full_name)); - LOCK(info_lock); - mfi->folder = NULL; - UNLOCK(info_lock); -} - -static void -folder_renamed(CamelObject *o, gpointer event_data, gpointer user_data) -{ - struct _folder_info *mfi = user_data; - CamelFolder *folder = (CamelFolder *)o; - char *old = event_data; - - d(printf("Folder renamed from '%s' to '%s'\n", old, folder->full_name)); - - mfi = mfi; - old = old; - folder = folder; - /* Dont do anything, do it from the store rename event? */ -} - -void mail_note_folder(CamelFolder *folder) -{ - CamelStore *store = folder->parent_store; - struct _store_info *si; - struct _folder_info *mfi; - - if (stores == NULL) { - g_warning("Adding a folder `%s' to a store which hasn't been added yet?\n", folder->full_name); - return; - } - - LOCK(info_lock); - si = g_hash_table_lookup(stores, store); - if (si == NULL) { - /*g_warning("Adding a folder `%s' to a store %p which hasn't been added yet?", folder->full_name, store);*/ - UNLOCK(info_lock); - return; - } - - mfi = g_hash_table_lookup(si->folders, folder->full_name); - if (mfi == NULL) { - w(g_warning("Adding a folder `%s' that I dont know about yet?", folder->full_name)); - UNLOCK(info_lock); - return; - } - - /* dont do anything if we already have this */ - if (mfi->folder == folder) { - UNLOCK(info_lock); - return; - } - - mfi->folder = folder; - - camel_object_hook_event(folder, "folder_changed", folder_changed, mfi); - camel_object_hook_event(folder, "message_changed", message_changed, mfi); - camel_object_hook_event(folder, "renamed", folder_renamed, mfi); - camel_object_hook_event(folder, "finalize", folder_finalised, mfi); - - update_1folder(mfi, 0, NULL); - - UNLOCK(info_lock); -} - -static void -store_folder_subscribed(CamelObject *o, void *event_data, void *data) -{ - struct _store_info *si; - CamelFolderInfo *fi = event_data; - - d(printf("Store folder subscribed '%s' store '%s' \n", fi->full_name, camel_url_to_string(((CamelService *)o)->url, 0))); - - LOCK(info_lock); - si = g_hash_table_lookup(stores, o); - if (si) - setup_folder(fi, si); - UNLOCK(info_lock); -} - -static void -store_folder_created(CamelObject *o, void *event_data, void *data) -{ - /* we only want created events to do more work if we dont support subscriptions */ - if (!camel_store_supports_subscriptions(CAMEL_STORE(o))) - store_folder_subscribed(o, event_data, data); -} - -static void -store_folder_unsubscribed(CamelObject *o, void *event_data, void *data) -{ - struct _store_info *si; - CamelFolderInfo *fi = event_data; - struct _folder_info *mfi; - CamelStore *store = (CamelStore *)o; - - d(printf("Store Folder deleted: %s\n", fi->full_name)); - - LOCK(info_lock); - si = g_hash_table_lookup(stores, store); - if (si) { - mfi = g_hash_table_lookup(si->folders, fi->full_name); - if (mfi) { - g_hash_table_remove(si->folders, mfi->full_name); - g_hash_table_remove(si->folders_uri, mfi->uri); - unset_folder_info(mfi, TRUE, TRUE); - free_folder_info(mfi); - } - } - UNLOCK(info_lock); -} - -static void -store_folder_deleted(CamelObject *o, void *event_data, void *data) -{ - /* we only want deleted events to do more work if we dont support subscriptions */ - if (!camel_store_supports_subscriptions(CAMEL_STORE(o))) - store_folder_unsubscribed(o, event_data, data); -} - -static void -rename_folders(struct _store_info *si, const char *oldbase, const char *newbase, CamelFolderInfo *fi) -{ - char *old; - struct _folder_info *mfi; - struct _folder_update *up; - - up = g_malloc0(sizeof(*up)); - - d(printf("oldbase '%s' newbase '%s' new '%s'\n", oldbase, newbase, fi->full_name)); - - /* Form what was the old name, and try and look it up */ - old = g_strdup_printf("%s%s", oldbase, fi->full_name + strlen(newbase)); - mfi = g_hash_table_lookup(si->folders, old); - if (mfi) { - d(printf("Found old folder '%s' renaming to '%s'\n", mfi->full_name, fi->full_name)); - - up->oldpath = mfi->path; - up->olduri = mfi->uri; - - /* Its a rename op */ - g_hash_table_remove(si->folders, mfi->full_name); - g_hash_table_remove(si->folders, mfi->uri); - g_free(mfi->full_name); - mfi->path = g_strdup(fi->path); - mfi->full_name = g_strdup(fi->full_name); - mfi->uri = g_strdup(fi->url); - g_hash_table_insert(si->folders, mfi->full_name, mfi); - g_hash_table_insert(si->folders_uri, mfi->uri, mfi); - } else { - d(printf("Rename found a new folder? old '%s' new '%s'\n", old, fi->full_name)); - /* Its a new op */ - mfi = g_malloc0(sizeof(*mfi)); - mfi->path = g_strdup(fi->path); - mfi->full_name = g_strdup(fi->full_name); - mfi->uri = g_strdup(fi->url); - mfi->store_info = si; - g_hash_table_insert(si->folders, mfi->full_name, mfi); - g_hash_table_insert(si->folders_uri, mfi->uri, mfi); - } - - g_free(old); - - up->path = g_strdup(mfi->path); - up->name = g_strdup(fi->name); - up->uri = g_strdup(mfi->uri); - up->unread = fi->unread_message_count==-1?0:fi->unread_message_count; - up->store = si->store; - camel_object_ref(up->store); - /* FIXME: use fi->flags */ - if (strstr(fi->url, ";noselect") == NULL) - up->add = TRUE; - - e_dlist_addtail(&updates, (EDListNode *)up); - flush_updates(); -#if 0 - if (fi->sibling) - rename_folders(si, oldbase, newbase, fi->sibling, folders); - if (fi->child) - rename_folders(si, oldbase, newbase, fi->child, folders); -#endif -} - -static void -get_folders(CamelFolderInfo *fi, GPtrArray *folders) -{ - g_ptr_array_add(folders, fi); - - if (fi->child) - get_folders(fi->child, folders); - if (fi->sibling) - get_folders(fi->sibling, folders); -} - -static int -folder_cmp(const void *ap, const void *bp) -{ - const CamelFolderInfo *a = ((CamelFolderInfo **)ap)[0]; - const CamelFolderInfo *b = ((CamelFolderInfo **)bp)[0]; - - return strcmp(a->path, b->path); -} - -static void -store_folder_renamed(CamelObject *o, void *event_data, void *data) -{ - CamelStore *store = (CamelStore *)o; - CamelRenameInfo *info = event_data; - struct _store_info *si; - - d(printf("Folder renamed: oldbase = '%s' new->full = '%s'\n", info->old_base, info->new->full_name)); - - LOCK(info_lock); - si = g_hash_table_lookup(stores, store); - if (si) { - GPtrArray *folders = g_ptr_array_new(); - CamelFolderInfo *top; - int i; - - /* Ok, so for some reason the folderinfo we have comes in all messed up from - imap, should find out why ... this makes it workable */ - get_folders(info->new, folders); - qsort(folders->pdata, folders->len, sizeof(folders->pdata[0]), folder_cmp); - - top = folders->pdata[0]; - for (i=0;i<folders->len;i++) { - rename_folders(si, info->old_base, top->full_name, folders->pdata[i]); - } - - g_ptr_array_free(folders, TRUE); - - } - UNLOCK(info_lock); -} - -struct _update_data { - struct _update_data *next; - struct _update_data *prev; - - int id; /* id for cancellation */ - - void (*done)(CamelStore *store, CamelFolderInfo *info, void *data); - void *data; -}; - -static void -unset_folder_info_hash(char *path, struct _folder_info *mfi, void *data) -{ - unset_folder_info(mfi, FALSE, FALSE); -} - -static void -free_folder_info_hash(char *path, struct _folder_info *mfi, void *data) -{ - free_folder_info(mfi); -} - -void -mail_note_store_remove(CamelStore *store) -{ - struct _update_data *ud; - struct _store_info *si; - - g_assert(CAMEL_IS_STORE(store)); - - if (stores == NULL) - return; - - d(printf("store removed!!\n")); - LOCK(info_lock); - si = g_hash_table_lookup(stores, store); - if (si) { - g_hash_table_remove(stores, store); - - camel_object_unhook_event(store, "folder_created", store_folder_created, NULL); - camel_object_unhook_event(store, "folder_deleted", store_folder_deleted, NULL); - camel_object_unhook_event(store, "folder_renamed", store_folder_renamed, NULL); - camel_object_unhook_event(store, "folder_subscribed", store_folder_subscribed, NULL); - camel_object_unhook_event(store, "folder_unsubscribed", store_folder_unsubscribed, NULL); - g_hash_table_foreach(si->folders, (GHFunc)unset_folder_info_hash, NULL); - - ud = (struct _update_data *)si->folderinfo_updates.head; - while (ud->next) { - d(printf("Cancelling outstanding folderinfo update %d\n", ud->id)); - mail_msg_cancel(ud->id); - ud = ud->next; - } - - camel_object_unref(si->store); - g_hash_table_foreach(si->folders, (GHFunc)free_folder_info_hash, NULL); - g_hash_table_destroy(si->folders); - g_hash_table_destroy(si->folders_uri); - g_free(si); - } - UNLOCK(info_lock); -} - -static void -update_folders(CamelStore *store, CamelFolderInfo *fi, void *data) -{ - struct _update_data *ud = data; - struct _store_info *si; - - d(printf("Got folderinfo for store\n")); - - LOCK(info_lock); - si = g_hash_table_lookup(stores, store); - if (si) { - /* the 'si' is still there, so we can remove ourselves from its list */ - /* otherwise its not, and we're on our own and free anyway */ - e_dlist_remove((EDListNode *)ud); - - if (fi) - create_folders(fi, si); - } - UNLOCK(info_lock); - - if (ud->done) - ud->done(store, fi, ud->data); - g_free(ud); -} - - -struct _ping_store_msg { - struct _mail_msg msg; - - CamelStore *store; -}; - -static char * -ping_store_desc (struct _mail_msg *mm, int done) -{ - struct _ping_store_msg *m = (struct _ping_store_msg *) mm; - char *service_name = camel_service_get_name (CAMEL_SERVICE (m->store), TRUE); - char *msg; - - msg = g_strdup_printf (_("Pinging %s"), service_name); - g_free (service_name); - - return msg; -} - -static void -ping_store_ping (struct _mail_msg *mm) -{ - struct _ping_store_msg *m = (struct _ping_store_msg *) mm; - - if (CAMEL_SERVICE (m->store)->status == CAMEL_SERVICE_CONNECTED) - camel_store_noop (m->store, &mm->ex); -} - -static void -ping_store_free (struct _mail_msg *mm) -{ - struct _ping_store_msg *m = (struct _ping_store_msg *) mm; - - camel_object_unref (m->store); -} - -static struct _mail_msg_op ping_store_op = { - ping_store_desc, - ping_store_ping, - NULL, - ping_store_free -}; - -static void -ping_store (gpointer key, gpointer val, gpointer user_data) -{ - CamelStore *store = (CamelStore *) key; - struct _ping_store_msg *m; - - if (CAMEL_SERVICE (store)->status != CAMEL_SERVICE_CONNECTED) - return; - - m = mail_msg_new (&ping_store_op, NULL, sizeof (struct _ping_store_msg)); - m->store = store; - camel_object_ref (store); - - e_thread_put (mail_thread_queued, (EMsg *) m); -} - -static gboolean -ping_cb (gpointer user_data) -{ - LOCK (info_lock); - - g_hash_table_foreach (stores, ping_store, NULL); - - UNLOCK (info_lock); - - return TRUE; -} - -static void -store_online_cb (CamelStore *store, void *data) -{ - struct _update_data *ud = data; - - LOCK(info_lock); - - if (g_hash_table_lookup(stores, store) != NULL) { - /* re-use the cancel id. we're already in the store update list too */ - ud->id = mail_get_folderinfo(store, NULL, update_folders, ud); - } else { - /* the store vanished, that means we were probably cancelled, or at any rate, - need to clean ourselves up */ - g_free(ud); - } - - UNLOCK(info_lock); -} - -void -mail_note_store(CamelStore *store, CamelOperation *op, - void (*done)(CamelStore *store, CamelFolderInfo *info, void *data), void *data) -{ - struct _store_info *si; - struct _update_data *ud; - const char *buf; - guint timeout; - - g_assert(CAMEL_IS_STORE(store)); - g_assert(pthread_self() == mail_gui_thread); - - LOCK(info_lock); - - if (stores == NULL) { - stores = g_hash_table_new(NULL, NULL); - count_sent = getenv("EVOLUTION_COUNT_SENT") != NULL; - count_trash = getenv("EVOLUTION_COUNT_TRASH") != NULL; - buf = getenv ("EVOLUTION_PING_TIMEOUT"); - timeout = buf ? strtoul (buf, NULL, 10) * 1000 : 600000; - ping_id = g_timeout_add (timeout, ping_cb, NULL); - } - - si = g_hash_table_lookup(stores, store); - if (si == NULL) { - d(printf("Noting a new store: %p: %s\n", store, camel_url_to_string(((CamelService *)store)->url, 0))); - - si = g_malloc0(sizeof(*si)); - si->folders = g_hash_table_new(g_str_hash, g_str_equal); - si->folders_uri = g_hash_table_new(CAMEL_STORE_CLASS(CAMEL_OBJECT_GET_CLASS(store))->hash_folder_name, - CAMEL_STORE_CLASS(CAMEL_OBJECT_GET_CLASS(store))->compare_folder_name); - si->store = store; - camel_object_ref((CamelObject *)store); - g_hash_table_insert(stores, store, si); - e_dlist_init(&si->folderinfo_updates); - - camel_object_hook_event(store, "folder_created", store_folder_created, NULL); - camel_object_hook_event(store, "folder_deleted", store_folder_deleted, NULL); - camel_object_hook_event(store, "folder_renamed", store_folder_renamed, NULL); - camel_object_hook_event(store, "folder_subscribed", store_folder_subscribed, NULL); - camel_object_hook_event(store, "folder_unsubscribed", store_folder_unsubscribed, NULL); - } - - /* We might get a race when setting up a store, such that it is still left in offline mode, - after we've gone online. This catches and fixes it up when the shell opens us */ - if (CAMEL_IS_DISCO_STORE(store) - && camel_session_is_online(session) - && camel_disco_store_status (CAMEL_DISCO_STORE (store)) == CAMEL_DISCO_STORE_OFFLINE) { - ud = g_malloc(sizeof(*ud)); - ud->done = done; - ud->data = data; - /* Note: we use the 'id' here, even though its not the right id, its still ok */ - ud->id = mail_store_set_offline (store, FALSE, store_online_cb, ud); - - e_dlist_addtail (&si->folderinfo_updates, (EDListNode *) ud); - } else if (!CAMEL_IS_DISCO_STORE(store) - || camel_disco_store_status (CAMEL_DISCO_STORE (store)) == CAMEL_DISCO_STORE_ONLINE - || camel_disco_store_can_work_offline (CAMEL_DISCO_STORE (store))) { - ud = g_malloc (sizeof (*ud)); - ud->done = done; - ud->data = data; - ud->id = mail_get_folderinfo (store, op, update_folders, ud); - - e_dlist_addtail (&si->folderinfo_updates, (EDListNode *) ud); - } - - UNLOCK(info_lock); -} - -struct _find_info { - const char *uri; - struct _folder_info *fi; -}; - -/* look up on each storeinfo using proper hash function for that stores uri's */ -static void storeinfo_find_folder_info(CamelStore *store, struct _store_info *si, struct _find_info *fi) -{ - if (fi->fi == NULL) - fi->fi = g_hash_table_lookup(si->folders_uri, fi->uri); -} - -/* returns TRUE if the uri is available, folderp is set to a - reffed folder if the folder has also already been opened */ -int mail_note_get_folder_from_uri(const char *uri, CamelFolder **folderp) -{ - struct _find_info fi = { uri, NULL }; - - if (stores == NULL) - return FALSE; - - LOCK(info_lock); - g_hash_table_foreach(stores, (GHFunc)storeinfo_find_folder_info, &fi); - if (folderp) { - if (fi.fi && fi.fi->folder) { - *folderp = fi.fi->folder; - camel_object_ref(*folderp); - } else { - *folderp = NULL; - } - } - UNLOCK(info_lock); - - return fi.fi != NULL; -} diff --git a/mail/mail-folder-cache.h b/mail/mail-folder-cache.h deleted file mode 100644 index 875579ad67..0000000000 --- a/mail/mail-folder-cache.h +++ /dev/null @@ -1,51 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* mail-folder-cache.h: Stores information about open folders */ - -/* - * Authors: Peter Williams <peterw@ximian.com> - * Michael Zucchi <notzed@ximian.com> - * - * Copyright 2000,2001 Ximian, Inc. (www.ximian.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public - * License as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA - */ - -#ifndef _MAIL_FOLDER_CACHE_H -#define _MAIL_FOLDER_CACHE_H - -#include <camel/camel-store.h> - -/* Add a store whose folders should appear in the shell - The folders are scanned from the store, and/or added at - runtime via the folder_created event */ -void -mail_note_store (CamelStore *store, CamelOperation *op, - void (*done) (CamelStore *store, CamelFolderInfo *info, void *data), - void *data); - -/* de-note a store */ -void mail_note_store_remove (CamelStore *store); - -/* When a folder has been opened, notify it for watching. - The folder must have already been created on the store (which has already been noted) - before the folder can be opened - */ -void mail_note_folder (CamelFolder *folder); - -/* Returns true if a folder is available (yet), and also sets *folderp (if supplied) - to a (referenced) copy of the folder if it has already been opened */ -int mail_note_get_folder_from_uri (const char *uri, CamelFolder **folderp); - -#endif diff --git a/mail/mail-font-prefs.c b/mail/mail-font-prefs.c deleted file mode 100644 index 0d26f1ccbd..0000000000 --- a/mail/mail-font-prefs.c +++ /dev/null @@ -1,130 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Authors: Larry Ewing <lewing@ximian.com> - * - * Copyright 2002 Ximian, Inc. (www.ximian.com) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA. - * - */ -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <gtk/gtk.h> -#include <gtkhtml/gtkhtml-propmanager.h> - -#include "mail-font-prefs.h" - -static GtkVBoxClass *parent_class = NULL; - -GtkWidget * -mail_font_prefs_new (void) -{ - MailFontPrefs *new; - - new = MAIL_FONT_PREFS (g_object_new (mail_font_prefs_get_type ()), NULL); - - return GTK_WIDGET (new); -} - -void -mail_font_prefs_apply (MailFontPrefs *prefs) -{ - gtk_html_propmanager_apply (prefs->pman); -} - -static void -font_prefs_changed (GtkHTMLPropmanager *pman, MailFontPrefs *prefs) -{ - if (prefs->control) - evolution_config_control_changed (prefs->control); -} - -static void -mail_font_prefs_destroy (GtkObject *object) -{ - MailFontPrefs *prefs = (MailFontPrefs *) object; - - if (prefs->pman) { - g_object_unref(prefs->pman); - g_object_unref(prefs->gui); - prefs->pman = NULL; - } - - if (GTK_OBJECT_CLASS (parent_class)->finalize) - (* GTK_OBJECT_CLASS (parent_class)->finalize) (object); -} - -static void -mail_font_prefs_init (MailFontPrefs *prefs) -{ - GtkWidget *toplevel; - GladeXML *gui; - - gui = glade_xml_new (EVOLUTION_GLADEDIR "/mail-config.glade", "font_tab", NULL); - prefs->gui = gui; - - prefs->pman = GTK_HTML_PROPMANAGER (gtk_html_propmanager_new (NULL)); - gtk_html_propmanager_set_gui (prefs->pman, gui, NULL); - g_object_ref(prefs->pman); - gtk_object_sink (GTK_OBJECT (prefs->pman)); - - g_signal_connect(prefs->pman, "changed", font_prefs_changed, prefs); - - /* get our toplevel widget */ - toplevel = glade_xml_get_widget (gui, "toplevel"); - - /* reparent */ - g_object_ref (toplevel); - gtk_container_remove (GTK_CONTAINER (toplevel->parent), toplevel); - gtk_container_add (GTK_CONTAINER (prefs), toplevel); - g_object_unref (toplevel); -} - -static void -mail_font_prefs_class_init (MailFontPrefsClass *klass) -{ - GtkObjectClass *object_class; - - object_class = (GtkObjectClass *) klass; - parent_class = g_type_class_ref(gtk_vbox_get_type ()); - - object_class->destroy = mail_font_prefs_destroy; -} - -GtkType -mail_font_prefs_get_type (void) -{ - static GType type = 0; - - if (!type) { - GTypeInfo type_info = { - sizeof (MailFontPrefsClass), - NULL, NULL, - (GClassInitFunc) mail_font_prefs_class_init, - NULL, NULL, - sizeof (MailFontPrefs), - 0, - (GInstanceInitFunc) mail_font_prefs_init, - }; - - type = g_type_register_static (gtk_vbox_get_type (), "MailFontPrefs", &type_info, 0); - } - - return type; -} - - diff --git a/mail/mail-font-prefs.h b/mail/mail-font-prefs.h deleted file mode 100644 index 87266734a9..0000000000 --- a/mail/mail-font-prefs.h +++ /dev/null @@ -1,66 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Authors: Jeffrey Stedfast <fejj@ximian.com> - * - * Copyright 2002 Ximian, Inc. (www.ximian.com) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA. - * - */ -#ifndef __MAIL_FONT_PREFS_H__ -#define __MAIL_FONT_PREFS_H__ - -#ifdef __cplusplus -extern "C" { -#pragma } -#endif - -#include <gtk/gtk.h> -#include <gtkhtml/gtkhtml-propmanager.h> - -#include <shell/Evolution.h> -#include "evolution-config-control.h" - -#define MAIL_FONT_PREFS_TYPE (mail_font_prefs_get_type()) -#define MAIL_FONT_PREFS(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), MAIL_FONT_PREFS_TYPE, MailFontPrefs)) -#define MAIL_FONT_PREFS_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), MAIL_FONT_PREFS_TYPE, MailFontPrefsClass)) -#define IS_MAIL_FONT_PREFS(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), MAIL_FONT_PREFS_TYPE)) -#define IS_MAIL_FONT_PREFS_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), MAIL_FONT_PREFS_TYPE)) - -typedef struct _MailFontPrefs MailFontPrefs; -typedef struct _MailFontPrefsClass MailFontPrefsClass; - -struct _MailFontPrefs { - GtkVBox parent_object; - - GtkHTMLPropmanager *pman; - GladeXML *gui; - EvolutionConfigControl *control; -}; - -struct _MailFontPrefsClass { - GtkVBoxClass parent_object; -}; - -GtkType mail_font_prefs_get_type (void); -GtkWidget * mail_font_prefs_new (void); -void mail_font_prefs_apply (MailFontPrefs *prefs); - -#define MAIL_FONT_PREFS_CONTROL_ID "OAFIID:GNOME_Evolution_Mail_FontPrefs_ConfigControl:" BASE_VERSION - -#ifdef __cplusplus -} -#endif /* __cplusplus */ -#endif /* __MAIL_FONT_PREFS_H__ */ diff --git a/mail/mail-importer.c b/mail/mail-importer.c deleted file mode 100644 index 46804fc295..0000000000 --- a/mail/mail-importer.c +++ /dev/null @@ -1,288 +0,0 @@ -/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ -/* mail-importer.c - * - * Authors: Iain Holmes <iain@ximian.com> - * - * Copyright (C) 2001-2003 Ximian, Inc. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public - * License as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <string.h> -#include <sys/types.h> -#include <dirent.h> -#include <gmodule.h> -#include <libgnome/gnome-util.h> -#include <evolution-storage.h> -#include <camel/camel-folder.h> -#include <camel/camel-mime-message.h> -#include <camel/camel-stream-mem.h> -#include <camel/camel-exception.h> -#include <e-util/e-path.h> - -#include "mail-component.h" -#include "mail-importer.h" -#include "mail.h" - -static GList *importer_modules = NULL; -static GNOME_Evolution_Storage local_storage = NULL; - -void mail_importer_uninit (void); - -struct _create_data { - GNOME_Evolution_Storage_Result create_result; - int create_done:1; -}; - -static void -folder_created_cb(BonoboListener *listener, const char *event_name, const BonoboArg *event_data, - CORBA_Environment *ev, struct _create_data *data) -{ - GNOME_Evolution_Storage_FolderResult *result; - - data->create_done = TRUE; - - if (strcmp (event_name, "evolution-shell:folder_created") != 0) { - return; /* Unknown event */ - } - - result = event_data->_value; - data->create_result = result->result; -} - -/** - * mail_importer_make_local_folder: - * @folderpath: - * - * Check a local folder exists at path @folderpath, and if not, create it. - * - * Return value: The physical uri of the folder, or NULL if the folder did - * not exist and could not be created. - **/ -char * -mail_importer_make_local_folder(const char *folderpath) -{ - CORBA_Environment ev; - char *uri = NULL, *tmp; - GNOME_Evolution_Folder *fi; - BonoboListener *listener; - - CORBA_exception_init (&ev); - - /* first, check, does this folder exist, if so, use the right path */ - fi = GNOME_Evolution_Storage_getFolderAtPath(local_storage, folderpath, &ev); - if (fi) { - printf("folder %s exists @ %s\n", folderpath, fi->physicalUri); - uri = g_strdup(fi->physicalUri); - CORBA_free(fi); - } else { - struct _create_data data = { GNOME_Evolution_Storage_GENERIC_ERROR, FALSE }; - - tmp = g_strdup_printf("file://%s/local", - mail_component_peek_base_directory (mail_component_peek ())); - uri = e_path_to_physical(tmp, folderpath); - g_free(tmp); - tmp = strrchr(uri, '/'); - tmp[0] = 0; - - printf("Creating folder %s, parent %s\n", folderpath, uri); - - listener = bonobo_listener_new (NULL, NULL); - g_signal_connect(listener, "event-notify", G_CALLBACK (folder_created_cb), &data); - - GNOME_Evolution_Storage_asyncCreateFolder(local_storage, folderpath, "mail", "", uri, - bonobo_object_corba_objref((BonoboObject *)listener), &ev); - - while (!data.create_done) - g_main_context_iteration(NULL, TRUE); - - bonobo_object_unref((BonoboObject *)listener); - - if (data.create_result != GNOME_Evolution_Storage_OK) { - g_free(uri); - uri = NULL; - } else { - *tmp = '/'; - } - } - - CORBA_exception_free (&ev); - - return uri; -} - -/** - * mail_importer_add_line: - * importer: A MailImporter structure. - * str: Next line of the mbox. - * finished: TRUE if @str is the last line of the message. - * - * Adds lines to the message until it is finished, and then adds - * the complete message to the folder. - */ -void -mail_importer_add_line (MailImporter *importer, - const char *str, - gboolean finished) -{ - CamelMimeMessage *msg; - CamelMessageInfo *info; - CamelException *ex; - - if (importer->mstream == NULL) - importer->mstream = CAMEL_STREAM_MEM (camel_stream_mem_new ()); - - camel_stream_write (CAMEL_STREAM (importer->mstream), str, strlen (str)); - - if (finished == FALSE) - return; - - camel_stream_reset (CAMEL_STREAM (importer->mstream)); - info = g_new0 (CamelMessageInfo, 1); - info->flags = CAMEL_MESSAGE_SEEN; - - msg = camel_mime_message_new (); - camel_data_wrapper_construct_from_stream (CAMEL_DATA_WRAPPER (msg), - CAMEL_STREAM (importer->mstream)); - - camel_object_unref (importer->mstream); - importer->mstream = NULL; - - ex = camel_exception_new (); - camel_folder_append_message (importer->folder, msg, info, NULL, ex); - camel_object_unref (msg); - - camel_exception_free (ex); - g_free (info); -} - -/* module management */ -static GList * -get_importer_list (void) -{ - DIR *dir; - struct dirent *d; - GList *importers_ret = NULL; - - dir = opendir (MAIL_IMPORTERSDIR); - if (!dir) { - g_warning ("No importers dir: %s", MAIL_IMPORTERSDIR); - return NULL; - } - - while ((d = readdir (dir))) { - char *path, *ext; - - ext = strchr (d->d_name, '.'); - if (!ext || strcmp (ext, ".so") != 0) - continue; - - path = g_build_filename (MAIL_IMPORTERSDIR, d->d_name, NULL); - importers_ret = g_list_prepend (importers_ret, path); - } - - closedir (dir); - return importers_ret; -} - -static void -free_importer_list (GList *list) -{ - for (; list; list = list->next) { - g_free (list->data); - } - - g_list_free (list); -} - -/** - * mail_importer_init: - * - * Initialises all the importers - */ -void -mail_importer_init (EvolutionShellClient *client) -{ - GList *importers, *l; - - if (importer_modules != NULL) { - return; - } - - local_storage = evolution_shell_client_get_local_storage (client); - - if (!g_module_supported ()) { - g_warning ("Could not initialise the importers as module loading" - " is not supported on this system"); - return; - } - - importers = get_importer_list (); - if (importers == NULL) - return; - - for (l = importers; l; l = l->next) { - GModule *module; - - module = g_module_open (l->data, 0); - if (!module) { - g_warning ("Could not load: %s: %s", (char *) l->data, - g_module_error ()); - } else { - void *(*mail_importer_module_init) (); - - if (!g_module_symbol (module, "mail_importer_module_init", - (gpointer *)&mail_importer_module_init)) { - g_warning ("Could not load %s: No initialisation", - (char *) l->data); - g_module_close (module); - } - - mail_importer_module_init (); - importer_modules = g_list_prepend (importer_modules, module); - } - } - - free_importer_list (importers); -} - -/** - * mail_importer_uninit: - * - * Unloads all the modules. - */ -void -mail_importer_uninit (void) -{ - CORBA_Environment ev; - GList *l; - - for (l = importer_modules; l; l = l->next) { - g_module_close (l->data); - } - - g_list_free (importer_modules); - importer_modules = NULL; - - CORBA_exception_init (&ev); - bonobo_object_release_unref (local_storage, &ev); - local_storage = NULL; - CORBA_exception_free (&ev); -} - diff --git a/mail/mail-importer.h b/mail/mail-importer.h deleted file mode 100644 index 66b4441e1d..0000000000 --- a/mail/mail-importer.h +++ /dev/null @@ -1,53 +0,0 @@ -/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ -/* mail-importer.h - * - * Authors: Iain Holmes <iain@ximian.com> - * - * Copyright (C) 2001 Ximian, Inc. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public - * License as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#ifndef __MAIL_IMPORTER_H__ -#define __MAIL_IMPORTER_H__ - -#include <bonobo/bonobo-listener.h> -#include <camel/camel-folder.h> -#include <camel/camel-stream-mem.h> -#include <evolution-shell-client.h> - -typedef struct _MailImporter MailImporter; -struct _MailImporter { - CamelFolder *folder; - CamelStreamMem *mstream; - - gboolean frozen; /* Is folder frozen? */ -}; - -void mail_importer_init (EvolutionShellClient *client); -void mail_importer_uninit (void); - -void mail_importer_add_line (MailImporter *importer, - const char *str, - gboolean finished); -void mail_importer_create_folder (const char *parent_path, - const char *name, - const char *description, - const BonoboListener *listener); - -/* creates a folder at folderpath on the local storage */ -char *mail_importer_make_local_folder(const char *folderpath); - -#endif diff --git a/mail/mail-mt.c b/mail/mail-mt.c deleted file mode 100644 index 7d3ac53e3b..0000000000 --- a/mail/mail-mt.c +++ /dev/null @@ -1,982 +0,0 @@ -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <stdio.h> -#include <string.h> -#include <unistd.h> -#include <pthread.h> -#include <errno.h> - -#include <glib.h> - -#include <gtk/gtkmain.h> -#include <gtk/gtkwidget.h> -#include <gtk/gtkdialog.h> -#include <gtk/gtkstock.h> -#include <libgnome/gnome-i18n.h> -#include <gal/widgets/e-gui-utils.h> - -#include "e-util/e-msgport.h" -#include "camel/camel-operation.h" - -#include "e-activity-handler.h" - -#include "mail-config.h" -#include "camel/camel-url.h" -#include "mail-component.h" -#include "mail-session.h" -#include "mail-mt.h" - -/*#define MALLOC_CHECK*/ -#define LOG_OPS -#define LOG_LOCKS -#define d(x) - -static void set_stop(int sensitive); -static void mail_operation_status(struct _CamelOperation *op, const char *what, int pc, void *data); - -#ifdef LOG_LOCKS -#define MAIL_MT_LOCK(x) (log_locks?fprintf(log, "%ld: lock " # x "\n", pthread_self()):0, pthread_mutex_lock(&x)) -#define MAIL_MT_UNLOCK(x) (log_locks?fprintf(log, "%ld: unlock " # x "\n", pthread_self()): 0, pthread_mutex_unlock(&x)) -#else -#define MAIL_MT_LOCK(x) pthread_mutex_lock(&x) -#define MAIL_MT_UNLOCK(x) pthread_mutex_unlock(&x) -#endif - -/* background operation status stuff */ -struct _mail_msg_priv { - int activity_state; /* sigh sigh sigh, we need to keep track of the state external to the - pointer itself for locking/race conditions */ - int activity_id; -}; - -/* This is used for the mail status bar, cheap and easy */ -#include "art/mail-new.xpm" - -static GdkPixbuf *progress_icon = NULL; - -/* mail_msg stuff */ -#ifdef LOG_OPS -static FILE *log; -static int log_ops, log_locks, log_init; -#endif - -static unsigned int mail_msg_seq; /* sequence number of each message */ -static GHashTable *mail_msg_active_table; /* table of active messages, must hold mail_msg_lock to access */ -static pthread_mutex_t mail_msg_lock = PTHREAD_MUTEX_INITIALIZER; -static pthread_cond_t mail_msg_cond = PTHREAD_COND_INITIALIZER; - -pthread_t mail_gui_thread; - -MailAsyncEvent *mail_async_event; - -static void mail_msg_destroy(EThread *e, EMsg *msg, void *data); - -void *mail_msg_new(mail_msg_op_t *ops, EMsgPort *reply_port, size_t size) -{ - struct _mail_msg *msg; - - MAIL_MT_LOCK(mail_msg_lock); - -#if defined(LOG_OPS) || defined(LOG_LOCKS) - if (!log_init) { - time_t now = time(0); - - log_init = TRUE; - log_ops = getenv("EVOLUTION_MAIL_LOG_OPS") != NULL; - log_locks = getenv("EVOLUTION_MAIL_LOG_LOCKS") != NULL; - if (log_ops || log_locks) { - log = fopen("evolution-mail-ops.log", "w+"); - if (log) { - setvbuf(log, NULL, _IOLBF, 0); - fprintf(log, "Started evolution-mail: %s\n", ctime(&now)); - g_warning("Logging mail operations to evolution-mail-ops.log"); - - if (log_ops) - fprintf(log, "Logging async operations\n"); - - if (log_locks) { - fprintf(log, "Logging lock operations, mail_gui_thread = %ld\n\n", mail_gui_thread); - fprintf(log, "%ld: lock mail_msg_lock\n", pthread_self()); - } - } else { - g_warning ("Could not open log file: %s", strerror(errno)); - log_ops = log_locks = FALSE; - } - } - } -#endif - msg = g_malloc0(size); - msg->ops = ops; - msg->seq = mail_msg_seq++; - msg->msg.reply_port = reply_port; - msg->cancel = camel_operation_new(mail_operation_status, GINT_TO_POINTER(msg->seq)); - camel_exception_init(&msg->ex); - msg->priv = g_malloc0(sizeof(*msg->priv)); - - g_hash_table_insert(mail_msg_active_table, GINT_TO_POINTER(msg->seq), msg); - - d(printf("New message %p\n", msg)); - -#ifdef LOG_OPS - if (log_ops) - fprintf(log, "%p: New\n", msg); -#endif - MAIL_MT_UNLOCK(mail_msg_lock); - - return msg; -} - - -static void end_event_callback (CamelObject *o, void *event_data, void *data) -{ - EActivityHandler *activity_handler = mail_component_peek_activity_handler (mail_component_peek ()); - guint activity_id = GPOINTER_TO_INT (event_data); - - e_activity_handler_operation_finished (activity_handler, activity_id); -} - - -#ifdef MALLOC_CHECK -#include <mcheck.h> - -static void -checkmem(void *p) -{ - if (p) { - int status = mprobe(p); - - switch (status) { - case MCHECK_HEAD: - printf("Memory underrun at %p\n", p); - abort(); - case MCHECK_TAIL: - printf("Memory overrun at %p\n", p); - abort(); - case MCHECK_FREE: - printf("Double free %p\n", p); - abort(); - } - } -} -#endif - -void mail_msg_free(void *msg) -{ - struct _mail_msg *m = msg; - int activity_id; - -#ifdef MALLOC_CHECK - checkmem(m); - checkmem(m->cancel); - checkmem(m->priv); -#endif - d(printf("Free message %p\n", msg)); - - if (m->ops->destroy_msg) - m->ops->destroy_msg(m); - - MAIL_MT_LOCK(mail_msg_lock); - -#ifdef LOG_OPS - if (log_ops) - fprintf(log, "%p: Free (exception `%s')\n", msg, - camel_exception_get_description(&m->ex)?camel_exception_get_description(&m->ex):"None"); -#endif - g_hash_table_remove(mail_msg_active_table, GINT_TO_POINTER(m->seq)); - pthread_cond_broadcast(&mail_msg_cond); - - /* We need to make sure we dont lose a reference here YUCK YUCK */ - /* This is tightly integrated with the code in do_op_status, - as it closely relates to the CamelOperation setup in msg_new() above */ - if (m->priv->activity_state == 1) { - m->priv->activity_state = 3; /* tell the other thread - * to free it itself (yuck yuck) */ - MAIL_MT_UNLOCK(mail_msg_lock); - return; - } else { - activity_id = m->priv->activity_id; - } - - MAIL_MT_UNLOCK(mail_msg_lock); - - if (m->cancel) { - camel_operation_mute(m->cancel); - camel_operation_unref(m->cancel); - } - - camel_exception_clear(&m->ex); - /*g_free(m->priv->what);*/ - g_free(m->priv); - g_free(m); - - if (activity_id != 0) - mail_async_event_emit(mail_async_event, MAIL_ASYNC_GUI, (MailAsyncFunc) end_event_callback, - NULL, GINT_TO_POINTER (activity_id), NULL); -} - -/* hash table of ops->dialogue of active errors */ -static GHashTable *active_errors = NULL; - -static void error_destroy(GtkObject *o, void *data) -{ - g_hash_table_remove(active_errors, data); -} - -static void error_response(GtkObject *o, int button, void *data) -{ - gtk_widget_destroy((GtkWidget *)o); -} - -void mail_msg_check_error(void *msg) -{ - struct _mail_msg *m = msg; - char *what = NULL; - char *text; - GtkDialog *gd; - -#ifdef MALLOC_CHECK - checkmem(m); - checkmem(m->cancel); - checkmem(m->priv); -#endif - - /* don't report any errors if we are not in interactive mode */ - if (!mail_session_get_interactive ()) - return; - - if (!camel_exception_is_set(&m->ex) - || m->ex.id == CAMEL_EXCEPTION_USER_CANCEL) - return; - - if (active_errors == NULL) - active_errors = g_hash_table_new(NULL, NULL); - - if (m->ops->describe_msg) - what = m->ops->describe_msg(m, FALSE); - - if (what) { - text = g_strdup_printf(_("Error while '%s':\n%s"), what, camel_exception_get_description(&m->ex)); - g_free (what); - } else - text = g_strdup_printf(_("Error while performing operation:\n%s"), camel_exception_get_description(&m->ex)); - - /* check to see if we have dialogue already running for this operation */ - /* we key on the operation pointer, which is at least accurate enough - for the operation type, although it could be on a different object. */ - if (g_hash_table_lookup(active_errors, m->ops)) { - g_warning("Error occured while existing dialogue active:\n%s", text); - g_free(text); - return; - } - - gd = (GtkDialog *)gtk_message_dialog_new(NULL, 0, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, "%s", text); - g_hash_table_insert(active_errors, m->ops, gd); - g_signal_connect(gd, "response", G_CALLBACK(error_response), m->ops); - g_signal_connect(gd, "destroy", G_CALLBACK(error_destroy), m->ops); - gtk_widget_show((GtkWidget *)gd); - g_free (text); -} - -void mail_msg_cancel(unsigned int msgid) -{ - struct _mail_msg *m; - - MAIL_MT_LOCK(mail_msg_lock); - m = g_hash_table_lookup(mail_msg_active_table, GINT_TO_POINTER(msgid)); - - if (m && m->cancel) - camel_operation_cancel(m->cancel); - - MAIL_MT_UNLOCK(mail_msg_lock); -} - - -/* waits for a message to be finished processing (freed) - the messageid is from struct _mail_msg->seq */ -void mail_msg_wait(unsigned int msgid) -{ - struct _mail_msg *m; - int ismain = pthread_self() == mail_gui_thread; - - if (ismain) { - MAIL_MT_LOCK(mail_msg_lock); - m = g_hash_table_lookup(mail_msg_active_table, GINT_TO_POINTER(msgid)); - while (m) { - MAIL_MT_UNLOCK(mail_msg_lock); - gtk_main_iteration(); - MAIL_MT_LOCK(mail_msg_lock); - m = g_hash_table_lookup(mail_msg_active_table, GINT_TO_POINTER(msgid)); - } - MAIL_MT_UNLOCK(mail_msg_lock); - } else { - MAIL_MT_LOCK(mail_msg_lock); - m = g_hash_table_lookup(mail_msg_active_table, GINT_TO_POINTER(msgid)); - while (m) { - pthread_cond_wait(&mail_msg_cond, &mail_msg_lock); - m = g_hash_table_lookup(mail_msg_active_table, GINT_TO_POINTER(msgid)); - } - MAIL_MT_UNLOCK(mail_msg_lock); - } -} - -int mail_msg_active(unsigned int msgid) -{ - int active; - - MAIL_MT_LOCK(mail_msg_lock); - if (msgid == (unsigned int)-1) - active = g_hash_table_size(mail_msg_active_table) > 0; - else - active = g_hash_table_lookup(mail_msg_active_table, GINT_TO_POINTER(msgid)) != NULL; - MAIL_MT_UNLOCK(mail_msg_lock); - - return active; -} - -void mail_msg_wait_all(void) -{ - int ismain = pthread_self() == mail_gui_thread; - - if (ismain) { - MAIL_MT_LOCK(mail_msg_lock); - while (g_hash_table_size(mail_msg_active_table) > 0) { - MAIL_MT_UNLOCK(mail_msg_lock); - gtk_main_iteration(); - MAIL_MT_LOCK(mail_msg_lock); - } - MAIL_MT_UNLOCK(mail_msg_lock); - } else { - MAIL_MT_LOCK(mail_msg_lock); - while (g_hash_table_size(mail_msg_active_table) > 0) { - pthread_cond_wait(&mail_msg_cond, &mail_msg_lock); - } - MAIL_MT_UNLOCK(mail_msg_lock); - } -} - -EMsgPort *mail_gui_port; -static GIOChannel *mail_gui_channel; -static guint mail_gui_watch; - -/* TODO: Merge these, gui_port2 doesn't do any mail_msg processing on the request (replies, forwards, frees) */ -EMsgPort *mail_gui_port2; -static GIOChannel *mail_gui_channel2; -static guint mail_gui_watch2; - -EMsgPort *mail_gui_reply_port; -static GIOChannel *mail_gui_reply_channel; - -/* a couple of global threads available */ -EThread *mail_thread_queued; /* for operations that can (or should) be queued */ -EThread *mail_thread_queued_slow; /* for operations that can (or should) be queued, but take a long time */ -EThread *mail_thread_new; /* for operations that should run in a new thread each time */ - -static gboolean -mail_msgport_replied(GIOChannel *source, GIOCondition cond, void *d) -{ - EMsgPort *port = (EMsgPort *)d; - mail_msg_t *m; - - while (( m = (mail_msg_t *)e_msgport_get(port))) { - -#ifdef MALLOC_CHECK - checkmem(m); - checkmem(m->cancel); - checkmem(m->priv); -#endif - -#ifdef LOG_OPS - if (log_ops) - fprintf(log, "%p: Replied to GUI thread (exception `%s'\n", m, - camel_exception_get_description(&m->ex)?camel_exception_get_description(&m->ex):"None"); -#endif - - if (m->ops->reply_msg) - m->ops->reply_msg(m); - mail_msg_check_error(m); - mail_msg_free(m); - } - - return TRUE; -} - -static gboolean -mail_msgport_received(GIOChannel *source, GIOCondition cond, void *d) -{ - EMsgPort *port = (EMsgPort *)d; - mail_msg_t *m; - - while (( m = (mail_msg_t *)e_msgport_get(port))) { -#ifdef MALLOC_CHECK - checkmem(m); - checkmem(m->cancel); - checkmem(m->priv); -#endif - -#ifdef LOG_OPS - if (log_ops) - fprintf(log, "%p: Received at GUI thread\n", m); -#endif - - if (m->ops->receive_msg) - m->ops->receive_msg(m); - if (m->msg.reply_port) - e_msgport_reply((EMsg *)m); - else { - if (m->ops->reply_msg) - m->ops->reply_msg(m); - mail_msg_free(m); - } - } - - return TRUE; -} - -/* Test code, lighterwight, more configurable calls */ -static gboolean -mail_msgport_received2(GIOChannel *source, GIOCondition cond, void *d) -{ - EMsgPort *port = (EMsgPort *)d; - mail_msg_t *m; - - while (( m = (mail_msg_t *)e_msgport_get(port))) { -#ifdef LOG_OPS - if (log_ops) - fprintf(log, "%p: Received at GUI2 thread\n", m); -#endif - - if (m->ops->receive_msg) - m->ops->receive_msg(m); - else - mail_msg_free(m); - } - - return TRUE; -} - - -static void -mail_msg_destroy(EThread *e, EMsg *msg, void *data) -{ - mail_msg_t *m = (mail_msg_t *)msg; - -#ifdef MALLOC_CHECK - checkmem(m); - checkmem(m->cancel); - checkmem(m->priv); -#endif - - mail_msg_free(m); -} - -static void -mail_msg_received(EThread *e, EMsg *msg, void *data) -{ - mail_msg_t *m = (mail_msg_t *)msg; - -#ifdef MALLOC_CHECK - checkmem(m); - checkmem(m->cancel); - checkmem(m->priv); -#endif - - if (m->ops->describe_msg) { - char *text = m->ops->describe_msg(m, FALSE); - -#ifdef LOG_OPS - if (log_ops) - fprintf(log, "%p: Received at thread %ld: '%s'\n", m, pthread_self(), text); -#endif - - d(printf("message received at thread\n")); - camel_operation_register(m->cancel); - camel_operation_start(m->cancel, "%s", text); - g_free(text); - } -#ifdef LOG_OPS - else - if (log_ops) - fprintf(log, "%p: Received at thread %ld\n", m, pthread_self()); -#endif - - if (m->ops->receive_msg) { - mail_enable_stop(); - m->ops->receive_msg(m); - mail_disable_stop(); - } - - if (m->ops->describe_msg) { - camel_operation_end(m->cancel); - camel_operation_unregister(m->cancel); - MAIL_MT_LOCK(mail_msg_lock); - camel_operation_unref(m->cancel); - m->cancel = NULL; - MAIL_MT_UNLOCK(mail_msg_lock); - } -} - -void mail_msg_cleanup(void) -{ - mail_msg_wait_all(); - - e_thread_destroy(mail_thread_queued_slow); - e_thread_destroy(mail_thread_queued); - e_thread_destroy(mail_thread_new); - - g_io_channel_unref(mail_gui_channel); - g_io_channel_unref(mail_gui_reply_channel); - - e_msgport_destroy(mail_gui_port); - e_msgport_destroy(mail_gui_reply_port); -} - -static guint -em_channel_setup(EMsgPort **port, GIOChannel **channel, GIOFunc func) -{ - GSource *source; - guint id; - - *port = e_msgport_new(); - *channel = g_io_channel_unix_new(e_msgport_fd(*port)); - source = g_io_create_watch(*channel, G_IO_IN); - g_source_set_callback(source, (GSourceFunc)func, *port, NULL); - g_source_set_can_recurse(source, FALSE); - id = g_source_attach(source, NULL); - g_source_unref(source); - - return id; -} - -void mail_msg_init(void) -{ - em_channel_setup(&mail_gui_reply_port, &mail_gui_reply_channel, mail_msgport_replied); - mail_gui_watch = em_channel_setup(&mail_gui_port, &mail_gui_channel, mail_msgport_received); - mail_gui_watch2 = em_channel_setup(&mail_gui_port2, &mail_gui_channel2, mail_msgport_received2); - - mail_thread_queued = e_thread_new(E_THREAD_QUEUE); - e_thread_set_msg_destroy(mail_thread_queued, mail_msg_destroy, 0); - e_thread_set_msg_received(mail_thread_queued, mail_msg_received, 0); - e_thread_set_reply_port(mail_thread_queued, mail_gui_reply_port); - - mail_thread_queued_slow = e_thread_new(E_THREAD_QUEUE); - e_thread_set_msg_destroy(mail_thread_queued_slow, mail_msg_destroy, 0); - e_thread_set_msg_received(mail_thread_queued_slow, mail_msg_received, 0); - e_thread_set_reply_port(mail_thread_queued_slow, mail_gui_reply_port); - - mail_thread_new = e_thread_new(E_THREAD_NEW); - e_thread_set_msg_destroy(mail_thread_new, mail_msg_destroy, 0); - e_thread_set_msg_received(mail_thread_new, mail_msg_received, 0); - e_thread_set_reply_port(mail_thread_new, mail_gui_reply_port); - e_thread_set_queue_limit(mail_thread_new, 10); - - mail_msg_active_table = g_hash_table_new(NULL, NULL); - mail_gui_thread = pthread_self(); - - mail_async_event = mail_async_event_new(); -} - -/* ********************************************************************** */ - -/* locks */ -static pthread_mutex_t status_lock = PTHREAD_MUTEX_INITIALIZER; - -/* ********************************************************************** */ - -struct _proxy_msg { - struct _mail_msg msg; - MailAsyncEvent *ea; - mail_async_event_t type; - - pthread_t thread; - - MailAsyncFunc func; - void *o; - void *event_data; - void *data; -}; - -static void -do_async_event(struct _mail_msg *mm) -{ - struct _proxy_msg *m = (struct _proxy_msg *)mm; - - m->thread = pthread_self(); - m->func(m->o, m->event_data, m->data); - m->thread = ~0; - - g_mutex_lock(m->ea->lock); - m->ea->tasks = g_slist_remove(m->ea->tasks, m); - g_mutex_unlock(m->ea->lock); -} - -static int -idle_async_event(void *mm) -{ - do_async_event(mm); - mail_msg_free(mm); - - return FALSE; -} - -struct _mail_msg_op async_event_op = { - NULL, - do_async_event, - NULL, - NULL, -}; - -MailAsyncEvent *mail_async_event_new(void) -{ - MailAsyncEvent *ea; - - ea = g_malloc0(sizeof(*ea)); - ea->lock = g_mutex_new(); - - return ea; -} - -int mail_async_event_emit(MailAsyncEvent *ea, mail_async_event_t type, MailAsyncFunc func, void *o, void *event_data, void *data) -{ - struct _proxy_msg *m; - int id; - int ismain = pthread_self() == mail_gui_thread; - - /* we dont have a reply port for this, we dont care when/if it gets executed, just queue it */ - m = mail_msg_new(&async_event_op, NULL, sizeof(*m)); - m->func = func; - m->o = o; - m->event_data = event_data; - m->data = data; - m->ea = ea; - m->type = type; - m->thread = ~0; - - id = m->msg.seq; - g_mutex_lock(ea->lock); - ea->tasks = g_slist_prepend(ea->tasks, m); - g_mutex_unlock(ea->lock); - - /* We use an idle function instead of our own message port only because the - gui message ports's notification buffer might overflow and deadlock us */ - if (type == MAIL_ASYNC_GUI) { - if (ismain) - g_idle_add(idle_async_event, m); - else - e_msgport_put(mail_gui_port, (EMsg *)m); - } else - e_thread_put(mail_thread_queued, (EMsg *)m); - - return id; -} - -int mail_async_event_destroy(MailAsyncEvent *ea) -{ - int id; - pthread_t thread = pthread_self(); - struct _proxy_msg *m; - - g_mutex_lock(ea->lock); - while (ea->tasks) { - m = ea->tasks->data; - id = m->msg.seq; - if (m->thread == thread) { - g_warning("Destroying async event from inside an event, returning EDEADLK"); - g_mutex_unlock(ea->lock); - errno = EDEADLK; - return -1; - } - g_mutex_unlock(ea->lock); - mail_msg_wait(id); - g_mutex_lock(ea->lock); - } - g_mutex_unlock(ea->lock); - - g_mutex_free(ea->lock); - g_free(ea); - - return 0; -} - -/* ********************************************************************** */ - -struct _call_msg { - struct _mail_msg msg; - mail_call_t type; - MailMainFunc func; - void *ret; - va_list ap; -}; - -static void -do_call(struct _mail_msg *mm) -{ - struct _call_msg *m = (struct _call_msg *)mm; - void *p1, *p2, *p3, *p4, *p5; - int i1; - va_list ap; - - G_VA_COPY(ap, m->ap); - - switch(m->type) { - case MAIL_CALL_p_p: - p1 = va_arg(ap, void *); - m->ret = m->func(p1); - break; - case MAIL_CALL_p_pp: - p1 = va_arg(ap, void *); - p2 = va_arg(ap, void *); - m->ret = m->func(p1, p2); - break; - case MAIL_CALL_p_ppp: - p1 = va_arg(ap, void *); - p2 = va_arg(ap, void *); - p3 = va_arg(ap, void *); - m->ret = m->func(p1, p2, p3); - break; - case MAIL_CALL_p_pppp: - p1 = va_arg(ap, void *); - p2 = va_arg(ap, void *); - p3 = va_arg(ap, void *); - p4 = va_arg(ap, void *); - m->ret = m->func(p1, p2, p3, p4); - break; - case MAIL_CALL_p_ppippp: - p1 = va_arg(ap, void *); - p2 = va_arg(ap, void *); - i1 = va_arg(ap, int); - p3 = va_arg(ap, void *); - p4 = va_arg(ap, void *); - p5 = va_arg(ap, void *); - m->ret = m->func(p1, p2, i1, p3, p4, p5); - break; - } -} - -struct _mail_msg_op mail_call_op = { - NULL, - do_call, - NULL, - NULL, -}; - -void *mail_call_main(mail_call_t type, MailMainFunc func, ...) -{ - struct _call_msg *m; - void *ret; - va_list ap; - EMsgPort *reply = NULL; - int ismain = pthread_self() == mail_gui_thread; - - va_start(ap, func); - - if (!ismain) - reply = e_msgport_new(); - - m = mail_msg_new(&mail_call_op, reply, sizeof(*m)); - m->type = type; - m->func = func; - G_VA_COPY(m->ap, ap); - - if (!ismain) { - e_msgport_put(mail_gui_port, (EMsg *)m); - e_msgport_wait(reply); - e_msgport_destroy(reply); - } else { - do_call(&m->msg); - } - - va_end(ap); - - ret = m->ret; - mail_msg_free(m); - - return ret; -} - -/* ********************************************************************** */ -/* locked via status_lock */ -static int busy_state; - -static void do_set_busy(struct _mail_msg *mm) -{ - set_stop(busy_state > 0); -} - -struct _mail_msg_op set_busy_op = { - NULL, - do_set_busy, - NULL, - NULL, -}; - -void mail_enable_stop(void) -{ - struct _mail_msg *m; - - MAIL_MT_LOCK(status_lock); - busy_state++; - if (busy_state == 1) { - m = mail_msg_new(&set_busy_op, NULL, sizeof(*m)); - e_msgport_put(mail_gui_port, (EMsg *)m); - } - MAIL_MT_UNLOCK(status_lock); -} - -void mail_disable_stop(void) -{ - struct _mail_msg *m; - - MAIL_MT_LOCK(status_lock); - busy_state--; - if (busy_state == 0) { - m = mail_msg_new(&set_busy_op, NULL, sizeof(*m)); - e_msgport_put(mail_gui_port, (EMsg *)m); - } - MAIL_MT_UNLOCK(status_lock); -} - -/* ******************************************************************************** */ - -struct _op_status_msg { - struct _mail_msg msg; - - struct _CamelOperation *op; - char *what; - int pc; - void *data; -}; - -static void do_op_status(struct _mail_msg *mm) -{ - EActivityHandler *activity_handler = mail_component_peek_activity_handler (mail_component_peek ()); - struct _op_status_msg *m = (struct _op_status_msg *)mm; - struct _mail_msg *msg; - struct _mail_msg_priv *data; - char *out, *p, *o, c; - int pc; - - g_assert (mail_gui_thread == pthread_self ()); - - MAIL_MT_LOCK (mail_msg_lock); - - msg = g_hash_table_lookup (mail_msg_active_table, m->data); - - if (msg == NULL) { - MAIL_MT_UNLOCK (mail_msg_lock); - return; - } - - data = msg->priv; - - out = alloca (strlen (m->what) * 2 + 1); - o = out; - p = m->what; - while ((c = *p++)) { - if (c == '%') - *o++ = '%'; - *o++ = c; - } - *o = 0; - - pc = m->pc; - - if (data->activity_id == 0) { - char *what; - int display; - - /* its being created/removed? well leave it be */ - if (data->activity_state == 1 || data->activity_state == 3) { - MAIL_MT_UNLOCK (mail_msg_lock); - return; - } else { - data->activity_state = 1; - - if (progress_icon == NULL) - progress_icon = gdk_pixbuf_new_from_xpm_data ((const char **)mail_new_xpm); - - MAIL_MT_UNLOCK (mail_msg_lock); - if (msg->ops->describe_msg) - what = msg->ops->describe_msg (msg, FALSE); - else - what = _("Working"); - - data->activity_id = e_activity_handler_operation_started (activity_handler, "evolution-mail", progress_icon, what, TRUE); - - if (msg->ops->describe_msg) - g_free (what); - - MAIL_MT_LOCK (mail_msg_lock); - if (data->activity_state == 3) { - MAIL_MT_UNLOCK (mail_msg_lock); - if (msg->cancel) - camel_operation_unref (msg->cancel); - camel_exception_clear (&msg->ex); - g_free (msg->priv); - g_free (msg); - } else { - data->activity_state = 2; - MAIL_MT_UNLOCK (mail_msg_lock); - } - return; - } - } else if (data->activity_id != 0) { - MAIL_MT_UNLOCK (mail_msg_lock); - e_activity_handler_operation_progressing (activity_handler, data->activity_id, out, (double)(pc/100.0)); - } else { - MAIL_MT_UNLOCK (mail_msg_lock); - } -} - -static void -do_op_status_free (struct _mail_msg *mm) -{ - struct _op_status_msg *m = (struct _op_status_msg *)mm; - - g_free (m->what); -} - -struct _mail_msg_op op_status_op = { - NULL, - do_op_status, - NULL, - do_op_status_free, -}; - -static void -mail_operation_status (struct _CamelOperation *op, const char *what, int pc, void *data) -{ - struct _op_status_msg *m; - - d(printf("got operation statys: %s %d%%\n", what, pc)); - - m = mail_msg_new(&op_status_op, NULL, sizeof(*m)); - m->op = op; - m->what = g_strdup(what); - switch (pc) { - case CAMEL_OPERATION_START: - pc = 0; - break; - case CAMEL_OPERATION_END: - pc = 100; - break; - } - m->pc = pc; - m->data = data; - e_msgport_put(mail_gui_port, (EMsg *)m); -} - -/* ******************** */ - -static void -set_stop (int sensitive) -{ - static int last = FALSE; - - if (last == sensitive) - return; - - /*bonobo_ui_component_set_prop (uic, "/commands/MailStop", "sensitive", sensitive ? "1" : "0", NULL);*/ - last = sensitive; -} diff --git a/mail/mail-mt.h b/mail/mail-mt.h deleted file mode 100644 index 11a7166d74..0000000000 --- a/mail/mail-mt.h +++ /dev/null @@ -1,126 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- - * - * Authors: Michael Zucchi <notzed@ximian.com> - * - * Copyright 2000, Ximian, Inc. (www.ximian.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public - * License as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - * - */ - -#ifndef _MAIL_MT -#define _MAIL_MT - -#include <pthread.h> -#include "camel/camel-exception.h" -#include "e-util/e-msgport.h" -#include "camel/camel-object.h" -#include "camel/camel-operation.h" - -typedef struct _mail_msg { - EMsg msg; /* parent type */ - struct _mail_msg_op *ops; /* operation functions */ - unsigned int seq; /* seq number for synchronisation */ - CamelOperation *cancel; /* a cancellation/status handle */ - CamelException ex; /* an initialised camel exception, upto the caller to use this */ - struct _mail_msg_priv *priv; /* private for internal use */ -} mail_msg_t; - -/* callback functions for thread message */ -typedef struct _mail_msg_op { - char *(*describe_msg)(struct _mail_msg *msg, int complete); - - void (*receive_msg)(struct _mail_msg *msg); /* message received */ - void (*reply_msg)(struct _mail_msg *msg); /* message replied */ - void (*destroy_msg)(struct _mail_msg *msg); /* finalise message */ -} mail_msg_op_t; - -/* setup ports */ -void mail_msg_init(void); -void mail_msg_cleanup (void); - -/* allocate a new message */ -void *mail_msg_new(mail_msg_op_t *ops, EMsgPort *reply_port, size_t size); -void mail_msg_free(void *msg); -void mail_msg_check_error(void *msg); -void mail_msg_cancel(unsigned int msgid); -void mail_msg_wait(unsigned int msgid); -void mail_msg_wait_all(void); -int mail_msg_active(unsigned int msgid); - -/* request a string/password */ -char *mail_get_password (CamelService *service, const char *prompt, - gboolean secret, gboolean *cache); - -/* present information and get an ok (or possibly cancel) - * "type" is as for gnome_message_box_new(); - */ -gboolean mail_user_message (const char *type, const char *prompt, gboolean allow_cancel); - -/* asynchronous event proxies */ -typedef struct _MailAsyncEvent { - GMutex *lock; - GSList *tasks; -} MailAsyncEvent; - -typedef enum _mail_async_event_t { - MAIL_ASYNC_GUI, - MAIL_ASYNC_THREAD, -} mail_async_event_t; - -typedef void (*MailAsyncFunc)(void *, void *, void *); - -/* create a new async event handler */ -MailAsyncEvent *mail_async_event_new(void); -/* forward a camel event (or other call) to the gui thread */ -int mail_async_event_emit(MailAsyncEvent *ea, mail_async_event_t type, MailAsyncFunc func, void *, void *, void *); -/* wait for all outstanding async events to complete */ -int mail_async_event_destroy(MailAsyncEvent *ea); - -/* Call a function in the gui thread, wait for it to return, type is the marshaller to use */ -typedef enum { - MAIL_CALL_p_p, - MAIL_CALL_p_pp, - MAIL_CALL_p_ppp, - MAIL_CALL_p_pppp, - MAIL_CALL_p_ppippp, -} mail_call_t; - -typedef void *(*MailMainFunc)(); - -void *mail_call_main(mail_call_t type, MailMainFunc func, ...); - -/* use with caution. only works with active message's anyway */ -void mail_enable_stop(void); -void mail_disable_stop(void); - -/* a message port that receives messages in the gui thread, used for sending port */ -extern EMsgPort *mail_gui_port; -/* a message port that receives messages in the gui thread, used for the reply port */ -extern EMsgPort *mail_gui_reply_port; - -/* some globally available threads */ -extern EThread *mail_thread_queued; /* for operations that can (or should) be queued */ -extern EThread *mail_thread_new; /* for operations that should run in a new thread each time */ -extern EThread *mail_thread_queued_slow; /* for operations that can (or should) be queued, but take a long time */ - -/* The main thread. */ -extern pthread_t mail_gui_thread; - -/* A generic proxy event for anything that can be proxied during the life of the mailer (almost nothing) */ -/* Note that almost all objects care about the lifecycle of their events, so this cannot be used */ -extern MailAsyncEvent *mail_async_event; - -#endif /* ! _MAIL_MT */ diff --git a/mail/mail-offline-handler.c b/mail/mail-offline-handler.c deleted file mode 100644 index 6613391a7b..0000000000 --- a/mail/mail-offline-handler.c +++ /dev/null @@ -1,258 +0,0 @@ -/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ -/* mail-offline-handler.c - * - * Copyright (C) 2001 Ximian, Inc. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public - * License as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - * - * Authors: - * Ettore Perazzoli <ettore@ximian.com> - * Dan Winship <danw@ximian.com> - */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include "mail-offline-handler.h" -#include "mail-component.h" -#include "mail-ops.h" -#include "mail-folder-cache.h" -#include "mail.h" - -#include <gtk/gtkmain.h> - -#include <gal/util/e-util.h> - - -#define PARENT_TYPE bonobo_object_get_type () -static BonoboObjectClass *parent_class = NULL; - -struct _MailOfflineHandlerPrivate { - GHashTable *sync_table; -}; - -static gboolean -service_is_relevant (CamelService *service, gboolean going_offline) -{ - if (!(service->provider->flags & CAMEL_PROVIDER_IS_REMOTE) || - (service->provider->flags & CAMEL_PROVIDER_IS_EXTERNAL)) - return FALSE; - - if (CAMEL_IS_DISCO_STORE (service) && - camel_disco_store_status (CAMEL_DISCO_STORE (service)) == CAMEL_DISCO_STORE_OFFLINE) - return !going_offline; - - return service->status != CAMEL_SERVICE_DISCONNECTED; -} - -static void -add_connection (gpointer key, gpointer value, gpointer user_data) -{ - CamelService *service = key; - GNOME_Evolution_ConnectionList *list = user_data; - - if (!service_is_relevant (service, TRUE)) - return; - - list->_buffer[list->_length].hostName = CORBA_string_dup (service->url->host); - list->_buffer[list->_length].type = CORBA_string_dup (service->provider->name); - list->_length++; -} - -static GNOME_Evolution_ConnectionList * -create_connection_list (void) -{ - GNOME_Evolution_ConnectionList *list; - - list = GNOME_Evolution_ConnectionList__alloc (); - list->_length = 0; - list->_maximum = mail_component_get_store_count (mail_component_peek ()); - list->_buffer = CORBA_sequence_GNOME_Evolution_Connection_allocbuf (list->_maximum); - - mail_component_stores_foreach (mail_component_peek (), add_connection, list); - - return list; -} - -/* GNOME::Evolution::Offline methods. */ - -static CORBA_boolean -impl__get_isOffline (PortableServer_Servant servant, - CORBA_Environment *ev) -{ - return !camel_session_is_online (session); -} - -static void -impl_prepareForOffline (PortableServer_Servant servant, - GNOME_Evolution_ConnectionList **active_connection_list, - CORBA_Environment *ev) -{ - MailOfflineHandler *offline_handler; - MailOfflineHandlerPrivate *priv; - - offline_handler = MAIL_OFFLINE_HANDLER (bonobo_object_from_servant (servant)); - priv = offline_handler->priv; - - *active_connection_list = create_connection_list (); -} - -/* keep track of each sync in progress */ -struct _sync_info { - char *uri; /* uri of folder being synced */ - CamelOperation *cancel; /* progress report/cancellation object */ - int pc; /* percent complete (0-100) */ - int lastpc; /* last percent reported, so we dont overreport */ - int id; /* timeout id */ - GHashTable *table; /* the hashtable that we're registered in */ -}; - -static void -went_offline (CamelStore *store, void *data) -{ - CORBA_Environment ev; - GNOME_Evolution_ConnectionList *connection_list; - GNOME_Evolution_OfflineProgressListener listener = data; - - connection_list = create_connection_list (); - - CORBA_exception_init (&ev); - GNOME_Evolution_OfflineProgressListener_updateProgress(listener, connection_list, &ev); - if (ev._major != CORBA_NO_EXCEPTION) - g_warning ("Error updating offline progress"); - CORBA_Object_release(listener, &ev); - - CORBA_exception_free (&ev); - CORBA_free (connection_list); -} - -static void -store_go_offline (gpointer key, gpointer value, gpointer data) -{ - CamelStore *store = key; - GNOME_Evolution_OfflineProgressListener listener = data; - CORBA_Environment ev; - - CORBA_exception_init(&ev); - if (service_is_relevant (CAMEL_SERVICE (store), TRUE)) { - mail_store_set_offline (store, TRUE, went_offline, CORBA_Object_duplicate(listener, &ev)); - } - CORBA_exception_free(&ev); -} - -static void -impl_goOffline (PortableServer_Servant servant, - const GNOME_Evolution_OfflineProgressListener progress_listener, - CORBA_Environment *ev) -{ - MailOfflineHandler *offline_handler; - - offline_handler = MAIL_OFFLINE_HANDLER (bonobo_object_from_servant (servant)); - - /* This will disable further auto-mail-check action. */ - camel_session_set_online (session, FALSE); - - /* FIXME: If send/receive active, wait for it to finish */ - - mail_component_stores_foreach (mail_component_peek (), store_go_offline, progress_listener); -} - -static void -store_go_online (gpointer key, gpointer value, gpointer data) -{ - CamelStore *store = key; - - if (service_is_relevant (CAMEL_SERVICE (store), FALSE)) { - mail_store_set_offline (store, FALSE, NULL, NULL); - mail_note_store (store, NULL, NULL, NULL); - } -} - -static void -impl_goOnline (PortableServer_Servant servant, - CORBA_Environment *ev) -{ - MailOfflineHandler *offline_handler; - MailOfflineHandlerPrivate *priv; - - offline_handler = MAIL_OFFLINE_HANDLER (bonobo_object_from_servant (servant)); - priv = offline_handler->priv; - - /* Enable auto-mail-checking */ - camel_session_set_online (session, TRUE); - - mail_component_stores_foreach (mail_component_peek (), store_go_online, NULL); -} - -/* GObject methods. */ - -static void -impl_finalise (GObject *object) -{ - MailOfflineHandler *offline_handler; - MailOfflineHandlerPrivate *priv; - - offline_handler = MAIL_OFFLINE_HANDLER (object); - priv = offline_handler->priv; - g_hash_table_destroy(priv->sync_table); - g_free (priv); - - if (G_OBJECT_CLASS (parent_class)->finalize != NULL) - (* G_OBJECT_CLASS (parent_class)->finalize) (object); -} - -/* GTK+ type initialization. */ - -static void -mail_offline_handler_class_init (MailOfflineHandlerClass *klass) -{ - GObjectClass *object_class; - POA_GNOME_Evolution_Offline__epv *epv; - - object_class = G_OBJECT_CLASS (klass); - object_class->finalize = impl_finalise; - - epv = & klass->epv; - epv->_get_isOffline = impl__get_isOffline; - epv->prepareForOffline = impl_prepareForOffline; - epv->goOffline = impl_goOffline; - epv->goOnline = impl_goOnline; - - parent_class = g_type_class_ref(PARENT_TYPE); -} - -static void -mail_offline_handler_init (MailOfflineHandler *offline_handler) -{ - MailOfflineHandlerPrivate *priv; - - priv = g_new (MailOfflineHandlerPrivate, 1); - priv->sync_table = g_hash_table_new(g_str_hash, g_str_equal); - - offline_handler->priv = priv; -} - -MailOfflineHandler * -mail_offline_handler_new (void) -{ - MailOfflineHandler *new; - - new = g_object_new(mail_offline_handler_get_type (), NULL); - - return new; -} - -BONOBO_TYPE_FUNC_FULL (MailOfflineHandler, GNOME_Evolution_Offline, PARENT_TYPE, mail_offline_handler); diff --git a/mail/mail-offline-handler.h b/mail/mail-offline-handler.h deleted file mode 100644 index 4e6a811d98..0000000000 --- a/mail/mail-offline-handler.h +++ /dev/null @@ -1,65 +0,0 @@ -/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ -/* mail-offline-handler.h - * - * Copyright (C) 2001 Ximian, Inc. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public - * License as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - * - * Author: Ettore Perazzoli <ettore@ximian.com> - */ - -#ifndef _MAIL_OFFLINE_HANDLER_H_ -#define _MAIL_OFFLINE_HANDLER_H_ - -#include <bonobo/bonobo-object.h> -#include "Evolution.h" - -#ifdef __cplusplus -extern "C" { -#pragma } -#endif /* __cplusplus */ - -#define MAIL_TYPE_OFFLINE_HANDLER (mail_offline_handler_get_type ()) -#define MAIL_OFFLINE_HANDLER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MAIL_TYPE_OFFLINE_HANDLER, MailOfflineHandler)) -#define MAIL_OFFLINE_HANDLER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MAIL_TYPE_OFFLINE_HANDLER, MailOfflineHandlerClass)) -#define MAIL_IS_OFFLINE_HANDLER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MAIL_TYPE_OFFLINE_HANDLER)) -#define MAIL_IS_OFFLINE_HANDLER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), MAIL_TYPE_OFFLINE_HANDLER)) - - -typedef struct _MailOfflineHandler MailOfflineHandler; -typedef struct _MailOfflineHandlerPrivate MailOfflineHandlerPrivate; -typedef struct _MailOfflineHandlerClass MailOfflineHandlerClass; - -struct _MailOfflineHandler { - BonoboObject parent; - - MailOfflineHandlerPrivate *priv; -}; - -struct _MailOfflineHandlerClass { - BonoboObjectClass parent_class; - - POA_GNOME_Evolution_Offline__epv epv; -}; - - -GType mail_offline_handler_get_type (void); -MailOfflineHandler *mail_offline_handler_new (void); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* _MAIL_OFFLINE_HANDLER_H_ */ diff --git a/mail/mail-ops.c b/mail/mail-ops.c deleted file mode 100644 index 1f5e75cb42..0000000000 --- a/mail/mail-ops.c +++ /dev/null @@ -1,2449 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* mail-ops.c: callbacks for the mail toolbar/menus */ - -/* - * Authors: Dan Winship <danw@ximian.com> - * Jeffrey Stedfast <fejj@ximian.com> - * Peter Williams <peterw@ximian.com> - * Michael Zucchi <notzed@ximian.com> - * - * Copyright 2000,2001 Ximian, Inc. (www.ximian.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public - * License as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA - */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -/* #include <ctype.h> */ -#include <string.h> -#include <errno.h> -#include <libgnome/gnome-exec.h> -#include <gal/util/e-util.h> -#include <camel/camel-mime-filter-from.h> -#include <camel/camel-operation.h> -#include <camel/camel-vtrash-folder.h> -#include <camel/camel-vee-store.h> -#include "mail.h" -#include "mail-component.h" -#include "mail-tools.h" -#include "mail-ops.h" -#include "mail-vfolder.h" -#include "mail-session.h" -#include "composer/e-msg-composer.h" - -#include "filter/filter-filter.h" - -#include "mail-mt.h" -#include "mail-folder-cache.h" - -#include "em-utils.h" - -#define w(x) -#define d(x) - -/* used for both just filtering a folder + uid's, and for filtering a whole folder */ -/* used both for fetching mail, and for filtering mail */ -struct _filter_mail_msg { - struct _mail_msg msg; - - CamelFolder *source_folder; /* where they come from */ - GPtrArray *source_uids; /* uids to copy, or NULL == copy all */ - CamelUIDCache *cache; /* UID cache if we are to cache the uids, NULL otherwise */ - CamelOperation *cancel; - CamelFilterDriver *driver; - int delete; /* delete messages after filtering them? */ - CamelFolder *destination; /* default destination for any messages, NULL for none */ -}; - -/* since fetching also filters, we subclass the data here */ -struct _fetch_mail_msg { - struct _filter_mail_msg fmsg; - - CamelOperation *cancel; /* we have our own cancellation struct, the other should be empty */ - int keep; /* keep on server? */ - - char *source_uri; - - void (*done)(char *source, void *data); - void *data; -}; - -static char * -filter_folder_describe (struct _mail_msg *mm, int complete) -{ - return g_strdup (_("Filtering Folder")); -} - -/* filter a folder, or a subset thereof, uses source_folder/source_uids */ -/* this is shared with fetch_mail */ -static void -filter_folder_filter (struct _mail_msg *mm) -{ - struct _filter_mail_msg *m = (struct _filter_mail_msg *)mm; - CamelFolder *folder; - GPtrArray *uids, *folder_uids = NULL; - - if (m->cancel) - camel_operation_register (m->cancel); - - folder = m->source_folder; - - if (folder == NULL || camel_folder_get_message_count (folder) == 0) { - if (m->cancel) - camel_operation_unregister (m->cancel); - return; - } - - if (m->destination) { - camel_folder_freeze (m->destination); - camel_filter_driver_set_default_folder (m->driver, m->destination); - } - - camel_folder_freeze (folder); - - if (m->source_uids) - uids = m->source_uids; - else - folder_uids = uids = camel_folder_get_uids (folder); - - camel_filter_driver_filter_folder (m->driver, folder, m->cache, uids, m->delete, &mm->ex); - camel_filter_driver_flush (m->driver, &mm->ex); - - if (folder_uids) - camel_folder_free_uids (folder, folder_uids); - - /* sync our source folder */ - if (!m->cache) - camel_folder_sync (folder, FALSE, camel_exception_is_set (&mm->ex) ? NULL : &mm->ex); - camel_folder_thaw (folder); - - if (m->destination) - camel_folder_thaw (m->destination); - - /* this may thaw/unref source folders, do it here so we dont do it in the main thread - see also fetch_mail_fetch() below */ - camel_object_unref(m->driver); - m->driver = NULL; - - if (m->cancel) - camel_operation_unregister (m->cancel); -} - -static void -filter_folder_filtered (struct _mail_msg *mm) -{ -} - -static void -filter_folder_free (struct _mail_msg *mm) -{ - struct _filter_mail_msg *m = (struct _filter_mail_msg *)mm; - - if (m->source_folder) - camel_object_unref (m->source_folder); - - if (m->source_uids) - em_utils_uids_free (m->source_uids); - - if (m->cancel) - camel_operation_unref (m->cancel); - - if (m->destination) - camel_object_unref (m->destination); - - if (m->driver) - camel_object_unref (m->driver); - - mail_session_flush_filter_log (); -} - -static struct _mail_msg_op filter_folder_op = { - filter_folder_describe, /* we do our own progress reporting? */ - filter_folder_filter, - filter_folder_filtered, - filter_folder_free, -}; - -void -mail_filter_folder (CamelFolder *source_folder, GPtrArray *uids, - const char *type, gboolean notify, - CamelOperation *cancel) -{ - struct _filter_mail_msg *m; - - m = mail_msg_new (&filter_folder_op, NULL, sizeof (*m)); - m->source_folder = source_folder; - camel_object_ref (source_folder); - m->source_uids = uids; - m->cache = NULL; - m->delete = FALSE; - if (cancel) { - m->cancel = cancel; - camel_operation_ref (cancel); - } - - m->driver = camel_session_get_filter_driver (session, type, NULL); - - if (!notify) { - /* FIXME: have a #define NOTIFY_FILTER_NAME macro? */ - /* the filter name has to stay in sync with mail-session::get_filter_driver */ - camel_filter_driver_remove_rule_by_name (m->driver, "new-mail-notification"); - } - - e_thread_put (mail_thread_new, (EMsg *)m); -} - -/* convenience function for it */ -void -mail_filter_on_demand (CamelFolder *folder, GPtrArray *uids) -{ - mail_filter_folder (folder, uids, FILTER_SOURCE_INCOMING, FALSE, NULL); -} - -/* ********************************************************************** */ - -/* Temporary workaround for various issues. Gone before 0.11 */ -static char * -uid_cachename_hack (CamelStore *store) -{ - CamelURL *url = CAMEL_SERVICE (store)->url; - char *encoded_url, *filename, *old_location; - struct stat st; - - encoded_url = g_strdup_printf ("pop://%s%s%s@%s/", url->user, - url->authmech ? ";auth=" : "", - url->authmech ? url->authmech : "", - url->host); - e_filename_make_safe (encoded_url); - - filename = g_strdup_printf ("%s/mail/pop3/cache-%s", - mail_component_peek_base_directory (mail_component_peek ()), encoded_url); - - /* lame hack, but we can't expect user's to actually migrate - their cache files - brain power requirements are too - high. */ - if (stat (filename, &st) == -1) { - /* This is either the first time the user has checked - mail with this POP provider or else their cache - file is in the old location... */ - old_location = g_strdup_printf ("%s/config/cache-%s", - mail_component_peek_base_directory (mail_component_peek ()), - encoded_url); - if (stat (old_location, &st) == -1) { - /* old location doesn't exist either so use the new location */ - g_free (old_location); - } else { - /* old location exists, so I guess we use the old cache file location */ - g_free (filename); - filename = old_location; - } - } - - g_free (encoded_url); - - return filename; -} - -static char * -fetch_mail_describe (struct _mail_msg *mm, int complete) -{ - return g_strdup (_("Fetching Mail")); -} - -static void -fetch_mail_fetch (struct _mail_msg *mm) -{ - struct _fetch_mail_msg *m = (struct _fetch_mail_msg *)mm; - struct _filter_mail_msg *fm = (struct _filter_mail_msg *)mm; - int i; - - if (m->cancel) - camel_operation_register (m->cancel); - - if ((fm->destination = mail_tool_get_local_inbox (&mm->ex)) == NULL) - goto fail; - - /* FIXME: this should support keep_on_server too, which would then perform a spool - access thingy, right? problem is matching raw messages to uid's etc. */ - if (!strncmp (m->source_uri, "mbox:", 5)) { - char *path = mail_tool_do_movemail (m->source_uri, &mm->ex); - - if (path && !camel_exception_is_set (&mm->ex)) { - camel_folder_freeze (fm->destination); - camel_filter_driver_set_default_folder (fm->driver, fm->destination); - camel_filter_driver_filter_mbox (fm->driver, path, m->source_uri, &mm->ex); - camel_folder_thaw (fm->destination); - - if (!camel_exception_is_set (&mm->ex)) - unlink (path); - } - g_free (path); - } else { - CamelFolder *folder = fm->source_folder = mail_tool_get_inbox (m->source_uri, &mm->ex); - - if (folder) { - /* this handles 'keep on server' stuff, if we have any new uid's to copy - across, we need to copy them to a new array 'cause of the way fetch_mail_free works */ - CamelUIDCache *cache = NULL; - char *cachename; - - cachename = uid_cachename_hack (folder->parent_store); - cache = camel_uid_cache_new (cachename); - g_free (cachename); - - if (cache) { - GPtrArray *folder_uids, *cache_uids, *uids; - - folder_uids = camel_folder_get_uids (folder); - cache_uids = camel_uid_cache_get_new_uids (cache, folder_uids); - if (cache_uids) { - /* need to copy this, sigh */ - fm->source_uids = uids = g_ptr_array_new (); - g_ptr_array_set_size (uids, cache_uids->len); - for (i = 0; i < cache_uids->len; i++) - uids->pdata[i] = g_strdup (cache_uids->pdata[i]); - camel_uid_cache_free_uids (cache_uids); - - fm->cache = cache; - filter_folder_filter (mm); - - /* save the cache of uids that we've just downloaded */ - camel_uid_cache_save (cache); - - /* if we are deleting off the server and no exception occured - * then iterate through the folder uids and mark them all - * for deletion. */ - if (fm->delete && !camel_exception_is_set (&mm->ex)) { - camel_folder_freeze (folder); - - for (i = 0; i < folder_uids->len; i++) - camel_folder_delete_message (folder, folder_uids->pdata[i]); - - /* sync and expunge */ - camel_folder_sync (folder, TRUE, &mm->ex); - - camel_folder_thaw (folder); - } - } - camel_uid_cache_destroy (cache); - camel_folder_free_uids (folder, folder_uids); - } else { - filter_folder_filter (mm); - } - - /* we unref the source folder here since we - may now block in finalize (we try to - disconnect cleanly) */ - camel_object_unref (fm->source_folder); - fm->source_folder = NULL; - } - } -fail: - if (m->cancel) - camel_operation_unregister (m->cancel); - - /* we unref this here as it may have more work to do (syncing - folders and whatnot) before we are really done */ - /* should this be cancellable too? (i.e. above unregister above) */ - if (fm->driver) { - camel_object_unref (fm->driver); - fm->driver = NULL; - } -} - -static void -fetch_mail_fetched (struct _mail_msg *mm) -{ - struct _fetch_mail_msg *m = (struct _fetch_mail_msg *)mm; - - if (m->done) - m->done (m->source_uri, m->data); -} - -static void -fetch_mail_free (struct _mail_msg *mm) -{ - struct _fetch_mail_msg *m = (struct _fetch_mail_msg *)mm; - - g_free (m->source_uri); - if (m->cancel) - camel_operation_unref (m->cancel); - - filter_folder_free (mm); -} - -static struct _mail_msg_op fetch_mail_op = { - fetch_mail_describe, /* we do our own progress reporting */ - fetch_mail_fetch, - fetch_mail_fetched, - fetch_mail_free, -}; - -/* ouch, a 'do everything' interface ... */ -void -mail_fetch_mail (const char *source, int keep, const char *type, CamelOperation *cancel, - CamelFilterGetFolderFunc get_folder, void *get_data, - CamelFilterStatusFunc *status, void *status_data, - void (*done)(char *source, void *data), void *data) -{ - struct _fetch_mail_msg *m; - struct _filter_mail_msg *fm; - - m = mail_msg_new (&fetch_mail_op, NULL, sizeof (*m)); - fm = (struct _filter_mail_msg *)m; - m->source_uri = g_strdup (source); - fm->delete = !keep; - fm->cache = NULL; - if (cancel) { - m->cancel = cancel; - camel_operation_ref (cancel); - } - m->done = done; - m->data = data; - - fm->driver = camel_session_get_filter_driver (session, type, NULL); - camel_filter_driver_set_folder_func (fm->driver, get_folder, get_data); - if (status) - camel_filter_driver_set_status_func (fm->driver, status, status_data); - - e_thread_put (mail_thread_new, (EMsg *)m); -} - -/* ********************************************************************** */ -/* sending stuff */ -/* ** SEND MAIL *********************************************************** */ - -extern CamelFolder *sent_folder; - -static char *normal_recipients[] = { - CAMEL_RECIPIENT_TYPE_TO, - CAMEL_RECIPIENT_TYPE_CC, - CAMEL_RECIPIENT_TYPE_BCC -}; - -static char *resent_recipients[] = { - CAMEL_RECIPIENT_TYPE_RESENT_TO, - CAMEL_RECIPIENT_TYPE_RESENT_CC, - CAMEL_RECIPIENT_TYPE_RESENT_BCC -}; - -/* send 1 message to a specific transport */ -static void -mail_send_message (CamelMimeMessage *message, const char *destination, - CamelFilterDriver *driver, CamelException *ex) -{ - EAccount *account = NULL; - const CamelInternetAddress *iaddr; - CamelAddress *from, *recipients; - CamelMessageInfo *info; - CamelTransport *xport = NULL; - char *transport_url = NULL; - char *sent_folder_uri = NULL; - const char *resent_from; - CamelFolder *folder = NULL; - GString *err = NULL; - XEvolution *xev; - int i; - - camel_medium_set_header (CAMEL_MEDIUM (message), "X-Mailer", - "Ximian Evolution " VERSION SUB_VERSION " " VERSION_COMMENT); - - camel_mime_message_set_date (message, CAMEL_MESSAGE_DATE_CURRENT, 0); - - xev = mail_tool_remove_xevolution_headers (message); - - if (xev->account) { - char *name; - - name = g_strstrip (g_strdup (xev->account)); - account = mail_config_get_account_by_name (name); - g_free (name); - - if (account) { - if (account->transport && account->transport->url) - transport_url = g_strdup (account->transport->url); - - sent_folder_uri = g_strdup (account->sent_folder_uri); - } - } - - if (!account) { - /* default back to these headers */ - if (xev->transport) - transport_url = g_strstrip (g_strdup (xev->transport)); - - if (xev->fcc) - sent_folder_uri = g_strstrip (g_strdup (xev->fcc)); - } - - xport = camel_session_get_transport (session, transport_url ? transport_url : destination, ex); - g_free (transport_url); - if (!xport) { - mail_tool_restore_xevolution_headers (message, xev); - mail_tool_destroy_xevolution (xev); - g_free (sent_folder_uri); - return; - } - - from = (CamelAddress *) camel_internet_address_new (); - resent_from = camel_medium_get_header (CAMEL_MEDIUM (message), "Resent-From"); - if (resent_from) { - camel_address_decode (from, resent_from); - } else { - iaddr = camel_mime_message_get_from (message); - camel_address_copy (from, CAMEL_ADDRESS (iaddr)); - } - - recipients = (CamelAddress *) camel_internet_address_new (); - for (i = 0; i < 3; i++) { - const char *type; - - type = resent_from ? resent_recipients[i] : normal_recipients[i]; - iaddr = camel_mime_message_get_recipients (message, type); - camel_address_cat (recipients, CAMEL_ADDRESS (iaddr)); - } - - camel_transport_send_to (xport, message, from, recipients, ex); - camel_object_unref (recipients); - camel_object_unref (from); - - mail_tool_restore_xevolution_headers (message, xev); - mail_tool_destroy_xevolution (xev); - - camel_object_unref (xport); - if (camel_exception_is_set (ex)) { - g_free (sent_folder_uri); - return; - } - - /* post-process */ - info = camel_message_info_new (); - info->flags = CAMEL_MESSAGE_SEEN; - - if (sent_folder_uri) { - folder = mail_tool_uri_to_folder (sent_folder_uri, 0, ex); - camel_exception_clear (ex); - g_free (sent_folder_uri); - } - - if (!folder) { - camel_object_ref (sent_folder); - folder = sent_folder; - } - - if (driver) { - camel_filter_driver_filter_message (driver, message, info, - NULL, NULL, NULL, "", ex); - - if (camel_exception_is_set (ex)) { - if (camel_exception_get_id (ex) == CAMEL_EXCEPTION_USER_CANCEL) - goto exit; - - /* save this error */ - err = g_string_new (""); - g_string_append_printf (err, _("Failed to apply outgoing filters: %s"), - camel_exception_get_description (ex)); - } - } - - retry_append: - camel_exception_clear (ex); - camel_folder_append_message (folder, message, info, NULL, ex); - if (camel_exception_is_set (ex)) { - if (camel_exception_get_id (ex) == CAMEL_EXCEPTION_USER_CANCEL) - goto exit; - - if (err == NULL) - err = g_string_new (""); - else - g_string_append (err, "\n\n"); - - if (folder != sent_folder) { - const char *name; - - camel_object_get (folder, NULL, CAMEL_OBJECT_DESCRIPTION, (char **) &name, 0); - g_string_append_printf (err, _("Failed to append to %s: %s\n" - "Appending to local `Sent' folder instead."), - name, camel_exception_get_description (ex)); - camel_object_ref (sent_folder); - camel_object_unref (folder); - folder = sent_folder; - - goto retry_append; - } else { - g_string_append_printf (err, _("Failed to append to local `Sent' folder: %s"), - camel_exception_get_description (ex)); - } - } - - if (err != NULL) { - /* set the culmulative exception report */ - camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM, err->str); - } - - exit: - - camel_folder_sync (folder, FALSE, NULL); - camel_message_info_free (info); - camel_object_unref (folder); - - if (err != NULL) - g_string_free (err, TRUE); -} - -/* ********************************************************************** */ - -struct _send_mail_msg { - struct _mail_msg msg; - - CamelFilterDriver *driver; - char *destination; - CamelMimeMessage *message; - - void (*done)(char *uri, CamelMimeMessage *message, gboolean sent, void *data); - void *data; -}; - -static char * -send_mail_desc (struct _mail_msg *mm, int done) -{ - struct _send_mail_msg *m = (struct _send_mail_msg *)mm; - const char *subject; - - subject = camel_mime_message_get_subject (m->message); - - if (subject) - return g_strdup_printf (_("Sending \"%s\""), subject); - else - return g_strdup (_("Sending message")); -} - -static void -send_mail_send (struct _mail_msg *mm) -{ - struct _send_mail_msg *m = (struct _send_mail_msg *)mm; - - mail_send_message (m->message, m->destination, m->driver, &mm->ex); -} - -static void -send_mail_sent (struct _mail_msg *mm) -{ - struct _send_mail_msg *m = (struct _send_mail_msg *)mm; - - if (m->done) - m->done (m->destination, m->message, !camel_exception_is_set (&mm->ex), m->data); -} - -static void -send_mail_free (struct _mail_msg *mm) -{ - struct _send_mail_msg *m = (struct _send_mail_msg *)mm; - - camel_object_unref (m->driver); - camel_object_unref (m->message); - g_free (m->destination); -} - -static struct _mail_msg_op send_mail_op = { - send_mail_desc, - send_mail_send, - send_mail_sent, - send_mail_free, -}; - -int -mail_send_mail (const char *uri, CamelMimeMessage *message, - void (*done) (char *uri, CamelMimeMessage *message, gboolean sent, void *data), - void *data) -{ - struct _send_mail_msg *m; - int id; - - m = mail_msg_new (&send_mail_op, NULL, sizeof (*m)); - m->destination = g_strdup (uri); - m->message = message; - camel_object_ref (message); - m->data = data; - m->done = done; - - id = m->msg.seq; - - m->driver = camel_session_get_filter_driver (session, FILTER_SOURCE_OUTGOING, NULL); - - e_thread_put (mail_thread_new, (EMsg *)m); - return id; -} - -/* ** SEND MAIL QUEUE ***************************************************** */ - -struct _send_queue_msg { - struct _mail_msg msg; - - CamelFolder *queue; - char *destination; - - CamelFilterDriver *driver; - CamelOperation *cancel; - - /* we use camelfilterstatusfunc, even though its not the filter doing it */ - CamelFilterStatusFunc *status; - void *status_data; - - void (*done)(char *destination, void *data); - void *data; -}; - -static void -report_status (struct _send_queue_msg *m, enum camel_filter_status_t status, int pc, const char *desc, ...) -{ - va_list ap; - char *str; - - if (m->status) { - va_start (ap, desc); - str = g_strdup_vprintf (desc, ap); - va_end (ap); - m->status (m->driver, status, pc, str, m->status_data); - g_free (str); - } -} - -static void -send_queue_send(struct _mail_msg *mm) -{ - struct _send_queue_msg *m = (struct _send_queue_msg *)mm; - extern CamelFolder *sent_folder; /* FIXME */ - GPtrArray *uids; - int i; - - d(printf("sending queue\n")); - - uids = camel_folder_get_uids (m->queue); - if (uids == NULL || uids->len == 0) - return; - - if (m->cancel) - camel_operation_register (m->cancel); - - for (i = 0; i < uids->len; i++) { - CamelMimeMessage *message; - CamelMessageInfo *info; - int pc = (100 * i) / uids->len; - - report_status (m, CAMEL_FILTER_STATUS_START, pc, _("Sending message %d of %d"), i+1, uids->len); - - info = camel_folder_get_message_info (m->queue, uids->pdata[i]); - if (info && info->flags & CAMEL_MESSAGE_DELETED) - continue; - - message = camel_folder_get_message (m->queue, uids->pdata[i], &mm->ex); - if (camel_exception_is_set (&mm->ex)) - break; - - mail_send_message (message, m->destination, m->driver, &mm->ex); - - if (camel_exception_is_set (&mm->ex)) - break; - - camel_folder_set_message_flags (m->queue, uids->pdata[i], CAMEL_MESSAGE_DELETED, CAMEL_MESSAGE_DELETED); - } - - if (camel_exception_is_set (&mm->ex)) - report_status (m, CAMEL_FILTER_STATUS_END, 100, _("Failed on message %d of %d"), i+1, uids->len); - else - report_status (m, CAMEL_FILTER_STATUS_END, 100, _("Complete.")); - - if (m->driver) { - camel_object_unref((CamelObject *)m->driver); - m->driver = NULL; - } - - camel_folder_free_uids (m->queue, uids); - - if (!camel_exception_is_set (&mm->ex)) - camel_folder_expunge (m->queue, &mm->ex); - - if (sent_folder) - camel_folder_sync (sent_folder, FALSE, NULL); - - if (m->cancel) - camel_operation_unregister (m->cancel); -} - -static void -send_queue_sent(struct _mail_msg *mm) -{ - struct _send_queue_msg *m = (struct _send_queue_msg *)mm; - - if (m->done) - m->done(m->destination, m->data); -} - -static void -send_queue_free(struct _mail_msg *mm) -{ - struct _send_queue_msg *m = (struct _send_queue_msg *)mm; - - if (m->driver) - camel_object_unref(m->driver); - camel_object_unref(m->queue); - g_free(m->destination); - if (m->cancel) - camel_operation_unref(m->cancel); -} - -static struct _mail_msg_op send_queue_op = { - NULL, /* do our own reporting, as with fetch mail */ - send_queue_send, - send_queue_sent, - send_queue_free, -}; - -/* same interface as fetch_mail, just 'cause i'm lazy today (and we need to run it from the same spot?) */ -void -mail_send_queue(CamelFolder *queue, const char *destination, - const char *type, CamelOperation *cancel, - CamelFilterGetFolderFunc get_folder, void *get_data, - CamelFilterStatusFunc *status, void *status_data, - void (*done)(char *destination, void *data), void *data) -{ - struct _send_queue_msg *m; - - m = mail_msg_new(&send_queue_op, NULL, sizeof(*m)); - m->queue = queue; - camel_object_ref(queue); - m->destination = g_strdup(destination); - if (cancel) { - m->cancel = cancel; - camel_operation_ref(cancel); - } - m->status = status; - m->status_data = status_data; - m->done = done; - m->data = data; - - m->driver = camel_session_get_filter_driver (session, type, NULL); - camel_filter_driver_set_folder_func (m->driver, get_folder, get_data); - - e_thread_put(mail_thread_new, (EMsg *)m); -} - -/* ** APPEND MESSAGE TO FOLDER ******************************************** */ - -struct _append_msg { - struct _mail_msg msg; - - CamelFolder *folder; - CamelMimeMessage *message; - CamelMessageInfo *info; - char *appended_uid; - - void (*done)(CamelFolder *folder, CamelMimeMessage *msg, CamelMessageInfo *info, int ok, const char *appended_uid, void *data); - void *data; -}; - -static char * -append_mail_desc (struct _mail_msg *mm, int done) -{ - return g_strdup (_("Saving message to folder")); -} - -static void -append_mail_append (struct _mail_msg *mm) -{ - struct _append_msg *m = (struct _append_msg *)mm; - - camel_mime_message_set_date(m->message, CAMEL_MESSAGE_DATE_CURRENT, 0); - camel_folder_append_message(m->folder, m->message, m->info, &m->appended_uid, &mm->ex); -} - -static void -append_mail_appended (struct _mail_msg *mm) -{ - struct _append_msg *m = (struct _append_msg *)mm; - - if (m->done) - m->done(m->folder, m->message, m->info, !camel_exception_is_set(&mm->ex), m->appended_uid, m->data); -} - -static void -append_mail_free (struct _mail_msg *mm) -{ - struct _append_msg *m = (struct _append_msg *)mm; - - camel_object_unref(m->message); - camel_object_unref(m->folder); - g_free (m->appended_uid); -} - -static struct _mail_msg_op append_mail_op = { - append_mail_desc, - append_mail_append, - append_mail_appended, - append_mail_free -}; - -void -mail_append_mail (CamelFolder *folder, CamelMimeMessage *message, CamelMessageInfo *info, - void (*done)(CamelFolder *folder, CamelMimeMessage *msg, CamelMessageInfo *info, int ok, const char *appended_uid, void *data), - void *data) -{ - struct _append_msg *m; - - g_assert(CAMEL_IS_FOLDER (folder)); - g_assert(CAMEL_IS_MIME_MESSAGE (message)); - - m = mail_msg_new (&append_mail_op, NULL, sizeof (*m)); - m->folder = folder; - camel_object_ref(folder); - m->message = message; - camel_object_ref(message); - m->info = info; - - m->done = done; - m->data = data; - - e_thread_put (mail_thread_new, (EMsg *)m); -} - -/* ** TRANSFER MESSAGES **************************************************** */ - -struct _transfer_msg { - struct _mail_msg msg; - - CamelFolder *source; - GPtrArray *uids; - gboolean delete; - char *dest_uri; - guint32 dest_flags; - - void (*done)(gboolean ok, void *data); - void *data; -}; - -static char * -transfer_messages_desc (struct _mail_msg *mm, int done) -{ - struct _transfer_msg *m = (struct _transfer_msg *)mm; - - return g_strdup_printf(m->delete?_("Moving messages to %s"):_("Copying messages to %s"), - m->dest_uri); - -} - -static void -transfer_messages_transfer (struct _mail_msg *mm) -{ - struct _transfer_msg *m = (struct _transfer_msg *)mm; - CamelFolder *dest; - - dest = mail_tool_uri_to_folder (m->dest_uri, m->dest_flags, &mm->ex); - if (camel_exception_is_set (&mm->ex)) - return; - - if (dest == m->source) { - camel_object_unref(dest); - /* no-op */ - return; - } - - camel_folder_freeze (m->source); - camel_folder_freeze (dest); - - camel_folder_transfer_messages_to (m->source, m->uids, dest, NULL, m->delete, &mm->ex); - - /* make sure all deleted messages are marked as seen */ - - if (m->delete) { - int i; - - for (i = 0; i < m->uids->len; i++) - camel_folder_set_message_flags (m->source, m->uids->pdata[i], - CAMEL_MESSAGE_SEEN, CAMEL_MESSAGE_SEEN); - } - - camel_folder_thaw (m->source); - camel_folder_thaw (dest); - camel_folder_sync (dest, FALSE, NULL); - camel_object_unref (dest); -} - -static void -transfer_messages_transferred (struct _mail_msg *mm) -{ - struct _transfer_msg *m = (struct _transfer_msg *)mm; - - if (m->done) - m->done (!camel_exception_is_set (&mm->ex), m->data); -} - -static void -transfer_messages_free (struct _mail_msg *mm) -{ - struct _transfer_msg *m = (struct _transfer_msg *)mm; - - camel_object_unref (m->source); - g_free (m->dest_uri); - em_utils_uids_free (m->uids); -} - -static struct _mail_msg_op transfer_messages_op = { - transfer_messages_desc, - transfer_messages_transfer, - transfer_messages_transferred, - transfer_messages_free, -}; - -void -mail_transfer_messages (CamelFolder *source, GPtrArray *uids, - gboolean delete_from_source, - const char *dest_uri, - guint32 dest_flags, - void (*done) (gboolean ok, void *data), - void *data) -{ - struct _transfer_msg *m; - - g_assert(CAMEL_IS_FOLDER (source)); - g_assert(uids != NULL); - g_assert(dest_uri != NULL); - - m = mail_msg_new(&transfer_messages_op, NULL, sizeof(*m)); - m->source = source; - camel_object_ref (source); - m->uids = uids; - m->delete = delete_from_source; - m->dest_uri = g_strdup (dest_uri); - m->dest_flags = dest_flags; - m->done = done; - m->data = data; - - e_thread_put(mail_thread_queued, (EMsg *)m); -} - -/* ** SCAN SUBFOLDERS ***************************************************** */ - -struct _get_folderinfo_msg { - struct _mail_msg msg; - - CamelStore *store; - CamelFolderInfo *info; - void (*done)(CamelStore *store, CamelFolderInfo *info, void *data); - void *data; -}; - -static char * -get_folderinfo_desc (struct _mail_msg *mm, int done) -{ - struct _get_folderinfo_msg *m = (struct _get_folderinfo_msg *)mm; - char *ret, *name; - - name = camel_service_get_name((CamelService *)m->store, TRUE); - ret = g_strdup_printf(_("Scanning folders in \"%s\""), name); - g_free(name); - return ret; -} - -static void -add_vtrash_or_vjunk_info (CamelStore *store, CamelFolderInfo *info, gchar *name, gchar *full_name, gchar *url_base, gboolean unread_count) -{ - CamelFolderInfo *fi, *vinfo, *parent; - char *uri, *path; - CamelURL *url; - - g_return_if_fail (info != NULL); - - parent = NULL; - for (fi = info; fi; fi = fi->sibling) { - if (!strcmp (fi->name, name)) - break; - parent = fi; - } - - /* create our vTrash/vJunk URL */ - url = camel_url_new (info->url, NULL); - path = g_strdup_printf ("/%s", name); - if (url->fragment) - camel_url_set_fragment (url, path); - else - camel_url_set_path (url, path); - g_free (path); - uri = camel_url_to_string (url, CAMEL_URL_HIDE_ALL); - camel_url_free (url); - - if (fi) { - /* We're going to replace the physical Trash/Junk folder with our vTrash/vJunk folder */ - vinfo = fi; - g_free (vinfo->full_name); - g_free (vinfo->name); - g_free (vinfo->url); - } else { - /* There wasn't a Trash/Junk folder so create a new folder entry */ - vinfo = g_new0 (CamelFolderInfo, 1); - - g_assert(parent != NULL); - - /* link it into the right spot */ - vinfo->sibling = parent->sibling; - parent->sibling = vinfo; - } - - /* Fill in the new fields */ - vinfo->full_name = g_strdup (full_name); - vinfo->name = g_strdup(vinfo->full_name); - vinfo->url = g_strdup_printf ("%s:%s", url_base, uri); - if (!unread_count) - vinfo->unread_message_count = -1; - vinfo->path = g_strdup_printf("/%s", vinfo->name); - g_free (uri); -} - -static void -add_vtrash_info (CamelStore *store, CamelFolderInfo *info) -{ - add_vtrash_or_vjunk_info (store, info, CAMEL_VTRASH_NAME, _("Trash"), "vtrash", FALSE); -} - -static void -add_vjunk_info (CamelStore *store, CamelFolderInfo *info) -{ - add_vtrash_or_vjunk_info (store, info, CAMEL_VJUNK_NAME, _("Junk"), "vjunk", TRUE); -} - -static void -add_unmatched_info(CamelFolderInfo *fi) -{ - for (; fi; fi = fi->sibling) { - if (!strcmp(fi->full_name, CAMEL_UNMATCHED_NAME)) { - g_free(fi->name); - fi->name = g_strdup(_("Unmatched")); - g_free(fi->path); - fi->path = g_strdup_printf("/%s", fi->name); - break; - } - } -} - -static void -get_folderinfo_get (struct _mail_msg *mm) -{ - struct _get_folderinfo_msg *m = (struct _get_folderinfo_msg *)mm; - guint32 flags = CAMEL_STORE_FOLDER_INFO_RECURSIVE; - - if (camel_store_supports_subscriptions (m->store)) - flags |= CAMEL_STORE_FOLDER_INFO_SUBSCRIBED; - - m->info = camel_store_get_folder_info (m->store, NULL, flags, &mm->ex); - if (m->info) { - if (m->info->url && (m->store->flags & CAMEL_STORE_VTRASH)) - add_vtrash_info(m->store, m->info); - if (m->info->url && (m->store->flags & CAMEL_STORE_VJUNK)) - add_vjunk_info(m->store, m->info); - if (CAMEL_IS_VEE_STORE(m->store)) - add_unmatched_info(m->info); - } -} - -static void -get_folderinfo_got (struct _mail_msg *mm) -{ - struct _get_folderinfo_msg *m = (struct _get_folderinfo_msg *)mm; - - if (camel_exception_is_set (&mm->ex)) { - char *url; - - url = camel_service_get_url (CAMEL_SERVICE (m->store)); - w(g_warning ("Error getting folder info from store at %s: %s", - url, camel_exception_get_description (&mm->ex))); - g_free (url); - } - - /* 'done' is probably guaranteed to fail, but... */ - - if (m->done) - m->done (m->store, m->info, m->data); -} - -static void -get_folderinfo_free (struct _mail_msg *mm) -{ - struct _get_folderinfo_msg *m = (struct _get_folderinfo_msg *)mm; - - if (m->info) - camel_store_free_folder_info(m->store, m->info); - camel_object_unref(m->store); -} - -static struct _mail_msg_op get_folderinfo_op = { - get_folderinfo_desc, - get_folderinfo_get, - get_folderinfo_got, - get_folderinfo_free, -}; - -int -mail_get_folderinfo (CamelStore *store, CamelOperation *op, void (*done)(CamelStore *store, CamelFolderInfo *info, void *data), void *data) -{ - struct _get_folderinfo_msg *m; - int id; - - m = mail_msg_new(&get_folderinfo_op, NULL, sizeof(*m)); - if (op) { - camel_operation_unref(m->msg.cancel); - m->msg.cancel = op; - camel_operation_ref(op); - } - m->store = store; - camel_object_ref(store); - m->done = done; - m->data = data; - id = m->msg.seq; - - e_thread_put(mail_thread_new, (EMsg *)m); - - return id; -} - -/* ** ATTACH MESSAGES ****************************************************** */ - -struct _build_data { - void (*done)(CamelFolder *folder, GPtrArray *uids, CamelMimePart *part, char *subject, void *data); - void *data; -}; - -static void -do_build_attachment (CamelFolder *folder, GPtrArray *uids, GPtrArray *messages, void *data) -{ - struct _build_data *d = data; - CamelMultipart *multipart; - CamelMimePart *part; - char *subject; - int i; - - if (messages->len == 0) { - d->done(folder, messages, NULL, NULL, d->data); - g_free(d); - return; - } - - if (messages->len == 1) { - part = mail_tool_make_message_attachment(messages->pdata[0]); - } else { - multipart = camel_multipart_new(); - camel_data_wrapper_set_mime_type(CAMEL_DATA_WRAPPER (multipart), "multipart/digest"); - camel_multipart_set_boundary(multipart, NULL); - - for (i=0;i<messages->len;i++) { - part = mail_tool_make_message_attachment(messages->pdata[i]); - camel_multipart_add_part(multipart, part); - camel_object_unref(part); - } - part = camel_mime_part_new(); - camel_medium_set_content_object(CAMEL_MEDIUM (part), CAMEL_DATA_WRAPPER(multipart)); - camel_object_unref(multipart); - - camel_mime_part_set_description(part, _("Forwarded messages")); - } - - subject = mail_tool_generate_forward_subject(messages->pdata[0]); - d->done(folder, messages, part, subject, d->data); - g_free(subject); - camel_object_unref(part); - - g_free(d); -} - -void -mail_build_attachment(CamelFolder *folder, GPtrArray *uids, - void (*done)(CamelFolder *folder, GPtrArray *messages, CamelMimePart *part, char *subject, void *data), void *data) -{ - struct _build_data *d; - - d = g_malloc(sizeof(*d)); - d->done = done; - d->data = data; - mail_get_messages(folder, uids, do_build_attachment, d); -} - -/* ** LOAD FOLDER ********************************************************* */ - -/* there should be some way to merge this and create folder, since both can - presumably create a folder ... */ - -struct _get_folder_msg { - struct _mail_msg msg; - - char *uri; - guint32 flags; - CamelFolder *folder; - void (*done) (char *uri, CamelFolder *folder, void *data); - void *data; -}; - -static char * -get_folder_desc (struct _mail_msg *mm, int done) -{ - struct _get_folder_msg *m = (struct _get_folder_msg *)mm; - - return g_strdup_printf(_("Opening folder %s"), m->uri); -} - -static void -get_folder_get (struct _mail_msg *mm) -{ - struct _get_folder_msg *m = (struct _get_folder_msg *)mm; - - m->folder = mail_tool_uri_to_folder (m->uri, m->flags, &mm->ex); -} - -static void -get_folder_got (struct _mail_msg *mm) -{ - struct _get_folder_msg *m = (struct _get_folder_msg *)mm; - - if (m->done) - m->done (m->uri, m->folder, m->data); -} - -static void -get_folder_free (struct _mail_msg *mm) -{ - struct _get_folder_msg *m = (struct _get_folder_msg *)mm; - - g_free (m->uri); - if (m->folder) - camel_object_unref (m->folder); -} - -static struct _mail_msg_op get_folder_op = { - get_folder_desc, - get_folder_get, - get_folder_got, - get_folder_free, -}; - -int -mail_get_folder (const char *uri, guint32 flags, - void (*done)(char *uri, CamelFolder *folder, void *data), - void *data, EThread *thread) -{ - struct _get_folder_msg *m; - int id; - - m = mail_msg_new(&get_folder_op, NULL, sizeof(*m)); - m->uri = g_strdup (uri); - m->flags = flags; - m->data = data; - m->done = done; - - id = m->msg.seq; - e_thread_put(thread, (EMsg *)m); - return id; -} - -/* ** GET STORE ******************************************************* */ - -struct _get_store_msg { - struct _mail_msg msg; - - char *uri; - CamelStore *store; - void (*done) (char *uri, CamelStore *store, void *data); - void *data; -}; - -static char * -get_store_desc (struct _mail_msg *mm, int done) -{ - struct _get_store_msg *m = (struct _get_store_msg *)mm; - - return g_strdup_printf(_("Opening store %s"), m->uri); -} - -static void -get_store_get (struct _mail_msg *mm) -{ - struct _get_store_msg *m = (struct _get_store_msg *)mm; - - /*camel_session_get_store connects us, which we don't want to do on startup. */ - - m->store = (CamelStore *) camel_session_get_service (session, m->uri, - CAMEL_PROVIDER_STORE, - &mm->ex); -} - -static void -get_store_got (struct _mail_msg *mm) -{ - struct _get_store_msg *m = (struct _get_store_msg *)mm; - - if (m->done) - m->done (m->uri, m->store, m->data); -} - -static void -get_store_free (struct _mail_msg *mm) -{ - struct _get_store_msg *m = (struct _get_store_msg *)mm; - - g_free (m->uri); - if (m->store) - camel_object_unref (m->store); -} - -static struct _mail_msg_op get_store_op = { - get_store_desc, - get_store_get, - get_store_got, - get_store_free, -}; - -int -mail_get_store (const char *uri, CamelOperation *op, void (*done) (char *uri, CamelStore *store, void *data), void *data) -{ - struct _get_store_msg *m; - int id; - - m = mail_msg_new (&get_store_op, NULL, sizeof (*m)); - if (op) { - camel_operation_unref(m->msg.cancel); - m->msg.cancel = op; - camel_operation_ref(op); - } - m->uri = g_strdup (uri); - m->data = data; - m->done = done; - - id = m->msg.seq; - e_thread_put (mail_thread_new, (EMsg *)m); - return id; -} - -/* ** REMOVE FOLDER ******************************************************* */ - -struct _remove_folder_msg { - struct _mail_msg msg; - - char *uri; - gboolean removed; - void (*done) (char *uri, gboolean removed, void *data); - void *data; -}; - -static char * -remove_folder_desc (struct _mail_msg *mm, int done) -{ - struct _remove_folder_msg *m = (struct _remove_folder_msg *)mm; - - return g_strdup_printf (_("Removing folder %s"), m->uri); -} - -static void -remove_folder_get (struct _mail_msg *mm) -{ - struct _remove_folder_msg *m = (struct _remove_folder_msg *)mm; - CamelStore *store; - CamelFolder *folder; - GPtrArray *uids; - int i; - - m->removed = FALSE; - - folder = mail_tool_uri_to_folder (m->uri, 0, &mm->ex); - if (!folder) - return; - - store = folder->parent_store; - - /* Delete every message in this folder, then expunge it */ - uids = camel_folder_get_uids (folder); - camel_folder_freeze(folder); - for (i = 0; i < uids->len; i++) - camel_folder_delete_message (folder, uids->pdata[i]); - camel_folder_sync (folder, TRUE, NULL); - camel_folder_thaw(folder); - camel_folder_free_uids (folder, uids); - - /* if the store supports subscriptions, unsubscribe from this folder... */ - if (camel_store_supports_subscriptions (store)) - camel_store_unsubscribe_folder (store, folder->full_name, NULL); - - /* Then delete the folder from the store */ - camel_store_delete_folder (store, folder->full_name, &mm->ex); - m->removed = !camel_exception_is_set (&mm->ex); - camel_object_unref (folder); -} - -static void -remove_folder_got (struct _mail_msg *mm) -{ - struct _remove_folder_msg *m = (struct _remove_folder_msg *)mm; - - if (m->removed) { - /* FIXME: Remove this folder from the folder cache ??? */ - } - - if (m->done) - m->done (m->uri, m->removed, m->data); -} - -static void -remove_folder_free (struct _mail_msg *mm) -{ - struct _remove_folder_msg *m = (struct _remove_folder_msg *)mm; - - g_free (m->uri); -} - -static struct _mail_msg_op remove_folder_op = { - remove_folder_desc, - remove_folder_get, - remove_folder_got, - remove_folder_free, -}; - -void -mail_remove_folder (const char *uri, void (*done) (char *uri, gboolean removed, void *data), void *data) -{ - struct _remove_folder_msg *m; - - m = mail_msg_new (&remove_folder_op, NULL, sizeof (*m)); - m->uri = g_strdup (uri); - m->data = data; - m->done = done; - - e_thread_put (mail_thread_new, (EMsg *)m); -} - -/* ** SYNC FOLDER ********************************************************* */ - -struct _sync_folder_msg { - struct _mail_msg msg; - - CamelFolder *folder; - void (*done) (CamelFolder *folder, void *data); - void *data; -}; - -static char *sync_folder_desc(struct _mail_msg *mm, int done) -{ - struct _sync_folder_msg *m = (struct _sync_folder_msg *)mm; - - return g_strdup_printf (_("Storing folder \'%s\'"), - camel_folder_get_full_name (m->folder)); -} - -static void sync_folder_sync(struct _mail_msg *mm) -{ - struct _sync_folder_msg *m = (struct _sync_folder_msg *)mm; - - camel_folder_sync(m->folder, FALSE, &mm->ex); -} - -static void sync_folder_synced(struct _mail_msg *mm) -{ - struct _sync_folder_msg *m = (struct _sync_folder_msg *)mm; - - if (m->done) - m->done(m->folder, m->data); -} - -static void sync_folder_free(struct _mail_msg *mm) -{ - struct _sync_folder_msg *m = (struct _sync_folder_msg *)mm; - - camel_object_unref((CamelObject *)m->folder); -} - -static struct _mail_msg_op sync_folder_op = { - sync_folder_desc, - sync_folder_sync, - sync_folder_synced, - sync_folder_free, -}; - -void -mail_sync_folder(CamelFolder *folder, void (*done) (CamelFolder *folder, void *data), void *data) -{ - struct _sync_folder_msg *m; - - m = mail_msg_new(&sync_folder_op, NULL, sizeof(*m)); - m->folder = folder; - camel_object_ref(folder); - m->data = data; - m->done = done; - - e_thread_put(mail_thread_queued_slow, (EMsg *)m); -} - -/* ******************************************************************************** */ - -static char *refresh_folder_desc(struct _mail_msg *mm, int done) -{ - return g_strdup(_("Refreshing folder")); -} - -static void refresh_folder_refresh(struct _mail_msg *mm) -{ - struct _sync_folder_msg *m = (struct _sync_folder_msg *)mm; - - camel_folder_refresh_info(m->folder, &mm->ex); -} - -/* we just use the sync stuff where we can, since it would be the same */ -static struct _mail_msg_op refresh_folder_op = { - refresh_folder_desc, - refresh_folder_refresh, - sync_folder_synced, - sync_folder_free, -}; - -void -mail_refresh_folder(CamelFolder *folder, void (*done) (CamelFolder *folder, void *data), void *data) -{ - struct _sync_folder_msg *m; - - m = mail_msg_new(&refresh_folder_op, NULL, sizeof(*m)); - m->folder = folder; - camel_object_ref(folder); - m->data = data; - m->done = done; - - e_thread_put(mail_thread_new, (EMsg *)m); -} - -/* ******************************************************************************** */ - -static char *expunge_folder_desc(struct _mail_msg *mm, int done) -{ - return g_strdup(_("Expunging folder")); -} - -static void expunge_folder_expunge(struct _mail_msg *mm) -{ - struct _sync_folder_msg *m = (struct _sync_folder_msg *)mm; - - camel_folder_expunge(m->folder, &mm->ex); -} - -/* we just use the sync stuff where we can, since it would be the same */ -static struct _mail_msg_op expunge_folder_op = { - expunge_folder_desc, - expunge_folder_expunge, - sync_folder_synced, - sync_folder_free, -}; - -void -mail_expunge_folder(CamelFolder *folder, void (*done) (CamelFolder *folder, void *data), void *data) -{ - struct _sync_folder_msg *m; - - m = mail_msg_new(&expunge_folder_op, NULL, sizeof(*m)); - m->folder = folder; - camel_object_ref(folder); - m->data = data; - m->done = done; - - e_thread_put(mail_thread_queued_slow, (EMsg *)m); -} - -/* ******************************************************************************** */ - -struct _empty_trash_msg { - struct _mail_msg msg; - - EAccount *account; - void (*done) (EAccount *account, void *data); - void *data; -}; - -static char *empty_trash_desc(struct _mail_msg *mm, int done) -{ - /* FIXME after 1.4 is out and we're not in string freeze any more. */ -#if 0 - struct _empty_trash_msg *m = (struct _empty_trash_msg *)mm; - - return g_strdup_printf (_("Emptying trash in \'%s\'"), - m->account ? m->account->name : _("Local Folders")); -#else - return g_strdup(_("Expunging folder")); -#endif -} - -static void empty_trash_empty(struct _mail_msg *mm) -{ - struct _empty_trash_msg *m = (struct _empty_trash_msg *)mm; - const char *evolution_dir; - CamelFolder *trash; - char *uri; - - if (m->account) { - trash = mail_tool_get_trash (m->account->source->url, FALSE, &mm->ex); - } else { - evolution_dir = mail_component_peek_base_directory (mail_component_peek ()); - uri = g_strdup_printf ("mbox:%s/mail/local", evolution_dir); - trash = mail_tool_get_trash (uri, TRUE, &mm->ex); - g_free (uri); - } - - if (trash) - camel_folder_expunge (trash, &mm->ex); - - camel_object_unref (trash); -} - -static void empty_trash_emptied(struct _mail_msg *mm) -{ - struct _empty_trash_msg *m = (struct _empty_trash_msg *)mm; - - if (m->done) - m->done(m->account, m->data); -} - -static void empty_trash_free(struct _mail_msg *mm) -{ - struct _empty_trash_msg *m = (struct _empty_trash_msg *)mm; - - if (m->account) - g_object_unref(m->account); -} - -static struct _mail_msg_op empty_trash_op = { - empty_trash_desc, - empty_trash_empty, - empty_trash_emptied, - empty_trash_free, -}; - -void -mail_empty_trash(EAccount *account, void (*done) (EAccount *account, void *data), void *data) -{ - struct _empty_trash_msg *m; - - m = mail_msg_new(&empty_trash_op, NULL, sizeof(*m)); - m->account = account; - if (account) - g_object_ref(account); - m->data = data; - m->done = done; - - e_thread_put(mail_thread_queued_slow, (EMsg *)m); -} - -/* ** GET MESSAGE(s) ***************************************************** */ - -struct _get_message_msg { - struct _mail_msg msg; - - CamelFolder *folder; - char *uid; - void (*done) (CamelFolder *folder, const char *uid, CamelMimeMessage *msg, void *data); - void *data; - CamelMimeMessage *message; - CamelOperation *cancel; -}; - -static char *get_message_desc(struct _mail_msg *mm, int done) -{ - struct _get_message_msg *m = (struct _get_message_msg *)mm; - - return g_strdup_printf(_("Retrieving message %s"), m->uid); -} - -static void get_message_get(struct _mail_msg *mm) -{ - struct _get_message_msg *m = (struct _get_message_msg *)mm; - - m->message = camel_folder_get_message(m->folder, m->uid, &mm->ex); -} - -static void get_message_got(struct _mail_msg *mm) -{ - struct _get_message_msg *m = (struct _get_message_msg *)mm; - - if (m->done) - m->done(m->folder, m->uid, m->message, m->data); -} - -static void get_message_free(struct _mail_msg *mm) -{ - struct _get_message_msg *m = (struct _get_message_msg *)mm; - - g_free (m->uid); - camel_object_unref (m->folder); - camel_operation_unref (m->cancel); - - if (m->message) - camel_object_unref (m->message); -} - -static struct _mail_msg_op get_message_op = { - get_message_desc, - get_message_get, - get_message_got, - get_message_free, -}; - -void -mail_get_message(CamelFolder *folder, const char *uid, void (*done) (CamelFolder *folder, const char *uid, - CamelMimeMessage *msg, void *data), - void *data, EThread *thread) -{ - struct _get_message_msg *m; - - m = mail_msg_new(&get_message_op, NULL, sizeof(*m)); - m->folder = folder; - camel_object_ref(folder); - m->uid = g_strdup(uid); - m->data = data; - m->done = done; - m->cancel = camel_operation_new(NULL, NULL); - - e_thread_put(thread, (EMsg *)m); -} - -/* ********************************************************************** */ - -struct _get_messages_msg { - struct _mail_msg msg; - - CamelFolder *folder; - GPtrArray *uids; - GPtrArray *messages; - - void (*done) (CamelFolder *folder, GPtrArray *uids, GPtrArray *msgs, void *data); - void *data; -}; - -static char * get_messages_desc(struct _mail_msg *mm, int done) -{ - struct _get_messages_msg *m = (struct _get_messages_msg *)mm; - - return g_strdup_printf(_("Retrieving %d message(s)"), m->uids->len); -} - -static void get_messages_get(struct _mail_msg *mm) -{ - struct _get_messages_msg *m = (struct _get_messages_msg *)mm; - int i; - CamelMimeMessage *message; - - for (i=0; i<m->uids->len; i++) { - int pc = ((i+1) * 100) / m->uids->len; - - message = camel_folder_get_message(m->folder, m->uids->pdata[i], &mm->ex); - camel_operation_progress(mm->cancel, pc); - if (message == NULL) - break; - - g_ptr_array_add(m->messages, message); - } -} - -static void get_messages_got(struct _mail_msg *mm) -{ - struct _get_messages_msg *m = (struct _get_messages_msg *)mm; - - if (m->done) - m->done(m->folder, m->uids, m->messages, m->data); -} - -static void get_messages_free(struct _mail_msg *mm) -{ - struct _get_messages_msg *m = (struct _get_messages_msg *)mm; - int i; - - em_utils_uids_free (m->uids); - for (i=0;i<m->messages->len;i++) { - if (m->messages->pdata[i]) - camel_object_unref(m->messages->pdata[i]); - } - g_ptr_array_free(m->messages, TRUE); - camel_object_unref(m->folder); -} - -static struct _mail_msg_op get_messages_op = { - get_messages_desc, - get_messages_get, - get_messages_got, - get_messages_free, -}; - -void -mail_get_messages(CamelFolder *folder, GPtrArray *uids, - void (*done) (CamelFolder *folder, GPtrArray *uids, GPtrArray *msgs, void *data), - void *data) -{ - struct _get_messages_msg *m; - - m = mail_msg_new(&get_messages_op, NULL, sizeof(*m)); - m->folder = folder; - camel_object_ref(folder); - m->uids = uids; - m->messages = g_ptr_array_new(); - m->data = data; - m->done = done; - - e_thread_put(mail_thread_new, (EMsg *)m); -} - -/* ** SAVE MESSAGES ******************************************************* */ - -struct _save_messages_msg { - struct _mail_msg msg; - - CamelFolder *folder; - GPtrArray *uids; - char *path; - void (*done)(CamelFolder *folder, GPtrArray *uids, char *path, void *data); - void *data; -}; - -static char *save_messages_desc(struct _mail_msg *mm, int done) -{ - struct _save_messages_msg *m = (struct _save_messages_msg *)mm; - - return g_strdup_printf(_("Saving %d messsage(s)"), m->uids->len); -} - -static void -save_prepare_part (CamelMimePart *mime_part) -{ - CamelDataWrapper *wrapper; - int parts, i; - - wrapper = camel_medium_get_content_object (CAMEL_MEDIUM (mime_part)); - if (!wrapper) - return; - - if (CAMEL_IS_MULTIPART (wrapper)) { - parts = camel_multipart_get_number (CAMEL_MULTIPART (wrapper)); - for (i = 0; i < parts; i++) { - CamelMimePart *part = camel_multipart_get_part (CAMEL_MULTIPART (wrapper), i); - - save_prepare_part (part); - } - } else { - if (CAMEL_IS_MIME_MESSAGE (wrapper)) { - /* prepare the message parts' subparts */ - save_prepare_part (CAMEL_MIME_PART (wrapper)); - } else { - CamelContentType *type; - - /* We want to save textual parts as 8bit instead of encoded */ - type = camel_data_wrapper_get_mime_type_field (wrapper); - if (camel_content_type_is (type, "text", "*")) - camel_mime_part_set_encoding (mime_part, CAMEL_TRANSFER_ENCODING_8BIT); - } - } -} - -static void -save_messages_save (struct _mail_msg *mm) -{ - struct _save_messages_msg *m = (struct _save_messages_msg *)mm; - CamelStreamFilter *filtered_stream; - CamelMimeFilterFrom *from_filter; - CamelStream *stream; - int fd, i; - char *from; - - fd = open (m->path, O_WRONLY | O_CREAT | O_TRUNC, 0666); - if (fd == -1) { - camel_exception_setv(&mm->ex, CAMEL_EXCEPTION_SYSTEM, - _("Unable to create output file: %s\n %s"), m->path, strerror(errno)); - return; - } - - stream = camel_stream_fs_new_with_fd(fd); - from_filter = camel_mime_filter_from_new(); - filtered_stream = camel_stream_filter_new_with_stream(stream); - camel_stream_filter_add(filtered_stream, (CamelMimeFilter *)from_filter); - camel_object_unref(from_filter); - - for (i=0; i<m->uids->len; i++) { - CamelMimeMessage *message; - int pc = ((i+1) * 100) / m->uids->len; - - message = camel_folder_get_message(m->folder, m->uids->pdata[i], &mm->ex); - camel_operation_progress(mm->cancel, pc); - if (message == NULL) - break; - - save_prepare_part (CAMEL_MIME_PART (message)); - - /* we need to flush after each stream write since we are writing to the same fd */ - from = camel_mime_message_build_mbox_from(message); - if (camel_stream_write_string(stream, from) == -1 - || camel_stream_flush(stream) == -1 - || camel_data_wrapper_write_to_stream((CamelDataWrapper *)message, (CamelStream *)filtered_stream) == -1 - || camel_stream_flush((CamelStream *)filtered_stream) == -1) { - camel_exception_setv(&mm->ex, CAMEL_EXCEPTION_SYSTEM, - _("Error saving messages to: %s:\n %s"), m->path, strerror(errno)); - g_free(from); - camel_object_unref((CamelObject *)message); - break; - } - g_free(from); - camel_object_unref(message); - } - - camel_object_unref(filtered_stream); - camel_object_unref(stream); -} - -static void save_messages_saved(struct _mail_msg *mm) -{ - struct _save_messages_msg *m = (struct _save_messages_msg *)mm; - - if (m->done) - m->done(m->folder, m->uids, m->path, m->data); -} - -static void save_messages_free(struct _mail_msg *mm) -{ - struct _save_messages_msg *m = (struct _save_messages_msg *)mm; - - em_utils_uids_free (m->uids); - camel_object_unref(m->folder); - g_free(m->path); -} - -static struct _mail_msg_op save_messages_op = { - save_messages_desc, - save_messages_save, - save_messages_saved, - save_messages_free, -}; - -int -mail_save_messages(CamelFolder *folder, GPtrArray *uids, const char *path, - void (*done) (CamelFolder *folder, GPtrArray *uids, char *path, void *data), void *data) -{ - struct _save_messages_msg *m; - int id; - - m = mail_msg_new(&save_messages_op, NULL, sizeof(*m)); - m->folder = folder; - camel_object_ref(folder); - m->uids = uids; - m->path = g_strdup(path); - m->data = data; - m->done = done; - - id = m->msg.seq; - e_thread_put(mail_thread_new, (EMsg *)m); - - return id; -} - -/* ** SAVE PART ******************************************************* */ - -struct _save_part_msg { - struct _mail_msg msg; - - CamelMimePart *part; - char *path; - void (*done)(CamelMimePart *part, char *path, int saved, void *data); - void *data; -}; - -static char *save_part_desc(struct _mail_msg *mm, int done) -{ - return g_strdup(_("Saving attachment")); -} - -static void -save_part_save (struct _mail_msg *mm) -{ - struct _save_part_msg *m = (struct _save_part_msg *)mm; - CamelMimeFilterCharset *charsetfilter; - CamelContentType *content_type; - CamelStream *filtered_stream; - CamelStream *stream_fs; - CamelDataWrapper *data; - const char *charset; - - stream_fs = camel_stream_fs_new_with_name (m->path, O_WRONLY | O_CREAT | O_TRUNC, 0666); - if (stream_fs == NULL) { - camel_exception_setv (&mm->ex, CAMEL_EXCEPTION_SYSTEM, - _("Cannot create output file: %s:\n %s"), - m->path, g_strerror (errno)); - return; - } - - /* we only convert text/ parts, and we only convert if we have to - null charset param == us-ascii == utf8 always, and utf8 == utf8 obviously */ - /* this will also let "us-ascii that isn't really" parts pass out in - proper format, without us trying to treat it as what it isn't, which is - the same algorithm camel uses */ - - data = camel_medium_get_content_object (CAMEL_MEDIUM (m->part)); - content_type = camel_mime_part_get_content_type (m->part); - if (camel_content_type_is (content_type, "text", "*") - && (charset = camel_content_type_param (content_type, "charset")) - && strcasecmp (charset, "utf-8") != 0) { - charsetfilter = camel_mime_filter_charset_new_convert ("utf-8", charset); - filtered_stream = (CamelStream *) camel_stream_filter_new_with_stream (stream_fs); - camel_object_unref (CAMEL_OBJECT (stream_fs)); - if (charsetfilter) { - camel_stream_filter_add (CAMEL_STREAM_FILTER (filtered_stream), CAMEL_MIME_FILTER (charsetfilter)); - camel_object_unref (charsetfilter); - } - } else { - filtered_stream = stream_fs; - } - - if (camel_data_wrapper_decode_to_stream (data, filtered_stream) == -1 - || camel_stream_flush (filtered_stream) == -1) - camel_exception_setv (&mm->ex, CAMEL_EXCEPTION_SYSTEM, - _("Could not write data: %s"), - g_strerror (errno)); - - camel_object_unref (filtered_stream); -} - -static void -save_part_saved (struct _mail_msg *mm) -{ - struct _save_part_msg *m = (struct _save_part_msg *)mm; - - if (m->done) - m->done (m->part, m->path, !camel_exception_is_set (&mm->ex), m->data); -} - -static void -save_part_free (struct _mail_msg *mm) -{ - struct _save_part_msg *m = (struct _save_part_msg *)mm; - - camel_object_unref (m->part); - g_free (m->path); -} - -static struct _mail_msg_op save_part_op = { - save_part_desc, - save_part_save, - save_part_saved, - save_part_free, -}; - -int -mail_save_part (CamelMimePart *part, const char *path, - void (*done)(CamelMimePart *part, char *path, int saved, void *data), void *data) -{ - struct _save_part_msg *m; - int id; - - m = mail_msg_new (&save_part_op, NULL, sizeof (*m)); - m->part = part; - camel_object_ref (part); - m->path = g_strdup (path); - m->data = data; - m->done = done; - - id = m->msg.seq; - e_thread_put (mail_thread_new, (EMsg *)m); - - return id; -} - - -/* ** PREPARE OFFLINE ***************************************************** */ - -struct _prep_offline_msg { - struct _mail_msg msg; - - CamelOperation *cancel; - char *uri; - void (*done)(const char *uri, void *data); - void *data; -}; - -static void prep_offline_do(struct _mail_msg *mm) -{ - struct _prep_offline_msg *m = (struct _prep_offline_msg *)mm; - CamelFolder *folder; - - if (m->cancel) - camel_operation_register(m->cancel); - - folder = mail_tool_uri_to_folder(m->uri, 0, &mm->ex); - if (folder) { - if (CAMEL_IS_DISCO_FOLDER(folder)) { - camel_disco_folder_prepare_for_offline((CamelDiscoFolder *)folder, - "(match-all)", - &mm->ex); - } - /* prepare_for_offline should do this? */ - /* of course it should all be atomic, but ... */ - camel_folder_sync(folder, FALSE, NULL); - camel_object_unref(folder); - } - - if (m->cancel) - camel_operation_unregister(m->cancel); -} - -static void prep_offline_done(struct _mail_msg *mm) -{ - struct _prep_offline_msg *m = (struct _prep_offline_msg *)mm; - - if (m->done) - m->done(m->uri, m->data); -} - -static void prep_offline_free(struct _mail_msg *mm) -{ - struct _prep_offline_msg *m = (struct _prep_offline_msg *)mm; - - if (m->cancel) - camel_operation_unref(m->cancel); - g_free(m->uri); -} - -static struct _mail_msg_op prep_offline_op = { - NULL, /* DO NOT CHANGE THIS, IT MUST BE NULL FOR CANCELLATION TO WORK */ - prep_offline_do, - prep_offline_done, - prep_offline_free, -}; - -void -mail_prep_offline(const char *uri, - CamelOperation *cancel, - void (*done)(const char *, void *data), - void *data) -{ - struct _prep_offline_msg *m; - - m = mail_msg_new(&prep_offline_op, NULL, sizeof(*m)); - m->cancel = cancel; - if (cancel) - camel_operation_ref(cancel); - m->uri = g_strdup(uri); - m->data = data; - m->done = done; - - e_thread_put(mail_thread_queued, (EMsg *)m); -} - -/* ** GO OFFLINE ***************************************************** */ - -struct _set_offline_msg { - struct _mail_msg msg; - - CamelStore *store; - gboolean offline; - void (*done)(CamelStore *store, void *data); - void *data; -}; - -static char *set_offline_desc(struct _mail_msg *mm, int done) -{ - struct _set_offline_msg *m = (struct _set_offline_msg *)mm; - char *service_name = camel_service_get_name (CAMEL_SERVICE (m->store), TRUE); - char *msg; - - msg = g_strdup_printf(m->offline?_("Disconnecting from %s"):_("Reconnecting to %s"), - service_name); - g_free(service_name); - return msg; -} - -static void set_offline_do(struct _mail_msg *mm) -{ - struct _set_offline_msg *m = (struct _set_offline_msg *)mm; - - if (CAMEL_IS_DISCO_STORE (m->store)) { - if (!m->offline) { - camel_disco_store_set_status (CAMEL_DISCO_STORE (m->store), - CAMEL_DISCO_STORE_ONLINE, - &mm->ex); - return; - } else if (camel_disco_store_can_work_offline (CAMEL_DISCO_STORE (m->store))) { - camel_disco_store_set_status (CAMEL_DISCO_STORE (m->store), - CAMEL_DISCO_STORE_OFFLINE, - &mm->ex); - return; - } - } - - if (m->offline) - camel_service_disconnect (CAMEL_SERVICE (m->store), - TRUE, &mm->ex); -} - -static void set_offline_done(struct _mail_msg *mm) -{ - struct _set_offline_msg *m = (struct _set_offline_msg *)mm; - - if (m->done) - m->done(m->store, m->data); -} - -static void set_offline_free(struct _mail_msg *mm) -{ - struct _set_offline_msg *m = (struct _set_offline_msg *)mm; - - camel_object_unref(m->store); -} - -static struct _mail_msg_op set_offline_op = { - set_offline_desc, - set_offline_do, - set_offline_done, - set_offline_free, -}; - -int -mail_store_set_offline (CamelStore *store, gboolean offline, - void (*done)(CamelStore *, void *data), - void *data) -{ - struct _set_offline_msg *m; - int id; - - /* Cancel any pending connect first so the set_offline_op - * thread won't get queued behind a hung connect op. - */ - if (offline) - camel_service_cancel_connect (CAMEL_SERVICE (store)); - - m = mail_msg_new(&set_offline_op, NULL, sizeof(*m)); - m->store = store; - camel_object_ref(store); - m->offline = offline; - m->data = data; - m->done = done; - - id = m->msg.seq; - e_thread_put(mail_thread_new, (EMsg *)m); - - return id; -} - -/* ** Execute Shell Command ***************************************************** */ - -void -mail_execute_shell_command (CamelFilterDriver *driver, int argc, char **argv, void *data) -{ - if (argc <= 0) - return; - - gnome_execute_async_fds (NULL, argc, argv, TRUE); -} - -/* [Un]mark junk flag */ - -struct _mark_junk_mail_msg { - struct _mail_msg msg; - - CamelFolder *folder; - MessageList *list; - gboolean junk; -}; - -static char * -mark_junk_describe (struct _mail_msg *mm, int complete) -{ - return g_strdup (_("Changing junk status")); -} - -/* filter a folder, or a subset thereof, uses source_folder/source_uids */ -/* this is shared with fetch_mail */ -static void -mark_junk_mark (struct _mail_msg *mm) -{ - struct _mark_junk_mail_msg *m = (struct _mark_junk_mail_msg *) mm; - CamelJunkPlugin *csp = NULL; - GPtrArray *uids; - gboolean commit_reports = FALSE; - int i; - - if (m->folder == NULL) - return; - - uids = message_list_get_selected (m->list); - camel_folder_freeze (m->folder); - - for (i=0; i<uids->len; i++) { - guint32 flags; - - flags = camel_folder_get_message_flags (m->folder, uids->pdata[i]); - if (((flags & CAMEL_MESSAGE_JUNK) == CAMEL_MESSAGE_JUNK) != m->junk) { - CamelMimeMessage *msg = camel_folder_get_message (m->folder, uids->pdata[i], NULL); - - if (msg) { - csp = CAMEL_SERVICE (m->folder->parent_store)->session->junk_plugin; - if (m->junk) - camel_junk_plugin_report_junk (csp, msg); - else - camel_junk_plugin_report_notjunk (csp, msg); - - commit_reports = TRUE; - camel_object_unref (msg); - } - } - camel_folder_set_message_flags(m->folder, uids->pdata[i], - CAMEL_MESSAGE_JUNK | (m->junk ? CAMEL_MESSAGE_DELETED : 0), - m->junk ? CAMEL_MESSAGE_JUNK : 0); - } - - if (commit_reports) - camel_junk_plugin_commit_reports (csp); - - message_list_free_uids(m->list, uids); - camel_folder_thaw(m->folder); -} - -static void -mark_junk_marked (struct _mail_msg *mm) -{ -} - -static void -mark_junk_free (struct _mail_msg *mm) -{ - struct _mark_junk_mail_msg *m = (struct _mark_junk_mail_msg *)mm; - - if (m->folder) - camel_object_unref (m->folder); -} - -static struct _mail_msg_op mark_junk_op = { - mark_junk_describe, - mark_junk_mark, - mark_junk_marked, - mark_junk_free, -}; - -void -mail_mark_junk (CamelFolder *folder, MessageList *list, gboolean junk) -{ - struct _mark_junk_mail_msg *m; - - m = mail_msg_new (&mark_junk_op, NULL, sizeof (*m)); - m->folder = folder; - camel_object_ref (folder); - m->list = list; - m->junk = junk; - - e_thread_put (mail_thread_new, (EMsg *) m); -} diff --git a/mail/mail-ops.h b/mail/mail-ops.h deleted file mode 100644 index 142052277d..0000000000 --- a/mail/mail-ops.h +++ /dev/null @@ -1,167 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ - -/* - * Authors: - * Peter Williams <peterw@ximian.com> - * Michael Zucchi <notzed@ximian.com> - * - * Copyright 2000, 2001 Ximian, Inc. (www.ximian.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public - * License as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA - */ - -#ifndef MAIL_OPS_H -#define MAIL_OPS_H - -#ifdef __cplusplus -extern "C" { -#pragma } -#endif /* __cplusplus */ - -#include "camel/camel-store.h" -#include "camel/camel-folder.h" -#include "camel/camel-filter-driver.h" -#include "camel/camel-mime-message.h" -#include "camel/camel-operation.h" - -#include "message-list.h" - -#include "e-util/e-msgport.h" -#include "e-util/e-account.h" - -void mail_append_mail (CamelFolder *folder, CamelMimeMessage *message, CamelMessageInfo *info, - void (*done)(CamelFolder *folder, CamelMimeMessage *msg, CamelMessageInfo *info, int ok, - const char *appended_uid, void *data), - void *data); - -void mail_transfer_messages (CamelFolder *source, GPtrArray *uids, - gboolean delete_from_source, - const char *dest_uri, - guint32 dest_flags, - void (*done) (gboolean ok, void *data), - void *data); - -/* get a single message, asynchronously */ -void mail_get_message (CamelFolder *folder, const char *uid, - void (*done) (CamelFolder *folder, const char *uid, CamelMimeMessage *msg, void *data), - void *data, - EThread *thread); - -/* get several messages */ -void mail_get_messages (CamelFolder *folder, GPtrArray *uids, - void (*done) (CamelFolder *folder, GPtrArray *uids, GPtrArray *msgs, void *data), - void *data); - -/* same for a folder */ -int mail_get_folder (const char *uri, guint32 flags, - void (*done) (char *uri, CamelFolder *folder, void *data), void *data, - EThread *thread); - -/* and for a store */ -int mail_get_store (const char *uri, CamelOperation *op, - void (*done) (char *uri, CamelStore *store, void *data), void *data); - -/* build an attachment */ -void mail_build_attachment (CamelFolder *folder, GPtrArray *uids, - void (*done)(CamelFolder *folder, GPtrArray *messages, - CamelMimePart *part, char *subject, void *data), - void *data); - -void mail_sync_folder (CamelFolder *folder, - void (*done) (CamelFolder *folder, void *data), - void *data); - -void mail_refresh_folder (CamelFolder *folder, - void (*done) (CamelFolder *folder, void *data), - void *data); - -void mail_expunge_folder (CamelFolder *folder, - void (*done) (CamelFolder *folder, void *data), - void *data); - -void mail_empty_trash (EAccount *account, - void (*done) (EAccount *account, void *data), - void *data); - -/* get folder info asynchronously */ -int mail_get_folderinfo (CamelStore *store, CamelOperation *op, - void (*done)(CamelStore *store, CamelFolderInfo *info, void *data), - void *data); - -/* remove an existing folder */ -void mail_remove_folder (const char *uri, - void (*done) (char *uri, gboolean removed, void *data), - void *data); - -/* transfer (copy/move) a folder */ -void mail_xfer_folder (const char *src_uri, const char *dest_uri, gboolean remove_source, - void (*done) (char *src_uri, char *dest_uri, gboolean remove_source, - CamelFolder *folder, void *data), - void *data); - -/* save messages */ -int mail_save_messages (CamelFolder *folder, GPtrArray *uids, const char *path, - void (*done) (CamelFolder *folder, GPtrArray *uids, char *path, void *data), - void *data); - -int mail_save_part (CamelMimePart *part, const char *path, - void (*done)(CamelMimePart *part, char *path, int saved, void *data), - void *data); - -int mail_send_mail (const char *uri, CamelMimeMessage *message, - void (*done) (char *uri, CamelMimeMessage *message, gboolean sent, void *data), - void *data); - - -/* yeah so this is messy, but it does a lot, maybe i can consolidate all user_data's to be the one */ -void mail_send_queue (CamelFolder *queue, const char *destination, - const char *type, CamelOperation *cancel, - CamelFilterGetFolderFunc get_folder, void *get_data, - CamelFilterStatusFunc *status, void *status_data, - void (*done)(char *destination, void *data), - void *data); - -void mail_fetch_mail (const char *source, int keep, - const char *type, CamelOperation *cancel, - CamelFilterGetFolderFunc get_folder, void *get_data, - CamelFilterStatusFunc *status, void *status_data, - void (*done)(char *source, void *data), - void *data); - -void mail_filter_folder (CamelFolder *source_folder, GPtrArray *uids, - const char *type, gboolean notify, - CamelOperation *cancel); - -/* convenience function for above */ -void mail_filter_on_demand (CamelFolder *folder, GPtrArray *uids); - -/* Work Offline */ -void mail_prep_offline(const char *uri, CamelOperation *cancel, - void (*done)(const char *, void *data), - void *data); -int mail_store_set_offline(CamelStore *store, gboolean offline, - void (*done)(CamelStore *, void *data), - void *data); - -/* filter driver execute shell command async callback */ -void mail_execute_shell_command (CamelFilterDriver *driver, int argc, char **argv, void *data); - -void mail_mark_junk (CamelFolder *folder, MessageList *list, gboolean junk); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* MAIL_OPS_H */ diff --git a/mail/mail-search.glade b/mail/mail-search.glade deleted file mode 100644 index 10b84e99a2..0000000000 --- a/mail/mail-search.glade +++ /dev/null @@ -1,197 +0,0 @@ -<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*--> -<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd"> - -<glade-interface> - -<widget class="GtkDialog" id="search_message_dialog"> - <property name="visible">True</property> - <property name="title" translatable="yes">Find in Message</property> - <property name="type">GTK_WINDOW_TOPLEVEL</property> - <property name="window_position">GTK_WIN_POS_CENTER</property> - <property name="modal">False</property> - <property name="resizable">False</property> - <property name="destroy_with_parent">False</property> - <property name="has_separator">True</property> - - <child internal-child="vbox"> - <widget class="GtkVBox" id="dialog-vbox1"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">0</property> - - <child internal-child="action_area"> - <widget class="GtkHButtonBox" id="dialog-action_area1"> - <property name="visible">True</property> - <property name="layout_style">GTK_BUTTONBOX_END</property> - - <child> - <widget class="GtkButton" id="button1"> - <property name="visible">True</property> - <property name="can_default">True</property> - <property name="can_focus">True</property> - <property name="label">gtk-cancel</property> - <property name="use_stock">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="response_id">-6</property> - </widget> - </child> - - <child> - <widget class="GtkButton" id="button2"> - <property name="visible">True</property> - <property name="can_default">True</property> - <property name="can_focus">True</property> - <property name="label">gtk-find</property> - <property name="use_stock">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="response_id">-3</property> - </widget> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="pack_type">GTK_PACK_END</property> - </packing> - </child> - - <child> - <widget class="GtkFrame" id="frame1"> - <property name="border_width">6</property> - <property name="visible">True</property> - <property name="label_xalign">0</property> - <property name="label_yalign">0.5</property> - <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property> - - <child> - <widget class="GtkVBox" id="vbox1"> - <property name="border_width">6</property> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">6</property> - - <child> - <widget class="GtkHBox" id="hbox1"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">6</property> - - <child> - <widget class="GtkLabel" id="label2"> - <property name="visible">True</property> - <property name="label" translatable="yes">Find:</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkEntry" id="search_entry"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="editable">True</property> - <property name="visibility">True</property> - <property name="max_length">0</property> - <property name="text" translatable="yes"></property> - <property name="has_frame">True</property> - <property name="invisible_char" translatable="yes">*</property> - <property name="activates_default">False</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="search_matches_label"> - <property name="visible">True</property> - <property name="label" translatable="yes"></property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkCheckButton" id="search_case_check"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">Case Sensitive</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="active">False</property> - <property name="inconsistent">False</property> - <property name="draw_indicator">True</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - </widget> - </child> - - <child> - <widget class="GtkLabel" id="search_subject_label"> - <property name="visible">True</property> - <property name="label" translatable="yes">Search</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="type">label_item</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - </widget> - </child> -</widget> - -</glade-interface> diff --git a/mail/mail-security.glade b/mail/mail-security.glade deleted file mode 100644 index 5dfbed673e..0000000000 --- a/mail/mail-security.glade +++ /dev/null @@ -1,214 +0,0 @@ -<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*--> -<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd"> - -<glade-interface> - -<widget class="GtkDialog" id="message_security_dialog"> - <property name="visible">True</property> - <property name="title" translatable="yes">Security Information</property> - <property name="type">GTK_WINDOW_TOPLEVEL</property> - <property name="window_position">GTK_WIN_POS_NONE</property> - <property name="modal">False</property> - <property name="resizable">True</property> - <property name="destroy_with_parent">False</property> - <property name="has_separator">True</property> - - <child internal-child="vbox"> - <widget class="GtkVBox" id="dialog-vbox2"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">0</property> - - <child internal-child="action_area"> - <widget class="GtkHButtonBox" id="dialog-action_area2"> - <property name="visible">True</property> - <property name="layout_style">GTK_BUTTONBOX_END</property> - - <child> - <widget class="GtkButton" id="okbutton1"> - <property name="visible">True</property> - <property name="can_default">True</property> - <property name="can_focus">True</property> - <property name="label">gtk-ok</property> - <property name="use_stock">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="response_id">-5</property> - </widget> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="pack_type">GTK_PACK_END</property> - </packing> - </child> - - <child> - <widget class="GtkNotebook" id="notebook1"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="show_tabs">True</property> - <property name="show_border">True</property> - <property name="tab_pos">GTK_POS_TOP</property> - <property name="scrollable">False</property> - <property name="enable_popup">False</property> - - <child> - <widget class="GtkVBox" id="vbox161"> - <property name="border_width">6</property> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">6</property> - - <child> - <widget class="GtkFrame" id="frame5"> - <property name="visible">True</property> - <property name="label_xalign">0</property> - <property name="label_yalign">0.5</property> - <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property> - - <child> - <widget class="GtkVBox" id="signature_vbox"> - <property name="border_width">6</property> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">0</property> - - <child> - <placeholder/> - </child> - </widget> - </child> - - <child> - <widget class="GtkLabel" id="label475"> - <property name="visible">True</property> - <property name="label" translatable="yes">Digital Signature</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="type">label_item</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkFrame" id="frame6"> - <property name="visible">True</property> - <property name="label_xalign">0</property> - <property name="label_yalign">0.5</property> - <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property> - - <child> - <widget class="GtkVBox" id="encryption_vbox"> - <property name="border_width">6</property> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">0</property> - - <child> - <placeholder/> - </child> - </widget> - </child> - - <child> - <widget class="GtkLabel" id="label476"> - <property name="visible">True</property> - <property name="label" translatable="yes">Encryption</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="type">label_item</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - </widget> - <packing> - <property name="tab_expand">False</property> - <property name="tab_fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label473"> - <property name="visible">True</property> - <property name="label" translatable="yes">Summary</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="type">tab</property> - </packing> - </child> - - <child> - <placeholder/> - </child> - - <child> - <widget class="GtkLabel" id="label474"> - <property name="visible">True</property> - <property name="label" translatable="yes">Details</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="type">tab</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - </widget> - </child> -</widget> - -</glade-interface> diff --git a/mail/mail-send-recv.c b/mail/mail-send-recv.c deleted file mode 100644 index e7d546294d..0000000000 --- a/mail/mail-send-recv.c +++ /dev/null @@ -1,943 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Authors: Michael Zucchi <NotZed@ximian.com> - * - * Copyright 2001 Ximian, Inc. (www.ximian.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public - * License as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - * - */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <stdio.h> -#include <string.h> - -/* for the dialogue stuff */ -#include <glib.h> -#include <gtk/gtkmain.h> -#include <gtk/gtkdialog.h> -#include <gtk/gtkstock.h> -#include <libgnomeui/gnome-window-icon.h> - -#include "e-util/e-gtk-utils.h" - -#include "widgets/misc/e-clipped-label.h" -#include "filter/filter-filter.h" -#include "camel/camel-filter-driver.h" -#include "camel/camel-folder.h" -#include "camel/camel-operation.h" - -#include "mail.h" -#include "mail-mt.h" -#include "mail-component.h" -#include "mail-config.h" -#include "mail-session.h" -#include "mail-tools.h" -#include "mail-ops.h" -#include "mail-send-recv.h" -#include "mail-folder-cache.h" - -#define d(x) - -/* ms between status updates to the gui */ -#define STATUS_TIMEOUT (250) - -/* pseudo-uri to key the send task on */ -#define SEND_URI_KEY "send-task:" - -/* send/receive email */ - -/* ********************************************************************** */ -/* This stuff below is independent of the stuff above */ - -/* this stuff is used to keep track of which folders filters have accessed, and - what not. the thaw/refreeze thing doesn't really seem to work though */ -struct _folder_info { - char *uri; - CamelFolder *folder; - time_t update; - int count; /* how many times updated, to slow it down as we go, if we have lots */ -}; - -struct _send_data { - GList *infos; - - GtkDialog *gd; - int cancelled; - - CamelFolder *inbox; /* since we're never asked to update this one, do it ourselves */ - time_t inbox_update; - - GMutex *lock; - GHashTable *folders; - - GHashTable *active; /* send_info's by uri */ -}; - -typedef enum { - SEND_RECEIVE, /* receiver */ - SEND_SEND, /* sender */ - SEND_UPDATE, /* imap-like 'just update folder info' */ - SEND_INVALID -} send_info_t ; - -typedef enum { - SEND_ACTIVE, - SEND_CANCELLED, - SEND_COMPLETE -} send_state_t; - -struct _send_info { - send_info_t type; /* 0 = fetch, 1 = send */ - CamelOperation *cancel; - char *uri; - int keep; - send_state_t state; - GtkProgressBar *bar; - GtkButton *stop; - EClippedLabel *status; - - int timeout_id; - char *what; - int pc; - - /*time_t update;*/ - struct _send_data *data; -}; - -static struct _send_data *send_data = NULL; -static GtkWidget *send_recv_dialogue = NULL; - -static struct _send_data *setup_send_data(void) -{ - struct _send_data *data; - - if (send_data == NULL) { - send_data = data = g_malloc0(sizeof(*data)); - data->lock = g_mutex_new(); - data->folders = g_hash_table_new(g_str_hash, g_str_equal); - data->inbox = mail_tool_get_local_inbox(NULL); - data->active = g_hash_table_new(g_str_hash, g_str_equal); - } - return send_data; -} - -static void -receive_cancel(GtkButton *button, struct _send_info *info) -{ - if (info->state == SEND_ACTIVE) { - camel_operation_cancel(info->cancel); - if (info->status) - e_clipped_label_set_text(info->status, _("Cancelling...")); - info->state = SEND_CANCELLED; - } - if (info->stop) - gtk_widget_set_sensitive((GtkWidget *)info->stop, FALSE); -} - -static void -free_folder_info(void *key, struct _folder_info *info, void *data) -{ - /*camel_folder_thaw (info->folder); */ - mail_sync_folder(info->folder, NULL, NULL); - camel_object_unref(info->folder); - g_free(info->uri); - g_free(info); -} - -static void free_send_info(void *key, struct _send_info *info, void *data) -{ - g_free(info->uri); - camel_operation_unref(info->cancel); - if (info->timeout_id != 0) - g_source_remove(info->timeout_id); - g_free(info->what); - g_free(info); -} - -static void -free_send_data(void) -{ - struct _send_data *data = send_data; - - g_assert(g_hash_table_size(data->active) == 0); - - if (data->inbox) { - mail_sync_folder(data->inbox, NULL, NULL); - /*camel_folder_thaw (data->inbox); */ - camel_object_unref(data->inbox); - } - - g_list_free(data->infos); - g_hash_table_foreach(data->active, (GHFunc)free_send_info, NULL); - g_hash_table_destroy(data->active); - g_hash_table_foreach(data->folders, (GHFunc)free_folder_info, NULL); - g_hash_table_destroy(data->folders); - g_mutex_free(data->lock); - g_free(data); - send_data = NULL; -} - -static void cancel_send_info(void *key, struct _send_info *info, void *data) -{ - receive_cancel(info->stop, info); -} - -static void hide_send_info(void *key, struct _send_info *info, void *data) -{ - info->stop = NULL; - info->bar = NULL; - info->status = NULL; - - if (info->timeout_id != 0) { - g_source_remove (info->timeout_id); - info->timeout_id = 0; - } -} - -static void -dialog_destroy_cb (struct _send_data *data, GObject *deadbeef) -{ - g_hash_table_foreach (data->active, (GHFunc) hide_send_info, NULL); - data->gd = NULL; - send_recv_dialogue = NULL; -} - -static void -dialogue_response(GtkDialog *gd, int button, struct _send_data *data) -{ - switch(button) { - case GTK_RESPONSE_CANCEL: - d(printf("cancelled whole thing\n")); - if (!data->cancelled) { - data->cancelled = TRUE; - g_hash_table_foreach(data->active, (GHFunc)cancel_send_info, NULL); - } - gtk_dialog_set_response_sensitive(gd, GTK_RESPONSE_CANCEL, FALSE); - break; - default: - d(printf("hiding dialogue\n")); - g_hash_table_foreach(data->active, (GHFunc)hide_send_info, NULL); - data->gd = NULL; - /*gtk_widget_destroy((GtkWidget *)gd);*/ - break; - } -} - -static void operation_status(CamelOperation *op, const char *what, int pc, void *data); -static int operation_status_timeout(void *data); - -static char * -format_url(const char *internal_url) -{ - CamelURL *url; - char *pretty_url; - - url = camel_url_new(internal_url, NULL); - if (url->host) - pretty_url = g_strdup_printf(_("Server: %s, Type: %s"), url->host, url->protocol); - else if (url->path) - pretty_url = g_strdup_printf(_("Path: %s, Type: %s"), url->path, url->protocol); - else - pretty_url = g_strdup_printf(_("Type: %s"), url->protocol); - - camel_url_free(url); - - return pretty_url; -} - -static send_info_t get_receive_type(const char *url) -{ - CamelProvider *provider; - CamelException ex; - - camel_exception_init(&ex); - provider = camel_session_get_provider (session, url, &ex); - camel_exception_clear(&ex); - if (!provider) - return SEND_INVALID; - - if (provider->object_types[CAMEL_PROVIDER_STORE]) { - if (provider->flags & CAMEL_PROVIDER_IS_STORAGE) - return SEND_UPDATE; - else - return SEND_RECEIVE; - } else if (provider->object_types[CAMEL_PROVIDER_TRANSPORT]) { - return SEND_SEND; - } - - return SEND_INVALID; -} - -static struct _send_data * -build_dialogue (EAccountList *accounts, CamelFolder *outbox, const char *destination) -{ - GtkDialog *gd; - GtkTable *table; - int row, num_sources; - GList *list = NULL; - struct _send_data *data; - GtkWidget *send_icon, *recv_icon; - GtkLabel *label; - EClippedLabel *status_label; - GtkProgressBar *bar; - GtkButton *stop; - GtkHSeparator *line; - struct _send_info *info; - char *pretty_url; - EAccount *account; - EIterator *iter; - - gd = (GtkDialog *)send_recv_dialogue = gtk_dialog_new_with_buttons(_("Send & Receive Mail"), NULL, GTK_DIALOG_NO_SEPARATOR, NULL); - stop = (GtkButton *)e_gtk_button_new_with_icon(_("Cancel _All"), GTK_STOCK_CANCEL); - gtk_widget_show((GtkWidget *)stop); - gtk_dialog_add_action_widget(gd, (GtkWidget *)stop, GTK_RESPONSE_CANCEL); - gnome_window_icon_set_from_file (GTK_WINDOW (gd), EVOLUTION_ICONSDIR "/send-receive.xpm"); - - num_sources = 0; - - iter = e_list_get_iterator ((EList *) accounts); - while (e_iterator_is_valid (iter)) { - account = (EAccount *) e_iterator_get (iter); - - if (account->source->url) - num_sources++; - - e_iterator_next (iter); - } - - g_object_unref (iter); - - table = (GtkTable *) gtk_table_new (num_sources, 4, FALSE); - gtk_container_set_border_width ((GtkContainer *) table, 3); - - gtk_box_pack_start (GTK_BOX (gd->vbox), GTK_WIDGET (table), TRUE, TRUE, 0); - - /* must bet setup after send_recv_dialogue as it may re-trigger send-recv button */ - data = setup_send_data (); - - row = 0; - iter = e_list_get_iterator ((EList *) accounts); - while (e_iterator_is_valid (iter)) { - EAccountService *source; - - account = (EAccount *) e_iterator_get (iter); - - source = account->source; - if (!account->enabled || !source->url) { - e_iterator_next (iter); - continue; - } - - /* see if we have an outstanding download active */ - info = g_hash_table_lookup (data->active, source->url); - if (info == NULL) { - send_info_t type; - - type = get_receive_type (source->url); - if (type == SEND_INVALID || type == SEND_SEND) { - e_iterator_next (iter); - continue; - } - - info = g_malloc0 (sizeof (*info)); - info->type = type; - - d(printf("adding source %s\n", source->url)); - - info->uri = g_strdup (source->url); - info->keep = source->keep_on_server; - info->cancel = camel_operation_new (operation_status, info); - info->state = SEND_ACTIVE; - info->timeout_id = g_timeout_add (STATUS_TIMEOUT, operation_status_timeout, info); - - g_hash_table_insert (data->active, info->uri, info); - list = g_list_prepend (list, info); - } else if (info->bar != NULL) { - /* incase we get the same source pop up again */ - e_iterator_next (iter); - continue; - } else if (info->timeout_id == 0) - info->timeout_id = g_timeout_add (STATUS_TIMEOUT, operation_status_timeout, info); - - recv_icon = gtk_image_new_from_file (EVOLUTION_BUTTONSDIR "/receive-24.png"); - - pretty_url = format_url (source->url); - label = (GtkLabel *)gtk_label_new (pretty_url); - g_free (pretty_url); - - bar = (GtkProgressBar *)gtk_progress_bar_new (); - - stop = (GtkButton *)e_gtk_button_new_with_icon(_("Cancel"), GTK_STOCK_CANCEL); - - status_label = (EClippedLabel *)e_clipped_label_new((info->type == SEND_UPDATE)?_("Updating..."):_("Waiting..."), - PANGO_WEIGHT_NORMAL, 1.0); - - /* g_object_set(data->label, "bold", TRUE, NULL); */ - gtk_misc_set_alignment (GTK_MISC (label), 0, .5); - gtk_misc_set_alignment (GTK_MISC (status_label), 0, .5); - - gtk_table_attach (table, (GtkWidget *)recv_icon, 0, 1, row, row+2, GTK_EXPAND | GTK_FILL, 0, 3, 3); - gtk_table_attach (table, (GtkWidget *)label, 1, 2, row, row+1, GTK_EXPAND | GTK_FILL, 0, 3, 3); - gtk_table_attach (table, (GtkWidget *)bar, 2, 3, row, row+2, GTK_EXPAND | GTK_FILL, 0, 3, 3); - gtk_table_attach (table, (GtkWidget *)stop, 3, 4, row, row+2, GTK_EXPAND | GTK_FILL, 0, 3, 3); - gtk_table_attach (table, (GtkWidget *)status_label, 1, 2, row+1, row+2, GTK_EXPAND | GTK_FILL, 0, 3, 3); - - info->bar = bar; - info->status = status_label; - info->stop = stop; - info->data = data; - - g_signal_connect (stop, "clicked", G_CALLBACK(receive_cancel), info); - e_iterator_next (iter); - row = row + 2; - } - - g_object_unref (iter); - - if (outbox && destination) { - info = g_hash_table_lookup (data->active, SEND_URI_KEY); - if (info == NULL) { - info = g_malloc0 (sizeof (*info)); - info->type = SEND_SEND; - d(printf("adding dest %s\n", destination)); - - info->uri = g_strdup (destination); - info->keep = FALSE; - info->cancel = camel_operation_new (operation_status, info); - info->state = SEND_ACTIVE; - info->timeout_id = g_timeout_add (STATUS_TIMEOUT, operation_status_timeout, info); - - g_hash_table_insert (data->active, SEND_URI_KEY, info); - list = g_list_prepend (list, info); - } else if (info->timeout_id == 0) - info->timeout_id = g_timeout_add (STATUS_TIMEOUT, operation_status_timeout, info); - - send_icon = gtk_image_new_from_file (EVOLUTION_BUTTONSDIR "/send-24.png"); - - pretty_url = format_url (destination); - label = (GtkLabel *)gtk_label_new (pretty_url); - g_free (pretty_url); - - bar = (GtkProgressBar *)gtk_progress_bar_new (); - stop = (GtkButton *)e_gtk_button_new_with_icon(_("Cancel"), GTK_STOCK_CANCEL); - - status_label = (EClippedLabel *)e_clipped_label_new(_("Waiting..."), PANGO_WEIGHT_NORMAL, 1.0); - - gtk_misc_set_alignment (GTK_MISC (label), 0, .5); - gtk_misc_set_alignment (GTK_MISC (status_label), 0, .5); - - gtk_table_attach (table, GTK_WIDGET (send_icon), 0, 1, row, row+2, GTK_EXPAND | GTK_FILL, 0, 3, 3); - gtk_table_attach (table, GTK_WIDGET (label), 1, 2, row, row+1, GTK_EXPAND | GTK_FILL, 0, 3, 3); - gtk_table_attach (table, GTK_WIDGET (bar), 2, 3, row, row+2, GTK_EXPAND | GTK_FILL, 0, 3, 3); - gtk_table_attach (table, GTK_WIDGET (stop), 3, 4, row, row+2, GTK_EXPAND | GTK_FILL, 0, 3, 3); - gtk_table_attach (table, GTK_WIDGET (status_label), 1, 2, row+1, row+2, GTK_EXPAND | GTK_FILL, 0, 3, 3); - - info->bar = bar; - info->stop = stop; - info->data = data; - info->status = status_label; - - g_signal_connect(stop, "clicked", G_CALLBACK(receive_cancel), info); - gtk_widget_show_all (GTK_WIDGET (table)); - } - - gtk_widget_show (GTK_WIDGET (gd)); - - g_signal_connect (gd, "response", G_CALLBACK (dialogue_response), data); - - g_object_weak_ref ((GObject *) gd, (GWeakNotify) dialog_destroy_cb, data); - - data->infos = list; - data->gd = gd; - - return data; -} - -static void -update_folders(char *uri, struct _folder_info *info, void *data) -{ - time_t now = *((time_t *)data); - - d(printf("checking update for folder: %s\n", info->uri)); - - /* let it flow through to the folders every 10 seconds */ - /* we back off slowly as we progress */ - if (now > info->update+10+info->count*5) { - d(printf("upating a folder: %s\n", info->uri)); - /*camel_folder_thaw(info->folder); - camel_folder_freeze(info->folder);*/ - info->update = now; - info->count++; - } -} - -static void set_send_status(struct _send_info *info, const char *desc, int pc) -{ - /* FIXME: LOCK */ - g_free(info->what); - info->what = g_strdup(desc); - info->pc = pc; -} - -static void -receive_status (CamelFilterDriver *driver, enum camel_filter_status_t status, int pc, const char *desc, void *data) -{ - struct _send_info *info = data; - time_t now = time(0); - - /* let it flow through to the folder, every now and then too? */ - g_hash_table_foreach(info->data->folders, (GHFunc)update_folders, &now); - - if (info->data->inbox && now > info->data->inbox_update+20) { - d(printf("updating inbox too\n")); - /* this doesn't seem to work right :( */ - /*camel_folder_thaw(info->data->inbox); - camel_folder_freeze(info->data->inbox);*/ - info->data->inbox_update = now; - } - - /* we just pile them onto the port, assuming it can handle it. - We could also have a receiver port and see if they've been processed - yet, so if this is necessary its not too hard to add */ - /* the mail_gui_port receiver will free everything for us */ - switch (status) { - case CAMEL_FILTER_STATUS_START: - case CAMEL_FILTER_STATUS_END: - set_send_status(info, desc, pc); - break; - default: - break; - } -} - -static int operation_status_timeout(void *data) -{ - struct _send_info *info = data; - - if (info->bar) { - gtk_progress_bar_set_fraction((GtkProgressBar *)info->bar, (gfloat)(info->pc/100.0)); - if (info->what) - e_clipped_label_set_text(info->status, info->what); - return TRUE; - } - - return FALSE; -} - -/* for camel operation status */ -static void operation_status(CamelOperation *op, const char *what, int pc, void *data) -{ - struct _send_info *info = data; - - /*printf("Operation '%s', percent %d\n");*/ - switch (pc) { - case CAMEL_OPERATION_START: - pc = 0; - break; - case CAMEL_OPERATION_END: - pc = 100; - break; - } - - set_send_status(info, what, pc); -} - -/* when receive/send is complete */ -static void -receive_done (char *uri, void *data) -{ - struct _send_info *info = data; - - if (info->bar) { - gtk_progress_bar_set_fraction((GtkProgressBar *)info->bar, (gfloat)1.0); - - switch(info->state) { - case SEND_CANCELLED: - e_clipped_label_set_text(info->status, _("Cancelled.")); - break; - default: - info->state = SEND_COMPLETE; - e_clipped_label_set_text(info->status, _("Complete")); - } - } - - if (info->stop) - gtk_widget_set_sensitive((GtkWidget *)info->stop, FALSE); - - /* remove/free this active download */ - d(printf("%s: freeing info %p\n", G_GNUC_FUNCTION, info)); - if (info->type == SEND_SEND) - g_hash_table_remove(info->data->active, SEND_URI_KEY); - else - g_hash_table_remove(info->data->active, info->uri); - info->data->infos = g_list_remove(info->data->infos, info); - - if (g_hash_table_size(info->data->active) == 0) { - if (info->data->gd) - gtk_widget_destroy((GtkWidget *)info->data->gd); - free_send_data(); - } - - free_send_info(NULL, info, NULL); -} - -/* same for updating */ -static void -receive_update_done(CamelStore *store, CamelFolderInfo *info, void *data) -{ - receive_done("", data); -} - -/* although we dont do anythign smart here yet, there is no need for this interface to - be available to anyone else. - This can also be used to hook into which folders are being updated, and occasionally - let them refresh */ -static CamelFolder * -receive_get_folder(CamelFilterDriver *d, const char *uri, void *data, CamelException *ex) -{ - struct _send_info *info = data; - CamelFolder *folder; - struct _folder_info *oldinfo; - char *oldkey; - - g_mutex_lock(info->data->lock); - oldinfo = g_hash_table_lookup(info->data->folders, uri); - g_mutex_unlock(info->data->lock); - if (oldinfo) { - camel_object_ref(oldinfo->folder); - return oldinfo->folder; - } - folder = mail_tool_uri_to_folder (uri, 0, ex); - if (!folder) - return NULL; - - /* we recheck that the folder hasn't snuck in while we were loading it... */ - /* and we assume the newer one is the same, but unref the old one anyway */ - g_mutex_lock(info->data->lock); - - if (g_hash_table_lookup_extended(info->data->folders, uri, (void **)&oldkey, (void **)&oldinfo)) { - camel_object_unref(oldinfo->folder); - oldinfo->folder = folder; - } else { - /*camel_folder_freeze (folder); */ - oldinfo = g_malloc0(sizeof(*oldinfo)); - oldinfo->folder = folder; - oldinfo->uri = g_strdup(uri); - g_hash_table_insert(info->data->folders, oldinfo->uri, oldinfo); - } - - camel_object_ref (folder); - - g_mutex_unlock(info->data->lock); - - return folder; -} - -static void -receive_update_got_folderinfo (CamelStore *store, CamelFolderInfo *info, void *data) -{ - receive_done ("", data); -} - -static void -receive_update_got_store (char *uri, CamelStore *store, void *data) -{ - struct _send_info *info = data; - - if (store) { - mail_get_folderinfo (store, info->cancel, receive_update_got_folderinfo, info); - } else { - receive_done ("", info); - } -} - -GtkWidget *mail_send_receive (void) -{ - extern CamelFolder *outbox_folder; - struct _send_data *data; - EAccountList *accounts; - EAccount *account; - GList *scan; - - if (send_recv_dialogue != NULL) { - if (GTK_WIDGET_REALIZED(send_recv_dialogue)) { - gdk_window_show(send_recv_dialogue->window); - gdk_window_raise(send_recv_dialogue->window); - } - return send_recv_dialogue; - } - - if (!camel_session_is_online (session)) - return send_recv_dialogue; - - account = mail_config_get_default_account (); - if (!account || !account->transport->url) - return send_recv_dialogue; - - accounts = mail_config_get_accounts (); - - data = build_dialogue (accounts, outbox_folder, account->transport->url); - scan = data->infos; - while (scan) { - struct _send_info *info = scan->data; - - switch(info->type) { - case SEND_RECEIVE: - mail_fetch_mail(info->uri, info->keep, - FILTER_SOURCE_INCOMING, - info->cancel, - receive_get_folder, info, - receive_status, info, - receive_done, info); - break; - case SEND_SEND: - /* todo, store the folder in info? */ - mail_send_queue(outbox_folder, info->uri, - FILTER_SOURCE_OUTGOING, - info->cancel, - receive_get_folder, info, - receive_status, info, - receive_done, info); - break; - case SEND_UPDATE: - mail_get_store(info->uri, info->cancel, receive_update_got_store, info); - break; - default: - g_assert_not_reached (); - } - scan = scan->next; - } - - return send_recv_dialogue; -} - -struct _auto_data { - char *uri; - int keep; /* keep on server flag */ - int period; /* in seconds */ - int timeout_id; -}; - -static GHashTable *auto_active; - -static gboolean -auto_timeout(void *data) -{ - struct _auto_data *info = data; - - if (camel_session_is_online(session)) - mail_receive_uri(info->uri, info->keep); - - return TRUE; -} - -static void auto_setup_set(void *key, struct _auto_data *info, GHashTable *set) -{ - g_hash_table_insert(set, info->uri, info); -} - -static void auto_clean_set(void *key, struct _auto_data *info, GHashTable *set) -{ - d(printf("removing auto-check for %s %p\n", info->uri, info)); - g_hash_table_remove(set, info->uri); - g_source_remove(info->timeout_id); - g_free(info->uri); - g_free(info); -} - -/* call to setup initial, and after changes are made to the config */ -/* FIXME: Need a cleanup funciton for when object is deactivated */ -void -mail_autoreceive_setup (void) -{ - EAccountList *accounts; - GHashTable *set_hash; - EIterator *iter; - - accounts = mail_config_get_accounts (); - - if (auto_active == NULL) - auto_active = g_hash_table_new(g_str_hash, g_str_equal); - - set_hash = g_hash_table_new(g_str_hash, g_str_equal); - g_hash_table_foreach(auto_active, (GHFunc)auto_setup_set, set_hash); - - iter = e_list_get_iterator ((EList *) accounts); - while (e_iterator_is_valid (iter)) { - EAccountService *source; - EAccount *account; - - account = (EAccount *) e_iterator_get (iter); - source = account->source; - - if (account->enabled && source->url && source->auto_check) { - struct _auto_data *info; - - d(printf("setting up auto-receive mail for : %s\n", source->url)); - - g_hash_table_remove(set_hash, source->url); - info = g_hash_table_lookup(auto_active, source->url); - if (info) { - info->keep = source->keep_on_server; - if (info->period != source->auto_check_time*60) { - info->period = source->auto_check_time*60; - g_source_remove(info->timeout_id); - info->timeout_id = g_timeout_add(info->period*1000, auto_timeout, info); - } - } else { - info = g_malloc0(sizeof(*info)); - info->uri = g_strdup(source->url); - info->keep = source->keep_on_server; - info->period = source->auto_check_time*60; - info->timeout_id = g_timeout_add(info->period*1000, auto_timeout, info); - g_hash_table_insert(auto_active, info->uri, info); - /* If we do this at startup, it can cause the logon dialogue to be hidden, - so lets not */ - /*mail_receive_uri(source->url, source->keep_on_server);*/ - } - } - - e_iterator_next (iter); - } - - g_object_unref (iter); - - g_hash_table_foreach(set_hash, (GHFunc)auto_clean_set, auto_active); - g_hash_table_destroy(set_hash); -} - -/* we setup the download info's in a hashtable, if we later need to build the gui, we insert - them in to add them. */ -void -mail_receive_uri (const char *uri, int keep) -{ - struct _send_info *info; - struct _send_data *data; - extern CamelFolder *outbox_folder; - send_info_t type; - - data = setup_send_data(); - info = g_hash_table_lookup(data->active, uri); - if (info != NULL) { - d(printf("download of %s still in progress\n", uri)); - return; - } - - d(printf("starting non-interactive download of '%s'\n", uri)); - - type = get_receive_type (uri); - if (type == SEND_INVALID || type == SEND_SEND) { - d(printf ("unsupported provider: '%s'\n", uri)); - return; - } - - info = g_malloc0 (sizeof (*info)); - info->type = type; - info->bar = NULL; - info->status = NULL; - info->uri = g_strdup (uri); - info->keep = keep; - info->cancel = camel_operation_new (operation_status, info); - info->stop = NULL; - info->data = data; - info->state = SEND_ACTIVE; - info->timeout_id = 0; - - d(printf("Adding new info %p\n", info)); - - g_hash_table_insert (data->active, info->uri, info); - - switch (info->type) { - case SEND_RECEIVE: - mail_fetch_mail (info->uri, info->keep, - FILTER_SOURCE_INCOMING, - info->cancel, - receive_get_folder, info, - receive_status, info, - receive_done, info); - break; - case SEND_SEND: - /* todo, store the folder in info? */ - mail_send_queue (outbox_folder, info->uri, - FILTER_SOURCE_OUTGOING, - info->cancel, - receive_get_folder, info, - receive_status, info, - receive_done, info); - break; - case SEND_UPDATE: - mail_get_store (info->uri, info->cancel, receive_update_got_store, info); - break; - default: - g_assert_not_reached (); - } -} - -void -mail_send (void) -{ - extern CamelFolder *outbox_folder; - EAccountService *transport; - struct _send_info *info; - struct _send_data *data; - send_info_t type; - - transport = mail_config_get_default_transport (); - if (!transport || !transport->url) - return; - - data = setup_send_data (); - info = g_hash_table_lookup (data->active, SEND_URI_KEY); - if (info != NULL) { - d(printf("send of %s still in progress\n", transport->url)); - return; - } - - d(printf("starting non-interactive send of '%s'\n", transport->url)); - - type = get_receive_type (transport->url); - if (type == SEND_INVALID) { - d(printf ("unsupported provider: '%s'\n", transport->url)); - return; - } - - info = g_malloc0 (sizeof (*info)); - info->type = SEND_SEND; - info->bar = NULL; - info->status = NULL; - info->uri = g_strdup (transport->url); - info->keep = FALSE; - info->cancel = camel_operation_new (operation_status, info); - info->stop = NULL; - info->data = data; - info->state = SEND_ACTIVE; - info->timeout_id = 0; - - d(printf("Adding new info %p\n", info)); - - g_hash_table_insert (data->active, SEND_URI_KEY, info); - - /* todo, store the folder in info? */ - mail_send_queue (outbox_folder, info->uri, - FILTER_SOURCE_OUTGOING, - info->cancel, - receive_get_folder, info, - receive_status, info, - receive_done, info); -} diff --git a/mail/mail-send-recv.h b/mail/mail-send-recv.h deleted file mode 100644 index d97f06222e..0000000000 --- a/mail/mail-send-recv.h +++ /dev/null @@ -1,45 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Authors: Michael Zucchi <NotZed@ximian.com> - * - * Copyright 2001 Ximian, Inc. (www.ximian.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public - * License as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - * - */ - -#ifndef MAIL_SEND_RECV_H -#define MAIL_SEND_RECV_H - -#ifdef __cplusplus -extern "C" { -#pragma } -#endif /* __cplusplus */ - -#include "mail-config.h" - -/* send/receive all uri's */ -GtkWidget *mail_send_receive(void); -/* receive a single uri */ -void mail_receive_uri(const char *uri, int keep); -void mail_send (void); -/* setup auto receive stuff */ -void mail_autoreceive_setup(void); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* ! MAIL_SEND_RECV_H */ diff --git a/mail/mail-session.c b/mail/mail-session.c deleted file mode 100644 index 75f95f906b..0000000000 --- a/mail/mail-session.c +++ /dev/null @@ -1,855 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* mail-session.c: handles the session information and resource manipulation */ -/* - * Copyright 2001 Ximian, Inc. (www.ximian.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public - * License as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - * - */ - - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <stdlib.h> -#include <string.h> - -#include <gtk/gtkdialog.h> -#include <gtk/gtkstock.h> - -#include <gconf/gconf.h> -#include <gconf/gconf-client.h> - -#include <libgnome/gnome-config.h> -#include <libgnome/gnome-sound.h> - -#include "camel/camel-filter-driver.h" -#include "filter/filter-context.h" -#include "filter/filter-filter.h" -#include "mail.h" -#include "mail-component.h" -#include "mail-config.h" -#include "mail-session.h" -#include "mail-tools.h" -#include "mail-mt.h" -#include "mail-ops.h" -#include "e-util/e-passwords.h" -#include "e-util/e-msgport.h" -#include "em-junk-filter.h" - -#define d(x) - -CamelSession *session; -static int session_check_junk_notify_id = -1; - -#define MAIL_SESSION_TYPE (mail_session_get_type ()) -#define MAIL_SESSION(obj) (CAMEL_CHECK_CAST((obj), MAIL_SESSION_TYPE, MailSession)) -#define MAIL_SESSION_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), MAIL_SESSION_TYPE, MailSessionClass)) -#define MAIL_IS_SESSION(o) (CAMEL_CHECK_TYPE((o), MAIL_SESSION_TYPE)) - -#define MAIL_SESSION_LOCK(s, l) (e_mutex_lock(((MailSession *)s)->l)) -#define MAIL_SESSION_UNLOCK(s, l) (e_mutex_unlock(((MailSession *)s)->l)) - -typedef struct _MailSession { - CamelSession parent_object; - - gboolean interactive; - FILE *filter_logfile; - - EMutex *lock; - - MailAsyncEvent *async; -} MailSession; - -typedef struct _MailSessionClass { - CamelSessionClass parent_class; - -} MailSessionClass; - -static CamelSessionClass *ms_parent_class; - -static char *get_password(CamelSession *session, const char *prompt, gboolean reprompt, gboolean secret, CamelService *service, const char *item, CamelException *ex); -static void forget_password(CamelSession *session, CamelService *service, const char *item, CamelException *ex); -static gboolean alert_user(CamelSession *session, CamelSessionAlertType type, const char *prompt, gboolean cancel); -static CamelFilterDriver *get_filter_driver(CamelSession *session, const char *type, CamelException *ex); - -static void ms_thread_status(CamelSession *session, CamelSessionThreadMsg *msg, const char *text, int pc); -static void *ms_thread_msg_new(CamelSession *session, CamelSessionThreadOps *ops, unsigned int size); -static void ms_thread_msg_free(CamelSession *session, CamelSessionThreadMsg *m); - -static void -init (MailSession *session) -{ - session->lock = e_mutex_new(E_MUTEX_REC); - session->async = mail_async_event_new(); -} - -static void -finalise (MailSession *session) -{ - if (session_check_junk_notify_id != -1) - gconf_client_notify_remove (mail_config_get_gconf_client (), session_check_junk_notify_id); - - mail_async_event_destroy(session->async); - e_mutex_destroy(session->lock); -} - -static void -class_init (MailSessionClass *mail_session_class) -{ - CamelSessionClass *camel_session_class = CAMEL_SESSION_CLASS (mail_session_class); - - /* virtual method override */ - camel_session_class->get_password = get_password; - camel_session_class->forget_password = forget_password; - camel_session_class->alert_user = alert_user; - camel_session_class->get_filter_driver = get_filter_driver; - - camel_session_class->thread_msg_new = ms_thread_msg_new; - camel_session_class->thread_msg_free = ms_thread_msg_free; - camel_session_class->thread_status = ms_thread_status; -} - -static CamelType -mail_session_get_type (void) -{ - static CamelType mail_session_type = CAMEL_INVALID_TYPE; - - if (mail_session_type == CAMEL_INVALID_TYPE) { - ms_parent_class = (CamelSessionClass *)camel_session_get_type(); - mail_session_type = camel_type_register ( - camel_session_get_type (), - "MailSession", - sizeof (MailSession), - sizeof (MailSessionClass), - (CamelObjectClassInitFunc) class_init, - NULL, - (CamelObjectInitFunc) init, - (CamelObjectFinalizeFunc) finalise); - } - - return mail_session_type; -} - - -static char * -make_key (CamelService *service, const char *item) -{ - char *key; - - if (service) - key = camel_url_to_string (service->url, CAMEL_URL_HIDE_PASSWORD | CAMEL_URL_HIDE_PARAMS); - else - key = g_strdup (item); - - return key; -} - -/* ********************************************************************** */ - -static GtkDialog *password_dialog = NULL; -static EDList password_list = E_DLIST_INITIALISER(password_list); - -struct _pass_msg { - struct _mail_msg msg; - - CamelSession *session; - const char *prompt; - gboolean reprompt; - gboolean secret; - CamelService *service; - const char *item; - CamelException *ex; - - char *service_url; - char *key; - - EAccountService *config_service; - GtkWidget *check; - GtkWidget *entry; - char *result; - int ismain; -}; - -static void do_get_pass(struct _mail_msg *mm); - -static void -pass_activate (GtkEntry *entry, void *data) -{ - if (password_dialog) - gtk_dialog_response (password_dialog, GTK_RESPONSE_OK); -} - -static void -pass_response (GtkDialog *dialog, int button, void *data) -{ - struct _pass_msg *m = data; - - switch (button) { - case GTK_RESPONSE_OK: - { - gboolean cache, remember; - - m->result = g_strdup (gtk_entry_get_text ((GtkEntry *) m->entry)); - remember = cache = m->check ? gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (m->check)) : FALSE; - - if (m->service_url) { - if (m->config_service) { - mail_config_service_set_save_passwd (m->config_service, cache); - - /* set `cache' to TRUE because people don't want to have to - re-enter their passwords for this session even if they told - us not to cache their passwords in the dialog...*sigh* */ - cache = TRUE; - } - } else { - /* we can't remember the password if it isn't for an account (pgp?) */ - remember = FALSE; - } - - if (cache) { - /* cache the password for the session */ - e_passwords_add_password (m->key, m->result); - - /* should we remember it between sessions? */ - if (remember) - e_passwords_remember_password ("Mail", m->key); - } - break; - } - default: - camel_exception_set (m->ex, CAMEL_EXCEPTION_USER_CANCEL, _("User canceled operation.")); - break; - } - - gtk_widget_destroy ((GtkWidget *) dialog); - - password_dialog = NULL; - e_msgport_reply ((EMsg *)m); - - if ((m = (struct _pass_msg *) e_dlist_remhead (&password_list))) - do_get_pass ((struct _mail_msg *) m); -} - -static void -request_password (struct _pass_msg *m) -{ - EAccount *mca = NULL; - char *title; - - /* If we already have a password_dialog up, save this request till later */ - if (!m->ismain && password_dialog) { - e_dlist_addtail (&password_list, (EDListNode *)m); - return; - } - - if (m->service_url) { - if ((mca = mail_config_get_account_by_source_url (m->service_url))) - m->config_service = mca->source; - else if ((mca = mail_config_get_account_by_transport_url (m->service_url))) - m->config_service = mca->transport; - } - - if (mca) - title = g_strdup_printf (_("Enter Password for %s"), mca->name); - else - title = g_strdup (_("Enter Password")); - - password_dialog = (GtkDialog *) gtk_message_dialog_new (NULL, 0, GTK_MESSAGE_QUESTION, - GTK_BUTTONS_OK_CANCEL, "%s", m->prompt); - gtk_window_set_title (GTK_WINDOW (password_dialog), title); - gtk_dialog_set_default_response (password_dialog, GTK_RESPONSE_OK); - g_free (title); - - gtk_container_set_border_width ((GtkContainer *) password_dialog, 6); - - m->entry = gtk_entry_new (); - gtk_entry_set_visibility ((GtkEntry *) m->entry, !m->secret); - g_signal_connect (m->entry, "activate", G_CALLBACK (pass_activate), password_dialog); - gtk_box_pack_start (GTK_BOX (GTK_DIALOG (password_dialog)->vbox), m->entry, TRUE, FALSE, 3); - gtk_widget_show (m->entry); - - if (m->reprompt && m->result) { - gtk_entry_set_text ((GtkEntry *) m->entry, m->result); - g_free (m->result); - m->result = NULL; - } - - if (m->service_url == NULL || m->service != NULL) { - m->check = gtk_check_button_new_with_mnemonic (m->service_url ? _("_Remember this password") : - _("_Remember this password for the remainder of this session")); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (m->check), - m->config_service ? m->config_service->save_passwd : FALSE); - gtk_box_pack_start (GTK_BOX (GTK_DIALOG (password_dialog)->vbox), m->check, TRUE, FALSE, 3); - gtk_widget_show (m->check); - } - - if (m->ismain) { - pass_response(password_dialog, gtk_dialog_run (password_dialog), m); - } else { - g_signal_connect (password_dialog, "response", G_CALLBACK (pass_response), m); - gtk_widget_show ((GtkWidget *) password_dialog); - } -} - -static void -do_get_pass(struct _mail_msg *mm) -{ - struct _pass_msg *m = (struct _pass_msg *)mm; - MailSession *mail_session = MAIL_SESSION (m->session); - - if (!strcmp (m->item, "popb4smtp_uri")) { - char *url = camel_url_to_string (m->service->url, 0); - EAccount *account = mail_config_get_account_by_transport_url (url); - - g_free(url); - if (account) - m->result = g_strdup(account->source->url); - } else if (m->key) { - m->result = e_passwords_get_password ("Mail", m->key); - if (m->result == NULL || m->reprompt) { - if (mail_session->interactive) { - request_password(m); - return; - } - } - } - - e_msgport_reply((EMsg *)mm); -} - -static void -do_free_pass(struct _mail_msg *mm) -{ - struct _pass_msg *m = (struct _pass_msg *)mm; - - g_free(m->service_url); - g_free(m->key); -} - -static struct _mail_msg_op get_pass_op = { - NULL, - do_get_pass, - NULL, - do_free_pass, -}; - -static char * -get_password (CamelSession *session, const char *prompt, gboolean reprompt, gboolean secret, - CamelService *service, const char *item, CamelException *ex) -{ - struct _pass_msg *m, *r; - EMsgPort *pass_reply; - char *ret; - - /* We setup an async request and send it off, and wait for it to return */ - /* If we're really in main, we dont of course ... - ... but this shouldn't be allowed because of locking issues */ - pass_reply = e_msgport_new (); - m = mail_msg_new(&get_pass_op, pass_reply, sizeof(struct _pass_msg)); - m->ismain = pthread_self() == mail_gui_thread; - m->session = session; - m->prompt = prompt; - m->reprompt = reprompt; - m->secret = secret; - m->service = service; - m->item = item; - m->ex = ex; - if (service) - m->service_url = camel_url_to_string (service->url, CAMEL_URL_HIDE_ALL); - m->key = make_key(service, item); - - if (m->ismain) { - do_get_pass((struct _mail_msg *)m); - } else { - extern EMsgPort *mail_gui_port2; - - e_msgport_put(mail_gui_port2, (EMsg *)m); - } - - e_msgport_wait(pass_reply); - r = (struct _pass_msg *)e_msgport_get(pass_reply); - g_assert(m == r); - - ret = m->result; - mail_msg_free(m); - e_msgport_destroy(pass_reply); - - return ret; -} - -static void -main_forget_password (CamelSession *session, CamelService *service, const char *item, CamelException *ex) -{ - char *key = make_key (service, item); - - e_passwords_forget_password ("Mail", key); - - g_free (key); -} - -static void -forget_password (CamelSession *session, CamelService *service, const char *item, CamelException *ex) -{ - mail_call_main(MAIL_CALL_p_pppp, (MailMainFunc)main_forget_password, - session, service, item, ex); -} - -/* ********************************************************************** */ - -static GtkDialog *message_dialog; -static EDList message_list = E_DLIST_INITIALISER(message_list); - -struct _user_message_msg { - struct _mail_msg msg; - - CamelSessionAlertType type; - const char *prompt; - - unsigned int allow_cancel:1; - unsigned int result:1; - unsigned int ismain:1; -}; - -static void do_user_message (struct _mail_msg *mm); - -/* clicked, send back the reply */ -static void -user_message_response (GtkDialog *dialog, int button, struct _user_message_msg *m) -{ - gtk_widget_destroy ((GtkWidget *) dialog); - - message_dialog = NULL; - - /* if !allow_cancel, then we've already replied */ - if (m->allow_cancel) { - m->result = button == GTK_RESPONSE_OK; - e_msgport_reply((EMsg *)m); - } - - /* check for pendings */ - if ((m = (struct _user_message_msg *)e_dlist_remhead(&message_list))) - do_user_message((struct _mail_msg *)m); -} - -static void -user_message_destroy_notify (struct _user_message_msg *m, GObject *deadbeef) -{ - message_dialog = NULL; -} - -static void -do_user_message (struct _mail_msg *mm) -{ - struct _user_message_msg *m = (struct _user_message_msg *)mm; - GtkMessageType msg_type; - - if (!m->ismain && message_dialog != NULL) { - e_dlist_addtail (&message_list, (EDListNode *)m); - return; - } - - switch (m->type) { - case CAMEL_SESSION_ALERT_INFO: - msg_type = GTK_MESSAGE_INFO; - break; - case CAMEL_SESSION_ALERT_WARNING: - msg_type = GTK_MESSAGE_WARNING; - break; - case CAMEL_SESSION_ALERT_ERROR: - msg_type = GTK_MESSAGE_ERROR; - break; - default: - msg_type = GTK_MESSAGE_INFO; - } - - message_dialog = (GtkDialog *) gtk_message_dialog_new ( - NULL, 0, msg_type, - m->allow_cancel ? GTK_BUTTONS_OK_CANCEL : GTK_BUTTONS_OK, - "%s", m->prompt); - gtk_dialog_set_default_response (message_dialog, m->allow_cancel ? GTK_RESPONSE_CANCEL : GTK_RESPONSE_OK); - g_object_set ((GObject *) message_dialog, "allow_shrink", TRUE, "allow_grow", TRUE, NULL); - - /* We only need to wait for the result if we allow cancel otherwise show but send result back instantly */ - if (m->allow_cancel) { - if (m->ismain) { - user_message_response(message_dialog, gtk_dialog_run (message_dialog), m); - } else { - g_signal_connect (message_dialog, "response", G_CALLBACK (user_message_response), m); - gtk_widget_show ((GtkWidget *) message_dialog); - } - } else { - g_signal_connect (message_dialog, "response", G_CALLBACK (gtk_widget_destroy), message_dialog); - g_object_weak_ref ((GObject *) message_dialog, (GWeakNotify) user_message_destroy_notify, m); - gtk_widget_show ((GtkWidget *) message_dialog); - m->result = TRUE; - e_msgport_reply ((EMsg *)m); - } -} - -static struct _mail_msg_op user_message_op = { NULL, do_user_message, NULL, NULL }; - -static gboolean -alert_user(CamelSession *session, CamelSessionAlertType type, const char *prompt, gboolean cancel) -{ - MailSession *mail_session = MAIL_SESSION (session); - struct _user_message_msg *m, *r; - EMsgPort *user_message_reply; - gboolean ret; - - if (!mail_session->interactive) - return FALSE; - - user_message_reply = e_msgport_new (); - m = mail_msg_new (&user_message_op, user_message_reply, sizeof (*m)); - m->ismain = pthread_self() == mail_gui_thread; - m->type = type; - m->prompt = prompt; - m->allow_cancel = cancel; - - if (m->ismain) - do_user_message((struct _mail_msg *)m); - else { - extern EMsgPort *mail_gui_port2; - - e_msgport_put(mail_gui_port2, (EMsg *)m); - } - - e_msgport_wait(user_message_reply); - r = (struct _user_message_msg *)e_msgport_get(user_message_reply); - g_assert(m == r); - - ret = m->result; - mail_msg_free(m); - e_msgport_destroy(user_message_reply); - - return ret; -} - -static CamelFolder * -get_folder (CamelFilterDriver *d, const char *uri, void *data, CamelException *ex) -{ - return mail_tool_uri_to_folder(uri, 0, ex); -} - -static void -main_play_sound (CamelFilterDriver *driver, char *filename, gpointer user_data) -{ - if (filename && *filename) - gnome_sound_play (filename); - else - gdk_beep (); - - g_free (filename); - camel_object_unref (session); -} - -static void -session_play_sound (CamelFilterDriver *driver, const char *filename, gpointer user_data) -{ - MailSession *ms = (MailSession *) session; - - camel_object_ref (session); - - mail_async_event_emit (ms->async, MAIL_ASYNC_GUI, (MailAsyncFunc) main_play_sound, - driver, g_strdup (filename), user_data); -} - -static void -main_system_beep (CamelFilterDriver *driver, gpointer user_data) -{ - gdk_beep (); -} - -static void -session_system_beep (CamelFilterDriver *driver, gpointer user_data) -{ - MailSession *ms = (MailSession *) session; - - camel_object_ref (session); - - mail_async_event_emit (ms->async, MAIL_ASYNC_GUI, (MailAsyncFunc) main_system_beep, - driver, user_data, NULL); -} - -static CamelFilterDriver * -main_get_filter_driver (CamelSession *session, const char *type, CamelException *ex) -{ - CamelFilterDriver *driver; - FilterRule *rule = NULL; - char *user, *system; - GConfClient *gconf; - RuleContext *fc; - - gconf = mail_config_get_gconf_client (); - - user = g_strdup_printf ("%s/mail/filters.xml", mail_component_peek_base_directory (mail_component_peek ())); - system = EVOLUTION_PRIVDATADIR "/filtertypes.xml"; - fc = (RuleContext *) filter_context_new (); - rule_context_load (fc, system, user); - g_free (user); - - driver = camel_filter_driver_new (session); - camel_filter_driver_set_folder_func (driver, get_folder, NULL); - - if (gconf_client_get_bool (gconf, "/apps/evolution/mail/filters/log", NULL)) { - MailSession *ms = (MailSession *) session; - - if (ms->filter_logfile == NULL) { - char *filename; - - filename = gconf_client_get_string (gconf, "/apps/evolution/mail/filters/logfile", NULL); - if (filename) { - ms->filter_logfile = fopen (filename, "a+"); - g_free (filename); - } - } - - if (ms->filter_logfile) - camel_filter_driver_set_logfile (driver, ms->filter_logfile); - } - - camel_filter_driver_set_shell_func (driver, mail_execute_shell_command, NULL); - camel_filter_driver_set_play_sound_func (driver, session_play_sound, NULL); - camel_filter_driver_set_system_beep_func (driver, session_system_beep, NULL); - - if ((!strcmp (type, FILTER_SOURCE_INCOMING) || !strcmp (type, FILTER_SOURCE_JUNKTEST)) - && camel_session_check_junk (session)) { - /* implicit junk check as 1st rule */ - camel_filter_driver_add_rule (driver, "Junk check", "(junk-test)", "(begin (set-system-flag \"junk\"))"); - } - - if (strcmp (type, FILTER_SOURCE_JUNKTEST)) { - GString *fsearch, *faction; - - fsearch = g_string_new (""); - faction = g_string_new (""); - - /* add the user-defined rules next */ - while ((rule = rule_context_next_rule (fc, rule, type))) { - g_string_truncate (fsearch, 0); - g_string_truncate (faction, 0); - - filter_rule_build_code (rule, fsearch); - filter_filter_build_action ((FilterFilter *) rule, faction); - camel_filter_driver_add_rule (driver, rule->name, fsearch->str, faction->str); - } - - g_string_free (fsearch, TRUE); - g_string_free (faction, TRUE); - } - - g_object_unref (fc); - - return driver; -} - -static CamelFilterDriver * -get_filter_driver (CamelSession *session, const char *type, CamelException *ex) -{ - return (CamelFilterDriver *) mail_call_main (MAIL_CALL_p_ppp, (MailMainFunc) main_get_filter_driver, - session, type, ex); -} - -/* TODO: This is very temporary, until we have a better way to do the progress reporting, - we just borrow a dummy mail-mt thread message and hook it onto out camel thread message */ - -static mail_msg_op_t ms_thread_ops_dummy = { NULL }; - -static void *ms_thread_msg_new(CamelSession *session, CamelSessionThreadOps *ops, unsigned int size) -{ - CamelSessionThreadMsg *msg = ms_parent_class->thread_msg_new(session, ops, size); - - /* We create a dummy mail_msg, and then copy its cancellation port over to ours, so - we get cancellation and progress in common with hte existing mail code, for free */ - if (msg) { - struct _mail_msg *m = mail_msg_new(&ms_thread_ops_dummy, NULL, sizeof(struct _mail_msg)); - - msg->data = m; - camel_operation_unref(msg->op); - msg->op = m->cancel; - camel_operation_ref(msg->op); - } - - return msg; -} - -static void ms_thread_msg_free(CamelSession *session, CamelSessionThreadMsg *m) -{ - mail_msg_free(m->data); - ms_parent_class->thread_msg_free(session, m); -} - -static void ms_thread_status(CamelSession *session, CamelSessionThreadMsg *msg, const char *text, int pc) -{ - /* This should never be called since we bypass it in alloc! */ - printf("Thread status '%s' %d%%\n", text, pc); -} - -char * -mail_session_get_password (const char *url_string) -{ - CamelURL *url; - char *simple_url; - char *passwd; - - url = camel_url_new (url_string, NULL); - simple_url = camel_url_to_string (url, CAMEL_URL_HIDE_PASSWORD | CAMEL_URL_HIDE_PARAMS); - camel_url_free (url); - - passwd = e_passwords_get_password ("Mail", simple_url); - - g_free (simple_url); - - return passwd; -} - -void -mail_session_add_password (const char *url_string, - const char *passwd) -{ - CamelURL *url; - char *simple_url; - - url = camel_url_new (url_string, NULL); - simple_url = camel_url_to_string (url, CAMEL_URL_HIDE_PASSWORD | CAMEL_URL_HIDE_PARAMS); - camel_url_free (url); - - e_passwords_add_password (simple_url, passwd); - - g_free (simple_url); -} - -void -mail_session_remember_password (const char *url_string) -{ - CamelURL *url; - char *simple_url; - - url = camel_url_new (url_string, NULL); - simple_url = camel_url_to_string (url, CAMEL_URL_HIDE_PASSWORD | CAMEL_URL_HIDE_PARAMS); - camel_url_free (url); - - e_passwords_remember_password ("Mail", simple_url); - - g_free (simple_url); -} - -void -mail_session_forget_password (const char *key) -{ - e_passwords_forget_password ("Mail", key); -} - -static void -mail_session_check_junk_notify (GConfClient *gconf, guint id, GConfEntry *entry, CamelSession *session) -{ - gchar *key; - - g_return_if_fail (gconf_entry_get_key (entry) != NULL); - g_return_if_fail (gconf_entry_get_value (entry) != NULL); - - key = strrchr (gconf_entry_get_key (entry), '/'); - if (!strcmp (key, "check_incoming")) - camel_session_set_check_junk (session, gconf_value_get_bool (gconf_entry_get_value (entry))); -} - -void -mail_session_init (const char *base_directory) -{ - char *camel_dir; - GConfClient *gconf; - - if (camel_init (base_directory, TRUE) != 0) - exit (0); - - session = CAMEL_SESSION (camel_object_new (MAIL_SESSION_TYPE)); - - camel_dir = g_strdup_printf ("%s/mail", base_directory); - camel_session_construct (session, camel_dir); - - gconf = mail_config_get_gconf_client (); - camel_session_set_check_junk (session, gconf_client_get_bool (gconf, "/apps/evolution/mail/junk/check_incoming", NULL)); - session_check_junk_notify_id = gconf_client_notify_add (gconf, "/apps/evolution/mail/junk", - (GConfClientNotifyFunc) mail_session_check_junk_notify, - session, NULL, NULL); - session->junk_plugin = CAMEL_JUNK_PLUGIN (em_junk_filter_get_plugin ()); - - /* The shell will tell us to go online. */ - camel_session_set_online ((CamelSession *) session, FALSE); - - g_free (camel_dir); -} - -gboolean -mail_session_get_interactive (void) -{ - return MAIL_SESSION (session)->interactive; -} - -void -mail_session_set_interactive (gboolean interactive) -{ - MAIL_SESSION (session)->interactive = interactive; - - if (!interactive) { - struct _pass_msg *pm; - struct _user_message_msg *um; - - d(printf ("Gone non-interactive, checking for outstanding interactive tasks\n")); - - /* clear out pending password requests */ - while ((pm = (struct _pass_msg *) e_dlist_remhead (&password_list))) { - d(printf ("Flushing password request : %s\n", pm->prompt)); - e_msgport_reply ((EMsg *) pm); - } - - /* destroy the current */ - if (password_dialog) { - d(printf ("Destroying password dialogue\n")); - gtk_widget_destroy ((GtkWidget *) password_dialog); - password_dialog = NULL; - } - - /* same for pending user messages */ - while ((um = (struct _user_message_msg *) e_dlist_remhead (&message_list))) { - d(printf ("Flusing message request: %s\n", um->prompt)); - e_msgport_reply((EMsg *) um); - } - - /* and the current */ - if (message_dialog) { - d(printf("Destroying message dialogue\n")); - gtk_widget_destroy ((GtkWidget *) message_dialog); - } - } -} - -void -mail_session_forget_passwords (BonoboUIComponent *uih, void *user_data, - const char *path) -{ - e_passwords_forget_passwords (); -} - -void -mail_session_flush_filter_log (void) -{ - MailSession *ms = (MailSession *) session; - - if (ms->filter_logfile) - fflush (ms->filter_logfile); -} diff --git a/mail/mail-session.h b/mail/mail-session.h deleted file mode 100644 index 2a7559964c..0000000000 --- a/mail/mail-session.h +++ /dev/null @@ -1,58 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Authors: Jeffrey Stedfast <fejj@ximian.com> - * - * Copyright 2000 Ximian, Inc. (www.ximian.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public - * License as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - * - */ - -#ifndef MAIL_SESSION_H -#define MAIL_SESSION_H - -#include <glib.h> -#include <bonobo/bonobo-ui-component.h> -#include <camel/camel-session.h> - -#ifdef __cplusplus -extern "C" { -#pragma } -#endif /* __cplusplus */ - -void mail_session_init (const char *base_directory); -gboolean mail_session_get_interactive (void); -void mail_session_set_interactive (gboolean interactive); -char *mail_session_request_dialog (const char *prompt, gboolean secret, - const char *key, gboolean async); -gboolean mail_session_accept_dialog (const char *prompt, const char *key, - gboolean async); -char *mail_session_get_password (const char *url); -void mail_session_add_password (const char *url, const char *passwd); -void mail_session_forget_passwords (BonoboUIComponent *uih, void *user_data, - const char *path); -void mail_session_remember_password (const char *url); - -void mail_session_forget_password (const char *key); - -void mail_session_flush_filter_log (void); - -extern CamelSession *session; - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* ! MAIL_SESSION_H */ diff --git a/mail/mail-signature-editor.c b/mail/mail-signature-editor.c deleted file mode 100644 index 570a0157c4..0000000000 --- a/mail/mail-signature-editor.c +++ /dev/null @@ -1,447 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Authors: Radek Doulik <rodo@ximian.com> - * Jeffrey Stedfast <fejj@ximian.com> - * - * Copyright 2002 Ximian, Inc. (www.ximian.com) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA. - * - */ - - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <string.h> -#include <errno.h> -#include <bonobo.h> -#include <bonobo/bonobo-stream-memory.h> - -#include <e-util/e-dialog-utils.h> - -#include "e-msg-composer.h" -#include "mail-signature-editor.h" -#include "mail-config.h" - -#define d(x) - - -struct _ESignatureEditor { - GtkWidget *win; - GtkWidget *control; - GtkWidget *name_entry; - GtkWidget *info_frame; - - MailConfigSignature *sig; - gboolean is_new; - gboolean html; - - GNOME_GtkHTML_Editor_Engine engine; -}; -typedef struct _ESignatureEditor ESignatureEditor; - -#define E_SIGNATURE_EDITOR(o) ((ESignatureEditor *) o) - -#define DEFAULT_WIDTH 600 -#define DEFAULT_HEIGHT 350 - -enum { REPLY_YES = 0, REPLY_NO, REPLY_CANCEL }; - -static void -destroy_editor (ESignatureEditor *editor) -{ - gtk_widget_destroy (editor->win); - g_free (editor); -} - -static void -menu_file_save_error (BonoboUIComponent *uic, CORBA_Environment *ev) -{ - char *err; - - /* errno is set if the rename() fails in menu_file_save_cb */ - - err = ev->_major != CORBA_NO_EXCEPTION ? bonobo_exception_get_text (ev) : g_strdup (g_strerror (errno)); - - e_notice (NULL, GTK_MESSAGE_ERROR, _("Could not save signature file: %s"), err); - g_warning ("Exception while saving signature: %s", err); - - g_free (err); -} - -static GByteArray * -get_text (Bonobo_PersistStream persist, const char *format, CORBA_Environment *ev) -{ - BonoboStream *stream; - BonoboStreamMem *stream_mem; - GByteArray *text; - - stream = bonobo_stream_mem_create (NULL, 0, FALSE, TRUE); - Bonobo_PersistStream_save (persist, (Bonobo_Stream)bonobo_object_corba_objref (BONOBO_OBJECT (stream)), - format, ev); - - if (ev->_major != CORBA_NO_EXCEPTION) - return NULL; - - stream_mem = BONOBO_STREAM_MEM (stream); - - text = g_byte_array_new (); - g_byte_array_append (text, stream_mem->buffer, stream_mem->pos); - bonobo_object_unref (BONOBO_OBJECT (stream)); - - return text; -} - -static ssize_t -write_all (int fd, const char *buf, size_t n) -{ - ssize_t w, nwritten = 0; - - do { - do { - w = write (fd, buf + nwritten, n - nwritten); - } while (w == -1 && (errno == EINTR || errno == EAGAIN)); - - if (w > 0) - nwritten += w; - } while (nwritten < n && w != -1); - - if (w == -1) - return -1; - - return nwritten; -} - -static void -menu_file_save_cb (BonoboUIComponent *uic, void *user_data, const char *path) -{ - ESignatureEditor *editor = user_data; - Bonobo_PersistStream pstream_iface; - char *dirname, *base, *filename; - CORBA_Environment ev; - GByteArray *text; - int fd; - - d(printf ("editor->sig->filename = %s\n", editor->sig->filename)); - dirname = g_path_get_dirname (editor->sig->filename); - d(printf ("dirname = %s\n", dirname)); - base = g_path_get_basename (editor->sig->filename); - d(printf ("basename = %s\n", base)); - filename = g_strdup_printf ("%s/.#%s", dirname, base); - d(printf ("filename = %s\n", filename)); - g_free (dirname); - g_free (base); - - CORBA_exception_init (&ev); - pstream_iface = Bonobo_Unknown_queryInterface - (bonobo_widget_get_objref (BONOBO_WIDGET (editor->control)), - "IDL:Bonobo/PersistStream:1.0", &ev); - - if (ev._major != CORBA_NO_EXCEPTION) - goto exception; - - if ((fd = open (filename, O_WRONLY | O_TRUNC | O_CREAT, 0666)) == -1) - goto exception; - - text = get_text (pstream_iface, editor->html ? "text/html" : "text/plain", &ev); - if (ev._major != CORBA_NO_EXCEPTION) { - close (fd); - goto exception; - } - - if (write_all (fd, text->data, text->len) == -1) { - g_byte_array_free (text, TRUE); - close (fd); - goto exception; - } - - g_byte_array_free (text, TRUE); - close (fd); - - if (rename (filename, editor->sig->filename) == -1) - goto exception; - - g_free (filename); - - mail_config_signature_set_html (editor->sig, editor->html); - - /* if the signature isn't already saved in the config, save it there now... */ - if (editor->is_new) { - mail_config_signature_add (editor->sig); - editor->is_new = FALSE; - } else - mail_config_signature_emit_event (MAIL_CONFIG_SIG_EVENT_CONTENT_CHANGED, editor->sig); - - return; - - exception: - - menu_file_save_error (uic, &ev); - CORBA_exception_free (&ev); - unlink (filename); - g_free (filename); -} - -static void -exit_dialog_cb (int reply, ESignatureEditor *editor) -{ - switch (reply) { - case GTK_RESPONSE_YES: - menu_file_save_cb (NULL, editor, NULL); - break; - case GTK_RESPONSE_NO: - destroy_editor (editor); - break; - } -} - -static void -do_exit (ESignatureEditor *editor) -{ - CORBA_Environment ev; - - CORBA_exception_init (&ev); - - if (GNOME_GtkHTML_Editor_Engine_hasUndo (editor->engine, &ev)) { - GtkWidget *dialog; - int button; - - dialog = gtk_message_dialog_new (GTK_WINDOW (editor->win), - GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_MODAL, - GTK_MESSAGE_QUESTION, GTK_BUTTONS_NONE, "%s", - _("This signature has been changed, but hasn't been saved.\n" - "\nDo you wish to save your changes?")); - gtk_dialog_add_buttons ((GtkDialog *) dialog, - _("_Discard changes"), GTK_RESPONSE_NO, - GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, - GTK_STOCK_SAVE, GTK_RESPONSE_YES, - NULL); - gtk_window_set_title ((GtkWindow *) dialog, _("Save signature")); - gtk_dialog_set_default_response ((GtkDialog *) dialog, GTK_RESPONSE_YES); - - button = gtk_dialog_run ((GtkDialog *) dialog); - gtk_widget_destroy (dialog); - - exit_dialog_cb (button, editor); - } else - destroy_editor (editor); - - CORBA_exception_free (&ev); -} - -static int -delete_event_cb (GtkWidget *w, GdkEvent *event, ESignatureEditor *editor) -{ - do_exit (editor); - - return FALSE; -} - -static void -menu_file_close_cb (BonoboUIComponent *uic, gpointer data, const gchar *path) -{ - ESignatureEditor *editor; - - editor = E_SIGNATURE_EDITOR (data); - do_exit (editor); -} - -static void -menu_file_save_close_cb (BonoboUIComponent *uic, gpointer data, const gchar *path) -{ - ESignatureEditor *editor; - - editor = E_SIGNATURE_EDITOR (data); - - menu_file_save_cb (uic, editor, path); - destroy_editor (editor); -} - -static BonoboUIVerb verbs [] = { - - BONOBO_UI_VERB ("FileSave", menu_file_save_cb), - BONOBO_UI_VERB ("FileClose", menu_file_close_cb), - BONOBO_UI_VERB ("FileSaveClose", menu_file_save_close_cb), - - BONOBO_UI_VERB_END -}; - -static void -load_signature (ESignatureEditor *editor) -{ - CORBA_Environment ev; - - if (editor->html) { - Bonobo_PersistFile pfile_iface; - - pfile_iface = Bonobo_Unknown_queryInterface (bonobo_widget_get_objref (BONOBO_WIDGET (editor->control)), - "IDL:Bonobo/PersistFile:1.0", NULL); - CORBA_exception_init (&ev); - Bonobo_PersistFile_load (pfile_iface, editor->sig->filename, &ev); - CORBA_exception_free (&ev); - } else { - Bonobo_PersistStream pstream_iface; - BonoboStream *stream; - char *data, *html; - - data = e_msg_composer_get_sig_file_content (editor->sig->filename, FALSE); - html = g_strdup_printf ("<PRE>\n%s", data); - g_free (data); - - pstream_iface = Bonobo_Unknown_queryInterface - (bonobo_widget_get_objref (BONOBO_WIDGET (editor->control)), - "IDL:Bonobo/PersistStream:1.0", NULL); - CORBA_exception_init (&ev); - stream = bonobo_stream_mem_create (html, strlen (html), TRUE, FALSE); - - if (stream == NULL) { - g_warning ("Couldn't create memory stream\n"); - } else { - BonoboObject *stream_object; - Bonobo_Stream corba_stream; - - stream_object = BONOBO_OBJECT (stream); - corba_stream = bonobo_object_corba_objref (stream_object); - Bonobo_PersistStream_load (pstream_iface, corba_stream, - "text/html", &ev); - } - - Bonobo_Unknown_unref (pstream_iface, &ev); - CORBA_Object_release (pstream_iface, &ev); - CORBA_exception_free (&ev); - bonobo_object_unref (BONOBO_OBJECT (stream)); - - g_free (html); - } -} - -static void -sig_name_changed (GtkWidget *w, ESignatureEditor *editor) -{ - const char *name; - - name = gtk_entry_get_text (GTK_ENTRY (editor->name_entry)); - - if (editor->is_new) { - g_free (editor->sig->name); - editor->sig->name = g_strdup (name); - } else { - mail_config_signature_set_name (editor->sig, name); - } -} - -static void -format_html_cb (BonoboUIComponent *component, - const char *path, - Bonobo_UIComponent_EventType type, - const char *state, - gpointer data) - -{ - ESignatureEditor *editor = (ESignatureEditor *) data; - - if (type != Bonobo_UIComponent_STATE_CHANGED) - return; - - editor->html = atoi (state); - bonobo_widget_set_property (BONOBO_WIDGET (editor->control), "FormatHTML", TC_CORBA_boolean, editor->html, NULL); -} - -void -mail_signature_editor (MailConfigSignature *sig, GtkWindow *parent, gboolean is_new) -{ - CORBA_Environment ev; - ESignatureEditor *editor; - BonoboUIComponent *component; - BonoboUIContainer *container; - GtkWidget *vbox, *hbox, *label, *frame, *vbox1; - - if (!sig->filename || !*sig->filename) - return; - - editor = g_new0 (ESignatureEditor, 1); - - editor->sig = sig; - editor->html = sig->html; - editor->is_new = is_new; - - editor->win = bonobo_window_new ("e-sig-editor", _("Edit signature")); - gtk_window_set_type_hint (GTK_WINDOW (editor->win), GDK_WINDOW_TYPE_HINT_DIALOG); - gtk_window_set_default_size (GTK_WINDOW (editor->win), DEFAULT_WIDTH, DEFAULT_HEIGHT); - if (parent != NULL) - gtk_window_set_transient_for (GTK_WINDOW (editor->win), parent); - g_object_set (editor->win, "allow_shrink", FALSE, "allow_grow", TRUE, NULL); - - container = bonobo_window_get_ui_container (BONOBO_WINDOW(editor->win)); - - component = bonobo_ui_component_new_default (); - bonobo_ui_component_set_container (component, bonobo_object_corba_objref (BONOBO_OBJECT (container)), NULL); - bonobo_ui_component_add_verb_list_with_data (component, verbs, editor); - bonobo_ui_util_set_ui (component, PREFIX, - EVOLUTION_UIDIR "/evolution-signature-editor.xml", - "evolution-signature-editor", NULL); - - editor->control = bonobo_widget_new_control ("OAFIID:GNOME_GtkHTML_Editor:3.1", - bonobo_ui_component_get_container (component)); - - if (editor->control == NULL) { - g_warning ("Cannot get 'OAFIID:GNOME_GtkHTML_Editor:3.1'."); - - destroy_editor (editor); - return; - } - - editor->engine = (GNOME_GtkHTML_Editor_Engine) Bonobo_Unknown_queryInterface - (bonobo_widget_get_objref (BONOBO_WIDGET (editor->control)), "IDL:GNOME/GtkHTML/Editor/Engine:1.0", NULL); - - load_signature (editor); - - bonobo_ui_component_set_prop (component, "/commands/FormatHtml", "state", editor->html ? "1" : "0", NULL); - bonobo_ui_component_add_listener (component, "FormatHtml", format_html_cb, editor); - - g_signal_connect (editor->win, "delete_event", G_CALLBACK (delete_event_cb), editor); - - vbox = gtk_vbox_new (FALSE, 0); - hbox = gtk_hbox_new (FALSE, 4); - vbox1 = gtk_vbox_new (FALSE, 3); - gtk_container_set_border_width (GTK_CONTAINER (vbox1), 3); - label = gtk_label_new (_("Enter a name for this signature.")); - gtk_misc_set_alignment (GTK_MISC (label), 0, 0); - gtk_box_pack_start (GTK_BOX (vbox1), label, FALSE, TRUE, 0); - label = gtk_label_new (_("Name:")); - gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, TRUE, 0); - editor->name_entry = gtk_entry_new (); - gtk_entry_set_text (GTK_ENTRY (editor->name_entry), sig->name); - g_signal_connect (editor->name_entry, "changed", G_CALLBACK (sig_name_changed), editor); - gtk_box_pack_start_defaults (GTK_BOX (hbox), editor->name_entry); - frame = gtk_frame_new (NULL); - gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_OUT); - gtk_box_pack_start (GTK_BOX (vbox1), hbox, FALSE, TRUE, 0); - gtk_container_add (GTK_CONTAINER (frame), vbox1); - gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, TRUE, 0); - gtk_widget_show_all (vbox); - gtk_box_pack_start_defaults (GTK_BOX (vbox), editor->control); - - bonobo_window_set_contents (BONOBO_WINDOW (editor->win), vbox); - bonobo_widget_set_property (BONOBO_WIDGET (editor->control), "FormatHTML", TC_CORBA_boolean, editor->html, NULL); - gtk_widget_show (GTK_WIDGET (editor->win)); - gtk_widget_show (GTK_WIDGET (editor->control)); - - CORBA_exception_init (&ev); - GNOME_GtkHTML_Editor_Engine_runCommand (editor->engine, "grab-focus", &ev); - CORBA_exception_free (&ev); -} diff --git a/mail/mail-signature-editor.h b/mail/mail-signature-editor.h deleted file mode 100644 index 9dd58aade2..0000000000 --- a/mail/mail-signature-editor.h +++ /dev/null @@ -1,42 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Authors: - * Radek Doulik <rodo@ximian.com> - * - * Copyright 2001, 2002 Ximian, Inc. (www.ximian.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public - * License as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - * - */ - -#ifndef MAIL_SIGNATURE_EDITOR_H -#define MAIL_SIGNATURE_EDITOR_H - -#ifdef __cplusplus -extern "C" { -#pragma } -#endif /* __cplusplus */ - -#include <glib.h> -#include <gtk/gtkwindow.h> -#include <mail-config.h> - -void mail_signature_editor (MailConfigSignature *sig, GtkWindow *parent, gboolean is_new); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif diff --git a/mail/mail-tools.c b/mail/mail-tools.c deleted file mode 100644 index 50b2d0ab12..0000000000 --- a/mail/mail-tools.c +++ /dev/null @@ -1,424 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Authors: - * Dan Winship <danw@ximian.com> - * Peter Williams <peterw@ximian.com> - * Jeffrey Stedfast <fejj@ximian.com> - * - * Copyright 2000 Ximian, Inc. (www.ximian.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public - * License as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA - */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <unistd.h> -#include <pthread.h> -#include <ctype.h> -#include <errno.h> -#include <string.h> - -#include <gconf/gconf.h> -#include <gconf/gconf-client.h> - -#include <camel/camel.h> -#include <camel/camel-vee-folder.h> - -#include <filter/vfolder-rule.h> -#include <filter/vfolder-context.h> -#include <filter/filter-option.h> -#include <filter/filter-input.h> - -#include "e-util/e-meta.h" - -#include "mail.h" /*session*/ -#include "mail-component.h" -#include "mail-config.h" -#include "mail-vfolder.h" -#include "mail-tools.h" -#include "mail-mt.h" -#include "mail-folder-cache.h" - - -/* **************************************** */ - -CamelFolder * -mail_tool_get_local_inbox (CamelException *ex) -{ - return mail_component_get_local_inbox(mail_component_peek(), ex); -} - -CamelFolder * -mail_tool_get_inbox (const gchar *url, CamelException *ex) -{ - CamelStore *store; - CamelFolder *folder; - - store = camel_session_get_store (session, url, ex); - if (!store) - return NULL; - - folder = camel_store_get_inbox (store, ex); - camel_object_unref (store); - - return folder; -} - -CamelFolder * -mail_tool_get_trash (const gchar *url, int connect, CamelException *ex) -{ - CamelStore *store; - CamelFolder *trash; - - if (connect) - store = camel_session_get_store (session, url, ex); - else - store = (CamelStore *) camel_session_get_service (session, url, CAMEL_PROVIDER_STORE, ex); - - if (!store) - return NULL; - - if (connect || ((CamelService *) store)->status == CAMEL_SERVICE_CONNECTED) - trash = camel_store_get_trash (store, ex); - else - trash = NULL; - - camel_object_unref (store); - - return trash; -} - -static char * -mail_tool_get_local_movemail_path (const unsigned char *uri) -{ - unsigned char *safe_uri, *c; - char *path; - - safe_uri = g_strdup (uri); - for (c = safe_uri; *c; c++) - if (strchr ("/:;=|%&#!*^()\\, ", *c) || !isprint ((int) *c)) - *c = '_'; - - path = g_strdup_printf ("%s/local/Inbox/movemail.%s", - mail_component_peek_base_directory (mail_component_peek ()), - safe_uri); - g_free (safe_uri); - - return path; -} - -char * -mail_tool_do_movemail (const char *source_url, CamelException *ex) -{ - char *dest_path; - struct stat sb; - CamelURL *uri; - - uri = camel_url_new(source_url, ex); - if (uri == NULL) - return NULL; - - if (strcmp(uri->protocol, "mbox") != 0) { - /* FIXME: use right text here post 1.4 */ - camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_URL_INVALID, - _("Could not parse URL `%s'"), - source_url); - camel_url_free(uri); - return NULL; - } - - /* Set up our destination. */ - dest_path = mail_tool_get_local_movemail_path (source_url); - - /* Movemail from source (source_url) to dest_path */ - camel_movemail (uri->path, dest_path, ex); - camel_url_free(uri); - - if (stat (dest_path, &sb) < 0 || sb.st_size == 0) { - unlink (dest_path); /* Clean up the movemail.foo file. */ - g_free (dest_path); - return NULL; - } - - if (camel_exception_is_set (ex)) { - g_free (dest_path); - return NULL; - } - - return dest_path; -} - -char * -mail_tool_generate_forward_subject (CamelMimeMessage *msg) -{ - const char *subject; - char *fwd_subj; - const int max_subject_length = 1024; - - subject = camel_mime_message_get_subject(msg); - - if (subject && *subject) { - /* Truncate insanely long subjects */ - if (strlen (subject) < max_subject_length) { - fwd_subj = g_strdup_printf ("[Fwd: %s]", subject); - } else { - /* We can't use %.*s because it depends on the locale being C/POSIX - or UTF-8 to work correctly in glibc */ - /*fwd_subj = g_strdup_printf ("[Fwd: %.*s...]", max_subject_length, subject);*/ - fwd_subj = g_malloc (max_subject_length + 11); - memcpy (fwd_subj, "[Fwd: ", 6); - memcpy (fwd_subj + 6, subject, max_subject_length); - memcpy (fwd_subj + 6 + max_subject_length, "...]", 5); - } - } else { - const CamelInternetAddress *from; - char *fromstr; - - from = camel_mime_message_get_from (msg); - if (from) { - fromstr = camel_address_format (CAMEL_ADDRESS (from)); - fwd_subj = g_strdup_printf ("[Fwd: %s]", fromstr); - g_free (fromstr); - } else - fwd_subj = g_strdup ("[Fwd: No Subject]"); - } - - return fwd_subj; -} - -XEvolution * -mail_tool_remove_xevolution_headers (CamelMimeMessage *message) -{ - XEvolution *xev; - - xev = g_new (XEvolution, 1); - xev->flags = g_strdup (camel_medium_get_header (CAMEL_MEDIUM (message), "X-Evolution")); - xev->source = g_strdup (camel_medium_get_header (CAMEL_MEDIUM (message), "X-Evolution-Source")); - xev->transport = g_strdup (camel_medium_get_header (CAMEL_MEDIUM (message), "X-Evolution-Transport")); - xev->account = g_strdup (camel_medium_get_header (CAMEL_MEDIUM (message), "X-Evolution-Account")); - xev->fcc = g_strdup (camel_medium_get_header (CAMEL_MEDIUM (message), "X-Evolution-Fcc")); - xev->format = g_strdup (camel_medium_get_header (CAMEL_MEDIUM (message), "X-Evolution-Format")); - xev->postto = g_strdup (camel_medium_get_header (CAMEL_MEDIUM (message), "X-Evolution-PostTo")); - - /* rip off the X-Evolution* headers */ - camel_medium_remove_header (CAMEL_MEDIUM (message), "X-Evolution"); - camel_medium_remove_header (CAMEL_MEDIUM (message), "X-Evolution-Source"); - camel_medium_remove_header (CAMEL_MEDIUM (message), "X-Evolution-Transport"); - camel_medium_remove_header (CAMEL_MEDIUM (message), "X-Evolution-Account"); - camel_medium_remove_header (CAMEL_MEDIUM (message), "X-Evolution-Fcc"); - camel_medium_remove_header (CAMEL_MEDIUM (message), "X-Evolution-Format"); - camel_medium_remove_header (CAMEL_MEDIUM (message), "X-Evolution-PostTo"); - - return xev; -} - -void -mail_tool_restore_xevolution_headers (CamelMimeMessage *message, XEvolution *xev) -{ - if (xev->flags) - camel_medium_set_header (CAMEL_MEDIUM (message), "X-Evolution", xev->flags); - if (xev->source) - camel_medium_set_header (CAMEL_MEDIUM (message), "X-Evolution-Source", xev->source); - if (xev->transport) - camel_medium_set_header (CAMEL_MEDIUM (message), "X-Evolution-Transport", xev->transport); - if (xev->account) - camel_medium_set_header (CAMEL_MEDIUM (message), "X-Evolution-Account", xev->account); - if (xev->fcc) - camel_medium_set_header (CAMEL_MEDIUM (message), "X-Evolution-Fcc", xev->fcc); - if (xev->format) - camel_medium_set_header (CAMEL_MEDIUM (message), "X-Evolution-Format", xev->format); - if (xev->postto) - camel_medium_set_header (CAMEL_MEDIUM (message), "X-Evolution-PostTo", xev->postto); -} - -void -mail_tool_destroy_xevolution (XEvolution *xev) -{ - g_free (xev->flags); - g_free (xev->source); - g_free (xev->transport); - g_free (xev->account); - g_free (xev->format); - g_free (xev->fcc); - g_free (xev->postto); - g_free (xev); -} - -CamelMimePart * -mail_tool_make_message_attachment (CamelMimeMessage *message) -{ - CamelMimePart *part; - const char *subject; - XEvolution *xev; - char *desc; - - subject = camel_mime_message_get_subject (message); - if (subject) - desc = g_strdup_printf (_("Forwarded message - %s"), subject); - else - desc = g_strdup (_("Forwarded message")); - - /* rip off the X-Evolution headers */ - xev = mail_tool_remove_xevolution_headers (message); - mail_tool_destroy_xevolution (xev); - - /* remove Bcc headers */ - while (camel_medium_get_header (CAMEL_MEDIUM (message), "Bcc")) - camel_medium_remove_header (CAMEL_MEDIUM (message), "Bcc"); - - part = camel_mime_part_new (); - camel_mime_part_set_disposition (part, "inline"); - camel_mime_part_set_description (part, desc); - camel_medium_set_content_object (CAMEL_MEDIUM (part), - CAMEL_DATA_WRAPPER (message)); - camel_mime_part_set_content_type (part, "message/rfc822"); - g_free (desc); - - return part; -} - -CamelFolder * -mail_tool_uri_to_folder (const char *uri, guint32 flags, CamelException *ex) -{ - CamelURL *url; - CamelStore *store = NULL; - CamelFolder *folder = NULL; - int offset = 0; - char *curi = NULL; - - g_return_val_if_fail (uri != NULL, NULL); - - if (!strncmp (uri, "vtrash:", 7)) - offset = 7; - else if (!strncmp (uri, "vjunk:", 6)) - offset = 6; - else if (!strncmp(uri, "email:", 6)) { - /* FIXME?: the filter:get_folder callback should do this itself? */ - curi = em_uri_to_camel(uri); - if (uri == NULL) { - camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM, _("Invalid folder: `%s'"), uri); - return NULL; - } - uri = curi; - } - - url = camel_url_new (uri + offset, ex); - if (!url) { - g_free(curi); - return NULL; - } - - store = camel_session_get_store (session, uri + offset, ex); - if (store) { - const char *name; - - /* if we have a fragment, then the path is actually used by the store, - so the fragment is the path to the folder instead */ - if (url->fragment) { - name = url->fragment; - } else { - if (url->path && *url->path) - name = url->path + 1; - else - name = ""; - } - - if (offset) { - if (offset == 7) - folder = camel_store_get_trash (store, ex); - else if (offset == 6) - folder = camel_store_get_junk (store, ex); - else - g_assert (FALSE); - } else - folder = camel_store_get_folder (store, name, flags, ex); - camel_object_unref (store); - } - - if (folder) - mail_note_folder (folder); - - camel_url_free (url); - g_free(curi); - - return folder; -} - - -/** - * mail_tools_x_evolution_message_parse: - * @in: GtkSelectionData->data - * @inlen: GtkSelectionData->length - * @uids: pointer to a gptrarray that will be filled with uids on success - * - * Parses the GtkSelectionData and returns a CamelFolder and a list of - * UIDs specified by the selection. - **/ -CamelFolder * -mail_tools_x_evolution_message_parse (char *in, unsigned int inlen, GPtrArray **uids) -{ - /* format: "uri\0uid1\0uid2\0uid3\0...\0uidn" */ - char *inptr, *inend; - CamelFolder *folder; - - if (in == NULL) - return NULL; - - folder = mail_tool_uri_to_folder (in, 0, NULL); - - if (!folder) - return NULL; - - /* split the uids */ - inend = in + inlen; - inptr = in + strlen (in) + 1; - *uids = g_ptr_array_new (); - while (inptr < inend) { - char *start = inptr; - - while (inptr < inend && *inptr) - inptr++; - - g_ptr_array_add (*uids, g_strndup (start, inptr - start)); - inptr++; - } - - return folder; -} - - -char * -mail_tools_folder_to_url (CamelFolder *folder) -{ - char *service_url, *url; - const char *full_name; - CamelService *service; - - g_return_val_if_fail (CAMEL_IS_FOLDER (folder), NULL); - - full_name = folder->full_name; - while (*full_name == '/') - full_name++; - - service = (CamelService *) folder->parent_store; - service_url = camel_url_to_string (service->url, CAMEL_URL_HIDE_ALL); - url = g_strdup_printf ("%s%s%s", service_url, service_url[strlen (service_url)-1] != '/' ? "/" : "", - full_name); - g_free (service_url); - - return url; -} diff --git a/mail/mail-tools.h b/mail/mail-tools.h deleted file mode 100644 index 2f4b61123c..0000000000 --- a/mail/mail-tools.h +++ /dev/null @@ -1,75 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ - -/* - * Author : - * Peter Williams <peterw@ximian.com> - * - * Copyright 2000 Ximian, Inc. (www.ximian.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public - * License as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA - */ - -#ifndef MAIL_TOOLS_H -#define MAIL_TOOLS_H - -#include <camel/camel.h> -#include <camel/camel-filter-driver.h> /*eek*/ - -typedef struct _xevolution { - char *flags; - char *source; - char *transport; - char *account; - char *fcc; - char *format; - char *postto; -} XEvolution; - -/* Get the CamelFolder for the local inbox */ -CamelFolder *mail_tool_get_local_inbox (CamelException *ex); - -/* Get the "inbox" for a url (uses global session) */ -CamelFolder *mail_tool_get_inbox (const char *url, CamelException *ex); - -/* Get the "trash" for a url (uses global session) */ -CamelFolder *mail_tool_get_trash (const char *url, int connect, CamelException *ex); - -/* Does a camel_movemail into the local movemail folder - * and returns the path to the new movemail folder that was created. which shoudl be freed later */ -char *mail_tool_do_movemail (const char *source_url, CamelException *ex); - -XEvolution *mail_tool_remove_xevolution_headers (CamelMimeMessage *message); -void mail_tool_restore_xevolution_headers (CamelMimeMessage *message, XEvolution *xev); -void mail_tool_destroy_xevolution (XEvolution *xev); - -/* Generates the subject for a message forwarding @msg */ -gchar *mail_tool_generate_forward_subject (CamelMimeMessage *msg); - -/* Make a message into an attachment */ -CamelMimePart *mail_tool_make_message_attachment (CamelMimeMessage *message); - -/* Parse the ui into a real CamelFolder any way we know how. */ -CamelFolder *mail_tool_uri_to_folder (const char *uri, guint32 flags, CamelException *ex); - -GHashTable *mail_lookup_url_table (CamelMimeMessage *mime_message); - -CamelFolder *mail_tools_x_evolution_message_parse (char *in, unsigned int inlen, GPtrArray **uids); - -char *mail_tools_folder_to_url (CamelFolder *folder); - -struct _EMeta *mail_tool_get_meta_data(const char *uri); -void mail_tool_delete_meta_data(const char *uri); - -#endif diff --git a/mail/mail-types.h b/mail/mail-types.h deleted file mode 100644 index 1cb0bdad06..0000000000 --- a/mail/mail-types.h +++ /dev/null @@ -1,40 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ - -/* - * Copyright 2000 Ximian, Inc. (www.ximian.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public - * License as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA - */ - -#ifndef MAIL_TYPES_H -#define MAIL_TYPES_H 1 - -#ifdef __cplusplus -extern "C" { -#pragma } -#endif /* __cplusplus }*/ - - -typedef struct _FolderBrowser FolderBrowser; -typedef struct _MessageBrowser MessageBrowser; -typedef struct _SubscribeDialog SubscribeDialog; -typedef struct _MessageList MessageList; -typedef struct _MailDisplay MailDisplay; - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* MAIL_TYPES_H */ diff --git a/mail/mail-vfolder.c b/mail/mail-vfolder.c deleted file mode 100644 index 84a278957a..0000000000 --- a/mail/mail-vfolder.c +++ /dev/null @@ -1,1022 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Authors: Michael Zucchi <notzed@ximian.com> - * - * Copyright 2000-2003 Ximian, Inc. (www.ximian.com) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA. - * - */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <glib.h> -#include <string.h> -#include <libgnome/gnome-i18n.h> - -#include "Evolution.h" - -#include "mail-component.h" -#include "mail-vfolder.h" -#include "mail-tools.h" -#include "mail-autofilter.h" -#include "mail-folder-cache.h" -#include "mail.h" -#include "mail-ops.h" -#include "mail-mt.h" - -#include "e-util/e-dialog-utils.h" - -#include "camel/camel.h" -#include "camel/camel-vee-folder.h" -#include "camel/camel-vee-store.h" - -#include "filter/vfolder-context.h" -#include "filter/vfolder-editor.h" - -#define d(x) /*(printf("%s(%d):%s: ", __FILE__, __LINE__, __PRETTY_FUNCTION__), (x))*/ - -static VfolderContext *context; /* context remains open all time */ -static CamelStore *vfolder_store; /* the 1 static vfolder store */ - -/* lock for accessing shared resources (below) */ -static pthread_mutex_t vfolder_lock = PTHREAD_MUTEX_INITIALIZER; - -static GList *source_folders_remote; /* list of source folder uri's - remote ones */ -static GList *source_folders_local; /* list of source folder uri's - local ones */ -static GHashTable *vfolder_hash; - -/* more globals ... */ -extern CamelSession *session; - -static void rule_changed(FilterRule *rule, CamelFolder *folder); - -#define LOCK() pthread_mutex_lock(&vfolder_lock); -#define UNLOCK() pthread_mutex_unlock(&vfolder_lock); - -/* ********************************************************************** */ - -struct _setup_msg { - struct _mail_msg msg; - - CamelFolder *folder; - char *query; - GList *sources_uri; - GList *sources_folder; -}; - -static char * -vfolder_setup_desc(struct _mail_msg *mm, int done) -{ - struct _setup_msg *m = (struct _setup_msg *)mm; - - return g_strdup_printf(_("Setting up vfolder: %s"), m->folder->full_name); -} - -static void -vfolder_setup_do(struct _mail_msg *mm) -{ - struct _setup_msg *m = (struct _setup_msg *)mm; - GList *l, *list = NULL; - CamelFolder *folder; - - d(printf("Setting up vfolder: %s\n", m->folder->full_name)); - - camel_vee_folder_set_expression((CamelVeeFolder *)m->folder, m->query); - - l = m->sources_uri; - while (l) { - d(printf(" Adding uri: %s\n", (char *)l->data)); - folder = mail_tool_uri_to_folder (l->data, 0, &mm->ex); - if (folder) { - list = g_list_append(list, folder); - } else { - g_warning("Could not open vfolder source: %s", (char *)l->data); - camel_exception_clear(&mm->ex); - } - l = l->next; - } - - l = m->sources_folder; - while (l) { - d(printf(" Adding folder: %s\n", ((CamelFolder *)l->data)->full_name)); - camel_object_ref(l->data); - list = g_list_append(list, l->data); - l = l->next; - } - - camel_vee_folder_set_folders((CamelVeeFolder *)m->folder, list); - - l = list; - while (l) { - camel_object_unref(l->data); - l = l->next; - } - g_list_free(list); -} - -static void -vfolder_setup_done(struct _mail_msg *mm) -{ - struct _setup_msg *m = (struct _setup_msg *)mm; - - m = m; -} - -static void -vfolder_setup_free (struct _mail_msg *mm) -{ - struct _setup_msg *m = (struct _setup_msg *)mm; - GList *l; - - camel_object_unref(m->folder); - g_free(m->query); - - l = m->sources_uri; - while (l) { - g_free(l->data); - l = l->next; - } - g_list_free(m->sources_uri); - - l = m->sources_folder; - while (l) { - camel_object_unref(l->data); - l = l->next; - } - g_list_free(m->sources_folder); -} - -static struct _mail_msg_op vfolder_setup_op = { - vfolder_setup_desc, - vfolder_setup_do, - vfolder_setup_done, - vfolder_setup_free, -}; - -static int -vfolder_setup(CamelFolder *folder, const char *query, GList *sources_uri, GList *sources_folder) -{ - struct _setup_msg *m; - int id; - - m = mail_msg_new(&vfolder_setup_op, NULL, sizeof (*m)); - m->folder = folder; - camel_object_ref(folder); - m->query = g_strdup(query); - m->sources_uri = sources_uri; - m->sources_folder = sources_folder; - - id = m->msg.seq; - e_thread_put(mail_thread_queued_slow, (EMsg *)m); - - return id; -} - -/* ********************************************************************** */ - -struct _adduri_msg { - struct _mail_msg msg; - - char *uri; - GList *folders; - int remove; -}; - -static char * -vfolder_adduri_desc(struct _mail_msg *mm, int done) -{ - struct _adduri_msg *m = (struct _adduri_msg *)mm; - - return g_strdup_printf(_("Updating vfolders for uri: %s"), m->uri); -} - -static void -vfolder_adduri_do(struct _mail_msg *mm) -{ - struct _adduri_msg *m = (struct _adduri_msg *)mm; - GList *l; - CamelFolder *folder = NULL; - - d(printf("%s uri to vfolder: %s\n", m->remove?"Removing":"Adding", m->uri)); - - /* we dont try lookup the cache if we are removing it, its no longer there */ - if (!m->remove && !mail_note_get_folder_from_uri(m->uri, &folder)) { - g_warning("Folder '%s' disappeared while I was adding/remove it to/from my vfolder", m->uri); - return; - } - - if (folder == NULL) - folder = mail_tool_uri_to_folder (m->uri, 0, &mm->ex); - - if (folder != NULL) { - l = m->folders; - while (l) { - if (m->remove) - camel_vee_folder_remove_folder((CamelVeeFolder *)l->data, folder); - else - camel_vee_folder_add_folder((CamelVeeFolder *)l->data, folder); - l = l->next; - } - camel_object_unref(folder); - } -} - -static void -vfolder_adduri_done(struct _mail_msg *mm) -{ - struct _adduri_msg *m = (struct _adduri_msg *)mm; - - m = m; -} - -static void -vfolder_adduri_free (struct _mail_msg *mm) -{ - struct _adduri_msg *m = (struct _adduri_msg *)mm; - - g_list_foreach(m->folders, (GFunc)camel_object_unref, NULL); - g_list_free(m->folders); - g_free(m->uri); -} - -static struct _mail_msg_op vfolder_adduri_op = { - vfolder_adduri_desc, - vfolder_adduri_do, - vfolder_adduri_done, - vfolder_adduri_free, -}; - -static int -vfolder_adduri(const char *uri, GList *folders, int remove) -{ - struct _adduri_msg *m; - int id; - - m = mail_msg_new(&vfolder_adduri_op, NULL, sizeof (*m)); - m->folders = folders; - m->uri = g_strdup(uri); - m->remove = remove; - - id = m->msg.seq; - e_thread_put(mail_thread_queued_slow, (EMsg *)m); - - return id; -} - -/* ********************************************************************** */ - -/* So, uh, apparently g_list_find_custom expect the compare func to return 0 to mean true? */ -static GList * -my_list_find(GList *l, const char *uri, GCompareFunc cmp) -{ - while (l) { - if (cmp(l->data, uri)) - break; - l = l->next; - } - return l; -} - -static int -uri_is_ignore(const char *uri, GCompareFunc uri_cmp) -{ - extern char *default_outbox_folder_uri, *default_sent_folder_uri, *default_drafts_folder_uri; - EAccountList *accounts; - EAccount *account; - EIterator *iter; - int found = FALSE; - - d(printf("checking '%s' against:\n %s\n %s\n %s\n", uri, default_outbox_folder_uri, default_sent_folder_uri, default_drafts_folder_uri)); - - found = (default_outbox_folder_uri && uri_cmp(default_outbox_folder_uri, uri)) - || (default_sent_folder_uri && uri_cmp(default_sent_folder_uri, uri)) - || (default_drafts_folder_uri && uri_cmp(default_drafts_folder_uri, uri)); - - accounts = mail_config_get_accounts (); - iter = e_list_get_iterator ((EList *) accounts); - while (e_iterator_is_valid (iter)) { - account = (EAccount *) e_iterator_get (iter); - - d(printf("checking sent_folder_uri '%s' == '%s'\n", - account->sent_folder_uri ? account->sent_folder_uri : "empty", uri)); - - found = (account->sent_folder_uri && uri_cmp (account->sent_folder_uri, uri)) - || (account->drafts_folder_uri && uri_cmp (account->drafts_folder_uri, uri)); - - if (found) - break; - - e_iterator_next (iter); - } - - g_object_unref (iter); - - return found; -} - -/* called when a new uri becomes (un)available */ -void -mail_vfolder_add_uri(CamelStore *store, const char *uri, int remove) -{ - FilterRule *rule; - const char *source; - CamelVeeFolder *vf; - GList *folders = NULL, *link; - int remote = (((CamelService *)store)->provider->flags & CAMEL_PROVIDER_IS_REMOTE) != 0; - GCompareFunc uri_cmp = CAMEL_STORE_CLASS(CAMEL_OBJECT_GET_CLASS(store))->compare_folder_name; - int is_ignore; - - if (CAMEL_IS_VEE_STORE(store) || !strncmp(uri, "vtrash:", 7) || !strncmp(uri, "vjunk:", 6) || context == NULL) - return; - - g_assert(pthread_self() == mail_gui_thread); - - is_ignore = uri_is_ignore(uri, uri_cmp); - - LOCK(); - - d(printf("%s uri to check: %s\n", remove?"Removing":"Adding", uri)); - - /* maintain the source folders lists for changed rules later on */ - if (remove) { - if (remote) { - if ((link = my_list_find(source_folders_remote, (void *)uri, uri_cmp)) != NULL) { - g_free(link->data); - source_folders_remote = g_list_remove_link(source_folders_remote, link); - } - } else { - if ((link = my_list_find(source_folders_local, (void *)uri, uri_cmp)) != NULL) { - g_free(link->data); - source_folders_local = g_list_remove_link(source_folders_local, link); - } - } - } else if (!is_ignore) { - /* we ignore drafts/sent/outbox here */ - if (remote) { - if (my_list_find(source_folders_remote, (void *)uri, uri_cmp) == NULL) - source_folders_remote = g_list_prepend(source_folders_remote, g_strdup(uri)); - } else { - if (my_list_find(source_folders_local, (void *)uri, uri_cmp) == NULL) - source_folders_local = g_list_prepend(source_folders_local, g_strdup(uri)); - } - } - - rule = NULL; - while ((rule = rule_context_next_rule((RuleContext *)context, rule, NULL))) { - int found = FALSE; - - if (!rule->name) { - d(printf("invalid rule (%p): rule->name is set to NULL\n", rule)); - continue; - } - - /* dont auto-add any sent/drafts folders etc, they must be explictly listed as a source */ - if (rule->source - && !is_ignore - && ((!strcmp(rule->source, "local") && !remote) - || (!strcmp(rule->source, "remote_active") && remote) - || (!strcmp(rule->source, "local_remote_active")))) - found = TRUE; - - /* we check using the store uri_cmp since its more accurate */ - source = NULL; - while (!found && (source = vfolder_rule_next_source((VfolderRule *)rule, source))) - found = uri_cmp(uri, source); - - if (found) { - vf = g_hash_table_lookup(vfolder_hash, rule->name); - g_assert(vf); - camel_object_ref(vf); - folders = g_list_prepend(folders, vf); - } - } - - UNLOCK(); - - if (folders != NULL) - vfolder_adduri(uri, folders, remove); -} - -/* called when a uri is deleted from a store */ -void -mail_vfolder_delete_uri(CamelStore *store, const char *uri) -{ - GCompareFunc uri_cmp = CAMEL_STORE_CLASS(CAMEL_OBJECT_GET_CLASS(store))->compare_folder_name; - FilterRule *rule; - const char *source; - CamelVeeFolder *vf; - GString *changed; - - if (context == NULL || !strncmp(uri, "vtrash:", 7) || !strncmp(uri, "vjunk:", 6)) - return; - - d(printf ("Deleting uri to check: %s\n", uri)); - - g_assert (pthread_self() == mail_gui_thread); - - changed = g_string_new (""); - - LOCK(); - - /* see if any rules directly reference this removed uri */ - rule = NULL; - while ((rule = rule_context_next_rule ((RuleContext *) context, rule, NULL))) { - source = NULL; - while ((source = vfolder_rule_next_source ((VfolderRule *) rule, source))) { - /* Remove all sources that match, ignore changed events though - because the adduri call above does the work async */ - if (uri_cmp (uri, source)) { - vf = g_hash_table_lookup (vfolder_hash, rule->name); - g_assert (vf != NULL); - g_signal_handlers_disconnect_matched (rule, G_SIGNAL_MATCH_FUNC|G_SIGNAL_MATCH_DATA, 0, - 0, NULL, rule_changed, vf); - vfolder_rule_remove_source ((VfolderRule *)rule, source); - g_signal_connect (rule, "changed", G_CALLBACK(rule_changed), vf); - g_string_append_printf (changed, " %s\n", rule->name); - source = NULL; - } - } - } - - UNLOCK(); - - if (changed->str[0]) { - GtkWidget *dialog; - char *user; - - dialog = gtk_message_dialog_new (NULL, 0, GTK_MESSAGE_INFO, GTK_BUTTONS_OK, - _("The following vFolder(s):\n%s" - "Used the removed folder:\n '%s'\n" - "And have been updated."), - changed->str, uri); - g_signal_connect_swapped (dialog, "response", G_CALLBACK (gtk_widget_destroy), dialog); - gtk_widget_show (dialog); - - user = g_strdup_printf ("%s/mail/vfolders.xml", - mail_component_peek_base_directory (mail_component_peek ())); - rule_context_save ((RuleContext *) context, user); - g_free (user); - } - - g_string_free (changed, TRUE); -} - -/* called when a uri is renamed in a store */ -void -mail_vfolder_rename_uri(CamelStore *store, const char *from, const char *to) -{ - GCompareFunc uri_cmp = CAMEL_STORE_CLASS(CAMEL_OBJECT_GET_CLASS(store))->compare_folder_name; - FilterRule *rule; - const char *source; - CamelVeeFolder *vf; - int changed = 0; - - d(printf("vfolder rename uri: %s to %s\n", from, to)); - - if (context == NULL || !strncmp(from, "vtrash:", 7) || !strncmp(to, "vtrash:", 7) || !strncmp(from, "vjunk:", 6) || !strncmp(to, "vjunk:", 6)) - return; - - g_assert(pthread_self() == mail_gui_thread); - - LOCK(); - - /* see if any rules directly reference this removed uri */ - rule = NULL; - while ( (rule = rule_context_next_rule((RuleContext *)context, rule, NULL)) ) { - source = NULL; - while ( (source = vfolder_rule_next_source((VfolderRule *)rule, source)) ) { - /* Remove all sources that match, ignore changed events though - because the adduri call above does the work async */ - if (uri_cmp(from, source)) { - d(printf("Vfolder '%s' used '%s' ('%s') now uses '%s'\n", rule->name, source, from, to)); - vf = g_hash_table_lookup(vfolder_hash, rule->name); - g_assert(vf); - g_signal_handlers_disconnect_matched(rule, G_SIGNAL_MATCH_FUNC|G_SIGNAL_MATCH_DATA, 0, - 0, NULL, rule_changed, vf); - vfolder_rule_remove_source((VfolderRule *)rule, source); - vfolder_rule_add_source((VfolderRule *)rule, to); - g_signal_connect(rule, "changed", G_CALLBACK(rule_changed), vf); - changed++; - source = NULL; - } - } - } - - UNLOCK(); - - if (changed) { - char *user; - - d(printf("Vfolders updated from renamed folder\n")); - user = g_strdup_printf("%s/mail/vfolders.xml", mail_component_peek_base_directory (mail_component_peek ())); - rule_context_save((RuleContext *)context, user); - g_free(user); - } -} - -/* ********************************************************************** */ - -static void context_rule_added(RuleContext *ctx, FilterRule *rule); - -static void -rule_changed(FilterRule *rule, CamelFolder *folder) -{ - const char *sourceuri; - GList *l; - GList *sources_uri = NULL, *sources_folder = NULL; - GString *query; - int i; - CamelFolder *newfolder; - - /* if the folder has changed name, then add it, then remove the old manually */ - if (strcmp(folder->full_name, rule->name) != 0) { - char *key, *oldname; - CamelFolder *old; - - LOCK(); - d(printf("Changing folder name in hash table to '%s'\n", rule->name)); - if (g_hash_table_lookup_extended(vfolder_hash, folder->full_name, (void **)&key, (void **)&old)) { - g_hash_table_remove(vfolder_hash, key); - g_free(key); - g_hash_table_insert(vfolder_hash, g_strdup(rule->name), folder); - UNLOCK(); - } else { - UNLOCK(); - g_warning("couldn't find a vfolder rule in our table? %s", folder->full_name); - } - - /* TODO: make the folder->full_name var thread accessible */ - oldname = g_strdup(folder->full_name); - camel_store_rename_folder(vfolder_store, oldname, rule->name, NULL); - g_free(oldname); - } - - d(printf("Filter rule changed? for folder '%s'!!\n", folder->name)); - - /* find any (currently available) folders, and add them to the ones to open */ - sourceuri = NULL; - while ( (sourceuri = vfolder_rule_next_source((VfolderRule *)rule, sourceuri)) ) { - if (mail_note_get_folder_from_uri(sourceuri, &newfolder)) { - if (newfolder) - sources_folder = g_list_append(sources_folder, newfolder); - else - sources_uri = g_list_append(sources_uri, g_strdup(sourceuri)); - } - } - - /* check the remote/local uri lists for any other uri's that should be looked at */ - if (rule->source) { - LOCK(); - for (i=0;i<2;i++) { - if (i==0 && (!strcmp(rule->source, "local") || !strcmp(rule->source, "local_remote_active"))) - l = source_folders_local; - else if (i==1 && (!strcmp(rule->source, "remote_active") || !strcmp(rule->source, "local_remote_active"))) - l = source_folders_remote; - else - l = NULL; - - while (l) { - if (mail_note_get_folder_from_uri(l->data, &newfolder)) { - if (newfolder) - sources_folder = g_list_append(sources_folder, newfolder); - else - sources_uri = g_list_append(sources_uri, g_strdup(l->data)); - } else { - d(printf(" -> No such folder?\n")); - } - l = l->next; - } - } - UNLOCK(); - } - - query = g_string_new(""); - filter_rule_build_code(rule, query); - - vfolder_setup(folder, query->str, sources_uri, sources_folder); - - g_string_free(query, TRUE); -} - -static void context_rule_added(RuleContext *ctx, FilterRule *rule) -{ - CamelFolder *folder; - - d(printf("rule added: %s\n", rule->name)); - - /* this always runs quickly */ - folder = camel_store_get_folder(vfolder_store, rule->name, 0, NULL); - if (folder) { - g_signal_connect(rule, "changed", G_CALLBACK(rule_changed), folder); - - LOCK(); - g_hash_table_insert(vfolder_hash, g_strdup(rule->name), folder); - UNLOCK(); - - mail_note_folder(folder); - rule_changed(rule, folder); - } -} - -static void context_rule_removed(RuleContext *ctx, FilterRule *rule) -{ - char *key, *path; - CamelFolder *folder = NULL; - - d(printf("rule removed; %s\n", rule->name)); - - /* TODO: remove from folder info cache? */ - - /* FIXME: is this even necessary? if we remove the folder from - * the CamelStore, the tree should pick it up auto-magically - * because it listens to CamelStore events... */ - path = g_strdup_printf("/%s", rule->name); - mail_component_remove_folder (mail_component_peek (), vfolder_store, path); - g_free(path); - - LOCK(); - if (g_hash_table_lookup_extended(vfolder_hash, rule->name, (void **)&key, (void **)&folder)) { - g_hash_table_remove(vfolder_hash, key); - g_free(key); - } - UNLOCK(); - - camel_store_delete_folder(vfolder_store, rule->name, NULL); - /* this must be unref'd after its deleted */ - if (folder) - camel_object_unref(folder); -} - -static void -store_folder_created(CamelObject *o, void *event_data, void *data) -{ - CamelStore *store = (CamelStore *)o; - CamelFolderInfo *info = event_data; - - store = store; - info = info; -} - -static void -store_folder_deleted(CamelObject *o, void *event_data, void *data) -{ - CamelStore *store = (CamelStore *)o; - CamelFolderInfo *info = event_data; - FilterRule *rule; - char *user; - - d(printf("Folder deleted: %s\n", info->name)); - store = store; - - /* Warning not thread safe, but might be enough */ - - LOCK(); - - /* delete it from our list */ - rule = rule_context_find_rule((RuleContext *)context, info->full_name, NULL); - if (rule) { - /* We need to stop listening to removed events, otherwise we'll try and remove it again */ - g_signal_handlers_disconnect_matched(context, G_SIGNAL_MATCH_FUNC|G_SIGNAL_MATCH_DATA, 0, - 0, NULL, context_rule_removed, context); - rule_context_remove_rule((RuleContext *)context, rule); - g_object_unref(rule); - g_signal_connect(context, "rule_removed", G_CALLBACK(context_rule_removed), context); - - user = g_strdup_printf("%s/mail/vfolders.xml", mail_component_peek_base_directory (mail_component_peek ())); - rule_context_save((RuleContext *)context, user); - g_free(user); - } else { - g_warning("Cannot find rule for deleted vfolder '%s'", info->name); - } - - UNLOCK(); -} - -static void -store_folder_renamed(CamelObject *o, void *event_data, void *data) -{ - CamelStore *store = (CamelStore *)o; - CamelRenameInfo *info = event_data; - FilterRule *rule; - char *user; - char *key; - CamelFolder *folder; - - /* This should be more-or-less thread-safe */ - - d(printf("Folder renamed to '%s' from '%s'\n", info->new->full_name, info->old_base)); - - /* Folder is already renamed? */ - LOCK(); - d(printf("Changing folder name in hash table to '%s'\n", info->new->full_name)); - if (g_hash_table_lookup_extended(vfolder_hash, info->old_base, (void **)&key, (void **)&folder)) { - g_hash_table_remove(vfolder_hash, key); - g_free(key); - g_hash_table_insert(vfolder_hash, g_strdup(info->new->full_name), folder); - - rule = rule_context_find_rule((RuleContext *)context, info->old_base, NULL); - g_assert(rule); - g_signal_handlers_disconnect_matched(rule, G_SIGNAL_MATCH_FUNC|G_SIGNAL_MATCH_DATA, 0, - 0, NULL, rule_changed, folder); - filter_rule_set_name(rule, info->new->full_name); - g_signal_connect(rule, "changed", G_CALLBACK(rule_changed), folder); - - user = g_strdup_printf("%s/mail/vfolders.xml", mail_component_peek_base_directory (mail_component_peek ())); - rule_context_save((RuleContext *)context, user); - g_free(user); - - UNLOCK(); - } else { - UNLOCK(); - g_warning("couldn't find a vfolder rule in our table? %s", info->new->full_name); - } -} - -void -vfolder_load_storage(void) -{ - char *user, *storeuri; - FilterRule *rule; - - vfolder_hash = g_hash_table_new(g_str_hash, g_str_equal); - - /* first, create the vfolder store, and set it up */ - storeuri = g_strdup_printf("vfolder:%s/vfolder", mail_component_peek_base_directory (mail_component_peek ())); - vfolder_store = camel_session_get_store(session, storeuri, NULL); - if (vfolder_store == NULL) { - g_warning("Cannot open vfolder store - no vfolders available"); - return; - } - - camel_object_hook_event(vfolder_store, "folder_created", - (CamelObjectEventHookFunc)store_folder_created, NULL); - camel_object_hook_event(vfolder_store, "folder_deleted", - (CamelObjectEventHookFunc)store_folder_deleted, NULL); - camel_object_hook_event(vfolder_store, "folder_renamed", - (CamelObjectEventHookFunc)store_folder_renamed, NULL); - - d(printf("got store '%s' = %p\n", storeuri, vfolder_store)); - mail_component_load_store_by_uri (mail_component_peek (), storeuri, _("VFolders")); - - /* load our rules */ - user = g_strdup_printf ("%s/mail/vfolders.xml", mail_component_peek_base_directory (mail_component_peek ())); - context = vfolder_context_new (); - if (rule_context_load ((RuleContext *)context, - EVOLUTION_PRIVDATADIR "/vfoldertypes.xml", user) != 0) { - g_warning("cannot load vfolders: %s\n", ((RuleContext *)context)->error); - } - g_free (user); - - g_signal_connect(context, "rule_added", G_CALLBACK(context_rule_added), context); - g_signal_connect(context, "rule_removed", G_CALLBACK(context_rule_removed), context); - - /* and setup the rules we have */ - rule = NULL; - while ( (rule = rule_context_next_rule((RuleContext *)context, rule, NULL)) ) { - if (rule->name) - context_rule_added((RuleContext *)context, rule); - else - d(printf("invalid rule (%p) encountered: rule->name is NULL\n", rule)); - } - - g_free(storeuri); -} - -static GtkWidget *vfolder_editor = NULL; - -static void -vfolder_editor_response (GtkWidget *dialog, int button, void *data) -{ - char *user; - - user = g_strdup_printf ("%s/mail/vfolders.xml", mail_component_peek_base_directory (mail_component_peek ())); - - switch(button) { - case GTK_RESPONSE_ACCEPT: - rule_context_save((RuleContext *)context, user); - break; - default: - rule_context_revert((RuleContext *)context, user); - } - - vfolder_editor = NULL; - - gtk_widget_destroy(dialog); - - g_free (user); -} - -void -vfolder_edit (void) -{ - if (vfolder_editor) { - gdk_window_raise (GTK_WIDGET (vfolder_editor)->window); - return; - } - - vfolder_editor = GTK_WIDGET (vfolder_editor_new (context)); - gtk_window_set_title (GTK_WINDOW (vfolder_editor), _("vFolders")); - g_signal_connect(vfolder_editor, "response", G_CALLBACK(vfolder_editor_response), NULL); - - gtk_widget_show (vfolder_editor); -} - -static void -edit_rule_response(GtkWidget *w, int button, void *data) -{ - if (button == GTK_RESPONSE_OK) { - char *user; - FilterRule *rule = g_object_get_data (G_OBJECT (w), "rule"); - FilterRule *orig = g_object_get_data (G_OBJECT (w), "orig"); - - filter_rule_copy(orig, rule); - user = g_strdup_printf("%s/mail/vfolders.xml", mail_component_peek_base_directory (mail_component_peek ())); - rule_context_save((RuleContext *)context, user); - g_free(user); - } - - gtk_widget_destroy(w); -} - -void -vfolder_edit_rule(const char *uri) -{ - GtkWidget *w; - GtkDialog *gd; - FilterRule *rule, *newrule; - CamelURL *url; - - url = camel_url_new(uri, NULL); - if (url && url->fragment - && (rule = rule_context_find_rule((RuleContext *)context, url->fragment, NULL))) { - g_object_ref((GtkObject *)rule); - newrule = filter_rule_clone(rule); - - w = filter_rule_get_widget((FilterRule *)newrule, (RuleContext *)context); - - gd = (GtkDialog *)gtk_dialog_new_with_buttons(_("Edit VFolder"), NULL, - GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_STOCK_CANCEL, - GTK_RESPONSE_CANCEL, - GTK_STOCK_OK, - GTK_RESPONSE_OK, - NULL); - gtk_container_set_border_width (GTK_CONTAINER (gd), 6); - gtk_box_set_spacing ((GtkBox *) gd->vbox, 6); - gtk_dialog_set_default_response(gd, GTK_RESPONSE_OK); - g_object_set(gd, "allow_shrink", FALSE, "allow_grow", TRUE, NULL); - gtk_window_set_default_size (GTK_WINDOW (gd), 500, 500); - gtk_box_pack_start((GtkBox *)gd->vbox, w, TRUE, TRUE, 0); - gtk_widget_show((GtkWidget *)gd); - g_object_set_data_full(G_OBJECT(gd), "rule", newrule, (GtkDestroyNotify)g_object_unref); - g_object_set_data_full(G_OBJECT(gd), "orig", rule, (GtkDestroyNotify)g_object_unref); - g_signal_connect(gd, "response", G_CALLBACK(edit_rule_response), NULL); - gtk_widget_show((GtkWidget *)gd); - } else { - e_notice (NULL, GTK_MESSAGE_WARNING, - _("Trying to edit a vfolder '%s' which doesn't exist."), uri); - } - - if (url) - camel_url_free(url); -} - -static void -new_rule_clicked(GtkWidget *w, int button, void *data) -{ - if (button == GTK_RESPONSE_OK) { - char *user; - FilterRule *rule = g_object_get_data((GObject *)w, "rule"); - - if (!filter_rule_validate(rule)) { - /* no need to popup a dialog because the validate code does that. */ - return; - } - - if (rule_context_find_rule ((RuleContext *)context, rule->name, rule->source)) { - GtkWidget *dialog = - gtk_message_dialog_new ((GtkWindow *) w, GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, - _("Rule name '%s' is not unique, choose another."), - rule->name); - - gtk_dialog_run ((GtkDialog *) dialog); - gtk_widget_destroy (dialog); - - return; - } - - - g_object_ref(rule); - rule_context_add_rule((RuleContext *)context, rule); - user = g_strdup_printf("%s/mail/vfolders.xml", mail_component_peek_base_directory (mail_component_peek ())); - rule_context_save((RuleContext *)context, user); - g_free(user); - } - - gtk_widget_destroy(w); -} - -FilterPart * -vfolder_create_part(const char *name) -{ - return rule_context_create_part((RuleContext *)context, name); -} - -/* clones a filter/search rule into a matching vfolder rule (assuming the same system definitions) */ -FilterRule * -vfolder_clone_rule(FilterRule *in) -{ - FilterRule *rule = (FilterRule *)vfolder_rule_new(); - xmlNodePtr xml; - - xml = filter_rule_xml_encode(in); - filter_rule_xml_decode(rule, xml, (RuleContext *)context); - xmlFreeNodeList(xml); - - return rule; -} - -/* adds a rule with a gui */ -void -vfolder_gui_add_rule(VfolderRule *rule) -{ - GtkWidget *w; - GtkDialog *gd; - - w = filter_rule_get_widget((FilterRule *)rule, (RuleContext *)context); - - gd = (GtkDialog *)gtk_dialog_new_with_buttons(_("New VFolder"), - NULL, - GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_STOCK_CANCEL, - GTK_RESPONSE_CANCEL, - GTK_STOCK_OK, - GTK_RESPONSE_OK, - NULL); - gtk_dialog_set_default_response(gd, GTK_RESPONSE_OK); - gtk_container_set_border_width (GTK_CONTAINER (gd), 6); - gtk_box_set_spacing ((GtkBox *) gd->vbox, 6); - g_object_set(gd, "allow_shrink", FALSE, "allow_grow", TRUE, NULL); - gtk_window_set_default_size (GTK_WINDOW (gd), 500, 500); - gtk_box_pack_start((GtkBox *)gd->vbox, w, TRUE, TRUE, 0); - gtk_widget_show((GtkWidget *)gd); - g_object_set_data_full(G_OBJECT(gd), "rule", rule, (GtkDestroyNotify)g_object_unref); - g_signal_connect(gd, "response", G_CALLBACK(new_rule_clicked), NULL); - gtk_widget_show((GtkWidget *)gd); -} - -void -vfolder_gui_add_from_message(CamelMimeMessage *msg, int flags, const char *source) -{ - VfolderRule *rule; - - g_return_if_fail (msg != NULL); - - rule = (VfolderRule*)vfolder_rule_from_message(context, msg, flags, source); - vfolder_gui_add_rule(rule); -} - -static void -vfolder_foreach_cb (gpointer key, gpointer data, gpointer user_data) -{ - CamelFolder *folder = CAMEL_FOLDER (data); - - if (folder) - camel_object_unref(folder); - - g_free (key); -} - -void -mail_vfolder_shutdown (void) -{ - g_hash_table_foreach (vfolder_hash, vfolder_foreach_cb, NULL); - g_hash_table_destroy (vfolder_hash); - vfolder_hash = NULL; - - if (vfolder_store) { - camel_object_unref (vfolder_store); - vfolder_store = NULL; - } - - if (context) { - g_object_unref(context); - context = NULL; - } -} diff --git a/mail/mail-vfolder.h b/mail/mail-vfolder.h deleted file mode 100644 index d945454c5e..0000000000 --- a/mail/mail-vfolder.h +++ /dev/null @@ -1,33 +0,0 @@ - -#ifndef _MAIL_VFOLDER_H -#define _MAIL_VFOLDER_H - -#include "Evolution.h" - -#include "camel/camel-folder.h" -#include "camel/camel-mime-message.h" -#include "filter/vfolder-rule.h" -#include "filter/filter-part.h" - -void vfolder_load_storage(void); - -void vfolder_edit (void); -void vfolder_edit_rule(const char *name); -FilterPart *vfolder_create_part (const char *name); -FilterRule *vfolder_clone_rule (FilterRule *in); -void vfolder_gui_add_rule (VfolderRule *rule); -void vfolder_gui_add_from_message (CamelMimeMessage *msg, int flags, const char *source); - -/* add a uri that is now (un)available to vfolders in a transient manner */ -void mail_vfolder_add_uri(CamelStore *store, const char *uri, int remove); - -/* note that a folder has changed name (uri) */ -void mail_vfolder_rename_uri(CamelStore *store, const char *from, const char *to); - -/* remove a uri that should be removed from vfolders permanently */ -void mail_vfolder_delete_uri(CamelStore *store, const char *uri); - -/* close up, clean up */ -void mail_vfolder_shutdown (void); - -#endif diff --git a/mail/mail.h b/mail/mail.h deleted file mode 100644 index 52d1b720a5..0000000000 --- a/mail/mail.h +++ /dev/null @@ -1,33 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Copyright 2000, Ximian, Inc. (www.ximian.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public - * License as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -/* This file is a F*CKING MESS. Shame to us! */ - -#include <libgnomevfs/gnome-vfs-mime-handlers.h> -#include <gtkhtml/gtkhtml.h> -#include <camel/camel.h> -#include <composer/e-msg-composer.h> -#include "mail-config.h" -#include "mail-session.h" -#include "mail-types.h" - -/* mail-identify */ -char *mail_identify_mime_part (CamelMimePart *part, MailDisplay *md); -gboolean evolution_folder_info_factory_init (void); - diff --git a/mail/message-list.c b/mail/message-list.c deleted file mode 100644 index c1fb66c39e..0000000000 --- a/mail/message-list.c +++ /dev/null @@ -1,3378 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Authors: Miguel de Icaza (miguel@ximian.com) - * Bertrand Guiheneuf (bg@aful.org) - * And just about everyone else in evolution ... - * - * Copyright 2000-2002 Ximian, Inc. (www.ximian.com) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA. - * - */ - - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <string.h> -#include <ctype.h> - -#include <glib/gunicode.h> - -#include <gconf/gconf.h> -#include <gconf/gconf-client.h> - -#include <gal/util/e-util.h> -#include <gal/widgets/e-gui-utils.h> -#include <gal/e-table/e-cell-text.h> -#include <gal/e-table/e-cell-toggle.h> -#include <gal/e-table/e-cell-checkbox.h> -#include <gal/e-table/e-cell-tree.h> -#include <gal/e-table/e-cell-date.h> -#include <gal/e-table/e-cell-size.h> -#include <gal/e-table/e-tree-memory.h> -#include <gal/e-table/e-tree-memory-callbacks.h> - -#include <camel/camel-exception.h> -#include <camel/camel-file-utils.h> -#include <camel/camel-folder.h> -#include <camel/camel-folder-thread.h> -#include <e-util/e-memory.h> - -#include "filter/filter-label.h" - -#include "mail-config.h" -#include "message-list.h" -#include "mail-mt.h" -#include "mail-tools.h" -#include "mail-ops.h" - -#include "em-utils.h" - -#include "art/mail-new.xpm" -#include "art/mail-read.xpm" -#include "art/mail-replied.xpm" -#include "art/attachment.xpm" -#include "art/priority-high.xpm" -#include "art/empty.xpm" -#include "art/score-lowest.xpm" -#include "art/score-lower.xpm" -#include "art/score-low.xpm" -#include "art/score-normal.xpm" -#include "art/score-high.xpm" -#include "art/score-higher.xpm" -#include "art/score-highest.xpm" -#include "art/flag-for-followup.xpm" -#include "art/flag-for-followup-done.xpm" - -/*#define TIMEIT */ - -#ifdef TIMEIT -#include <sys/time.h> -#include <unistd.h> -#endif - -#define d(x) -#define t(x) - -struct _MessageListPrivate { - GtkWidget *invisible; /* 4 selection */ - - GPtrArray *primary_uids; /* uids in primary selection */ - GPtrArray *clipboard_uids; /* uids in clipboard selection */ -}; - -/* - * Default sizes for the ETable display - * - */ -#define N_CHARS(x) (CHAR_WIDTH * (x)) - -#define COL_ICON_WIDTH (16) -#define COL_ATTACH_WIDTH (16) -#define COL_CHECK_BOX_WIDTH (16) -#define COL_FROM_EXPANSION (24.0) -#define COL_FROM_WIDTH_MIN (32) -#define COL_SUBJECT_EXPANSION (30.0) -#define COL_SUBJECT_WIDTH_MIN (32) -#define COL_SENT_EXPANSION (24.0) -#define COL_SENT_WIDTH_MIN (32) -#define COL_RECEIVED_EXPANSION (20.0) -#define COL_RECEIVED_WIDTH_MIN (32) -#define COL_TO_EXPANSION (24.0) -#define COL_TO_WIDTH_MIN (32) -#define COL_SIZE_EXPANSION (6.0) -#define COL_SIZE_WIDTH_MIN (32) - -enum { - NORMALISED_SUBJECT, - NORMALISED_FROM, - NORMALISED_TO, - NORMALISED_LAST, -}; - -#define PARENT_TYPE (e_tree_scrolled_get_type ()) - -/* #define SMART_ADDRESS_COMPARE */ - -#ifdef SMART_ADDRESS_COMPARE -struct _EMailAddress { - ENameWestern *wname; - char *address; -}; - -typedef struct _EMailAddress EMailAddress; -#endif /* SMART_ADDRESS_COMPARE */ - -static ETreeScrolledClass *message_list_parent_class; - -static void on_cursor_activated_cmd (ETree *tree, int row, ETreePath path, gpointer user_data); -static void on_selection_changed_cmd(ETree *tree, MessageList *ml); -static gint on_click (ETree *tree, gint row, ETreePath path, gint col, GdkEvent *event, MessageList *list); -static char *filter_date (time_t date); -static char *filter_size (int size); - -static void folder_changed (CamelObject *o, gpointer event_data, gpointer user_data); -static void message_changed (CamelObject *o, gpointer event_data, gpointer user_data); - -static void hide_save_state(MessageList *ml); -static void hide_load_state(MessageList *ml); - -/* note: @changes is owned/freed by the caller */ -/*static void mail_do_regenerate_messagelist (MessageList *list, const char *search, const char *hideexpr, CamelFolderChangeInfo *changes);*/ -static void mail_regen_list(MessageList *ml, const char *search, const char *hideexpr, CamelFolderChangeInfo *changes); - -static void clear_info(char *key, ETreePath *node, MessageList *ml); - -enum { - MESSAGE_SELECTED, - MESSAGE_LIST_BUILT, - LAST_SIGNAL -}; - -static guint message_list_signals [LAST_SIGNAL] = {0, }; - -static struct { - char **image_base; - GdkPixbuf *pixbuf; -} states_pixmaps [] = { - { mail_new_xpm, NULL }, - { mail_read_xpm, NULL }, - { mail_replied_xpm, NULL }, -/* FIXME: Replace these with pixmaps for multiple_read and multiple_unread */ - { mail_new_xpm, NULL }, - { mail_read_xpm, NULL }, - { empty_xpm, NULL }, - { attachment_xpm, NULL }, - { priority_high_xpm, NULL }, - { score_lowest_xpm, NULL }, - { score_lower_xpm, NULL }, - { score_low_xpm, NULL }, - { score_normal_xpm, NULL }, - { score_high_xpm, NULL }, - { score_higher_xpm, NULL }, - { score_highest_xpm, NULL }, - { flag_for_followup_xpm,NULL }, - { flag_for_followup_done_xpm,NULL }, - { NULL, NULL } -}; - -/* FIXME: junk prefs */ -static gboolean junk_folder = TRUE; - -#ifdef SMART_ADDRESS_COMPARE -static EMailAddress * -e_mail_address_new (const char *address) -{ - CamelInternetAddress *cia; - EMailAddress *new; - const char *name = NULL, *addr = NULL; - - cia = camel_internet_address_new (); - if (camel_address_unformat (CAMEL_ADDRESS (cia), address) == -1) { - camel_object_unref (cia); - return NULL; - } - camel_internet_address_get (cia, 0, &name, &addr); - - new = g_new (EMailAddress, 1); - new->address = g_strdup (addr); - if (name && *name) { - new->wname = e_name_western_parse (name); - } else { - new->wname = NULL; - } - - camel_object_unref (cia); - - return new; -} - -static void -e_mail_address_free (EMailAddress *addr) -{ - g_return_if_fail (addr != NULL); - - g_free (addr->address); - if (addr->wname) - e_name_western_free (addr->wname); - g_free (addr); -} - -/* Note: by the time this function is called, the strings have already - been normalised which means we can assume all lowercase chars and - we can just use strcmp for the final comparison. */ -static int -e_mail_address_compare (gconstpointer address1, gconstpointer address2) -{ - const EMailAddress *addr1 = address1; - const EMailAddress *addr2 = address2; - int retval; - - g_return_val_if_fail (addr1 != NULL, 1); - g_return_val_if_fail (addr2 != NULL, -1); - - if (!addr1->wname && !addr2->wname) { - /* have to compare addresses, one or both don't have names */ - g_return_val_if_fail (addr1->address != NULL, 1); - g_return_val_if_fail (addr2->address != NULL, -1); - - return strcmp (addr1->address, addr2->address); - } - - if (!addr1->wname) - return -1; - if (!addr2->wname) - return 1; - - if (!addr1->wname->last && !addr2->wname->last) { - /* neither has a last name - default to address? */ - /* FIXME: what do we compare next? */ - g_return_val_if_fail (addr1->address != NULL, 1); - g_return_val_if_fail (addr2->address != NULL, -1); - - return strcmp (addr1->address, addr2->address); - } - - if (!addr1->wname->last) - return -1; - if (!addr2->wname->last) - return 1; - - retval = strcmp (addr1->wname->last, addr2->wname->last); - if (retval) - return retval; - - /* last names are identical - compare first names */ - - if (!addr1->wname->first && !addr2->wname->first) - return strcmp (addr1->address, addr2->address); - - if (!addr1->wname->first) - return -1; - if (!addr2->wname->first) - return 1; - - retval = strcmp (addr1->wname->first, addr2->wname->first); - if (retval) - return retval; - - return strcmp (addr1->address, addr2->address); -} -#endif /* SMART_ADDRESS_COMPARE */ - -/* Note: by the time this function is called, the strings have already - been normalised which means we can assume all lowercase chars and - we can just use strcmp for the final comparison. */ -static int -address_compare (gconstpointer address1, gconstpointer address2) -{ -#ifdef SMART_ADDRESS_COMPARE - EMailAddress *addr1, *addr2; -#endif /* SMART_ADDRESS_COMPARE */ - int retval; - - g_return_val_if_fail (address1 != NULL, 1); - g_return_val_if_fail (address2 != NULL, -1); - -#ifdef SMART_ADDRESS_COMPARE - addr1 = e_mail_address_new (address1); - addr2 = e_mail_address_new (address2); - retval = e_mail_address_compare (addr1, addr2); - e_mail_address_free (addr1); - e_mail_address_free (addr2); -#else - retval = strcmp ((const char *) address1, (const char *) address2); -#endif /* SMART_ADDRESS_COMPARE */ - - return retval; -} - -static char * -filter_size (gint size) -{ - gfloat fsize; - - if (size < 1024) { - return g_strdup_printf ("%d", size); - } else { - fsize = ((gfloat) size) / 1024.0; - if (fsize < 1024.0) { - return g_strdup_printf ("%.2f K", fsize); - } else { - fsize /= 1024.0; - return g_strdup_printf ("%.2f M", fsize); - } - } -} - -/* Gets the uid of the message displayed at a given view row */ -static const char * -get_message_uid (MessageList *message_list, ETreePath node) -{ - CamelMessageInfo *info; - - g_assert (node != NULL); - info = e_tree_memory_node_get_data (E_TREE_MEMORY (message_list->model), node); - /* correct me if I'm wrong, but this should never be NULL, should it? */ - g_assert (info != NULL); - - return camel_message_info_uid (info); -} - -/* Gets the CamelMessageInfo for the message displayed at the given - * view row. - */ -static CamelMessageInfo * -get_message_info (MessageList *message_list, ETreePath node) -{ - CamelMessageInfo *info; - - g_assert (node != NULL); - info = e_tree_memory_node_get_data (E_TREE_MEMORY (message_list->model), node); - g_assert (info != NULL); - - return info; -} - -static const char * -get_normalised_string (MessageList *message_list, CamelMessageInfo *info, int col) -{ - const char *string, *str; - char *normalised; - EPoolv *poolv; - int index; - - switch (col) { - case COL_SUBJECT_NORM: - string = camel_message_info_subject (info); - index = NORMALISED_SUBJECT; - break; - case COL_FROM_NORM: - string = camel_message_info_from (info); - index = NORMALISED_FROM; - break; - case COL_TO_NORM: - string = camel_message_info_to (info); - index = NORMALISED_TO; - break; - default: - string = NULL; - index = NORMALISED_LAST; - g_assert_not_reached (); - } - - /* slight optimisation */ - if (string == NULL || string[0] == '\0') - return ""; - - poolv = g_hash_table_lookup (message_list->normalised_hash, camel_message_info_uid (info)); - if (poolv == NULL) { - poolv = e_poolv_new (NORMALISED_LAST); - g_hash_table_insert (message_list->normalised_hash, (char *) camel_message_info_uid (info), poolv); - } else { - str = e_poolv_get (poolv, index); - if (*str) - return str; - } - - if (col == COL_SUBJECT_NORM) { - const unsigned char *subject; - - subject = (const unsigned char *) string; - while (!g_ascii_strncasecmp (subject, "Re:", 3)) { - subject += 3; - - /* jump over any spaces */ - while (*subject && isspace ((int) *subject)) - subject++; - } - - /* jump over any spaces */ - while (*subject && isspace ((int) *subject)) - subject++; - - string = (const char *) subject; - } - - normalised = g_utf8_collate_key (string, -1); - e_poolv_set (poolv, index, normalised, TRUE); - - return e_poolv_get (poolv, index); -} - -struct search_func_data { - MessageList *message_list; - guint32 flags; - guint32 mask; -}; - -static gboolean -search_func (ETreeModel *model, ETreePath path, struct search_func_data *data) -{ - CamelMessageInfo *info; - - if (e_tree_model_node_is_root (data->message_list->model, path)) - return FALSE; - - info = get_message_info (data->message_list, path); - - if (info && (info->flags & data->mask) == data->flags) { - if (data->message_list->cursor_uid) { - g_free (data->message_list->cursor_uid); - data->message_list->cursor_uid = g_strdup (camel_message_info_uid (info)); - } - g_signal_emit (GTK_OBJECT (data->message_list), message_list_signals[MESSAGE_SELECTED], 0, - camel_message_info_uid (info)); - return TRUE; - } - return FALSE; -} - - -/** - * message_list_select: - * @message_list: a MessageList - * @base_row: the (model) row to start from - * @direction: the direction to search in - * @flags: a set of flag values - * @mask: a mask for comparing against @flags - * @wraparound: if %TRUE, go back to the beginning for - * the next match if necessary. - * - * This moves the message list selection to a suitable row. @base_row - * lists the first (model) row to try, but as a special case, model - * row -1 is mapped to the last row. @flags and @mask combine to specify - * what constitutes a suitable row. @direction is - * %MESSAGE_LIST_SELECT_NEXT if it should find the next matching - * message, or %MESSAGE_LIST_SELECT_PREVIOUS if it should find the - * previous. If no suitable row is found, the selection will be - * unchanged. - * - * Returns %TRUE if a new message has been selected or %FALSE otherwise. - **/ -gboolean -message_list_select (MessageList *message_list, - MessageListSelectDirection direction, - guint32 flags, - guint32 mask, - gboolean wraparound) -{ - struct search_func_data data; - ETreeFindNextParams params = 0; - - data.message_list = message_list; - data.flags = flags; - data.mask = mask; - - if (direction == MESSAGE_LIST_SELECT_NEXT) - params |= E_TREE_FIND_NEXT_FORWARD; - else - params |= E_TREE_FIND_NEXT_BACKWARD; - - if (wraparound) - params |= E_TREE_FIND_NEXT_WRAP; - - return e_tree_find_next (message_list->tree, params, (ETreePathFunc) search_func, &data); -} - - -/** - * message_list_select_uid: - * @message_list: - * @uid: - * - * Selects the message with the given UID. - **/ -void -message_list_select_uid (MessageList *message_list, const char *uid) -{ - ETreePath node; - - if (message_list->regen) { - g_free(message_list->pending_select_uid); - message_list->pending_select_uid = g_strdup(uid); - } - - node = g_hash_table_lookup (message_list->uid_nodemap, uid); - if (node) { - CamelMessageInfo *info; - - info = get_message_info (message_list, node); - - /* This will emit a changed signal that we'll pick up */ - e_tree_set_cursor (message_list->tree, node); - } else { - g_free (message_list->cursor_uid); - message_list->cursor_uid = NULL; - g_signal_emit (GTK_OBJECT (message_list), message_list_signals[MESSAGE_SELECTED], 0, NULL); - } -} - - -void -message_list_select_next_thread (MessageList *message_list) -{ - ETreePath node, last; - - if (!message_list->cursor_uid) - return; - - /* get the thread parent node */ - last = node = g_hash_table_lookup (message_list->uid_nodemap, message_list->cursor_uid); - while (!e_tree_model_node_is_root (message_list->model, node)) { - last = node; - node = e_tree_model_node_get_parent (message_list->model, node); - } - - /* get the next toplevel node */ - node = e_tree_model_node_get_next (message_list->model, last); - - if (node) { - CamelMessageInfo *info; - - info = get_message_info (message_list, node); - e_tree_set_cursor (message_list->tree, node); - - g_free (message_list->cursor_uid); - message_list->cursor_uid = g_strdup (camel_message_info_uid (info)); - - g_signal_emit (GTK_OBJECT (message_list), message_list_signals[MESSAGE_SELECTED], 0, - camel_message_info_uid (info)); - } -} - - -/** - * message_list_select_all: - * @message_list: Message List widget - * - * Selects all messages in the message list. - **/ -void -message_list_select_all (MessageList *message_list) -{ - ESelectionModel *etsm; - - etsm = e_tree_get_selection_model (message_list->tree); - - e_selection_model_select_all (etsm); -} - - -typedef struct thread_select_info { - MessageList *ml; - GPtrArray *paths; -} thread_select_info_t; - -static gboolean -select_node (ETreeModel *model, ETreePath path, gpointer user_data) -{ - thread_select_info_t *tsi = (thread_select_info_t *) user_data; - - g_ptr_array_add (tsi->paths, path); - return FALSE; /*not done yet*/ -} - -static void -thread_select_foreach (ETreePath path, gpointer user_data) -{ - thread_select_info_t *tsi = (thread_select_info_t *) user_data; - ETreeModel *model = tsi->ml->model; - ETreePath node; - - /* @path part of the initial selection. If it has children, - * we select them as well. If it doesn't, we select its siblings and - * their children (ie, the current node must be inside the thread - * that the user wants to mark. - */ - - if (e_tree_model_node_get_first_child (model, path)) { - node = path; - } else { - node = e_tree_model_node_get_parent (model, path); - - /* Let's make an exception: if no parent, then we're about - * to mark the whole tree. No. */ - if (e_tree_model_node_is_root (model, node)) - node = path; - } - - e_tree_model_node_traverse (model, node, select_node, tsi); -} - -/** - * message_list_select_thread: - * @message_list: Message List widget - * - * Selects all messages in the current thread (based on cursor). - **/ -void -message_list_select_thread (MessageList *message_list) -{ - ETreeSelectionModel *etsm; - thread_select_info_t tsi; - int i; - - tsi.ml = message_list; - tsi.paths = g_ptr_array_new (); - - etsm = (ETreeSelectionModel *) e_tree_get_selection_model (message_list->tree); - - e_tree_selected_path_foreach (message_list->tree, thread_select_foreach, &tsi); - - for (i = 0; i < tsi.paths->len; i++) - e_tree_selection_model_add_to_selection (etsm, tsi.paths->pdata[i]); - - g_ptr_array_free (tsi.paths, TRUE); -} - - -/** - * message_list_invert_selection: - * @message_list: Message List widget - * - * Invert the current selection in the message-list. - **/ -void -message_list_invert_selection (MessageList *message_list) -{ - ESelectionModel *etsm; - - etsm = e_tree_get_selection_model (message_list->tree); - - e_selection_model_invert_selection (etsm); -} - -void -message_list_copy(MessageList *ml, gboolean cut) -{ - struct _MessageListPrivate *p = ml->priv; - GPtrArray *uids; - - if (p->clipboard_uids) { - message_list_free_uids(ml, p->clipboard_uids); - p->clipboard_uids = NULL; - } - - uids = message_list_get_selected(ml); - - if (uids->len > 0) { - if (cut) { - int i; - - camel_folder_freeze(ml->folder); - for (i=0;i<uids->len;i++) - camel_folder_set_message_flags(ml->folder, uids->pdata[i], - CAMEL_MESSAGE_SEEN | CAMEL_MESSAGE_DELETED, - CAMEL_MESSAGE_SEEN | CAMEL_MESSAGE_DELETED); - - camel_folder_thaw(ml->folder); - } - - p->clipboard_uids = uids; - gtk_selection_owner_set(p->invisible, GDK_SELECTION_CLIPBOARD, gtk_get_current_event_time()); - } else { - message_list_free_uids(ml, uids); - gtk_selection_owner_set(NULL, GDK_SELECTION_CLIPBOARD, gtk_get_current_event_time()); - } -} - -gboolean -message_list_has_primary_selection(MessageList *ml) -{ - return ml->priv->primary_uids != NULL; -} - -void -message_list_paste(MessageList *ml) -{ - gtk_selection_convert(ml->priv->invisible, GDK_SELECTION_CLIPBOARD, - gdk_atom_intern ("x-uid-list", FALSE), - GDK_CURRENT_TIME); -} - -/* - * SimpleTableModel::col_count - */ -static int -ml_column_count (ETreeModel *etm, void *data) -{ - return COL_LAST; -} - -/* - * SimpleTableModel::has_save_id - */ -static gboolean -ml_has_save_id (ETreeModel *etm, void *data) -{ - return TRUE; -} - -/* - * SimpleTableModel::get_save_id - */ -static char * -ml_get_save_id (ETreeModel *etm, ETreePath path, void *data) -{ - CamelMessageInfo *info; - - info = e_tree_memory_node_get_data (E_TREE_MEMORY(etm), path); - if (info == NULL) - return g_strdup("root"); - return g_strdup (camel_message_info_uid(info)); -} - -/* - * SimpleTableModel::has_save_id - */ -static gboolean -ml_has_get_node_by_id (ETreeModel *etm, void *data) -{ - return TRUE; -} - -/* - * SimpleTableModel::get_save_id - */ -static ETreePath -ml_get_node_by_id (ETreeModel *etm, const char *save_id, void *data) -{ - MessageList *ml; - - ml = data; - - if (!strcmp (save_id, "root")) - return e_tree_model_get_root (etm); - - return g_hash_table_lookup(ml->uid_nodemap, save_id); -} - -static void * -ml_duplicate_value (ETreeModel *etm, int col, const void *value, void *data) -{ - switch (col){ - case COL_MESSAGE_STATUS: - case COL_FLAGGED: - case COL_SCORE: - case COL_ATTACHMENT: - case COL_DELETED: - case COL_UNREAD: - case COL_SENT: - case COL_RECEIVED: - case COL_SIZE: - case COL_FOLLOWUP_FLAG_STATUS: - case COL_FOLLOWUP_DUE_BY: - return (void *) value; - - case COL_FROM: - case COL_SUBJECT: - case COL_TO: - case COL_FOLLOWUP_FLAG: - case COL_LOCATION: - return g_strdup (value); - - default: - g_assert_not_reached (); - } - return NULL; -} - -static void -ml_free_value (ETreeModel *etm, int col, void *value, void *data) -{ - switch (col){ - case COL_MESSAGE_STATUS: - case COL_FLAGGED: - case COL_SCORE: - case COL_ATTACHMENT: - case COL_DELETED: - case COL_UNREAD: - case COL_SENT: - case COL_RECEIVED: - case COL_SIZE: - case COL_FOLLOWUP_FLAG_STATUS: - case COL_FOLLOWUP_DUE_BY: - break; - - case COL_FROM: - case COL_SUBJECT: - case COL_TO: - case COL_FOLLOWUP_FLAG: - case COL_LOCATION: - g_free (value); - break; - default: - g_assert_not_reached (); - } -} - -static void * -ml_initialize_value (ETreeModel *etm, int col, void *data) -{ - switch (col){ - case COL_MESSAGE_STATUS: - case COL_FLAGGED: - case COL_SCORE: - case COL_ATTACHMENT: - case COL_DELETED: - case COL_UNREAD: - case COL_SENT: - case COL_RECEIVED: - case COL_SIZE: - case COL_FOLLOWUP_FLAG_STATUS: - case COL_FOLLOWUP_DUE_BY: - return NULL; - - case COL_FROM: - case COL_SUBJECT: - case COL_TO: - case COL_FOLLOWUP_FLAG: - case COL_LOCATION: - return g_strdup (""); - default: - g_assert_not_reached (); - } - - return NULL; -} - -static gboolean -ml_value_is_empty (ETreeModel *etm, int col, const void *value, void *data) -{ - switch (col){ - case COL_MESSAGE_STATUS: - case COL_FLAGGED: - case COL_SCORE: - case COL_ATTACHMENT: - case COL_DELETED: - case COL_UNREAD: - case COL_SENT: - case COL_RECEIVED: - case COL_SIZE: - case COL_FOLLOWUP_FLAG_STATUS: - case COL_FOLLOWUP_DUE_BY: - return value == NULL; - - case COL_FROM: - case COL_SUBJECT: - case COL_TO: - case COL_FOLLOWUP_FLAG: - case COL_LOCATION: - return !(value && *(char *)value); - default: - g_assert_not_reached (); - return FALSE; - } -} - -static const char *status_map[] = { - N_("Unseen"), - N_("Seen"), - N_("Answered"), - N_("Multiple Unseen Messages"), - N_("Multiple Messages"), -}; - -static const char *score_map[] = { - N_("Lowest"), - N_("Lower"), - N_("Low"), - N_("Normal"), - N_("High"), - N_("Higher"), - N_("Highest"), -}; - - -static char * -ml_value_to_string (ETreeModel *etm, int col, const void *value, void *data) -{ - unsigned int i; - - switch (col){ - case COL_MESSAGE_STATUS: - i = GPOINTER_TO_UINT(value); - if (i > 4) - return g_strdup (""); - return g_strdup (_(status_map[i])); - - case COL_SCORE: - i = GPOINTER_TO_UINT(value) + 3; - if (i > 6) - i = 3; - return g_strdup (_(score_map[i])); - - case COL_ATTACHMENT: - case COL_FLAGGED: - case COL_DELETED: - case COL_UNREAD: - case COL_FOLLOWUP_FLAG_STATUS: - return g_strdup_printf ("%d", GPOINTER_TO_UINT(value)); - - case COL_SENT: - case COL_RECEIVED: - case COL_FOLLOWUP_DUE_BY: - return filter_date (GPOINTER_TO_INT (value)); - - case COL_SIZE: - return filter_size (GPOINTER_TO_INT (value)); - - case COL_FROM: - case COL_SUBJECT: - case COL_TO: - case COL_FOLLOWUP_FLAG: - case COL_LOCATION: - return g_strdup (value); - default: - g_assert_not_reached (); - return NULL; - } -} - -static GdkPixbuf * -ml_tree_icon_at (ETreeModel *etm, ETreePath path, void *model_data) -{ - /* we dont really need an icon ... */ - return NULL; -} - -/* return true if there are any unread messages in the subtree */ -static int -subtree_unread(MessageList *ml, ETreePath node) -{ - CamelMessageInfo *info; - ETreePath child; - - while (node) { - info = e_tree_memory_node_get_data((ETreeMemory *)ml->model, node); - g_assert(info); - - if (!(info->flags & CAMEL_MESSAGE_SEEN)) - return TRUE; - - if ((child = e_tree_model_node_get_first_child (E_TREE_MODEL (ml->model), node))) - if (subtree_unread(ml, child)) - return TRUE; - node = e_tree_model_node_get_next (ml->model, node); - } - return FALSE; -} - -static int -subtree_size(MessageList *ml, ETreePath node) -{ - CamelMessageInfo *info; - int size = 0; - ETreePath child; - - while (node) { - info = e_tree_memory_node_get_data((ETreeMemory *)ml->model, node); - g_assert(info); - - size += info->size; - if ((child = e_tree_model_node_get_first_child (E_TREE_MODEL (ml->model), node))) - size += subtree_size(ml, child); - - node = e_tree_model_node_get_next (ml->model, node); - } - return size; -} - -static time_t -subtree_earliest(MessageList *ml, ETreePath node, int sent) -{ - CamelMessageInfo *info; - time_t earliest = 0, date; - ETreePath *child; - - while (node) { - info = e_tree_memory_node_get_data((ETreeMemory *)ml->model, node); - g_assert(info); - - if (sent) - date = info->date_sent; - else - date = info->date_received; - - if (earliest == 0 || date < earliest) - earliest = date; - - if ((child = e_tree_model_node_get_first_child (ml->model, node))) { - date = subtree_earliest(ml, child, sent); - if (earliest == 0 || (date != 0 && date < earliest)) - earliest = date; - } - - node = e_tree_model_node_get_next (ml->model, node); - } - - return earliest; -} - -static void * -ml_tree_value_at (ETreeModel *etm, ETreePath path, int col, void *model_data) -{ - MessageList *message_list = model_data; - CamelMessageInfo *msg_info; - const char *str; - - if (e_tree_model_node_is_root (etm, path)) - return NULL; - - /* retrieve the message information array */ - msg_info = e_tree_memory_node_get_data (E_TREE_MEMORY(etm), path); - g_assert (msg_info != NULL); - - switch (col){ - case COL_MESSAGE_STATUS: - if (msg_info->flags & CAMEL_MESSAGE_ANSWERED) - return GINT_TO_POINTER (2); - else if (msg_info->flags & CAMEL_MESSAGE_SEEN) - return GINT_TO_POINTER (1); - else - return GINT_TO_POINTER (0); - break; - case COL_FLAGGED: - return GINT_TO_POINTER ((msg_info->flags & CAMEL_MESSAGE_FLAGGED) != 0); - case COL_SCORE: { - const char *tag; - int score = 0; - - tag = camel_tag_get ((CamelTag **) &msg_info->user_tags, "score"); - if (tag) - score = atoi (tag); - - return GINT_TO_POINTER (score); - } - case COL_FOLLOWUP_FLAG_STATUS: { - const char *tag, *cmp; - - /* FIXME: this all should be methods off of message-tag-followup class, - FIXME: the tag names should be namespaced :( */ - tag = camel_tag_get ((CamelTag **) &msg_info->user_tags, "follow-up"); - cmp = camel_tag_get ((CamelTag **) &msg_info->user_tags, "completed-on"); - if (tag && tag[0]) { - if (cmp && cmp[0]) - return GINT_TO_POINTER(2); - else - return GINT_TO_POINTER(1); - } else - return GINT_TO_POINTER(0); - } - case COL_FOLLOWUP_DUE_BY: { - const char *tag; - time_t due_by; - - tag = camel_tag_get ((CamelTag **) &msg_info->user_tags, "due-by"); - if (tag && *tag) { - due_by = camel_header_decode_date (tag, NULL); - return GINT_TO_POINTER (due_by); - } else { - return GINT_TO_POINTER (0); - } - } - case COL_FOLLOWUP_FLAG: - str = camel_tag_get ((CamelTag **) &msg_info->user_tags, "follow-up"); - return (void *)(str ? str : ""); - case COL_ATTACHMENT: - return GINT_TO_POINTER ((msg_info->flags & CAMEL_MESSAGE_ATTACHMENTS) != 0); - case COL_FROM: - str = camel_message_info_from (msg_info); - return (void *)(str ? str : ""); - case COL_FROM_NORM: - return (void *) get_normalised_string (message_list, msg_info, col); - case COL_SUBJECT: - str = camel_message_info_subject (msg_info); - return (void *)(str ? str : ""); - case COL_SUBJECT_NORM: - return (void *) get_normalised_string (message_list, msg_info, col); - case COL_SENT: - return GINT_TO_POINTER (msg_info->date_sent); - case COL_RECEIVED: - return GINT_TO_POINTER (msg_info->date_received); - case COL_TO: - str = camel_message_info_to (msg_info); - return (void *)(str ? str : ""); - case COL_TO_NORM: - return (void *) get_normalised_string (message_list, msg_info, col); - case COL_SIZE: - return GINT_TO_POINTER (msg_info->size); - case COL_DELETED: - return GINT_TO_POINTER ((msg_info->flags & CAMEL_MESSAGE_DELETED) != 0); - case COL_UNREAD: { - ETreePath child; - - child = e_tree_model_node_get_first_child(etm, path); - if (child && !e_tree_node_is_expanded(message_list->tree, path) - && (msg_info->flags & CAMEL_MESSAGE_SEEN)) { - return GINT_TO_POINTER (subtree_unread (message_list, child)); - } - - return GINT_TO_POINTER (!(msg_info->flags & CAMEL_MESSAGE_SEEN)); - } - case COL_COLOUR: { - const char *colour, *due_by, *completed, *label; - - /* Priority: colour tag; label tag; important flag; due-by tag */ - - colour = camel_tag_get ((CamelTag **) &msg_info->user_tags, "colour"); - due_by = camel_tag_get ((CamelTag **) &msg_info->user_tags, "due-by"); - completed = camel_tag_get ((CamelTag **) &msg_info->user_tags, "completed-on"); - label = camel_tag_get ((CamelTag **) &msg_info->user_tags, "label"); - if (colour == NULL) { - find_colour: - if (label != NULL) { - colour = mail_config_get_label_color_by_name (label); - if (colour == NULL) { - /* dead label? */ - label = NULL; - goto find_colour; - } - } else if (msg_info->flags & CAMEL_MESSAGE_FLAGGED) { - /* FIXME: extract from the xpm somehow. */ - colour = "#A7453E"; - } else if ((due_by && *due_by) && !(completed && *completed)) { - time_t now = time (NULL); - time_t target_date; - - target_date = camel_header_decode_date (due_by, NULL); - if (now >= target_date) { - /* FIXME: extract from the xpm somehow. */ - colour = "#A7453E"; - } - } - } - return (void *) colour; - } - case COL_LOCATION: { - CamelFolder *folder; - char *name; - - if (CAMEL_IS_VEE_FOLDER(message_list->folder)) { - folder = camel_vee_folder_get_location((CamelVeeFolder *)message_list->folder, (CamelVeeMessageInfo *)msg_info, NULL); - } else { - folder = message_list->folder; - } - - camel_object_get(folder, NULL, CAMEL_OBJECT_DESCRIPTION, &name, 0); - return name; - } - default: - g_assert_not_reached (); - return NULL; - } -} - -static void -ml_tree_set_value_at (ETreeModel *etm, ETreePath path, int col, - const void *val, void *model_data) -{ - g_assert_not_reached (); -} - -static gboolean -ml_tree_is_cell_editable (ETreeModel *etm, ETreePath path, int col, void *model_data) -{ - return FALSE; -} - -static void -message_list_init_images (void) -{ - int i; - - /* - * Only load once, and share - */ - if (states_pixmaps [0].pixbuf) - return; - - for (i = 0; states_pixmaps [i].image_base; i++){ - states_pixmaps [i].pixbuf = gdk_pixbuf_new_from_xpm_data ( - (const char **) states_pixmaps [i].image_base); - } -} - -static char * -filter_date (time_t date) -{ - time_t nowdate = time(NULL); - time_t yesdate; - struct tm then, now, yesterday; - char buf[26]; - gboolean done = FALSE; - - if (date == 0) - return g_strdup (_("?")); - - localtime_r (&date, &then); - localtime_r (&nowdate, &now); - if (then.tm_mday == now.tm_mday && - then.tm_mon == now.tm_mon && - then.tm_year == now.tm_year) { - e_utf8_strftime_fix_am_pm (buf, 26, _("Today %l:%M %p"), &then); - done = TRUE; - } - if (!done) { - yesdate = nowdate - 60 * 60 * 24; - localtime_r (&yesdate, &yesterday); - if (then.tm_mday == yesterday.tm_mday && - then.tm_mon == yesterday.tm_mon && - then.tm_year == yesterday.tm_year) { - e_utf8_strftime_fix_am_pm (buf, 26, _("Yesterday %l:%M %p"), &then); - done = TRUE; - } - } - if (!done) { - int i; - for (i = 2; i < 7; i++) { - yesdate = nowdate - 60 * 60 * 24 * i; - localtime_r (&yesdate, &yesterday); - if (then.tm_mday == yesterday.tm_mday && - then.tm_mon == yesterday.tm_mon && - then.tm_year == yesterday.tm_year) { - e_utf8_strftime_fix_am_pm (buf, 26, _("%a %l:%M %p"), &then); - done = TRUE; - break; - } - } - } - if (!done) { - if (then.tm_year == now.tm_year) { - e_utf8_strftime_fix_am_pm (buf, 26, _("%b %d %l:%M %p"), &then); - } else { - e_utf8_strftime_fix_am_pm (buf, 26, _("%b %d %Y"), &then); - } - } -#if 0 -#ifdef CTIME_R_THREE_ARGS - ctime_r (&date, buf, 26); -#else - ctime_r (&date, buf); -#endif -#endif - - return g_strdup (buf); -} - -static ETableExtras * -message_list_create_extras (void) -{ - int i; - GdkPixbuf *images [7]; - ETableExtras *extras; - ECell *cell; - - extras = e_table_extras_new (); - e_table_extras_add_pixbuf (extras, "status", states_pixmaps [0].pixbuf); - e_table_extras_add_pixbuf (extras, "score", states_pixmaps [13].pixbuf); - e_table_extras_add_pixbuf (extras, "attachment", states_pixmaps [6].pixbuf); - e_table_extras_add_pixbuf (extras, "flagged", states_pixmaps [7].pixbuf); - e_table_extras_add_pixbuf (extras, "followup", states_pixmaps [15].pixbuf); - - e_table_extras_add_compare (extras, "address_compare", address_compare); - - for (i = 0; i < 5; i++) - images [i] = states_pixmaps [i].pixbuf; - - e_table_extras_add_cell (extras, "render_message_status", e_cell_toggle_new (0, 5, images)); - - for (i = 0; i < 2; i++) - images [i] = states_pixmaps [i + 5].pixbuf; - - e_table_extras_add_cell (extras, "render_attachment", e_cell_toggle_new (0, 2, images)); - - images [1] = states_pixmaps [7].pixbuf; - e_table_extras_add_cell (extras, "render_flagged", e_cell_toggle_new (0, 2, images)); - - images[1] = states_pixmaps [15].pixbuf; - images[2] = states_pixmaps [16].pixbuf; - e_table_extras_add_cell (extras, "render_flag_status", e_cell_toggle_new (0, 3, images)); - - for (i = 0; i < 7; i++) - images[i] = states_pixmaps [i + 7].pixbuf; - - e_table_extras_add_cell (extras, "render_score", e_cell_toggle_new (0, 7, images)); - - /* date cell */ - cell = e_cell_date_new (NULL, GTK_JUSTIFY_LEFT); - g_object_set (G_OBJECT (cell), - "bold_column", COL_UNREAD, - "color_column", COL_COLOUR, - NULL); - e_table_extras_add_cell (extras, "render_date", cell); - - /* text cell */ - cell = e_cell_text_new (NULL, GTK_JUSTIFY_LEFT); - g_object_set (G_OBJECT (cell), - "bold_column", COL_UNREAD, - "color_column", COL_COLOUR, - NULL); - e_table_extras_add_cell (extras, "render_text", cell); - - e_table_extras_add_cell (extras, "render_tree", - e_cell_tree_new (NULL, NULL, /* let the tree renderer default the pixmaps */ - TRUE, cell)); - - /* size cell */ - cell = e_cell_size_new (NULL, GTK_JUSTIFY_RIGHT); - g_object_set (G_OBJECT (cell), - "bold_column", COL_UNREAD, - "color_column", COL_COLOUR, - NULL); - e_table_extras_add_cell (extras, "render_size", cell); - - return extras; -} - -static void -save_tree_state(MessageList *ml) -{ - char *filename; - - if (ml->folder == NULL || ml->tree == NULL) - return; - - filename = mail_config_folder_to_cachename(ml->folder, "et-expanded-"); - e_tree_save_expanded_state(ml->tree, filename); - g_free(filename); -} - -static void -load_tree_state (MessageList *ml) -{ - char *filename; - - if (ml->folder == NULL || ml->tree == NULL) - return; - - filename = mail_config_folder_to_cachename (ml->folder, "et-expanded-"); - e_tree_load_expanded_state (ml->tree, filename); - g_free (filename); -} - - -void -message_list_save_state (MessageList *ml) -{ - save_tree_state (ml); - hide_save_state (ml); -} - -static void -message_list_setup_etree (MessageList *message_list, gboolean outgoing) -{ - /* build the spec based on the folder, and possibly from a saved file */ - /* otherwise, leave default */ - if (message_list->folder) { - char *path; - char *name; - struct stat st; - - g_object_set (message_list->tree, - "uniform_row_height", TRUE, - NULL); - - name = camel_service_get_name (CAMEL_SERVICE (message_list->folder->parent_store), TRUE); - d(printf ("folder name is '%s'\n", name)); - - path = mail_config_folder_to_cachename (message_list->folder, "et-expanded-"); - if (path && stat (path, &st) == 0 && st.st_size > 0 && S_ISREG (st.st_mode)) { - /* build based on saved file */ - e_tree_load_expanded_state (message_list->tree, path); - } - g_free (path); - - g_free (name); - } -} - -static void -ml_selection_get(GtkWidget *widget, GtkSelectionData *data, guint info, guint time_stamp, MessageList *ml) -{ - GPtrArray *uids; - - if (info & 1) - uids = ml->priv->primary_uids; - else - uids = ml->priv->clipboard_uids; - - if (uids == NULL) - return; - - if (info & 2) { - /* text/plain */ - printf("setting text/plain selection for uids\n"); - em_utils_selection_set_mailbox(data, ml->folder, uids); - } else { - /* x-uid-list */ - printf("setting x-uid-list selection for uids\n"); - em_utils_selection_set_uidlist(data, ml->folder_uri, uids); - } -} - -static void -ml_selection_clear_event(GtkWidget *widget, GdkEventSelection *event, MessageList *ml) -{ - struct _MessageListPrivate *p = ml->priv; - - if (event->selection == GDK_SELECTION_PRIMARY) { - if (p->primary_uids) { - message_list_free_uids(ml, p->primary_uids); - p->primary_uids = NULL; - } - } else if (event->selection == GDK_SELECTION_CLIPBOARD) { - if (p->clipboard_uids) { - message_list_free_uids(ml, p->clipboard_uids); - p->clipboard_uids = NULL; - } - } -} - -static void -ml_selection_received_uidlist(MessageList *ml, GtkSelectionData *data) -{ - CamelFolder *folder; - GPtrArray *uids; - char *uri; - - if (em_utils_selection_get_uidlist(data, &uri, &uids) == 0) - return; - - folder = mail_tool_uri_to_folder(uri, 0, NULL); - if (folder) { - mail_transfer_messages(folder, uids, FALSE, ml->folder_uri, 0, NULL, NULL); - camel_object_unref(folder); - } else { - /* FIXME: error box? */ - g_warning("could not open paste source uri '%s'", uri); - em_utils_uids_free(uids); - } - - g_free(uri); -} - -static void -ml_selection_received(GtkWidget *widget, GtkSelectionData *data, guint time, MessageList *ml) -{ - if (data->target != gdk_atom_intern ("x-uid-list", FALSE)) { - printf("Unknown selection received by message-list\n"); - - return; - } - - ml_selection_received_uidlist(ml, data); -} - -static GtkTargetEntry ml_drag_types[] = { - { "x-uid-list", 0, 0 }, - { "message/rfc822", 0, 1 }, - /* not included in dest types */ - { "text/uri-list", 0, 2 }, -}; - -static void -ml_tree_drag_data_get (ETree *tree, int row, ETreePath path, int col, - GdkDragContext *context, GtkSelectionData *data, - guint info, guint time, MessageList *ml) -{ - GPtrArray *uids; - - uids = message_list_get_selected(ml); - - if (uids->len > 0) { - switch (info) { - case 0 /* DND_TARGET_TYPE_X_UID_LIST */: - em_utils_selection_set_uidlist(data, ml->folder_uri, uids); - break; - case 1 /* DND_TARGET_TYPE_MESSAGE_RFC822 */: - em_utils_selection_set_mailbox(data, ml->folder, uids); - break; - case 2 /* DND_TARGET_TYPE_TEXT_URI_LIST */: - em_utils_selection_set_urilist(data, ml->folder, uids); - break; - } - } - - message_list_free_uids(ml, uids); -} - -static void -ml_tree_drag_data_received (ETree *tree, int row, ETreePath path, int col, - GdkDragContext *context, gint x, gint y, - GtkSelectionData *data, guint info, - guint time, MessageList *ml) -{ - /* this means we are receiving no data */ - if (data->data == NULL || data->length == -1) - return; - - /* Note: we don't receive text/uri-list, since we have no - guarantee on what the content would be */ - - switch (info) { - case 1 /* DND_TARGET_TYPE_MESSAGE_RFC822 */: - em_utils_selection_get_mailbox(data, ml->folder); - break; - case 0 /* DND_TARGET_TYPE_X_UID_LIST */: - ml_selection_received_uidlist(ml, data); - break; - } - - gtk_drag_finish(context, TRUE, TRUE, time); -} - -/* - * GtkObject::init - */ -static void -message_list_init (GtkObject *object) -{ - MessageList *message_list = MESSAGE_LIST (object); - struct _MessageListPrivate *p; - GdkAtom matom; - - gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (message_list), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS); - - message_list->normalised_hash = g_hash_table_new (g_str_hash, g_str_equal); - - message_list->hidden = NULL; - message_list->hidden_pool = NULL; - message_list->hide_before = ML_HIDE_NONE_START; - message_list->hide_after = ML_HIDE_NONE_END; - - message_list->search = NULL; - - message_list->hide_lock = g_mutex_new(); - - message_list->uid_nodemap = g_hash_table_new (g_str_hash, g_str_equal); - message_list->async_event = mail_async_event_new(); - - /* TODO: Should this only get the selection if we're realised? */ - p = message_list->priv = g_malloc0(sizeof(*message_list->priv)); - p->invisible = gtk_invisible_new(); - g_object_ref(p->invisible); - gtk_object_sink((GtkObject *)p->invisible); - - matom = gdk_atom_intern ("x-uid-list", FALSE); - gtk_selection_add_target(p->invisible, GDK_SELECTION_CLIPBOARD, matom, 0); - gtk_selection_add_target(p->invisible, GDK_SELECTION_PRIMARY, matom, 1); - gtk_selection_add_target(p->invisible, GDK_SELECTION_CLIPBOARD, GDK_SELECTION_TYPE_STRING, 2); - gtk_selection_add_target(p->invisible, GDK_SELECTION_PRIMARY, GDK_SELECTION_TYPE_STRING, 3); - - g_signal_connect(p->invisible, "selection_get", G_CALLBACK(ml_selection_get), message_list); - g_signal_connect(p->invisible, "selection_clear_event", G_CALLBACK(ml_selection_clear_event), message_list); - g_signal_connect(p->invisible, "selection_received", G_CALLBACK(ml_selection_received), message_list); -} - -static void -normalised_free (gpointer key, gpointer value, gpointer user_data) -{ - e_poolv_destroy (value); -} - -static void -message_list_destroy(GtkObject *object) -{ - MessageList *message_list = MESSAGE_LIST (object); - struct _MessageListPrivate *p = message_list->priv; - - if (message_list->async_event) { - mail_async_event_destroy(message_list->async_event); - message_list->async_event = NULL; - } - - if (message_list->folder) { - /* need to do this before removing folder, folderinfo's might not exist after */ - if (message_list->uid_nodemap) { - g_hash_table_foreach(message_list->uid_nodemap, (GHFunc)clear_info, message_list); - g_hash_table_destroy (message_list->uid_nodemap); - } - - save_tree_state(message_list); - hide_save_state(message_list); - camel_object_unhook_event(message_list->folder, "folder_changed", folder_changed, message_list); - camel_object_unhook_event(message_list->folder, "message_changed", message_changed, message_list); - camel_object_unref (message_list->folder); - message_list->folder = NULL; - } - - if (p->invisible) { - g_object_unref(p->invisible); - p->invisible = NULL; - } - - if (message_list->extras) { - g_object_unref (message_list->extras); - message_list->extras = NULL; - } - - if (message_list->model) { - g_object_unref (message_list->model); - message_list->model = NULL; - } - - if (message_list->idle_id != 0) { - g_source_remove (message_list->idle_id); - message_list->idle_id = 0; - } - - if (message_list->seen_id) { - g_source_remove (message_list->seen_id); - message_list->seen_id = 0; - } - - message_list->destroyed = TRUE; - - GTK_OBJECT_CLASS (message_list_parent_class)->destroy(object); -} - -static void -message_list_finalise (GObject *object) -{ - MessageList *message_list = MESSAGE_LIST (object); - struct _MessageListPrivate *p = message_list->priv; - - g_hash_table_foreach (message_list->normalised_hash, normalised_free, NULL); - g_hash_table_destroy (message_list->normalised_hash); - - if (message_list->thread_tree) - camel_folder_thread_messages_unref(message_list->thread_tree); - - if (message_list->hidden) { - g_hash_table_destroy(message_list->hidden); - e_mempool_destroy(message_list->hidden_pool); - message_list->hidden = NULL; - message_list->hidden_pool = NULL; - } - - g_free(message_list->cursor_uid); - - g_mutex_free(message_list->hide_lock); - - g_free(message_list->folder_uri); - message_list->folder_uri = NULL; - - if (p->primary_uids) - message_list_free_uids(message_list, p->primary_uids); - if (p->clipboard_uids) - message_list_free_uids(message_list, p->clipboard_uids); - - g_free(p); - - G_OBJECT_CLASS (message_list_parent_class)->finalize (object); -} - -/* - * GtkObjectClass::init - */ -static void -message_list_class_init (GObjectClass *object_class) -{ - message_list_parent_class = g_type_class_ref(PARENT_TYPE); - - object_class->finalize = message_list_finalise; - ((GtkObjectClass *)object_class)->destroy = message_list_destroy; - - message_list_signals[MESSAGE_SELECTED] = - g_signal_new ("message_selected", - MESSAGE_LIST_TYPE, - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (MessageListClass, message_selected), - NULL, - NULL, - g_cclosure_marshal_VOID__STRING, - G_TYPE_NONE, 1, G_TYPE_STRING); - - message_list_signals[MESSAGE_LIST_BUILT] = - g_signal_new ("message_list_built", - MESSAGE_LIST_TYPE, - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (MessageListClass, message_list_built), - NULL, - NULL, - g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, 0); - - message_list_init_images (); -} - -static void -message_list_construct (MessageList *message_list) -{ - gboolean construct_failed; - message_list->model = - e_tree_memory_callbacks_new (ml_tree_icon_at, - - ml_column_count, - - ml_has_save_id, - ml_get_save_id, - - ml_has_get_node_by_id, - ml_get_node_by_id, - - ml_tree_value_at, - ml_tree_set_value_at, - ml_tree_is_cell_editable, - - ml_duplicate_value, - ml_free_value, - ml_initialize_value, - ml_value_is_empty, - ml_value_to_string, - - message_list); - - e_tree_memory_set_expanded_default(E_TREE_MEMORY(message_list->model), TRUE); - - /* - * The etree - */ - message_list->extras = message_list_create_extras (); - construct_failed = (e_tree_scrolled_construct_from_spec_file (E_TREE_SCROLLED (message_list), - message_list->model, - message_list->extras, - EVOLUTION_ETSPECDIR "/message-list.etspec", - NULL) - == NULL); - - message_list->tree = e_tree_scrolled_get_tree(E_TREE_SCROLLED (message_list)); - if (!construct_failed) - e_tree_root_node_set_visible (message_list->tree, FALSE); - - g_signal_connect((message_list->tree), "cursor_activated", - G_CALLBACK (on_cursor_activated_cmd), - message_list); - - g_signal_connect((message_list->tree), "click", - G_CALLBACK (on_click), message_list); - - g_signal_connect((message_list->tree), "selection_change", - G_CALLBACK (on_selection_changed_cmd), message_list); - - - e_tree_drag_source_set(message_list->tree, GDK_BUTTON1_MASK, - ml_drag_types, sizeof(ml_drag_types)/sizeof(ml_drag_types[0]), - GDK_ACTION_MOVE|GDK_ACTION_COPY); - - g_signal_connect(message_list->tree, "tree_drag_data_get", - G_CALLBACK(ml_tree_drag_data_get), message_list); - - /* note, we only include 2 types, we don't include text/uri-list as a receiver */ - e_tree_drag_dest_set(message_list->tree, GTK_DEST_DEFAULT_ALL, - ml_drag_types, 2, - GDK_ACTION_MOVE|GDK_ACTION_COPY); - - g_signal_connect(message_list->tree, "tree_drag_data_received", - G_CALLBACK(ml_tree_drag_data_received), message_list); -} - -/** - * message_list_new: - * - * Creates a new message-list widget. - * - * Returns a new message-list widget. - **/ -GtkWidget * -message_list_new (void) -{ - MessageList *message_list; - - message_list = MESSAGE_LIST (g_object_new(message_list_get_type (), - "hadjustment", NULL, - "vadjustment", NULL, - NULL)); - message_list_construct (message_list); - - return GTK_WIDGET (message_list); -} - -static void -clear_info(char *key, ETreePath *node, MessageList *ml) -{ - CamelMessageInfo *info; - - info = e_tree_memory_node_get_data((ETreeMemory *)ml->model, node); - camel_folder_free_message_info(ml->folder, info); -} - -static void -clear_tree (MessageList *ml) -{ - ETreeModel *etm = ml->model; - -#ifdef TIMEIT - struct timeval start, end; - unsigned long diff; - - printf("Clearing tree\n"); - gettimeofday(&start, NULL); -#endif - - /* we also reset the uid_rowmap since it is no longer useful/valid anyway */ - if (ml->folder) - g_hash_table_foreach (ml->uid_nodemap, (GHFunc)clear_info, ml); - g_hash_table_destroy (ml->uid_nodemap); - ml->uid_nodemap = g_hash_table_new (g_str_hash, g_str_equal); - - if (ml->tree_root) { - /* we should be frozen already */ - e_tree_memory_node_remove (E_TREE_MEMORY(etm), ml->tree_root); - } - - ml->tree_root = e_tree_memory_node_insert (E_TREE_MEMORY(etm), NULL, 0, NULL); - -#ifdef TIMEIT - gettimeofday(&end, NULL); - diff = end.tv_sec * 1000 + end.tv_usec/1000; - diff -= start.tv_sec * 1000 + start.tv_usec/1000; - printf("Clearing tree took %ld.%03ld seconds\n", diff / 1000, diff % 1000); -#endif - -} - -/* we try and find something that isn't deleted in our tree - there is actually no assurance that we'll find somethign that will - still be there next time, but its probably going to work most of the time */ -static char * -find_next_undeleted (MessageList *ml) -{ - ETreePath node; - int last; - int vrow; - ETree *et = ml->tree; - CamelMessageInfo *info; - - node = g_hash_table_lookup (ml->uid_nodemap, ml->cursor_uid); - if (node == NULL) - return NULL; - - info = get_message_info (ml, node); - if (info && (info->flags & CAMEL_MESSAGE_DELETED) == 0) { - return NULL; - } - - last = e_tree_row_count (ml->tree); - - /* model_to_view_row etc simply dont work for sorted views. Sigh. */ - vrow = e_tree_row_of_node (et, node); - - /* We already checked this node. */ - vrow ++; - - while (vrow < last) { - CamelMessageInfo *info; - - node = e_tree_node_at_row (et, vrow); - info = get_message_info (ml, node); - if (info && (info->flags & CAMEL_MESSAGE_DELETED) == 0) { - return g_strdup (camel_message_info_uid (info)); - } - vrow ++; - } - - return NULL; -} - -/* only call if we have a tree model */ -/* builds the tree structure */ -static void build_subtree (MessageList *ml, ETreePath parent, CamelFolderThreadNode *c, int *row); - -static void build_subtree_diff (MessageList *ml, ETreePath parent, ETreePath path, CamelFolderThreadNode *c, int *row); - -static void -build_tree (MessageList *ml, CamelFolderThread *thread, CamelFolderChangeInfo *changes) -{ - int row = 0; - ETreeModel *etm = ml->model; - ETreePath *top; - char *saveuid = NULL; - -#ifdef TIMEIT - struct timeval start, end; - unsigned long diff; - - printf("Building tree\n"); - gettimeofday(&start, NULL); -#endif - -#ifdef TIMEIT - gettimeofday(&end, NULL); - diff = end.tv_sec * 1000 + end.tv_usec/1000; - diff -= start.tv_sec * 1000 + start.tv_usec/1000; - printf("Loading tree state took %ld.%03ld seconds\n", diff / 1000, diff % 1000); -#endif - - if (ml->tree_root == NULL) { - ml->tree_root = e_tree_memory_node_insert(E_TREE_MEMORY(etm), NULL, 0, NULL); - } - - if (ml->cursor_uid) { - if (ml->hidedeleted) { - saveuid = find_next_undeleted(ml); - } - } - -#define BROKEN_ETREE /* avoid some broken code in etree(?) by not using the incremental update */ - - top = e_tree_model_node_get_first_child(etm, ml->tree_root); -#ifndef BROKEN_ETREE - if (top == NULL || changes == NULL) { -#endif - e_tree_memory_freeze(E_TREE_MEMORY(etm)); - clear_tree (ml); - - build_subtree(ml, ml->tree_root, thread->tree, &row); - - e_tree_memory_thaw(E_TREE_MEMORY(etm)); -#ifndef BROKEN_ETREE - } else { - static int tree_equal(ETreeModel *etm, ETreePath ap, CamelFolderThreadNode *bp); - - build_subtree_diff(ml, ml->tree_root, top, thread->tree, &row); - top = e_tree_model_node_get_first_child(etm, ml->tree_root); - tree_equal(ml->model, top, thread->tree); - } -#endif - - if (saveuid) { - ETreePath *node = g_hash_table_lookup (ml->uid_nodemap, saveuid); - if (node == NULL) { - g_free (ml->cursor_uid); - ml->cursor_uid = NULL; - g_signal_emit (ml, message_list_signals[MESSAGE_SELECTED], 0, NULL); - } else { - e_tree_set_cursor (ml->tree, node); - } - g_free (saveuid); - } else if (ml->cursor_uid && !g_hash_table_lookup (ml->uid_nodemap, ml->cursor_uid)) { - g_free (ml->cursor_uid); - ml->cursor_uid = NULL; - g_signal_emit (ml, message_list_signals[MESSAGE_SELECTED], 0, NULL); - } - -#ifdef TIMEIT - gettimeofday(&end, NULL); - diff = end.tv_sec * 1000 + end.tv_usec/1000; - diff -= start.tv_sec * 1000 + start.tv_usec/1000; - printf("Building tree took %ld.%03ld seconds\n", diff / 1000, diff % 1000); -#endif -} - -/* this is about 20% faster than build_subtree_diff, - entirely because e_tree_model_node_insert(xx, -1 xx) - is faster than inserting to the right row :( */ -/* Otherwise, this code would probably go as it does the same thing essentially */ -static void -build_subtree (MessageList *ml, ETreePath parent, CamelFolderThreadNode *c, int *row) -{ - ETreeModel *tree = ml->model; - ETreePath node; - - while (c) { - /* phantom nodes no longer allowed */ - g_assert(c->message); - - node = e_tree_memory_node_insert(E_TREE_MEMORY(tree), parent, -1, (void *)c->message); - g_hash_table_insert(ml->uid_nodemap, (void *)camel_message_info_uid(c->message), node); - camel_folder_ref_message_info(ml->folder, (CamelMessageInfo *)c->message); - - if (c->child) { - build_subtree(ml, node, c->child, row); - } - c = c->next; - } -} - -/* compares a thread tree node with the etable tree node to see if they point to - the same object */ -static int -node_equal(ETreeModel *etm, ETreePath ap, CamelFolderThreadNode *bp) -{ - CamelMessageInfo *info; - - info = e_tree_memory_node_get_data(E_TREE_MEMORY(etm), ap); - - if (bp->message && strcmp(camel_message_info_uid(info), camel_message_info_uid(bp->message))==0) - return 1; - - return 0; -} - -#ifndef BROKEN_ETREE -/* debug function - compare the two trees to see if they are the same */ -static int -tree_equal(ETreeModel *etm, ETreePath ap, CamelFolderThreadNode *bp) -{ - CamelMessageInfo *info; - - while (ap && bp) { - if (!node_equal(etm, ap, bp)) { - g_warning("Nodes in tree differ"); - info = e_tree_memory_node_get_data(E_TREE_MEMORY(etm), ap); - printf("table uid = %s\n", camel_message_info_uid(info)); - printf("camel uid = %s\n", camel_message_info_uid(bp->message)); - return FALSE; - } else { - if (!tree_equal(etm, e_tree_model_node_get_first_child(etm, ap), bp->child)) - return FALSE; - } - bp = bp->next; - ap = e_tree_model_node_get_next(etm, ap); - } - - if (ap || bp) { - g_warning("Tree differs, out of nodes in one branch"); - if (ap) { - info = e_tree_memory_node_get_data(E_TREE_MEMORY(etm), ap); - if (info) - printf("table uid = %s\n", camel_message_info_uid(info)); - else - printf("info is empty?\n"); - } - if (bp) { - printf("camel uid = %s\n", camel_message_info_uid(bp->message)); - return FALSE; - } - return FALSE; - } - return TRUE; -} -#endif - -/* adds a single node, retains save state, and handles adding children if required */ -static void -add_node_diff(MessageList *ml, ETreePath parent, ETreePath path, CamelFolderThreadNode *c, int *row, int myrow) -{ - ETreeModel *etm = ml->model; - ETreePath node; - - g_assert(c->message); - - /* we just update the hashtable key, umm, does this leak the info on the message node? */ - g_hash_table_remove(ml->uid_nodemap, camel_message_info_uid(c->message)); - node = e_tree_memory_node_insert(E_TREE_MEMORY(etm), parent, myrow, (void *)c->message); - g_hash_table_insert(ml->uid_nodemap, (void *)camel_message_info_uid(c->message), node); - camel_folder_ref_message_info(ml->folder, (CamelMessageInfo *)c->message); - (*row)++; - - if (c->child) { - build_subtree_diff(ml, node, NULL, c->child, row); - } -} - -/* removes node, children recursively and all associated data */ -static void -remove_node_diff(MessageList *ml, ETreePath node, int depth) -{ - ETreeModel *etm = ml->model; - ETreePath cp, cn; - CamelMessageInfo *info; - - t(printf("Removing node: %s\n", (char *)e_tree_memory_node_get_data(etm, node))); - - /* we depth-first remove all node data's ... */ - cp = e_tree_model_node_get_first_child(etm, node); - while (cp) { - cn = e_tree_model_node_get_next(etm, cp); - remove_node_diff(ml, cp, depth+1); - cp = cn; - } - - /* and the rowid entry - if and only if it is referencing this node */ - info = e_tree_memory_node_get_data(E_TREE_MEMORY (etm), node); - - /* and only at the toplevel, remove the node (etree should optimise this remove somewhat) */ - if (depth == 0) - e_tree_memory_node_remove(E_TREE_MEMORY(etm), node); - - g_assert(info); - g_hash_table_remove(ml->uid_nodemap, camel_message_info_uid(info)); - camel_folder_free_message_info(ml->folder, info); -} - -/* applies a new tree structure to an existing tree, but only by changing things - that have changed */ -static void -build_subtree_diff(MessageList *ml, ETreePath parent, ETreePath path, CamelFolderThreadNode *c, int *row) -{ - ETreeModel *etm = ml->model; - ETreePath ap, *ai, *at, *tmp; - CamelFolderThreadNode *bp, *bi, *bt; - int i, j, myrow = 0; - - ap = path; - bp = c; - - while (ap || bp) { - t(printf("Processing row: %d (subtree row %d)\n", *row, myrow)); - if (ap == NULL) { - t(printf("out of old nodes\n")); - /* ran out of old nodes - remaining nodes are added */ - add_node_diff(ml, parent, ap, bp, row, myrow); - myrow++; - bp = bp->next; - } else if (bp == NULL) { - t(printf("out of new nodes\n")); - /* ran out of new nodes - remaining nodes are removed */ - tmp = e_tree_model_node_get_next(etm, ap); - remove_node_diff(ml, ap, 0); - ap = tmp; - } else if (node_equal(etm, ap, bp)) { - /*t(printf("nodes match, verify\n"));*/ - /* matching nodes, verify details/children */ -#if 0 - if (bp->message) { - char *olduid; - int oldrow; - /* if this is a message row, check/update the row id map */ - if (g_hash_table_lookup_extended(ml->uid_rowmap, camel_message_info_uid(bp->message), (void *)&olduid, (void *)&oldrow)) { - if (oldrow != (*row)) { - g_hash_table_insert(ml->uid_rowmap, olduid, (void *)(*row)); - } - } else { - g_warning("Cannot find uid %s in table?", camel_message_info_uid(bp->message)); - /*g_assert_not_reached();*/ - } - } -#endif - *row = (*row)+1; - myrow++; - tmp = e_tree_model_node_get_first_child(etm, ap); - /* make child lists match (if either has one) */ - if (bp->child || tmp) { - build_subtree_diff(ml, ap, tmp, bp->child, row); - } - ap = e_tree_model_node_get_next(etm, ap); - bp = bp->next; - } else { - t(printf("searching for matches\n")); - /* we have to scan each side for a match */ - bi = bp->next; - ai = e_tree_model_node_get_next(etm, ap); - for (i=1;bi!=NULL;i++,bi=bi->next) { - if (node_equal(etm, ap, bi)) - break; - } - for (j=1;ai!=NULL;j++,ai=e_tree_model_node_get_next(etm, ai)) { - if (node_equal(etm, ai, bp)) - break; - } - if (i<j) { - /* smaller run of new nodes - must be nodes to add */ - if (bi) { - bt = bp; - while (bt != bi) { - t(printf("adding new node 0\n")); - add_node_diff(ml, parent, NULL, bt, row, myrow); - myrow++; - bt = bt->next; - } - bp = bi; - } else { - t(printf("adding new node 1\n")); - /* no match in new nodes, add one, try next */ - add_node_diff(ml, parent, NULL, bp, row, myrow); - myrow++; - bp = bp->next; - } - } else { - /* bigger run of old nodes - must be nodes to remove */ - if (ai) { - at = ap; - while (at != ai) { - t(printf("removing old node 0\n")); - tmp = e_tree_model_node_get_next(etm, at); - remove_node_diff(ml, at, 0); - at = tmp; - } - ap = ai; - } else { - t(printf("adding new node 2\n")); - /* didn't find match in old nodes, must be new node? */ - add_node_diff(ml, parent, NULL, bp, row, myrow); - myrow++; - bp = bp->next; -#if 0 - tmp = e_tree_model_node_get_next(etm, ap); - remove_node_diff(etm, ap, 0); - ap = tmp; -#endif - } - } - } - } -} - -#ifndef BROKEN_ETREE -static void build_flat_diff(MessageList *ml, CamelFolderChangeInfo *changes); -#endif - -static void -build_flat (MessageList *ml, GPtrArray *summary, CamelFolderChangeInfo *changes) -{ - ETreeModel *etm = ml->model; - ETreePath node; - char *saveuid = NULL; - int i; - -#ifdef TIMEIT - struct timeval start, end; - unsigned long diff; - - printf("Building flat\n"); - gettimeofday(&start, NULL); -#endif - - if (ml->cursor_uid) { - if (ml->hidedeleted) { - saveuid = find_next_undeleted(ml); - } - } - -#ifndef BROKEN_ETREE - if (changes) { - build_flat_diff(ml, changes); - } else { -#endif - e_tree_memory_freeze(E_TREE_MEMORY(etm)); - clear_tree (ml); - for (i = 0; i < summary->len; i++) { - CamelMessageInfo *info = summary->pdata[i]; - - node = e_tree_memory_node_insert(E_TREE_MEMORY(etm), ml->tree_root, -1, info); - g_hash_table_insert(ml->uid_nodemap, (void *)camel_message_info_uid(info), node); - camel_folder_ref_message_info(ml->folder, info); - } - e_tree_memory_thaw(E_TREE_MEMORY(etm)); - -#ifndef BROKEN_ETREE - } -#endif - - if (saveuid) { - ETreePath *node = g_hash_table_lookup(ml->uid_nodemap, saveuid); - if (node == NULL) { - g_free (ml->cursor_uid); - ml->cursor_uid = NULL; - g_signal_emit (ml, message_list_signals[MESSAGE_SELECTED], 0, NULL); - } else { - e_tree_set_cursor (ml->tree, node); - } - g_free (saveuid); - } - -#ifdef TIMEIT - gettimeofday(&end, NULL); - diff = end.tv_sec * 1000 + end.tv_usec/1000; - diff -= start.tv_sec * 1000 + start.tv_usec/1000; - printf("Building flat took %ld.%03ld seconds\n", diff / 1000, diff % 1000); -#endif - -} - -static void -message_list_change_first_visible_parent (MessageList *ml, ETreePath node) -{ - ETreePath first_visible = NULL; - - while (node && (node = e_tree_model_node_get_parent (ml->model, node))) { - if (!e_tree_node_is_expanded (ml->tree, node)) - first_visible = node; - } - - if (first_visible != NULL) { - e_tree_model_pre_change (ml->model); - e_tree_model_node_data_changed (ml->model, first_visible); - } -} - -#ifndef BROKEN_ETREE - -static void -build_flat_diff(MessageList *ml, CamelFolderChangeInfo *changes) -{ - int i; - ETreePath node; - CamelMessageInfo *info; - -#ifdef TIMEIT - struct timeval start, end; - unsigned long diff; - - gettimeofday(&start, NULL); -#endif - - d(printf("updating changes to display\n")); - - /* remove individual nodes? */ - d(printf("Removing messages from view:\n")); - for (i=0;i<changes->uid_removed->len;i++) { - node = g_hash_table_lookup(ml->uid_nodemap, changes->uid_removed->pdata[i]); - if (node) { - info = e_tree_memory_node_get_data(E_TREE_MEMORY(ml->model), node); - e_tree_memory_node_remove(E_TREE_MEMORY(ml->model), node); - camel_folder_free_message_info(ml->folder, info); - g_hash_table_remove(ml->uid_nodemap, changes->uid_removed->pdata[i]); - } - } - - /* add new nodes? - just append to the end */ - d(printf("Adding messages to view:\n")); - for (i=0;i<changes->uid_added->len;i++) { - info = camel_folder_get_message_info (ml->folder, changes->uid_added->pdata[i]); - if (info) { - d(printf(" %s\n", (char *)changes->uid_added->pdata[i])); - node = e_tree_memory_node_insert (E_TREE_MEMORY (ml->model), ml->tree_root, -1, info); - g_hash_table_insert (ml->uid_nodemap, (void *)camel_message_info_uid (info), node); - } - } - - /* and update changes too */ - d(printf("Changing messages to view:\n")); - for (i = 0; i < changes->uid_changed->len; i++) { - ETreePath *node = g_hash_table_lookup (ml->uid_nodemap, changes->uid_changed->pdata[i]); - if (node) { - e_tree_model_pre_change (ml->model); - e_tree_model_node_data_changed (ml->model, node); - - message_list_change_first_visible_parent (ml, node); - } - } - -#ifdef TIMEIT - gettimeofday(&end, NULL); - diff = end.tv_sec * 1000 + end.tv_usec/1000; - diff -= start.tv_sec * 1000 + start.tv_usec/1000; - printf("Inserting changes took %ld.%03ld seconds\n", diff / 1000, diff % 1000); -#endif - -} -#endif /* ! BROKEN_ETREE */ - - -static void -mail_folder_hide_by_flag (CamelFolder *folder, MessageList *ml, CamelFolderChangeInfo **changes, int flag) -{ - CamelFolderChangeInfo *newchanges, *oldchanges = *changes; - CamelMessageInfo *info; - int i; - - newchanges = camel_folder_change_info_new (); - - for (i = 0; i < oldchanges->uid_changed->len; i++) { - ETreePath node = g_hash_table_lookup (ml->uid_nodemap, oldchanges->uid_changed->pdata[i]); - - info = camel_folder_get_message_info (folder, oldchanges->uid_changed->pdata[i]); - if (node != NULL && info != NULL && (info->flags & flag) != 0) - camel_folder_change_info_remove_uid (newchanges, oldchanges->uid_changed->pdata[i]); - else if (node == NULL && info != NULL && (info->flags & flag) == 0) - camel_folder_change_info_add_uid (newchanges, oldchanges->uid_changed->pdata[i]); - else - camel_folder_change_info_change_uid (newchanges, oldchanges->uid_changed->pdata[i]); - camel_folder_free_message_info (folder, info); - } - - if (newchanges->uid_added->len > 0 || newchanges->uid_removed->len > 0) { - for (i = 0; i < oldchanges->uid_added->len; i++) - camel_folder_change_info_add_uid (newchanges, oldchanges->uid_added->pdata[i]); - for (i = 0; i < oldchanges->uid_removed->len; i++) - camel_folder_change_info_remove_uid (newchanges, oldchanges->uid_removed->pdata[i]); - camel_folder_change_info_free (oldchanges); - *changes = newchanges; - } else { - camel_folder_change_info_free (newchanges); - } -} - -static void -main_folder_changed (CamelObject *o, gpointer event_data, gpointer user_data) -{ - MessageList *ml = MESSAGE_LIST (user_data); - CamelFolderChangeInfo *changes = (CamelFolderChangeInfo *)event_data; - CamelFolder *folder = (CamelFolder *)o; - int i; - - d(printf("folder changed event, changes = %p\n", changes)); - if (changes) { - d(printf("changed = %d added = %d removed = %d\n", - changes->uid_changed->len, changes->uid_added->len, changes->uid_removed->len)); - - for (i = 0; i < changes->uid_removed->len; i++) { - /* uncache the normalised strings for these uids */ - EPoolv *poolv; - - poolv = g_hash_table_lookup (ml->normalised_hash, changes->uid_removed->pdata[i]); - if (poolv != NULL) { - g_hash_table_remove (ml->normalised_hash, changes->uid_removed->pdata[i]); - e_poolv_destroy (poolv); - } - } - - /* check if the hidden state has changed, if so modify accordingly, then regenerate */ - if (ml->hidejunk || ml->hidedeleted) - mail_folder_hide_by_flag (folder, ml, &changes, (ml->hidejunk ? CAMEL_MESSAGE_JUNK : 0) | (ml->hidedeleted ? CAMEL_MESSAGE_DELETED : 0)); - - if (changes->uid_added->len == 0 && changes->uid_removed->len == 0 && changes->uid_changed->len < 100) { - for (i = 0; i < changes->uid_changed->len; i++) { - ETreePath node = g_hash_table_lookup (ml->uid_nodemap, changes->uid_changed->pdata[i]); - if (node) { - e_tree_model_pre_change (ml->model); - e_tree_model_node_data_changed (ml->model, node); - - message_list_change_first_visible_parent (ml, node); - } - } - - camel_folder_change_info_free (changes); - return; - } - } - - mail_regen_list (ml, ml->search, NULL, changes); -} - -static void -folder_changed (CamelObject *o, gpointer event_data, gpointer user_data) -{ - CamelFolderChangeInfo *changes; - MessageList *ml = MESSAGE_LIST (user_data); - - if (event_data) { - changes = camel_folder_change_info_new(); - camel_folder_change_info_cat(changes, (CamelFolderChangeInfo *)event_data); - } else { - changes = NULL; - } - - mail_async_event_emit(ml->async_event, MAIL_ASYNC_GUI, (MailAsyncFunc)main_folder_changed, o, changes, user_data); -} - -static void -message_changed (CamelObject *o, gpointer event_data, gpointer user_data) -{ - CamelFolderChangeInfo *changes; - MessageList *ml = MESSAGE_LIST (user_data); - - changes = camel_folder_change_info_new(); - camel_folder_change_info_change_uid(changes, (char *)event_data); - - mail_async_event_emit(ml->async_event, MAIL_ASYNC_GUI, (MailAsyncFunc)main_folder_changed, o, changes, user_data); -} - - -/** - * message_list_set_folder: - * @message_list: Message List widget - * @folder: folder backend to be set - * @uri: uri of @folder. - * @outgoing: whether this is an outgoing folder - * - * Sets @folder to be the backend folder for @message_list. If - * @outgoing is %TRUE, then the message-list UI changes to default to - * the "Outgoing folder" column view. - **/ -void -message_list_set_folder (MessageList *message_list, CamelFolder *folder, const char *uri, gboolean outgoing) -{ - gboolean hide_deleted; - GConfClient *gconf; - CamelException ex; - - g_return_if_fail (IS_MESSAGE_LIST (message_list)); - - if (message_list->folder == folder) - return; - - camel_exception_init (&ex); - - /* cancel any outstanding regeneration requests */ - if (message_list->regen) { - GList *l = message_list->regen; - - while (l) { - struct _mail_msg *mm = l->data; - - if (mm->cancel) - camel_operation_cancel(mm->cancel); - l = l->next; - } - } - - clear_tree (message_list); - - if (message_list->folder) { - hide_save_state(message_list); - camel_object_unhook_event((CamelObject *)message_list->folder, "folder_changed", - folder_changed, message_list); - camel_object_unhook_event((CamelObject *)message_list->folder, "message_changed", - message_changed, message_list); - camel_object_unref (message_list->folder); - } - - if (message_list->thread_tree) { - camel_folder_thread_messages_unref(message_list->thread_tree); - message_list->thread_tree = NULL; - } - - if (message_list->folder_uri != uri) { - g_free(message_list->folder_uri); - message_list->folder_uri = g_strdup(uri); - message_list->folder = folder; - } - - if (message_list->cursor_uid) { - g_free(message_list->cursor_uid); - message_list->cursor_uid = NULL; - g_signal_emit(message_list, message_list_signals[MESSAGE_SELECTED], 0, NULL); - } - - if (folder) { - /* Setup the strikeout effect for non-trash folders */ - if (!(folder->folder_flags & CAMEL_FOLDER_IS_TRASH)) { - ECell *cell; - - cell = e_table_extras_get_cell (message_list->extras, "render_date"); - g_object_set (cell, - "strikeout_column", COL_DELETED, - NULL); - - cell = e_table_extras_get_cell (message_list->extras, "render_text"); - g_object_set (cell, - "strikeout_column", COL_DELETED, - NULL); - - cell = e_table_extras_get_cell (message_list->extras, "render_size"); - g_object_set (cell, - "strikeout_column", COL_DELETED, - NULL); - } - - /* Build the etree suitable for this folder */ - message_list_setup_etree (message_list, outgoing); - - camel_object_hook_event (folder, "folder_changed", - folder_changed, message_list); - camel_object_hook_event (folder, "message_changed", - message_changed, message_list); - - camel_object_ref (folder); - - gconf = mail_config_get_gconf_client (); - hide_deleted = !gconf_client_get_bool (gconf, "/apps/evolution/mail/display/show_deleted", NULL); - message_list->hidedeleted = hide_deleted && !(folder->folder_flags & CAMEL_FOLDER_IS_TRASH); - message_list->hidejunk = junk_folder && !(folder->folder_flags & CAMEL_FOLDER_IS_JUNK) && !(folder->folder_flags & CAMEL_FOLDER_IS_TRASH); - - hide_load_state (message_list); - mail_regen_list (message_list, message_list->search, NULL, NULL); - } -} - -E_MAKE_TYPE (message_list, "MessageList", MessageList, message_list_class_init, message_list_init, PARENT_TYPE); - -static gboolean -on_cursor_activated_idle (gpointer data) -{ - MessageList *message_list = data; - ESelectionModel *esm = e_tree_get_selection_model (message_list->tree); - int selected = e_selection_model_selected_count (esm); - - if (selected == 1 && message_list->cursor_uid) { - d(printf ("emitting cursor changed signal, for uid %s\n", message_list->cursor_uid)); - g_signal_emit (message_list, message_list_signals[MESSAGE_SELECTED], 0, message_list->cursor_uid); - } else { - g_signal_emit (message_list, message_list_signals[MESSAGE_SELECTED], 0, NULL); - } - - message_list->idle_id = 0; - return FALSE; -} - -static void -on_cursor_activated_cmd (ETree *tree, int row, ETreePath path, gpointer user_data) -{ - MessageList *message_list = MESSAGE_LIST (user_data); - const char *new_uid; - - if (path == NULL) - new_uid = NULL; - else - new_uid = get_message_uid (message_list, path); - - if (message_list->cursor_uid != NULL && new_uid != NULL && !strcmp (message_list->cursor_uid, new_uid)) - return; - - message_list->cursor_row = row; - g_free (message_list->cursor_uid); - message_list->cursor_uid = g_strdup (new_uid); - - if (!message_list->idle_id) { - message_list->idle_id = - g_idle_add_full (G_PRIORITY_LOW, on_cursor_activated_idle, - message_list, NULL); - } -} - -static void -on_selection_changed_cmd(ETree *tree, MessageList *ml) -{ - GPtrArray *uids; - - uids = message_list_get_selected(ml); - g_free(ml->cursor_uid); - if (uids->len == 1) - ml->cursor_uid = g_strdup(uids->pdata[0]); - else - ml->cursor_uid = NULL; - - if (uids->len <= 1 && !ml->idle_id) - ml->idle_id = g_idle_add_full (G_PRIORITY_LOW, on_cursor_activated_idle, ml, NULL); - - if (ml->priv->primary_uids) { - message_list_free_uids(ml, ml->priv->primary_uids); - ml->priv->primary_uids = NULL; - } - - if (uids->len > 0) { - ml->priv->primary_uids = uids; - gtk_selection_owner_set(ml->priv->invisible, GDK_SELECTION_PRIMARY, gtk_get_current_event_time()); - } else { - message_list_free_uids(ml, uids); - gtk_selection_owner_set(NULL, GDK_SELECTION_PRIMARY, gtk_get_current_event_time()); - } -} - -static gint -on_click (ETree *tree, gint row, ETreePath path, gint col, GdkEvent *event, MessageList *list) -{ - CamelMessageInfo *info; - int flag; - - if (col == COL_MESSAGE_STATUS) - flag = CAMEL_MESSAGE_SEEN; - else if (col == COL_FLAGGED) - flag = CAMEL_MESSAGE_FLAGGED; - else - return FALSE; - - info = get_message_info (list, path); - if (info == NULL) { - return FALSE; - } - - /* If a message was marked as deleted and the user flags it as - important, marks it as needing a reply, marks it as unread, - then undelete the message. */ - if (info->flags & CAMEL_MESSAGE_DELETED) { - if (col == COL_FLAGGED && !(info->flags & CAMEL_MESSAGE_FLAGGED)) - flag |= CAMEL_MESSAGE_DELETED; - - if (col == COL_MESSAGE_STATUS && (info->flags & CAMEL_MESSAGE_SEEN)) - flag |= CAMEL_MESSAGE_DELETED; - } - - camel_folder_set_message_flags (list->folder, camel_message_info_uid (info), flag, ~info->flags); - - if (flag == CAMEL_MESSAGE_SEEN && list->seen_id) { - g_source_remove (list->seen_id); - list->seen_id = 0; - } - - return TRUE; -} - -struct message_list_foreach_data { - MessageList *message_list; - MessageListForeachFunc callback; - gpointer user_data; -}; - -static void -mlfe_callback (ETreePath path, gpointer user_data) -{ - struct message_list_foreach_data *mlfe_data = user_data; - const char *uid; - - if (e_tree_model_node_is_root (mlfe_data->message_list->model, path)) - return; - - uid = get_message_uid (mlfe_data->message_list, - path); - if (uid) { - mlfe_data->callback (mlfe_data->message_list, uid, - mlfe_data->user_data); - } else { - /* FIXME: could this the cause of bug #6637 and friends? */ - g_warning ("I wonder if this could be the cause of bug #6637 and friends?"); - g_assert_not_reached (); - } -} - -void -message_list_foreach (MessageList *message_list, - MessageListForeachFunc callback, - gpointer user_data) -{ - struct message_list_foreach_data mlfe_data; - - mlfe_data.message_list = message_list; - mlfe_data.callback = callback; - mlfe_data.user_data = user_data; - e_tree_selected_path_foreach (message_list->tree, - mlfe_callback, &mlfe_data); -} - -struct _ml_selected_data { - MessageList *ml; - GPtrArray *uids; -}; - -static void -ml_getselected_cb(ETreePath path, void *user_data) -{ - struct _ml_selected_data *data = user_data; - const char *uid; - - if (e_tree_model_node_is_root (data->ml->model, path)) - return; - - uid = get_message_uid(data->ml, path); - g_assert(uid != NULL); - g_ptr_array_add(data->uids, g_strdup(uid)); -} - -GPtrArray * -message_list_get_selected(MessageList *ml) -{ - struct _ml_selected_data data = { - ml, - g_ptr_array_new() - }; - - e_tree_selected_path_foreach(ml->tree, ml_getselected_cb, &data); - - return data.uids; -} - -void message_list_free_uids(MessageList *ml, GPtrArray *uids) -{ - int i; - - for (i=0;i<uids->len;i++) - g_free(uids->pdata[i]); - g_ptr_array_free(uids, TRUE); -} - -/* set whether we are in threaded view or flat view */ -void -message_list_set_threaded (MessageList *ml, gboolean threaded) -{ - if (ml->threaded != threaded) { - ml->threaded = threaded; - - mail_regen_list (ml, ml->search, NULL, NULL); - } -} - -void -message_list_set_hidedeleted (MessageList *ml, gboolean hidedeleted) -{ - if (ml->hidedeleted != hidedeleted) { - ml->hidedeleted = hidedeleted; - - mail_regen_list (ml, ml->search, NULL, NULL); - } -} - -void -message_list_set_search (MessageList *ml, const char *search) -{ - if (search == NULL || search[0] == '\0') - if (ml->search == NULL || ml->search[0] == '\0') - return; - - if (search != NULL && ml->search != NULL && strcmp (search, ml->search) == 0) - return; - - if (ml->thread_tree) { - camel_folder_thread_messages_unref(ml->thread_tree); - ml->thread_tree = NULL; - } - - mail_regen_list (ml, search, NULL, NULL); -} - -/* returns the number of messages displayable *after* expression hiding has taken place */ -unsigned int -message_list_length (MessageList *ml) -{ - return ml->hide_unhidden; -} - -struct _glibsuxcrap { - unsigned int count; - CamelFolder *folder; -}; - -static void -glib_crapback(void *key, void *data, void *x) -{ - struct _glibsuxcrap *y = x; - CamelMessageInfo *mi; - - mi = camel_folder_get_message_info(y->folder, key); - if (mi) { - y->count++; - camel_folder_free_message_info(y->folder, mi); - } -} - -/* returns number of hidden messages */ -unsigned int -message_list_hidden(MessageList *ml) -{ - unsigned int hidden = 0; - - MESSAGE_LIST_LOCK (ml, hide_lock); - if (ml->hidden && ml->folder) { - /* this is a hack, should probably just maintain the hidden table better */ - struct _glibsuxcrap x = { 0, ml->folder }; - g_hash_table_foreach(ml->hidden, glib_crapback, &x); - hidden = x.count; - } - MESSAGE_LIST_UNLOCK (ml, hide_lock); - - return hidden; -} - - -/* add a new expression to hide, or set the range. - @expr: A new search expression - all matching messages will be hidden. May be %NULL. - @lower: Use ML_HIDE_NONE_START to specify no messages hidden from the start of the list. - @upper: Use ML_HIDE_NONE_END to specify no message hidden from the end of the list. - - For either @upper or @lower, use ML_HIDE_SAME, to keep the previously set hide range. - If either range is negative, then the range is taken from the end of the available list - of messages, once other hiding has been performed. Use message_list_length() to find out - how many messages are available for hiding. - - Example: hide_add(ml, NULL, -100, ML_HIDE_NONE_END) -> hide all but the last (most recent) - 100 messages. -*/ -void -message_list_hide_add (MessageList *ml, const char *expr, unsigned int lower, unsigned int upper) -{ - MESSAGE_LIST_LOCK (ml, hide_lock); - - if (lower != ML_HIDE_SAME) - ml->hide_before = lower; - if (upper != ML_HIDE_SAME) - ml->hide_after = upper; - - MESSAGE_LIST_UNLOCK (ml, hide_lock); - - mail_regen_list (ml, ml->search, expr, NULL); -} - -/* hide specific uid's */ -void -message_list_hide_uids (MessageList *ml, GPtrArray *uids) -{ - int i; - char *uid; - - /* first see if we need to do any work, if so, then do it all at once */ - for (i = 0; i < uids->len; i++) { - if (g_hash_table_lookup (ml->uid_nodemap, uids->pdata[i])) { - MESSAGE_LIST_LOCK (ml, hide_lock); - if (ml->hidden == NULL) { - ml->hidden = g_hash_table_new (g_str_hash, g_str_equal); - ml->hidden_pool = e_mempool_new (512, 256, E_MEMPOOL_ALIGN_BYTE); - } - - uid = e_mempool_strdup (ml->hidden_pool, uids->pdata[i]); - g_hash_table_insert (ml->hidden, uid, uid); - for ( ; i < uids->len; i++) { - if (g_hash_table_lookup (ml->uid_nodemap, uids->pdata[i])) { - uid = e_mempool_strdup (ml->hidden_pool, uids->pdata[i]); - g_hash_table_insert (ml->hidden, uid, uid); - } - } - MESSAGE_LIST_UNLOCK (ml, hide_lock); - mail_regen_list (ml, ml->search, NULL, NULL); - break; - } - } -} - -/* no longer hide any messages */ -void -message_list_hide_clear (MessageList *ml) -{ - MESSAGE_LIST_LOCK (ml, hide_lock); - if (ml->hidden) { - g_hash_table_destroy (ml->hidden); - e_mempool_destroy (ml->hidden_pool); - ml->hidden = NULL; - ml->hidden_pool = NULL; - } - ml->hide_before = ML_HIDE_NONE_START; - ml->hide_after = ML_HIDE_NONE_END; - MESSAGE_LIST_UNLOCK (ml, hide_lock); - - if (ml->thread_tree) { - camel_folder_thread_messages_unref(ml->thread_tree); - ml->thread_tree = NULL; - } - - mail_regen_list (ml, ml->search, NULL, NULL); -} - -#define HIDE_STATE_VERSION (1) - -/* version 1 file is: - uintf 1 - uintf hide_before - uintf hide_after - string* uids -*/ - -static void -hide_load_state (MessageList *ml) -{ - char *filename; - FILE *in; - guint32 version, lower, upper; - - filename = mail_config_folder_to_cachename(ml->folder, "hidestate-"); - in = fopen(filename, "r"); - if (in) { - camel_file_util_decode_fixed_int32 (in, &version); - if (version == HIDE_STATE_VERSION) { - MESSAGE_LIST_LOCK(ml, hide_lock); - if (ml->hidden == NULL) { - ml->hidden = g_hash_table_new(g_str_hash, g_str_equal); - ml->hidden_pool = e_mempool_new(512, 256, E_MEMPOOL_ALIGN_BYTE); - } - camel_file_util_decode_fixed_int32 (in, &lower); - ml->hide_before = lower; - camel_file_util_decode_fixed_int32 (in, &upper); - ml->hide_after = upper; - while (!feof(in)) { - char *olduid, *uid; - - if (camel_file_util_decode_string (in, &olduid) != -1) { - uid = e_mempool_strdup(ml->hidden_pool, olduid); - g_free (olduid); - g_hash_table_insert(ml->hidden, uid, uid); - } - } - MESSAGE_LIST_UNLOCK(ml, hide_lock); - } - fclose(in); - } - g_free(filename); -} - -static void -hide_save_1 (char *uid, char *keydata, FILE *out) -{ - camel_file_util_encode_string (out, uid); -} - -/* save the hide state. Note that messages are hidden by uid, if the uid's change, then - this will become invalid, but is easy to reset in the ui */ -static void -hide_save_state (MessageList *ml) -{ - char *filename; - FILE *out; - - if (ml->folder == NULL) - return; - - MESSAGE_LIST_LOCK(ml, hide_lock); - - filename = mail_config_folder_to_cachename(ml->folder, "hidestate-"); - if (ml->hidden == NULL && ml->hide_before == ML_HIDE_NONE_START && ml->hide_after == ML_HIDE_NONE_END) { - unlink(filename); - } else if ((out = fopen (filename, "w"))) { - camel_file_util_encode_fixed_int32 (out, HIDE_STATE_VERSION); - camel_file_util_encode_fixed_int32 (out, ml->hide_before); - camel_file_util_encode_fixed_int32 (out, ml->hide_after); - if (ml->hidden) - g_hash_table_foreach(ml->hidden, (GHFunc)hide_save_1, out); - fclose(out); - } - g_free (filename); - - MESSAGE_LIST_UNLOCK(ml, hide_lock); -} - -/* ** REGENERATE MESSAGELIST ********************************************** */ -struct _regen_list_msg { - struct _mail_msg msg; - - int complete; - - MessageList *ml; - char *search; - char *hideexpr; - CamelFolderChangeInfo *changes; - gboolean dotree; /* we are building a tree */ - gboolean hidedel; /* we want to/dont want to show deleted messages */ - gboolean hidejunk; /* we want to/dont want to show junk messages */ - gboolean thread_subject; - CamelFolderThread *tree; - - CamelFolder *folder; - GPtrArray *summary; -}; - -/* - maintain copy of summary - - any new messages added - any removed removed, etc. - - use vfolder to implement searches ??? - - */ - -static char * -regen_list_describe (struct _mail_msg *mm, gint complete) -{ - return g_strdup (_("Generating message list")); -} - -static void -regen_list_regen (struct _mail_msg *mm) -{ - struct _regen_list_msg *m = (struct _regen_list_msg *)mm; - GPtrArray *uids, *uidnew, *showuids, *searchuids = NULL; - CamelMessageInfo *info; - int i; - - /* if we have hidedeleted on, use a search to find it out, merge with existing search if set */ - if (!camel_folder_has_search_capability(m->folder)) { - /* if we have no search capability, dont let search or hide deleted work */ - uids = camel_folder_get_uids(m->folder); - } else if (m->hidedel) { - char *expr; - - if (m->hidejunk) { - if (m->search) { - expr = alloca(strlen(m->search) + 92); - sprintf(expr, "(and (match-all (and (not (system-flag \"deleted\")) (not (system-flag \"junk\"))))\n %s)", m->search); - } else - expr = "(match-all (and (not (system-flag \"deleted\")) (not (system-flag \"junk\"))))"; - } else { - if (m->search) { - expr = alloca(strlen(m->search) + 64); - sprintf(expr, "(and (match-all (not (system-flag \"deleted\")))\n %s)", m->search); - } else - expr = "(match-all (not (system-flag \"deleted\")))"; - } - searchuids = uids = camel_folder_search_by_expression (m->folder, expr, &mm->ex); - } else { - char *expr; - - if (m->hidejunk) { - if (m->search) { - expr = alloca(strlen(m->search) + 64); - sprintf(expr, "(and (match-all (not (system-flag \"junk\")))\n %s)", m->search); - } else - expr = "(match-all (not (system-flag \"junk\")))"; - searchuids = uids = camel_folder_search_by_expression (m->folder, expr, &mm->ex); - } else { - if (m->search) - searchuids = uids = camel_folder_search_by_expression (m->folder, m->search, &mm->ex); - else - uids = camel_folder_get_uids (m->folder); - } - } - - if (camel_exception_is_set (&mm->ex)) - return; - - /* perform hiding */ - if (m->hideexpr && camel_folder_has_search_capability(m->folder)) { - uidnew = camel_folder_search_by_expression (m->ml->folder, m->hideexpr, &mm->ex); - /* well, lets not abort just because this faileld ... */ - camel_exception_clear (&mm->ex); - - if (uidnew) { - MESSAGE_LIST_LOCK(m->ml, hide_lock); - - if (m->ml->hidden == NULL) { - m->ml->hidden = g_hash_table_new (g_str_hash, g_str_equal); - m->ml->hidden_pool = e_mempool_new (512, 256, E_MEMPOOL_ALIGN_BYTE); - } - - for (i = 0; i < uidnew->len; i++) { - if (g_hash_table_lookup (m->ml->hidden, uidnew->pdata[i]) == 0) { - char *uid = e_mempool_strdup (m->ml->hidden_pool, uidnew->pdata[i]); - g_hash_table_insert (m->ml->hidden, uid, uid); - } - } - - MESSAGE_LIST_UNLOCK(m->ml, hide_lock); - - camel_folder_search_free (m->ml->folder, uidnew); - } - } - - MESSAGE_LIST_LOCK(m->ml, hide_lock); - - m->ml->hide_unhidden = uids->len; - - /* what semantics do we want from hide_before, hide_after? - probably <0 means measure from the end of the list */ - - /* perform uid hiding */ - if (m->ml->hidden || m->ml->hide_before != ML_HIDE_NONE_START || m->ml->hide_after != ML_HIDE_NONE_END) { - int start, end; - uidnew = g_ptr_array_new (); - - /* first, hide matches */ - if (m->ml->hidden) { - for (i = 0; i < uids->len; i++) { - if (g_hash_table_lookup (m->ml->hidden, uids->pdata[i]) == 0) - g_ptr_array_add (uidnew, uids->pdata[i]); - } - } - - /* then calculate the subrange visible and chop it out */ - m->ml->hide_unhidden = uidnew->len; - - if (m->ml->hide_before != ML_HIDE_NONE_START || m->ml->hide_after != ML_HIDE_NONE_END) { - GPtrArray *uid2 = g_ptr_array_new (); - - start = m->ml->hide_before; - if (start < 0) - start += m->ml->hide_unhidden; - end = m->ml->hide_after; - if (end < 0) - end += m->ml->hide_unhidden; - - start = MAX(start, 0); - end = MIN(end, uidnew->len); - for (i = start; i < end; i++) { - g_ptr_array_add (uid2, uidnew->pdata[i]); - } - - g_ptr_array_free (uidnew, TRUE); - uidnew = uid2; - } - showuids = uidnew; - } else { - uidnew = NULL; - showuids = uids; - } - - MESSAGE_LIST_UNLOCK(m->ml, hide_lock); - - if (!camel_operation_cancel_check(mm->cancel)) { - /* update/build a new tree */ - if (m->dotree) { - if (m->tree) - camel_folder_thread_messages_apply (m->tree, showuids); - else - m->tree = camel_folder_thread_messages_new (m->folder, showuids, m->thread_subject); - } else { - m->summary = g_ptr_array_new (); - for (i = 0; i < showuids->len; i++) { - info = camel_folder_get_message_info (m->folder, showuids->pdata[i]); - if (info) - g_ptr_array_add(m->summary, info); - } - } - - m->complete = TRUE; - } - - if (uidnew) - g_ptr_array_free (uidnew, TRUE); - - if (searchuids) - camel_folder_search_free (m->folder, searchuids); - else - camel_folder_free_uids (m->folder, uids); -} - -static void -regen_list_regened (struct _mail_msg *mm) -{ - struct _regen_list_msg *m = (struct _regen_list_msg *)mm; - - if (m->ml->destroyed) - return; - - if (!m->complete) - return; - - if (camel_operation_cancel_check(mm->cancel)) - return; - - if (m->dotree) { - save_tree_state (m->ml); - - build_tree (m->ml, m->tree, m->changes); - if (m->ml->thread_tree) - camel_folder_thread_messages_unref(m->ml->thread_tree); - m->ml->thread_tree = m->tree; - m->tree = NULL; - - load_tree_state (m->ml); - } else - build_flat (m->ml, m->summary, m->changes); - - g_signal_emit (m->ml, message_list_signals[MESSAGE_LIST_BUILT], 0); -} - -static void -regen_list_free (struct _mail_msg *mm) -{ - struct _regen_list_msg *m = (struct _regen_list_msg *)mm; - int i; - - if (m->summary) { - for (i = 0; i < m->summary->len; i++) - camel_folder_free_message_info (m->folder, m->summary->pdata[i]); - g_ptr_array_free (m->summary, TRUE); - } - - if (m->tree) - camel_folder_thread_messages_unref (m->tree); - - if (m->ml->search && m->ml->search != m->search) - g_free (m->ml->search); - m->ml->search = m->search; - - g_free (m->hideexpr); - - camel_object_unref (m->folder); - - if (m->changes) - camel_folder_change_info_free (m->changes); - - /* This should probably lock the list. - However, since we have a received function, this will always be called in gui thread */ - m->ml->regen = g_list_remove(m->ml->regen, m); - - if (m->ml->regen == NULL && m->ml->pending_select_uid) { - char *uid = m->ml->pending_select_uid; - - m->ml->pending_select_uid = NULL; - message_list_select_uid(m->ml, uid); - g_free(uid); - } - - g_object_unref(m->ml); -} - -static struct _mail_msg_op regen_list_op = { - regen_list_describe, - regen_list_regen, - regen_list_regened, - regen_list_free, -}; - -static void -mail_regen_list (MessageList *ml, const char *search, const char *hideexpr, CamelFolderChangeInfo *changes) -{ - struct _regen_list_msg *m; - GConfClient *gconf; - - if (ml->folder == NULL) - return; - - /* cancel any outstanding regeneration requests, we rebuild from scratch anyway */ - if (ml->regen) { - GList *l = ml->regen; - - while (l) { - struct _mail_msg *mm = l->data; - - if (mm->cancel) - camel_operation_cancel(mm->cancel); - l = l->next; - } - } - - gconf = mail_config_get_gconf_client (); - -#ifndef BROKEN_ETREE - /* this can sometimes crash,so ... */ - - /* see if we need to goto the child thread at all anyway */ - /* currently the only case is the flat view with updates and no search */ - if (hideexpr == NULL && search == NULL && changes != NULL && !ml->threaded) { - build_flat_diff(ml, changes); - camel_folder_change_info_free(changes); - return; - } -#endif - - m = mail_msg_new (®en_list_op, NULL, sizeof (*m)); - m->ml = ml; - m->search = g_strdup (search); - m->hideexpr = g_strdup (hideexpr); - m->changes = changes; - m->dotree = ml->threaded; - m->hidedel = ml->hidedeleted; - m->hidejunk = ml->hidejunk; - m->thread_subject = gconf_client_get_bool (gconf, "/apps/evolution/mail/display/thread_subject", NULL); - g_object_ref(ml); - m->folder = ml->folder; - camel_object_ref(m->folder); - - if ((!m->hidedel || !m->dotree) && ml->thread_tree) { - camel_folder_thread_messages_unref(ml->thread_tree); - ml->thread_tree = NULL; - } else if (ml->thread_tree) { - m->tree = ml->thread_tree; - camel_folder_thread_messages_ref(m->tree); - } - - ml->regen = g_list_prepend(ml->regen, m); - - e_thread_put (mail_thread_new, (EMsg *)m); -} diff --git a/mail/message-list.etspec b/mail/message-list.etspec deleted file mode 100644 index 1ba8a64187..0000000000 --- a/mail/message-list.etspec +++ /dev/null @@ -1,35 +0,0 @@ -<ETableSpecification cursor-mode="line" draw-grid="false" draw-focus="true" selection-mode="browse"> - <ETableColumn model_col="0" _title="Status" pixbuf="status" expansion="0.0" minimum_width="18" resizable="false" cell="render_message_status" compare="integer" sortable="false"/> - - <ETableColumn model_col="1" _title="Flagged" pixbuf="flagged" expansion="0.0" minimum_width="18" resizable="false" cell="render_flagged" compare="integer"/> - - <ETableColumn model_col="2" _title="Score" pixbuf="score" expansion="0.0" minimum_width="18" disabled="true" resizable="false" cell="render_score" compare="integer"/> - - <ETableColumn model_col="3" _title="Attachment" pixbuf="attachment" expansion="0.0" minimum_width="18" resizable="false" cell="render_attachment" compare="integer" sortable="false"/> - - <ETableColumn model_col="4" compare_col="14" _title="From" expansion="1.0" minimum_width="32" resizable="true" cell="render_text" compare="address_compare" search="string" priority="10"/> - - <ETableColumn model_col="5" compare_col="15" _title="Subject" expansion="1.6" minimum_width="32" resizable="true" cell="render_tree" compare="string" search="string"/> - - <ETableColumn model_col="6" _title="Date" expansion="0.4" minimum_width="32" resizable="true" cell="render_date" compare="integer"/> - - <ETableColumn model_col="7" _title="Received" expansion="0.4" minimum_width="32" resizable="true" cell="render_date" compare="integer"/> - - <ETableColumn model_col="8" compare_col="16" _title="To" expansion="1.0" minimum_width="32" resizable="true" cell="render_text" compare="address_compare" search="string" priority="5"/> - - <ETableColumn model_col="9" _title="Size" expansion="0.2" minimum_width="32" resizable="true" cell="render_size" compare="integer"/> - - <ETableColumn model_col="10" _title="Flag Status" pixbuf="followup" expansion="0.0" minimum_width="18" resizable="false" cell="render_flag_status" compare="integer"/> - - <ETableColumn model_col="11" _title="Follow Up Flag" expansion="0.2" minimum_width="32" resizable="true" cell="render_text" compare="string"/> - - <ETableColumn model_col="12" _title="Due By" expansion="0.2" minimum_width="32" resizable="true" cell="render_date" compare="integer"/> - - <ETableColumn model_col="13" _title="Original Location" expansion="0.2" minimum_width="32" resizable="true" cell="render_text" compare="string"/> - - <ETableState> - <column source="0"/> <column source="3"/> <column source="1"/> - <column source="4"/> <column source="5" expansion="1.60"/> <column source="6" expansion="0.40"/> - <grouping> </grouping> - </ETableState> -</ETableSpecification> diff --git a/mail/message-list.h b/mail/message-list.h deleted file mode 100644 index 8052ed791b..0000000000 --- a/mail/message-list.h +++ /dev/null @@ -1,216 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Authors: Jeffrey Stedfast <fejj@ximian.com> - * - * Copyright 2003 Ximian, Inc. (www.ximian.com) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA. - * - */ - - -#ifndef _MESSAGE_LIST_H_ -#define _MESSAGE_LIST_H_ - -#include <gtk/gtkobject.h> -#include <gtk/gtkwidget.h> - -#include <gal/e-table/e-table-simple.h> -#include <gal/e-table/e-tree-scrolled.h> -#include "mail-types.h" - -#ifdef __cplusplus -extern "C" { -#pragma } -#endif /* __cplusplus */ - -#define MESSAGE_LIST_TYPE (message_list_get_type ()) -#define MESSAGE_LIST(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), MESSAGE_LIST_TYPE, MessageList)) -#define MESSAGE_LIST_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), MESSAGE_LIST_TYPE, MessageListClass)) -#define IS_MESSAGE_LIST(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), MESSAGE_LIST_TYPE)) -#define IS_MESSAGE_LIST_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), MESSAGE_LIST_TYPE)) - -enum { - COL_MESSAGE_STATUS, - COL_FLAGGED, - COL_SCORE, - COL_ATTACHMENT, - COL_FROM, - COL_SUBJECT, - COL_SENT, - COL_RECEIVED, - COL_TO, - COL_SIZE, - COL_FOLLOWUP_FLAG_STATUS, - COL_FOLLOWUP_FLAG, - COL_FOLLOWUP_DUE_BY, - COL_LOCATION, /* vfolder location? */ - - /* normalised strings */ - COL_FROM_NORM, - COL_SUBJECT_NORM, - COL_TO_NORM, - - COL_LAST, - - /* Invisible columns */ - COL_DELETED, - COL_UNREAD, - COL_COLOUR, -}; - -#define MESSAGE_LIST_COLUMN_IS_ACTIVE(col) (col == COL_MESSAGE_STATUS || \ - col == COL_FLAGGED) - -#define ML_HIDE_NONE_START (0) -#define ML_HIDE_NONE_END (2147483647) -/* dont change */ -#define ML_HIDE_SAME (2147483646) - -struct _MessageList { - ETreeScrolled parent; - - struct _MessageListPrivate *priv; - - /* The table */ - ETreeModel *model; - ETree *tree; - ETreePath tree_root; - ETableExtras *extras; - - /* The folder & matching uri */ - CamelFolder *folder; - char *folder_uri; - - GHashTable *uid_nodemap; /* uid (from info) -> tree node mapping */ - - GHashTable *normalised_hash; - - /* UID's to hide. Keys in the mempool */ - /* IMPORTANT: You MUST have obtained the hide lock, to operate on this data */ - GHashTable *hidden; - struct _EMemPool *hidden_pool; - int hide_unhidden; /* total length, before hiding */ - int hide_before, hide_after; /* hide ranges of messages */ - - /* Current search string, or %NULL */ - char *search; - - /* Are we displaying threaded view? */ - guint threaded : 1; - - /* do we automatically hide deleted messages? */ - guint hidedeleted : 1; - - /* do we automatically hide junk messages? */ - guint hidejunk : 1; - - /* is the message-list object in a destroyed state? */ - guint destroyed : 1; - - /* Where the ETree cursor is. */ - int cursor_row; - char *cursor_uid; - - /* Row-selection and seen-marking timers */ - guint idle_id, seen_id; - - /* locks */ - GMutex *hide_lock; /* for any 'hide' info above */ - - /* list of outstanding regeneration requests */ - GList *regen; - char *pending_select_uid; /* set if we were busy regnerating while we had a select come in */ - - /* the current camel folder thread tree, if any */ - struct _CamelFolderThread *thread_tree; - - /* for message/folder chagned event handling */ - struct _MailAsyncEvent *async_event; -}; - -typedef struct { - ETreeScrolledClass parent_class; - - /* signals - select a message */ - void (*message_selected) (MessageList *ml, const char *uid); - void (*message_list_built) (MessageList *ml); -} MessageListClass; - -typedef void (*MessageListForeachFunc) (MessageList *message_list, - const char *uid, - gpointer user_data); - -typedef enum { - MESSAGE_LIST_SELECT_NEXT = 1, - MESSAGE_LIST_SELECT_PREVIOUS = -1 -} MessageListSelectDirection; - -GtkType message_list_get_type (void); -GtkWidget *message_list_new (void); -void message_list_set_folder (MessageList *message_list, CamelFolder *camel_folder, const char *uri, gboolean outgoing); - -void message_list_foreach (MessageList *message_list, - MessageListForeachFunc callback, - gpointer user_data); - -GPtrArray *message_list_get_selected(MessageList *ml); -void message_list_free_uids(MessageList *ml, GPtrArray *uids); - -/* select next/prev message helpers */ -gboolean message_list_select (MessageList *message_list, - MessageListSelectDirection direction, - guint32 flags, - guint32 mask, - gboolean wraparound); - -void message_list_select_uid (MessageList *message_list, - const char *uid); - -void message_list_select_next_thread (MessageList *ml); - -/* selection manipulation */ -void message_list_select_all (MessageList *ml); -void message_list_select_thread (MessageList *ml); -void message_list_invert_selection (MessageList *ml); - -/* clipboard stuff */ -void message_list_copy(MessageList *ml, gboolean cut); -gboolean message_list_has_primary_selection(MessageList *ml); -void message_list_paste (MessageList *ml); - -/* info */ -unsigned int message_list_length (MessageList *ml); -unsigned int message_list_hidden (MessageList *ml); - -/* hide specific messages */ -void message_list_hide_add (MessageList *ml, const char *expr, unsigned int lower, unsigned int upper); -void message_list_hide_uids (MessageList *ml, GPtrArray *uids); -void message_list_hide_clear (MessageList *ml); - -void message_list_set_threaded (MessageList *ml, gboolean threaded); -void message_list_set_hidedeleted (MessageList *ml, gboolean hidedeleted); -void message_list_set_search (MessageList *ml, const char *search); - -void message_list_save_state (MessageList *ml); - -#define MESSAGE_LIST_LOCK(m, l) g_mutex_lock(((MessageList *)m)->l) -#define MESSAGE_LIST_UNLOCK(m, l) g_mutex_unlock(((MessageList *)m)->l) - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* _MESSAGE_LIST_H_ */ diff --git a/mail/message-tag-editor.c b/mail/message-tag-editor.c deleted file mode 100644 index bfc7c699f3..0000000000 --- a/mail/message-tag-editor.c +++ /dev/null @@ -1,128 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Authors: Jeffrey Stedfast <fejj@ximian.com> - * - * Copyright 2002 Ximian, Inc. (www.ximian.com) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA. - * - */ - - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <gtk/gtkstock.h> - -#include "message-tag-editor.h" - -static void message_tag_editor_class_init (MessageTagEditorClass *class); -static void message_tag_editor_init (MessageTagEditor *editor); -static void message_tag_editor_finalise (GObject *obj); - -static CamelTag *get_tag_list (MessageTagEditor *editor); -static void set_tag_list (MessageTagEditor *editor, CamelTag *value); - -static GtkDialogClass *parent_class = NULL; - -GType -message_tag_editor_get_type (void) -{ - static GType type = 0; - - if (!type) { - static const GTypeInfo info = { - sizeof (MessageTagEditorClass), - NULL, /* base_class_init */ - NULL, /* base_class_finalize */ - (GClassInitFunc) message_tag_editor_class_init, - NULL, /* class_finalize */ - NULL, /* class_data */ - sizeof (MessageTagEditor), - 0, - (GInstanceInitFunc) message_tag_editor_init, - }; - - type = g_type_register_static (gtk_dialog_get_type (), "MessageTagEditor", &info, 0); - } - - return type; -} - -static void -message_tag_editor_class_init (MessageTagEditorClass *klass) -{ - GObjectClass *object_class = G_OBJECT_CLASS (klass); - - parent_class = g_type_class_ref (gtk_dialog_get_type ()); - - object_class->finalize = message_tag_editor_finalise; - - klass->get_tag_list = get_tag_list; - klass->set_tag_list = set_tag_list; -} - -static void -message_tag_editor_init (MessageTagEditor *editor) -{ - gtk_window_set_default_size((GtkWindow *)editor, 400, 500); - gtk_dialog_add_buttons (GTK_DIALOG (editor), - GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, - GTK_STOCK_OK, GTK_RESPONSE_OK, - NULL); - - gtk_dialog_set_default_response (GTK_DIALOG (editor), GTK_RESPONSE_OK); -} - - -static void -message_tag_editor_finalise (GObject *obj) -{ - /*MessageTagEditor *editor = (MessageTagEditor *) obj;*/ - - G_OBJECT_CLASS (parent_class)->finalize (obj); -} - -static CamelTag * -get_tag_list (MessageTagEditor *editor) -{ - return NULL; -} - -CamelTag * -message_tag_editor_get_tag_list (MessageTagEditor *editor) -{ - g_return_val_if_fail (IS_MESSAGE_TAG_EDITOR (editor), NULL); - - return MESSAGE_TAG_EDITOR_GET_CLASS (editor)->get_tag_list (editor); -} - - -static void -set_tag_list (MessageTagEditor *editor, CamelTag *tags) -{ - /* no-op */ - ; -} - -void -message_tag_editor_set_tag_list (MessageTagEditor *editor, CamelTag *tags) -{ - g_return_if_fail (IS_MESSAGE_TAG_EDITOR (editor)); - g_return_if_fail (tags != NULL); - - MESSAGE_TAG_EDITOR_GET_CLASS (editor)->set_tag_list (editor, tags); -} diff --git a/mail/message-tag-editor.h b/mail/message-tag-editor.h deleted file mode 100644 index 9177012f75..0000000000 --- a/mail/message-tag-editor.h +++ /dev/null @@ -1,73 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Authors: Jeffrey Stedfast <fejj@ximian.com> - * - * Copyright 2002 Ximian, Inc. (www.ximian.com) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA. - * - */ - - -#ifndef __MESSAGE_TAG_EDITOR_H__ -#define __MESSAGE_TAG_EDITOR_H__ - -#include <gtk/gtkwidget.h> -#include <gtk/gtkdialog.h> -#include <camel/camel-folder.h> -#include <camel/camel-folder-summary.h> - -#ifdef __cplusplus -extern "C" { -#pragma } -#endif /* __cplusplus */ - -#define MESSAGE_TAG_EDITOR_TYPE (message_tag_editor_get_type ()) -#define MESSAGE_TAG_EDITOR(obj) (G_TYPE_CHECK_INSTANCE_CAST (obj, MESSAGE_TAG_EDITOR_TYPE, MessageTagEditor)) -#define MESSAGE_TAG_EDITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST (klass, MESSAGE_TAG_EDITOR_TYPE, MessageTagEditorClass)) -#define IS_MESSAGE_TAG_EDITOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE (obj, MESSAGE_TAG_EDITOR_TYPE)) -#define IS_MESSAGE_TAG_EDITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MESSAGE_TAG_EDITOR_TYPE)) -#define MESSAGE_TAG_EDITOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MESSAGE_TAG_EDITOR_TYPE, MessageTagEditorClass)) - -typedef struct _MessageTagEditor MessageTagEditor; -typedef struct _MessageTagEditorClass MessageTagEditorClass; - -struct _MessageTagEditor { - GtkDialog parent; - -}; - -struct _MessageTagEditorClass { - GtkDialogClass parent_class; - - /* virtual methods */ - CamelTag * (*get_tag_list) (MessageTagEditor *editor); - void (*set_tag_list) (MessageTagEditor *editor, CamelTag *tags); - - /* signals */ -}; - - -GtkType message_tag_editor_get_type (void); - -/* methods */ -CamelTag *message_tag_editor_get_tag_list (MessageTagEditor *editor); -void message_tag_editor_set_tag_list (MessageTagEditor *editor, CamelTag *tags); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __MESSAGE_TAG_EDITOR_H__ */ diff --git a/mail/message-tag-followup.c b/mail/message-tag-followup.c deleted file mode 100644 index 6a2f62eaf6..0000000000 --- a/mail/message-tag-followup.c +++ /dev/null @@ -1,354 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Authors: Jeffrey Stedfast <fejj@ximian.com> - * - * Copyright 2002 Ximian, Inc. (www.ximian.com) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA. - * - */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <stdio.h> -#include <stdlib.h> -#include <string.h> - -#ifdef GTK_DISABLE_DEPRECATED -/* Gtk2's GtkCombo widget uses the deprecated GtkList widget, so - there's no way to use GtkCombo and still build if - GTK_DISABLE_DEPRECATED is defined. Yay Gtk! */ -#undef GTK_DISABLE_DEPRECATED -#include <gtk/gtkcombo.h> -#include <gtk/gtklist.h> -#define GTK_ENABLE_DEPRECATED -#endif /* GTK_DISABLE_DEPRECATED */ - -#include <glade/glade.h> - -#include <gconf/gconf.h> -#include <gconf/gconf-client.h> - -#include <libgnomeui/gnome-window-icon.h> -#include <libgnomeui/gnome-pixmap.h> - -#include "message-tag-followup.h" -#include "mail-config.h" - -static void message_tag_followup_class_init (MessageTagFollowUpClass *class); -static void message_tag_followup_init (MessageTagFollowUp *followup); -static void message_tag_followup_finalise (GObject *obj); - -static CamelTag *get_tag_list (MessageTagEditor *editor); -static void set_tag_list (MessageTagEditor *editor, CamelTag *tags); - - -#define DEFAULT_FLAG 2 /* Follow-Up */ -static char *available_flags[] = { - N_("Call"), - N_("Do Not Forward"), - N_("Follow-Up"), - N_("For Your Information"), - N_("Forward"), - N_("No Response Necessary"), - N_("Read"), - N_("Reply"), - N_("Reply to All"), - N_("Review"), -}; - -static int num_available_flags = sizeof (available_flags) / sizeof (available_flags[0]); - - -static MessageTagEditorClass *parent_class = NULL; - - -GType -message_tag_followup_get_type (void) -{ - static GType type = 0; - - if (!type) { - static const GTypeInfo info = { - sizeof (MessageTagFollowUpClass), - NULL, /* base_class_init */ - NULL, /* base_class_finalize */ - (GClassInitFunc) message_tag_followup_class_init, - NULL, /* class_finalize */ - NULL, /* class_data */ - sizeof (MessageTagFollowUp), - 0, - (GInstanceInitFunc) message_tag_followup_init, - }; - - type = g_type_register_static (message_tag_editor_get_type (), "MessageTagFollowUp", &info, 0); - } - - return type; -} - -static void -message_tag_followup_class_init (MessageTagFollowUpClass *klass) -{ - GObjectClass *object_class = G_OBJECT_CLASS (klass); - MessageTagEditorClass *editor_class = (MessageTagEditorClass *) klass; - - parent_class = g_type_class_ref (message_tag_editor_get_type ()); - - object_class->finalize = message_tag_followup_finalise; - - editor_class->get_tag_list = get_tag_list; - editor_class->set_tag_list = set_tag_list; -} - -static void -message_tag_followup_init (MessageTagFollowUp *editor) -{ - editor->combo = NULL; - editor->target_date = NULL; - editor->completed = NULL; - editor->clear = NULL; - editor->completed_date = 0; -} - - -static void -message_tag_followup_finalise (GObject *obj) -{ - MessageTagFollowUp *editor = (MessageTagFollowUp *) obj; - - editor->completed_date = 0; - - G_OBJECT_CLASS (parent_class)->finalize (obj); -} - - -static CamelTag * -get_tag_list (MessageTagEditor *editor) -{ - MessageTagFollowUp *followup = (MessageTagFollowUp *) editor; - CamelTag *tags = NULL; - time_t date; - char *text; - - camel_tag_set (&tags, "follow-up", gtk_entry_get_text (GTK_ENTRY (followup->combo->entry))); - - date = e_date_edit_get_time (followup->target_date); - if (date != (time_t) -1) { - text = camel_header_format_date (date, 0); - camel_tag_set (&tags, "due-by", text); - g_free (text); - } else { - camel_tag_set (&tags, "due-by", ""); - } - - if (gtk_toggle_button_get_active (followup->completed)) { - text = camel_header_format_date (followup->completed_date, 0); - camel_tag_set (&tags, "completed-on", text); - g_free (text); - } else { - camel_tag_set (&tags, "completed-on", ""); - } - - return tags; -} - -static void -set_tag_list (MessageTagEditor *editor, CamelTag *tags) -{ - MessageTagFollowUp *followup = (MessageTagFollowUp *) editor; - const char *text; - time_t date; - - text = camel_tag_get (&tags, "follow-up"); - if (text) - gtk_entry_set_text (GTK_ENTRY (followup->combo->entry), text); - - text = camel_tag_get (&tags, "due-by"); - if (text && *text) { - date = camel_header_decode_date (text, NULL); - e_date_edit_set_time (followup->target_date, date); - } else { - e_date_edit_set_time (followup->target_date, (time_t) -1); - } - - text = camel_tag_get (&tags, "completed-on"); - if (text && *text) { - date = camel_header_decode_date (text, NULL); - if (date != (time_t) 0) { - gtk_toggle_button_set_active (followup->completed, TRUE); - followup->completed_date = date; - } - } -} - -static void -clear_clicked (GtkButton *button, gpointer user_data) -{ - MessageTagFollowUp *followup = user_data; - - gtk_list_select_item (GTK_LIST (followup->combo->list), DEFAULT_FLAG); - - e_date_edit_set_time (followup->target_date, (time_t) -1); - gtk_toggle_button_set_active (followup->completed, FALSE); -} - -static void -completed_toggled (GtkToggleButton *button, gpointer user_data) -{ - MessageTagFollowUp *followup = user_data; - - if (gtk_toggle_button_get_active (followup->completed)) - followup->completed_date = time (NULL); - else - followup->completed_date = 0; -} - -static int -get_week_start_day (void) -{ - GConfClient *gconf; - - gconf = mail_config_get_gconf_client (); - return gconf_client_get_int (gconf, "/apps/evolution/calendar/display/week_start_day", NULL); -} - -static gboolean -locale_supports_12_hour_format (void) -{ - char s[16]; - time_t t = 0; - - strftime(s, sizeof s, "%p", gmtime (&t)); - return s[0] != '\0'; -} - -GtkWidget *target_date_new (const char *s1, const char *s2, int i1, int i2); - -GtkWidget * -target_date_new (const char *s1, const char *s2, int i1, int i2) -{ - gboolean time_24hour = TRUE; - GConfClient *gconf; - GtkWidget *widget; - int start; - - widget = e_date_edit_new (); - e_date_edit_set_show_date (E_DATE_EDIT (widget), TRUE); - e_date_edit_set_show_time (E_DATE_EDIT (widget), TRUE); - - /* Note that this is 0 (Sun) to 6 (Sat), conver to 0 (mon) to 6 (sun) */ - start = (get_week_start_day () + 6) % 7; - - if (locale_supports_12_hour_format ()) { - gconf = mail_config_get_gconf_client (); - time_24hour = gconf_client_get_bool (gconf, "/apps/evolution/calendar/display/use_24hour_format", NULL); - } - - e_date_edit_set_week_start_day (E_DATE_EDIT (widget), start); - e_date_edit_set_use_24_hour_format (E_DATE_EDIT (widget), time_24hour); - e_date_edit_set_allow_no_date_set (E_DATE_EDIT (widget), TRUE); - e_date_edit_set_time_popup_range (E_DATE_EDIT (widget), 0, 24); - - return widget; -} - -static void -construct (MessageTagEditor *editor) -{ - MessageTagFollowUp *followup = (MessageTagFollowUp *) editor; - GtkCellRenderer *renderer; - GtkListStore *model; - GtkWidget *widget; - GList *strings; - GladeXML *gui; - int i; - - gtk_window_set_title (GTK_WINDOW (editor), _("Flag to Follow Up")); - gnome_window_icon_set_from_file (GTK_WINDOW (editor), EVOLUTION_IMAGES "/flag-for-followup-16.png"); - gtk_container_set_border_width (GTK_CONTAINER (editor), 6); - - gui = glade_xml_new (EVOLUTION_GLADEDIR "/message-tags.glade", "followup_editor", NULL); - - widget = glade_xml_get_widget (gui, "toplevel"); - - /* reparent */ - gtk_widget_reparent (widget, GTK_DIALOG (editor)->vbox); - gtk_box_set_child_packing (GTK_BOX (GTK_DIALOG (editor)->vbox), widget, TRUE, TRUE, 6, GTK_PACK_START); - - widget = glade_xml_get_widget (gui, "pixmap"); - gtk_image_set_from_file ((GtkImage *)widget, EVOLUTION_GLADEDIR "/flag-for-followup-48.png"); - - followup->message_list = GTK_TREE_VIEW (glade_xml_get_widget (gui, "message_list")); - model = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_STRING); - gtk_tree_view_set_model (followup->message_list, (GtkTreeModel *) model); - - renderer = gtk_cell_renderer_text_new (); - gtk_tree_view_insert_column_with_attributes (followup->message_list, -1, _("From"), - renderer, "text", 0, NULL); - - renderer = gtk_cell_renderer_text_new (); - gtk_tree_view_insert_column_with_attributes (followup->message_list, -1, _("Subject"), - renderer, "text", 1, NULL); - - followup->combo = GTK_COMBO (glade_xml_get_widget (gui, "combo")); - gtk_combo_set_case_sensitive (followup->combo, FALSE); - strings = NULL; - for (i = 0; i < num_available_flags; i++) - strings = g_list_append (strings, (char *) _(available_flags[i])); - gtk_combo_set_popdown_strings (followup->combo, strings); - g_list_free (strings); - gtk_list_select_item (GTK_LIST (followup->combo->list), DEFAULT_FLAG); - - followup->target_date = E_DATE_EDIT (glade_xml_get_widget (gui, "target_date")); - /* glade bug, need to show this ourselves */ - gtk_widget_show ((GtkWidget *) followup->target_date); - e_date_edit_set_time (followup->target_date, (time_t) -1); - - followup->completed = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui, "completed")); - g_signal_connect (followup->completed, "toggled", G_CALLBACK (completed_toggled), followup); - - followup->clear = GTK_BUTTON (glade_xml_get_widget (gui, "clear")); - g_signal_connect (followup->clear, "clicked", G_CALLBACK (clear_clicked), followup); - - g_object_unref (gui); -} - -MessageTagEditor * -message_tag_followup_new (void) -{ - MessageTagEditor *editor; - - editor = (MessageTagEditor *) g_object_new (message_tag_followup_get_type (), NULL); - construct (editor); - - return editor; -} - -void -message_tag_followup_append_message (MessageTagFollowUp *editor, const char *from, const char *subject) -{ - GtkTreeIter iter; - GtkListStore *model; - - g_return_if_fail (IS_MESSAGE_TAG_FOLLOWUP (editor)); - - model = (GtkListStore *) gtk_tree_view_get_model (editor->message_list); - - gtk_list_store_append (model, &iter); - gtk_list_store_set (model, &iter, 0, from, 1, subject, -1); -} diff --git a/mail/message-tag-followup.h b/mail/message-tag-followup.h deleted file mode 100644 index c6a292c19e..0000000000 --- a/mail/message-tag-followup.h +++ /dev/null @@ -1,83 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Authors: Jeffrey Stedfast <fejj@ximian.com> - * - * Copyright 2002 Ximian, Inc. (www.ximian.com) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA. - * - */ - - -#ifndef __MESSAGE_TAG_FOLLOWUP_H__ -#define __MESSAGE_TAG_FOLLOWUP_H__ - -#include <gtk/gtk.h> -#include <mail/message-tag-editor.h> -#include <camel/camel-folder.h> -#include <camel/camel-folder-summary.h> -#include <widgets/misc/e-dateedit.h> -#include <time.h> - -#ifdef __cplusplus -extern "C" { -#pragma } -#endif /* __cplusplus */ - -#define MESSAGE_TAG_FOLLOWUP_TYPE (message_tag_followup_get_type ()) -#define MESSAGE_TAG_FOLLOWUP(obj) (G_TYPE_CHECK_INSTANCE_CAST (obj, MESSAGE_TAG_FOLLOWUP_TYPE, MessageTagFollowUp)) -#define MESSAGE_TAG_FOLLOWUP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST (klass, MESSAGE_TAG_FOLLOWUP_TYPE, MessageTagFollowUpClass)) -#define IS_MESSAGE_TAG_FOLLOWUP(obj) (G_TYPE_CHECK_INSTANCE_TYPE (obj, MESSAGE_TAG_FOLLOWUP_TYPE)) -#define IS_MESSAGE_TAG_FOLLOWUP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MESSAGE_TAG_FOLLOWUP_TYPE)) -#define MESSAGE_TAG_FOLLOWUP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MESSAGE_TAG_FOLLOWUP_TYPE, MessageTagFollowUpClass)) - -typedef struct _MessageTagFollowUp MessageTagFollowUp; -typedef struct _MessageTagFollowUpClass MessageTagFollowUpClass; - -struct _MessageTagFollowUp { - MessageTagEditor parent; - - GtkTreeView *message_list; - - GtkCombo *combo; - - EDateEdit *target_date; - GtkToggleButton *completed; - GtkButton *clear; - - time_t completed_date; -}; - -struct _MessageTagFollowUpClass { - MessageTagEditorClass parent_class; - - /* virtual methods */ - /* signals */ -}; - - -GtkType message_tag_followup_get_type (void); - -MessageTagEditor *message_tag_followup_new (void); - -void message_tag_followup_append_message (MessageTagFollowUp *editor, - const char *from, - const char *subject); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __MESSAGE_TAG_FOLLOWUP_H__ */ diff --git a/mail/message-tags.glade b/mail/message-tags.glade deleted file mode 100644 index 1b58fe297d..0000000000 --- a/mail/message-tags.glade +++ /dev/null @@ -1,335 +0,0 @@ -<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*--> -<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd"> - -<glade-interface> - -<widget class="GtkDialog" id="followup_editor"> - <property name="border_width">6</property> - <property name="title" translatable="yes">Flag to Follow Up</property> - <property name="type">GTK_WINDOW_TOPLEVEL</property> - <property name="window_position">GTK_WIN_POS_NONE</property> - <property name="modal">False</property> - <property name="resizable">True</property> - <property name="destroy_with_parent">False</property> - <property name="has_separator">True</property> - - <child internal-child="vbox"> - <widget class="GtkVBox" id="vbox2"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">3</property> - - <child internal-child="action_area"> - <widget class="GtkHButtonBox" id="hbuttonbox1"> - <property name="visible">True</property> - <property name="layout_style">GTK_BUTTONBOX_END</property> - - <child> - <widget class="GtkButton" id="button4"> - <property name="visible">True</property> - <property name="can_default">True</property> - <property name="can_focus">True</property> - <property name="label">gtk-ok</property> - <property name="use_stock">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="response_id">0</property> - </widget> - </child> - - <child> - <widget class="GtkButton" id="button5"> - <property name="visible">True</property> - <property name="can_default">True</property> - <property name="can_focus">True</property> - <property name="label">gtk-cancel</property> - <property name="use_stock">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="response_id">0</property> - </widget> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="pack_type">GTK_PACK_END</property> - </packing> - </child> - - <child> - <widget class="GtkVBox" id="toplevel"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">6</property> - - <child> - <widget class="GtkHBox" id="hbox2"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">6</property> - - <child> - <widget class="GtkImage" id="pixmap"> - <property name="visible">True</property> - <property name="pixbuf">flag-for-followup-48.png</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="lblDirections"> - <property name="visible">True</property> - <property name="label" translatable="yes">The messages you have selected for follow up are listed below. -Please select a follow up action from the "Flag" menu.</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkScrolledWindow" id="scrolledwindow1"> - <property name="visible">True</property> - <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property> - <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property> - <property name="shadow_type">GTK_SHADOW_IN</property> - <property name="window_placement">GTK_CORNER_TOP_LEFT</property> - - <child> - <widget class="GtkTreeView" id="message_list"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="headers_visible">True</property> - <property name="rules_hint">False</property> - <property name="reorderable">False</property> - <property name="enable_search">True</property> - </widget> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkTable" id="table2"> - <property name="visible">True</property> - <property name="n_rows">2</property> - <property name="n_columns">3</property> - <property name="homogeneous">False</property> - <property name="row_spacing">6</property> - <property name="column_spacing">6</property> - - <child> - <widget class="GtkLabel" id="label3"> - <property name="visible">True</property> - <property name="label" translatable="yes">_Flag:</property> - <property name="use_underline">True</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="mnemonic_widget">combo-entry</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label4"> - <property name="visible">True</property> - <property name="label" translatable="yes">_Due by:</property> - <property name="use_underline">True</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkButton" id="clear"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label">gtk-clear</property> - <property name="use_stock">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - </widget> - <packing> - <property name="left_attach">2</property> - <property name="right_attach">3</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkCheckButton" id="completed"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">C_ompleted</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="active">False</property> - <property name="inconsistent">False</property> - <property name="draw_indicator">True</property> - </widget> - <packing> - <property name="left_attach">2</property> - <property name="right_attach">3</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="Custom" id="target_date"> - <property name="visible">True</property> - <property name="creation_function">target_date_new</property> - <property name="int1">0</property> - <property name="int2">0</property> - <property name="last_modification_time">Sat, 09 Feb 2002 00:20:24 GMT</property> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="x_options">fill</property> - <property name="y_options">fill</property> - </packing> - </child> - - <child> - <widget class="GtkCombo" id="combo"> - <property name="visible">True</property> - <property name="value_in_list">False</property> - <property name="allow_empty">True</property> - <property name="case_sensitive">False</property> - <property name="enable_arrow_keys">True</property> - <property name="enable_arrows_always">False</property> - - <child internal-child="entry"> - <widget class="GtkEntry" id="combo-entry"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="editable">True</property> - <property name="visibility">True</property> - <property name="max_length">0</property> - <property name="text" translatable="yes"></property> - <property name="has_frame">True</property> - <property name="invisible_char" translatable="yes">*</property> - <property name="activates_default">False</property> - </widget> - </child> - - <child internal-child="list"> - <widget class="GtkList" id="convertwidget3"> - <property name="visible">True</property> - <property name="selection_mode">GTK_SELECTION_BROWSE</property> - - <child> - <widget class="GtkListItem" id="convertwidget4"> - <property name="visible">True</property> - - <child> - <widget class="GtkLabel" id="convertwidget5"> - <property name="visible">True</property> - <property name="label" translatable="yes"></property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - </child> - </widget> - </child> - </widget> - </child> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="y_options"></property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - </widget> - </child> -</widget> - -</glade-interface> diff --git a/mail/subscribe-dialog.glade b/mail/subscribe-dialog.glade deleted file mode 100644 index c38505df4d..0000000000 --- a/mail/subscribe-dialog.glade +++ /dev/null @@ -1,334 +0,0 @@ -<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*--> -<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd"> - -<glade-interface> - -<widget class="GtkWindow" id="subscribe_dialog"> - <property name="width_request">500</property> - <property name="height_request">400</property> - <property name="visible">True</property> - <property name="title" translatable="yes">Folder Subscriptions</property> - <property name="type">GTK_WINDOW_TOPLEVEL</property> - <property name="window_position">GTK_WIN_POS_NONE</property> - <property name="modal">False</property> - <property name="resizable">True</property> - <property name="destroy_with_parent">False</property> - - <child> - <widget class="GtkVBox" id="vbox1"> - <property name="border_width">12</property> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">6</property> - - <child> - <widget class="GtkHBox" id="hbox1"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">6</property> - - <child> - <widget class="GtkLabel" id="label1"> - <property name="visible">True</property> - <property name="label" translatable="yes">S_erver:</property> - <property name="use_underline">True</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="mnemonic_widget">store_menu</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkOptionMenu" id="store_menu"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="history">0</property> - - <child> - <widget class="GtkMenu" id="menu1"> - - <child> - <widget class="GtkMenuItem" id="no_imap_server_selected1"> - <property name="visible">True</property> - <property name="label" translatable="yes">None Selected</property> - <property name="use_underline">True</property> - <signal name="activate" handler="on_no_imap_server_selected1_activate" last_modification_time="Mon, 14 Apr 2003 17:08:20 GMT"/> - </widget> - </child> - </widget> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkProgressBar" id="progress_bar"> - <property name="visible">True</property> - <property name="orientation">GTK_PROGRESS_LEFT_TO_RIGHT</property> - <property name="fraction">0</property> - <property name="pulse_step">0.1</property> - <property name="text" translatable="yes"></property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="pack_type">GTK_PACK_END</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkHBox" id="tree_box"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">6</property> - - <child> - <widget class="GtkVButtonBox" id="vbuttonbox1"> - <property name="visible">True</property> - <property name="layout_style">GTK_BUTTONBOX_START</property> - <property name="spacing">6</property> - - <child> - <widget class="GtkButton" id="subscribe_button"> - <property name="visible">True</property> - <property name="can_default">True</property> - <property name="can_focus">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - - <child> - <widget class="GtkAlignment" id="alignment1"> - <property name="visible">True</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xscale">0</property> - <property name="yscale">0</property> - - <child> - <widget class="GtkHBox" id="hbox3"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">2</property> - - <child> - <widget class="GtkImage" id="image1"> - <property name="visible">True</property> - <property name="stock">gtk-add</property> - <property name="icon_size">4</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label2"> - <property name="visible">True</property> - <property name="label" translatable="yes">_Subscribe</property> - <property name="use_underline">True</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - </widget> - </child> - </widget> - </child> - </widget> - </child> - - <child> - <widget class="GtkButton" id="unsubscribe_button"> - <property name="visible">True</property> - <property name="can_default">True</property> - <property name="can_focus">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - - <child> - <widget class="GtkAlignment" id="alignment2"> - <property name="visible">True</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xscale">0</property> - <property name="yscale">0</property> - - <child> - <widget class="GtkHBox" id="hbox4"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">2</property> - - <child> - <widget class="GtkImage" id="image2"> - <property name="visible">True</property> - <property name="stock">gtk-remove</property> - <property name="icon_size">4</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label3"> - <property name="visible">True</property> - <property name="label" translatable="yes">_Unsubscribe</property> - <property name="use_underline">True</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - </widget> - </child> - </widget> - </child> - </widget> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="pack_type">GTK_PACK_END</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkHSeparator" id="hseparator1"> - <property name="visible">True</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkHBox" id="hbox5"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">0</property> - - <child> - <widget class="GtkHButtonBox" id="hbuttonbox2"> - <property name="visible">True</property> - <property name="layout_style">GTK_BUTTONBOX_DEFAULT_STYLE</property> - <property name="spacing">0</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkHButtonBox" id="hbuttonbox1"> - <property name="visible">True</property> - <property name="layout_style">GTK_BUTTONBOX_END</property> - <property name="spacing">12</property> - - <child> - <widget class="GtkButton" id="refresh_button"> - <property name="visible">True</property> - <property name="can_default">True</property> - <property name="can_focus">True</property> - <property name="label">gtk-refresh</property> - <property name="use_stock">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - </widget> - </child> - - <child> - <widget class="GtkButton" id="close_button"> - <property name="visible">True</property> - <property name="can_default">True</property> - <property name="can_focus">True</property> - <property name="label">gtk-close</property> - <property name="use_stock">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - </widget> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - </widget> - </child> -</widget> - -</glade-interface> |