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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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
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.
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.
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.
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.
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.
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.
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?