DaemonLog.qml 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /*
  2. * Copyright (c) 2011 Nokia Corporation.
  3. */
  4. import QtQuick 1.1
  5. import QtMobility.serviceframework 1.1
  6. Rectangle {
  7. id: container
  8. color: "white"
  9. smooth: true
  10. border.width: 1
  11. border.color: "gray"
  12. radius: 8
  13. property string logString;
  14. gradient: Gradient {
  15. GradientStop { position: 0.0; color: "#bab7b0" }
  16. GradientStop { position: 1.0; color: "#edede5" }
  17. }
  18. // Listen WhoWhereDaemon Service logs
  19. Connections {
  20. target: main.daemonService
  21. ignoreUnknownSignals: true
  22. onDaemonLog: {
  23. //console.log("From Daemon: " + log);
  24. logString += log + "\n";
  25. textId.text = logString;
  26. flickable.contentY += tmpText.paintedHeight
  27. }
  28. }
  29. Text {
  30. id: tmpText
  31. opacity: 0
  32. font.pointSize: textId.font.pointSize
  33. font.family: "Courier"
  34. text: "TextHeight"
  35. smooth: true
  36. }
  37. Flickable {
  38. id: flickable
  39. anchors {
  40. fill: parent
  41. }
  42. contentWidth: width
  43. contentHeight: textId.height
  44. clip: true
  45. Text {
  46. id: textId
  47. width: parent.width - 10
  48. anchors.left: parent.left
  49. anchors.leftMargin: 10
  50. anchors.topMargin: 5
  51. anchors.bottomMargin: 5
  52. wrapMode: Text.WordWrap
  53. //color: "#d8dcdf"
  54. color: "black"
  55. font.pointSize: 6
  56. font.family: "Courier"
  57. text: ""
  58. smooth: true
  59. }
  60. }
  61. }