1. 14 Mar, 2019 1 commit
  2. 17 Jan, 2019 1 commit
  3. 15 Jan, 2019 1 commit
  4. 31 Dec, 2018 1 commit
  5. 26 Dec, 2018 2 commits
  6. 09 Dec, 2018 1 commit
    • Michael Gratton's avatar
      Clean up AccountInformation and ServiceInformation APIs · 1bccd51a
      Michael Gratton authored
      Remove remaining crufty properties left over from pulling accounts out
      of the engine, rename imap/smtp to incoming/outgoing since maybe one
      day other protocols or implementations will be supported. Remove the
      old pairs of properties for TLS and SMTP auth, replace the
      SmtpCredentials enum with something that is also independent of
  7. 08 Dec, 2018 2 commits
    • Michael Gratton's avatar
      Move CredentialsMediator back to AccountInformation · 8fe6d4f8
      Michael Gratton authored
      In practice, the same mediator is always being used for both services,
      and by removing it from ServiceInformation we can provide default
      instances for both IMAP and SMTP, meaning we can load account config
      before service config, making handling loading for both much tidier.
    • Michael Gratton's avatar
      Enable config file versioning · 123f51db
      Michael Gratton authored
      This (way too large patch) enables versioning in config files, and
      provides a mechanism by which to load older versions from a newer
      version of Geary. It also properly introduces a new v1 config format
      that adds several groups to geary.ini to make it easier to read and to
      distinguish between incoming/outgoig services rather than IMAP/SMTP.
      To do this, a few things that should have happened in seperate patches
      were also done:
       * Make AccountInformation's imap and smtp properties mutable (they
       aren't stateful any more anyway), make ServiceInformation non-abstract
       again and remove the subclasses (to get config versioning happening
       without an explosion of a classes, it all has to be handled from the
       AccountManager anyway), and some other misc things.
  8. 30 Nov, 2018 2 commits
  9. 06 Apr, 2018 2 commits
  10. 08 Feb, 2018 1 commit
  11. 16 Nov, 2017 1 commit
    • Michael Gratton's avatar
      Allow determining when JS has finished loading in ClientWebView. · f1e92fea
      Michael Gratton authored
      * src/client/components/client-web-view.vala (ClientWebView): Add
        is_content_loaded property and content_loaded signal, update and fire
        when getting a contentLoaded message from the WebProcess.
      * ui/client-web-view.js: Fire the contentLoaded message when loading is
        complete. Add ClientPageStateTest test case to ensure it is working
      * test/client/components/client-web-view-test-case.vala
        (ClientWebViewTestCase::load_body_fixture): Use is_content_loaded
        rather than is_loading as the test for loading having finished, since
        we're actually interested in when the JS has finished loaded, not the
  12. 07 Feb, 2017 1 commit
  13. 31 Jan, 2017 9 commits
    • Michael Gratton's avatar
      Split composer web view up into multiple parts. · 96ffcdb6
      Michael Gratton authored
      This lets us implement changing signatures and deleting bottom-quoted
      messages without having to reload the whole view, and makes it possible
      to target only the user's content when modifying for send, etc.
      * src/client/composer/composer-web-view.vala (ComposerWebView): Move
        composer CSS into composer-web-view.css resource file, load it when
        loading JS resource and add it to the view's user content manager.
        (ComposerWebView::load_html): Split up body, signature and quote into a
        DIV container for each.
        (ComposerWebView::linkify_content): Replaced with ::clean_content,
        which will also tidy up internal markup before sending. Update call
        site and unit test.
      * src/engine/rfc822/rfc822-utils.vala (Geary.RFC822.Utils): Remove some
        more obtrusive white space when sending replies/forwards.
      * test/client/composer/composer-web-view-test.vala,
        test/js/composer-page-state-test.vala: Update tests to expect new HTML
        and text output from ComposerWebView and use of individual parts for
        composer markup.
      * ui/composer-web-view.js (ComposerPageState): Replace messageBody
        property and uses with bodyPart, signaturePart and quotePart. Set these
        content-editable on load. Move listeners from messageBody back to the
        document.body so they also listen for events on the additional
        parts. Keep track of text cursor location within the parts and set a
        class if so, to work around the lack of :focus-inside support.
        (ComposerPageState::updateSignature): Implement by updating the inner
        content of the signature part.
        (ComposerPageState::deleteQuotedMessage): Implement by removing the
        quote part from the DOM tree.
        (ComposerPageState::containsAttachmentKeyword): Consider only the
        bodyPart when scanning for attachments, remove hacks for ignoring the
        signature any any quoted message.
        (ComposerPageState::linkifyContent): Mirror ClientWebView change and
        replace with ::cleanContent. Ensure existing parts have contenteditable
        and focus class removed, remove signature and quote parts if empty.
        (ComposerPageState::getHtml): Generate HTML using clones of the three
        parts, so we can rmeove contenteditable and focus classes without
        modifying the actual DOM.
        (ComposerPageState::selectionChanged): Update focus class on parts as
    • Michael Gratton's avatar
      Make ClientWebView-based tests execute a bit faster. · 355e4d37
      Michael Gratton authored
      * test/client/components/client-web-view-test.vala: New explicit tests
        for init'ing the WebContext and loading default resources.
      * test/client/components/client-web-view-test-case.vala:
        Init the WebContext and load resources in the constructor rather than
        fixture setup, so it only happens once per suite, not once per
        test. Update subclasses to do same.
      * test/client/composer/composer-web-view-test.vala: Add an explicit test
        for loading ComposerWebView resources.
    • Michael Gratton's avatar
      Set a specific disk cache dir for the web process. · 3e203a9c
      Michael Gratton authored
      * src/client/application/geary-controller.vala
        (GearyController::open_async): Pass new cache dir through to
        ClientWebView::init_web_context. Update avatar cache dir name to remove
      * src/client/components/client-web-view.vala
        (ClientWebView::init_web_context): Add additional cache dir para and
        update call sites. Use to construct a WebsiteDataManager
        instance. Construct a new WebContext using the data manager, and use
        that instead of the default one when creating new ClientWebView
    • Michael Gratton's avatar
      Clean up how composer loads content into its web view. · dec06d93
      Michael Gratton authored
      The main gist of this is to ensure that the composer's widgets are
      constructed seperately to loading its content, and that we only ever call
      ComposerWebView::load_html precisely once per composer instance.
      * src/client/composer/composer-widget.vala: Remove referred message,
        quote text and draft flag param from constructor signature, move any
        calls that loaded data from them to new load method. Don't load
        anything into the editor here. Make loading the signature file async,
        and call new ComposerWebView::updateSignature method on the editor to
        update it.
        (ComposerWidget::load): New async message for loading content into the
        composer. Move related code from the constructor and GearyController
        here, make methods that were previously public for that private
        again. Tidy up calls a bit now that we have a single place from which
        to do it all, and can understand the process a bit better.
        (ComposerWidget::on_editor_key_press_event): Don't reload the editor to
        remove the quoted text, call new ComposerWebView::delete_quoted_message
        method on it instead.
      * src/client/composer/composer-web-view.vala
        (ComposerWebView): Add ::delete_quoted_message ::update_signature
        methods, thunk to JS.
        (ComposerWebView::load_html): Add quote and is_draft parameters,
        construct HTML for the composer using apporporate spacing here, instead
        of relying on all the disparate parts from doing the right thing.
      * src/client/application/geary-controller.vala
        (GearyController::create_compose_widget_async): Load composer content
        after adding it to the widget hierarchy, set focus only after
        everything is set up.
      * src/engine/rfc822/rfc822-utils.vala (quote_email_for_reply,
        quote_email_for_forward): Don't add extra padding around quoted parts -
        let callers manage their own whitespace.
      * test/client/components/client-web-view-test-case.vala
        (TestCase:load_body_fixture): Make HTML param non-nullable, update
      * ui/composer-web-view.js (ComposerPageState): Add ::updateSignature and
        ::deleteQuotedMessage method stubs.
    • Michael Gratton's avatar
      Reenable basic deceptive link highlighting. · 2b5f94da
      Michael Gratton authored
      * bindings/vapi/javascriptcore-4.0.vapi (Object::get_property): Fix
        return type.
      * src/client/conversation-viewer/conversation-message.vala (GtkTemplate):
        Hook up to new deceptive_link_clicked signal, remove old DOM-based
      * src/client/conversation-viewer/conversation-web-view.vala
        (ConversationWebView): Add new deceptive_link_clicked signal and
        DeceptiveText enum, listen for deceptiveLinkClicked JS message and fire
        signal when received.
      * src/client/util/util-webkit.vala (WebKitUtil): Add to_object util function.
      * src/engine/util/util-js.vala (Geary.JS): Add to_object and get_property
        util functions.
      * ui/conversation-web-view.js (ConversationPageState) Listen for link
        clicks, check for deceptive text and send message if found. Add unit
        tests for deceptive text check.
      * test/js/composer-page-state-test.vala: Move ::run_javascript to parent
        class so new ConversationPageStateTest class can use it, adapt call
        sites to different parent signature.
    • Michael Gratton's avatar
      Replace composer link dialog with a popover. · c476fdc6
      Michael Gratton authored
      * src/client/composer/composer-link-popover.vala: New GtkPopover subclass
        for creating/editing links.
      * src/client/composer/composer-web-view.vala (EditContext): Add is_link
        and link_uri properties, decode them from the message string, add
        decoding tests.
        (ComposerWebView): Add some as-yet un-implemented methods for
        inserting/deleting links.
      * src/client/composer/composer-widget.vala (ComposerWidget): Add
        cursor_url for storing current text cursor link, update it from the
        cursor_context_changed signal param, rename hover_url to pointer_url to
        match. Add link_activated signal to let user's open links they are
        adding, hook that up in the controller. Rename
        ::update_selection_actions to ::update_cursor_actions, since that's a
        little more apt now, also enable insert link action if there is a
        cursor_url set as well as a selection. Remove ::link_dialog, replace
        with ::new_link_popover, hook up the new popover's signals there as
        (ComposerWidget::on_insert_link): Create and show a lin popover instead
        of a dialog.
      * ui/composer-web-view.js: Take note of whther the context node is a link
        and if so, also it's href. Include both when serialsing for the
        cursorContextChanged message. Add serialisation tests.
      * ui/composer-link-popover.ui: New UI for link popover.
    • Michael Gratton's avatar
      Replace ad-hoc ComposerWebView cursor signal param w/ structured object. · 53caf43f
      Michael Gratton authored
      This lets us notify of more cursor editing context state in the future
      without changing the signal signature.
      * src/client/composer/composer-web-view.vala (ComposerWebView): Replace
        cursor_style_changed signal and cursorStyleChanged JS message with
        cursor_context_changed signal and cursorContextChanged message, add new
        EditContext inner class and pass as arg to new signal, update call
        sites. Move parsing of JS message to new inner class. Add unit tests,
        fix a font-family bug revealed by tests.
      * ui/composer-web-view.js (ComposerPageState): Replace cursorFontFamily
        and cursorFontSize with a cursor context and new EditContext object to
        encapsulate them, update them from a node and serialise them. Add unit
    • Michael Gratton's avatar
      Re-enable spell checking in composer. · f69c4619
      Michael Gratton authored
      * src/client/application/geary-config.vala (Configuration): Remove
        spell-check setting, we can just get it from the list of visible
        languages instead. Update the schema.
      * src/client/components/client-web-view.vala (WebView::init_web_context):
        Pass in a config object, use that to init WebKit's spell checking on
        the WebContext now that is a global configuration, update it when the
        config changes, update call sites.
      * src/client/composer/composer-widget.vala (ComposerWidget): Remove
        WK1-syle spell checking settings prefs.
      * src/client/composer/spell-check-popover.vala (SpellCheckPopover): Pass
        a config object in so we don't have to use the global app singleton
      * src/client/dialogs/preferences-dialog.vala (PreferencesDialog):
        Modernise by converting into a widget template.
      * test/client/components/client-web-view-test-case.vala (TestCase):
        Construct a config object as a fixture, use it to init the WebContext
        and make it avalaible to subclasses & update subclasses.
      * ui/preferences-dialog.ui: Moved from preferences.dialog, remove spell
        check preference.
    • Michael Gratton's avatar
      Fix non-breaking spaces breaking formatting in sent messages. · 17fda41b
      Michael Gratton authored
      This ensures that non-breaking space chars (not HTML entities) are
      removed from text obtainined from the composer, and moves the F=F text
      formatting from JS back to Vala, to minimimse the JS footprint and return
      to using the old (working) version again.
      * src/client/composer/composer-web-view.vala (ClientWebView::get_text):
        Restore the old F=F formatting code previously in webkit-util, apply it
        to plain text obtained from the composer.
      * test/client/components/client-web-view-test-case.vala: New base class
        for tests involving ClientWebView.
      * test/client/composer/composer-web-view-test.vala: New tests for
        ComposerWebView::get_html and ::get_text.
      * test/js/composer-page-state-test.vala: Reworked to use
        ClientWebViewTestCase, updated tests now that JS is returning
        QUOTE_MARKER-delinated text, not F=F text.
      * test/testcase.vala (TestCase): Move ::async_complete and ::async_result
        from ComposerPageStateTest so all test cases can test async code.
      * test/CMakeLists.txt: Add new source files.
      * test/main.vala (main): Add new test.
      * ui/composer-web-view.js: Update doc comments, remove F=F code, break
        out non-breaking space replacement so it can be tested.
  14. 26 Dec, 2016 1 commit
    • Michael Gratton's avatar
      Add simple/demo client unit test using GSettings. · 50120c67
      Michael Gratton authored
      * test/client/application/geary-configuration-test.vala: New unit test
        for Configuration class.
      * test/main.vala: Add new unit test to the client suite, ensure the
        memory GSettings backend is used as the default so we get default
        setting values, and never save any changes made.
      * test/CMakeLists.txt: Add new unit test source.
      * src/client/application/geary-config.vala: Tidy up code a bit to adhere
        to code conventions.