Parse html links in the Notes section.

In the spirit of "Do the simplest thing that could
possibly work": capture Ctrl+leftclick mouse events
in the Notes area. If the string under the clicked
position is a valid url, then launch it.

Many common URI schemes will work. Typing a url that
starts with https:// will work. So will mailto: and
file://

See #733

Signed-off-by: K. Heller <pestophagous@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
K. \"pestophagous\" Heller 2015-11-15 20:56:24 -08:00 committed by Dirk Hohndel
parent 99ed01e571
commit 0a2f5d25c0
3 changed files with 178 additions and 0 deletions

View file

@ -195,6 +195,9 @@ MainTab::MainTab(QWidget *parent) : QTabWidget(parent),
connect(ui.diveNotesMessage, &KMessageWidget::showAnimationFinished,
ui.location, &DiveLocationLineEdit::fixPopupPosition);
// enable URL clickability in notes:
new TextHyperlinkEventFilter(ui.notes);//destroyed when ui.notes is destroyed
acceptingEdit = false;
ui.diveTripLocation->hide();