* src/client/application/geary-controller.vala (GearyController): Replace
use of last_save_directory with new attachments_dir property on the
configuration object.
* src/client/dialogs/attachment-dialog.vala (AttachmentDialog): Replace
current_folder with use of last_save_directory with new attachments_dir
property on the configuration object. Add config object as ctor param
and object field, update call sites.
* src/client/conversation-viewer/conversation-email.vala
(ConversationEmail): Save config object as a class field, use that to
get and set the print directory when printing. Also set the default
print filename based on the email's subject.
* src/client/conversation-viewer/conversation-email.vala
(ConversationEmail::print): WebKit.PrintOperation.run_dialog will cause
the print job to be executed if the user selects OK, so no need to
manually do it ourself.
Bug 778033
* src/client/conversation-viewer/conversation-message.vala
(ConversationMessage::highlight_search_terms): Also check the subject
for matching items and highlight if found.
* src/client/conversation-viewer/conversation-list-box.vala
(ConversationListBox::EmailRow): Update matching row class to
disambiguate from matching headers.
* ui/geary.css: Ensure matching subject labels get highlighted.
* src/client/conversation-viewer/conversation-web-view.vala
(ConversationWebView): Add async ::highlight_search_terms with hacks to
make WK2 find API work a bit more like the WK1 API. Add
::unmark_search_terms method for consistency.
* src/client/conversation-viewer/conversation-list-box.vala
(ConversationListBox): Keep track of total number of search terms
found, so we can notify the viewer and update to deal with heasrch
highlighting now being async. Rename ::search_matches_found to
::search_matches_updated and add a count param, update call sites and
handlers.
* src/client/conversation-viewer/conversation-message.vala
(ConversationMessage): Use search term highlighting on
ConversationWebView rather than WebKit's API directly.
* src/client/conversation-viewer/conversation-viewer.vala
(ConversationViewer): Update find entry's primary icon to reflect
whether any matches were found.
* src/client/conversation-viewer/conversation-email.vala
(ConversationEmail): Rename ::message_view_iterator to just ::iterator,
update all call sites to use for-each loops rather than
Gee.Iterator::foreach closures.
* src/engine/api/geary-engine.vala (Engine::create_orphan_account): Fix
sense of test when determining the next account id to use. Add unit
tests.
(Engine::add_account): Made public so it can be used in public test.
* src/engine/api/geary-account-information.vala (AccountInformation):
Make main constrcutor public, pass in the id rather than divining it
from the config dir's name for both ctors. Update call sites.
* src/engine/api/geary-engine.vala (Engine): Also make the ctor public.
* src/client/accounts/add-edit-page.vala
(AddEditPage::get_account_information): Handle when the id is not null,
but the account has not yet been added to the engine, as is the case
when a new account has vailed validation and hence is an orphan.
See commit 67d2c80.
* src/client/composer/composer-widget.vala (ComposerWidget::load): Only
call restore_reply_to_state if there is a referred message *and* it is
actually a draft.
This does the following:
- Implements using conventional controls
(Up/Down/PageUp/PageDown/Home/End) to control the
conversation's vertical scrollbar.
- Uses Spacebar/Shift+Spacebar (but not backspace, since that's also
mapped to trash/delete) to advance the focus forward/back through
individual messages.
Bug 772748.
* src/client/conversation-viewer/conversation-list-box.vala
(ConversationListBox): Add action signals and keyboard bindings to
implement the scheme above. Remove the old hacky approach to making
the spacebar do something useful.
* src/client/conversation-viewer/conversation-web-view.vala
(ConversationWebView): Blacklist forwarding key press events for the
keys above, so the ConversationListBox bindings actually work.
Bug 778261.
* src/client/conversation-viewer/conversation-message.vala
(ConversationMessage): Add a new timeout for showing the progress bar,
1s after the first image is loaded.
Bug 778720.
* src/client/conversation-viewer/conversation-message.vala
(ConversationMessage::load_avatar): Don't pass thr load cancellable
through to soup, just check to see if the load has been cancelled
before attempting to set the icon.
* src/client/composer/composer-widget.vala (ComposerWidget::load): We
only need to call restore_reply_to_state when we are actually restoring
from a draft.
This restores some old behaviour after teh WK2 port.
* src/client/conversation-viewer/conversation-message.vala
(ConversationMessage): Add alt_text param to ::save_image
signal. Replace ::set_action_param_string with
::set_action_param_string so we can pass a (url, alt_text) tuple for
the save_image tuple and update call sites. Set this tuple for the
action when enabling it, and pass the two values to the ::save_image
signal handler when activated.
* src/engine/api/geary-attachment.vala (Attachment::get_safe_file_name):
Add alt_file_name param method, use that when constructing a file
name. Add doc comment, test.
* src/client/application/geary-controller.vala: Updated to pass alt text
from save_imge signal emission all thr way through to
get_safe_file_name.
This ensures both inline images are saved using the specified content
filename, if any, and that an extension is attempted to be guessed when
no filename is specified.
Fixes Bug 713999, Bug 712923, Bug 778026.
* src/client/application/geary-controller.vala: Major rework of how
attachments are saved. Rework how save dialogs are constructed,
combining common code paths into one constrcutor method. Split up code
for saving one attachment vs many into two different methods. Ensure
all code baths ultimately use the same method to do the actual
saving. Lookup a attachment when saving an inline image and use that
by default. Get filenames from new Attachment::get_useful_filename
method that guesses if needed.
* src/client/conversation-viewer/conversation-message.vala
(ConversationMessage::save_image): Fix name of first param to reflect
what it actually is.
* src/engine/api/geary-attachment.vala (Attachment): Add
::get_safe_filename method that checks the type of both the
attachment's content and its file name, if any. Will construct an
appropriate file name if non is given. Add unit tests.
* src/engine/api/geary-email.vala (Email): Add new
::get_attachment_by_content_id to lookup attachments by MIME
content-id. Rename old ::get_attachment method to disambiguate.
This could probably use a DB migration to set all attachments will "none"
as their filename to NULL, but that's a lot of trouble for little gain.
* src/client/conversation-viewer/conversation-email.vala (if): Remove
workaround for "none" attachment file names.
* src/client/conversation-viewer/conversation-message.vala
(ConversationMessage::inline_image_replacer): Handle translation for
null attachment file names here, rather than in the engine.
* src/engine/api/geary-email.vala
(Email::get_searchable_attachment_list): Don't bother appending file
names for attachments when they are null.
* src/engine/imap-db/imap-db-attachment.vala (Attachment): Use a const
for null file name replacement string so it can be used elsewhere.
* src/engine/imap-db/imap-db-folder.vala (Folder::do_list_attachments):
Clean up old "none" file names when loading from DB.
(Folder::do_save_attachments_db): Allow for file name being null.
* src/engine/rfc822/rfc822-message.vala (Message::InlinePartReplacer):
Allow file name to be null, update call sites.
* src/engine/rfc822/rfc822-utils.vala (get_clean_attachment_filename):
Don't attempt to translate null filenames, just return it null. Update
call sites.
* src/engine/api/geary-attachment.vala (Attachment): Allow direct access
to MIME content-disposition filename if available. Make it obvious that
the filename comes from content-disposition. Reorder attrs to reflect
importance. Update subclasses and call sites.
* src/client/accounts/account-dialog-add-edit-pane.vala
(AccountDialogAddEditPane): Pass an account id to edit_alternate_emails
signal, not an email addess.
* src/client/accounts/account-dialog.vala
(AccountDialog::get_account_info_for_email): Rename method to
"get_account_info" and param since it actually accepts an account
id. Update call sites.
* src/client/accounts/add-edit-page.vala (AddEditPage::id): Make RO
access public, so the AddEditPane can access it.
* src/client/conversation-list/conversation-list-view.vala
(ConversationListView): Convert to using IdleManager for handling
selection updating, reset it when widget is destroyed.
Should help/fix Bug 778025.
* ui/client-web-view.js (PageView::init): Also add a load handler to the
window, to (strangely) catch the final load event on the
document. Expand and correct comments a bit.
* src/client/composer/composer-web-view.vala
(ComposerWebView::load_html): Remove spacers around cursor, just add
them after body and inline quote if present. Update unit tests.
In some cases, it may happen that a mail is being sent multiple times simultaneously
to the same recipient.
The only modified field being the Message-ID, we have to check it as well as
message's size before merging 2 mails together.
Otherwise, at each start-up Geary will try to fetch "missing mails" but will never
succeed to do so.