You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by an...@apache.org on 2012/02/24 21:52:11 UTC

[10/26] qt commit: Merge pull request #9 from tranter/master

Merge pull request #9 from tranter/master

Add accelerometer support

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

Branch: refs/heads/master
Commit: 2d62e9fe7bd6751b7c48dbb556b4a73e8363c033
Parents: 345a8b2 c2ba52c
Author: Jeff Tranter <jt...@ics.com>
Authored: Tue Feb 21 09:29:21 2012 -0800
Committer: Jeff Tranter <jt...@ics.com>
Committed: Tue Feb 21 09:29:21 2012 -0800

----------------------------------------------------------------------
 cordovaqt.pro                 |    2 +
 src/plugins/accelerometer.cpp |   58 ++++++++++++++++++++++++++++++++++++
 src/plugins/accelerometer.h   |   56 ++++++++++++++++++++++++++++++++++
 www/basic.js                  |   14 ++++++++-
 www/index.html                |   11 ++++---
 xml/plugins.xml               |    1 +
 6 files changed, 136 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-qt/blob/2d62e9fe/cordovaqt.pro
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-cordova-qt/blob/2d62e9fe/www/basic.js
----------------------------------------------------------------------
diff --cc www/basic.js
index 70258e2,22bd59a..9f172f9
--- a/www/basic.js
+++ b/www/basic.js
@@@ -13,10 -13,11 +13,11 @@@ function init(
  {
      navigator.accelerometer.watchAcceleration(function (v) {
          get("accel_val").innerHTML = v.x + '   ' + v.y + '    ' + v.z;
-     }, null, {});
+     }, null, {frequency:100});
+ 
  }
  
 -function ping_google() 
 +function ping_google()
  {
      navigator.network.isReachable('http://www.google.com', function (state) {
          if (state == NetworkStatus.NOT_REACHABLE) {

http://git-wip-us.apache.org/repos/asf/incubator-cordova-qt/blob/2d62e9fe/www/index.html
----------------------------------------------------------------------
diff --cc www/index.html
index f975909,0545f93..2b2aa0f
--- a/www/index.html
+++ b/www/index.html
@@@ -25,10 -24,9 +24,9 @@@
          <br />
          <input type="button" value="Ping Google!" onclick="ping_google();">
          <br />
-         <br />
          <input type="button" value="RequestFileSystem" onclick="test_requestFileSystem();">
          <br />
 -        <div id="debug_output"> Unknown </div>
 +        <div id="debug_output"> </div>
          <br />
          <input type="button" value="getCurrentPosition" onclick="getCurrentPosition();">
          <br />