~link2xt/kdeltachat

40092aa096bac7e279eb5a4cc97758bac484236c — link2xt a month ago 138d854
Add SOCKS5 settings
2 files changed, 58 insertions(+), 0 deletions(-)

M qml/ConfigurePage.qml
M qml/SettingsPage.qml
M qml/ConfigurePage.qml => qml/ConfigurePage.qml +27 -0
@@ 118,6 118,28 @@ Kirigami.ScrollablePage {
            textRole: "text"
        }

        Switch {
            id: socks5Enabled
            text: "SOCKS5 enabled"
        }
        TextField {
            id: socks5Host
            Kirigami.FormData.label: "SOCKS5 host: "
        }
        TextField {
            id: socks5Port
            Kirigami.FormData.label: "SOCKS5 port: "
        }
        TextField {
            id: socks5Username
            Kirigami.FormData.label: "SOCKS5 username: "
        }
        TextField {
            id: socks5Password
            Kirigami.FormData.label: "Password: "
            echoMode: TextInput.PasswordEchoOnEdit
        }

        ProgressBar {
            id: progressBar
            value: 0.0


@@ 141,6 163,11 @@ Kirigami.ScrollablePage {
                let certificate_checks = certificateChecks.model.get(certificateChecks.currentIndex).value;
                root.context.setConfig("imap_certificate_checks", certificate_checks)
                root.context.setConfig("smtp_certificate_checks", certificate_checks)
                root.context.setConfig("socks5_enabled", socks5Enabled.checked ? "1" : "0")
                root.context.setConfig("socks5_host", socks5Host.text)
                root.context.setConfig("socks5_port", socks5Port.text)
                root.context.setConfig("socks5_user", socks5Username.text)
                root.context.setConfig("socks5_password", socks5Password.text)
                root.context.configure()
            }
        }

M qml/SettingsPage.qml => qml/SettingsPage.qml +31 -0
@@ 90,5 90,36 @@ Kirigami.ScrollablePage {
            currentIndex: root.context.getConfig("show_emails")
            onActivated: root.context.setConfig("show_emails", currentIndex)
        }

        Switch {
            text: "SOCKS5 enabled"
            checked: settingsPageRoot.context.getConfig("socks5_enabled") == "1"
            onToggled: settingsPageRoot.context.setConfig("socks5_enabled", checked ? "1" : "0")
        }

        TextField {
            Kirigami.FormData.label: "SOCKS5 host: "
            text: settingsPageRoot.context.getConfig("socks5_host")
            onEditingFinished: settingsPageRoot.context.setConfig("socks5_host", text)
        }

        TextField {
            Kirigami.FormData.label: "SOCKS5 port: "
            text: settingsPageRoot.context.getConfig("socks5_port")
            onEditingFinished: settingsPageRoot.context.setConfig("socks5_port", text)
        }

        TextField {
            Kirigami.FormData.label: "SOCKS5 username: "
            text: settingsPageRoot.context.getConfig("socks5_user")
            onEditingFinished: settingsPageRoot.context.setConfig("socks5_user", text)
        }

        TextField {
            Kirigami.FormData.label: "SOCKS5 password: "
            echoMode: TextInput.PasswordEchoOnEdit
            text: settingsPageRoot.context.getConfig("socks5_password")
            onEditingFinished: settingsPageRoot.context.setConfig("socks5_password", text)
        }
    }
}