0.3.10 Read from local pallette.xml working. /JL

This commit is contained in:
2022-12-22 22:07:07 +01:00
parent abc422f58b
commit 9d7c215ea9
4 changed files with 26 additions and 3 deletions
+8 -1
View File
@@ -199,7 +199,7 @@ func CreateBrandsList(mw *MyMainWindow) []string {
func CreatePallette(mw *MyMainWindow) {
// Open our xmlFile
XMLFile, err := os.Open("pallettes\\pallette.xml")
XMLFile, err := os.Open(UserPath + Sep + "pallette.xml")
// if we os.Open returns an error then handle it
if err != nil {
log.Print("Failed to open pallette.xml")
@@ -218,3 +218,10 @@ func CreatePallette(mw *MyMainWindow) {
log.Printf("Failed to unmarshal: %v", er)
}
}
func CheckPalletteFile() bool {
if _, err := os.Stat(UserPath + Sep + "pallette.xml"); os.IsNotExist(err) {
return false
}
return true
}