Commit graph

3030 commits

Author SHA1 Message Date
Michael James Gratton
2f145ac76f Set the WK data dir so we don't pick up WK default local storage. 2017-03-06 13:46:10 +11:00
Michael James Gratton
919aea1516 Make MainWindow and ComposerWindow uniquely targetable via CSS.
Fixes Bug 746590.
2017-03-06 13:20:16 +11:00
Gautier Pelloux-Prayer
2cb1fdb0be Show main window on startup. Bug 779549 2017-03-05 20:12:06 +01:00
Michael James Gratton
00718198fa Migrate to custom libsecret schema & use host, login & proto as key.
Fixes Bug 779102, Bug 768121.

* src/client/application/secret-mediator.vala: Rework to use custom Geary
  libsecret schema, using new app id as schema name. Use protocol, login
  and hostname as key instead of just account id to avoid flatpak
  installs with different account ids clobbering normal install's saved
  passwords. Drop 0.1 migrations since that's pretty old now.

* src/engine/api/geary-service.vala (Service): Add ::name method to
  return useful machine-readable version of the protocol.
2017-03-05 20:38:16 +11:00
Michael James Gratton
485b8c8598 Fix messages not being auto-marked read on scroll.
Fixes bug introduced by commit 07966a1.

* src/client/conversation-viewer/conversation-viewer.vala
  (ConversationViewer::load_conversation): Remove old conversation before
  loading the new one, so the list box picks up the new scrolled window's
  hadjustment rather than the old one.
2017-03-04 14:05:20 +11:00
Michael James Gratton
57ca408c53 Fix composer UI brokenness when compiled under vala 0.36.
Don't rely ComposerState::state notify and property bindings firing when
the value hasn't actually changed to update the composer's UI. This is
works around Vala Bug 631267 landing.

* src/client/composer/composer-headerbar.vala (ComposerHeaderbar): Add
  signal and methods to be called explicity on state changes, rather than
  relying on being notified of ComposerWidget::state changing.

* src/client/composer/composer-widget.vala (ComposerWidget): Hook up new
  ComposerHeaderbar signal and method. Remove notify and property
  bindings on ::state property, move related code to new
  ::update_composer_view method and call that as needed. Remove
  overridden ::show_all, because the UI state should now always be
  consistent with ::state. Clean up various methods.

* src/client/composer/email-entry.vala (EmailEntry::EmailEntry): Make
  widget visible by default, since we are no longer calling
  ComposerWidget::show_all().

* src/client/application/geary-controller.vala: Don't call show all on
  new composers, they now manage their visibility properly.

* ui/composer-headerbar.ui: Make toolbar icons visible by default.

* ui/composer-widget.ui: Make toolbar icons visible by default, set Send
  button icon here rather than in the class.
2017-03-04 13:45:17 +11:00
Michael James Gratton
1cb8b77b48 Don't (expicitly) use deprecated Gee methods. 2017-03-04 13:45:17 +11:00
Josef Andersson
84f669bc3f Update Swedish translation 2017-03-03 20:51:12 +00:00
Federico Bruni
510cb689ea Update Italian translation 2017-03-03 17:37:25 +00:00
Michael James Gratton
f3fd81b8ee Don't use deprecated Gdk.Pixbuf.new_from_stream_async function. 2017-02-28 23:23:27 +11:00
Michael James Gratton
07966a1156 Fix crash when conversation scrolled window child changes.
This is a workaround for GTK+ Bug 778190.

* src/client/conversation-viewer/conversation-viewer.vala
  (ConversationViewer): Replace the whole conversation scrolled window
  when changing the conversation, not just the viewport.

* ui/conversation-viewer.ui: Remove the ScrolledWindow for now since we
  are constructing it manually.
2017-02-28 21:18:07 +11:00
Michael James Gratton
ca3452b840 Fix attachments not being opened when using flatpak. Bug 770886.
* src/client/application/geary-controller.vala
  (GearyController:on_attachments_activated): Just use
  Gtk.show_uri_on_window to open attachments.
2017-02-28 00:24:38 +11:00
Michael James Gratton
2349ea6892 Use Gtk.show_uri_on_window when available. Bug 770884.
* src/CMakeLists.txt: Define a macro when Gtk+ 3.22 is available.

* src/client/application/geary-application.vala (GearyApplication): Add
  show_uri method that uses the app's currently active window/screen to
  show the URI on, add a compile-time test to use Gtk.show_uri or
  Gtk.show_uri_on_window as appropriate, make the API nicer to use by
  not having two different error reporting methods. Rework existing uses
  of Gtk.show_uri to use this method.
2017-02-28 00:24:38 +11:00
Michael James Gratton
4cab543e1b Fix a shell warning running configure under flatpak-builder. 2017-02-28 00:24:38 +11:00
Rico Tzschichholz
d34f0e7bb0 Fix build with new vala
https://bugzilla.gnome.org/show_bug.cgi?id=779264
2017-02-28 00:24:38 +11:00
Gautier Pelloux-Prayer
71ac4de367 Close folders in reverse order. Bug 778968 2017-02-26 22:34:20 +01:00
Piotr Drąg
21d4e4da05 Update Polish help translation 2017-02-26 18:38:37 +01:00
Мирослав Николић
45625eaaae Updated Serbian translation 2017-02-26 16:21:01 +01:00
Мирослав Николић
18318827e9 Updated Serbian translation 2017-02-26 07:52:10 +01:00
Michael James Gratton
527399be76 Remember attachments dir and reuse adding/saving attachments and images.
* src/client/application/geary-controller.vala (GearyController): Replace
  use of last_save_directory with new attachments_dir property on the
  configuration object.

* src/client/dialogs/attachment-dialog.vala (AttachmentDialog): Replace
  current_folder with use of last_save_directory with new attachments_dir
  property on the configuration object. Add config object as ctor param
  and object field, update call sites.
2017-02-24 12:06:42 +11:00
Michael James Gratton
7787af3aac Remember print dir and reuse when printing again. Bug 713573.
* src/client/conversation-viewer/conversation-email.vala
  (ConversationEmail): Save config object as a class field, use that to
  get and set the print directory when printing. Also set the default
  print filename based on the email's subject.
2017-02-24 11:49:05 +11:00
Michael James Gratton
a20cb240a3 Fix print to file not working. Bug 778874.
* src/client/conversation-viewer/conversation-email.vala
  (ConversationEmail::print): WebKit.PrintOperation.run_dialog will cause
  the print job to be executed if the user selects OK, so no need to
  manually do it ourself.
2017-02-24 11:16:06 +11:00
Michael James Gratton
11d093bee2 Validate entered email address before allowing add a new account.
Bug 775513.
2017-02-23 14:23:52 +11:00
Michael James Gratton
548529d432 Add a keyboard nav section to the user manual.
* help/C/shortcuts.page: Add a new section, move existing focus commands
  to it, add shortcuts for conversation message nav.
2017-02-23 14:08:02 +11:00
Alex Henrie
f38f0d150d Rename archive/trash/delete actions to clearly be for conversations 2017-02-23 11:33:12 +11:00
Michael James Gratton
928189f36d Fix matching message subject not being highlighted in find/search.
Bug 778033

* src/client/conversation-viewer/conversation-message.vala
  (ConversationMessage::highlight_search_terms): Also check the subject
  for matching items and highlight if found.

* src/client/conversation-viewer/conversation-list-box.vala
  (ConversationListBox::EmailRow): Update matching row class to
  disambiguate from matching headers.

* ui/geary.css: Ensure matching subject labels get highlighted.
2017-02-23 11:33:12 +11:00
Michael James Gratton
ae3374593f Fix messages with search hits in bodies not being expanded. Bug 778033.
* src/client/conversation-viewer/conversation-web-view.vala
  (ConversationWebView): Add async ::highlight_search_terms with hacks to
  make WK2 find API work a bit more like the WK1 API.  Add
  ::unmark_search_terms method for consistency.

* src/client/conversation-viewer/conversation-list-box.vala
  (ConversationListBox): Keep track of total number of search terms
  found, so we can notify the viewer and update to deal with heasrch
  highlighting now being async. Rename ::search_matches_found to
  ::search_matches_updated and add a count param, update call sites and
  handlers.

* src/client/conversation-viewer/conversation-message.vala
  (ConversationMessage): Use search term highlighting on
  ConversationWebView rather than WebKit's API directly.

* src/client/conversation-viewer/conversation-viewer.vala
  (ConversationViewer): Update find entry's primary icon to reflect
  whether any matches were found.
2017-02-23 11:33:12 +11:00
Michael James Gratton
0c929683bc Allow using foreach loops over ConversationEmail's messages.
* src/client/conversation-viewer/conversation-email.vala
  (ConversationEmail): Rename ::message_view_iterator to just ::iterator,
  update all call sites to use for-each loops rather than
  Gee.Iterator::foreach closures.
2017-02-23 11:33:12 +11:00
Michael James Gratton
e8dcad9a43 Add unit tests for adding accounts.
* src/engine/api/geary-engine.vala (Engine::create_orphan_account): Fix
  sense of test when determining the next account id to use. Add unit
  tests.
  (Engine::add_account): Made public so it can be used in public test.
2017-02-23 11:33:12 +11:00
Michael James Gratton
d4a95fa287 Fix error when adding third account. Bug 779048.
Patch courtesy of Rafał Masternak <rafdev@muub.net>
2017-02-23 11:33:12 +11:00
Michael James Gratton
6eac43b2e7 Make both Engine and AccountInfo a bit more unit testable.
* src/engine/api/geary-account-information.vala (AccountInformation):
  Make main constrcutor public, pass in the id rather than divining it
  from the config dir's name for both ctors. Update call sites.

* src/engine/api/geary-engine.vala (Engine): Also make the ctor public.
2017-02-23 11:33:12 +11:00
Michael James Gratton
dbf0251646 Fix error validing account details on second try. Bug 775511
* src/client/accounts/add-edit-page.vala
  (AddEditPage::get_account_information): Handle when the id is not null,
  but the account has not yet been added to the engine, as is the case
  when a new account has vailed validation and hence is an orphan.
2017-02-23 11:33:12 +11:00
Jiri Grönroos
7d4573a9cd Update Finnish translation 2017-02-22 19:19:30 +00:00
Piotr Drąg
386b5076fd Update Polish translation 2017-02-19 19:39:03 +01:00
Dušan Kazik
f973b72078 Update Slovak translation 2017-02-18 10:18:00 +00:00
Michael James Gratton
e0ff646904 Really fix crash when replying to non-draft messages.
See commit 67d2c80.

* src/client/composer/composer-widget.vala (ComposerWidget::load): Only
  call restore_reply_to_state if there is a referred message *and* it is
  actually a draft.
2017-02-16 19:11:57 +11:00
Michael James Gratton
1806065496 Re-enable standard keyboard scrolling for conversations.
This does the following:

- Implements using conventional controls
  (Up/Down/PageUp/PageDown/Home/End) to control the
  conversation's vertical scrollbar.
- Uses Spacebar/Shift+Spacebar (but not backspace, since that's also
  mapped to trash/delete) to advance the focus forward/back through
  individual messages.

Bug 772748.

*  src/client/conversation-viewer/conversation-list-box.vala
   (ConversationListBox): Add action signals and keyboard bindings to
   implement the scheme above. Remove the old hacky approach to making
   the spacebar do something useful.

* src/client/conversation-viewer/conversation-web-view.vala
  (ConversationWebView): Blacklist forwarding key press events for the
  keys above, so the ConversationListBox bindings actually work.
2017-02-16 18:25:28 +11:00
Michael James Gratton
011b89303b Make ConversationListBox::check_mark_read private. 2017-02-16 12:22:48 +11:00
Michael James Gratton
2851a5526e Don't breifly show the message body progress bar when loading cached.
Bug 778261.

* src/client/conversation-viewer/conversation-message.vala
  (ConversationMessage): Add a new timeout for showing the progress bar,
  1s after the first image is loaded.
2017-02-16 11:58:13 +11:00
Michael James Gratton
4ca86afc73 Workaround libsoup cache crashing when cancellable is actually cancelled.
Bug 778720.

* src/client/conversation-viewer/conversation-message.vala
  (ConversationMessage::load_avatar): Don't pass thr load cancellable
  through to soup, just check to see if the load has been cancelled
  before attempting to set the icon.
2017-02-16 10:20:38 +11:00
Michael James Gratton
67d2c80b69 Fix a crash replying to a message.
* src/client/composer/composer-widget.vala (ComposerWidget::load): We
  only need to call restore_reply_to_state when we are actually restoring
  from a draft.
2017-02-16 09:38:53 +11:00
Michael James Gratton
9f5def0d0f Re-implement alt text filename fallback when saving inline images.
This restores some old behaviour after teh WK2 port.

* src/client/conversation-viewer/conversation-message.vala
  (ConversationMessage): Add alt_text param to ::save_image
  signal. Replace ::set_action_param_string with
  ::set_action_param_string so we can pass a (url, alt_text) tuple for
  the save_image tuple and update call sites. Set this tuple for the
  action when enabling it, and pass the two values to the ::save_image
  signal handler when activated.

* src/engine/api/geary-attachment.vala (Attachment::get_safe_file_name):
  Add alt_file_name param method, use that when constructing a file
  name. Add doc comment, test.

* src/client/application/geary-controller.vala: Updated to pass alt text
  from save_imge signal emission all thr way through to
  get_safe_file_name.
2017-02-16 08:58:58 +11:00
Michael James Gratton
b19d0c8cad Ensure mixed landscape/portrait attachment previews are centred vertically. 2017-02-16 08:44:44 +11:00
Michael James Gratton
2a7fca9397 Clean up default filename when saving attachments.
This ensures both inline images are saved using the specified content
filename, if any, and that an extension is attempted to be guessed when
no filename is specified.

Fixes Bug 713999, Bug 712923, Bug 778026.

* src/client/application/geary-controller.vala: Major rework of how
  attachments are saved. Rework how save dialogs are constructed,
  combining common code paths into one constrcutor method. Split up code
  for saving one attachment vs many into two different methods. Ensure
  all code baths ultimately use the same method to do the actual
  saving. Lookup a attachment when saving an inline image and use that
  by default. Get filenames from new Attachment::get_useful_filename
  method that guesses if needed.

* src/client/conversation-viewer/conversation-message.vala
  (ConversationMessage::save_image): Fix name of first param to reflect
  what it actually is.

* src/engine/api/geary-attachment.vala (Attachment): Add
  ::get_safe_filename method that checks the type of both the
  attachment's content and its file name, if any. Will construct an
  appropriate file name if non is given. Add unit tests.

* src/engine/api/geary-email.vala (Email): Add new
  ::get_attachment_by_content_id to lookup attachments by MIME
  content-id. Rename old ::get_attachment method to disambiguate.
2017-02-16 08:44:27 +11:00
Michael James Gratton
992528862e Clean up DB handling of attachments without specified file names.
This could probably use a DB migration to set all attachments will "none"
as their filename to NULL, but that's a lot of trouble for little gain.

* src/client/conversation-viewer/conversation-email.vala (if): Remove
  workaround for "none" attachment file names.

* src/client/conversation-viewer/conversation-message.vala
  (ConversationMessage::inline_image_replacer): Handle translation for
  null attachment file names here, rather than in the engine.

* src/engine/api/geary-email.vala
  (Email::get_searchable_attachment_list): Don't bother appending file
  names for attachments when they are null.

* src/engine/imap-db/imap-db-attachment.vala (Attachment): Use a const
  for null file name replacement string so it can be used elsewhere.

* src/engine/imap-db/imap-db-folder.vala (Folder::do_list_attachments):
  Clean up old "none" file names when loading from DB.
  (Folder::do_save_attachments_db): Allow for file name being null.

* src/engine/rfc822/rfc822-message.vala (Message::InlinePartReplacer):
  Allow file name to be null, update call sites.

* src/engine/rfc822/rfc822-utils.vala (get_clean_attachment_filename):
  Don't attempt to translate null filenames, just return it null. Update
  call sites.
2017-02-15 17:50:49 +11:00
Michael James Gratton
6257e05ad9 Tidy up Geary.Attachment API a bit.
* src/engine/api/geary-attachment.vala (Attachment): Allow direct access
  to MIME content-disposition filename if available. Make it obvious that
  the filename comes from content-disposition. Reorder attrs to reflect
  importance. Update subclasses and call sites.
2017-02-15 17:50:49 +11:00
Michael James Gratton
183da8bd3f Add ContentType.is_default and unit test. 2017-02-15 17:50:49 +11:00
Michael James Gratton
e3d708b8e6 Add ContentType methods for determining file name extenions and type sniffing.
* src/engine/mime/mime-content-type.vala (ContentType): Add ::guess_type
  and ::get_file_name_extension methods, unit tests.
2017-02-15 17:50:34 +11:00
Dušan Kazik
9014e46e42 Update Slovak translation 2017-02-12 14:07:55 +00:00
Marek Černocký
8044129731 Updated Czech translation 2017-02-11 11:07:42 +01:00