(event *tcell.EventKey)
| 614 | } |
| 615 | |
| 616 | func explorerPageKeyHandler(event *tcell.EventKey) *tcell.EventKey { |
| 617 | if event.Key() == tcell.KeyTab || event.Key() == tcell.KeyBacktab { |
| 618 | explorerRotateFocus() |
| 619 | return nil |
| 620 | } |
| 621 | |
| 622 | // Handle keys that don't require a selected node first. |
| 623 | switch event.Key() { |
| 624 | case tcell.KeyCtrlF: |
| 625 | openFinder(&explorerCache, "LDAP Explorer") |
| 626 | return event |
| 627 | case tcell.KeyCtrlB: |
| 628 | openExplorerSettingsForm() |
| 629 | return event |
| 630 | } |
| 631 | |
| 632 | currentNode := treePanel.GetCurrentNode() |
| 633 | if currentNode == nil { |
| 634 | return event |
| 635 | } |
| 636 | |
| 637 | switch event.Key() { |
| 638 | case tcell.KeyCtrlP: |
| 639 | openPasswordChangeForm(currentNode) |
| 640 | case tcell.KeyCtrlL: |
| 641 | openMoveObjectForm(currentNode, func(newObjectDN string) { |
| 642 | newParentNode := reloadParentNode(currentNode) |
| 643 | |
| 644 | idx := findEntryInChildren(newObjectDN, newParentNode) |
| 645 | |
| 646 | otherNodeToSelect := newParentNode |
| 647 | |
| 648 | if idx > 0 { |
| 649 | siblings := newParentNode.GetChildren() |
| 650 | otherNodeToSelect = siblings[idx] |
| 651 | } |
| 652 | |
| 653 | treePanel.SetCurrentNode(otherNodeToSelect) |
| 654 | reloadExplorerAttrsPanel(otherNodeToSelect, CacheEntries) |
| 655 | }) |
| 656 | } |
| 657 | |
| 658 | return event |
| 659 | } |
nothing calls this directly
no test coverage detected