U: application config, init

This commit is contained in:
杨红岩 2023-06-22 15:47:57 +08:00
parent e0a7dd9edc
commit 2a03a3594c
3 changed files with 11 additions and 8 deletions

View File

@ -43,11 +43,11 @@ func (m *TCEFApplication) SetObjectRootName(name string) {
//initDefaultSettings 初始 energy 默认设置
func (m *TCEFApplication) initDefaultSettings() {
lp := libPath()
if lp != "" {
m.SetFrameworkDirPath(lp)
m.SetResourcesDirPath(lp)
m.SetLocalesDirPath(path.Join(lp, "locales"))
if m.FrameworkDirPath() == "" {
lp := libPath()
if lp != "" {
m.SetFrameworkDirPath(lp)
}
}
m.SetLocale(LANGUAGE_zh_CN)
m.SetLogSeverity(LOGSEVERITY_DISABLE)
@ -130,6 +130,9 @@ func (m *TCEFApplication) FrameworkDirPath() string {
func (m *TCEFApplication) SetFrameworkDirPath(value string) {
imports.Proc(def.CEFAppConfig_SetFrameworkDirPath).Call(api.PascalStr(value))
// 默认 resources 和 locals 在同一目录
m.SetResourcesDirPath(value)
m.SetLocalesDirPath(path.Join(value, "locales"))
}
// MainBundlePath 仅用于macOS

2
go.mod
View File

@ -3,7 +3,7 @@ module github.com/energye/energy/v2
go 1.18
require (
github.com/energye/golcl v0.0.0-20230607072628-c317d3f83490
github.com/energye/golcl v1.0.1
github.com/godbus/dbus/v5 v5.1.0
github.com/jessevdk/go-flags v1.5.0
github.com/json-iterator/go v1.1.12

4
go.sum
View File

@ -1,8 +1,8 @@
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/energye/golcl v0.0.0-20230607072628-c317d3f83490 h1:vMHyTgLHArcIey6FNULfoJm9gsqE09FC+FTC2Fx3swQ=
github.com/energye/golcl v0.0.0-20230607072628-c317d3f83490/go.mod h1:zMXHYLRCs4FbWMc7mK+ePsbrgvrsWzgnONk/Yjt/C1E=
github.com/energye/golcl v1.0.1 h1:qNrMuUJ+L2JFKMlSEZd1rjIsm/dflX7ITfWEGFumrdc=
github.com/energye/golcl v1.0.1/go.mod h1:zMXHYLRCs4FbWMc7mK+ePsbrgvrsWzgnONk/Yjt/C1E=
github.com/godbus/dbus/v5 v5.1.0 h1:4KLkAxT3aOY8Li4FRJe/KvhoNFFxo0m6fNuFUO8QJUk=
github.com/godbus/dbus/v5 v5.1.0/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=