Commit graph

5276 commits

Author SHA1 Message Date
Michael Gratton
37d2898b73 Replace use of Gee.TreeSet in Util.Cache.Lru
We're getting crashes (#398, #609) in Gee.TreeSet for the LRU cache when
removing values to update the last used time for an existing cache.
Since Gee isn't currently being activaly maintained, replace use of
that class with something else.
2019-11-20 12:43:15 +11:00
Daniel Mustieles
cb7cdbbbe6 Updated Spanish translation 2019-11-19 10:04:52 +01:00
Michael Gratton
e576c780c5 Merge branch 'mjog/misc-fixes' into 'mainline'
Misc fixes

See merge request GNOME/geary!369
2019-11-19 09:00:28 +00:00
Michael Gratton
32ee1b2b06 Remove unused method 2019-11-19 19:22:38 +11:00
Michael Gratton
2b15b49e4f Fix valac criticals at build time
See GNOME/vala#835
2019-11-19 19:22:38 +11:00
Michael Gratton
e4cbff8bfa De-cruftify Geary.Collection utility functions
Remove functions that have as-convenient methods in up-tp-date Gee,
rename ::get_first to ::first so it reads better and add API docs,
replace ::to_array_list with ::copy, since that's what's actually
needed.
2019-11-19 19:22:38 +11:00
Michael Gratton
1deae845c3 Fix indentation of util-collection.vala 2019-11-19 13:23:04 +11:00
Michael Gratton
c37a5412a7 Take copies of ConversationListView's selection for undo ops
Undoable operations like trashing or marking messages need to take a
copy of the conversation lists's selection so that as the selection
changes over time, the op's underlying collection doesn't also change.
2019-11-19 10:48:47 +11:00
Michael Gratton
7f034107b0 Fix race when Application.Contoller's constructor opens a window
Don't try to open windows from the constructor since MainWindow needs
access to the controller via the applictaion, but the application can't
set the controller instance until is is constructed.
2019-11-19 10:24:23 +11:00
Michael Gratton
afedbb1f42 Merge branch 'mjog/engine-api-cleanup' into 'mainline'
Geary.Engine API cleanup

See merge request GNOME/geary!368
2019-11-18 23:09:43 +00:00
Michael Gratton
dccb81fcb1 Rework Geary.Engine lifecycle managment
Now that its singleton is gone, and since it's ::open_asyc and
::close_async methods don't do anything async, just merge the former
with the class's ctor and make the latter non-async.

Explicitly construct an instance in Application.Client and ensure it
is closed there as well instead of in the controller, for consistency.
2019-11-19 09:41:09 +11:00
Michael Gratton
2e00e9b7f7 Remove the Geary.Engine.instance singleton 🎉 2019-11-19 09:41:09 +11:00
Michael Gratton
8655030745 Rework application engine convenience methods
Now that Geary.Engine has a more convenient API, remove
Application.Controller::get_first_account and ::get_num_accounts in
favour of those.

Provide common Application.MainWwindow methods for getting and selecting
the first accoutn's inbox, call those to reduce code duplication.
2019-11-19 09:41:09 +11:00
Michael Gratton
ecfd772c07 Clean up Geary.Engine account API and implementation
Keep a single ordered list of accounts around, construct accounts
when their config is first added, and prefer accessing accounts by
config rather than id.
2019-11-19 09:41:04 +11:00
Piotr Drąg
7797af7623 Update POTFILES.in 2019-11-18 13:57:50 +01:00
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