Commit graph

152 commits

Author SHA1 Message Date
Michael James Gratton
d7af23201c Revert "Revert "Merge branch 'mjog/558-webkit-shared-process' into 'mainline'""
This reverts commit cbe6e0ba9b, which reinstates
commit e4a5b85698.

See !411 and !374
2020-10-13 00:02:02 +11:00
Michael Gratton
bf1879059c Application.Controller: Clean up account adding/removal
Add dedicated methods for adding and removing accounts to simplify
callback impls and remove redundancy, ensure they check for engine
errors if an account already exists or doesn't exist.
2020-08-20 11:36:07 +10:00
Michael Gratton
df7a30cbe1 Geary.Account: Add {de}register_local_folder methods
Support API clients registering their own local folder implementations.
Use this (and the last commit) to generalise handling of the outbox by
GenericAccount by registering it when the outbox postie is started, and
when creating a map of folders that contain specific ids.

This also ensures API clients are informed of the outbox becoming
available, allowing some special case code to be removed from the app
controller.
2020-08-18 16:32:26 +10:00
Michael Gratton
78c8a2fedc Plugins: Update to new composer lifecycle
Update to be compatible with Application.Controller composer lifecycle
changes, add matching signals so plugins can decorate composers as
they are created.

Keep track of Plugin.Composer implementation instances so that the same
object can always be returned for the same Composer.Widget instance.

Update plugin call sites.
2020-08-18 16:32:26 +10:00
Michael Gratton
c57ae854bd Application.Controller: Rework composer life-cycle, again
Since plugins especially require the ability to customise a composer
ideally before presenting it, split up composer construction into two
phases: `compose_blah` methods that find a matching composer or
constructa new one, then `present_composer` to present it.
Add `composer_registered` and `composer_deregistered` signals, fired
as appropriate so other code paths (again, plugins in particular) can
hook into composer lifecycles.

Update call sites for new API and to explicitly present new composers.
2020-08-18 16:32:26 +10:00
Michael Gratton
850bb3139f Fix vala mainline switch statement build warnings 2020-08-17 10:33:33 +10:00
Michael Gratton
1ed1f82a12 Composer.Widget: Rename get_composed_email to to_composed_email
It's a factory method, not an accessor.
2020-08-13 19:52:12 +10:00
Michael Gratton
691a239031 Composer.ApplicationInterface: New composer app interface
Defining an interface for the composer to access application objects
and services decouples it from Application.Controller, allowing it to be more
easily unit tested.

Replace use of Application.Client and Application.Controller in the
composer and add some basic unit tests.
2020-08-13 19:52:12 +10:00
Michael Gratton
8608293367 Application.AccountInterface: New interface for accessing account objects
By defining an interface for account object access, classes that use it
are decoupled from Application.Controller, allowing them to be more
easily unit tested.
2020-08-13 19:51:33 +10:00
Michael Gratton
e4edf28e0c Merge branch 'remove-old-msgs-beyond-storage-pref' into 'mainline'
Remove old messages beyond storage preference

See merge request GNOME/geary!388
2020-06-30 07:07:12 +00:00
Michael Gratton
3daeade46f Application.Controller: Fix composer not appearing inline for replies 2020-06-27 13:48:24 +10:00
Chris Heywood
cfd88f7f17 Remove unnecessary var in Application.Controller 2020-05-07 19:59:16 +10:00
Chris Heywood
4ff783b231 Merge branch 'mainline' into remove-old-msgs-beyond-storage-pref 2020-04-30 18:08:19 +10:00
Michael Gratton
9a2fe63a5f Application.Controller: Ensure outboxes appear in the folder list 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
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
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
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
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
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
544289688a src/client: Fix warnings and errors reported by valadoc 2020-04-08 12:07:05 +10:00
Michael Gratton
8dcab7f306 Geary.SpecialFolderType: Rename class and related properties, signals
The `SpecialFolderType` was somewhat mis-named, since the special use
does not (in most cases) confer any special type, rather it's simply
defines what a particular folder is used /for/.

As such, rename the enum to to `Geary.Folder.SpecialUse`, moving it in
to the `Folder` class, since it relates specifically to folders, also
rename `Folder::special_folder_type` and
`Folder::special_folder_type_changed` reflect the above and not
duplicate the type name, and similarly rename
`Account::folders_special_type`.

Update the many call sites.
2020-03-31 16:15:57 +11:00
Michael Gratton
19d29b9e9d Geary.Folder, Geary.SpecialFolderType: Move folder name i18n to client
Remove `Geary.Folder::get_display_name` method, and
`display-name-changed` signal, and
`Geary.SpecialFolderType::get_display_name`. Add new equivalent methods
for client in `Util.I18n` and use those instead.
2020-03-31 15:33:17 +11:00
Michael Gratton
fd09105136 Plugin:NotificationContext: Remove EmailStore accessor method
Now that EmailExtenion exists, plugins can just get an instance of
the email store by implementing that.
2020-03-30 21:45:26 +11:00
Michael Gratton
8a36587cc0 Plugin.EmailStore: Add email-displayed signal
Ensure the signal is emitted whenever an email in the conversation
viewer is displayed fully (i.e. expanded).
2020-03-30 21:05:00 +11:00
Michael Gratton
e56b155c27 Plugin.EmailStore: Ensure email-sent is emitted by email plugins 2020-03-30 21:05:00 +11:00
Michael Gratton
8b474fa508 Application.MainWindow: Remove empty trash/spam menu items
Remove menu items and now-unused callbacks and controller methods.
2020-03-22 16:47:07 +11:00
Michael Gratton
cbe5fb6a07 Plugin.Application: Add support for emptying folders
Allow plugins to delete all email from a folder after getting user
confirmation.
2020-03-22 16:45:55 +11:00
Michael Gratton
c4d046ea61 Application.AvatarStore: Make class internal
Now that no non-application-package classes are using it, make the
class internal and its property on Controller private.
2020-03-22 08:55:28 +11:00
Michael Gratton
21fb82fd2a Application.Contact: Add method to access avatars
Allows access to avatars without requiring access to the store.
2020-03-22 08:55:00 +11:00
Michael Gratton
e7c7326a05 Plugin.EmailStore: Actually emit the email-sent signal
Wire up emitting the signal from the controller when it gets notified
of an email being sent.
2020-03-21 17:03:48 +11:00
Michael Gratton
2e623a5b78 Geary.Smtp.ClientService: Pass a Geary.Email to sent-mail signal
Pass and email object to sent-mail so that we have access to one when
notifying plugings of mail being sent and not need to convert/impement
the RFC833 message to a Plugin.Email object.
2020-03-21 17:03:48 +11:00
Michael Gratton
e0ac053f33 Application.Controller: Minor code cleanup for readability 2020-03-20 17:08:46 +11:00
Michael Gratton
feece66c6e MainWindowInfobar: Rename and derive from common InfoBar widget
Rename to Components.ProblemReportInfoBar to better describe what it
does, and to fit with the code convention for package and file names.

Derive from Components.InfoBar so we can drop the custom GTK Builder
file for it.
2020-03-20 17:08:46 +11:00
Michael Gratton
ee4bd117ee Convert plugins to use isolated context model
Convert the plugin implementation to use a model where each plugin
has its own context object instances and has limited/no access to the
client's and engine's objects.
2020-03-17 19:23:24 +11:00
Michael Gratton
03331fd231 Application.PluginManager: Add close method
Add close method, call it from the controller when shutting down, so
that plugins are actually deactivated and can release resources.
2020-03-17 19:23:24 +11:00
Michael Gratton
18df946216 FolderList.Tree: Remove use of a NotificationContext object
Since these are becoming per-plugin only, use folder signals to update
for now.
2020-03-17 19:23:24 +11:00
Michael Gratton
1143bb03f4 Application.PluginManager: Convert ctor to RAII
Do all loading up front in the manager's constructor so it's ready to
go after being constructed.
2020-03-17 19:23:24 +11:00
Michael Gratton
c394611037 Application.Controller: Make plugin manager public
Allow other application components to access the plugin manager, rename
property for brevity.
2020-03-17 19:23:24 +11:00
Michael Gratton
87e2255bb3 Application.Controller: Fix deleting conversations from search
When deleteing messages from the search folder, all most be removed
(not just in-folder) since none of the messages will be in-folder.
2020-03-13 15:57:20 +11:00
Michael Gratton
c2adf8e0fc Application.Controller: Permit notifications when no main window
If there's no main window, the app must be running hidden, so
notifications should be sent.

Fixes #716
2020-03-04 11:30:56 +11:00
Michael James Gratton
cbe6e0ba9b Revert "Merge branch 'mjog/558-webkit-shared-process' into 'mainline'"
Revert merge request GNOME/geary!374 for now since the shared process
model breaks old-style WebProcess message handler IPC.

This can be un-reverted when out JS is ported to the new Messages API
that is landing in WebKitGTK 2.28.

This reverts commit e4a5b85698, reversing
changes made to 66f6525480.
2020-02-13 12:56:52 +11:00
Chris Heywood
a6595ebc2f Merge branch 'mainline' into remove-old-msgs-beyond-storage-pref 2020-01-24 10:32:19 +01:00
Michael Gratton
65ff5bea40 Merge branch 'no-queued-notification' into 'mainline'
Don't display "email queued for delivery" when undo-send-delay is 0

Closes #672

See merge request GNOME/geary!399
2020-01-22 09:34:24 +00:00
Adam Dingle
02c65476ea Allow brief notifications
This change allows certain notifications to be displayed only briefly. The new DConf key brief-notification-duration is the number of seconds for which brief notifications should be displayed.

At the moment the only brief notifications are "Message sent", "Conversation archived" and "Message archived".

Closes #602
2020-01-19 15:26:21 +01:00
Adam Dingle
2588a12f30 Don't display "email queued for delivery" when undo-send-delay is 0
Closes #672
2020-01-19 11:54:36 +01:00
Chris Heywood
ae19398944 Improve cancel-ability of account storage cleanup 2020-01-10 17:41:06 +01:00