2018-11-22 00:01:17 +00:00
|
|
|
import QtGraphicalEffects 1.0
|
|
|
|
import QtQuick 2.7
|
|
|
|
import QtQuick.Controls 2.4
|
|
|
|
import QtQuick.Controls.Material 2.0
|
|
|
|
import QtQuick.Layouts 1.3
|
|
|
|
import QtQuick.Window 2.11
|
2019-02-12 22:47:23 +00:00
|
|
|
import QtQuick.Controls 1.4
|
2018-11-22 00:01:17 +00:00
|
|
|
|
|
|
|
import "../widgets"
|
2019-02-12 22:47:23 +00:00
|
|
|
import "../styles"
|
2019-02-13 05:08:43 +00:00
|
|
|
import "../utils.js" as Utils
|
2018-11-22 00:01:17 +00:00
|
|
|
|
|
|
|
ColumnLayout { // groupSettingsPane
|
2019-02-13 07:09:39 +00:00
|
|
|
id: gsp
|
2018-11-22 00:01:17 +00:00
|
|
|
anchors.fill: parent
|
2019-02-05 00:41:18 +00:00
|
|
|
property string groupID
|
2019-02-11 20:23:31 +00:00
|
|
|
property variant addrbook
|
2018-11-22 00:01:17 +00:00
|
|
|
|
|
|
|
StackToolbar {
|
|
|
|
id: toolbar
|
|
|
|
aux.visible: false
|
2019-02-13 04:25:20 +00:00
|
|
|
back.onClicked: theStack.pane = theStack.messagePane
|
2018-11-22 00:01:17 +00:00
|
|
|
}
|
|
|
|
|
2019-04-16 19:40:19 +00:00
|
|
|
Flickable {
|
|
|
|
anchors.top: toolbar.bottom
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.bottom: parent.bottom
|
|
|
|
boundsBehavior: Flickable.StopAtBounds
|
|
|
|
clip:true
|
|
|
|
contentWidth: tehcol.width
|
|
|
|
contentHeight: tehcol.height
|
|
|
|
|
2019-02-12 22:47:23 +00:00
|
|
|
Column {
|
2019-04-16 19:40:19 +00:00
|
|
|
id: tehcol
|
|
|
|
width: gsp.width
|
2019-02-12 22:47:23 +00:00
|
|
|
leftPadding: 10
|
|
|
|
spacing: 5
|
|
|
|
|
2018-11-22 00:01:17 +00:00
|
|
|
ScalingLabel {
|
2019-03-11 21:31:53 +00:00
|
|
|
text: qsTr("server-label") + ":"
|
2018-11-22 00:01:17 +00:00
|
|
|
}
|
|
|
|
|
2019-02-12 22:47:23 +00:00
|
|
|
TextField {
|
2018-11-22 00:01:17 +00:00
|
|
|
id: txtServer
|
2019-04-16 19:40:19 +00:00
|
|
|
style: CwtchTextFieldStyle{ width: tehcol.width * 0.8 }
|
2019-02-05 00:41:18 +00:00
|
|
|
readOnly: true
|
2018-11-22 00:01:17 +00:00
|
|
|
}
|
|
|
|
|
2019-02-12 22:47:23 +00:00
|
|
|
SimpleButton {
|
|
|
|
icon: "regular/clipboard"
|
2019-03-11 21:31:53 +00:00
|
|
|
text: qsTr("copy-btn")
|
2019-02-12 22:47:23 +00:00
|
|
|
|
|
|
|
onClicked: {
|
2019-03-11 21:31:53 +00:00
|
|
|
gcd.popup("copied-clipboard-notification")
|
2019-02-12 22:47:23 +00:00
|
|
|
txtServer.selectAll()
|
|
|
|
txtServer.copy()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-11-22 00:01:17 +00:00
|
|
|
ScalingLabel {
|
2019-03-11 21:31:53 +00:00
|
|
|
text: qsTr("invitation-label") + ":"
|
2018-11-22 00:01:17 +00:00
|
|
|
}
|
|
|
|
|
2019-02-12 22:47:23 +00:00
|
|
|
TextField {
|
2018-11-22 00:01:17 +00:00
|
|
|
id: txtInvitation
|
2019-04-16 19:40:19 +00:00
|
|
|
style: CwtchTextFieldStyle{ width: tehcol.width * 0.8 }
|
2019-02-05 00:41:18 +00:00
|
|
|
readOnly: true
|
2018-11-22 00:01:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
SimpleButton {
|
|
|
|
icon: "regular/clipboard"
|
2019-03-11 21:31:53 +00:00
|
|
|
text: qsTr("copy-btn")
|
2018-11-22 00:01:17 +00:00
|
|
|
|
|
|
|
onClicked: {
|
2019-03-11 21:31:53 +00:00
|
|
|
gcd.popup("copied-clipboard-notification")
|
2018-11-22 00:01:17 +00:00
|
|
|
txtInvitation.selectAll()
|
|
|
|
txtInvitation.copy()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-02-05 00:41:18 +00:00
|
|
|
ScalingLabel{
|
2019-03-11 21:31:53 +00:00
|
|
|
text: qsTr("group-name-label") + ":"
|
2019-02-05 00:41:18 +00:00
|
|
|
}
|
|
|
|
|
2019-02-12 22:47:23 +00:00
|
|
|
TextField {
|
2019-02-05 00:41:18 +00:00
|
|
|
id: txtGroupName
|
2019-04-16 19:40:19 +00:00
|
|
|
style: CwtchTextFieldStyle{ width: tehcol.width * 0.8 }
|
2019-02-05 00:41:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
SimpleButton {
|
2019-03-11 21:31:53 +00:00
|
|
|
text: qsTr("save-btn")
|
2019-02-05 00:41:18 +00:00
|
|
|
|
|
|
|
onClicked: {
|
|
|
|
gcd.saveGroupSettings(groupID, txtGroupName.text)
|
|
|
|
theStack.title = txtGroupName.text
|
|
|
|
theStack.pane = theStack.messagePane
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-03-11 21:31:53 +00:00
|
|
|
//: Invite someone to the group
|
|
|
|
ScalingLabel { text: qsTr("invite-to-group-label") }
|
2019-02-05 20:09:31 +00:00
|
|
|
|
|
|
|
ComboBox {
|
|
|
|
id: cbInvite
|
2019-02-12 22:47:23 +00:00
|
|
|
//popup.font.pixelSize: 12
|
2019-02-05 20:09:31 +00:00
|
|
|
width: 200
|
2019-02-12 22:47:23 +00:00
|
|
|
//font.pixelSize: 20
|
2019-02-13 05:08:43 +00:00
|
|
|
style: CwtchComboBoxStyle{}
|
2019-02-05 20:22:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
SimpleButton {
|
2019-03-11 21:31:53 +00:00
|
|
|
text: qsTr("invite-btn")
|
2019-02-05 20:22:33 +00:00
|
|
|
|
|
|
|
onClicked: {
|
2019-02-11 20:23:31 +00:00
|
|
|
gcd.inviteToGroup(addrbook[cbInvite.currentIndex], groupID)
|
2019-02-05 20:09:31 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-02-13 07:09:39 +00:00
|
|
|
SimpleButton {
|
|
|
|
icon: "regular/trash-alt"
|
2019-03-11 21:31:53 +00:00
|
|
|
text: qsTr("delete-btn")
|
2019-02-13 07:09:39 +00:00
|
|
|
|
|
|
|
onClicked: {
|
|
|
|
gcd.leaveGroup(groupID)
|
|
|
|
theStack.pane = theStack.emptyPane
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-02-12 22:47:23 +00:00
|
|
|
}//end of column with padding
|
2019-04-16 19:40:19 +00:00
|
|
|
}//end of flickable
|
2018-11-22 00:01:17 +00:00
|
|
|
|
|
|
|
Connections {
|
|
|
|
target: gcd
|
|
|
|
|
2019-02-14 02:42:13 +00:00
|
|
|
onSupplyGroupSettings: function(gid, name, server, invite, accepted, addrbooknames, addrbookaddrs) {
|
2019-02-13 07:09:39 +00:00
|
|
|
gsp.groupID = gid
|
2018-11-22 00:01:17 +00:00
|
|
|
toolbar.text = name
|
|
|
|
txtGroupName.text = name
|
|
|
|
txtServer.text = server
|
|
|
|
txtInvitation.text = invite
|
2019-02-13 05:08:43 +00:00
|
|
|
cbInvite.model = addrbooknames.map(function(e){return Utils.htmlEscaped(e)})
|
2019-02-11 20:23:31 +00:00
|
|
|
addrbook = addrbookaddrs
|
2018-11-22 00:01:17 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|