MCPcopy Create free account
hub / github.com/246859/AutoToolBox / SetMenu

Function SetMenu

toolbox/toolbox.go:269–286  ·  view source on GitHub ↗
(dir string, items []string, top bool)

Source from the content-addressed store, hash-verified

267}
268
269func SetMenu(dir string, items []string, top bool) error {
270 toolboxDisplay := fmt.Sprintf("Open %s Here", AppName)
271 toolboxCmd := filepath.Join(dir, _ToolBoxCommand)
272 subCommands := strings.Join(items, ";")
273
274 // add directory background shell
275 err := SetMenuItem(DirectoryBackgroundShell+AppName, toolboxDisplay, toolboxCmd, subCommands, top)
276 if err != nil {
277 return err
278 }
279
280 // add directory shell
281 err = SetMenuItem(DirectoryShell+AppName, toolboxDisplay, toolboxCmd, subCommands, top)
282 if err != nil {
283 return err
284 }
285 return nil
286}
287
288// SetMenuItem add menu to registry
289func SetMenuItem(path, display, command, subCommands string, top bool) error {

Callers 3

RunSetFunction · 0.92
RunAddFunction · 0.92
RemoveToolsFunction · 0.92

Calls 1

SetMenuItemFunction · 0.85

Tested by

no test coverage detected