Example #1
0
func main() {
	path, isTest := vdata.TestPathDefault()

	// path := cdglobal.ConfigDirDock("") + "/current_theme/cairo-dock.conf"

	// path := cdglobal.AppBuildPathFull(pathGoGmail...)

	gtk.Init(nil)

	source := vdata.New(log.NewLog(log.Logs), nil, nil)
	build := vdata.TestInit(source, path)
	if build == nil {
		return
	}
	build.BuildAll(pageswitch.New())
	if isTest {
		cfprint.Updated(build)
		build.KeyWalk(vdata.TestValues)
		cfprint.Updated(build)
	} else {
		cfprint.Default(build, true)
	}
}
Example #2
0
// Save updates the configuration file with user changes.
//
func (build *builder) Save() {
	if confown.Settings.ToVirtual(build.conf.FilePath()) {
		cfprint.Updated(build)
		return
	}

	build.Log().DEV("save real")

	build.KeyWalk((*cftype.Key).UpdateStorage)

	_, str, e := build.conf.ToData()
	if build.log.Err(e, "save: get keyfile data") {
		return
	}

	tofile, e := confown.SaveFile(build.conf.FilePath(), str)
	if !build.Log().Err(e, "save config") && build.postSave != nil && tofile {
		build.postSave()
	}
}