mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-21 09:36:51 +00:00
feat: early access
This commit is contained in:
@ -370,6 +370,12 @@ func (s *FrontendQt) qtExecute(Procedure func(*FrontendQt) error) error {
|
||||
s.Qml.SetIsProxyAllowed(false)
|
||||
}
|
||||
|
||||
if updater.UpdateChannel(s.settings.Get(settings.UpdateChannelKey)) == updater.BetaChannel {
|
||||
s.Qml.SetIsEarlyAccess(true)
|
||||
} else {
|
||||
s.Qml.SetIsEarlyAccess(false)
|
||||
}
|
||||
|
||||
s.eventListener.RetryEmit(events.TLSCertIssue)
|
||||
s.eventListener.RetryEmit(events.ErrorEvent)
|
||||
|
||||
@ -548,6 +554,18 @@ func (s *FrontendQt) toggleAutoUpdate() {
|
||||
}
|
||||
}
|
||||
|
||||
func (s *FrontendQt) toggleEarlyAccess() {
|
||||
defer s.Qml.ProcessFinished()
|
||||
|
||||
if updater.UpdateChannel(s.settings.Get(settings.UpdateChannelKey)) == updater.BetaChannel {
|
||||
s.settings.Set(settings.UpdateChannelKey, string(updater.LiveChannel))
|
||||
s.Qml.SetIsEarlyAccess(false)
|
||||
} else {
|
||||
s.settings.Set(settings.UpdateChannelKey, string(updater.BetaChannel))
|
||||
s.Qml.SetIsEarlyAccess(true)
|
||||
}
|
||||
}
|
||||
|
||||
func (s *FrontendQt) toggleAllowProxy() {
|
||||
defer s.Qml.ProcessFinished()
|
||||
|
||||
|
||||
@ -35,6 +35,7 @@ type GoQMLInterface struct {
|
||||
|
||||
_ bool `property:"isAutoStart"`
|
||||
_ bool `property:"isAutoUpdate"`
|
||||
_ bool `property:"isEarlyAccess"`
|
||||
_ bool `property:"isProxyAllowed"`
|
||||
_ string `property:"currentAddress"`
|
||||
_ string `property:"goos"`
|
||||
@ -94,6 +95,7 @@ type GoQMLInterface struct {
|
||||
|
||||
_ func() `slot:"toggleAutoStart"`
|
||||
_ func() `slot:"toggleAutoUpdate"`
|
||||
_ func() `slot:"toggleEarlyAccess"`
|
||||
_ func() `slot:"toggleAllowProxy"`
|
||||
_ func() `slot:"loadAccounts"`
|
||||
_ func() `slot:"openLogs"`
|
||||
@ -157,6 +159,7 @@ func (s *GoQMLInterface) init() {}
|
||||
// SetFrontend connects all slots and signals from Go to QML.
|
||||
func (s *GoQMLInterface) SetFrontend(f *FrontendQt) {
|
||||
s.ConnectToggleAutoStart(f.toggleAutoStart)
|
||||
s.ConnectToggleEarlyAccess(f.toggleEarlyAccess)
|
||||
s.ConnectToggleAutoUpdate(f.toggleAutoUpdate)
|
||||
s.ConnectToggleAllowProxy(f.toggleAllowProxy)
|
||||
s.ConnectLoadAccounts(f.loadAccounts)
|
||||
|
||||
Reference in New Issue
Block a user