[Kde-pim] [Differential] [Request, 53 lines] D2313: Only allow one recipient per line in composer
dvratil (Daniel Vrátil)
noreply at phabricator.kde.org
Sat Jul 30 16:58:25 BST 2016
dvratil created this revision.
dvratil added reviewers: mlaurent, aheinecke.
dvratil added a subscriber: KDE PIM.
dvratil set the repository for this revision to rMESSAGELIB PIM: Message Library.
dvratil added a project: KDE PIM.
Restricted Application added a subscriber: kde-pim.
REVISION SUMMARY
For the Opportunistic encryption task (https://phabricator.kde.org/T2520, https://phabricator.kde.org/D1639), we need to show an icon next to a each recipient showing status of the encryption key we are going to use. However it is not possible to put icons mid-text in K(Q)LineEdit, only at the beginning of the line, which is a problem if there are multiple recipients in a single line. I've spent quite some time trying to come up with a fake LineEdit widget that would be seemlessly composed of multiple QToolButton+QLineEdit widgets inside a QScrollArea, but the user experience was never as good as with a single QLineEdit. Therefore I opted for an alternative strategy of only allowing a single recipient per line. The RecipientEditor already automatically jumps to next line when you autocomplete a contact from addressbook/LDAP, so I only needed to handle situation when user does not autocomplete but instead types comma (or semicolon) to write more contacts into single edit, or when they copy-paste a comma-separated list of emails into a single edit.
This patch adds a simple eventFilter that listens for comma/semicolon keypresses in the RecipientLineEdit and adds a new line, gives it a focus and consumes the keypress. I also adjusted the slotCalculateTotal() method which is called whenever a new email(s) are entered into any RecipientLineEdit to automatically split any RecipientLineEdit which has more than one recipient into multiple lines.
If you can figure out any other way how get multiple contacts into single line, let me know :-)
REPOSITORY
rMESSAGELIB PIM: Message Library
REVISION DETAIL
https://phabricator.kde.org/D2313
AFFECTED FILES
messagecomposer/src/recipient/recipientseditor.cpp
messagecomposer/src/recipient/recipientseditor.h
EMAIL PREFERENCES
https://phabricator.kde.org/settings/panel/emailpreferences/
To: dvratil, mlaurent, aheinecke
Cc: kde-pim, #kde_pim, dvasin, winterz, smartins, vkrause, mlaurent, knauss, dvratil
_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/
More information about the kde-pim
mailing list