summaryrefslogtreecommitdiffstats
path: root/src/webengine/ui_delegates_manager.cpp
diff options
context:
space:
mode:
authorSzabolcs David <davidsz@inf.u-szeged.hu>2017-02-13 08:48:37 -0800
committerSzabolcs David <davidsz@inf.u-szeged.hu>2017-02-21 08:22:30 +0000
commit905017117d38d799bc95d6cfdd0195b717b605b8 (patch)
treecf76af1f06722ca0ea8cdc953d38042ee5535089 /src/webengine/ui_delegates_manager.cpp
parenta6c6665d79e6d4097c0a1155ff5f963b9a9eab19 (diff)
Fix empty dialogs on window.onbeforeunload
Custom texts are not supported anymore in unload dialogs. Fill them with a better message. Task-number: QTBUG-58673 Change-Id: I820155452461db90bf1df2ae8a8ec10ee752aab1 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'src/webengine/ui_delegates_manager.cpp')
-rw-r--r--src/webengine/ui_delegates_manager.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/webengine/ui_delegates_manager.cpp b/src/webengine/ui_delegates_manager.cpp
index a37484023..4a47a49eb 100644
--- a/src/webengine/ui_delegates_manager.cpp
+++ b/src/webengine/ui_delegates_manager.cpp
@@ -330,7 +330,10 @@ void UIDelegatesManager::showDialog(QSharedPointer<JavaScriptDialogController> d
item->setParentItem(m_view);
dialog->setParent(m_view);
QQmlProperty textProp(dialog, QStringLiteral("text"));
- textProp.write(dialogController->message());
+ if (dialogController->type() == WebContentsAdapterClient::UnloadDialog)
+ textProp.write(tr("Changes that you made may not be saved."));
+ else
+ textProp.write(dialogController->message());
QQmlProperty titleProp(dialog, QStringLiteral("title"));
titleProp.write(title);