mirror of
https://git.jami.net/savoirfairelinux/jami-client-qt.git
synced 2025-07-18 22:45:25 +02:00
chatview: correctly handle clicked links in the webview
Change-Id: I16edca89fe0e66fb3845cc0420c251c70c12bdec Gitlab: #11
This commit is contained in:
parent
214d9add58
commit
06fbda77e0
3 changed files with 16 additions and 0 deletions
|
@ -232,6 +232,13 @@ Rectangle {
|
|||
}
|
||||
}
|
||||
|
||||
onNavigationRequested: {
|
||||
if(request.navigationType === WebEngineView.LinkClickedNavigation) {
|
||||
MessagesAdapter.openUrl(request.url)
|
||||
request.action = WebEngineView.IgnoreRequest
|
||||
}
|
||||
}
|
||||
|
||||
onLoadingChanged: {
|
||||
if (loadRequest.status == WebEngineView.LoadSucceededStatus) {
|
||||
messageWebView.runJavaScript(ClientWrapper.utilsAdaptor.getStyleSheet(
|
||||
|
|
|
@ -332,6 +332,14 @@ MessagesAdapter::openFile(const QString &arg)
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
MessagesAdapter::openUrl(const QString &url)
|
||||
{
|
||||
if (!QDesktopServices::openUrl(url)) {
|
||||
qDebug() << "Couldn't open url: " << url;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
MessagesAdapter::acceptFile(const QString &arg)
|
||||
{
|
||||
|
|
|
@ -49,6 +49,7 @@ public:
|
|||
Q_INVOKABLE void sendFile(const QString &message);
|
||||
Q_INVOKABLE void retryInteraction(const QString &arg);
|
||||
Q_INVOKABLE void deleteInteraction(const QString &arg);
|
||||
Q_INVOKABLE void openUrl(const QString &url);
|
||||
Q_INVOKABLE void openFile(const QString &arg);
|
||||
Q_INVOKABLE void acceptFile(const QString &arg);
|
||||
Q_INVOKABLE void refuseFile(const QString &arg);
|
||||
|
|
Loading…
Add table
Reference in a new issue