Commit graph

5924 commits

Author SHA1 Message Date
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
Michael Gratton
3ffa6e10ee FolderList.FolderEntry: Emit ::entry_changed on folder context change
This ensures any name, icon etc changes are picked up if anything
updates the same for the folder's context.
2020-04-17 12:28:38 +10:00
Michael Gratton
1a345682f5 Sidebar.Entry: Coalesce multiple entry changed signals into one
Don't have a separate blah_changed signal for each property, just have
one and update all props when it is emitted. This happens infrequently
enough that the extra overhead is trivial and simplifies the code base.
2020-04-17 12:28:38 +10:00
Michael Gratton
c4b44b41f6 Application.FolderContext: New class for aggregating client folder state
Add new `FolderContext` class to encapsulate client state and policy
about a specific engine folder. Use it for display name, icon and email
count bubble policy for now.

Update AccountContext to maintain a set of folder-policy instances per
account, and convert the folder list over to using the new objects.
2020-04-17 12:28:38 +10:00
Michael Gratton
9952143b30 Application.AccountContext: Break out unto standalone source file 2020-04-17 12:28:38 +10:00
Michael Gratton
8b3e01f11d Application: Rename plugin context objects to make their use clear 2020-04-17 12:28:38 +10:00
Michael Gratton
1b9d28da8e Merge branch 'mjog/logging-improvements' into 'mainline'
Logging improvements

See merge request GNOME/geary!495
2020-04-16 23:33:30 +00:00
Michael Gratton
5ce6517b3b Geary.Logging: Add/update API docs for the package and a few functions 2020-04-17 08:59:00 +10:00
Michael Gratton
834b6eb4bf Geary.Db: Disable SQL query logging by default again
Even just logging SQL queries is extremely verbose, and pushes a lot
of logging messages off the end of the buffer. So rework result logging
flag and code to apply to both again.

Re-merge Application.Client's SQL logging command line flags back into
one again.
2020-04-17 08:49:33 +10:00
Michael Gratton
53bdf9299d Components.InspectorLogView: Always show inspector log messages
This allows start, stop and marks to always be seen, regardless of
account, domain and text filters.
2020-04-16 18:49:51 +10:00
Michael Gratton
127876f5f6 Components.InspectorLogView: Convert filter lamda to function
The log entry filter lambda is quite large now, so move it to a
standard-alone function.
2020-04-16 18:49:42 +10:00
Michael Gratton
8b4f370a2a Component.Inspector: Add mark and clear buttons for logs 2020-04-16 18:47:33 +10:00
Michael Gratton
849b2fb0b8 Components.InspectorLogView: Pre-fill internal domains with those known
SMTP in particular won't show up until an email as been sent, so make
it visible from the get-go.
2020-04-16 17:43:31 +10:00
Michael Gratton
31b073d0d5 ui/components-inspector-log-view.ui: Minor tweaks 2020-04-16 17:31:18 +10:00
Michael Gratton
b70790eac1 Components.InspectorLogView: Support filtering logs by account/domain
Hook up sidebar rows so that their checkbox's enabled state indicates
and can be used to set the filtering for the log view.
2020-04-16 17:30:50 +10:00
Michael Gratton
2fada87a72 Geary.Logging: Let callers determine threading safety for log_listener
Rather than scheduling calling a registered log_listener on the default
main loop context, let the listener implementation handle that in
whatever way they want.
2020-04-16 17:11:53 +10:00
Michael Gratton
01c093e26e Geary.Logging: Update domain suppression APIs
Make `suppress_domain`/`unsuppress_domain` return whether they actually
added or removed the suppression. Add `is_suppresed_domain` to allow
determining this at other times.
2020-04-16 17:11:34 +10:00
Michael Gratton
4b097b4542 Components.InspectorLogView: Add sidebar listing accounts & log domains
Adds a sidebar that displays accounts and logging domains, grouped into
accounts, internal domains, and external domains.
2020-04-16 13:05:07 +10:00
Michael Gratton
d5e94a257d Geary.Logging: Update how log blacklisting and suppression works
Blacklisting now prevents records from being created, where as
suppression now simply prevents them from being printed.

This means records are created for all log messages, regardless of
whether they are displayed.

Update API docs for a bunch of methods to make this clear, and to make
the requirements for getting log records in the first place is also
clear.
2020-04-16 11:44:56 +10:00
Michael Gratton
b2e99dcef2 Application.Client: Add command line flag for logging SQL results 2020-04-16 11:44:26 +10:00
Michael Gratton
f4a4d699be Geary.Db: Add special flag for logging SQL results
Update the db's logging to log SQL statements normally, but add a
special case flag to enable logging query results as well, since these
are particularly verbose.
2020-04-16 11:44:19 +10:00
Michael Gratton
00f0fb9665 Geary.Logging: Move remaining code from api source to util source
Now that the flags code is gone, move the remaining code from
`src/engine/api/geary-logging.vala` into
`src/engine/util/util-logging.vala`, and remove the former source file.
2020-04-15 17:31:16 +10:00
Michael Gratton
3b0815a1dc Geary.Logging: Remove Flag enum
Now that we have classes logging on sub-domains, and the ability to
suppress specific domains, remove flags and switch over to doing
domain suppression for manipulating debug settings in the client.
2020-04-15 17:05:09 +10:00