Commit graph

167 commits

Author SHA1 Message Date
Cédric Bellegarde
a5e4764de5 client: Remove mostly unused StatusBar widget
- Message are now shown in toasts
- It's only used to hold a Spinner, moved in HeaderBar
2023-11-18 12:02:15 +00:00
Cédric Bellegarde
1a7a3a987a engine: Cancel any remote folders update before marking a message
When marking a message, a race condition can happen:
- A remote folders update is already running
- We mark the message locally and replay it remotely
- The previous remote update result restores invalid values locally
2022-09-26 11:03:13 +02:00
Julian Sparber
6a052031df avatar: Use HdyAvatar for displaying avatars 2021-04-04 12:44:32 +10:00
Michael Gratton
67d68d083d Merge branch 'mjog/folder-load-sync-race' into 'mainline'
Folder load/sync race

See merge request GNOME/geary!663
2021-02-23 21:28:20 +00:00
Michael Gratton
a9aa736f67 Application.Controller: Ignore file not found for e8061379 2021-02-10 22:20:24 +11:00
Michael Gratton
0f6c38be4c Geary.ImapEngine.GenericAccount: Use account sync API for db cleanup
Replace use of signals with direct method calls.
2021-02-09 01:05:50 +11:00
Michael Gratton
f218328210 Application.Controller: Fix build warning
Fixes build warning introduced in commit c4fae242.
2021-02-07 14:23:13 +11:00
Michael Gratton
c4fae24262 Application.Controller: Fix directory used for locally pinned certs
Fix defect introduced in commit e8061379.
2021-02-01 22:07:16 +11:00
Michael Gratton
c331145fd3 client: Clean up database upgrade dialog implementation
Rename `UpgradeDialog` to `DatabaseManager` since it's not actually a
dialog, move it into the APplication package. Replace old Glade UI file
with a custom built dialog since it's trivial and so we can make it
modal for a main window.

Fixes #1007
2021-01-19 23:50:29 +11:00
Michael Gratton
bb02e157c6 Geary.App.SearchFolder: Substantial implementation rework
This does the following:

 * Makes updating the search query a non-async call, so that apps can
   call it and forget about it
 * Makes updating search results only update the folder's contents
   when finished, and not if cancelled
 * Cancels any existing search tasks if the query is updated
 * Swaps sending removed signals before inserted signals to make the
   conversation viewer happier
2021-01-19 20:48:17 +11:00
Michael Gratton
9658e9e3b4 Geary.Controller: Migrate release config if needed
If the current config directory is empty, go looking for config data
in other well known locations and if found, copy it all across from
the most recently modified directory.

This supports migrating config from non-Flatpak to Flatpak locations,
and release config to devel profile locations.

Fixes #326
2020-10-14 09:21:34 +11:00
Michael Gratton
468ea6df58 Application.Client: Rename app user dirs to home dirs 2020-10-14 09:21:34 +11:00
Michael Gratton
6934841484 Application.Controller: Clean up invoking XDG config migration
Order args to better, create the config dir in the controller since
that is always needed, regardless of any migrations.
2020-10-14 09:21:34 +11:00
Michael Gratton
e8061379ec Application.Controller: Clean up config/data vars in ctor 2020-10-14 09:21:31 +11:00
Michael Gratton
d7e05ab20e client: Move Migrate namespace to be under Util 2020-10-14 09:20:42 +11:00
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