Esempio n. 1
0
func MenuEditPost(menu *GoAppMenu, fts *models.FilesTreeStore, jl IJobList) {
	MenuEditCurrent(menu, fts, jl)
	cursor := fts.Current()
	var obj tr.TreeElementIf
	if len(cursor.Path) != 0 {
		obj = fts.Object(cursor)
	}
	global.GVC().XmlTextView().Set(obj)
	global.GVC().Sync()
}
Esempio n. 2
0
func MenuEditCurrent(menu *GoAppMenu, fts *models.FilesTreeStore, jl IJobList) {
	menu.editUndo.SetSensitive(jl.CanUndo())
	menu.editRedo.SetSensitive(jl.CanRedo())
	var prop tr.Property
	cursor := fts.Current()
	if len(cursor.Path) != 0 {
		prop = fts.Property(cursor)
		menu.editNew.SetSensitive(prop.MayAddObject())
		menu.editDelete.SetSensitive(prop.MayRemove())
		menu.editEdit.SetSensitive(prop.MayEdit())
	} else {
		menu.editNew.SetSensitive(false)
		menu.editDelete.SetSensitive(false)
		menu.editEdit.SetSensitive(false)
	}
}