Create new Application.AttachmentManager class and move code for saving
attachments there from both Application.Controller and MainWindow since
aside from needing the latter for dialogs it is independent of both.
Create new Components.AttachmentPane widget for diplaying attachents
for an email in the ConversationViewer.
Update ConversationEmail and ConversationMessage to use these two new
classes directly, rather than implementing save management itself or
requiring the MainWindow to wire up signals on these classes.
* src/client/components/client-web-view.vala (ClientWebView): Make
has_valid_height a GObject property so we can get notified about it
changing.
* src/client/conversation-viewer/conversation-email.vala
(ConversationEmail::connect_message_view_signals): Fixed to listen to
has-valid-height changing rather than the old WK1 load-status property.
* ui/conversation-message.ui: Set body_container orientation to vertical
so adding the attachments widget works as expected.
Since both the star and email menu button are both buttons, the
attachments icon should be as as well. Replace the Save Attachments menu
item with this button.
* src/client/conversation-viewer/conversation-email.vala: Convert
attachment_icon to attachment_button. Update call sites.
* ui/conversation-email.ui: Replace attachments icon with button.
* ui/conversation-message-menu.ui: Remove Save Attachments item.
Since we're using the Icon View, we have some more options in terms of
user selction and the actions applicable to that. So make the attachment
signals and their handlers all apply to collections of attachments and
use the GAppInfo class for determining which app to open an attachment
with.
* src/client/application/geary-controller.vala: Chase signal changes.
(GearyController::on_attachments_activated): Handle multiple
attachments being activated at once. Use its GAppInfo for launching
each attachment, prompt the user with an GtkAppChooserDialog if the
info is unknown.
* src/client/conversation-viewer/conversation-email.vala Use the new
AttachmentInfo class to manage lists of all displayed and currently
selected attachments and their associated GAppInfo objects. Add actions
for attachment context menu items. Move attachment signals from
ConversationViewer here, make all attachment signals have a collection
of them as their param. Hook up appropriate GtkIconView callbacks to
manage selection, activation, etc. Construct AttachmentInfo instances
when loading attachments and use them in the icon view's model.
* ui/conversation-email.ui: Define needed callbacks for the icon
view. Update its model to accept a GObject for the attachment info
class.
* ui/conversation-message-menu.ui: Fix action name for save attachments
menu item.
* src/client/application/geary-controller.vala: Chase signal changes.
(GearyController::on_view_source): Moved view source code here from the
conversation viewer.
* src/client/conversation-viewer/conversation-email.vala: Add an action
group for the email for email-specific actions with the prefix
"msg". Add actions each of the items in the email menu. Move
email-specific signals here from ConversationViewer. Update actions
based on message state as needed.
* src/client/conversation-viewer/conversation-viewer.vala: Add signal
handlers for ConversationEmail's email flagging signals and forward
them on to the `mark_emails` signal, since we also want to batch up
email flag changes from here.
* ui/conversation-email.ui: Fix star/unstar action names.
* ui/conversation-message-menu.ui: Cromulify the email menu name.
* src/client/conversation-viewer/conversation-email.vala
(ConversationEmail::not_saved_infobar): Add a template widget child for
the not-saved info bar, add to ConversationMessage's infobar box and
display it when the flag is set.
* ui/conversation-email.ui: Add a warning info bar for displaying the
message.
* src/client/conversation-viewer/conversation-email.vala: Move the
draft_infobar wdiget from ConversationMessage, when the message is a
draft add it to ConversationMessage's infobar box and show it.
* ui/conversation-email.ui: Move the draft_infobar definition from
conversation-message.ui here.
* ui/conversation-message.ui: Wrap the remote messages infobar in an box
so that ConversationEmail can easily append its own in the same location.
Geary currently displays RFC 822 attachments inline, below the email's
primary message body, using the same HTML chrome for the headers and
email body as for the primary body. Taking the same approach but using
GTK+ widgets meant splitting ConversationMessage up into a
ConversationEmail class that manages the UI for displaying an email in
its entirety, and a ConversationMessage to manage the only header widgets
and webview for displaying an individual RFC 822 message, usable for both
the primary body and any sub-messages. Thus, this is a big change.
One behavioural change is that each sub-message with remote images now
requires individual approval, rather than being dependant on the
containing message's sender and/or approval. This prevents some attacks
e.g. a trusted sender forwarding a spam/malware message, but does not
prevent it if the message is forwarded inline, obviosuly.
* src/client/conversation-viewer/conversation-email.vala (ConversationEmail):
New class for managing the UI for an overall email message. This
replaces the old ConversationMessage and contains much of it's code and
widgets - anything from that class which does not directly support
displaying headers or a message body.
* src/client/conversation-viewer/conversation-message.vala:
(ConversationMessage): Same class as before, but now with its scope
narrowed to only display message headers and body. The draft infobar
remains here rather than being put ConversationEmail where it belongs
since it's bit of a pain to insert in the right place and doesn't
really hurt.
(::email): Moved this property and any code that depends on it to
ConversationEmail.
(::always_load_remote_images): New property passed in via the ctor,
allowing one dependency on the old ::email property to be removed.
(::inlined_content_ids): Moved to ConversationEmail, since that is the
class that keeps track of attachments to display. Add the signal
attachment_displayed_inline to allow ConversationEmail to be notified
of inlined attachments instead.
(::flag_remote_images, ::remember_remote_images): New signals to notify
ConversationEmail that the user has flagged this message or the
message's sender for loading remote images. This is passed through
since in the former's case we may need to set flags on the email
itself, the latter because it is one less use of the contact_store
property, which should be removed from this class at some point.
* src/client/conversation-viewer/conversation-viewer.vala: Chase API
changes from the above. In general, replace use of the term "message"
with "email" since this class is now mostly dealing with
ConversationEmail instances, rather than ConversationMessage instances.
(ConversationViewer::check_mark_read): Only consider the
ConversationEmail's primary message body when checking for visibility
rather than that and any submessages to keep things simple.
(ConversationViewer::show_message, ::hide_message): Renamed to
expand_email/collapse_email respectively since we don't ever actually
hide it. Carry that change on to same methods on ConversationEmail.
* src/engine/rfc822/rfc822-message.vala (Geary.RFC822.Message): Add
get_primary_originator(), almost vermatim from Geary.Email, to support
determining the sender for remembering remote message loading for
senders of sub-emails.
* src/client/components/main-window.vala (MainWindow::set_styling): Fix
background transition for collapsed emails.
* src/client/application/geary-controller.vala: Chase API name changes.
* src/CMakeLists.txt: Include new ConversationEmail source file.
* ui/conversation-email.ui: New UI for ConversationEmail, move the email
action box, attachments box amd sub-messages box here from
conversation-message.ui.
* ui/CMakeLists.txt: Include new UI in compiled resources.
* po/POTFILES.in: Add new UI for transation.