Commit graph

97 commits

Author SHA1 Message Date
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
1454a3dc39 Add trivial amount of documentation comments. 2016-10-04 10:58:17 +11:00
Michael James Gratton
4044819476 Load the avatar cache on startup to ensure it is being loaded. 2016-10-04 10:58:17 +11:00
Michael James Gratton
aabfb1d6de Reenable displaying sender avatars using Gravatar.
Since we're no longer using the web view to display the user avatar, use
libsoup and add some additional infrastructure to support caching the
avatars. Also switches to HTTPS for accessing the Gravatar service.

* src/client/application/geary-application.vala
  (GearyApplication::get_user_cache_directory): New method to return the
  XDG cache directory for Geary.

* src/client/application/geary-controller.vala: Add both a Soup session
  and cache for fetching avatars. Write the cache to disk on controller
  close.

* src/client/conversation-viewer/conversation-email.vala
  (ConversationEmail::start_loading): Trigger avatar loads when loading
  the email.

* src/client/conversation-viewer/conversation-message.vala: Replace
  single avatar image widget with two, so the image does not need to be
  rescaled when expanded/collapsed.

* src/client/conversation-viewer/conversation-message.vala
  (ConversationMessage::load_avatar): Queue a request for a Gravatar
  avatar.
  (ConversationMessage::set_avatar): Load pixbuf returned by Gravatar,
  scale and set it for the preview and expanded avatar images.

* src/client/conversation-viewer/conversation-viewer.vala
  (ConversationViewer::clear): Cancel any outsanding avatar loads.

* src/client/util/util-gravatar.vala (Gravatar): Construct a HTTPS URL to
  avoid advertising to the NSA who we are receiving email from.

* ui/conversation-message.ui: Add the second avatar image.
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
Michael James Gratton
ea8a9c992c Reenable and update code for editing draft messages.
Use a Gtk.InfoBar for displaying the draft button.

* src/client/conversation-viewer/conversation-message.vala: Add draft
  infobar template child, edit_draft signal. Remove unused draft-related
  code.
  (ConversationMessage::ConversationMessage): Add new is_draft ctor
  param, when true show the draft infobar.
  (ConversationMessage::on_draft_response): New handler for when the edit
  draft button on the infobar is clicked.

* src/client/conversation-viewer/conversation-viewer.vala: Remove
  edit_draft signal, make a lame attemppt to work out if a message is a
  draft and pass that through to ConversationMessage.

* src/client/application/geary-controller.vala: Hook up on_edit_draft
  handler to added conversation messages.

* ui/conversation-message.ui: Added draft infobar.
2016-10-04 10:58:17 +11:00
Michael James Gratton
b5270e3740 Reenable and update code for displayed attachments.
* src/client/conversation-viewer/conversation-message.vala: Add template
  child widgets for displayed attachment UI, add signal for when user
  activates an attachment.
  (ConversationMessage::ConversationMessage): Ensure the attachment UI
  is visible when there are displayed attachments.
  (ConversationMessage::start_loading): New method for async loading of
  message content, use just for attachments for now.
  (ConversationMessage::on_attachments_view_activated): Handle activation
  signal for specific attachments.
  (ConversationMessage::load_attachments): Load attachments from the
  message into the new UI.
  (ConversationMessage::load_attachment_icon): Load icons for the
  attachments UI from the attachment itself if an image, else from the
  icon theme.

* src/client/application/geary-controller.vala: Hook up
  attachment_activated signal to conversation messages.

* src/client/conversation-viewer/conversation-viewer.vala
  (ConversationViewer::add_message): Ensure message loading starts after
  new conversation messages are added to the window hierarchy.

* ui/conversation-message.ui: Add an attachments box, with an icon view
  for displayed attachments.
2016-10-04 10:58:17 +11:00
Michael James Gratton
dc08a159b2 Don't require duplicating conversation message signals on the viewer.
Since we want GearyController to handle the effects of most user actions,
we've had to duplicate ConversationMessage's signals on
ConversationViewer and chain them down.

Instead, add a message_added & message_removed signal to
ConversationViewer and emit them as appropriate, then have
GearyController connect to those and manually manage hooking/unhooking
itself to ConversationMessage signals as instances are added/removed.

Do this to the link clicked signal to start.

* src/client/application/geary-controller.vala: Add on_message_added and
  on_message_removed handlers, connect them to the main window's
  ConversationViewer instance and added/remove the message's link click
  hander there.

* src/client/conversation-viewer/conversation-viewer.vala: Add
  message_added and message_removed signals, hook them up as messages are
  added and removed. Remove link_selected signal and plumbing.

* src/client/conversation-viewer/conversation-message.vala: Rename
  link_selected to link_activated to match GTK nomenclature better.
2016-10-04 10:58:17 +11:00
Michael James Gratton
69a53d9db9 Reenable and update code for embedded message composer.
The embedded composer is now added to the the conversation list
box. Still needs some work to fix focus and scrolling issues, also to
insert the composer in the right place in the list.

* src/client/components/main-window.vala (MainWindow::set_styling):
  Adjust theme CSS to make padding around embedded coposer not so
  terrible. Fix style for embedded headerbar.

* src/client/composer/composer-embed.vala: Don't attempt to up-manage
  it's parent's state, since the parent has a much better idea of how
  best to do that. Instead of passing in a ConversationViewer, just pass
  in a Gtk.ScrolledWindow that needs to be adjusted as the embededded
  editor and add some signals needed by the ConversationViewer. Reenabled
  some code needed to get scroll event passthrough working.

* src/client/conversation-viewer/conversation-viewer.vala: Remove old
  embedded composer code. Adjust conversation_listbox callbacks to handle
  the embedded composer being present.
  (ConversationViewer::get_selected_message): Fixed to actually return a
  message.
  (ConversationViewer::do_embedded_composer): New method to set up an
  embedded composer.

* src/client/application/geary-controller.vala
  (GearyController::create_compose_widget_async): Call new
  ConversationViewer::do_embedded_composer to let it set up a new
  embedded composer when needed.
2016-10-04 10:58:17 +11:00
Michael James Gratton
5184a38fe8 Reenable and update code for attached, full pane message composer.
Display attached+un-embedded composer as an additional ConversationViewer
stack page, although it realy should be broken as its own top-level
widget - there's already too much state in ConversationViewer.

* src/client/conversation-viewer/conversation-viewer.vala: Remove old
  composer boxes code. Add new ViewState enum, property and methods to
  define and manipulate the current view state - either conversation or
  composer.
  (do_conversation): New method to put the viewer in conversation mode.
  (do_compose): New method to put the viewer in compose mode, hook up the
  composer widget, and handle ConversationListView selection management
  for now.
  (on_folder_selected, on_conversation_count_changed,
  on_conversations_selected): Ensure these methods do the right thing
  depending on the viewer's current view state.
  (set_paned_composer): Replaced by ::do_compose, fixed call sites.
  (show_multiple_selected): Minor code clean up - moved down to a more
  appropriate location.

* src/client/composer/composer-box.vala (ComposerBox): Don't attempt to
  up-manage it's parent's state, since the parent has a much better idea
  of how best to do that. Likewise move code to manage previous
  ConversationList selection out, provide signal so the a more
  appropriate class can manage it instead.

* src/client/composer/composer-container.vala: Add some method comments.

* ui/conversation-viewer.ui: Add new page to the stack for the composer.
2016-10-04 10:58:17 +11:00
Michael James Gratton
b29d83e546 Convert ConversationViewer to a Stack with a ListBox, remove its WebView.
* src/client/conversation-viewer/conversation-viewer.vala: Convert to a
  GtkStack. Use a GTK template for constructing the UI. Remove WebView
  and any DOM-related code. Replace the enum DisplayMode and hence the
  HTML spinner and HTML user message with widgets in the stack. Remove
  all menus since they're all message specific and will need to be
  re-implemented for ConversationViewer. Comment out composer related
  code for the moment.

* src/client/application/geary-controller.vala
  (GearyController::conversations_selected): Make both conversations and
  current_folder arguments non-nullable, since it doesn't make any sense
  for there not to be any and simplifies handler impls.
  (GearyController::on_conversations_selected): Don't fire when there
  isn't a current folder.

* src/client/components/main-window.vala (MainWindow::set_styling): Add
  CSS theme code for the the conversation message list.
  (MainWindow::create_layout): Remove GtkFrame, just add the
  ConversationViewer instance directly.

* ui/conversation-viewer.ui: New GtkBuilder template for
  ConversationViewer, implemented as a GtkStack containing widgets for
  displaying the loading spinner, conversation as a GtkListBox, and label
  for user messages.

* ui/CMakeLists.txt, po/POTFILES.in: Added new UI files.
2016-10-04 10:58:17 +11:00
Michael James Gratton
6f66b6c566 Disable some code that will break when ConversationViewer loses it web_view. 2016-10-04 10:58:17 +11:00
Michael James Gratton
69d7e242ec Remove ActionAdaptor and related code, made redundant by 17f7ec2. 2016-09-25 18:12:24 +10:00
Michael James Gratton
17f7ec265e Replace application-scoped GtkAction with GActions.
* src/client/application/geary-application.vala (GearyApplication): Move
  action names, entries and callbacks from GearyController to here. Add a
  new mailto action that expects an argument, make compose just open a
  blank composer.

* src/client/application/geary-controller.vala (GearyController): Add
  ::compose() and ::compose_mailto() methods to support app actions.
2016-09-25 01:10:07 +10:00
Michael James Gratton
6b58da6b99 Fix delay showing composer for accounts with large numbers of messages.
* src/client/application/geary-controller.vala
  (GearyController::create_compose_widget_async): Load draft manager and
  email entry completion model asynchronously after the UI has been made
  visible.

* src/client/composer/composer-widget.vala (ComposerWidget): Rename
  set_entry_completions to load_entry_completions, make loading
  async. Make open_draft_manager_async and load_entry_completions public
  so they can be invoked by the controller.

* src/client/composer/contact-list-store.vala (ContactListStore): Load
  contacts asynchronously in smaller batches, so the UI
  remains responsive.
2016-09-23 23:58:38 +10:00
Niels De Graef
ebd788968b Use GLib.Actions in the composer. Bug 770356.
Now using these instead of the old composer's actions. This led to quite
some changes:

* Use GLib.ActionEntry instead of Gtk.ActionEntry in
  composer-widget.vala
* Action names can now be specified in the UI files.
* Use templates for the ComposerHeaderBar. Remove
  Pillbar as superclass, since that was no longer necessary.
* Merge ComposerToolbar into ComposerWidget.
* Since actions can now be parameterized, some methods could be
  merged (e.g. font size methods).
* The menu button in the composer now automatically uses a popover.
* Some methods and classes really deserved more comments.
* necessary POTFILES.in changes

Signed-off-by: Niels De Graef <nielsdegraef@gmail.com>
2016-09-21 15:02:18 +10:00
Michael James Gratton
295a14243c Convert from using AccountInformation.email to an id - client changes.
* src/engine/api/geary-account-information.vala (AccountInformation):
  Add a display_name property, use that in the client wherever a unique
  name for an account has to be shown to the user. Update all other cases
  to use `id` or `primary_mailbox`.

* src/client/accounts/add-edit-page.vala: Add id property, use that when
  determining if an account is new or is being edited.

* src/client/accounts/account-dialog-account-list-pane.vala
  (AccountDialogAccountListPane): Add the account's id to the list model,
  use that instead of the email address as the primary key.
2016-07-19 17:28:24 +10:00
Michael James Gratton
a81cc78bb0 Fix some build issues arising from user config/data dir split. Bug 741883. 2016-07-12 15:55:27 +10:00
Oskar Viljasaar
b3b2d58c76 Add a helper function to copy over configuration and use it. Bug 741883
The function is called just before the engine gets started, so
hopefully just before any files are read by Geary.
2016-07-12 15:45:11 +10:00
Oskar Viljasaar
f80f52fbe6 Use built-in GTK signals for the search bar
- Make use of the "search-changed" signal to handle user input, this
lets us get rid of the built-in timeout mechanism. This reduces the
timeout from 250ms to 150ms after user input before doing the search
though.

- Use the "activate" and "stop-search" signals for the entry. This
lets us remove our handling of key events.

https://bugzilla.gnome.org/show_bug.cgi?id=720993
2016-07-05 01:08:08 +10:00
Michael James Gratton
f8acc74eaa Make all account types support archiving. Bug 766912.
Move Geary.FolderSupport.Archive interface and implementation from
OtherFolder to GenericFolder, so both Y! and Outlook services get archive
support.

* src/client/components/main-toolbar.vala
  (MainToolbar::update_trash_button): Renamed from
  update_trash_archive_buttons, only bother to update the archive
  state. Update call sites.

* src/engine/api/geary-account.vala (Geary.Account): Remove
  can_support_archive property and constructor arg, update subclasses to
  not pass it through.

* src/engine/imap-engine/imap-engine-generic-folder.vala (GenericFolder):
  Extend Geary.FolderSupport.Archive, copy implementation from
  OtherFolder.

* src/engine/imap-engine/other/imap-engine-other-folder.vala
  (OtherFolder): Remove Geary.FolderSupport.Archive parent class and
  implementation.
2016-06-05 18:42:10 +10:00
Michael James Gratton
10362b5a64 Tidy up main window accelerator setup.
* src/client/application/geary-controller.vala
  (GearyController::create_actions): Remove uneeded calls to
  add_accelerator - just remove them for dups ot move them to the action
  definition. Ensure they are defined in accelerators.ui so they are
  bound to their accelerators regarcdless of having a visible proxy.
2016-05-30 09:37:12 +10:00
Michael James Gratton
c86af16ecf Remove some more artifacts from the old gear menu. Bug 759980. 2016-05-30 00:18:24 +10:00
Michael James Gratton
66928f73f6 Enable L/M keyboard shortcut for label/moving messages. Fixes Bug 731737.
* help/C/shortcuts.page: Document new shortcuts.

* src/client/application/geary-controller.vala: Add shortcuts for copy
  and move actions.

* src/client/components/pill-toolbar.vala (PillBar::create_menu_button):
  Hook up the button's related action to invoke the button's popup menu,
  taking care not to cause an infinte loop.
  (PillBar::setup_button): Connect to the related_action's tooltip notify
  signal via a local variable rather than via the button, so it does not
  get lost when it changes for Gtk.MenuButton actions.
2016-05-29 23:25:49 +10:00
Michael James Gratton
54ba285ab8 Clean up shortcuts and shortcut docs. Closes Bug 766987.
* src/client/application/geary-controller.vala: Remove prefs and accounts
  shortcuts.

* ui/app_menu.interface: Remove prefs and accounts shortcuts

* help/C/shortcuts.page: Capitalise J/K, remove prefs and accounts
  shortcuts.
2016-05-29 22:24:19 +10:00
Michael James Gratton
18755f6d7a Fix app & desktop becoming unresponsive when clicking the gear menu.
When the shell is not showing the app menu, we are adding a gear menu and
using that for the app menu to work around an issue in Mint Cinnamon
always showing a menu bar when an app menu was present. However under
gnome-shell, this causes both Geary and gnome-shell to both start fully
consuming the CPU when the gear menu was activated.

Perhaps GtkApplication{Window} was notifying or querying shell about the
state of the actions since they are in the in the "app" namespace, but
shell not knowing or caring about them was returning an error, causing
Geary to retry?

Removing the gear menu and letting GTK+ add its own app menu to the
header when shell is not showing it fixes the issue.

We could load the app_menu actions into the "win" namespace, but that
would require adding yet more workarounds (at least a duplicate
app_menu.ui file or something else similary sucky) for someone else's bug
and for users that will never see or need the fix.

Bug 759980.

* src/client/application/geary-controller.vala: Always set the
  application's app_menu.

* src/client/components/main-toolbar.vala,
  src/client/composer/composer-headerbar.vala: Remove gear menu.

* src/client/components/main-window.vala: Set show-menubar to false
  so we either get the shell managed app-menu or GTK managed one
  in the header bar.
2016-05-18 19:49:24 +10:00
Michael James Gratton
56dedd7db7 Ensure main window contents are shown when presented from application.
Bug 763961.

* src/client/application/geary-application.vala
  (GearyApplication::present): Always call show_all on the main window
  since if started hidden, it won't have had that called on it.

* src/client/application/geary-controller.vala:
  (GearyController::on_indicator_activated_application,
   GearyController::on_indicator_activated_composer,
   GearyController::on_indicator_activated_inbox): Always call show_all
  on the main window since if started hidden, it won't have had that
  called on it.
2016-05-09 09:31:38 -04:00
Adam Dingle
654e513f9c Transfer Yorba copyrights to Software Freedom Conservancy 2016-05-06 08:33:37 -04:00
Michael James Gratton
8f00a51b13 Replace Yorba links with GNOME links, remove donate menu, update dpkg blurb.
Thanks for all the fish, Yorba.

Bug 765656.
2016-05-05 07:49:27 -04:00
Michael James Gratton
d33e3e7229 Simplify icon handling a bit.
When implementing bug 765359, it appears that Geary is doing too much
work to load icons. Simplify it a bit.

* src/client/components/icon-factory.vala (IconFactory): Don't bother
  loading an application icon, it's easier and works better to just use
  an icon name where needed. Don't bother adding all of the icons/*x*
  directories to the icon theme search path, just make the icon's
  directory hierarchy follow the XDG/hicolor spec and add the base
  directory. Remove now-redundant code.

* src/client/application/geary-controller.vala: Set the default icon name
  for all geary windows.
  (GearyController:on_about()): Set the name for the icon in the About
  dialog.

* src/client/components/main-window.vala (ApplicationWindow): Don't
  bother loading icons for the window, just use the new default.

* src/client/notification/libnotify.vala: Don't bother passing the
  application icon through for error notifications, an icon name has
  already been set.

* icons/*x*/geary.png: Move to a new directory hierarchy that follows the
  hicolor spec.

* icons/CMakeLists.txt: Updated to use new paths to the icons.
2016-04-28 14:22:21 -04:00
Michael James Gratton
fe928afbdc Load UI resources as GResources, not from the file system. 2016-04-09 17:30:29 -04:00
Robert Schroll
98be06db89 Avoid critical errors when creating multiple application menus
First, create a composer action corresponding to the app menu, instead
of reusing the one from the controller.  Second, create the menu from a
MenuModel, instead of from a UIManager, so we can have many of them.

https://bugzilla.gnome.org/show_bug.cgi?id=746504
2015-03-20 18:50:31 -04:00
Robert Schroll
32740bb151 Add label for DELETE_MESSAGE, for conversation list context menu
https://bugzilla.gnome.org/show_bug.cgi?id=746406
2015-03-18 16:34:29 -04:00
Jim Nelson
bee2cfd796 Disconnect from UI/Engine signals when closing app
This prevents a lot of extraneous (and often erroring) operations
when Geary closes, particularly due to the conversation and folder
list selections changing as items are removed.
2015-03-13 15:38:27 -07:00
Robert Schroll
5162914697 Move search entry out of header bar and into dedicated search bar 2015-03-11 18:15:30 -04:00
Robert Schroll
f33b0bd956 Split main toolbar into two halves
https://bugzilla.gnome.org/show_bug.cgi?id=743960
2015-03-11 18:15:30 -04:00
Timo Kluck
f46f0d92aa Shortcut keys for nav to next/previous conversation: Bug #714434 2015-03-05 17:23:04 -08:00
Jim Nelson
7494fa57d2 Additional debug logging at app shutdown for bug #745561
Hopefully these messages will give us some idea where in the shutdown
code the application sometimes hangs.
2015-03-05 15:55:05 -08:00
Jim Nelson
329b1350a9 Capitalize Trash in tooltip as it is cap'd elsewhere 2015-02-12 18:00:08 -08:00
Jim Nelson
29448cab65 Update copyright to 2015 2015-02-06 12:43:33 -08:00
Jim Nelson
354e2edbf8 Undo Archive/Trash/Move: Bug #721828
For now, the undo stack is 1-deep with no redo facility, which mimics
Gmail's facility.  We can consider later offering a more involved
undo stack, but would like to try this out for now and work out the
kinks before becoming more aggressive.
2015-02-05 17:57:27 -08:00
Jim Nelson
e526528543 Improved sorting and Gtk.ListStore manipulations & lookup: Bug #713190
Although this doesn't solve the problems described in the bug, there
was some perceived improvement in reducing the occurrence.  These
changes also clean up the code, being verbose about distinguishing
between sorting by sent date (i.e. the Date: header field) and
received date (i.e. in EmailProperties, i.e. IMAP's INTERNALDATE).
There was one comparator that did not have a proper stabilizer; that's
fixed here as well.
2015-02-02 17:40:31 -08:00
Robert Schroll
787e92e731 Host new composers in ComposerBox, not in ComposerEmbed
This allows us to avoid messing with the state of the conversation
viewer when we're composing a new message.  Instead, we hide it
completely and show only the ComposerBox.

The styling of paned composer is changed to resemble that of the inline
composers. Because of restrictions on what styles are available for
various widgets, the ComposerBox becomes a Gtk.Frame, and its border
simulates the margin while some padding and an inset shadow simulate the
border. I haven't figured out how to do an outset box-shadow.

https://bugzilla.gnome.org/show_bug.cgi?id=743670
2015-02-02 16:38:28 -05:00
Jim Nelson
d4cc681e91 Retry commands properly if connection lost: Bug #714540
If a command fails due to a hard error (connection dropped, network
loss, etc.), the command is preserved in the in-memory Folder queue
and retried when the connection is reestablished.  This makes Geary
more robust and resistant to simple errors due to connection loss,
i.e. archiving a message and having it return later because the
archive command was dropped and, when the connection reestablished,
the message "reappears" because it's still on the server.

Note that this is *not* offline mode or a replacement for it, merely
a way to make Geary more robust when a user's connection is flaky.
2015-01-26 17:07:10 -08:00
Jim Nelson
ed5914e468 Improved connection reestablishment for IMAP folders: Bug #713972
This patch drastically improves network connection handling and
reestablishment.  In particular, the ImapEngine.Folder's open_count
wasn't always properly maintained (in the engine and the client)
causing connection reestablishment issues.  Also, prior code attempted
to deduce when to reestablish a connection based on the type of Error
encountered.  Now, as long as the Folder's open_count is greater than
zero, reestablishment will be attempted (with a back-off algorithm and
special cases in the ClientSessionManager preventing continual login,
i.e. when credentials are bad).

ClientSessionManager also has a back-off algorithm when it's adjusting
its session pool and uses the NetworkMonitor to detect when the host
is simply unavailable due to the network being unavailable (to prevent
continuous retries).

In addition to the above bug, this patch solves the following tickets:
  Bug #714595
  Bug #725959
  Bug #712960
2015-01-22 17:11:39 -08:00
Robert Schroll
09582736b8 Properly restore state of drafts
We do this heuristically, by noting which messages it is in reply to and
seeing if it matches the unmodified reply or reply all states.  This
isn't perfect; notably forwarded messages are picked up.

We hide the existing draft in the conversation viewer as soon as we open
the composer.  We also ensure that future versions of this draft will
also be hidden.  The list of emails to be hidden is cleared when the
conversation viewer is, so we query all open composers at this point to
see which email ids should be hidden.

https://bugzilla.gnome.org/show_bug.cgi?id=743067
2015-01-16 16:39:19 -08:00
Robert Schroll
2d1d2ed31c Allow quotes from multiple messages in a single reply
When replying to a message, we use the existing inline composer if it
already references the message we're replying to, or if we're replying
with a quote.  Replies without quotes get made into new composers.

When adding a new message as a reply in a composer, we add the relevant
addresses to the to and cc lines, based on the current reply type.  We
remove duplicates, and don't include any to addresses as cc.  We also
keep track of a total to and total cc list, which gets swapped in if a
reply action is to change the reply type.

We keep track of all the replied-to message ids and include all of them
in the In-Reply-To header.  However, the References header only includes
message ids from the first message replied to.  This is because RFC 2822
requires this header to represent a single lineage, which we cannot
guarantee if we're replying to different branches of the conversation.
2015-01-14 13:18:21 -08:00
Robert Schroll
4b644cc4bd Allow only a single inline composer at a time
Also, set the detached state after creating the window to get the
toolbar in the correct state.
2015-01-14 13:18:21 -08:00
Jim Nelson
09a15914da Update Archive/Trash/Delete/Empty buttons on toolbar: Bug #742686
With the Empty button now attached to Archive/Trash/Delete, it's now
less lopsided for only Archive to have a label.  This removes the
label from Trash/Delete (which also makes it more innocuous when the
user presses Shift a lot, i.e. while editing in the inline composer),
which in turns simplifies building the main toolbar.
2015-01-13 14:42:34 -08:00