This introduces e-shell-utils for miscellaneous utility functions
that integrate with the shell or shell settings. First function
is e_shell_run_save_dialog(), which automatically remembers the
selected folder in the file chooser dialog.
Also, kill some redundant save dialog functions, as well as some
write-this-string-to-disk functions that block.
Rename e-fsutils to e-file-utils. This is where we'll add asynchronous
functions for common file I/O operations with EActivity integration.
Start with e_file_replace_contents_async() (and corresponding finish()
function). This is a simple wrapper for g_file_replace_contents_async()
which also returns an EActivity. It replaces e_write_file_uri().
Also redesign EIOActivity to -contain- a GAsyncResult rather than
implement the interface for itself. This is easier for now but I may
change my mind again when I figure out how to tie centralized error
reporting into the EActivity framework.
EIOActivity implements the GAsyncResult interface, and the idea is to
use this instead of GSimpleAsyncResult. In addition to the features
offered by EActivity, it also contains GAsyncReadyCallback information
and a GCancellable.
- Calling e_activity_cancel() triggers the GCancellable.
- Calling e_activity_complete() triggers the GAsyncReadyCallback.
Functions that follow GIO's asynchronous pattern should return an
EIOActivity (cast as an EActivity) instead of 'void', so it can be
handed to an EShellBackend or whatever else dispatches activities.
This is not yet feature-complete. It's missing API for storing result
values and GErrors. I don't have a complete picture of the final API in
my head yet, so I'll copy things over from GSimpleAsyncResult as needed.
This is due to an old hack that hiding a composer means we're closing
it so save_draft_done() destroys the composer after saved draft. But
in Anjal, the composer widget is always hidden (since the editor is
reparented to the tab), and will be wrongly destroyed by
save_draft_done() when you clicked "Save Draft" button.
This patch improved the old hack, by adding a new API
e_msg_composer_request_close() that can be used to request closing a
composer (so the old hack is no longer needed). Internally,
composer->priv->application_exiting is used to store this exiting
status.
So by this we no longer use a composer's visibility to check whether
we're to close it. When you no longer need a composer after saved
draft, call e_msg_composer_request_close() before sending the
save-draft signal.
The e_msg_composer_is_exiting() (removed by 983bea9) has to be bring
back, which is needed by other programs that use the composer (Anjal
here).
(forward ported from 08150f6 of gnome-2-28)
A new field "mail_sent" is added to the Composer to indicate whether the
mail is sent successfully or not. This is needed by Anjal to know
whether it can destroy the composer or not.
After the folder's context menu closes the folder tree selection jumps
back to the folder whose contents are showing in the message list.
Suggested by Philippe LeCavalier on evolution-list.