SettingsForm.ui.qml 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  1. import QtQuick 2.12
  2. import QtQuick.Layouts 1.3
  3. import QtQuick.Controls 2.5
  4. import QtQuick.Controls.Material 2.3
  5. import QtQuick.Dialogs 1.0
  6. Page {
  7. width: 1280
  8. height: 470
  9. id: page
  10. font.capitalization: Font.MixedCase
  11. Connections {
  12. target: _qmlHandler
  13. onCloseWindow: {
  14. window.close()
  15. }
  16. onLoadSettings: {
  17. settingsCovertMethodPicker.currentIndex = covertMethod
  18. settingsSaveIpSwitch.checked = saveIP
  19. settingsSaveUsernameSwitch.checked = saveUsername
  20. settingsCliPath.text = "CLI-Path: " + cliPath
  21. }
  22. }
  23. ColumnLayout {
  24. anchors.fill: parent
  25. RowLayout {
  26. Layout.alignment: Qt.AlignCenter
  27. Layout.preferredWidth: parent.width
  28. Layout.preferredHeight: 400
  29. Layout.bottomMargin: 20
  30. ColumnLayout {
  31. Layout.alignment: Qt.AlignCenter
  32. Layout.preferredWidth: 500
  33. Layout.preferredHeight: parent.height
  34. Text {
  35. Layout.alignment: Qt.AlignCenter
  36. Layout.preferredWidth: 400
  37. Layout.preferredHeight: 50
  38. color: "#ffffff"
  39. text: "Covert Channel Method:"
  40. verticalAlignment: Text.AlignVCenter
  41. horizontalAlignment: Text.AlignLeft
  42. font.pixelSize: 20
  43. }
  44. Text {
  45. Layout.alignment: Qt.AlignCenter
  46. Layout.preferredWidth: 400
  47. Layout.preferredHeight: 50
  48. color: "#ffffff"
  49. text: "Autofill default IP on start:"
  50. verticalAlignment: Text.AlignVCenter
  51. horizontalAlignment: Text.AlignLeft
  52. font.pixelSize: 20
  53. }
  54. Text {
  55. Layout.alignment: Qt.AlignCenter
  56. Layout.preferredWidth: 400
  57. Layout.preferredHeight: 50
  58. color: "#ffffff"
  59. text: "Autofill default username on start:"
  60. verticalAlignment: Text.AlignVCenter
  61. horizontalAlignment: Text.AlignLeft
  62. font.pixelSize: 20
  63. }
  64. Text {
  65. id: settingsCliPath
  66. Layout.alignment: Qt.AlignCenter
  67. Layout.preferredWidth: 400
  68. Layout.preferredHeight: 50
  69. color: "#ffffff"
  70. text: "CLI-Path: "
  71. verticalAlignment: Text.AlignVCenter
  72. horizontalAlignment: Text.AlignLeft
  73. font.pixelSize: 20
  74. }
  75. Text {
  76. Layout.alignment: Qt.AlignCenter
  77. Layout.preferredWidth: 400
  78. Layout.preferredHeight: 50
  79. color: "#ffffff"
  80. text: "Delete my account:"
  81. verticalAlignment: Text.AlignVCenter
  82. horizontalAlignment: Text.AlignLeft
  83. font.pixelSize: 20
  84. }
  85. }
  86. ColumnLayout {
  87. Layout.alignment: Qt.AlignCenter
  88. Layout.preferredWidth: 500
  89. Layout.preferredHeight: parent.height
  90. ComboBox {
  91. id: settingsCovertMethodPicker
  92. Layout.alignment: Qt.AlignCenter
  93. Layout.preferredHeight: 50
  94. Layout.preferredWidth: 400
  95. model: ListModel {
  96. ListElement {
  97. text: "Method 1"
  98. }
  99. ListElement {
  100. text: "Method 2"
  101. }
  102. ListElement {
  103. text: "Method 3"
  104. }
  105. }
  106. }
  107. Switch {
  108. id: settingsSaveIpSwitch
  109. Layout.alignment: Qt.AlignCenter
  110. Layout.preferredHeight: 50
  111. Layout.preferredWidth: 400
  112. text: ""
  113. checked: false
  114. display: AbstractButton.IconOnly
  115. }
  116. Switch {
  117. id: settingsSaveUsernameSwitch
  118. Layout.alignment: Qt.AlignCenter
  119. Layout.preferredHeight: 50
  120. Layout.preferredWidth: 400
  121. text: ""
  122. checked: false
  123. display: AbstractButton.IconOnly
  124. }
  125. Button {
  126. id: settingsChangeCliPathButton
  127. Layout.alignment: Qt.AlignCenter
  128. Layout.preferredHeight: 50
  129. Layout.preferredWidth: 220
  130. text: "Change (req. restart)"
  131. font.pixelSize: 20
  132. // @disable-check M223
  133. onClicked: {
  134. // @disable-check M222
  135. settingsCliDialog.open()
  136. }
  137. }
  138. Button {
  139. id: settingsDeleteMeButton
  140. Layout.alignment: Qt.AlignCenter
  141. Layout.preferredHeight: 50
  142. Layout.preferredWidth: 150
  143. text: "Delete Me"
  144. font.pixelSize: 20
  145. // @disable-check M223
  146. onClicked: {
  147. // @disable-check M222
  148. deleteMePopup.open()
  149. }
  150. }
  151. }
  152. }
  153. Rectangle {
  154. Layout.alignment: Qt.AlignCenter
  155. Layout.preferredWidth: parent.width
  156. Layout.preferredHeight: 2
  157. Layout.bottomMargin: 30
  158. color: Material.accent
  159. }
  160. RowLayout {
  161. Layout.alignment: Qt.AlignCenter
  162. Layout.preferredWidth: parent.width
  163. Layout.preferredHeight: 50
  164. Layout.bottomMargin: 20
  165. Button {
  166. id: settingsResetButton
  167. Layout.alignment: Qt.AlignCenter
  168. Layout.preferredWidth: 200
  169. Layout.preferredHeight: 50
  170. text: "Select defaults"
  171. font.pixelSize: 20
  172. onClicked: {
  173. _qmlHandler.onSettingsResetButton()
  174. }
  175. }
  176. Button {
  177. id: settingsSaveButton
  178. Layout.alignment: Qt.AlignCenter
  179. Layout.preferredWidth: 200
  180. Layout.preferredHeight: 50
  181. text: "Save Changes"
  182. font.pixelSize: 20
  183. onClicked: {
  184. _qmlHandler.onSettingsSaveButton(settingsCovertMethodPicker.currentIndex,
  185. settingsSaveIpSwitch.checked,
  186. settingsSaveUsernameSwitch.checked,
  187. settingsCliPath.text.replace("CLI-Path: ", ""))
  188. }
  189. }
  190. Button {
  191. id: settingsRevertChangesButton
  192. Layout.alignment: Qt.AlignCenter
  193. Layout.preferredWidth: 200
  194. Layout.preferredHeight: 50
  195. text: "Revert Changes"
  196. font.pixelSize: 20
  197. onClicked: {
  198. _qmlHandler.onSettingsRevertChangesButton()
  199. }
  200. }
  201. }
  202. }
  203. FileDialog {
  204. id: settingsCliDialog
  205. nameFilters: ["CLI file (ccats-cli)"]
  206. title: "Please select the CLI File"
  207. folder: shortcuts.home
  208. // @disable-check M223
  209. onAccepted: {
  210. // @disable-check M222
  211. var path = settingsCliDialog.fileUrl.toString()
  212. path = path.replace(/^(file:\/{2})/,"");
  213. settingsCliPath.text = "CLI-Path: " + path
  214. }
  215. }
  216. DeleteMePopup {
  217. id: deleteMePopup
  218. }
  219. }