Пример #1
0
// SetConfig sets the config data for the manager.
//
func (m *Manager) SetConfig(conf *Config) {
	m.Config = conf

	switch m.Config.BackendID {
	case BackendInternal:
		m.backend = YTDL{}

	case BackendYoutubeDL:
		m.backend = YoutubeDL{}
	}

	m.CmdOpenDir = strhelp.First(m.CmdOpenDir, cdglobal.CmdOpen)
	m.CmdOpenVideo = strhelp.First(m.CmdOpenVideo, cdglobal.CmdOpen)
	m.CmdOpenWeb = strhelp.First(m.CmdOpenWeb, cdglobal.CmdOpen)
}
Пример #2
0
// OpenFile opens a file to an editor.
// If the path is relative, the target sources folder will be used.
//
func (app *Applet) OpenFile(file string) {
	if !filepath.IsAbs(file) {
		file = filepath.Join(app.target.SourceDir(), file)
	}
	cmd := strhelp.First(app.conf.CmdOpenSource, cdglobal.CmdOpen)
	app.Log().ExecAsync(cmd, file)
}