main.qml 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. import QtQuick 2.12
  2. import QtQuick.Controls 2.5
  3. import "../ServerFiles"
  4. import "../Settings"
  5. import "../Connect"
  6. import "../Notifications"
  7. import "../Log"
  8. ApplicationWindow {
  9. id: window
  10. visible: true
  11. width: 1280
  12. height: 720
  13. maximumHeight: height
  14. maximumWidth: width
  15. font.capitalization: Font.MixedCase
  16. minimumHeight: height
  17. minimumWidth: width
  18. title: qsTr("Covert Channel Application")
  19. property string notificationTabTitle: "Notifications"
  20. Connections {
  21. target: _qmlHandler
  22. onNotification: {
  23. if (swipeView.currentIndex != 2)
  24. notificationTabTitle = "* Notifications"
  25. }
  26. }
  27. menuBar: MenuBar {
  28. contentHeight: 30
  29. Menu {
  30. title: qsTr("&File")
  31. Action {
  32. text: qsTr("Change Server...")
  33. onTriggered: {
  34. _qmlHandler.onSwitchServer()
  35. _qmlHandler.onStart(false)
  36. ipPopup.open()
  37. }
  38. }
  39. MenuSeparator { }
  40. Action {
  41. text: qsTr("&Quit")
  42. onTriggered: window.close()
  43. }
  44. }
  45. Menu {
  46. title: qsTr("&Help")
  47. Action {
  48. text: qsTr("About")
  49. onTriggered: aboutPopup.open()
  50. }
  51. }
  52. }
  53. SwipeView {
  54. id: swipeView
  55. anchors.fill: parent
  56. currentIndex: header.currentIndex
  57. ServerFilesForm {
  58. }
  59. NotificationsForm {
  60. }
  61. SettingsForm {
  62. }
  63. LogForm {
  64. }
  65. }
  66. header: TabBar {
  67. id: header
  68. currentIndex: swipeView.currentIndex
  69. contentHeight: 50
  70. TabButton {
  71. text: qsTr("Server Files")
  72. }
  73. TabButton {
  74. text: notificationTabTitle
  75. onClicked: {
  76. text = "Notifications"
  77. }
  78. }
  79. TabButton {
  80. text: qsTr("Settings")
  81. }
  82. TabButton {
  83. text: qsTr("Log")
  84. }
  85. }
  86. footer: FooterForm {
  87. }
  88. LoginSignupPopup {
  89. id: loginSignupPopup
  90. }
  91. IpPopup {
  92. id: ipPopup
  93. }
  94. NoConfigFoundPopup {
  95. id: noConfigFoundPopup
  96. }
  97. InvalidConfigPopup {
  98. id: invalidConfigPopup
  99. }
  100. InvalidCliPathPopup {
  101. id: invalidCliPathPopup
  102. }
  103. Popup {
  104. id: aboutPopup
  105. height: 300
  106. dim: true
  107. clip: false
  108. width: 400
  109. modal: true
  110. focus: true
  111. anchors.centerIn: Overlay.overlay
  112. Overlay.modal: Rectangle {
  113. color: "#b5b5b5e7"
  114. }
  115. TextArea {
  116. anchors.fill: parent
  117. text: "Covert Channel Application\n\nDeveloped by:\n\nTobias Alexander Wach\nPaul Leonard Sander\nMarius Rescheleit\nDenys Serdyukov\nJonas Pflanzer\n\nLicensed under the GNU General Public License v3.0"
  118. wrapMode: Text.WordWrap
  119. horizontalAlignment: Text.AlignHCenter
  120. verticalAlignment: Text.AlignVCenter
  121. font.pixelSize: 20
  122. }
  123. }
  124. Component.onCompleted: {
  125. swipeView.interactive = false
  126. ipPopup.open()
  127. _qmlHandler.onStart(true)
  128. }
  129. }