0.0.22 Added userhome functionality. /JL

This commit is contained in:
Jan Lerking
2022-12-15 10:31:24 +01:00
parent 078e49d745
commit a75c035ca8

12
main.go
View File

@@ -1,7 +1,6 @@
package main package main
import ( import (
"fmt"
"log" "log"
"math" "math"
"os/user" "os/user"
@@ -29,7 +28,7 @@ type MyMainWindow struct {
const ( const (
AppName string = "BeadImager" AppName string = "BeadImager"
Version string = "0.0.21" Version string = "0.0.22"
CopyRight string = "©2022 Jan Lerking" CopyRight string = "©2022 Jan Lerking"
STD_MESS string = "Ready" STD_MESS string = "Ready"
LogFile string = "BeadImager.log" LogFile string = "BeadImager.log"
@@ -46,14 +45,9 @@ func main() {
if err != nil { if err != nil {
log.Fatalf(err.Error()) log.Fatalf(err.Error())
} }
username := currentUser.Username homeDir := currentUser.HomeDir
if username != "MSI\\janle" { UserPath = homeDir + Sep + "BeadImager"
UserPath = fmt.Sprintf("C:\\Users\\" + username + Sep + "BeadImager")
} else {
UserPath = "C:\\Users\\janle\\BeadImager"
}
InitLogFile() InitLogFile()
log.Println("User: ", username)
walk.AppendToWalkInit(func() { walk.AppendToWalkInit(func() {
walk.FocusEffect, _ = walk.NewBorderGlowEffect(walk.RGB(0, 63, 255)) walk.FocusEffect, _ = walk.NewBorderGlowEffect(walk.RGB(0, 63, 255))