Title: [104032] trunk/Tools
Revision
104032
Author
[email protected]
Date
2012-01-04 06:04:52 -0800 (Wed, 04 Jan 2012)

Log Message

[Qt] Add UI for _javascript_ Prompt dialog in the Qt MiniBrowser
https://bugs.webkit.org/show_bug.cgi?id=75488

Patch by Alexander Færøy <[email protected]> on 2012-01-04
Reviewed by Tor Arne Vestbø.

* MiniBrowser/qt/MiniBrowser.qrc:
* MiniBrowser/qt/qml/BrowserWindow.qml:
* MiniBrowser/qt/qml/Dialog.qml:
* MiniBrowser/qt/qml/DialogLineInput.qml: Copied from Tools/MiniBrowser/qt/qml/Dialog.qml.
* MiniBrowser/qt/qml/PromptDialog.qml: Copied from Tools/MiniBrowser/qt/qml/Dialog.qml.

Modified Paths

Added Paths

Diff

Modified: trunk/Tools/ChangeLog (104031 => 104032)


--- trunk/Tools/ChangeLog	2012-01-04 13:45:15 UTC (rev 104031)
+++ trunk/Tools/ChangeLog	2012-01-04 14:04:52 UTC (rev 104032)
@@ -1,3 +1,16 @@
+2012-01-04  Alexander Færøy  <[email protected]>
+
+        [Qt] Add UI for _javascript_ Prompt dialog in the Qt MiniBrowser
+        https://bugs.webkit.org/show_bug.cgi?id=75488
+
+        Reviewed by Tor Arne Vestbø.
+
+        * MiniBrowser/qt/MiniBrowser.qrc:
+        * MiniBrowser/qt/qml/BrowserWindow.qml:
+        * MiniBrowser/qt/qml/Dialog.qml:
+        * MiniBrowser/qt/qml/DialogLineInput.qml: Copied from Tools/MiniBrowser/qt/qml/Dialog.qml.
+        * MiniBrowser/qt/qml/PromptDialog.qml: Copied from Tools/MiniBrowser/qt/qml/Dialog.qml.
+
 2012-01-04  Tor Arne Vestbø  <[email protected]>
 
         [Qt] Use rpath for WTR's InjectedBundle to pick up the right QtWebKit

Modified: trunk/Tools/MiniBrowser/qt/MiniBrowser.qrc (104031 => 104032)


--- trunk/Tools/MiniBrowser/qt/MiniBrowser.qrc	2012-01-04 13:45:15 UTC (rev 104031)
+++ trunk/Tools/MiniBrowser/qt/MiniBrowser.qrc	2012-01-04 14:04:52 UTC (rev 104032)
@@ -11,8 +11,10 @@
         <file>qml/ConfirmDialog.qml</file>
         <file>qml/Dialog.qml</file>
         <file>qml/DialogButton.qml</file>
+        <file>qml/DialogLineInput.qml</file>
         <file>qml/ItemSelector.qml</file>
         <file>qml/MockTouchPoint.qml</file>
+        <file>qml/PromptDialog.qml</file>
         <file>qml/ViewportInfoItem.qml</file>
         <file>useragentlist.txt</file>
         <file>icons/favicon.png</file>

Modified: trunk/Tools/MiniBrowser/qt/qml/BrowserWindow.qml (104031 => 104032)


--- trunk/Tools/MiniBrowser/qt/qml/BrowserWindow.qml	2012-01-04 13:45:15 UTC (rev 104031)
+++ trunk/Tools/MiniBrowser/qt/qml/BrowserWindow.qml	2012-01-04 14:04:52 UTC (rev 104032)
@@ -265,6 +265,7 @@
         experimental.itemSelector: ItemSelector { }
         experimental.alertDialog: AlertDialog { }
         experimental.confirmDialog: ConfirmDialog { }
+        experimental.promptDialog: PromptDialog { }
     }
 
     ViewportInfoItem {

Modified: trunk/Tools/MiniBrowser/qt/qml/Dialog.qml (104031 => 104032)


--- trunk/Tools/MiniBrowser/qt/qml/Dialog.qml	2012-01-04 13:45:15 UTC (rev 104031)
+++ trunk/Tools/MiniBrowser/qt/qml/Dialog.qml	2012-01-04 14:04:52 UTC (rev 104032)
@@ -52,7 +52,7 @@
 
     Item {
         id: staticContent
-
+        anchors.centerIn: parent
         anchors.fill: parent
         anchors.margins: 10
 
@@ -74,6 +74,7 @@
 
         Column {
             id: dynamicColumn
+            spacing: 5
             anchors {
                 margins: 10
                 bottom: staticContent.bottom

Copied: trunk/Tools/MiniBrowser/qt/qml/DialogLineInput.qml (from rev 104031, trunk/Tools/MiniBrowser/qt/qml/Dialog.qml) (0 => 104032)


--- trunk/Tools/MiniBrowser/qt/qml/DialogLineInput.qml	                        (rev 0)
+++ trunk/Tools/MiniBrowser/qt/qml/DialogLineInput.qml	2012-01-04 14:04:52 UTC (rev 104032)
@@ -0,0 +1,55 @@
+/*
+ * Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies)
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 2.0
+
+Rectangle {
+    id: dialogLineInput
+
+    property alias text: input.text
+    signal accepted()
+
+    height: 20
+    color: "#fefefe"
+
+    border {
+        width: 1
+        color: "#aeaeae"
+    }
+
+    smooth: true
+    radius: 3
+    clip: true
+
+    TextInput {
+        id: input
+        focus: true
+        anchors.fill: parent
+
+        onAccepted: dialogLineInput.accepted()
+    }
+}

Copied: trunk/Tools/MiniBrowser/qt/qml/PromptDialog.qml (from rev 104031, trunk/Tools/MiniBrowser/qt/qml/Dialog.qml) (0 => 104032)


--- trunk/Tools/MiniBrowser/qt/qml/PromptDialog.qml	                        (rev 0)
+++ trunk/Tools/MiniBrowser/qt/qml/PromptDialog.qml	2012-01-04 14:04:52 UTC (rev 104032)
@@ -0,0 +1,61 @@
+/*
+ * Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies)
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 2.0
+
+Dialog {
+    id: dialog
+
+    title: "_javascript_ Prompt"
+    message: model.message
+
+    height: 180
+
+    DialogLineInput {
+        id: input
+        width: dialog.width - 30
+        text: model.defaultValue
+
+        onAccepted: model.accept(input.text)
+    }
+
+    Row {
+        id: buttonRow
+        spacing: 5
+        anchors.horizontalCenter: parent.horizontalCenter
+
+        DialogButton {
+            text: "OK"
+            onClicked: model.accept(input.text)
+        }
+
+        DialogButton {
+            text: "Cancel"
+            onClicked: model.reject()
+        }
+    }
+}
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to