mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-29 21:16:44 +00:00
GODT-1846: remove restart cues, implement restart-less behaviour.
Other: fixed case issue in SSL member function names. Other: removed 'restart' mention in SMTP and IMAP SSL settings. GODT-1846: modified gRPC server to introduce ConnectionMode settings. GODT-1846: implemented connection mode handling in bridge-gui. GODT-1846: implemented error reporting in bridge-gui for connection mode. Other: gathered all IMAP/SMTP server settings. GODT-1846: wired IMAP/SMTP port change errors. Other: Renamed some error events and signals. Other: Fixed crash in IMAP restart when not started. Other: dismiss port error notifications before changing ports. Other: misc. fixes.
This commit is contained in:
committed by
James Houlahan
parent
46c0463e43
commit
1f0312573a
@ -229,20 +229,20 @@ Item {
|
||||
colorScheme: root.colorScheme
|
||||
title: qsTr("IMAP")
|
||||
hostname: Backend.hostname
|
||||
port: Backend.portIMAP.toString()
|
||||
port: Backend.imapPort.toString()
|
||||
username: configuration.currentAddress
|
||||
password: root.user ? root.user.password : ""
|
||||
security : Backend.useSSLforIMAP ? "SSL" : "STARTTLS"
|
||||
security : Backend.useSSLForIMAP ? "SSL" : "STARTTLS"
|
||||
}
|
||||
|
||||
Configuration {
|
||||
colorScheme: root.colorScheme
|
||||
title: qsTr("SMTP")
|
||||
hostname : Backend.hostname
|
||||
port : Backend.portSMTP.toString()
|
||||
port : Backend.smtpPort.toString()
|
||||
username : configuration.currentAddress
|
||||
password : root.user ? root.user.password : ""
|
||||
security : Backend.useSSLforSMTP ? "SSL" : "STARTTLS"
|
||||
security : Backend.useSSLForSMTP ? "SSL" : "STARTTLS"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -696,7 +696,7 @@ Window {
|
||||
}
|
||||
RowLayout {
|
||||
Label {colorScheme: root.colorScheme; text: "SMTP using SSL:"}
|
||||
Toggle {colorScheme: root.colorScheme; checked: root.useSSLforSMTP; onClicked: root.useSSLforSMTP = !root.useSSLforSMTP}
|
||||
Toggle {colorScheme: root.colorScheme; checked: root.useSSLForSMTP; onClicked: root.useSSLForSMTP = !root.useSSLForSMTP}
|
||||
}
|
||||
RowLayout {
|
||||
Label {colorScheme: root.colorScheme; text: "Local cache:"}
|
||||
@ -822,9 +822,9 @@ Window {
|
||||
}
|
||||
|
||||
|
||||
property bool useSSLforSMTP: false
|
||||
function toggleUseSSLforSMTP(makeItActive){
|
||||
console.debug("-> SMTP SSL", makeItActive, root.useSSLforSMTP)
|
||||
property bool useSSLForSMTP: false
|
||||
function toggleUseSSLForSMTP(makeItActive){
|
||||
console.debug("-> SMTP SSL", makeItActive, root.useSSLForSMTP)
|
||||
}
|
||||
signal toggleUseSSLFinished()
|
||||
|
||||
@ -841,8 +841,8 @@ Window {
|
||||
return true
|
||||
}
|
||||
signal changePortFinished()
|
||||
signal portIssueIMAP()
|
||||
signal portIssueSMTP()
|
||||
signal imapPortStartupError()
|
||||
signal smtpPortStartupError()
|
||||
|
||||
function triggerReset() {
|
||||
console.debug("-> trigger reset")
|
||||
|
||||
@ -315,7 +315,7 @@ Item {
|
||||
|
||||
PortSettings { // 4
|
||||
colorScheme: root.colorScheme
|
||||
|
||||
notifications: root.notifications
|
||||
onBack: {
|
||||
rightContent.showGeneralSettings()
|
||||
}
|
||||
|
||||
@ -36,7 +36,7 @@ SettingsView {
|
||||
|
||||
Label {
|
||||
colorScheme: root.colorScheme
|
||||
text: qsTr("Changes require reconfiguration of email client. Bridge will automatically restart.")
|
||||
text: qsTr("Changes require reconfiguration of email client.")
|
||||
type: Label.Body
|
||||
color: root.colorScheme.text_weak
|
||||
Layout.fillWidth: true
|
||||
@ -80,13 +80,13 @@ SettingsView {
|
||||
Button {
|
||||
id: submitButton
|
||||
colorScheme: root.colorScheme
|
||||
text: qsTr("Save and restart")
|
||||
text: qsTr("Save")
|
||||
onClicked: {
|
||||
submitButton.loading = true
|
||||
root.submit()
|
||||
}
|
||||
|
||||
enabled: sslButton.checked !== Backend.useSSLforIMAP
|
||||
enabled: sslButton.checked !== Backend.useSSLForIMAP
|
||||
}
|
||||
|
||||
Button {
|
||||
@ -99,20 +99,21 @@ SettingsView {
|
||||
Connections {
|
||||
target: Backend
|
||||
|
||||
function onToggleUseSSLFinished() {
|
||||
function onChangeMailServerSettingsFinished() {
|
||||
submitButton.loading = false
|
||||
root.back()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function submit(){
|
||||
submitButton.loading = true
|
||||
Backend.toggleUseSSLforIMAP(sslButton.checked)
|
||||
Backend.setMailServerSettings(Backend.imapPort, Backend.smtpPort, sslButton.checked, Backend.useSSLForSMTP)
|
||||
}
|
||||
|
||||
function setDefaultValues(){
|
||||
sslButton.checked = Backend.useSSLforIMAP
|
||||
starttlsButton.checked = !Backend.useSSLforIMAP
|
||||
sslButton.checked = Backend.useSSLForIMAP
|
||||
starttlsButton.checked = !Backend.useSSLForIMAP
|
||||
}
|
||||
|
||||
onVisibleChanged: {
|
||||
|
||||
@ -46,8 +46,12 @@ QtObject {
|
||||
|
||||
property var all: [
|
||||
root.noInternet,
|
||||
root.portIssueIMAP,
|
||||
root.portIssueSMTP,
|
||||
root.imapPortStartupError,
|
||||
root.smtpPortStartupError,
|
||||
root.imapPortChangeError,
|
||||
root.smtpPortChangeError,
|
||||
root.imapConnectionModeChangeError,
|
||||
root.smtpConnectionModeChangeError,
|
||||
root.updateManualReady,
|
||||
root.updateManualRestartNeeded,
|
||||
root.updateManualError,
|
||||
@ -98,8 +102,8 @@ QtObject {
|
||||
}
|
||||
}
|
||||
|
||||
property Notification portIssueIMAP: Notification {
|
||||
description: qsTr("The IMAP server could not be started. Please check or change the IMAP port and restart the application.")
|
||||
property Notification imapPortStartupError: Notification {
|
||||
description: qsTr("The IMAP server could not be started. Please check or change the IMAP port.")
|
||||
brief: qsTr("IMAP port error")
|
||||
icon: "./icons/ic-alert.svg"
|
||||
type: Notification.NotificationType.Danger
|
||||
@ -108,14 +112,14 @@ QtObject {
|
||||
Connections {
|
||||
target: Backend
|
||||
|
||||
function onPortIssueIMAP() {
|
||||
root.portIssueIMAP.active = true
|
||||
function onImapPortStartupError() {
|
||||
root.imapPortStartupError.active = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
property Notification portIssueSMTP: Notification {
|
||||
description: qsTr("The SMTP server could not be started. Please check or change the SMTP port and restart the application.")
|
||||
property Notification smtpPortStartupError: Notification {
|
||||
description: qsTr("The SMTP server could not be started. Please check or change the SMTP port.")
|
||||
brief: qsTr("SMTP port error")
|
||||
icon: "./icons/ic-alert.svg"
|
||||
type: Notification.NotificationType.Danger
|
||||
@ -124,8 +128,88 @@ QtObject {
|
||||
Connections {
|
||||
target: Backend
|
||||
|
||||
function onPortIssueSMTP() {
|
||||
root.portIssueSMTP.active = true
|
||||
function onSmtpPortStartupError() {
|
||||
root.smtpPortStartupError.active = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
property Notification imapPortChangeError: Notification {
|
||||
description: qsTr("The IMAP port could not be changed.")
|
||||
brief: qsTr("IMAP port change error")
|
||||
icon: "./icons/ic-alert.svg"
|
||||
type: Notification.NotificationType.Danger
|
||||
group: Notifications.Group.Connection
|
||||
|
||||
Connections {
|
||||
target: Backend
|
||||
|
||||
function onImapPortChangeError() {
|
||||
root.imapPortChangeError.active = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
property Notification smtpPortChangeError: Notification {
|
||||
description: qsTr("The SMTP port could not be changed.")
|
||||
brief: qsTr("SMTP port change error")
|
||||
icon: "./icons/ic-alert.svg"
|
||||
type: Notification.NotificationType.Danger
|
||||
group: Notifications.Group.Connection
|
||||
|
||||
Connections {
|
||||
target: Backend
|
||||
|
||||
function onSmtpPortChangeError() {
|
||||
root.smtpPortChangeError.active = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
property Notification imapConnectionModeChangeError: Notification {
|
||||
description: qsTr("The IMAP connection mode could not be changed.")
|
||||
brief: qsTr("IMAP Connection mode change error")
|
||||
icon: "./icons/ic-alert.svg"
|
||||
type: Notification.NotificationType.Danger
|
||||
group: Notifications.Group.Connection
|
||||
|
||||
Connections {
|
||||
target: Backend
|
||||
|
||||
function onImapConnectionModeChangeError() {
|
||||
root.imapConnectionModeChangeError.active = true
|
||||
}
|
||||
}
|
||||
|
||||
action: Action {
|
||||
text: qsTr("OK")
|
||||
|
||||
onTriggered: {
|
||||
root.imapConnectionModeChangeError.active= false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
property Notification smtpConnectionModeChangeError: Notification {
|
||||
description: qsTr("The SMTP connection mode could not be changed.")
|
||||
brief: qsTr("SMTP Connection mode change error")
|
||||
icon: "./icons/ic-alert.svg"
|
||||
type: Notification.NotificationType.Danger
|
||||
group: Notifications.Group.Connection
|
||||
|
||||
Connections {
|
||||
target: Backend
|
||||
|
||||
function onSmtpConnectionModeChangeError() {
|
||||
root.smtpConnectionModeChangeError.active = true
|
||||
}
|
||||
}
|
||||
|
||||
action: Action {
|
||||
text: qsTr("OK")
|
||||
|
||||
onTriggered: {
|
||||
root.smtpConnectionModeChangeError.active= false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -27,9 +27,11 @@ SettingsView {
|
||||
|
||||
fillHeight: false
|
||||
|
||||
property var notifications
|
||||
|
||||
property bool _valuesChanged: (
|
||||
imapField.text*1 !== Backend.portIMAP ||
|
||||
smtpField.text*1 !== Backend.portSMTP
|
||||
imapField.text*1 !== Backend.imapPort ||
|
||||
smtpField.text*1 !== Backend.smtpPort
|
||||
)
|
||||
|
||||
Label {
|
||||
@ -41,7 +43,7 @@ SettingsView {
|
||||
|
||||
Label {
|
||||
colorScheme: root.colorScheme
|
||||
text: qsTr("Changes require reconfiguration of your email client. Bridge will automatically restart.")
|
||||
text: qsTr("Changes require reconfiguration of your email client.")
|
||||
type: Label.Body
|
||||
color: root.colorScheme.text_weak
|
||||
Layout.fillWidth: true
|
||||
@ -81,7 +83,7 @@ SettingsView {
|
||||
Button {
|
||||
id: submitButton
|
||||
colorScheme: root.colorScheme
|
||||
text: qsTr("Save and restart")
|
||||
text: qsTr("Save")
|
||||
enabled: root._valuesChanged
|
||||
onClicked: {
|
||||
// removing error here because we may have set it manually (port occupied)
|
||||
@ -109,7 +111,13 @@ SettingsView {
|
||||
return
|
||||
}
|
||||
|
||||
Backend.changePorts(imapField.text, smtpField.text)
|
||||
// We turn off all port error notification. They well be restored if problems persist
|
||||
root.notifications.imapPortStartupError.active = false
|
||||
root.notifications.smtpPortStartupError.active = false
|
||||
root.notifications.imapPortChangeError.active = false
|
||||
root.notifications.smtpPortChangeError.active = false
|
||||
|
||||
Backend.setMailServerSettings(imapField.text, smtpField.text, Backend.useSSLForIMAP, Backend.useSSLForSMTP)
|
||||
}
|
||||
}
|
||||
|
||||
@ -123,7 +131,7 @@ SettingsView {
|
||||
Connections {
|
||||
target: Backend
|
||||
|
||||
function onChangePortFinished() {
|
||||
function onChangeMailServerSettingsFinished() {
|
||||
submitButton.loading = false
|
||||
}
|
||||
}
|
||||
@ -148,8 +156,8 @@ SettingsView {
|
||||
|
||||
function isPortFree(field) {
|
||||
var num = field.text*1
|
||||
if (num === Backend.portIMAP) return true
|
||||
if (num === Backend.portSMTP) return true
|
||||
if (num === Backend.imapPort) return true
|
||||
if (num === Backend.smtpPort) return true
|
||||
if (!Backend.isPortFree(num)) {
|
||||
field.error = true
|
||||
field.errorString = qsTr("Port occupied")
|
||||
@ -160,8 +168,8 @@ SettingsView {
|
||||
}
|
||||
|
||||
function setDefaultValues(){
|
||||
imapField.text = Backend.portIMAP
|
||||
smtpField.text = Backend.portSMTP
|
||||
imapField.text = Backend.imapPort
|
||||
smtpField.text = Backend.smtpPort
|
||||
imapField.error = false
|
||||
smtpField.error = false
|
||||
}
|
||||
|
||||
@ -36,7 +36,7 @@ SettingsView {
|
||||
|
||||
Label {
|
||||
colorScheme: root.colorScheme
|
||||
text: qsTr("Changes require reconfiguration of email client. Bridge will automatically restart.")
|
||||
text: qsTr("Changes require reconfiguration of email client.")
|
||||
type: Label.Body
|
||||
color: root.colorScheme.text_weak
|
||||
Layout.fillWidth: true
|
||||
@ -80,13 +80,13 @@ SettingsView {
|
||||
Button {
|
||||
id: submitButton
|
||||
colorScheme: root.colorScheme
|
||||
text: qsTr("Save and restart")
|
||||
text: qsTr("Save")
|
||||
onClicked: {
|
||||
submitButton.loading = true
|
||||
root.submit()
|
||||
}
|
||||
|
||||
enabled: sslButton.checked !== Backend.useSSLforSMTP
|
||||
enabled: sslButton.checked !== Backend.useSSLForSMTP
|
||||
}
|
||||
|
||||
Button {
|
||||
@ -99,20 +99,21 @@ SettingsView {
|
||||
Connections {
|
||||
target: Backend
|
||||
|
||||
function onToggleUseSSLFinished() {
|
||||
function onChangeMailServerSettingsFinished() {
|
||||
submitButton.loading = false
|
||||
root.back()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function submit(){
|
||||
function submit() {
|
||||
submitButton.loading = true
|
||||
Backend.toggleUseSSLforSMTP(sslButton.checked)
|
||||
Backend.setMailServerSettings(Backend.imapPort, Backend.smtpPort, Backend.useSSLForIMAP, sslButton.checked)
|
||||
}
|
||||
|
||||
function setDefaultValues(){
|
||||
sslButton.checked = Backend.useSSLforSMTP
|
||||
starttlsButton.checked = !Backend.useSSLforSMTP
|
||||
sslButton.checked = Backend.useSSLForSMTP
|
||||
starttlsButton.checked = !Backend.useSSLForSMTP
|
||||
}
|
||||
|
||||
onVisibleChanged: {
|
||||
|
||||
Reference in New Issue
Block a user