disable Fyne thread checks, fix async for connect to server workflow
This commit is contained in:
@@ -5,7 +5,7 @@ build:
|
||||
# so the last 3 cmds move it over manually. This is a bit fragile though
|
||||
# since it assumes a specific location and version of the dependency
|
||||
package_macos:
|
||||
CGO_CFLAGS="-I/usr/local/include -I/opt/homebrew/include" CGO_LDFLAGS="-L/usr/local/lib -L/opt/homebrew/lib" fyne package -os darwin
|
||||
CGO_CFLAGS="-I/usr/local/include -I/opt/homebrew/include" CGO_LDFLAGS="-L/usr/local/lib -L/opt/homebrew/lib" fyne package -os darwin -tags migrated_fynedo
|
||||
|
||||
bundledeps_macos_homebrew:
|
||||
dylibbundler -od -b -x ./Supersonic.app/Contents/MacOS/supersonic -d ./Supersonic.app/Contents/Frameworks/ -p @executable_path/../Frameworks/
|
||||
|
||||
@@ -438,7 +438,6 @@ func (c *Controller) DoConnectToServerWorkflow(server *backend.ServerConfig) {
|
||||
// try connecting to last used server - set up cancelable modal dialog
|
||||
canceled := false
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
defer cancel()
|
||||
dlg := dialog.NewCustom(lang.L("Connecting"), lang.L("Cancel"),
|
||||
widget.NewLabel(fmt.Sprintf(lang.L("Connecting to")+" %s", server.Nickname)), c.MainWindow)
|
||||
dlg.SetOnClosed(func() {
|
||||
@@ -447,8 +446,13 @@ func (c *Controller) DoConnectToServerWorkflow(server *backend.ServerConfig) {
|
||||
})
|
||||
c.haveModal = true
|
||||
dlg.Show()
|
||||
|
||||
// try to connect
|
||||
go func() {
|
||||
defer cancel() // make sure to free up ctx resources if user does not cancel
|
||||
|
||||
if err := c.tryConnectToServer(ctx, server, pass); err != nil {
|
||||
fyne.Do(func() {
|
||||
dlg.Hide()
|
||||
c.haveModal = false
|
||||
if canceled {
|
||||
@@ -462,10 +466,14 @@ func (c *Controller) DoConnectToServerWorkflow(server *backend.ServerConfig) {
|
||||
c.haveModal = true
|
||||
dlg.Show()
|
||||
}
|
||||
})
|
||||
} else {
|
||||
fyne.Do(func() {
|
||||
dlg.Hide()
|
||||
c.haveModal = false
|
||||
})
|
||||
}
|
||||
}()
|
||||
}
|
||||
|
||||
func (m *Controller) PromptForLoginAndConnect() {
|
||||
|
||||
Reference in New Issue
Block a user