Merge branch 'master' into add-profile
the build was successful Details

This commit is contained in:
Dan Ballard 2019-11-29 17:37:39 -08:00
commit fbecb20e05
2 changed files with 201 additions and 1 deletions

View File

@ -121,7 +121,7 @@ func App(gcd *ui.GrandCentralDispatcher, subscribed chan bool, reloadingFirst bo
if e.Data[event.Status] != "running" {
peer.Listen()
peer.StartPeersConnections()
//peer.StartGroupConnections()
peer.StartGroupConnections()
}
blockUnkownPeers, exists := peer.GetProfile().GetAttribute(constants.BlockUnknownPeersSetting)

View File

@ -0,0 +1,200 @@
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
import QtQuick.Controls 1.4
import "../widgets"
import "../styles"
ColumnLayout { // Add Profile Pane
id: profileAddEditPane
anchors.fill: parent
property string mode // edit or add
StackToolbar {
id: stb
text: mode == "add" ? qsTr("add-profile-title") : qsTr("edit-profile-title")
aux.visible: false
membership.visible: false
stack: "management"
}
function reset() {
txtProfileName.text = qsTr("default-profile-name")
txtPassword1.text = ""
txtPassword2.text = ""
deleteReset()
}
function load(onion, name, pass) {
onionLabel.text = onion
txtProfileName.text = name
txtPassword1.text = pass
txtPassword2.text = pass
deleteReset()
}
function deleteReset() {
deleteConfirmLabel.visible = false
deleteConfirmLabel.visible = false
deleteConfirmLabel.color = "black"
confirmDeleteTxt.visible = false
confirmDeleteTxt.text = ""
confirmDeleteBtn.visible = false
}
Flickable {
anchors.top: stb.bottom
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: parent.bottom
boundsBehavior: Flickable.StopAtBounds
clip:true
contentWidth: tehcol.width
contentHeight: tehcol.height
Column {
id: tehcol
leftPadding: 10
spacing: 5
width: profileAddEditPane.width
ScalingLabel {
//: Onion
text: qsTr("profile-onion-label") + ":"
visible: mode == "edit"
}
ScalingLabel {
id: onionLabel
visible: mode == "edit"
}
ScalingLabel {
//: Display name
text: qsTr("profile-name") + ":"
}
TextField {
id: txtProfileName
Layout.fillWidth: true
style: CwtchTextFieldStyle{ width: tehcol.width * 0.8 }
//: default suggested profile name
text: qsTr("default-profile-name")
}
ScalingLabel {
//: Password
text: qsTr("password1-label") + ":"
}
TextField {
id: txtPassword1
Layout.fillWidth: true
style: CwtchTextFieldStyle{ width: tehcol.width * 0.8 }
echoMode: TextInput.Password
readOnly: mode == "edit"
}
ScalingLabel {
//: Reenter password
text: qsTr("password2-label") + ":"
}
TextField {
id: txtPassword2
Layout.fillWidth: true
style: CwtchTextFieldStyle{ width: tehcol.width * 0.8 }
echoMode: TextInput.Password
readOnly: mode == "edit"
}
SimpleButton {
//: Create Profile || Save Profile
text: mode == "add" ? qsTr("create-profile-btn") : qsTr("save-profile-btn")
onClicked: {
if (txtPassword1.text != txtPassword2.text) {
passwordErrorLabel.visible = true
} else {
if (mode == "add") {
gcd.createProfile(txtProfileName.text, txtPassword1.text)
} else {
gcd.updateNick(onionLabel.text, txtProfileName.text)
}
gcd.reloadProfileList()
parentStack.pane = parentStack.managementPane
}
}
}
ScalingLabel {
id: passwordErrorLabel
//: Passwords do not match
text: qsTr("password-error-match")
visible: false
color: "red"
}
SimpleButton {
//: Delete Profile
text: qsTr("delete-profile-btn")
icon: "regular/trash-alt"
visible: mode == "edit"
onClicked: {
deleteConfirmLabel.visible = true
deleteConfirmLabel.visible = true
confirmDeleteTxt.visible = true
confirmDeleteBtn.visible = true
}
}
ScalingLabel {
id: deleteConfirmLabel
//: Type DELETE to confirm
text: qsTr("delete-confirm-label")+ ":"
visible: false
}
TextField {
id: confirmDeleteTxt
Layout.fillWidth: true
style: CwtchTextFieldStyle{ width: tehcol.width * 0.8 }
visible: false
}
SimpleButton {
id: confirmDeleteBtn
icon: "regular/trash-alt"
//: Really Delete Profile
text: qsTr("delete-profile-confirm-btn")
color: "red"
visible: false
onClicked: {
//: DELETE
if (confirmDeleteTxt.text == qsTr("delete-confirm-text")) {
gcd.deleteProfile(onionLabel.text)
gcd.reloadProfileList()
parentStack.pane = parentStack.managementPane
} else {
deleteConfirmLabel.color = "red"
}
}
}
}//end of column with padding
}//end of flickable
}