GODT-1388: Refactor Alternative routing

This commit is contained in:
Alexander Bilyak
2021-10-27 16:14:18 +02:00
committed by Jakub
parent af0c5e6bae
commit 42ced6694e
6 changed files with 26 additions and 27 deletions

View File

@ -99,12 +99,8 @@ func (f *FrontendQt) toggleAutostart(makeItEnabled bool) {
}
func (f *FrontendQt) toggleDoH(makeItEnabled bool) {
if f.settings.GetBool(settings.AllowProxyKey) == makeItEnabled {
f.qml.SetIsDoHEnabled(makeItEnabled)
return
}
f.settings.SetBool(settings.AllowProxyKey, makeItEnabled)
f.restart()
f.bridge.SetProxyAllowed(makeItEnabled)
f.qml.SetIsDoHEnabled(f.bridge.GetProxyAllowed())
}
func (f *FrontendQt) toggleUseSSLforSMTP(makeItEnabled bool) {

View File

@ -15,6 +15,7 @@
// You should have received a copy of the GNU General Public License
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>.
//go:build build_qt
// +build build_qt
package qt
@ -232,7 +233,7 @@ func (q *QMLBackend) setup(f *FrontendQt) {
}()
})
q.SetIsDoHEnabled(f.settings.GetBool(settings.AllowProxyKey))
q.SetIsDoHEnabled(f.bridge.GetProxyAllowed())
q.ConnectToggleDoH(f.toggleDoH)
q.SetUseSSLforSMTP(f.settings.GetBool(settings.SMTPSSLKey))