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