incubator-callback-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From long...@apache.org
Subject qt commit: fix for simulator in window
Date Mon, 30 Apr 2012 18:07:24 GMT
Updated Branches:
  refs/heads/master 40790e6e7 -> c83981a66


fix for simulator in window


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/c83981a6
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-qt/tree/c83981a6
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-qt/diff/c83981a6

Branch: refs/heads/master
Commit: c83981a664bc9be833bdf2f1030af7fae7b32fcb
Parents: 40790e6
Author: Longwei Su <lsu@ics.com>
Authored: Mon Apr 30 14:07:03 2012 -0400
Committer: Longwei Su <lsu@ics.com>
Committed: Mon Apr 30 14:07:03 2012 -0400

----------------------------------------------------------------------
 src/cordova.cpp    |    3 +-
 www/index.html     |  200 +++++++++++++++++------------------------------
 www/index_qt5.html |   59 ++++++++++++++
 3 files changed, 133 insertions(+), 129 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-qt/blob/c83981a6/src/cordova.cpp
----------------------------------------------------------------------
diff --git a/src/cordova.cpp b/src/cordova.cpp
index 269c0cb..9eb07ee 100644
--- a/src/cordova.cpp
+++ b/src/cordova.cpp
@@ -30,7 +30,8 @@ Cordova::Cordova(QObject *parent) : QObject(parent) {
     m_topLevelEventsReceiver = 0;
     // Determine index file path
     m_workingDir = QApplication::applicationDirPath();
-#ifdef MEEGO_EDITION_HARMATTAN
+//#ifdef MEEGO_EDITION_HARMATTAN
+#if defined(MEEGO_EDITION_HARMATTAN) || (defined(QT_SIMULATOR) && defined(Q_OS_WIN)
)
     m_workingDir.cdUp();
 #endif
     qDebug() << "Using" << m_workingDir.absolutePath() << "as working dir";

http://git-wip-us.apache.org/repos/asf/incubator-cordova-qt/blob/c83981a6/www/index.html
----------------------------------------------------------------------
diff --git a/www/index.html b/www/index.html
old mode 100755
new mode 100644
index 8886d89..65c84a2
--- a/www/index.html
+++ b/www/index.html
@@ -1,128 +1,72 @@
-<!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="cordova.js"></script>
     
-
-      
-<script type="text/javascript" charset="utf-8">
-
-    var deviceReady = false;
-
-    function roundNumber(num) {
-        var dec = 3;
-        var result = Math.round(num*Math.pow(10,dec))/Math.pow(10,dec);
-        return result;
-    }
-
-    //-------------------------------------------------------------------------
-    // Compass
-    //-------------------------------------------------------------------------
-    var watchCompassId = null;
-
-    /**
-     * Start watching compass
-     */
-    var watchCompass = function() {
-        console.log("watchCompass()");
-
-        // Success callback
-        var success = function(a){
-            document.getElementById('compassHeading').innerHTML = roundNumber(a.magneticHeading);
-        };
-
-        // Fail callback
-        var fail = function(e){
-            console.log("watchCompass fail callback with error code "+e);
-            stopCompass();
-            setCompassStatus(e);
-        };
-
-        // Update heading every 1 sec
-        var opt = {};
-        opt.frequency = 1000;
-        watchCompassId = navigator.compass.watchHeading(success, fail, opt);
-
-        setCompassStatus("Running");
-    };
-
-    /**
-     * Stop watching the acceleration
-     */
-    var stopCompass = function() {
-        setCompassStatus("Stopped");
-        if (watchCompassId) {
-            navigator.compass.clearWatch(watchCompassId);
-            watchCompassId = null;
-        }
-    };
-
-    /**
-     * Get current compass
-     */
-    var getCompass = function() {
-        console.log("getCompass()");
-
-        // Stop compass if running
-        stopCompass();
-
-        // Success callback
-        var success = function(a){
-            document.getElementById('compassHeading').innerHTML = roundNumber(a.magneticHeading);
-        };
-
-        // Fail callback
-        var fail = function(e){
-            console.log("getCompass fail callback with error code "+e);
-            setCompassStatus(e);
-        };
-
-        // Make call
-        var opt = {};
-        navigator.compass.getCurrentHeading(success, fail, opt);
-    };
-
-    /**
-     * Set compass status
-     */
-    var setCompassStatus = function(status) {
-        document.getElementById('compass_status').innerHTML = status;
-    };
-    
-    /**
-     * Function called when page has finished loading.
-     */
-    function init() {
-        document.addEventListener("deviceready", function() {
-                deviceReady = true;
-                console.log("Device="+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>Compass</h1>
-    <div id="info">
-        <b>Status:</b> <span id="compass_status">Stopped</span>
-        <table width="100%"><tr>
-            <td width="33%">Heading: <span id="compassHeading"> </span></td>
-        </tr></table>
-    </div>
-    <h2>Action</h2>
-    <div class="btn large" onclick="getCompass();">Get Compass</div>
-    <div class="btn large" onclick="watchCompass();">Start Watching Compass</div>
-    <div class="btn large" onclick="stopCompass();">Stop Watching Compass</div>
-    <h2> </h2><div class="backBtn" onclick="backHome();">Back</div>
-  </body>
-</html>      
+<!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>
+        <script language="javascript" type="text/javascript" src="basic.js"></script>
+
+        <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>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-cordova-qt/blob/c83981a6/www/index_qt5.html
----------------------------------------------------------------------
diff --git a/www/index_qt5.html b/www/index_qt5.html
new file mode 100644
index 0000000..5312fd5
--- /dev/null
+++ b/www/index_qt5.html
@@ -0,0 +1,59 @@
+<!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>


Mime
View raw message