Commit graph

3208 commits

Author SHA1 Message Date
Ask Hjorth Larsen
5b815f70d5 Updated Danish translation 2017-11-11 18:44:51 +01:00
Dušan Kazik
499b92e863 Update Slovak translation 2017-11-11 09:19:42 +00:00
Michael James Gratton
2af9412740 Merge branch 'wip/768422-namespace-support'. Fixes Bug 768422 and Bug 726866. 2017-11-10 00:29:51 +11:00
Michael James Gratton
b7ffd8242f Fix MainWindow not appearing when no passwords stored in keyring.
Fixes problem introduced by commit 157a109e.

* src/client/application/secret-mediator.vala (SecretMediator): Recreate
  SCHEMA_COMPAT_NETWORK schema object locally since using a CCcodr attr
  doesn't seem to work.
2017-11-06 19:21:54 +11:00
Piotr Drąg
b68f2c6afc Update Polish translation 2017-11-05 16:06:12 +01:00
Matej Urbančič
0d14189ec7 Updated Slovenian translation 2017-11-04 13:02:07 +01:00
Marek Cernocky
ec469e40ed Updated Czech translation 2017-11-03 11:26:12 +01:00
Michael James Gratton
21421f8d48 Add unit tests for NAMESPACE parsing, CREATE serialisation, fix an error. 2017-11-03 16:52:21 +11:00
Michael James Gratton
13f8aa88ca Minor code cleanup. 2017-11-03 13:56:31 +11:00
Michael James Gratton
24bed9074f Minor special use handling clean up.
* src/engine/imap-engine/imap-engine-generic-account.vala
  (Account::update_folders_async): Don't fall over creating special use
  folders if only one fails.

* src/engine/imap/response/imap-mailbox-attributes.vala
  (MailboxAttributes::get_special_folder_type): Remove duplicate clause.
2017-11-03 13:56:07 +11:00
Michael James Gratton
2015a72802 Add support for creating special use mailboxes.
The IMAP CREATE-SPECIAL-USE extension allows specifying the use of a
mailbox being created. We should use it if present.

* src/engine/imap/api/imap-account.vala (Account::create_folder_async):
  Add optional SpecialFolderType param, if present use command variant
  that accepts it.

* src/engine/imap/command/imap-create-command.vala (Command): Add
  additional ctor that accepts a SpecialFolderType param. If present,
  add a USE list to the command sent.

* src/engine/imap/response/imap-capabilities.vala (Capabilities): Add
  CREATE-SPECIAL-USE to the list of known capabilities, sort the list.
2017-11-03 13:53:14 +11:00
Michael James Gratton
bcca3f0332 Use default personal namespace when creating special folders. Bug 726866.
* src/engine/imap/api/imap-account.vala (Account): Add
  get_default_personal_namespace() method to return a folder at the root
  of the default personal namespace.

* src/engine/imap/transport/imap-client-session.vala (ClientSession):
  Make inbox and namespace attrs into RO internal properties so Account
  can access them.

* src/engine/imap-engine/imap-engine-generic-account.vala
  (Account::ensure_special_folder_async): Get the default namespace
  folder and use that when checking for matching folders, rather than
  trying to guess just at the root then INBOX. If not found, assume the
  folder should be a child of the root.
2017-11-03 13:49:04 +11:00
Michael James Gratton
e361dc649a Further Imap.Account API tweaks.
* src/engine/imap/api/imap-account.vala
  (Account:list_child_folders_async): Renamed to
  fetch_child_folders_async to match other remote-y methods, make returb
  value non-null since nulls suck. Fix call site.
2017-11-03 13:41:36 +11:00
Michael James Gratton
3443b7f7dd Slighly improve sorting of po/POTFILES.in 2017-11-03 13:05:47 +11:00
Piotr Drąg
c6481c6f6d Translate GSchema
https://bugzilla.gnome.org/show_bug.cgi?id=771643
2017-11-03 13:05:47 +11:00
Piotr Drąg
42294ba38b Add XML declaration to the GSchema file 2017-11-02 18:57:21 +01:00
Piotr Drąg
9c1078ad16 Remove intltool markers from <caption> tags in AppData 2017-11-02 17:36:24 +01:00
Piotr Drąg
bfef27ed88 Add translator comments to .desktop files 2017-11-02 17:20:01 +01:00
Alan Mortensen
3e2389311c Updated Danish translation 2017-11-02 13:00:58 +01:00
Michael James Gratton
2a0fa4c746 Merge branch 'wip/771643-replace-intltool'. Fixes Bug 771643. 2017-11-02 19:15:08 +11:00
Michael James Gratton
e9bf7da63a Merge branch 'wip/784300-unlock-keyring'. Fixes Bug 784300. 2017-11-02 19:12:41 +11:00
Michael James Gratton
5dc8ace41c Merge branch 'wip/781488-aliyun-greeting-error'. Fixes Bug 781488. 2017-11-02 19:12:14 +11:00
Michael James Gratton
9ac2b05a23 Ensure syntax errors are always reported by the deserialiser.
Add unit tests.

* src/engine/imap/transport/imap-deserializer.vala (Deserialiser): Add a
  new EOL even handler to the FAILED state that is the one place where
  the deserialize_failure() signal is fired and that any existing params
  are reset.
  (Deserialiser::push_line): Remove signal calls and unused return
  value. Don't use EOS to detect NUL to avoid some confusion. Ensure an
  EOL event is always fired so that the FAILED EOF handler is always run.
  (Deserialiser::push_data): Remove signal calls and unused return value.
  (Deserialiser::flush_params): Don't bother returning a state, since we
  now always know what the next one should be when calling it. Only
  trigger the parameters_ready() signal if there is a valid
  parameter. Make logging consistent with the rest of the class.
  (Deserialiser::reset_params): New common method for resetting any
  existing deserialised message.
  (Deserialiser::on_literal_char): Minor tidy up.
  (Deserialiser::on_eos): Ensure that any existing param is sent on EOS
  so that any BYE+EOS sent by the server is picked up.
2017-11-02 19:10:29 +11:00
Michael James Gratton
25e700d22a Allow IMAP atoms to be terminated by an atom-special w/o needing a space.
Fixes Bug 781488.

* src/engine/imap/transport/imap-deserializer.vala (Deserializer): Update
  char handling in START_PARAM state to be more explict and to handle all
  possible chars, not just a subset. Then, simply defer to START_PARAM to
  determine what to do when an invalid atom char is encountered when in
  the ATOM state. Rename SYSTEM_FLAG state to just FLAG since it also
  handles extension flags, and only use it for handling the first char in
  the flag so "\*" can be treated appropriately, then defer to the ATOM
  state, so flag keywords are treated in the same way as regular
  atoms. Add unit tests.
2017-11-02 19:10:29 +11:00
Michael James Gratton
8adddddad3 Tidy up deserialiser source a bit.
* src/engine/imap/transport/imap-deserializer.vala: Remove unused object
  attr, reorder signals based on priority, make is_halted() public so
  test cases can call it, put public methods up the top.
2017-11-02 19:10:29 +11:00
Michael James Gratton
bbcf57c8eb Add test case stub for Geary.Imap.Deserializer to the build. 2017-11-02 19:10:29 +11:00
Michael James Gratton
4224c52683 Assorted async test case fixes.
* test/testcase.vala (TestCase): Make the test case's main loop
  accessible to subclasses so they are using the same one we are.
  (TestCase::async_result): Use GLib main context rather than GTK+ main
  loop so that test cases with async methods work even when GTK+ not
  present.
  (TestCase::async_complete): Ensure the main loop is woken when an async
  test completes so the test case doesn't block if it loses the race with
  async_result();
2017-11-02 19:10:29 +11:00
Michael James Gratton
3157fb7952 Workaround a xgettext warning about a Vala verbatim comment. 2017-11-02 19:10:29 +11:00
Michael James Gratton
e05de4ccec Workaround xgettext not recognising Elementary Contractor files.
We can't just simply run xgettext twice (once as normal, once with just
the contractor file and passing "--desktop" as an arg, since
l10n.gnome.org won't pick up the second pass and the contract will remain
untranslated.

So work around by renaming the contractor file such that it is
recognised, then rename it back to normal when translating it.

* desktop/geary-attach.contract.in: Renamed to
  desktop/geary-attach.contract.desktop.in.

* desktop/CMakeLists.txt: Undo the rename when translating.

* po/CMakeLists.txt, po/Makevars: Add a xgettext keyword for the
  contractor Description field.

* po/POTFILES.in: Chase the file rename.
2017-11-02 19:10:29 +11:00
Michael James Gratton
643c65a954 Remove obsolete X-GNOME-FullName key from desktop files. 2017-11-02 19:10:29 +11:00
Michael James Gratton
a8d3b21f05 Re-enable top level cmake/Makefile "pot_file" target for po/geary.pot. 2017-11-02 19:10:29 +11:00
Michael James Gratton
66b83f7eaa Add po/Makevars hint for Damned Lies (a.k.a. l10n.gnome.org). 2017-11-02 19:10:29 +11:00
Niels De Graef
39ef8e3e2d Replace intltool with gettext. Bug 771643.
Signed-off-by: Niels De Graef <nielsdegraef@gmail.com>
2017-11-02 19:10:29 +11:00
Michael James Gratton
97f880b190 Fix move and copy menu button ids in the main toolbar. 2017-11-02 19:09:30 +11:00
Michael James Gratton
ee567ed205 Restore Archive toolbar label.
* ui/main-toolbar.ui: Update min GTK version, add label to Archive button.
2017-11-02 19:09:30 +11:00
Niels De Graef
97ce3d09cd Start the final part of bug 713991.
* Ported Gtk.Action to GLib.Action in the GearyController.
* Removed Gtk.AccelGroups (handled through Gtk.Application now).
* Got rid of Gtk.UiManager (now all is done through Gtk.Builder).
* Throw away workaround for conflicting Gtk.Actions in ComposerContainer.
* Aggregate zoom in/out/normal into one parameterized zoom action.

Signed-off-by: Niels De Graef <nielsdegraef@gmail.com>
2017-11-02 19:07:01 +11:00
Michael James Gratton
ddd9aabcf1 Fix HTML signatures that are single IMG tags not recognised as HTML.
* src/engine/util/util-html.vala (smart_escape): Don't bother attempting
  to match a pair of tags, just something that looks like an opening tag,
  since IMG is an empty element and it is valid to not have a closing
  slash in HTML. Also, closing tags in HTML are optional anwyay. Add some
  unit tests.
2017-11-02 19:05:26 +11:00
Michael James Gratton
aebdfd6b82 Attempt to unlock the libsecret keyring before accessing secrets.
Fixes Bug 784300.

* src/client/application/secret-mediator.vala (SecretMediator): Add
  check_unlocked() method, call that up front from the public mediate API
  methods.
2017-11-02 19:05:26 +11:00
Michael James Gratton
157a109e7f Remove custom libsecret VAPI in favour of the system-provided one.
This gives us access to the full libsecret API.

* bindings/vapi/libsecret-1.vapi: Deleted.

* src/client/application/secret-mediator.vala (Object): Use an internal
  binding to the missing SCHEMA_COMPAT_NETWORK constant.
2017-11-02 19:05:26 +11:00
Michael James Gratton
cac73f41cf Use Imap.ClientSession for mapping between folder and mailbox names.
Now that ClientSession is storing per-connection inbox and namespace
data, we want to always consult with the account or folder's session to
determine the correct Imap.MailboxSpecifier name for a high-level
Geary.FolderPath, and vice versa.

This is enforced by removing all inbox and delim information from Imap.Accout
and Imap.Folder, and providing methods to translate between
MailboxSpecifier and FolderPath, then fixing up the fallout.

* src/engine/imap/transport/imap-client-session.vala (ClientSession): Add
  methods for obtaining the delimiter and converting between foler paths
  and mailbox names, based on information obtainined from the IMAP server
  for this connection.

* src/engine/imap/api/imap-account.vala (Account): Remove
  path_to_mailbox, inbox_specifier, and hierarchy_delimiter object
  attributes since these are connection specific. Convert from caching
  all mailbox specifiers retreived from the server and some Imap.Folder
  instances to simply cache all Folder instances. Substantially rework
  the public API implementation as below to support this and update all
  call sites.
  (Account::folder_exists_async): Actually hit the server rather than
  justing looking at the cache to determine if the folder exists, remove
  a folder from the cache if not.
  (Account::fetch_folder_async): Renamed from
  "fetch_unrecycled_folder_async" so as to be a bit less obtuse, updated
  call sites.
  (Account::fetch_folder_cached_async): Renamed from fetch_folder_async
  to be a bit more obvious. Substantially simplified, deleates to
  fetch_folder_async() rather than list_children_async() method, so we
  don't need list all children of its parent and hence to do a status for
  each. Rather than passing a "created" flag out and forcing call sites
  to then do a second call to update message counts, just simply take a
  boolean param indicating if we should do it here.
  (Account::list_child_folders_async): Simplified a bit, updated to
  create and cache an Imap.Folder for each child.
  (Account::fetch_counts_async): Removed and merged into
  fetch_folder_cached_async() since the only call site was replaced by
  the new refresh_counts param on that method.
  (Account::send_list_async, send_status_async): renamed from
  list_children_async and fetch_status_async, to make it obvious about
  what they are actually doing. Added an instance of ClientSession as
  first param so they don't have to re-claim the same session.
  (Account::send_command_async, send_multiple_async): Also add an
  instance of ClientSession as first param so they don't have to re-claim
  a session after the public methods calling them have already done so.

* src/engine/imap/api/imap-folder.vala (Folder): As for Imap.Account,
  remove mailbox info delim (these were redundant anyway) and replace
  uses on the folder's client session for converting between folder paths
  and mailbox names.

* src/engine/api/geary-folder-path.vala (FolderPath): Remove
  get_fullpath(), since having it would only encourage API users to do
  the wrong thing.

* src/engine/imap/message/imap-mailbox-specifier.vala
  (MailboxSpecifier::from_folder_path): Ensure the inbox name is also
  passed in and manually construct a mailbox name from a FolderPath so
  the connection's actual inbox name ca be substituted in.
2017-11-02 18:05:54 +11:00
Michael James Gratton
97b0770730 Initial IMAP inbox and namespace information in client session.
Since each IMAP connection may have different notions of namespaces and
mailbox hierarchy delimiters, inbox names, and so on, store this
information per-connection rather than per-account.

Don't remove uses of old inbox and delimiters yet, that will be next.

* src/engine/imap/api/imap-account.vala (Account): Remove list_inbox()
  and its single call site.

* src/engine/imap/transport/imap-client-session.vala (ClientSession): Add
  class attributes for storing namespace prefix and mailbox hierarchy
  delimiter information for the inbox and RFC 2342 namespaces. Add a
  namespace signal, fire it when a namespace server response is reached.
  (ClientSession::initiate_session_async): After logging in and enabling
  compression, obtain the mailbox info for the inbox and either namespace
  information if supported, or else attempt to guess what the default user
  mailbox is.
2017-11-02 17:29:17 +11:00
Michael James Gratton
cf724f8c3e Engine and IMAP stack documentation comment updates. 2017-11-02 17:18:28 +11:00
Michael James Gratton
93d63e6966 Allow "" to be used by geary-console as an empty string arg. 2017-11-02 17:16:41 +11:00
Michael James Gratton
53dd5a5f69 Add initial NAMESPACE command, response and console support.
Bug 768422
2017-11-02 17:16:41 +11:00
Michael James Gratton
2a9f749145 Fix HTML signatures that are single IMG tags not recognised as HTML.
* src/engine/util/util-html.vala (smart_escape): Don't bother attempting
  to match a pair of tags, just something that looks like an opening tag,
  since IMG is an empty element and it is valid to not have a closing
  slash in HTML. Also, closing tags in HTML are optional anwyay. Add some
  unit tests.
2017-11-02 17:16:41 +11:00
Michael James Gratton
492ae7b8fe Ensure syntax errors are always reported by the deserialiser.
Add unit tests.

* src/engine/imap/transport/imap-deserializer.vala (Deserialiser): Add a
  new EOL even handler to the FAILED state that is the one place where
  the deserialize_failure() signal is fired and that any existing params
  are reset.
  (Deserialiser::push_line): Remove signal calls and unused return
  value. Don't use EOS to detect NUL to avoid some confusion. Ensure an
  EOL event is always fired so that the FAILED EOF handler is always run.
  (Deserialiser::push_data): Remove signal calls and unused return value.
  (Deserialiser::flush_params): Don't bother returning a state, since we
  now always know what the next one should be when calling it. Only
  trigger the parameters_ready() signal if there is a valid
  parameter. Make logging consistent with the rest of the class.
  (Deserialiser::reset_params): New common method for resetting any
  existing deserialised message.
  (Deserialiser::on_literal_char): Minor tidy up.
  (Deserialiser::on_eos): Ensure that any existing param is sent on EOS
  so that any BYE+EOS sent by the server is picked up.
2017-10-31 18:19:28 +11:00
Michael James Gratton
db4c4f785f Allow IMAP atoms to be terminated by an atom-special w/o needing a space.
Fixes Bug 781488.

* src/engine/imap/transport/imap-deserializer.vala (Deserializer): Update
  char handling in START_PARAM state to be more explict and to handle all
  possible chars, not just a subset. Then, simply defer to START_PARAM to
  determine what to do when an invalid atom char is encountered when in
  the ATOM state. Rename SYSTEM_FLAG state to just FLAG since it also
  handles extension flags, and only use it for handling the first char in
  the flag so "\*" can be treated appropriately, then defer to the ATOM
  state, so flag keywords are treated in the same way as regular
  atoms. Add unit tests.
2017-10-31 18:19:28 +11:00
Michael James Gratton
1f973bfdd3 Tidy up deserialiser source a bit.
* src/engine/imap/transport/imap-deserializer.vala: Remove unused object
  attr, reorder signals based on priority, make is_halted() public so
  test cases can call it, put public methods up the top.
2017-10-31 18:19:28 +11:00
Michael James Gratton
fc68c0d7d5 Add test case stub for Geary.Imap.Deserializer to the build. 2017-10-31 18:19:28 +11:00
Michael James Gratton
019499619b Assorted async test case fixes.
* test/testcase.vala (TestCase): Make the test case's main loop
  accessible to subclasses so they are using the same one we are.
  (TestCase::async_result): Use GLib main context rather than GTK+ main
  loop so that test cases with async methods work even when GTK+ not
  present.
  (TestCase::async_complete): Ensure the main loop is woken when an async
  test completes so the test case doesn't block if it loses the race with
  async_result();
2017-10-31 18:19:28 +11:00