[webkit-dev] [PATCH] Use 'Ok' and 'Cancel' buttons in JavaScript confirm box.

Johannes Obermayr johannesobermayr at gmx.de
Tue Jan 10 11:29:28 PST 2012


See: http://www.javascripter.net/faq/confirm.htm

Fixes: https://bugs.kde.org/show_bug.cgi?id=287629
---
 Source/WebKit/qt/Api/qwebpage.cpp |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Source/WebKit/qt/Api/qwebpage.cpp b/Source/WebKit/qt/Api/qwebpage.cpp
index 8f0f153..acd2bd6 100644
--- a/Source/WebKit/qt/Api/qwebpage.cpp
+++ b/Source/WebKit/qt/Api/qwebpage.cpp
@@ -2119,7 +2119,7 @@ void QWebPage::javaScriptAlert(QWebFrame *frame, const QString& msg)
     This function is called whenever a JavaScript program running inside \a frame calls the confirm() function
     with the message, \a msg. Returns true if the user confirms the message; otherwise returns false.
 
-    The default implementation executes the query using QMessageBox::information with QMessageBox::Yes and QMessageBox::No buttons.
+    The default implementation executes the query using QMessageBox::information with QMessageBox::Ok and QMessageBox::Cancel buttons.
 */
 bool QWebPage::javaScriptConfirm(QWebFrame *frame, const QString& msg)
 {
@@ -2128,7 +2128,7 @@ bool QWebPage::javaScriptConfirm(QWebFrame *frame, const QString& msg)
     return true;
 #else
     QWidget* parent = (d->client) ? d->client->ownerWidget() : 0;
-    return QMessageBox::Yes == QMessageBox::information(parent, tr("JavaScript Confirm - %1").arg(mainFrame()->url().host()), Qt::escape(msg), QMessageBox::Yes, QMessageBox::No);
+    return QMessageBox::Ok == QMessageBox::information(parent, tr("JavaScript Confirm - %1").arg(mainFrame()->url().host()), Qt::escape(msg), QMessageBox::Ok, QMessageBox::Cancel);
 #endif
 }
 
-- 
1.7.7



More information about the webkit-dev mailing list