Commit graph

332 commits

Author SHA1 Message Date
Michael Gratton
7ec99e1f6b client: Implement showing window menu when F10 pressed
Fixes #1102
2021-01-08 09:34:27 +11:00
Michael Gratton
a21982ae42 Merge branch 'mjog/draft-errors' into 'mainline'
Misc draft management issues

Closes #858 and #1044

See merge request GNOME/geary!613
2020-11-05 08:14:32 +00:00
Michael Gratton
7c38cd6cef Merge branch 'mjog/888-reply-time' into 'mainline'
Include time zone in date/time format string for reply quotes

Closes #888

See merge request GNOME/geary!603
2020-10-29 12:58:23 +00:00
Michael Gratton
5533ae323d Composer.Widget: Hide save button by default
Determining if this can be enabled currently requires opening the
remote, so hide it by default until we know for sure.
2020-10-25 19:06:51 +11:00
Michael Gratton
36daf80120 Composer.Widget: Clean up set_save_to_override method signature
The method now no longer requires async or throws an error, so remove
both.
2020-10-25 19:06:51 +11:00
Michael Gratton
6d5b0bc5b6 Composer.Widget: Rework draft manager management
Since the draft manager will now block until a remote for the draft
folder has been obtained, it now must be ensured that all calls to
opening the manager are backgrounded so that the UI isn't blocked
when offline.
2020-10-25 19:06:51 +11:00
Michael Gratton
6f1f94e554 Composer.Widget: Suppress unsupported draft folder messages
There's nothing people can do about the draft folder being unusable
for saving drafts, so just log a debug message and continue.

Fixes #858
2020-10-25 19:02:37 +11:00
Michael Gratton
ff565bc6ef Components.WebView: Convert to using messages for JS method invocation
Use WebKitGTK UserMessage objects for invoking JS methods rather than
serialising to JS strings and running those. This is possibly slightly
less efficient, but removes the onus on serialising to and parsing from
JS and once switched over from message handlers to UserMessage objects
will be using a single uniform IPC interface for both.
2020-10-13 00:02:09 +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
51b8c501be Util.Email: Use a single unambiguous date format for reply quote dates
Rather than using the UI pref for 12/24h clocks, use a single format
string that should be reasonably unambiguous and that includes the
time zone.

Fixes #888
2020-10-10 23:55:02 +11:00
Julian Sparber
d6c546e2d5 composer: close the composer when navigating back 2020-10-10 10:41:49 +02:00
Michael Gratton
70186163e8 Composer.Widget: Fix critical when immediately detaching a new composer
New composers have no associated GLib Application instance, so when the
main window is already showing a composer and another is opened, the
new composer has no application to pass its window.

Fix by requiring `Composer.detach` be passed an application instance
and find an appropriate instance at each call site.
2020-09-27 22:46:40 +10:00
Michael Gratton
bd85c4f1a8 Composer.Widget: Fix criticals when "mailto:" has empty body 2020-09-27 19:57:52 +10:00
Michael Gratton
369b1f1a4d Composer.Widget: Split email body editing code out into separate widget
Create a new Composer.Editor widget and move all body web view and
action bar related code from the main widget there.

This helps to clearly delineate concerns of the two classes, it
substantially reduces the complexity of the main widget, and should
reduce the odds of further breakage like that fixed by the previous
commit less likely in the future.
2020-08-28 18:25:58 +10:00
Björn Daase
1d02b8b70b *: fix spelling mistakes found by codespell 2020-08-19 09:34:58 +02:00
Michael Gratton
8a5ea12069 Composer.Widget: Avoid confusing xgettext with a verbatim string 2020-08-18 18:08:05 +10:00
Michael Gratton
0d283dfc72 Geary.RFC822.MailboxAddresses: Update append methods
Rename append method to concatenate_list since that's what it actually does. Add new method
for cat'ing a single mailbox, add methods for merging both a single mailbox and mailbox
list into a new list.
2020-08-18 16:32:26 +10:00
Michael Gratton
2c7fe7dbc9 Composer.Widget: Add focused_input_widget property
Support tracking the last focused input widget so that text can be
inserted into it as needed.
2020-08-18 16:32:26 +10:00
Michael Gratton
2159a9a6ce Composer.Widget: Make editor prop public
Allows Plugin.Composer impl to insert text into the message body.
2020-08-18 16:32:26 +10:00
Michael Gratton
204adb50ff Plugin.Composer: Support plugins for providing composer action bars
Add and implement `Composer.set_action_bar`.
2020-08-18 16:32:26 +10:00
Michael Gratton
bde39bf985 Composer.Widget: Place composer action bars into their own container
Use CSS instead of widget props to ensure widgets have sufficient
white space.

This will allow adding additional action bars (e.g. by plugins) in a
more straight-forward manner.
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
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
850bb3139f Fix vala mainline switch statement build warnings 2020-08-17 10:33:33 +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
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
b78dfe7cb8 Composer.Widget: Convert references to a MessageIdList instance
Using the high-level representation avoids having to re-parse and
re-format the list.

Update the util method Geary.RFC822.Utils.reply_references to support
this.
2020-07-30 12:53:11 +10:00
Michael Gratton
d0efd00386 Composer.Widget: API doc comment updates 2020-06-27 13:49:09 +10:00
Michael Gratton
5b253cbee6 Geary.RFC822.MessageIdList: Update API to match MailboxAddresses
Make immutable, provide similar properties and accessors as
MailboxAddresses.
2020-05-06 14:58:56 +10:00
Michael Gratton
97e0093e29 Geary.ComposedEmail: Remove to_rfc822_message, it's redundant
Callers can just call the same thing that method does instead.
2020-05-05 21:57:17 +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
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
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
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
544289688a src/client: Fix warnings and errors reported by valadoc 2020-04-08 12:07:05 +10:00
Michael Gratton
d2eec63cfb Util.International: Rename package to I18n to make fn calls less verbose 2020-03-31 15:30:00 +11:00
Björn Daase
dbfa640e76 Composer.Widget: Do not set double dot after 'From' label
We do not set double dots after the other labels so remove it for the
'From' label as well.
Therefore, adjust the .ui file to have the right label (with the
mnemonic underscore) and remove the adjustment of it in code.
2020-03-28 12:09:32 +01:00
Michael Gratton
86d013c21c Composer.Widget: Focus message body for all inline composers
Any kind of inline composer will be a reply, so always focus the message
body when grabbing the focus.

See #671
2020-03-25 23:32:02 +11:00
Michael Gratton
ebe30d846e Include emoji menu item in composer context menu
Closes #713
2020-02-18 23:47:00 +11:00
James Westman
adf6f2b4a7 composer: Improve "insert link" popover
- Use transitions instead of show/hide
- Make the popover narrower (360px instead of 40 chars)
- Use text labels for "Add" and "Insert" rather than the check icon
- Show the button as active when the popover is open
2020-02-15 23:01:25 -06:00
James Westman
66bbb576a6 composer: Make format menu more generic
It still only contains text formatting options, but it uses the
view-more-symbolic icon.
2020-02-15 23:01:25 -06:00
James Westman
d3aff68273 composer: Style improvements for attachment box
- Add separators between rows
- Use icon instead of text for remove button
2020-02-15 23:01:25 -06:00
James Westman
233a1a6c37 composer: Improve spell check popover
- Use a MenuButton
- Separators between rows
- Make the popover narrower
- Put the country name below the language name, instead of in
  parenthesis
- Ellipsize country/language names
2020-02-15 23:01:25 -06:00
Michael Gratton
3340d7911f Remove some code clearly meant for testing only 2020-02-13 12:56:52 +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
Michael Gratton
9c0fecf552 Fix some build warnings 2020-02-02 18:15:53 +11:00