DeleteMePopup.ui.qml 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  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. onClosed: {
  16. resetStatus()
  17. }
  18. Connections {
  19. target: _qmlHandler
  20. onDeleteMePopupSetStatus: {
  21. deleteMePopupStatusText.text = status
  22. }
  23. }
  24. ColumnLayout {
  25. anchors.fill: parent
  26. Text {
  27. Layout.alignment: Qt.AlignCenter
  28. Layout.preferredWidth: parent.width
  29. Layout.preferredHeight: 100
  30. color: "#ffffff"
  31. text: qsTr("Are you sure you want to delete your account on the server?\nThe application will restart.")
  32. wrapMode: Text.WordWrap
  33. horizontalAlignment: Text.AlignHCenter
  34. verticalAlignment: Text.AlignVCenter
  35. font.pixelSize: 20
  36. }
  37. Text {
  38. id: deleteMePopupStatusText
  39. Layout.alignment: Qt.AlignCenter
  40. Layout.preferredWidth: parent.width
  41. Layout.preferredHeight: 50
  42. color: "#df3f3f"
  43. text: ""
  44. horizontalAlignment: Text.AlignHCenter
  45. verticalAlignment: Text.AlignVCenter
  46. font.pixelSize: 20
  47. Connections {
  48. target: popup
  49. onResetStatus: deleteMePopupStatusText.text = ""
  50. }
  51. }
  52. TextField {
  53. id: deleteMePopupPasswordInput
  54. Layout.alignment: Qt.AlignCenter
  55. Layout.preferredWidth: 300
  56. Layout.preferredHeight: 50
  57. selectByMouse: true
  58. echoMode: TextInput.Password
  59. text: ""
  60. horizontalAlignment: Text.AlignHCenter
  61. placeholderText: "Enter password to confirm"
  62. }
  63. RowLayout {
  64. spacing: 0
  65. Layout.alignment: Qt.AlignCenter
  66. Layout.preferredWidth: parent.width
  67. Layout.preferredHeight: 50
  68. Button {
  69. Layout.alignment: Qt.AlignCenter
  70. Layout.preferredHeight: parent.height
  71. Layout.preferredWidth: 150
  72. text: "Confirm"
  73. enabled: !(deleteMePopupPasswordInput.text == "")
  74. font.pointSize: 16
  75. // @disable-check M223
  76. onClicked: {
  77. // @disable-check M222
  78. _qmlHandler.onSettingsDeleteMeButton(
  79. deleteMePopupPasswordInput.text)
  80. }
  81. }
  82. Button {
  83. Layout.alignment: Qt.AlignCenter
  84. Layout.preferredHeight: parent.height
  85. Layout.preferredWidth: 150
  86. text: "Cancel"
  87. font.pointSize: 16
  88. // @disable-check M223
  89. onClicked: {
  90. // @disable-check M222
  91. popup.close()
  92. }
  93. }
  94. }
  95. }
  96. }