parent
12eecd3195
commit
dc8294b6bd
|
@ -25,7 +25,7 @@ QtObject:
|
|||
method rowCount(self: MailServersList, index: QModelIndex = nil): int =
|
||||
return self.mailservers.len
|
||||
|
||||
proc getMailserverName*(self: MailServersList, enode: string): string =
|
||||
proc getMailserverName*(self: MailServersList, enode: string): string {.slot.} =
|
||||
for mailserver in self.mailservers:
|
||||
if mailserver.endpoint == enode:
|
||||
return mailserver.name
|
||||
|
|
|
@ -69,6 +69,37 @@ Item {
|
|||
}
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
Layout.fillWidth: true
|
||||
StyledText {
|
||||
color: Style.current.lightBlueText
|
||||
text: qsTr("Active Mailserver")
|
||||
Layout.rightMargin: Style.current.padding
|
||||
Layout.leftMargin: Style.current.padding
|
||||
Layout.fillWidth: true
|
||||
font.weight: Font.Medium
|
||||
font.pixelSize: 20
|
||||
}
|
||||
StyledText {
|
||||
id: activeMailserverTxt
|
||||
color: Style.current.textColor
|
||||
text: "..."
|
||||
Layout.rightMargin: Style.current.padding
|
||||
Layout.leftMargin: Style.current.padding
|
||||
Layout.fillWidth: true
|
||||
wrapMode: Text.Wrap
|
||||
font.weight: Font.Medium
|
||||
font.pixelSize: 14
|
||||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: profileModel.mailservers
|
||||
onActiveMailserverChanged: (activeMailserver) => {
|
||||
activeMailserverTxt.text = profileModel.mailservers.list.getMailserverName(activeMailserver) + "\n" + activeMailserver
|
||||
}
|
||||
}
|
||||
|
||||
ColumnLayout {
|
||||
id: logContainer
|
||||
height: 300
|
||||
|
|
|
@ -14,21 +14,22 @@ Item {
|
|||
Connections {
|
||||
target: profileModel.mailservers
|
||||
onActiveMailserverChanged: (activeMailserver) => {
|
||||
syncContainer.activeMailserver = activeMailserver
|
||||
syncContainer.activeMailserver = profileModel.mailservers.list.getMailserverName(activeMailserver)
|
||||
}
|
||||
}
|
||||
|
||||
Item {
|
||||
width: profileContainer.profileContentWidth
|
||||
anchors.top: parent.top
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
|
||||
Component {
|
||||
id: mailserversList
|
||||
|
||||
StatusRadioButton {
|
||||
id: rbSetMailsever
|
||||
text: name
|
||||
checked: name === activeMailserver.activeMailserver
|
||||
checked: name === activeMailserver
|
||||
onClicked: {
|
||||
if (checked) {
|
||||
profileModel.mailservers.setMailserver(name);
|
||||
|
@ -166,7 +167,7 @@ Item {
|
|||
|
||||
StyledText {
|
||||
//% "..."
|
||||
text: profileModel.mailservers.activeMailserver || qsTrId("---")
|
||||
text: qsTr("Active mailserver: %1").arg(activeMailserver) || qsTrId("---")
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: 24
|
||||
anchors.top: switchLbl.bottom
|
||||
|
@ -176,16 +177,12 @@ Item {
|
|||
|
||||
ListView {
|
||||
id: mailServersListView
|
||||
anchors.topMargin: 200
|
||||
anchors.topMargin: 20
|
||||
anchors.top: automaticSelectionSwitch.bottom
|
||||
anchors.fill: parent
|
||||
anchors.bottom: parent.bottom
|
||||
model: profileModel.mailservers.list
|
||||
delegate: mailserversList
|
||||
visible: !automaticSelectionSwitch.checked
|
||||
|
||||
Component.onCompleted: {
|
||||
profileModel.mailservers.getActiveMailserver()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue