summaryrefslogtreecommitdiffstats
path: root/src/webengine/ui_delegates_manager.cpp
diff options
context:
space:
mode:
authorPierre Rossi <pierre.rossi@digia.com>2014-04-11 18:46:40 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-04-29 16:37:37 +0200
commit4da1db8fb60b444dc112b41804a3ac7480197bd2 (patch)
tree9d49ec3bfb6a8703ee23fb6122c025862db39a79 /src/webengine/ui_delegates_manager.cpp
parent59ec1beac8b2c0931efb9a78ee696a8e150e9a6f (diff)
Add a way of using UI dialogs for authorization
We could use this to prompt the user for various feature permissions that we are not ready to expose in our API. Change-Id: If6e6a16aca4142b0564121dfc7677b7c4996f742 Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>
Diffstat (limited to 'src/webengine/ui_delegates_manager.cpp')
-rw-r--r--src/webengine/ui_delegates_manager.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/webengine/ui_delegates_manager.cpp b/src/webengine/ui_delegates_manager.cpp
index 5fb5ef475..919b3f622 100644
--- a/src/webengine/ui_delegates_manager.cpp
+++ b/src/webengine/ui_delegates_manager.cpp
@@ -257,15 +257,19 @@ void UIDelegatesManager::showDialog(QSharedPointer<JavaScriptDialogController> d
switch (dialogController->type()) {
case WebContentsAdapterClient::AlertDialog:
dialogComponentType = AlertDialog;
- title = QObject::tr("Javascript Alert - %1");
+ title = QObject::tr("Javascript Alert - %1").arg(m_view->url().toString());
break;
case WebContentsAdapterClient::ConfirmDialog:
dialogComponentType = ConfirmDialog;
- title = QObject::tr("Javascript Confirm - %1");
+ title = QObject::tr("Javascript Confirm - %1").arg(m_view->url().toString());
break;
case WebContentsAdapterClient::PromptDialog:
dialogComponentType = PromptDialog;
- title = QObject::tr("Javascript Prompt - %1");
+ title = QObject::tr("Javascript Prompt - %1").arg(m_view->url().toString());
+ break;
+ case WebContentsAdapterClient::InternalAuthorizationDialog:
+ dialogComponentType = ConfirmDialog;
+ title = dialogController->title();
break;
default:
Q_UNREACHABLE();
@@ -288,7 +292,7 @@ void UIDelegatesManager::showDialog(QSharedPointer<JavaScriptDialogController> d
textProp.write(dialogController->message());
QQmlProperty titleProp(dialog, QStringLiteral("title"));
- titleProp.write(title.arg(m_view->url().toString()));
+ titleProp.write(title);
if (dialogComponentType == PromptDialog) {
QQmlProperty promptProp(dialog, QStringLiteral("prompt"));