incubator-callback-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From long...@apache.org
Subject [1/2] qt commit: minor updates for mobile-spec test cases
Date Fri, 27 Apr 2012 13:47:54 GMT
Updated Branches:
  refs/heads/master d4facfb6f -> b6c00928f


minor updates for mobile-spec test cases


Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-qt/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-qt/commit/b6c00928
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-qt/tree/b6c00928
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-qt/diff/b6c00928

Branch: refs/heads/master
Commit: b6c00928f08cc9fefb77d8b2efc96f22168cb0e4
Parents: 95bcfc6
Author: Longwei Su <lsu@ics.com>
Authored: Fri Apr 27 09:43:13 2012 -0400
Committer: Longwei Su <lsu@ics.com>
Committed: Fri Apr 27 09:43:13 2012 -0400

----------------------------------------------------------------------
 qml/main_qt5.qml      |    2 +-
 src/plugins/media.h   |    8 +-
 www/index.html        |  156 ++++++++++++++++++++++++--------------------
 www/index_qt5.html    |   59 -----------------
 www/js/contacts.js    |    3 +-
 www/phonegap-1.3.0.js |   15 ++++
 xml/plugins.xml       |    2 +-
 7 files changed, 109 insertions(+), 136 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-qt/blob/b6c00928/qml/main_qt5.qml
----------------------------------------------------------------------
diff --git a/qml/main_qt5.qml b/qml/main_qt5.qml
index 86bfa48..efc2b72 100644
--- a/qml/main_qt5.qml
+++ b/qml/main_qt5.qml
@@ -16,7 +16,7 @@ WebView {
     }
     //Uncomment when it will be available
     //experimental.setFlickableViewportEnabled: false
-//    experimental.useTraditionalDesktopBehaviour: true
+    //experimental.useTraditionalDesktopBehaviour: true
 
 
     Component.onCompleted: {

http://git-wip-us.apache.org/repos/asf/incubator-cordova-qt/blob/b6c00928/src/plugins/media.h
----------------------------------------------------------------------
diff --git a/src/plugins/media.h b/src/plugins/media.h
index 05388ab..78e0654 100644
--- a/src/plugins/media.h
+++ b/src/plugins/media.h
@@ -18,11 +18,11 @@
 #define MEDIA_H
 
 #include "../cplugin.h"
-#include <QMediaPlayer>
-#include <QMediaRecorder>
+#include <QtMultimediaKit/QMediaPlayer>
+#include <QtMultimediaKit/QMediaRecorder>
 #include <QUrl>
-#include <QAudioCaptureSource>
-#include <QAudioEncoderSettings>
+#include <QtMultimediaKit/QAudioCaptureSource>
+#include <QtMultimediaKit/QAudioEncoderSettings>
 
 //#ifdef QTM_NAMESPACE
 //QTM_USE_NAMESPACE

http://git-wip-us.apache.org/repos/asf/incubator-cordova-qt/blob/b6c00928/www/index.html
----------------------------------------------------------------------
diff --git a/www/index.html b/www/index.html
old mode 100644
new mode 100755
index 5f38cb3..3fb8e67
--- a/www/index.html
+++ b/www/index.html
@@ -1,73 +1,89 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
-"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-    <head>
-        <title>Cordova-Qt Test Page</title>
-        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
-        <script language="javascript" type="text/javascript" src="js/cordova.js"></script>
-        <script language="javascript" type="text/javascript" src="js/cordova.qt.js"></script>
-        <script language="javascript" type="text/javascript" src="js/connection.js"></script>
-        <script language="javascript" type="text/javascript" src="js/console.js"></script>
-        <script language="javascript" type="text/javascript" src="js/device.js"></script>
-        <script language="javascript" type="text/javascript" src="js/file.js"></script>
-        <script language="javascript" type="text/javascript" src="js/geolocation.js"></script>
-        <script language="javascript" type="text/javascript" src="js/notification.js"></script>
-        <script language="javascript" type="text/javascript" src="js/compass.js"></script>
-        <script language="javascript" type="text/javascript" src="js/accelerometer.js"></script>
-        <script language="javascript" type="text/javascript" src="js/camera.js"></script>
-        <script language="javascript" type="text/javascript" src="js/contacts.js"></script>
-        <script language="javascript" type="text/javascript" src="js/media.js"></script>
+<!DOCTYPE html>
+<html>
+  <head>
+    <meta name="viewport" content="width=device-width,height=device-height,user-scalable=no,maximum-scale=1.0,initial-scale=1.0"
/>
+    <meta http-equiv="Content-type" content="text/html; charset=utf-8"> <!-- ISO-8859-1
-->
+    <title>Cordova Mobile Spec</title>
+    <link rel="stylesheet" href="master.css" type="text/css" media="screen" title="no
title" charset="utf-8">
+    <script type="text/javascript" charset="utf-8" src="phonegap.js"></script>
+    <script src="http://192.168.1.2:8080/target/target-script-min.js#anonymous"></script>
 
-        <script language="javascript" type="text/javascript" src="basic.js"></script>
+      
+<script type="text/javascript" charset="utf-8">
 
-        <style type="text/css">
-            input {
-                height: 60px;
-                margin-top: 15px;
-            }
-        </style>
-    </head>
-    <body>
-        <input type="button" value="Init Watchers" onclick="init();"/>
-        <br />
-        <input type="button" value="Vibrate" onclick="test_vibra();"/>
-        <br />
-        <input type="button" value="Alert/Confirm" onclick="test_alert_confirm();">
-        <br />
-        <input type="button" value="Check Connection" onclick="getCurrentConnectionType();">
-        <br />
-        <input type="button" value="Request File System" onclick="test_requestFileSystem();">
-        <br />
-        <div id="debug_output"> </div>
-        <input type="button" value="Get Current Position" onclick="getCurrentPosition();">
-        <br />
-        <div id="position_val"> Location </div>
-        <input type="button" value="Get Acceleration" onclick="getCurrentAcceleration();">
-        <br />
-        <div id="accel_val"> Acceleration </div>
-        <input type="button" value="Get Current Heading" onclick="getCurrentHeading();">
-        <br />
-        <div id="heading_val"> Heading </div>
-        <input type="button" value="Get Picture" onclick="getPicture();">
-        <br />
-        <div id="picture_val"> Picture</div>
-        <input type="button" value="Create Test Contact" onclick="createTestContact();">
-        <br />
-        <div id="create_contact_result"></div>
-        <input type="button" value="Search for Test Contact" onclick="searchForTestContact();">
-        <br />
-        <div id="search_contact_result"></div>
-        <input type="button" value="Remove Test Contact" onclick="removeTestContact();">
-        <br />
-        <div id="remove_contact_result"></div>
-        <input type="button" value="Media Open" onclick="mediaOpen();">
-        <input type="button" value="Play" onclick="mediaPlay();">
-        <input type="button" value="Pause" onclick="mediaPause();">
-        <input type="button" value="Stop" onclick="mediaStop();">
-        <input type="button" value="Start Recording" onclick="mediaStartRecording();">
-        <input type="button" value="Stop Recording" onclick="mediaStopRecording();">
-        <input type="button" value="FF 5sec" onclick="mediaFF5sec();">
-        <br />
-        <div id="media_position_duration_val"> Position/Duration</div>
-    </body>
+    var deviceReady = false;
+
+    function interceptBackbutton() {
+    	eventOutput("Back button intercepted");
+    }
+    function interceptMenubutton() {
+    	eventOutput("Menu button intercepted");
+    }
+    function interceptSearchbutton() {
+    	eventOutput("Search button intercepted");
+    }
+    function interceptResume() {
+      eventOutput("Resume event intercepted");
+    }
+    function interceptPause() {
+      eventOutput("Pause event intercepted");
+    }
+    function interceptOnline() {
+      eventOutput("Online event intercepted");
+    }
+    function interceptOffline() {
+      eventOutput("Offline event intercepted");
+    }
+    
+    var eventOutput = function(s) {
+        var el = document.getElementById("results");
+        el.innerHTML = el.innerHTML + s + "<br>";
+    };
+
+    
+    /**
+     * Function called when page has finished loading.
+     */
+    function init() {
+        document.addEventListener("deviceready", function() {
+                deviceReady = true;
+                console.log("Device="+device.platform+" "+device.version);
+                eventOutput("deviceready event: "+device.platform+" "+device.version);
+            }, false);
+        window.setTimeout(function() {
+        	if (!deviceReady) {
+        		alert("Error: PhoneGap did not initialize.  Demo will not run correctly.");
+        	}
+        },1000);
+    }
+
+</script>
+
+  </head>
+  <body onload="init();" id="stage" class="theme">
+  
+    <h1>Events</h1>
+    <div id="info">
+        <b>Results:</b><br>
+        <span id="results"></span>
+    </div>
+
+    <h2>Action</h2>
+    <div class="btn large" onclick="document.addEventListener('backbutton', interceptBackbutton,
false);">Intercept backbutton</div>
+    <div class="btn large" onclick="document.removeEventListener('backbutton', interceptBackbutton,
false);">Stop intercept of backbutton</div>
+    <div class="btn large" onclick="document.addEventListener('menubutton', interceptMenubutton,
false);">Intercept menubutton</div>
+    <div class="btn large" onclick="document.removeEventListener('menubutton', interceptMenubutton,
false);">Stop intercept of menubutton</div>
+    <div class="btn large" onclick="document.addEventListener('searchbutton', interceptSearchbutton,
false);">Intercept searchbutton</div>
+    <div class="btn large" onclick="document.removeEventListener('searchbutton', interceptSearchbutton,
false);">Stop intercept of searchbutton</div>
+    <div class="btn large" onclick="document.addEventListener('resume', interceptResume,
false);">Intercept resume</div>
+    <div class="btn large" onclick="document.removeEventListener('resume', interceptResume,
false);">Stop intercept of resume</div>
+    <div class="btn large" onclick="document.addEventListener('pause', interceptPause,
false);">Intercept pause</div>
+    <div class="btn large" onclick="document.removeEventListener('pause', interceptPause,
false);">Stop intercept of pause</div>
+    <div class="btn large" onclick="document.addEventListener('online', interceptOnline,
false);">Intercept online</div>
+    <div class="btn large" onclick="document.removeEventListener('online', interceptOnline,
false);">Stop intercept of online</div>
+    <div class="btn large" onclick="document.addEventListener('offline', interceptOffline,
false);">Intercept offline</div>
+    <div class="btn large" onclick="document.removeEventListener('offline', interceptOffline,
false);">Stop intercept of offline</div>
+
+    <h2> </h2><div class="backBtn" onclick="backHome();">Back</div>
+  </body>
 </html>

http://git-wip-us.apache.org/repos/asf/incubator-cordova-qt/blob/b6c00928/www/index_qt5.html
----------------------------------------------------------------------
diff --git a/www/index_qt5.html b/www/index_qt5.html
deleted file mode 100644
index 5312fd5..0000000
--- a/www/index_qt5.html
+++ /dev/null
@@ -1,59 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
-"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-    <head>
-        <title>Cordova-Qt5 Test Page</title>
-        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
-        <script language="javascript" type="text/javascript" src="js/cordova.js"></script>
-        <script language="javascript" type="text/javascript" src="js/cordova.qt5.js"></script>
-        <script language="javascript" type="text/javascript" src="js/connection.js"></script>
-        <script language="javascript" type="text/javascript" src="js/console.js"></script>
-        <script language="javascript" type="text/javascript" src="js/device.js"></script>
-        <script language="javascript" type="text/javascript" src="js/file.js"></script>
-        <script language="javascript" type="text/javascript" src="js/geolocation.js"></script>
-        <script language="javascript" type="text/javascript" src="js/notification.js"></script>
-        <script language="javascript" type="text/javascript" src="js/compass.js"></script>
-        <script language="javascript" type="text/javascript" src="js/accelerometer.js"></script>
-        <script language="javascript" type="text/javascript" src="js/contacts.js"></script>
-
-        <script language="javascript" type="text/javascript" src="basic.js"></script>
-
-        <style type="text/css">
-            input {
-                height: 30px;
-                margin-top: 15px;
-            }
-        </style>
-    </head>
-    <body>
-        <input type="button" value="Init Watchers" onclick="init();"/>
-        <br />
-        <input type="button" value="Vibrate" onclick="test_vibra();"/>
-        <br />
-        <input type="button" value="Alert/Confirm" onclick="test_alert_confirm();">
-        <br />
-        <input type="button" value="Check Connection" onclick="getCurrentConnectionType();">
-        <br />
-        <input type="button" value="Request File System" onclick="test_requestFileSystem();">
-        <br />
-        <div id="debug_output"> </div>
-        <input type="button" value="Get Current Position" onclick="getCurrentPosition();">
-        <br />
-        <div id="position_val"> Location </div>
-        <input type="button" value="Get Acceleration" onclick="getCurrentAcceleration();">
-        <br />
-        <div id="accel_val"> Acceleration </div>
-        <input type="button" value="Get Current Heading" onclick="getCurrentHeading();">
-        <br />
-        <div id="heading_val"> Heading </div>
-        <input type="button" value="Create Test Contact" onclick="createTestContact();">
-        <br />
-        <div id="create_contact_result"></div>
-        <input type="button" value="Search for Test Contact" onclick="searchForTestContact();">
-        <br />
-        <div id="search_contact_result"></div>
-        <input type="button" value="Remove Test Contact" onclick="removeTestContact();">
-        <br />
-        <div id="remove_contact_result"></div>
-    </body>
-</html>

http://git-wip-us.apache.org/repos/asf/incubator-cordova-qt/blob/b6c00928/www/js/contacts.js
----------------------------------------------------------------------
diff --git a/www/js/contacts.js b/www/js/contacts.js
index eb78db5..b56b4dd 100644
--- a/www/js/contacts.js
+++ b/www/js/contacts.js
@@ -68,6 +68,7 @@ ContactName.create = function(obj) {
             var result = new ContactName()
             result.familyName = obj.familyName
             result.givenName = obj.givenName
+            result.formatted = obj.formatted
             result.middleName = obj.middleName
             result.honorificPrefix = obj.honorificPrefix
             result.honorificSuffix = obj.honorificSuffix
@@ -156,7 +157,7 @@ Contact.create = function(obj) {
             var result = new Contact()
             result.id = obj.id
             result.displayName = obj.displayName
-            result.name = ContactName.create(obj.name | obj.displayName)
+            result.name = ContactName.create(obj.name)
             result.nickname = obj.nickname
             var subObj
             for (subObj in obj.phoneNumbers)

http://git-wip-us.apache.org/repos/asf/incubator-cordova-qt/blob/b6c00928/www/phonegap-1.3.0.js
----------------------------------------------------------------------
diff --git a/www/phonegap-1.3.0.js b/www/phonegap-1.3.0.js
new file mode 100644
index 0000000..1b53740
--- /dev/null
+++ b/www/phonegap-1.3.0.js
@@ -0,0 +1,15 @@
+document.write('<script language="javascript" type="text/javascript" src="js/cordova.js"></script>');
+document.write('<script language="javascript" type="text/javascript" src="js/cordova.qt.js"></script>');
+document.write('<script language="javascript" type="text/javascript" src="js/connection.js"></script>');
+document.write('<script language="javascript" type="text/javascript" src="js/console.js"></script>');
+document.write('<script language="javascript" type="text/javascript" src="js/device.js"></script>');
+document.write('<script language="javascript" type="text/javascript" src="js/file.js"></script>');
+document.write('<script language="javascript" type="text/javascript" src="js/geolocation.js"></script>');
+document.write('<script language="javascript" type="text/javascript" src="js/notification.js"></script>');
+document.write('<script language="javascript" type="text/javascript" src="js/compass.js"></script>');
+document.write('<script language="javascript" type="text/javascript" src="js/accelerometer.js"></script>');
+document.write('<script language="javascript" type="text/javascript" src="js/camera.js"></script>');
+document.write('<script language="javascript" type="text/javascript" src="js/contacts.js"></script>');
+document.write('<script language="javascript" type="text/javascript" src="js/media.js"></script>');
+
+

http://git-wip-us.apache.org/repos/asf/incubator-cordova-qt/blob/b6c00928/xml/plugins.xml
----------------------------------------------------------------------
diff --git a/xml/plugins.xml b/xml/plugins.xml
index b1a9376..4eb7266 100644
--- a/xml/plugins.xml
+++ b/xml/plugins.xml
@@ -11,7 +11,7 @@
     <plugin name="Compass" value="com.cordova.Compass"/>
     <plugin name="Camera" value="com.cordova.Camera"/>
     <plugin name="Contacts" value="com.cordova.Contacts"/>
-    <plugin name="Media" value="com.cordova.Media"/>
+<!--    <plugin name="Media" value="com.cordova.Media"/>-->
 
 <!--    <plugin name="Compass" value="com.cordova.CompassListener"/>
     <plugin name="Media" value="com.cordova.AudioHandler"/>


Mime
View raw message