Commit graph

5261 commits

Author SHA1 Message Date
Michael Gratton
93d1ab684b Merge branch 'mjog/docs-update' into 'mainline'
Docs update

See merge request GNOME/geary!367
2019-11-18 11:23:10 +00:00
Michael Gratton
fbb6f8d7cb Merge branch 'mjog/mutiple-main-windows' into 'mainline'
Support multiple multiple main windows

Closes #169 and #139

See merge request GNOME/geary!366
2019-11-18 11:13:54 +00:00
Michael Gratton
51f0efe6ee Remove Application.Controller::display_main_window_if_ready
It's not actually needed under the new application regime for anything
other than UpgradeDialog, so rework that to not require it and remove
the method and supporting code.
2019-11-18 21:44:48 +11:00
Michael Gratton
fbc47a1f99 Ensure the inbox of the first account is selected on app startup 2019-11-18 21:43:48 +11:00
Michael Gratton
a760e26560 Improve UX when automating folder/conversation selection
Don't select the inbox of the first account by default in MainWindow,
and provide a means of inhibiting conversation autoselect when changing
folder. This allows selecting a conversation in a different folder and
opening new folders with a specific conversation selected without
jumping to the first conversation first when the autoselect pref is
enabled.
2019-11-18 21:43:25 +11:00
Michael Gratton
68aaec3245 Open conversations in new window on activate
When activating a conversation outside of the Drafts folder, open it in
a new window.
2019-11-18 19:15:51 +11:00
Michael Gratton
af2b799dc7 Select account/folder/conversations in new windows
Select the same as was selected in last active window, if any.
2019-11-18 19:15:30 +11:00
Michael Gratton
f307722c1d Update archive, shortcuts and composer manual pages
Update pages to be consistent with how the app currently works. Mention
undo for both archiving and sending/saving/dicarding composers. Update
compser page to mention features added over the last few releases.
2019-11-18 18:33:10 +11:00
Michael Gratton
808f040a2f Remove shortcuts from composer tooltips
These are rendundant now that the shortcut overlay exists.
2019-11-18 18:31:59 +11:00
Michael Gratton
08dc98aade Add keyboard shortcut to help for new windows 2019-11-18 18:31:25 +11:00
Michael Gratton
76035f3eec Update appdata with recent new features 2019-11-18 18:30:54 +11:00
Michael Gratton
ccb1135961 Show HeaderBar close buttons by default
Only disable under Unity where they aren't desirable.
2019-11-18 15:29:39 +11:00
Michael Gratton
446e9b8699 Always update Application.MainWindow title
Update the main window title with the folder/account name or in-window
composer subject even when using CSD since this helps differenciate
between multiple windows when open.
2019-11-18 15:27:46 +11:00
Michael Gratton
1ea97dcdb6 Move global GTK CSS loading from main window to the app 2019-11-18 13:53:20 +11:00
Michael Gratton
8f8709f2af Add support for opening additional main windows
Closes #139
2019-11-18 13:50:38 +11:00
Michael Gratton
0eaa3ac257 Rework how Application.Client manages application holds
Always take out a hold on the application and construct a controller
in ::startup, so that it does not immediately exit when running as a
background service now that no main windows will be constructed by
default.

Manually exit the application when there are no windows remaining
instead of releasing the hold so that it has a chance to cleanly close
the controller.
2019-11-18 11:57:53 +11:00
Michael Gratton
f4f9ff4589 Improve logging initialisation and startup
Initialise logging as early as possible to capture as many logging
messages as possible. Don't log to stderr by default on startup to
avoid printing unwanted messages, rather output any captured but not
printed messages when enabling debug output for the first time.
2019-11-18 11:53:02 +11:00
Michael Gratton
3f6fe1f3f2 Clean up Application.Controller and MainWindow shutdown
Ensure MainWindow always clears the currently selected folder and
hence conversation monitor when being closed. Clean up Controller
shutdown so it ignores account changes early, closes main windows in
parallel, and releases UI resources early.
2019-11-18 11:46:50 +11:00
Michael Gratton
3ca121f069 Move Application.MainWindow handling from Controller to Client
Add Application.Client::last_active_main_window, ::get_main_windows and
::get_active_main_window members to allow the controller easy access to
MainWindow instances. Remove the Application.Controller::main_window
property in favour of using these, generalise it to work with with
arbirary numbers of open main windows.
2019-11-18 11:28:41 +11:00
Michael Gratton
ab8755aa78 Add Application.Controller::account_available and unavailable
Clean up methods for opening an account, emit the signals when accounts
have been opened/before being closed. Use these signals in MainWindow to
manage its own internal state rather than relying on the controller.
2019-11-17 21:47:24 +11:00
Michael Gratton
e2a39029e2 Drop Application.Controller access to internal
Now that MainWindow is in the Application package, we don't need to
keep Controller public anymore.
2019-11-17 21:41:25 +11:00
Michael Gratton
0dce50457a Promote AccountContext to a top-level internal class
This class should only be shared amounst application objects, so
make it and accessors on Controller internal.
2019-11-17 21:41:19 +11:00
Michael Gratton
239fdce562 Move MainWindow to Application package
Move MainWindow out of the root namespace and add it to Application,
so it can privately share internal state with the Controller. Rename
the source and UI files to match.
2019-11-17 21:38:33 +11:00
Michael Gratton
56876365ba Rename GearyApplication class and source to match code style
Rename `GearyApplication` => `Application.Client` and
`geary-application.vala to `application-client.vala`. Update call sites
and test cases.
2019-11-17 21:38:29 +11:00
Michael Gratton
419bc6d051 Remove GearyApplication.instance global var 2019-11-17 21:35:28 +11:00
Michael Gratton
2ed60bfdbb Merge branch 'mjog/493-undo-send' into 'mainline'
Undo composer send/save/discard

Closes #493

See merge request GNOME/geary!361
2019-11-17 09:33:48 +00:00
Michael Gratton
07f6f02e2d Clean up composer handling on application quit
Rather than a convoluted systems of signals and callbacks to be able to
prompt if unsaved composers should be closed on application quit, just
do so directly from GearyApplication::quit, and close any still-open
composers on controller shutdown.

This requires some more complicated state handling in the composer, but
allows greatly simplifiying the processes to both quit the application
and close th controller.
2019-11-17 20:00:02 +11:00
Michael Gratton
f7ea988d03 Remove unused method 2019-11-17 20:00:02 +11:00
Michael Gratton
e4a02ee4e1 Ensure saved drafts are reused when reusing Composer.Widget
Convert ::current_draft_id back to an auto property and update its
value manually. Pass it to the draft-manager when re-opening due to
re-enabling the composer, so that SaveComposerCommand when undone will
start updating the previousl used draft.
2019-11-17 20:00:02 +11:00
Michael Gratton
c5c36ee9b3 Don't prompt when closing in-main-window composers
Now we have undo support for sending, saving and discarding composers,
don't prompt when closing in-main-window composers in most cases.

It retains prompting for detached composers, since it may not be obvious
how to undo that (although it is supported), also when closing the main
window completely (for the same reason), and when quitting the app.
2019-11-17 20:00:02 +11:00
Michael Gratton
de57355a1e Implement undoing saved composers
Add Application::save_composed_email method and SaveComposerEmail
command, execute the latter when the former is called. Update
Composer.Widget::save_and_exit_async to call this as needed instead
of manually disposing of the widget.
2019-11-17 20:00:02 +11:00
Michael Gratton
373504025f Implement undoing discarded composers
Add Application::discard_composed_email method and DiscardComposerEmail
command, execute the latter when the former is called. Update
Composer.Widget::discard_and_exit_async to call this as needed instead
of manually disposing of the widget.
2019-11-17 20:00:02 +11:00
Michael Gratton
19e0424981 Make Application.Controller's composer command re-usable
Rename ::send_email to ::send_composed_email and SendCommand to
SendComposerCommand to better reflect what they do. Rework the command
to use an abstratc base class with some generic composer management
methods.
2019-11-17 20:00:02 +11:00
Michael Gratton
df50fb0b95 Update composer draft lifecycle management
Make Geary.App.DraftManager's ::update and ::discard methods async and
drop the ::discard_on_close property. Update all Composer.Widget draft
methods to be aync, drop the `_async` prefix, take a cancellable arg and
throw their errors rather than logging them. Update call sites to take
this into account and report errors rather than logging them.
2019-11-17 20:00:02 +11:00
Michael Gratton
ce4097458c Implement undo-on-send
Implement new Application.Controller::send_email method and SendEmail
application command, execute the new command when the method is called.
Call the new method from Composer.Widget when sending the command.

Closes #493
2019-11-17 20:00:02 +11:00
Michael Gratton
8f8539788d Add undo-send-delay application setting 2019-11-17 20:00:02 +11:00
Michael Gratton
884d48b854 Minor Application.Controller shutdown cleanup
Ensure all refs to closed accounts are cleared when closing them.
Remove a use of the Geary.Engine.instance global.
2019-11-17 20:00:02 +11:00
Michael Gratton
bc78622eeb Rework Composer.Widget close management
Rename Composer.Widget::should_close to ::confirm_close and actually
start closing the composer in all cases if not cancelled, so that call
sites don't need to do so manually. Simplify CloseStatus enum and
Application.Controller's management as a result.
2019-11-17 20:00:02 +11:00
Michael Gratton
0128d760c0 Clean up how Composer.Widget's presentation mode is updated
Rather than scattering the composer's detached/paned/inline mode all
over the code base, make it settable only by the containers it is
embedded in, since in that's what actually determines it.

This also lets composers be re-added to the main window if needed.
2019-11-17 20:00:02 +11:00
Michael Gratton
97e9299faa Clean up Composer.Widget header management
Make the composer's containers completely manage attaching and detaching the
the composer's header, rather than mixing it between them. Remove a use
of the global `GearyApplication.instance` var.
2019-11-17 20:00:02 +11:00
Michael Gratton
44fd56588b Clean up the Composer API
Make ComposerWidget::close method handle a lot more common code,
allowing many handlers to be simplified. Make access for some properties
more private and add accessors as appropriate, replace some "notify is
too hard" singnals with actual notify calls. Rename a few other
properties to better indicate what they do. Reintroduce `is-draft`
argument to ::load so we can accurately determine if we are loading a
draft, and so the `draft_id` param can be removed from the ctor.
Introduce a ::set_enabled method that can be used to disable and hide
the composer before closing it. Rename ::change_compose_type to
::append_to_email and reduce its scope drastically.

Drastically simplify ComposerContainer's API and its implementing
classes, reducing the API surface down to a single method call. Ensure
its properties that could be null are nullable, update call sites.

Remove dead code in all of the above classes, add more API docs.
2019-11-17 20:00:02 +11:00
Michael Gratton
29042bb2d8 Move composer classes into their own namespace
Rename all composer classes prefixed with "Composer" so that the prefix
is a namespace instead. This increases the compartmentalisation of the
classes, making `internal` a useful member modifier and makes them
consistent with the code style guide.
2019-11-17 20:00:02 +11:00
Michael Gratton
1447d1acbc Minimise DOM changes made by ComposerPageState::cleanContent JS
By overriding ComposerPageState::getHtml to accept a parameter that
supports getting HTML with empty composer parts removed, cleanContent
can simply be made to linkify the page, thus allowing a ComposerWidget
to be re-used multiple times when sending an email.
2019-11-17 20:00:01 +11:00
Michael Gratton
43803239a4 Replace Geary.Account::send_email w/ Smtp.ClientService methods
Remove Geary.Account::send_email and the sending progress monitor in
favour of exposing Geary.Smtp.ClientService as a public class and so
allowing clients to acccess those symbols from Geary.Account::outgoing.

Also make ::send_email a convenience class for doing a save/queue and
expose those operations, so clients can managage the two seperately if
desired (e.g. for undoing sending).

Finally, make Outbox.Folder public since it's exposed by the SMTP
service and maybe clients want to do something more detailed with it
anyway?
2019-11-17 20:00:01 +11:00
Michael Gratton
cc4389f41d Make Geary.ComposedEmail implement Geary.EmailHeaderSet
This allows it to be used in exchange with the Geary.Email and
RFC822.Message classes in places.
2019-11-17 19:59:19 +11:00
Michael Gratton
9b4edf5726 Util.Email.to_short_recipient_display: Consider all of to/cc/bcc
Rather than just using an email's to field, also use cc and bcc when
generating the string.
2019-11-17 16:53:42 +11:00
Michael Gratton
455eb770fd Let Application.Command instances specify if they support redo
This adds simmilar support as already exists for undo.
2019-11-17 16:53:42 +11:00
Michael Gratton
e426517b30 Rename Config class and source file to match code style
Rename `Configuration` => `Application.Configuration` and
`geary-config.vala to `application-config.vala`. Update call sites and
test cases.
2019-11-17 16:53:42 +11:00
Michael Gratton
727f395cf8 Merge branch 'wip/90-304-image-dnd-paste' into 'mainline'
Inline image drag and drop #90 and image paste from clipboard #304

See merge request GNOME/geary!343
2019-11-17 05:51:41 +00:00
Michael James Gratton
8f2563bc09 iMerge branch 'wip/90-304-image-dnd-paste' into 'mainline'
Inline image drag and drop #90 and image paste from clipboard #304

See merge request GNOME/geary!343
2019-11-17 16:42:12 +11:00