Commit graph

6137 commits

Author SHA1 Message Date
Michael Gratton
6ea5e43168 vala-unit: Minor test fixups 2020-08-18 16:32:26 +10:00
Michael Gratton
41de9e537b Plugin.Composer: Support registering composer menu items
Allow plugins to register per-composer actions and add menu items to
their own section in the composer's menu.
2020-08-18 16:32:26 +10:00
Michael Gratton
ec44114612 Plugin.Button: Rename to Actionable
Make the name generic so it can be used for things other than buttons
(e.g. menu items).
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
f3e6feb887 Application.PluginManager: Rework context state management
Introduce new PluginGlobals and PluginContext to encapsulate global and
per-context state, respectively. Pass these objects to various plugin
interface implementations instead of doling it out piecemeal.
2020-08-18 16:32:26 +10:00
Michael Gratton
6d99cded50 src/client/plugin/mail-merge/meson.build: Fix rpath on wrong target 2020-08-18 16:32:26 +10:00
Michael Gratton
2c4a73e0ed Plugin.MailMerge: Add simple CSV reader with unit tests 2020-08-18 16:32:26 +10:00
Michael Gratton
cc145abe56 Plugin.MailMerge: Implement basic merge field parsing 2020-08-18 16:32:26 +10:00
Michael Gratton
8ba6838612 Plugin.Email: Add load_body_as method and implement it
Allows email plugins access to email boxy text.
2020-08-18 16:32:26 +10:00
Michael Gratton
aa80b10d07 Plugin.Email: Mark Geary.EmailHeaderSet as a prerequisite
Allows plugins access to all standard email headers.
2020-08-18 16:32:26 +10:00
Michael Gratton
efc5c3bf33 Util.Email.strip_subject_prefixes: Convert param to EmailHeaderSet
Provides some more flexibility in how it can be called.
2020-08-18 16:32:26 +10:00
Michael Gratton
6074610234 Geary.EmailHeaderSet: Seal setting properties off from sub-classes
Remove setters for all properties, so plugins can't create sub-classes
of instances and set these values. Fix implementations.
2020-08-18 16:32:26 +10:00
Michael Gratton
0aeeba1cba Trivial doc comment update 2020-08-18 16:32:26 +10:00
Michael Gratton
ce905740dc Plugins: Actually implement info bar plugin priority
Now that InfoBarStack supports a priority queue, use that for folder
and email stacks, and set the required priority property when
constructing info bars for plugins, so that the highest priority
info bar is always shown.
2020-08-18 16:32:26 +10:00
Michael Gratton
85adc6b114 Components.InfoBarStack: Support additional stack queue algorithms
In addition to just showing the most-recenly-added info bar, also
support choosing an info bar based on a priority queue.
2020-08-18 16:32:26 +10:00
Michael Gratton
911f8ec66c Components.PreferencesWindow: Update plugin rows when deps change
Hook up to PluginManager's signals and ensure plugin rows are updated
when a plugin's dependencies are also loaded or unloaded.
2020-08-18 16:32:26 +10:00
Michael Gratton
a655037922 Application.PluginManager: Update plugin settings for dependencies also
If loading or unloading an optional plugin causes dependencies to be
loaded or unloaded, update the GSettings for the dependencies as well.
2020-08-18 16:32:26 +10:00
Michael Gratton
7311ffe930 Plugins: Add initial MailMerge plugin outline 2020-08-18 16:32:26 +10:00
Michael Gratton
cb648cd839 Merge branch 'mjog/vala-switch-warnings' into 'mainline'
Fix vala mainline switch statement build warnings

See merge request GNOME/geary!543
2020-08-17 01:01:33 +00:00
Michael Gratton
850bb3139f Fix vala mainline switch statement build warnings 2020-08-17 10:33:33 +10:00
Michael Gratton
108853a009 Merge branch 'mjog/sound-plugin-feedback' into 'mainline'
Sent sound plugin feedback

See merge request GNOME/geary!542
2020-08-16 05:35:03 +00:00
Michael Gratton
492d66239e Plugin.SentSound: Play a sound on when first activated
This provides feedback that the plugin is working, and displays an
error if not.
2020-08-16 14:44:11 +10:00
Michael Gratton
9f5bea33f0 Plugin.SentSound: Report an error when sound doesn't play 2020-08-16 14:44:11 +10:00
Michael Gratton
10c7ab197e Plugin.PluginBase: Add is_startup parameter to activate
This allows plugins to take different actions depending on if they are
being first loaded or not.
2020-08-16 14:42:23 +10:00
Michael Gratton
4411e00b18 Merge branch 'mjog/plugin-problem-reports' into 'mainline'
Plugin problem reports

See merge request GNOME/geary!538
2020-08-16 03:44:03 +00:00
Michael Gratton
c37cf0640b Plugin.Application: Add support for reporting problems 2020-08-16 09:48:23 +10:00
sicklylife
817bc7f216 Update Japanese translation 2020-08-15 19:44:30 +00:00
sicklylife
2dc73ab29c Update Japanese translation 2020-08-15 19:40:24 +00:00
Daniel Mustieles
9bd855181e Updated Spanish translation 2020-08-14 11:11:07 +02:00
Michael Gratton
e5247a260d Merge branch 'mjog/composer-context-loading-fixes' into 'mainline'
Composer context loading fixes

See merge request GNOME/geary!539
2020-08-13 10:50:53 +00:00
Michael Gratton
e5bfd7295c test-client: Fix test failure for new composer widget tests under CI
Init icon factory so composer tests work under CI, add rsvg as a test
dependency for Ubuntu which as of 20.10 does not include it by default.
2020-08-13 19:52:12 +10:00
Michael Gratton
29ba9311e6 Composer.Widget: Handle non-Geary HTML and plain text drafts better
Commit 37d904b5 added a partial change to how drafts are saved and
loaded - saving plain text only when not in rich text mode and
loading HTML-based drafts that don't seem to have originated from Geary
and plain-text-only drafts as the body so that Geary's composer-internal
HTML markup is still present.

However this introduced a double signature when loading plain text
drafts back since Geary would assume the body (including sig) is the
message body and appending a new sig to that.

This addresses the issue above by always saving drafts with HTML parts
even when in plain text only mode.
2020-08-13 19:52:12 +10:00
Michael Gratton
44654e3f76 Composer.Widget: Rework context email loading
Ensure composer state is restored when loading draft replies and that
`referred_ids` is updated top include the messages the draft refers to.

Make the process for loading different context types more obvious by
doing the work in-place, especially for replies, and avoiding multiple
utility methods that also branch based on type.

Use standard RFC822 classes for managing In-Reply-To and References, and
merge id lists rather than simply concatenating them. Ensure both are
updated when adding additional replies to the email, and they are always
set on any composed email constructed.

Add unit tests for all of the above.
2020-08-13 19:52:12 +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
a781e0ebf5 Composer.WebView: Rework HTML consts so that IDs have internal access 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
ea5c95bbbb Trivial code formatting fixup 2020-08-13 19:52:12 +10:00
Michael Gratton
c73888b2c4 Geary.RFC822.MessageIDList: Support merging message id lists
Add support for merging a list with a single id or a another list,
only appending the new id(s) if not already present. Add unit tests.
2020-08-13 19:52:12 +10:00
Michael Gratton
c41515a2c7 Geary.RFC822.MessageIDList: Replace append with concatenate
Add new method for appending a single id, rename to `concatenate` to
disambiguate.
2020-08-13 19:51:33 +10:00
Michael Gratton
2957f15297 Geary.RFC822.MailboxAddresses: Update equality semantics
Although when processing mailbox addresses lists are effectively sets,
the ordering can be important for people. As such, make `equal_to`
comparisons require identical ordering, and add new `contains_all` for
order-independent comparisons.
2020-08-13 19:51:33 +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
6e0aa316d8 build: Generate client internal VAPI and build client tests with it 2020-08-13 19:51:33 +10:00
Michael Gratton
35683dd6eb build: Reduce verbosity of meson vars by removing geary_ prefixes 2020-08-13 19:51:33 +10:00
Michael Gratton
2030b2dec7 test: Break out engine mock objects into their own name-space
Engine mocks don't need to be in the `Geary` namespace, and including
them there makes it difficult to use them in client tests, so put them
all in their own name-space and corresponding directory.
2020-08-13 19:51:33 +10:00
Michael Gratton
3e156525ae Merge branch 'mjog/message-id-db' into 'mainline'
Message-Id data stored incorrectly in the database

Closes #834

See merge request GNOME/geary!540
2020-08-13 08:28:26 +00:00
Michael Gratton
175c7dc7f2 Geary.RFC822.MessageIDList: Add unit tests for parsing RFC822 id lists 2020-08-13 17:55:07 +10:00
Michael Gratton
33801f22ef sql: Add migration for bad message-id data in the database 2020-08-13 15:50:07 +10:00
Michael Gratton
d280bcbbeb Geary.ImapDB: Use RFC822 strings for Message-Id values in the database
Ensure `RFC822.MessageID.to_rfc822_string` is used when storing and
searching for message ids in the database.
2020-08-13 15:21:23 +10:00
Rafael Fontenelle
fe61902367 Update Brazilian Portuguese translation 2020-08-10 10:22:36 +00:00