2019-05-22 20:35:00 -05:00
|
|
|
package gui
|
|
|
|
|
|
|
|
// import "github.com/davecgh/go-spew/spew"
|
|
|
|
// import "time"
|
|
|
|
// import "fmt"
|
|
|
|
|
|
|
|
// import "log"
|
|
|
|
import "runtime"
|
|
|
|
|
|
|
|
import "github.com/andlabs/ui"
|
|
|
|
import _ "github.com/andlabs/ui/winmanifest"
|
|
|
|
|
2019-05-26 14:05:23 -05:00
|
|
|
func ShowSplashBox() *ui.Box {
|
2019-05-22 20:35:00 -05:00
|
|
|
newbox := ui.NewVerticalBox()
|
|
|
|
newbox.SetPadded(true)
|
|
|
|
|
|
|
|
makeAttributedString()
|
2019-05-26 14:05:23 -05:00
|
|
|
Data.MyArea = makeSplashArea()
|
2019-05-22 20:35:00 -05:00
|
|
|
|
2019-05-22 22:30:48 -05:00
|
|
|
newbox.Append(Data.MyArea, true)
|
2019-05-22 20:35:00 -05:00
|
|
|
|
|
|
|
if runtime.GOOS == "linux" {
|
|
|
|
newbox.Append(ui.NewLabel("OS: Linux"), false)
|
|
|
|
} else if runtime.GOOS == "windows" {
|
|
|
|
newbox.Append(ui.NewLabel("OS: Windows"), false)
|
|
|
|
} else {
|
|
|
|
newbox.Append(ui.NewLabel("OS: " + runtime.GOOS), false)
|
|
|
|
}
|
|
|
|
|
2019-05-23 00:50:36 -05:00
|
|
|
version := "Version: " + Data.Version
|
|
|
|
newbox.Append(ui.NewLabel(version), false)
|
2019-05-23 02:12:18 -05:00
|
|
|
|
2019-05-23 15:44:53 -05:00
|
|
|
if (Data.Debug) {
|
|
|
|
if (Data.GitCommit != "") {
|
|
|
|
tmp := "git rev-list: " + Data.GitCommit
|
|
|
|
newbox.Append(ui.NewLabel(tmp), false)
|
|
|
|
}
|
|
|
|
if (Data.GoVersion != "") {
|
|
|
|
tmp := "go build version: " + Data.GoVersion
|
|
|
|
newbox.Append(ui.NewLabel(tmp), false)
|
|
|
|
}
|
2019-05-24 02:20:59 -05:00
|
|
|
if (Data.Buildtime != "") {
|
|
|
|
tmp := "build date: " + Data.Buildtime
|
|
|
|
newbox.Append(ui.NewLabel(tmp), false)
|
|
|
|
}
|
2019-05-23 02:12:18 -05:00
|
|
|
}
|
|
|
|
|
2019-05-26 14:40:07 -05:00
|
|
|
okButton := CreateButton(nil, nil, "OK", "DONE", nil)
|
2019-05-22 20:35:00 -05:00
|
|
|
newbox.Append(okButton, false)
|
|
|
|
|
|
|
|
return newbox
|
|
|
|
}
|