DeleteMePopup.ui.qml 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. import QtQuick 2.4
  2. import QtQuick.Controls 2.3
  3. import QtQuick.Layouts 1.3
  4. Popup {
  5. id: popup
  6. height: 300
  7. dim: true
  8. clip: false
  9. width: 400
  10. modal: true
  11. focus: true
  12. closePolicy: Popup.NoAutoClose
  13. anchors.centerIn: Overlay.overlay
  14. signal resetStatus
  15. Overlay.modal: Rectangle {
  16. color: "#b5c5c5c5"
  17. }
  18. onClosed: {
  19. resetStatus()
  20. }
  21. Connections {
  22. target: _qmlHandler
  23. onDeleteMePopupSetStatus: {
  24. deleteMePopupStatusText.text = status
  25. }
  26. }
  27. ColumnLayout {
  28. anchors.fill: parent
  29. Text {
  30. Layout.alignment: Qt.AlignCenter
  31. Layout.preferredWidth: parent.width
  32. Layout.preferredHeight: 100
  33. text: qsTr("Are you sure you want to delete your account on the server?\nThe application will restart.")
  34. wrapMode: Text.WordWrap
  35. horizontalAlignment: Text.AlignHCenter
  36. verticalAlignment: Text.AlignVCenter
  37. font.pixelSize: 20
  38. }
  39. Text {
  40. id: deleteMePopupStatusText
  41. Layout.alignment: Qt.AlignCenter
  42. Layout.preferredWidth: parent.width
  43. Layout.preferredHeight: 50
  44. color: "#df3f3f"
  45. text: ""
  46. horizontalAlignment: Text.AlignHCenter
  47. verticalAlignment: Text.AlignVCenter
  48. font.pixelSize: 20
  49. Connections {
  50. target: popup
  51. onResetStatus: deleteMePopupStatusText.text = ""
  52. }
  53. }
  54. TextField {
  55. id: deleteMePopupPasswordInput
  56. Layout.alignment: Qt.AlignCenter
  57. Layout.preferredWidth: 300
  58. Layout.preferredHeight: 50
  59. selectByMouse: true
  60. echoMode: TextInput.Password
  61. text: ""
  62. horizontalAlignment: Text.AlignHCenter
  63. placeholderText: "Enter password to confirm"
  64. Connections {
  65. target: popup
  66. onResetStatus: deleteMePopupPasswordInput.text = ""
  67. }
  68. }
  69. RowLayout {
  70. spacing: 0
  71. Layout.alignment: Qt.AlignCenter
  72. Layout.preferredWidth: parent.width
  73. Layout.preferredHeight: 50
  74. Button {
  75. Layout.alignment: Qt.AlignCenter
  76. Layout.preferredHeight: parent.height
  77. Layout.preferredWidth: 150
  78. text: "Confirm"
  79. enabled: !(deleteMePopupPasswordInput.text == "")
  80. font.pointSize: 16
  81. // @disable-check M223
  82. onClicked: {
  83. // @disable-check M222
  84. _qmlHandler.onSettingsDeleteMeButton(
  85. deleteMePopupPasswordInput.text)
  86. }
  87. }
  88. Button {
  89. Layout.alignment: Qt.AlignCenter
  90. Layout.preferredHeight: parent.height
  91. Layout.preferredWidth: 150
  92. text: "Cancel"
  93. font.pointSize: 16
  94. // @disable-check M223
  95. onClicked: {
  96. // @disable-check M222
  97. popup.close()
  98. }
  99. }
  100. }
  101. }
  102. }