Commit graph

5286 commits

Author SHA1 Message Date
Michael Gratton
259ebe50fd Re-implement single key shortcuts as a preference
Add new `single-key-shortcuts` GSetting, Application.Configuration
property and add UI for it in the Preferences window. When enabled,
load in new `single-key-shortcuts.css` file that has the appropriate
bindings. Update bindings to match Google's current set, and update
shortcut help to match.
2019-11-21 02:36:09 +11:00
Michael Gratton
fb1439264a Update MainWindow shortcuts to be keybinding signal based
Use keybinding ("action") signals and a GtkBindingSet to hook up most
of MainWindow's actions to keyboard shortcuts, rather than use
the application to do so. Remove single-key shortcuts, and update
shortcuts used to avoid collisions. Replace "focus conversation list"
action with general navigation between panes.

🚨 Remove MainWindow hack that enabled single key shortcuts to work 🚨
2019-11-21 02:26:05 +11:00
Michael Gratton
e11e2bd279 Convert prefs dialog to a HdyPreferencesWindow
Move it to the Components package, use libhandy preferences widgets
for the UI.
2019-11-20 23:16:55 +11:00
Michael Gratton
93311aeb1f Merge branch 'mjog/fix-search-not-realised' into 'mainline'
Fix criticals when activating search

See merge request GNOME/geary!372
2019-11-20 07:02:51 +00:00
Michael Gratton
8c46079078 Fix criticals when activating search
Now that MainWindow doesn't get a show_all(), need to manually set the
search bar to be visible. GTK4 can't get here soon enough!
2019-11-20 17:36:57 +11:00
Michael Gratton
cf2cfb5426 Merge branch 'mjog/636-add-account-name-validation' into 'mainline'
Fix accounts editor default name validation when adding an account

Closes #636

See merge request GNOME/geary!371
2019-11-20 06:29:46 +00:00
Michael Gratton
a278163ca9 Manually pre-validate default name in Accounts.EditorAddPane
Fixes #636
2019-11-20 17:11:14 +11:00
Michael Gratton
ca6cbecb83 Add manual Components.Validator::validator method
Support manual validation where needed, add unit tests.

This also slightly changes the behaviour of non-required field, since
an empty non-required field should be valid.
2019-11-20 17:11:14 +11:00
Michael Gratton
c9fc877d12 Ensure Components.Validator::is-valid gets notify sigs emitted 2019-11-20 14:44:17 +11:00
Michael Gratton
89642c5283 Replace uses of Gee.TreeSet where used for sorting
Add new Geary.Iterable::to_sorted_list method that should be more
performant than adding elements to a sorted set and sorting one-by-one,
use that instead of a TreeSet.
2019-11-20 12:46:36 +11:00
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