Moved windows actions to mainwindow_init_win.go.
This commit is contained in:
parent
56c0d2787a
commit
3537b05dce
@ -12,6 +12,7 @@ package ui
|
|||||||
import (
|
import (
|
||||||
// stdlib
|
// stdlib
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"runtime"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
@ -193,6 +194,11 @@ func (m *MainWindow) Close() {
|
|||||||
ctx.Cfg.Cfg["/mainwindow/fav_servers/" + fav_servers_columns[i].GetTitle() + "_width"] = strconv.Itoa(fav_servers_columns[i].GetWidth())
|
ctx.Cfg.Cfg["/mainwindow/fav_servers/" + fav_servers_columns[i].GetTitle() + "_width"] = strconv.Itoa(fav_servers_columns[i].GetWidth())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Additional actions should be taken on Windows.
|
||||||
|
if runtime.GOOS == "windows" {
|
||||||
|
m.closeWin()
|
||||||
|
}
|
||||||
|
|
||||||
ctx.Close()
|
ctx.Close()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -10,6 +10,10 @@ import (
|
|||||||
"github.com/couchbase/goutils/platform"
|
"github.com/couchbase/goutils/platform"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func (m *MainWindow) closeWin() {
|
||||||
|
platform.HideConsole(false)
|
||||||
|
}
|
||||||
|
|
||||||
func (m *MainWindow) initializeWin() {
|
func (m *MainWindow) initializeWin() {
|
||||||
platform.HideConsole(true)
|
platform.HideConsole(true)
|
||||||
|
|
||||||
|
@ -18,9 +18,6 @@ import (
|
|||||||
// stdlib
|
// stdlib
|
||||||
"fmt"
|
"fmt"
|
||||||
"runtime"
|
"runtime"
|
||||||
|
|
||||||
// other
|
|
||||||
"github.com/couchbase/goutils/platform"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
@ -29,11 +26,6 @@ func main() {
|
|||||||
numCPUs := runtime.NumCPU()
|
numCPUs := runtime.NumCPU()
|
||||||
runtime.GOMAXPROCS(numCPUs)
|
runtime.GOMAXPROCS(numCPUs)
|
||||||
|
|
||||||
if runtime.GOOS == "windows" {
|
|
||||||
platform.HideConsole(true)
|
|
||||||
defer platform.HideConsole(false)
|
|
||||||
}
|
|
||||||
|
|
||||||
ctx := context.New()
|
ctx := context.New()
|
||||||
ctx.Initialize()
|
ctx.Initialize()
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user