Commit graph

5845 commits

Author SHA1 Message Date
Michael Gratton
4a469d7898 po/POTFILES.in: Add missing lines for email templates files 2020-04-23 14:11:55 +10:00
Michael Gratton
ee3f3c9930 Merge branch 'mjog/folder-order' into 'mainline'
FolderList.AccountBranch: Fix ordering of special-use folders

See merge request GNOME/geary!501
2020-04-23 02:02:51 +00:00
Michael Gratton
11754cb63b Merge branch 'mjog/phantom-parent-folders' into 'mainline'
Geary.ImapEngine.GenericAccount: Fix duplicate folders on first load

See merge request GNOME/geary!500
2020-04-23 01:59:36 +00:00
Michael Gratton
9e0acad23d FolderList.AccountBranch: Fix ordering of special-use folders
Don't rely on the special-use enum ordinal, there's no reason to
expect the engine lists uses in an order people would file helpful.
2020-04-23 11:45:11 +10:00
Michael Gratton
df2bce4eb8 Geary.ImapEngine.GenericAccount: Fix duplicate folders on first load
When loading an account for the first time, folders may not be processed
such that parents are handled first, leading to phantom folders created
for them.

This is particularly noticeable for GMail accounts, where the `[GMail]`
folder would typically show up, since it was created twice.
2020-04-23 11:17:01 +10:00
Michael Gratton
ab9d83987a Merge branch 'mjog/gmail-all-mail-missing' into 'mainline'
Geary.Imap.MailboxAttributes: Fix missing SPECIAL-USE \All case

See merge request GNOME/geary!499
2020-04-23 01:14:45 +00:00
Michael Gratton
779d1906d8 Merge branch 'fix/missing_itstool_dependecy' into 'mainline'
INSTALL: add missing itstool dependency for Fedora

See merge request GNOME/geary!498
2020-04-23 00:48:35 +00:00
Michael Gratton
e94ce67605 Geary.Imap.MailboxAttributes: Fix missing SPECIAL-USE \All case
This was causing GMail's All Mail folder to not show up as a special-use
folder.
2020-04-23 10:41:09 +10:00
Michael Gratton
9e0ae0eb8d Merge branch 'mjog/email-templates' into 'mainline'
Email templates plugin

Closes #803

See merge request GNOME/geary!497
2020-04-23 00:38:04 +00:00
Michael Gratton
1986633351 Plugin.EmailTemplate: Create templates folder if it does not exist 2020-04-23 09:35:19 +10:00
Michael Gratton
1b529d2195 Minor doc comment update 2020-04-23 09:35:19 +10:00
Michael Gratton
13e339f009 Plugin.Account: Support creating folders in the personal name space
Add `create_personal_folder` method and implement it in
Application.FolderStoreImpl.
2020-04-23 09:35:19 +10:00
Michael Gratton
48ed8d9fe3 Geary.Account: Support creating folders in the personal name space
Add `create_personal_folder` method, implement it in
ImapEngine.GenericAccount. Use this when creating required special
folders to reduce code duplication.
2020-04-23 09:35:19 +10:00
Michael Gratton
e0dc785240 Geary.ImapEngine: Don't add local folders then update their special use
Set local folder special use when they are loaded rather than doing it
in two steps, so that when client code is notified of the folders
being available, they will already have the correct special type.
2020-04-23 09:35:19 +10:00
Michael Gratton
400850cc44 Geary.AccountInformation: Rework how special use folder paths are stored
Use a simple list of strings to store path steps, since we don't know
what the root will be in advance, and this leads to errors if callers
try to compare the info's paths to (say) an actual IMAP path.

Store path steps in a SpecialUse to path step map property, rather than
as individual properties for each special use, to reduce repetition.
2020-04-23 09:35:19 +10:00
Björn Daase
8d24b1499e INSTALL: add missing itstool dependency for Fedora
Otherwise, the post install script on Fedora crashes with:
`FileNotFoundError: [Errno 2] No such file or directory: 'itstool'`.

It is in the Ubuntu/Debian dependencies so simply add it for Fedora as well
2020-04-22 23:31:13 +02:00
Michael Gratton
9a2fe63a5f Application.Controller: Ensure outboxes appear in the folder list 2020-04-21 23:36:24 +10:00
Michael Gratton
47d4056010 Plugins: Add EmailTemplate plugin 2020-04-21 23:36:24 +10:00
Michael Gratton
10510727b6 Plugin.Composer: Support disabling sending a composer
Allow disabling send in the composer for editing templates.
2020-04-21 23:36:24 +10:00
Michael Gratton
33a6134864 Plugin.Composer: Support specifying a folder to save email 2020-04-21 23:36:24 +10:00
Michael Gratton
4f92c2b548 Plugin.InfoBar: Allow secondary buttons to be specified. 2020-04-21 23:36:24 +10:00
Michael Gratton
14f3dd0c36 Application.Controller: Allow creating composers with alt save folders
Allow a non-draft folder to be specified as the location to save
email being composed.
2020-04-21 23:36:24 +10:00
Michael Gratton
085ed9a6a3 Geary.App.DraftManaager: Update API to something more RAII-like
Replace open method with an async ctor, so we can make a few properties
non-null by default, and callers need to call one less call. Make
destination folder configurable, and require email flags passed in
via the ctor, not every time when saving.
2020-04-21 23:36:24 +10:00
Michael Gratton
924231d103 Plugins.SpecialFolders: Actually implement the edit draft action
Fixes #803
2020-04-21 16:22:55 +10:00
Michael Gratton
6fd3f36551 Plugin.Composer: Add support for editing an email in the composer
Add `edit_email` method, and implement in the underlying implementation.
2020-04-21 16:22:55 +10:00
Michael Gratton
2cd43de8ee ConversationViewer: Avoid re-enabling kinetic scrolling if disabled 2020-04-21 16:22:55 +10:00
Michael Gratton
480277e9c2 Application.MainWindow: Email not found error when discarding a draft
When the drafts folder is selected, and a draft is being edited, and
that dis discarded, there is a race between the composer disappearing
(and hence the draft being shown again) and the draft itself being
removed from the folder. Attempt to check for this and avoid reporting
the problem.
2020-04-21 16:22:55 +10:00
Michael Gratton
a67f1b2157 Application.{Controller,MainWindow}: Clean up displaying composers
When displaying a new empty composer, only consider those attached to
the current main window. Ensure that when re-using an existing composer,
that no composers in the undo buffer are used. Ensure drafts are
displayed full-pane when appropriate. Clean up redundant parts of
the `show_composer` API a bit.
2020-04-21 16:22:55 +10:00
Michael Gratton
6a33266cfb Composer.Widget: Re-load a context email with missing fields if needed
Rather than just throwing an error, try re-loading context emails in
`load_context` from the store.
2020-04-21 16:22:55 +10:00
Michael Gratton
fc4bc926c3 Composer.Widget: Convert to using AccountContext objects
Use AccountContext objects so the composer can access the account's
cancellable, contacts, etc. Simplify cancellable handling as a result.
2020-04-21 16:22:55 +10:00
Michael Gratton
96ddd5aee0 ConversationListBox: Remove obsolete action and signal 2020-04-21 16:22:55 +10:00
Michael Gratton
aac59ec53b Application.Controller, Composer.Widget: Clean up composer construction
Clean up and simplify how composers are constructed. Ensure all
composers are constructed via Application.Composer. Provide a set of
APIs for constructing different kinds of composers with minimal
parameters, rather than having one method with eleventy different
parameters.

Mirror API changes in Composer.Widget by splitting `load` method up
into a method for each different composer type. Clean up internals a
bit as a result. Rename `ComposeType` enum and its values to
`ContextType` to better reflect what it does.
2020-04-21 16:22:55 +10:00
Michael Gratton
a98f953237 Application.Client: Use plugin variant formats for app actions
Expect the same variant format for the `show-folder` and `show-email`
application actions. Use existing email and folder store factory
lookup methods for these. Update DesktopNotifications plugin to simply
pass variant values from plugin classes through to notifications.
2020-04-20 10:53:27 +10:00
Michael Gratton
0b0efd026a Application.FolderStoreFactory: Move get_folder_from_variant to factory
Make the from variant method accessible to the client as per email
factory, so the client can reuse it.
2020-04-20 10:53:27 +10:00
Michael Gratton
aff599821a Plugin.EmailStore: Add methods for getting email ids from variants
Implement these in Application.EmailStoreFactory's implementation of
the interface.

This switches the variant format used to `(account_id,email_id)` to
match that used for folders, and so a folder doesn't need to be
specified when showing an email.

This breaks opening email from desktop notifications, but that will be
fixed shortly.
2020-04-20 10:53:27 +10:00
Piotr Drąg
0c33187fcb Update Polish translation 2020-04-19 10:31:52 +02:00
Michael Gratton
97b807f0b4 Application.FolderStoreFactory: Improve folder signal impl
Only signal folders available/unavailable if non-empty when adding or
removing accounts, avoid producing two collections when signalling, and
fix removing folders from the store before signalling that they have
been removed.
2020-04-18 18:37:35 +10:00
Michael Gratton
2f666213ca Application.FolderStoreFactory, EmailStorefactory: Remove controller use
Remove use of Application.Controller in these classes so they can be
more easily unit tested.
2020-04-18 18:37:35 +10:00
Michael Gratton
5519ba86cf Application.PluginManager: Use AccountContext keys for account impl map
Use AccountContext as keys the Plugin.Application implementation map to
reduce the need for getting instances from the controller.
2020-04-18 18:37:35 +10:00
Michael Gratton
624b9ab901 Minor doc comment updates 2020-04-18 18:37:35 +10:00
Michael Gratton
c719c701f7 Plugin.EmailIdentifier: Add account property
Expose the account that an id belongs to so that plugins can use that
when e.g. opening an composer to edit the email.
2020-04-18 18:37:35 +10:00
Michael Gratton
5a94d4bd01 Application.PluginManager: Move plugin account mgmt from folder factory
Move implementation and management of Plugin.Account instances from
FolderStoreFactory here, so that other objects (e.g. plugin composers)
can access the implementation's backing account context.
2020-04-18 18:37:35 +10:00
Michael Gratton
5f2d40bed9 Plugin: Add new Composer object and Application.new_composer method
This allows plugins to create and show new composers for a specific
account.
2020-04-18 18:37:35 +10:00
Michael Gratton
1dfd5a1855 Plugin.FolderPluginContext: Support registering special use folders
Add `register_folder_used_as` and `unregister_folder_used_as`, implement
both `Application.FolderContextPlugin`.
2020-04-18 18:37:35 +10:00
Michael Gratton
9345323c84 Plugin.Error: Add NOT_SUPPORTED type 2020-04-18 18:37:35 +10:00
Michael Gratton
e22d74db4b Geary.Folder: Add SpecialUse.CUSTOM and set_used_as_custom method
Support applications setting custom special uses for folders.
2020-04-18 18:37:35 +10:00
Michael Gratton
e9ce94b655 Application.FolderStoreFactory: Convert to using app & folder contexts
Hook into the controller's signals for notification of accounts becoming
available so we get AccountContext objects to work with, and hook into
those to get notifications of folders becoming available, and work with
those so plugins get the exact same view of these as the client itself
does.
2020-04-18 18:37:35 +10:00
Michael Gratton
60f3fac66e Application: Pass Controller instance to to plugin objects directly
Most of the plugin implementation classes require instances of the
controller and other objects obtained from the application instance,
rather than the application instance itself. So pass that and the other
objects in instead of the application.
2020-04-18 18:37:35 +10:00
Michael Gratton
778cb2d637 Application.AccountContext: Add signals for folder context notifications
Add signals for folder contexts being added and remove, and hence also
require them to be added and removed in bulk, as collections.

Also, hook MainWindow up to use these signals rather than requiring
Controller manually manage notifying each main window of each folder
becoming available/unavailable.
2020-04-18 18:37:35 +10:00
Yuri Chornoivan
9d829dec95 Update Ukrainian translation 2020-04-17 05:21:21 +00:00