Commit graph

22 commits

Author SHA1 Message Date
Michael Gratton
f4d3c54110 ui: Remove can_focus from GTK builder file definitions
GTK widgets set the default for this as needed, and some incorrect
values for this have caused issues with keyboard focus.

Fixes #1059
2021-01-27 21:43:23 +11:00
Michael Gratton
28e6b669f6 ConversationMessage: Convert to use InfoBarStack
Remove stock infobars from ConversationEmail and ConversationMessage
builder files. Use common ComponentsInfobar for remote image loading
infobar. Use Components.InfoBarStack in ConversationMessage for plugin
support.
2020-03-30 21:05:00 +11:00
Michael Gratton
5cc92ef964 Move email action handling to ConversationListBox
This allows a single widget to get constructed to handle email actions,
rather than every single ConversationEmail having to do so, and thus
related signals can also be moved to and emitted from
ConversationListBox, so that MainWindow only has to hook up to a single
object's signals for a conversation, not every email in the
conversation.
2019-11-07 11:58:55 +11:00
Michael Gratton
de6ef699de Clean up attachment save code
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.
2019-11-07 11:58:55 +11:00
Tobias Bernard
de5df79184 ui: change conversation menu icon to view-more 2019-04-18 13:51:44 +02:00
Alex Henrie
5e55587e6d Remove nonfunctional "Try Again" button for saving sent emails. Bug 727679. 2017-10-26 18:03:56 +11:00
Michael James Gratton
6171ff2ebd Fix attachments UI not ever being displayed.
* 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.
2017-02-01 00:41:43 +11:00
Michael James Gratton
bc4c1e1579 Add translator notes about the conversation email star/unstar buttons. 2016-12-14 11:49:55 +11:00
Michael James Gratton
0a164cecda Add missing word to UI label in conversation-email.ui. Bug 772951. 2016-10-15 12:05:30 +11:00
Michael James Gratton
4e6d072b9b Don't show info bars on show all. 2016-10-04 10:58:17 +11:00
Michael James Gratton
9c813eaacb Replace Gtk.IconView with FlowBox for displaying email attachments. 2016-10-04 10:58:17 +11:00
Michael James Gratton
b03c0add14 Convert new convo widgets to use Gtk.Grid instead of Box. 2016-10-04 10:58:17 +11:00
Michael James Gratton
640e8fdbc6 Workaround wide convo InfoBars being too wide for small screens.
* ui/conversation-email.ui, ui/conversation-message.ui: Ellipsie labels
  on InfoBars so they can shrink.
2016-10-04 10:58:17 +11:00
Michael James Gratton
648e726c86 Ensure header buttons are not sensitive when convo email is collapsed. 2016-10-04 10:58:17 +11:00
Michael James Gratton
dcc5f42eea Tidy up conversation list style. 2016-10-04 10:58:17 +11:00
Michael James Gratton
4daf4bdcd5 Chase ConversationEmail action namespace change in its main UI file. 2016-10-04 10:58:17 +11:00
Michael James Gratton
338fe6c3b3 Convert ConversationEmail's attachment icon into a button.
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.
2016-10-04 10:58:17 +11:00
Michael James Gratton
be31b33731 Re-enable attachments context menu.
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.
2016-10-04 10:58:17 +11:00
Michael James Gratton
19456bd58e Re-enable email menu actions and message star/unstar.
* 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.
2016-10-04 10:58:17 +11:00
Michael James Gratton
1af11b09b4 Reenable displaying the "sent but not saved" message.
* 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.
2016-10-04 10:58:17 +11:00
Michael James Gratton
ad035f799c Allow ConversationEmail to manage its infobars indep. of ConversationMessage.
* 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.
2016-10-04 10:58:17 +11:00
Michael James Gratton
ec22b33825 Reenable displaying sub-messages.
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.
2016-10-04 10:58:17 +11:00