Moved windows actions to mainwindow_init_win.go.

This commit is contained in:
Stanislav Nikitin 2016-10-11 00:14:00 +05:00
parent 56c0d2787a
commit 3537b05dce
3 changed files with 10 additions and 8 deletions

View File

@ -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()
}

View File

@ -10,6 +10,10 @@ import (
"github.com/couchbase/goutils/platform"
)
func (m *MainWindow) closeWin() {
platform.HideConsole(false)
}
func (m *MainWindow) initializeWin() {
platform.HideConsole(true)

View File

@ -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()