This repository has been archived on 2021-06-24. You can view files and clone it, but cannot push or open issues or pull requests.
ui/qml/panes/GroupSettingsPane.qml

134 lines
2.5 KiB
QML
Raw Permalink Normal View History

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
id: gsp
2018-11-22 00:01:17 +00:00
anchors.fill: parent
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-02-12 22:47:23 +00:00
Column {
leftPadding: 10
spacing: 5
2018-11-22 00:01:17 +00:00
ScalingLabel {
text: "Server:"
}
2019-02-12 22:47:23 +00:00
TextField {
2018-11-22 00:01:17 +00:00
id: txtServer
2019-02-12 22:47:23 +00:00
style: CwtchTextFieldStyle{ width: 400 }
readOnly: true
2018-11-22 00:01:17 +00:00
}
2019-02-12 22:47:23 +00:00
SimpleButton {
icon: "regular/clipboard"
text: "copy"
onClicked: {
gcd.popup("copied to clipboard!")
txtServer.selectAll()
txtServer.copy()
}
}
2018-11-22 00:01:17 +00:00
ScalingLabel {
text: "Invitation:"
}
2019-02-12 22:47:23 +00:00
TextField {
2018-11-22 00:01:17 +00:00
id: txtInvitation
2019-02-12 22:47:23 +00:00
style: CwtchTextFieldStyle{ width: 400 }
readOnly: true
2018-11-22 00:01:17 +00:00
}
SimpleButton {
icon: "regular/clipboard"
text: "copy"
onClicked: {
gcd.popup("copied to clipboard!")
txtInvitation.selectAll()
txtInvitation.copy()
}
}
ScalingLabel{
text: "Group name:"
}
2019-02-12 22:47:23 +00:00
TextField {
id: txtGroupName
2019-02-12 22:47:23 +00:00
style: CwtchTextFieldStyle{ width: 400 }
}
SimpleButton {
text: "Save"
onClicked: {
gcd.saveGroupSettings(groupID, txtGroupName.text)
theStack.title = txtGroupName.text
theStack.pane = theStack.messagePane
}
}
ScalingLabel { text: "Invite someone to the group:" }
ComboBox {
id: cbInvite
2019-02-12 22:47:23 +00:00
//popup.font.pixelSize: 12
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 {
text: "Invite"
onClicked: {
2019-02-11 20:23:31 +00:00
gcd.inviteToGroup(addrbook[cbInvite.currentIndex], groupID)
}
}
SimpleButton {
icon: "regular/trash-alt"
text: "delete"
onClicked: {
gcd.leaveGroup(groupID)
theStack.pane = theStack.emptyPane
}
}
2019-02-12 22:47:23 +00:00
}//end of column with padding
2018-11-22 00:01:17 +00:00
Connections {
target: gcd
onSupplyGroupSettings: function(gid, name, server, invite, accepted, addrbooknames, addrbookaddrs) {
console.log("Supplied " + gid + " " + name)
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
}
}
}