DiscoveryPage.qml 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /**
  2. * Copyright (c) 2012 Nokia Corporation.
  3. */
  4. import QtQuick 1.1
  5. import com.nokia.meego 1.1
  6. import ConnectivityPlugin 1.0
  7. Page {
  8. Header {
  9. id: header
  10. anchors {
  11. top: parent.top
  12. left: parent.left
  13. }
  14. width: parent.width
  15. text: "Discovered services"
  16. BusyIndicator {
  17. height: parent.height - 4
  18. width: height
  19. anchors {
  20. top: parent.top
  21. left: parent.left
  22. margins: 2
  23. }
  24. running: true
  25. }
  26. }
  27. ListView {
  28. id: listView
  29. anchors {
  30. top: header.bottom
  31. bottom: parent.bottom
  32. left: parent.left
  33. right: parent.right
  34. topMargin: 20
  35. }
  36. model: discoveredServicesModel
  37. spacing: 5
  38. delegate: Component {
  39. id: listItem
  40. Button {
  41. width: listView.width
  42. text: model.name
  43. onClicked: {
  44. connectionManager.connect(name);
  45. pageStack.pop();
  46. }
  47. }
  48. }
  49. }
  50. ScrollDecorator {
  51. flickableItem: listView
  52. }
  53. tools: ToolBarLayout {
  54. ToolButton {
  55. text: qsTr("Cancel");
  56. onClicked: {
  57. connectionManager.disconnect();
  58. pageStack.pop();
  59. }
  60. }
  61. }
  62. }