Exemplo n.º 1
0
def addToProfileMenu(menu):
    "Add a profile menu."
    preferences.ToolDialog().addPluginToMenu(menu, __file__[: __file__.rfind(".")])
    menu.add_separator()
    directoryPath = preferences.getPluginsDirectoryPath()
    pluginFilenames = preferences.getPluginFilenames()
    craftTypeName = preferences.getCraftTypeName()
    profileRadioVar = preferences.Tkinter.StringVar()
    for pluginFilename in pluginFilenames:
        addSubmenus(craftTypeName, menu, pluginFilename, os.path.join(directoryPath, pluginFilename), profileRadioVar)
Exemplo n.º 2
0
def addToProfileMenu( profileSelection, profileType, repository ):
	"Add a profile menu."
	pluginFilenames = preferences.getPluginFilenames()
	craftTypeName = preferences.getCraftTypeName()
	pluginModule = preferences.getCraftTypePluginModule()
	profilePluginPreferences = preferences.getReadRepository( pluginModule.getRepositoryConstructor() )
	for profileName in profilePluginPreferences.profileList.value:
		preferences.ProfileSelectionMenuRadio().getFromMenuButtonDisplay( profileSelection, profileName, repository, profileName == profilePluginPreferences.profileListbox.value )
	for pluginFilename in pluginFilenames:
		preferences.ProfileTypeMenuRadio().getFromMenuButtonDisplay( profileType, pluginFilename, repository, craftTypeName == pluginFilename )