Commit graph

3518 commits

Author SHA1 Message Date
Michael James Gratton
7fa755f0b7 Work around composer info label being too long. Fixes Bug 790435.
* ui/composer-widget.ui: Make the info label esliipsisable, but give it a
  reasonable minimum size.

* src/client/composer/composer-widget.vala (ComposerWidget): Set the info
  label's tooltip with the text so it can still be read when ellipsed.
2018-04-14 12:46:55 +10:00
Michael James Gratton
5a9075b345 Fix TRUE/FALSE listed as composer drafts status.
* src/client/composer/composer-widget.vala (Composer): Replace use of
  inappropriate public properties and obtuse property bindings with a
  subject_changed signal and private properties that update the info
  label in their setter, so it's obvious how the whole thing works. Move
  code for managing a detached compoer's window title to the
  ComposerWindow class.
2018-04-14 12:37:22 +10:00
Michael James Gratton
7954a224cc Ensure drafts are removed when composer from address changes accounts.
This also ensure that if the user causes the from account quickly, that
there isn't any undesirable interleaving of drafts managers as multiple
instances are possibly opened and closed.

Fixes 778976.

* src/client/composer/composer-widget.vala (ComposerWidget): When
  reopening the draft manager and one exists already, discard its draft
  first. When opening a new draft manager, use a cancellable to stop any
  existing draft manager being opened, and to close any being opened when
  the widget is destroyed. Use a private var when opening/closing the
  draft managers so the class field is only updated when the instance has
  fully opened and as soon as it starts to be closed.
2018-04-14 09:35:26 +10:00
Michael James Gratton
77d33d7346 Don't display quote expander buttons when printing a message.
Fixes Bug 795216.

* ui/conversation-web-view.css: Fix syntax error in CSS, make
  geary-button elements display: none for print.
2018-04-13 16:54:57 +10:00
Stas Solovey
8c5d170c1d Update Russian translation 2018-04-12 20:03:12 +00:00
Stas Solovey
27a5c05197 Update Russian translation
(cherry picked from commit 1e93d4366d8b1f5f154c461210ec51f60e824c08)
2018-04-12 19:49:36 +00:00
Michael James Gratton
67e8a8ab93 Fix composer detach button position & visibility on custom setups.
Fixes Bug 793710.

* src/client/composer/composer-headerbar.vala (ComposerHeaderbar): Ensure
  we actually get notified when the user changes their decoration prefs
  and update detach button location correctly.

* ui/composer-headerbar.ui: Make start detach button's image visible by
  default.
2018-04-12 11:36:18 +10:00
Michael James Gratton
65f6c1127f Fix second multipart/digest message body not being displayed.
* src/client/conversation-viewer/conversation-email.vala
  (MessageViewIterator): Fix class to actually obey Gee.Iterator and
  Gee.Traversable.foreach contracts, so the first attached message has
  its body loaded when the email is loaded.
2018-04-11 16:41:30 +10:00
Michael James Gratton
3da72b2f76 Fix message body quote button styling under WebKitGTK 2.20.
* ui/conversation-web-view.css: Replace bogus ">>" with simple descendent
  selector.
2018-04-11 14:01:54 +10:00
Michael James Gratton
cfaee5cb58 Further work around issues presenting windows under gnome-shell.
Follow-up to Bug 776881 and commit e333794f, fixes Bug 794264.

* src/client/application/geary-application.vala,
  src/client/composer/composer-container.vala: Use
  GLib.get_monotonic_time() instead of get_real_time() when calling
  Gtk.Window.present_with_time to avoid issues with mutter/gnome-shell
  alt-tabbing.
2018-04-11 12:02:42 +10:00
Michael James Gratton
71d05b6ce0 Reduce CPU use when idle.
It looks like Gtk.Spinner triggers repaints when running, even when the
widget is not visible. This ensures the conversation is stopped when not
visible.

Fix for Bug 783025.

* src/client/conversation-viewer/conversation-viewer.vala
  (ConversationViewer): Start the conversation spinner when showing it,
  stop the conversation spinner when it is hidden.
2018-04-09 12:31:39 +10:00
Michael James Gratton
2149f74c99 Merge branch 'wip/794174-conversation-monitor-max-cpu'. Fixes Bug 794174. 2018-04-07 10:04:20 +10:00
Michael James Gratton
3bf2ac181a Add unit tests for ConversationMonitor, fix a few issues.
* src/engine/app/app-conversation-monitor.vala (ConversationMonitor):
  Don't check the folder blacklist for external folder signals when the
  signal is received, do it when the operation is executed so it's fresh.

* src/engine/app/conversation-monitor/app-fill-window-operation.vala
  (FillWindowOperation): Only re-fill the conversation if we get a full
  load, anything else means we hit the end of the folder.

* test/engine/app/app-conversation-monitor-test.vala: New unit tests
  for ConversationMonitor.

* test/engine/api/geary-account-mock.vala,
  test/engine/api/geary-folder-mock.vala: Mix in MockObject mock up all
  method calls.

* test/engine/api/geary-email-identifier-mock.vala: Fix the comparator
  method when the other instance is null.
2018-04-07 10:02:24 +10:00
Michael James Gratton
0ea1fe6c35 Don't use the database for internal ConversationMonitor bookkeeping.
This replaces the use of Geary.Folder.find_boundaries_async in
ConversationMonitor with a simple sorted set of known in-folder message
ids. This is both easy and fast, reduces needless DB load when loading
conversations, and also allows allows removing what is otherwise
single-use implementation overhead in classes deriving from Folder.

* src/engine/app/app-conversation-monitor.vala (ConversationMonitor):
  Replace get_lowest_email_id_async() with window_lowest property, update
  call sites. Implement the property by using a sorted set of known
  listed email ids from the base folder. Update the set as messages in
  the base folder are listed. Rename notify_emails_removed to just
  removed and remove ids from the set if any messages from the base
  folder are removed.

* src/engine/api/geary-folder.vala (Folder): Remove
  get_lowest_email_id_async since it is now unused, do same for all
  subclasses.
2018-04-07 10:02:24 +10:00
Michael James Gratton
712088061b Add a mock object mixin that can check call expectations on mocks.
* test/mock-object.vala: Add initial mock object implementation.

* test/test-case.vala; Add some useful high level assertion functions.
2018-04-07 10:02:18 +10:00
Michael James Gratton
15748cef03 Tidy up unit test infrastructure and mock classes.
* test/api/*.vala: Renamed files that contained mock objects to *-mock.vala,
  not *-test.vala.

* test/testcase.vala: Renamed to test-case.vala for consistency, remove
  TestCase class from Gee package since that's really not true. Clean up
  code for consistency.

* test/meson.build, test/CMakeLists.txt: Split TestCase compilation out
  into a separate test lib.
2018-04-07 09:41:18 +10:00
Michael James Gratton
50f73ff252 Allow test fixtures and test methods to throw errors by default.
* test/testcase.vala (TestCase): Add a generic throws clause to both
  TestMethod and set_up and tear_down, update subclasses.
2018-04-07 09:41:18 +10:00
Marek Černocký
6b24e07e56 Updated Czech translation 2018-03-25 08:16:29 +02:00
Dušan Kazik
d0c611d48e Update Slovak translation 2018-03-18 20:56:20 +00:00
Piotr Drąg
4e9ca65d3a Update Polish translation 2018-03-18 17:40:09 +01:00
Andre Klapper
507da1abb5 Remove non-existing anchor link (target removed in 6b88f82) 2018-03-18 14:52:34 +01:00
Kukuh Syafaat
fa87133fdd Update Indonesian translation 2018-03-16 03:40:09 +00:00
Balázs Meskó
f401037581 Update Hungarian translation 2018-03-15 14:14:08 +00:00
Alan Mortensen
23d9214cd7 Updated Danish translation 2018-03-12 11:58:46 +01:00
Rafael Fontenelle
3235ecb0ff Update Brazilian Portuguese translation 2018-03-11 05:29:26 +00:00
Michael James Gratton
5f60b18876 Fix the build for people who don't have libgee 0.20 installed.
* src/engine/app/conversation-monitor/app-conversation-operation-queue.vala:
  Don't use Gee.Traversable.any_match, we can't depend on 0.20 yet.
2018-03-06 16:29:32 +11:00
Michael James Gratton
9402c35428 Update dev convenience makefile.
* Makefile: Add a verbose build target, use proper dependencies for
  binary and valadoc copying.
2018-03-05 23:38:47 +11:00
Michael James Gratton
a75391c676 Merge branch 'wip/fix-reference-tracking' 2018-03-05 23:34:06 +11:00
Michael James Gratton
c9b53863e8 Further improvements handling unreliable/offline networks. Bug 789924.
Re-merge branch 'wip/789924-network-transition-redux'.
2018-03-05 23:15:41 +11:00
Michael James Gratton
5b8618a573 Fix crash when opening new IMAP client session as the engine is closing. 2018-03-05 23:15:19 +11:00
Michael James Gratton
675d7d3a9a Don't let a task try to re-open a folder while it is being closed.
Really (for sure this time) ensure folder opening/closing is not racy by
using the same mutex to guard the complete opening and closing processes.

* src/engine/imap-engine/imap-engine-minimal-folder.vala (MinimalFolder):
  Rename open_mutex to remote_mutex since it's only actually used when
  opening a remote session. Rename close_mutex to lifecycle_mutex and
  ensure that has always been claimed when manipulating the
  open_count. In particular, ensure that all of open_async is executed
  under that mutex and ensure that both decrementing the close count, and
  the complete actual closing process is always protected by it as well.
2018-03-04 23:36:12 +11:00
Michael James Gratton
cf86d07b54 Make ConversationMonitor more robust with no/changing connectivity.
Conversation monitor was built around older assumptions of how a folder's
remote connections work - that once a folder opens it will likely also
eventually establish a remote connection, that once the connection is up
it will hang around, and so on.

This patch removes any public notion of (re)seeding, since it can't be
relied to actually happen over the course of the session, ensures that
all folder operations are local-only when the folder does not have a
working remote connection so it doesn't block, and take the opportunity
to reorganise and clean up the monitor API and documentation comments.

* src/engine/app/app-conversation-monitor.vala (ConversationMonitor):
  Remove seed signals, and don't bother running an initial reseed if the
  folder is already open, since the fill operation will cause any locally
  incomplete messages to be filled out from the report. Manage and use an
  internal Cancellable for cancelling internal operations when shutting
  down. Construct a queue only when starting to monitor conversations,
  delete it when stopping. Move as much operation-specific code into the
  operations themselves as reasonably possible, making some methods
  internal so thy can be accessed from the ops. Ensure all folder listing
  operations specify LOCAL_ONLY when the remote is not open. Removed
  LocalLoadOperation since that is now redundant. Update the API for
  accessing conversations to match Gee conventions and update call
  sites. Update documentation comments. Hook back up to locally-complete
  signals so we don't miss emails being filled out by the prefetcher, for
  now.

* src/engine/app/conversation-monitor/app-conversation-set.vala
  (ConversationSet): Rename conversations property to match Gee
  conventions, update call sites.

* src/engine/app/conversation-monitor/app-conversation-operation.vala
  (ConversationOperation): Allow operations to specify if they should
  allow duplicates, and allow the execution method to throw errors, so
  they can be handled in a uniform way.

* src/engine/app/conversation-monitor/app-conversation-operation-queue.vala
  (ConversationOperationQueue): Accept progress monitor property as a
  ctor arg rather than constructing on itself, so it is tied to the
  life-cycle of the ConversationMonitor rather than the queue. Add a
  signal for notifying of errors thrown when running operations, and use
  the new operation-independent support for determining if duplicates
  should be queued.

* src/engine/app/conversation-monitor/app-fill-window-operation.vala
  (FillWindowOperation): Enforce a maximum window size as well as minimum
  to keep loading large windows semi-responsive. Remove code to handle
  inserts now that they are handled by their own op.

* src/engine/app/conversation-monitor/app-insert-operation.vala
  (InsertOperation): New operation to manage inserts, handle it them by
  simply adding them to the conversation if they are newer than the
  oldest message, rather that relisting all loaded messages.
2018-03-04 23:36:12 +11:00
Michael James Gratton
3944884269 Improve IMAP client session pool management.
Close released client sessions when there are too many, and try harder to
not give out bad sessions when one is being claimed.

* src/engine/imap/transport/imap-client-session-manager.vala
  (ClientSessionManager): Add a maximum free session tunable and release
  any client sessions returned if it would otherwise exceed this
  threshold. When claiming a session, ensure that an older session is
  still good by sending a NOOP before returning it.
2018-03-03 11:08:13 +11:00
Michael James Gratton
3f0b8c98c4 Ensure account synchroniser re-uses client sessions properly.
This ensures that when an account synchroniser account op completes and
its folder is closing completely, that it waits for this to complete
fully. Thus when the next op executes, it can re-use the same client
session.

This, along with recent other recent changes on the branch, gets the
total client session count on app start down to 2 simultaneous
connections only, instead of 3 or 4.

* src/engine/imap-engine/imap-engine-account-synchronizer.vala
  (RefreshFolderSync): If closing the folder causes it to be completely
  closed, wait for that to happen so the session is released to the pool
  before the next op runs.

* src/engine/imap-engine/imap-engine-minimal-folder.vala (MinimalFolder):
  Make close_remote_session async so it can wait for the session to be
  fully released, including returning the session to the pool. Update
  call sites.

* src/engine/imap-engine/imap-engine-generic-account.vala
  (GenericAccount): Make release_folder_session async so that
  MinimalFolder can wait for it to be fully released, including returning
  the session from Selected state. Update call sites.
2018-03-03 11:08:13 +11:00
Michael James Gratton
9070380fc8 Tidy up IMAP folder session management.
* src/engine/imap-engine/imap-engine-generic-account.vala
  (GenericAccount): Don't attempt to claim two client sessions when
  opening a folder, rather claim one and use as both an account session
  and a folder session. Rename open_folder_session to
  claim_folder_session to be consistent with account session API, update
  call sites.

* src/engine/imap-engine/imap-engine-minimal-folder.vala (MinimalFolder):
  Ensure the remote session is automatically re-established if
  appropriate on disconnect. Tidy up debug output and some comments.
2018-03-03 11:08:13 +11:00
Michael James Gratton
9cedfaf0d8 Remove GenericAccount's IMAP account session attribute.
For most of the time, GenericAccount does not need an open client
session, yet it always claims one from the pool on open and hangs on to
it. This means that the account synchroniser for example cannot use the
same session to perform sync, requiring an additional session to be
opened.

This patch removes the held session with methods to claim and release
account sessions instances for those code paths that need it, allowing
the previously claimed session to be re-used when not in use.

* src/engine/imap-engine/imap-engine-generic-account.vala
  (GenericAccount): Remove remote_open_lock and remote_session, just
  claim new client sessions from the pool as needed instead. Add
  release_account_session to allow claimed sessions to be returned to the
  pool. Update uses of remote_session to claim and release instead.

* src/engine/imap/transport/imap-client-session-manager.vala
  (ClientSessionManager): Update ready signal to include a parameter
  indicating if ready or not, so GenericAccount can still block
  claim_account_session callers when not ready. Rework all code that sets
  is_ready to use a common notify method that both does that and fires
  the signal, and rework all code paths that stop the pool to use a
  common code path that uniformly resets timers, notifies no longer
  ready, and drops all client sessions.

* src/engine/imap/api/imap-account-session.vala: Remove distinction
  between fetch_folder_async and fetch_folder_cached_async
  since account session objects are now short-lived.
2018-03-03 11:08:13 +11:00
Michael James Gratton
e78313df52 Improve doc comments for Email, Folder and RFC822.Message.
fixup and reword 79b9bbe
2018-03-03 11:07:45 +11:00
Claude Paroz
2fde941b94 Update French translation 2018-03-01 22:01:37 +00:00
GNOME Translation Robot
0d501196eb Update Dutch translation 2018-02-26 20:43:57 +00:00
Michael James Gratton
05f676005d Remove some unused and unclear Folder.OpenState values. 2018-02-26 23:35:39 +11:00
Michael James Gratton
61f739b128 Ensure MinimalFolder is only closed at most once if open_count is 1. 2018-02-26 23:21:00 +11:00
Michael James Gratton
17e8059918 Ensure some timeout managers are reset as needed. 2018-02-26 23:20:54 +11:00
Michael James Gratton
ab346b8f37 Minor leftover code cleanup. 2018-02-26 23:02:51 +11:00
Michael James Gratton
129c3a26a8 Clean up how GearyController manages account-related objects.
* src/client/application/geary-controller.vala (GearyController): Rather
  than using several per-account maps, one for each type of related
  object, introduce an AccountContext object that collects all related
  objects together and use a single map from an account's info object to
  the context object. When closing the controller, close each account in
  the same way as it would be done if the account was closed normally, so
  that the same cleanup occurs.
2018-02-26 23:02:50 +11:00
Michael James Gratton
a6945b12b0 Fix a number of objects being leaked at shutdown. 2018-02-26 23:02:50 +11:00
Michael James Gratton
635d3a947a Fix some serious run-time memory leaks.
* src/client/components/client-web-view.vala (ClientWebView): Fix
  instances being leaked due to circular ref when registering JS message
  handlers.

* src/engine/util/util-idle-manager.vala,
  src/engine/util/util-timeout-manager.vala: Fix instances and classes
  using these being leaked due to reference loop when used with closures
  as callbacks.
2018-02-26 23:02:50 +11:00
Michael James Gratton
be9a02eaf7 Enable app reference tracking for objects such as GTK+ widgets.
This splits Geary.BaseObject up into a class an interface so that classes
derived from a pre-existing, non-GLib.Object class can still use the
reference tracking infrastructure, and adds the mixin interface to a
number of key client classes such as MainWindow and ClientWebView.

* src/engine/api/geary-base-object.vala: Split Geary.BaseObject up into a
  class an interface so that classed derived from a pre-existing,
  non-GLib.Object class can still use the reference tracking
  infrastructure.
2018-02-26 23:02:50 +11:00
Daniel Mustieles
7ca4b1a05f Updated Spanish translation 2018-02-22 14:02:30 +01:00
Michael James Gratton
edb4a0d1d5 Fix reference tracking logs not being output when enabled.
* src/client/application/geary-application.vala (Application): Use
  Application.quit to exit normally rather Gtk.main_quit so that control
  is returned to the main() entry-point.
2018-02-21 11:27:52 +11:00
Mario Blättermann
2419d89b26 Update German translation 2018-02-18 15:34:09 +00:00