Guest User

Untitled

a guest
Oct 31st, 2017
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.43 KB | None | 0 0
  1. import QtQuick 2.0
  2. import QtQuick.Controls 2.2
  3. import QtQuick.Dialogs 1.2
  4. import "."
  5.  
  6. Dialog {
  7. width: 800
  8. height: 450
  9. modality: Qt.WindowModal
  10. title: qsTr("Select data source")
  11. standardButtons: StandardButton.Cancel
  12.  
  13. StackView {
  14. id: stackView
  15. anchors.fill: parent
  16. background: Rectangle {
  17. color: Style.windowBackgroundColor
  18. }
  19. initialItem: dataSourceTypeSelector
  20.  
  21. Item {
  22. id: dataSourceTypeSelector
  23. Column {
  24. anchors.centerIn: parent
  25. height: 4 * 50 + 3 * spacing
  26. spacing: 30
  27.  
  28. DarkButton {
  29. id: remoteServerButton
  30. width: 240
  31. height: 60
  32. text: "Remote server"
  33. icon: "icons/ic_cloud_black_24px.svg"
  34. iconTextSpacing: 20
  35. contentHorizontalOffset: 20
  36. onClicked: stackView.push(remoteServer)
  37. }
  38.  
  39. DarkButton {
  40. id: phoneServerButton
  41. width: 240
  42. height: 60
  43. text: "Phone (WiFi)"
  44. icon: "icons/ic_phonelink_ring_black_24px.svg"
  45. iconTextSpacing: 20
  46. contentHorizontalOffset: 20
  47. onClicked: stackView.push(phoneWifi)
  48. }
  49.  
  50. DarkButton {
  51. id: phoneDirectoryButton
  52. width: 240
  53. height: 60
  54. text: "Phone (USB)"
  55. icon: "icons/ic_phonelink_black_24px.svg"
  56. iconTextSpacing: 20
  57. contentHorizontalOffset: 20
  58. onClicked: stackView.push(phoneDirectory)
  59. }
  60.  
  61. DarkButton {
  62. id: localComputerDirectoryButton
  63. width: 240
  64. height: 60
  65. text: "Local computer directory"
  66. icon: "icons/ic_computer_black_24px.svg"
  67. iconTextSpacing: 20
  68. contentHorizontalOffset: 20
  69. onClicked: stackView.push(localComputerDirectory)
  70. }
  71. }
  72. }
  73.  
  74. Item {
  75. id: remoteServer
  76. x: 10000
  77.  
  78. Rectangle {
  79. anchors.left: parent.left
  80. anchors.right: parent.right
  81. anchors.top: parent.top
  82. height: 30
  83. color: "red"
  84. Text {
  85. anchors.centerIn: parent
  86. text: "This version doesn't support this data source type."
  87. color: "white"
  88. }
  89. }
  90.  
  91. DarkButton {
  92. anchors.left: parent.left
  93. anchors.top: parent.top
  94. icon: "icons/ic_arrow_back_black_24px.svg"
  95. contentHorizontalOffset: 20
  96. onClicked: stackView.pop()
  97. }
  98.  
  99. LoginForm {
  100. anchors.centerIn: parent
  101. onSignIn: console.log("Sign in: {User: \"%1\", Password: \"%2\"}".arg(login).arg(password))
  102. }
  103. }
  104.  
  105. Item {
  106. id: phoneWifi
  107. x: 10000
  108. Rectangle {
  109. anchors.left: parent.left
  110. anchors.right: parent.right
  111. anchors.top: parent.top
  112. height: 30
  113. color: "red"
  114. Text {
  115. anchors.centerIn: parent
  116. text: "This version doesn't support this data source type."
  117. color: "white"
  118. }
  119. }
  120.  
  121. DarkButton {
  122. anchors.left: parent.left
  123. anchors.top: parent.top
  124. icon: "icons/ic_arrow_back_black_24px.svg"
  125. contentHorizontalOffset: 20
  126. onClicked: stackView.pop()
  127. }
  128.  
  129. PhoneWifiSelector {
  130. anchors.centerIn: parent
  131. onSelected: console.log("Selected phone {name: \"%1\", address: \"%2\"}".arg(name).arg(address))
  132. }
  133. }
  134.  
  135. Item {
  136. id: phoneDirectory
  137. x: 10000
  138. Rectangle {
  139. anchors.left: parent.left
  140. anchors.right: parent.right
  141. anchors.top: parent.top
  142. height: 30
  143. color: "red"
  144. Text {
  145. anchors.centerIn: parent
  146. text: "This version doesn't support this data source type."
  147. color: "white"
  148. }
  149. }
  150. DarkButton {
  151. anchors.left: parent.left
  152. anchors.top: parent.top
  153. icon: "icons/ic_arrow_back_black_24px.svg"
  154. contentHorizontalOffset: 20
  155. onClicked: stackView.pop()
  156. }
  157. Text {
  158. anchors.centerIn: parent
  159. text: "Phone (USB)"
  160. }
  161. }
  162.  
  163. Item {
  164. id: localComputerDirectory
  165. x: 10000
  166. DarkButton {
  167. anchors.left: parent.left
  168. anchors.top: parent.top
  169. icon: "icons/ic_arrow_back_black_24px.svg"
  170. contentHorizontalOffset: 20
  171. onClicked: stackView.pop()
  172. }
  173. Text {
  174. anchors.centerIn: parent
  175. text: "Local computer"
  176. }
  177. }
  178. }
  179. }
Add Comment
Please, Sign In to add comment