Bug 772607.
* src/engine/rfc822/rfc822-utils.vala (Geary.RFC822.Utils): Don't
truncate the preview here - fetch preview will already be truncated,
and the conversation message preview needs the full text anyway. Update
unit tests.
* src/client/conversation-viewer/conversation-message.vala
(ConversationMessage::ConversationMessage): Since we need to know if
the preview has been truncated so we know if we need to add an elipsis
or not, get the full preview and tuncate it here if needed.
* src/engine/rfc822/rfc822-message.vala (Message): Don't bother trying to
set the preview when creating a Geary.Email from the message. Minor
code & doc cleanup.
* src/engine/api/geary-email.vala (Email): Double length of max fetch
preview so HTML parts might actually pick up some content. Tidy up doc
comments.
* src/engine/rfc822/rfc822-utils.vala (to_preview_text): Don't bother to
check for MIME Content-* headers now that we are only treating a part
as plain text if it is actually text/plain.
Bug 714317.
* src/engine/rfc822/rfc822-message-data.vala (PreviewText::with_header):
Check to see if the part is text/plain or text/html before generating a
preview for it.
Ensures that both appear the same to the user, and that the conversation
message preview gets the same armour and quote stripping that the fecth
preview does.
Added tests.
Bug 714317
* src/engine/rfc822/rfc822-utils.vala
(Geary.RFC822.Utils::to_preview_text): New common function to handle
generating a preview from a RFC 822 plain text or HTML string.
* src/engine/rfc822/rfc822-message-data.vala (PreviewText::with_header):
Move plain text armour and quote stripping to to_preview_text(), call
that to generate preview text.
* src/engine/rfc822/rfc822-message.vala (Message::get_preview): call
to_preview_text() to generate the preview text.
When generating the preview, only the first 128 bytes of the first MIME
part is fetched and used. If this part is text/html with a significant
amount of embedded CSS, then there is a good chance the string passed to
Geary.HTML::remove_html_tags() will be invalid, or be missing closing
elements. Since that function uses regexes that require balanced tags to
remove script and style blocks, then it was very possible that in these
cases this method will miss removing these blocks.
To solve this, remove_html_tags() is removed and its call sites are
replaced by calls to Geary.HTML::html_to_text(), which has been tidyied
up to produce more human-readable result.
Add unit tests to cover new html_to_text functionality and its call
sites.
* src/engine/util/util-html.vala: Remove remove_html_tags(). Update
html_to_text() to not just insert line breaks, but also insert spaces
and alt text, and ignore tags like HEAD, SCRIPT and STYLE, as
appropriate. Add an optional param to also allow skipping BLOCKQUOTE
elements, which we don't want in the preview.
* src/engine/rfc822/rfc822-utils.vala
(Geary.RFC822.Utils::create_utf8_filter_charset): Allow the given
charset to be null, empty or invalid, and if so use the default
specificed in RFC 2045. Update call sites to simply pass in given
charsets, rather than checking if they are empty, etc.
* src/engine/rfc822/rfc822.vala (Geary.RFC822): Define a const value for
UTF-8 encoding, using that instead of literals throughout the codebase.
Fixes Bug 770037.
* src/client/application/geary-controller.vala
(GearyController::close_composition_windows): Set from private to
internal so MainWindow can call it, add an arg to determine if all
composers should be closed, or only the one in the main window.
* src/client/components/main-window.vala (MainWindow::on_delete_event):
Close any main window composers before letting the window close.
* src/client/composer/composer-widget.vala (ComposerWidget::state): Don't
allow ny old code to set the composer's state.
* src/client/application/geary-application.vala
(GearyApplication::is_background_service): New property to provide
common way to determine if the app is a background service. Rework
other uses of the command line arg or setting to use this.
* src/client/application/geary-application.vala (GearyApplication):
Deprecate 'instance' and add 'engine' prop, clean up slightly.
* src/client/components/main-window.vala (MainWindow): Override
'application' property to return an instance of GearyApplication, use
that to replace use of global instance vars.
Since the Inbox is usually always open, and folders are only sync'ed if
they are closed, the Inbox would rarely, if ever, get sync'ed. As a
result, it would also never be prefetched.
* src/engine/imap-engine/imap-engine-account-synchronizer.vala
(AccountSynchronizer::send_all): Always sync a folder when it becomes
available, even if it is open, so on reconnect/etc, even the Inbox is
sync'ed.
(AccountSynchronizer::process_folder_async): If an error occurs, keep
note of whether the sync was due to the folder becoming available or
not when re-scheduling it.
* ui/conversation-viewer.ui,
src/client/conversation-viewer/conversation-viewer.vala: next-match and
previous-match signals are only available in GTK+ >= 3.16.
* ui/empty-placeholder.ui: Drop declared GTK+ requirement to 3.14.
* ui/geary.css: The :not() pseudeo class is only available in GTK+ >= 3.20.
* Use GtkTemplate to simplify layout.
* Prefix instance variables with this.
* Extract helper methods for clarity.
Signed-off-by: Niels De Graef <nielsdegraef@gmail.com>
This commit reverts Unity workaround removal (commit 7b37e26; bug
738899).
However, in contrast to 7b37e26, it does not:
* set clock format to the one used for Unity clock indicator
* Use global GearyApplication.instance variable
Additionally, it makes detach button displayed always on the right while
running in Unity.
* src/client/conversation-viewer/conversation-message.vala
(ConversationMessage::clean_html_markup): Check the image buffer
actually has some bytes before processing it.
* src/client/conversation-viewer/conversation-list-box.vala (EmailRow::expand):
Check to see if the message's web views report a valid height and queue
a resize if not, before expanding the row.
Bug 773054
* src/client/conversation-viewer/conversation-list-box.vala
(ConversationListBox::show_loading), ui/conversation-viewer.ui: Specify
a width and height request for the spinners, ensure they are centered.