GpsIcon.qml 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /*
  2. * Copyright (c) 2011 Nokia Corporation.
  3. */
  4. import QtQuick 1.1
  5. import QtMobility.serviceframework 1.1
  6. Item {
  7. id: container
  8. width: 100
  9. height: 62
  10. // Listen WhoWhereDaemon Service logs
  11. Connections {
  12. target: main.daemonService
  13. ignoreUnknownSignals: true
  14. onGpsInitialized: {
  15. noGpsImage.opacity = 0
  16. gpsImage.opacity = 1
  17. rotAnim.restart();
  18. }
  19. onGpsLocationReceived: {
  20. noGpsImage.opacity = 0
  21. gpsImage.opacity = 1
  22. rotAnim.stop();
  23. }
  24. onGpsClosed: {
  25. noGpsImage.opacity = 1
  26. gpsImage.opacity = 0
  27. rotAnim.stop();
  28. }
  29. }
  30. RotationAnimation {
  31. id: rotAnim
  32. loops: Animation.Infinite
  33. duration: 4000
  34. from: 0
  35. to: 359
  36. target: container
  37. property: "rotation"
  38. }
  39. Image {
  40. id: noGpsImage
  41. opacity: 1
  42. anchors.fill: parent
  43. smooth: true
  44. source: "qrc:/images/gpsOff.png"
  45. fillMode: Image.PreserveAspectFit
  46. }
  47. Image {
  48. id: gpsImage
  49. opacity: 0
  50. anchors.fill: parent
  51. smooth: true
  52. source: "qrc:/images/gpsOn.png"
  53. fillMode: Image.PreserveAspectFit
  54. }
  55. }