forked from Silverfish/proton-bridge
feat: clientmanager has checkconnection
This commit is contained in:
@ -23,7 +23,6 @@ import (
|
||||
"strings"
|
||||
|
||||
"github.com/ProtonMail/proton-bridge/internal/preferences"
|
||||
"github.com/ProtonMail/proton-bridge/pkg/connection"
|
||||
"github.com/ProtonMail/proton-bridge/pkg/ports"
|
||||
"github.com/abiosoft/ishell"
|
||||
)
|
||||
@ -41,7 +40,7 @@ func (f *frontendCLI) restart(c *ishell.Context) {
|
||||
}
|
||||
|
||||
func (f *frontendCLI) checkInternetConnection(c *ishell.Context) {
|
||||
if connection.CheckInternetConnection() == nil {
|
||||
if f.bridge.CheckConnection() == nil {
|
||||
f.Println("Internet connection is available.")
|
||||
} else {
|
||||
f.Println("Can not contact server please check you internet connection.")
|
||||
|
||||
@ -49,7 +49,7 @@ import (
|
||||
|
||||
//"github.com/ProtonMail/proton-bridge/pkg/keychain"
|
||||
"github.com/ProtonMail/proton-bridge/pkg/listener"
|
||||
pmapi "github.com/ProtonMail/proton-bridge/pkg/pmapi"
|
||||
"github.com/ProtonMail/proton-bridge/pkg/pmapi"
|
||||
"github.com/ProtonMail/proton-bridge/pkg/updates"
|
||||
"github.com/kardianos/osext"
|
||||
"github.com/skratchdot/open-golang/open"
|
||||
@ -86,7 +86,7 @@ type FrontendQt struct {
|
||||
programName string // Program name (shown in taskbar).
|
||||
programVer string // Program version (shown in help).
|
||||
|
||||
authClient bridge.PMAPIProvider
|
||||
authClient pmapi.Client
|
||||
|
||||
auth *pmapi.Auth
|
||||
|
||||
@ -569,7 +569,7 @@ func (s *FrontendQt) isSMTPSTARTTLS() bool {
|
||||
}
|
||||
|
||||
func (s *FrontendQt) checkInternet() {
|
||||
s.Qml.SetConnectionStatus(IsInternetAvailable())
|
||||
s.Qml.SetConnectionStatus(s.bridge.CheckConnection() == nil)
|
||||
}
|
||||
|
||||
func (s *FrontendQt) switchAddressModeUser(iAccount int) {
|
||||
|
||||
@ -25,7 +25,6 @@ import (
|
||||
"os/exec"
|
||||
"time"
|
||||
|
||||
"github.com/ProtonMail/proton-bridge/pkg/connection"
|
||||
"github.com/therecipe/qt/core"
|
||||
)
|
||||
|
||||
@ -64,10 +63,6 @@ func PauseLong() {
|
||||
time.Sleep(3 * time.Second)
|
||||
}
|
||||
|
||||
func IsInternetAvailable() bool {
|
||||
return connection.CheckInternetConnection() == nil
|
||||
}
|
||||
|
||||
// FIXME: Not working in test...
|
||||
func WaitForEnter() {
|
||||
log.Print("Press 'Enter' to continue...")
|
||||
|
||||
@ -54,6 +54,7 @@ type Bridger interface {
|
||||
ClearData() error
|
||||
AllowProxy()
|
||||
DisallowProxy()
|
||||
CheckConnection() error
|
||||
}
|
||||
|
||||
// BridgeUser is an interface of user needed by frontend.
|
||||
|
||||
Reference in New Issue
Block a user