Page MenuHomePhabricator

[QT] Improve validated fields responsiveness

Authored by Fabien on Mar 3 2021, 08:26.


Group Reviewers
Restricted Project

The validated inputs (e.g. the proxy IP in Settings=>Options=>Network)
will change their appearance and display a message when the content is
invalid. The current behavior is to update this status when the widget
gains or loses the focus; however the focus out event is not triggered
when the user clicks the form container, making the UI feel
Example scenario:

  1. Check the "Connect through SOCKS5 proxy" checkbox
  2. Set the proxy IP to (invalid) and click OK. The input

fields is red'ed and a error tooltip displayed.

  1. Change the proxy IP to (now valid). The OK button remains

greyed and the input field red'ed despite valid. You need to click
another button or field (such as the port field) to undim the OK button.

This diff fixes this by checking the validity of the input field at
every key press, thus giving immediate feedback to the user.

Test Plan

Follow the steps above and check the OK button is now dimmed/undimmed as
soon as the content gets valid/invalid.

Diff Detail

rABC Bitcoin ABC
Lint Passed
No Test Coverage
Build Status
Buildable 15308
Build 30548: Build Difflint-circular-dependencies · build-diff · build-without-wallet · build-debug · build-clang · build-clang-tidy
Build 30547: arc lint + arc unit

Event Timeline

Fabien requested review of this revision.Mar 3 2021, 08:26
majcosta requested changes to this revision.Mar 3 2021, 13:21
majcosta added a subscriber: majcosta.
majcosta added inline comments.

this slot is already connected to the textChanged signal. just move the checkValidity(); call here and it will still work in weird edge cases where the textbox is empy and you change it to by using the middle mouse button paste on linux or something

This revision now requires changes to proceed.Mar 3 2021, 13:21