Commit graph

3383 commits

Author SHA1 Message Date
Michael James Gratton
fad8c46e02 Fix app icons not being installed to the correct directory under Meson. 2018-01-12 18:21:34 +11:00
Michael James Gratton
5456dab49c Tidy up inclusion of libunwind in the Meson build.
* meson.build: Use libunwind and libunwind-generic to avoid having to
  search for the platform-specific lib.

* src/meson.build: Set UNW_LOCAL_ONLY define to get the most optimal
  unwind impl.
2018-01-12 18:21:26 +11:00
Michael James Gratton
d7ed670fe4 Fix valadoc errors after merging wip/778276-better-flag-updates. 2018-01-12 12:49:07 +11:00
Michael James Gratton
3aefeb0783 Update meson build after merging wip/778276-better-flag-updates. 2018-01-12 12:25:33 +11:00
Michael James Gratton
5acf0e7ace Update sources in POFILES.in. 2018-01-12 12:06:17 +11:00
Michael James Gratton
6c5a7d5868 Merge branch 'wip/778276-better-flag-updates'. Fixes Bug 778276. 2018-01-12 11:56:57 +11:00
Michael James Gratton
4cb9f2fbba Retry an account operation after a network error. 2018-01-12 11:39:44 +11:00
Michael James Gratton
7d1de0d9c0 Fix some issues opening mailboxes from Bug 789924 / commit fddf609.
* src/engine/imap-engine/imap-engine-minimal-folder.vala
  (MinimalFolder.start_open_remote): Don't check to see if the timer is
  running before opening the remote, just do it since this method is only
  called when the remote should be opened.
  (MinimalFolder.on_remote_ready): Only start opening the remote if
  actually needed.
2018-01-11 15:36:32 +11:00
Michael James Gratton
f913d18364 Fix some issues opening mailboxes from Bug 789924 / commit fddf609.
* src/engine/imap-engine/imap-engine-minimal-folder.vala
  (MinimalFolder.start_open_remote): Don't check to see if the timer is
  running before opening the remote, just do it since this method is only
  called when the remote should be opened.
  (MinimalFolder.on_remote_ready): Only start opening the remote if
  actually needed.
2018-01-11 15:35:22 +11:00
Michael James Gratton
66648a6a94 Ensure gnome-control-centre knows in advance Geary uses notifications.
* desktop/org.gnome.Geary.desktop.in: Add X-GNOME-UsesNotifications=true
  to desktop file per:
  https://wiki.gnome.org/Initiatives/GnomeGoals/NotificationSource
2018-01-11 03:22:55 +11:00
Michael James Gratton
e6ecefd827 Remove composer pref text in the online manual, it no longer exists. 2018-01-11 03:13:58 +11:00
Michael James Gratton
8b42ceda1a Update start-notification preferences text, tooltip, and user manual.
Fixes Bug 742244, again.
2018-01-11 03:13:54 +11:00
Michael James Gratton
f9fc4c7e25 Fix typos in descriptions of main-window-info-bar.vala. Bug 792359.
Patch courtesy Rafael Fontenelle <rafaelff@gnome.org>.
2018-01-10 18:39:07 +11:00
Michael James Gratton
49963daf05 Use the correct plural form when controller is closing composers.
Fixes Bug 730607.
2018-01-10 18:33:15 +11:00
Michael James Gratton
b47ce0732f Refine text of composer confirm close dialogs.
Per discussion in Bug 748555.
2018-01-10 18:32:08 +11:00
Michael James Gratton
1675f2dc25 Fix copy pasta error in schema description. Bug 792356. 2018-01-09 20:25:37 +11:00
Gautier Pelloux-Prayer
ff95fb819f Do not show "Labels" folders entry in sidemenu if there are none. Bug 754802 2018-01-09 18:35:07 +11:00
Michael James Gratton
acba774839 Fix valadoc warnings, generate internal docs rather than docs for deps.
This lets valadoc build Geary's engine docs again as long as patches for
valadoc Bug 736483 and Bug 646982 are applied (which will hopefully be
merged for vala 0.40). Once Bug 792349 is also fixed, we'll be able to
generate private docs as well.
2018-01-09 18:28:29 +11:00
Piotr Drąg
802c6b9095 Update Polish translation 2017-12-24 17:17:15 +01:00
Kristjan SCHMIDT
2ca4a4d5b4 Update Esperanto translation 2017-12-23 01:48:35 +00:00
Dušan Kazik
e334fa44f8 Update Slovak translation 2017-12-21 19:52:21 +00:00
Michael James Gratton
3a47017ee4 Stop the flag watcher running periodically.
Since we are now noticing unsolicited FETCH data when open, we don't need
to periodically run the flag watcher — it only needs to be run when first
opening a folder, so do it then.

* src/engine/imap-engine/imap-engine-minimal-folder.vala (MinimalFolder):
  Move main flag watcher operation here, call it once the folder's remote
  has opened. Remove use of EmailFlagWatcher.

* src/engine/imap-engine/imap-engine-email-flag-watcher.vala: Removed, no
  longer used.
2017-12-20 21:10:10 +10:30
Michael James Gratton
f63f7352cf Minor GenericAccount debug and comment updates. 2017-12-20 21:03:58 +10:30
Michael James Gratton
5446cc25f4 Turn some debug logging down a bit. 2017-12-20 21:02:18 +10:30
Michael James Gratton
22f20e163f Convert the account synchronizer's work into account operations.
* src/engine/imap-engine/imap-engine-account-synchronizer.vala: Replace
  the account synchronizer's queue and operations with two account
  operations, one for simply refreshing folders and one for extanding the
  vector back to the prefetch epoch.
2017-12-20 21:01:34 +10:30
Michael James Gratton
70e7ae279f Prevent the email prefetcher running multiple times.
* src/engine/imap-engine/imap-engine-minimal-folder.vala (MinimalFolder):
  Tell the prefetcher we've opened once the open count as incremented,
  rather than when the remote is connected, so it isn't signalled
  multiple times and hence doesn't add multiple listeners.
2017-12-20 20:54:32 +10:30
Michael James Gratton
9e93062d6f Create and use a common FolderOperation account operation class. 2017-12-20 20:24:30 +10:30
Michael James Gratton
8827bc2a09 Add a mock Account object. 2017-12-19 10:47:36 +11:00
Michael James Gratton
dcdbcbeef9 Add some useful Engine API mock objects. 2017-12-19 10:23:47 +11:00
Michael James Gratton
904d78f77c Minor doc comment update. 2017-12-19 09:41:51 +11:00
Michael James Gratton
b3ed537414 Pay attention when the server notifies us of altered flags.
Actually process unsolicited FETCH responses from the server rather than
dropping them when in Selected state. This means we don't need to
periodically sync flags when a folder is open.

* src/engine/imap/api/imap-folder.vala (Folder): Add new updated signal,
  fire it when an unsolicited FETCH is received. Keep FETCH (and SEARCH)
  accumulators null when no operation is in progress so we know when a
  FETCH is unsolicited.
  (Folder::exec_commands_async): Make fetched and searched lists in-args
  and let caller manage lifecycle of these collections, using them as the
  accumulators.

* src/engine/imap-engine/imap-engine-minimal-folder.vala (Move): Hook up
  to new Imap.Folder updated signal when opening, queue the replay op
  when it is fired.

* src/engine/imap-engine/replay-ops/imap-engine-replay-update.vala
  (ReplayUpdate): New replay op for handling unsolicited FETCH responses.
2017-12-19 09:41:51 +11:00
Michael James Gratton
08ed7e0375 Move impl for ReplayAppend and ReplayRemoval actually into the ops.
This de-clutters MinimalFolder and ensures they really only can be called
from the replay ops, as intended.
2017-12-19 09:41:51 +11:00
Michael James Gratton
3e6c429c72 Bump move commit timeout to something reasonable.
Committing earlier makes it much more likely the commit will actually
happen before e.g. the user closes Geary or puts the computer to sleep,
but still leaving time for "oh-no" undos.

* src/engine/imap-engine/imap-engine-revokable-move.vala (RevokableMove):
  Drop commit interval from 60s to 5s.
2017-12-19 09:41:50 +11:00
Michael James Gratton
7c72dac489 Increase the remote folder refresh interval.
Now we are getting notified of folder chnages, we can sweep for folder
changes less often.

* src/engine/imap-engine/imap-engine-generic-account.vala
  (GenericAccount): Bump remote folder refresh interval from 2 minutes to
  15 minutes.
2017-12-19 09:41:50 +11:00
Michael James Gratton
edd817240e Don't sync on email send, sync when sent mail is saved.
* src/engine/imap-engine/imap-engine-minimal-folder.vala
  (MinimalFolder::create_email_async): Send folders-contents-altered when
  we have created a message.

* src/engine/imap-engine/imap-engine-account-synchronizer.vala
  (AccountSynchronizer): Don't bother synchronising mail on send, since
  we'll now get a folders-contents-altered signal when it's actually
  saved instead.
2017-12-19 09:41:50 +11:00
Michael James Gratton
adf2b7bc7f Fire folders_contents_altered when we alter folder contents.
Ensuring f-c-a is fired means that the background sync will pick up the
changes from the operations after they happen, rather than when the next
folder refresh happens.

* src/engine/imap-engine/imap-engine-generic-account.vala
  (Account::update_folders): Provide a convenience singleton version of
  ::update_folders to fire folders_contents_altered.

* src/engine/imap-engine/imap-engine-generic-account.vala
  (RefreshFolderUnseen): Update cached status values for a folder and
  fire f-c-a signal, but only for folders that have changed.

* src/engine/imap-engine/imap-engine-minimal-folder.vala
  (MinimalFolder::copy_email_async): Fire f-c-a signal after the op
  completes.

* src/engine/imap-engine/imap-engine-revokable-move.vala (RevokableMove),
  src/engine/imap-engine/imap-engine-revokable-committed-move.vala
  (RevokableCommittedMove): Notify contents have changed when a move is
  revoked.
2017-12-19 09:41:50 +11:00
Michael James Gratton
24b7a95474 Make sure local folders are always loaded before remote folders.
This might fix an issue where folders are duplicated in FolderTable in
the db are duplicated.

* src/engine/imap-db/imap-db-account.vala (Account::clone_folder_async):
  Check the folder hasn't already been loaded before attempting to clone
  it.

* src/engine/imap-engine/imap-engine-generic-account.vala (Account): Only
  connect/disconnect to Imap.Account's ready signal when opening/closing
  the account so we don't queue a UpdateRemoteFolders op before loading
  local folders, but do queue one after a LoadFolders if the remote is
  already ready.
  (Account::update_remote_folders): Reset the update timer before
  queuing the op in case one has been already been recently queued.
2017-12-19 09:41:50 +11:00
Michael James Gratton
d9e23d553e Convert folder unseen update into an account op, only schedule if closed.
If the folder is open, we should be getting notifications of flag changes
from the server, so double-checking is kind of pointless, and since it's
implemented using an IMAP STATUS, also expensive for the server.

* src/engine/imap-engine/imap-engine-generic-account.vala
  (GenericAccount): Convert refresh_unseen_async method into a new
  RefreshFolderUnseen account operation, add a guard to ensure the folder
  is closed when executing. Remove hash map of timeouts and replace with
  a single timeout manager on MinimalFolder itself.

* src/engine/imap-engine/imap-engine-minimal-folder.vala (MinimalFolder):
  Add timeout manager for unseen update, only start it running if closed,
  when triggered, schedule a RefreshFolderUnseen op on the account.
2017-12-19 09:41:50 +11:00
Michael James Gratton
d4abaaafbc Rework GenericAccount to use an AccountOperation for loading folders.
Also fixes special folders not being present when local folders have been
loaded, but remote folders have not.

* src/engine/imap-engine/imap-engine-generic-account.vala
  (GenericAccount): Move code for enumerating local folders into new
  LoadFolders operation and enumerating remote folders into new
  UpdateRemoteFolders operation, and simplify implementation. Schedule
  the first after opening and secule the second on the old timer and when
  remote becomes ready. Replace build_folder(s) methods with new
  simplified API for adding, updating and removing folders from the
  account for operations. Grossly simplify implementation of
  fetch_folder_async() to just return cached versions, since once the two
  operations above have run, the caches should be entirely up to date.

* src/engine/api/geary-account.vala (Account): Split the
  folders_added_removed signal into folders_created and folders_deleted,
  since it makes the implementation a bit easier. Nothing is using them
  at the moment anwyay.
2017-12-19 09:41:50 +11:00
Michael James Gratton
382bd9c43e Refactor GenericAccount::new_folder a bit to make it less verbose. 2017-12-19 09:41:50 +11:00
Michael James Gratton
b24c554f51 Add an operations queue to GenericAccount for server operations.
This generalises the approach used to execute the flag watcher and
background sync, provides a high-level means of managing local and remote
operations, and provides a means of compartmentalising operation-specific
code.

* src/engine/imap-engine/imap-engine-account-operation.vala
  (AccountProcessor): Interface for denoting classes that implements some
  account-specific operation.

* src/engine/imap-engine/imap-engine-account-processor.vala
  (AccountProcessor): Class to manage the operation queue and execute
  operations.

* src/engine/imap-engine/imap-engine-generic-account.vala
  (GenericAccount): Create and manage an instance of AccountProcessor,
  add queue_operation method to allow operations to be queued.
2017-12-19 09:41:50 +11:00
Michael James Gratton
5ed7de55dd Split test running up into test-engine and test-client.
This allows us to compile the engine tests against the internal VAPI, so
we can unit test internal classes.

* CMakeLists.txt: Add top-level targets test-engine-run and
  test-client-run that execute the respective test binaries. Make
  the tests target depend on them and make them depend on their
  binaries.

* Makefile.in: Add test-client and test-engin targets for convenience.

* src/CMakeLists.txt: Make the right invocation of valac to generate a
  correct geary-engine-internal.vapi. Make gsettings schema generation
  depend on geary-client so it exists for test-client if the main binary
  hasn't been built.

* test/CMakeLists.txt: Split everything up into to builds, one for
  test-engine and the other for test-client. Use geary-engine-internal
  when building test-engine for access to internal classes and members.

* test/engine/util-idle-manager-test.vala,
  test/engine/util-timeout-manager-test.vala: Use Glib MainContext rather
  than the GTK main loop for pumping events so the test cases compile
  without GTK.

* test/test-engine.vala, test/test-client.vala: New main source file for
  test binaries based on old main.vala.
2017-12-19 09:41:50 +11:00
Michael James Gratton
9a83e95b89 Rename Geary.Nonblocking.Mailbox to Queue, make constructed type explicit.
Mailbox would produce a FIFO or priority queue depending on if you pass
in a comparator or not. This adds additional constructors to make that
explicit, and also now allows the FIFO to have its own equality
function. Renames the class to something less confusing for an email
library.

Also adds doc comments for all public members.

* src/engine/nonblocking/nonblocking-queue.vala: Renamed from
  nonblocking-mailbox.vala, rename class from Mailbox to Queue, rename
  recv_async to just 'receive'. Provide full documentation
  comments. Update call sites.
2017-12-19 09:41:50 +11:00
Michael James Gratton
724202d112 Modernise EmailPrefetcher a bit.
Not strictly necessary for this bug, but may as well since we're here.

* src/engine/imap-engine/imap-engine-email-prefetcher.vala
  (EmailPrefetcher): Use a TimeoutManager and an explicit open and close
  call from MinimalFolder.
2017-12-19 09:41:50 +11:00
Michael James Gratton
fcf3f74d77 Add a Cancellable for terminating internal folder operations.
* src/engine/imap-engine/imap-engine-minimal-folder.vala (Folder): Add
  open_cancellable member, construct new instance when opening and
  cancell then null out when closing the folder.
2017-12-19 09:41:50 +11:00
Michael James Gratton
3b025b3d41 Allow reporting problems to the client from Geary.Imap.MinimalFolder.
* src/engine/api/geary-account.vala (Account): Add a doc comment for the
  report_problem signal.

* src/engine/imap-engine/imap-engine-minimal-folder.vala (Folder): Add
  problem_report signal and notify_service_problem method for firting it.

* src/engine/imap-engine/imap-engine-generic-account.vala
  (Account::build_folders): Connect problem_report from folder through to
  the account.
2017-12-19 09:41:50 +11:00
Michael James Gratton
03d81922dd Fix a critical error invoking popup on conversation list.
* src/client/conversation-list/conversation-list-view.vala,
  src/client/conversation-viewer/conversation-message.vala,
  src/client/sidebar/sidebar-tree.vala (TreeView): Use
  Gtk.Menu.popup_at_pointer() rather than deprecated popup() method.

* src/client/util/util-gtk.vala (GtkUtil): Remove unused menu-related
  code.
2017-12-19 09:41:50 +11:00
Michael James Gratton
d89c9120ff Allow email address with "localhost" as the domain part. Fixes Bug 714299. 2017-12-19 09:41:50 +11:00
Kukuh Syafaat
a12b9a66f0 Update Indonesian translation 2017-12-19 09:41:50 +11:00
Michael James Gratton
c9076c6adb Fix Flatpak build.
* org.gnome.Geary.json: Add libunwind dep, point libgee back to master
  while we're here.
2017-12-19 09:41:50 +11:00