mirror of
https://github.com/taigrr/wtf
synced 2025-01-18 04:03:14 -08:00
Remove the need for every module to define a widget.ShowHelp keyboard control
This common functionality is moved up to KeyboardWidget. Modules now include widget.InitializeCommonControls() instead.
This commit is contained in:
@@ -5,7 +5,8 @@ import (
|
||||
)
|
||||
|
||||
func (widget *Widget) initializeKeyboardControls() {
|
||||
widget.SetKeyboardChar("/", widget.ShowHelp, "Show/hide this help prompt")
|
||||
widget.InitializeCommonControls()
|
||||
|
||||
widget.SetKeyboardChar("r", widget.Refresh, "Refresh widget")
|
||||
widget.SetKeyboardChar("j", widget.Next, "Select next item")
|
||||
widget.SetKeyboardChar("k", widget.Prev, "Select previous item")
|
||||
|
||||
@@ -3,7 +3,8 @@ package feedreader
|
||||
import "github.com/gdamore/tcell"
|
||||
|
||||
func (widget *Widget) initializeKeyboardControls() {
|
||||
widget.SetKeyboardChar("/", widget.ShowHelp, "Show/hide this help widget")
|
||||
widget.InitializeCommonControls()
|
||||
|
||||
widget.SetKeyboardChar("r", widget.Refresh, "Refresh widget")
|
||||
widget.SetKeyboardChar("j", widget.Next, "Select next item")
|
||||
widget.SetKeyboardChar("k", widget.Prev, "Select previous item")
|
||||
|
||||
@@ -5,7 +5,8 @@ import (
|
||||
)
|
||||
|
||||
func (widget *Widget) initializeKeyboardControls() {
|
||||
widget.SetKeyboardChar("/", widget.ShowHelp, "Show/hide this help window")
|
||||
widget.InitializeCommonControls()
|
||||
|
||||
widget.SetKeyboardChar("r", widget.Refresh, "Refresh widget")
|
||||
widget.SetKeyboardChar("h", widget.prevProject, "Select previous project")
|
||||
widget.SetKeyboardChar("l", widget.nextProject, "Select next project")
|
||||
|
||||
@@ -3,7 +3,8 @@ package git
|
||||
import "github.com/gdamore/tcell"
|
||||
|
||||
func (widget *Widget) initializeKeyboardControls() {
|
||||
widget.SetKeyboardChar("/", widget.ShowHelp, "Show/hide this help window")
|
||||
widget.InitializeCommonControls()
|
||||
|
||||
widget.SetKeyboardChar("r", widget.Refresh, "Refresh widget")
|
||||
widget.SetKeyboardChar("l", widget.NextSource, "Select next source")
|
||||
widget.SetKeyboardChar("h", widget.PrevSource, "Select previous source")
|
||||
|
||||
@@ -5,7 +5,8 @@ import (
|
||||
)
|
||||
|
||||
func (widget *Widget) initializeKeyboardControls() {
|
||||
widget.SetKeyboardChar("/", widget.ShowHelp, "Show/hide this help prompt")
|
||||
widget.InitializeCommonControls()
|
||||
|
||||
widget.SetKeyboardChar("r", widget.Refresh, "Refresh widget")
|
||||
widget.SetKeyboardChar("l", widget.NextSource, "Select next source")
|
||||
widget.SetKeyboardChar("h", widget.PrevSource, "Select previous source")
|
||||
|
||||
@@ -3,7 +3,8 @@ package gitlab
|
||||
import "github.com/gdamore/tcell"
|
||||
|
||||
func (widget *Widget) initializeKeyboardControls() {
|
||||
widget.SetKeyboardChar("/", widget.ShowHelp, "Show/hide this help prompt")
|
||||
widget.InitializeCommonControls()
|
||||
|
||||
widget.SetKeyboardChar("r", widget.Refresh, "Refresh widget")
|
||||
widget.SetKeyboardChar("h", widget.PrevSource, "Select previous project")
|
||||
widget.SetKeyboardChar("l", widget.NextSource, "Select next project")
|
||||
|
||||
@@ -3,7 +3,8 @@ package gitter
|
||||
import "github.com/gdamore/tcell"
|
||||
|
||||
func (widget *Widget) initializeKeyboardControls() {
|
||||
widget.SetKeyboardChar("/", widget.ShowHelp, "Show/hide this help prompt")
|
||||
widget.InitializeCommonControls()
|
||||
|
||||
widget.SetKeyboardChar("r", widget.Refresh, "Refresh widget")
|
||||
widget.SetKeyboardChar("j", widget.Next, "Select next item")
|
||||
widget.SetKeyboardChar("k", widget.Prev, "Select previous item")
|
||||
|
||||
@@ -3,7 +3,8 @@ package hackernews
|
||||
import "github.com/gdamore/tcell"
|
||||
|
||||
func (widget *Widget) initializeKeyboardControls() {
|
||||
widget.SetKeyboardChar("/", widget.ShowHelp, "Show/hide this help widget")
|
||||
widget.InitializeCommonControls()
|
||||
|
||||
widget.SetKeyboardChar("r", widget.Refresh, "Refresh widget")
|
||||
widget.SetKeyboardChar("j", widget.Next, "Select next item")
|
||||
widget.SetKeyboardChar("k", widget.Prev, "Select previous item")
|
||||
|
||||
@@ -3,7 +3,8 @@ package jenkins
|
||||
import "github.com/gdamore/tcell"
|
||||
|
||||
func (widget *Widget) initializeKeyboardControls() {
|
||||
widget.SetKeyboardChar("/", widget.ShowHelp, "Show/hide this help prompt")
|
||||
widget.InitializeCommonControls()
|
||||
|
||||
widget.SetKeyboardChar("r", widget.Refresh, "Refresh widget")
|
||||
widget.SetKeyboardChar("j", widget.Next, "Select next item")
|
||||
widget.SetKeyboardChar("k", widget.Prev, "Select previous item")
|
||||
|
||||
@@ -5,7 +5,8 @@ import (
|
||||
)
|
||||
|
||||
func (widget *Widget) initializeKeyboardControls() {
|
||||
widget.SetKeyboardChar("/", widget.ShowHelp, "Show/hide this help prompt")
|
||||
widget.InitializeCommonControls()
|
||||
|
||||
widget.SetKeyboardChar("r", widget.openItem, "Refresh widget")
|
||||
widget.SetKeyboardChar("j", widget.Next, "Select next item")
|
||||
widget.SetKeyboardChar("k", widget.Prev, "Select previous item")
|
||||
|
||||
@@ -3,7 +3,8 @@ package mercurial
|
||||
import "github.com/gdamore/tcell"
|
||||
|
||||
func (widget *Widget) initializeKeyboardControls() {
|
||||
widget.SetKeyboardChar("/", widget.ShowHelp, "Show/hide this help prompt")
|
||||
widget.InitializeCommonControls()
|
||||
|
||||
widget.SetKeyboardChar("r", widget.Refresh, "Refresh widget")
|
||||
widget.SetKeyboardChar("l", widget.NextSource, "Select next source")
|
||||
widget.SetKeyboardChar("h", widget.PrevSource, "Select previous source")
|
||||
|
||||
@@ -3,7 +3,8 @@ package nbascore
|
||||
import "github.com/gdamore/tcell"
|
||||
|
||||
func (widget *Widget) initializeKeyboardControls() {
|
||||
widget.SetKeyboardChar("/", widget.ShowHelp, "Show/hide this help prompt")
|
||||
widget.InitializeCommonControls()
|
||||
|
||||
widget.SetKeyboardChar("r", widget.Refresh, "Refresh widget")
|
||||
widget.SetKeyboardChar("l", widget.next, "Select next item")
|
||||
widget.SetKeyboardChar("h", widget.prev, "Select previous item")
|
||||
|
||||
@@ -3,7 +3,8 @@ package rollbar
|
||||
import "github.com/gdamore/tcell"
|
||||
|
||||
func (widget *Widget) initializeKeyboardControls() {
|
||||
widget.SetKeyboardChar("/", widget.ShowHelp, "Show/hide this help prompt")
|
||||
widget.InitializeCommonControls()
|
||||
|
||||
widget.SetKeyboardChar("r", widget.Refresh, "Refresh widget")
|
||||
widget.SetKeyboardChar("j", widget.Next, "Select next item")
|
||||
widget.SetKeyboardChar("k", widget.Prev, "Select previous item")
|
||||
|
||||
@@ -7,7 +7,8 @@ import (
|
||||
)
|
||||
|
||||
func (widget *Widget) initializeKeyboardControls() {
|
||||
widget.SetKeyboardChar("/", widget.ShowHelp, "Show/hide this help prompt")
|
||||
widget.InitializeCommonControls()
|
||||
|
||||
widget.SetKeyboardChar("r", widget.Refresh, "Refresh widgett")
|
||||
widget.SetKeyboardChar("l", widget.next, "Select next item")
|
||||
widget.SetKeyboardChar("h", widget.previous, "Select previous item")
|
||||
|
||||
@@ -7,7 +7,8 @@ import (
|
||||
)
|
||||
|
||||
func (widget *Widget) initializeKeyboardControls() {
|
||||
widget.SetKeyboardChar("/", widget.ShowHelp, "Show/hide this help prompt")
|
||||
widget.InitializeCommonControls()
|
||||
|
||||
widget.SetKeyboardChar("/", widget.Refresh, "Refresh widget")
|
||||
widget.SetKeyboardChar("h", widget.selectPrevious, "Select previous item")
|
||||
widget.SetKeyboardChar("l", widget.selectNext, "Select next item")
|
||||
|
||||
@@ -6,7 +6,8 @@ import (
|
||||
)
|
||||
|
||||
func (widget *Widget) initializeKeyboardControls() {
|
||||
widget.SetKeyboardChar("/", widget.ShowHelp, "Show/hide this help prompt")
|
||||
widget.InitializeCommonControls()
|
||||
|
||||
widget.SetKeyboardChar("l", widget.NextSource, "Select next file")
|
||||
widget.SetKeyboardChar("h", widget.PrevSource, "Select previous file")
|
||||
widget.SetKeyboardChar("o", widget.openFile, "Open file")
|
||||
|
||||
@@ -9,7 +9,8 @@ import (
|
||||
)
|
||||
|
||||
func (widget *Widget) initializeKeyboardControls() {
|
||||
widget.SetKeyboardChar("/", widget.ShowHelp, "Show/hide this help prompt")
|
||||
widget.InitializeCommonControls()
|
||||
|
||||
widget.SetKeyboardChar("r", widget.Refresh, "Refresh widget")
|
||||
widget.SetKeyboardChar("j", widget.displayNext, "Select next item")
|
||||
widget.SetKeyboardChar("k", widget.displayPrev, "Select previous item")
|
||||
@@ -24,6 +25,7 @@ func (widget *Widget) initializeKeyboardControls() {
|
||||
widget.SetKeyboardKey(tcell.KeyCtrlJ, widget.demoteSelected, "Demote item")
|
||||
widget.SetKeyboardKey(tcell.KeyCtrlK, widget.promoteSelected, "Promote item")
|
||||
widget.SetKeyboardKey(tcell.KeyEnter, widget.editSelected, "Edit item")
|
||||
|
||||
}
|
||||
|
||||
func (widget *Widget) deleteSelected() {
|
||||
|
||||
@@ -3,7 +3,8 @@ package todoist
|
||||
import "github.com/gdamore/tcell"
|
||||
|
||||
func (widget *Widget) initializeKeyboardControls() {
|
||||
widget.SetKeyboardChar("/", widget.ShowHelp, "Show/hide this help prompt")
|
||||
widget.InitializeCommonControls()
|
||||
|
||||
widget.SetKeyboardChar("r", widget.Refresh, "Refresh widget")
|
||||
widget.SetKeyboardChar("d", widget.Delete, "Delete item")
|
||||
widget.SetKeyboardChar("j", widget.Prev, "Select previous item")
|
||||
|
||||
@@ -3,7 +3,8 @@ package transmission
|
||||
import "github.com/gdamore/tcell"
|
||||
|
||||
func (widget *Widget) initializeKeyboardControls() {
|
||||
widget.SetKeyboardChar("/", widget.ShowHelp, "Show/hide this help prompt")
|
||||
widget.InitializeCommonControls()
|
||||
|
||||
widget.SetKeyboardChar("j", widget.Prev, "Select previous item")
|
||||
widget.SetKeyboardChar("k", widget.Next, "Select next item")
|
||||
widget.SetKeyboardChar("u", widget.Unselect, "Clear selection")
|
||||
|
||||
@@ -3,7 +3,8 @@ package travisci
|
||||
import "github.com/gdamore/tcell"
|
||||
|
||||
func (widget *Widget) initializeKeyboardControls() {
|
||||
widget.SetKeyboardChar("/", widget.ShowHelp, "Show/hide this help prompt")
|
||||
widget.InitializeCommonControls()
|
||||
|
||||
widget.SetKeyboardChar("r", widget.Refresh, "Refresh widget")
|
||||
widget.SetKeyboardChar("j", widget.Next, "Select next item")
|
||||
widget.SetKeyboardChar("k", widget.Prev, "Select previous item")
|
||||
|
||||
@@ -6,7 +6,8 @@ import (
|
||||
)
|
||||
|
||||
func (widget *Widget) initializeKeyboardControls() {
|
||||
widget.SetKeyboardChar("/", widget.ShowHelp, "Show/hide this help prompt")
|
||||
widget.InitializeCommonControls()
|
||||
|
||||
widget.SetKeyboardChar("r", widget.Refresh, "Refresh widget")
|
||||
widget.SetKeyboardChar("l", widget.NextSource, "Select next source")
|
||||
widget.SetKeyboardChar("h", widget.PrevSource, "Select previous source")
|
||||
|
||||
@@ -3,7 +3,8 @@ package weather
|
||||
import "github.com/gdamore/tcell"
|
||||
|
||||
func (widget *Widget) initializeKeyboardControls() {
|
||||
widget.SetKeyboardChar("/", widget.ShowHelp, "Show/hide this help prompt")
|
||||
widget.InitializeCommonControls()
|
||||
|
||||
widget.SetKeyboardChar("r", widget.Refresh, "Refresh Widget")
|
||||
widget.SetKeyboardChar("h", widget.PrevSource, "Select previous city")
|
||||
widget.SetKeyboardChar("l", widget.NextSource, "Select next city")
|
||||
|
||||
@@ -3,8 +3,9 @@ package zendesk
|
||||
import "github.com/gdamore/tcell"
|
||||
|
||||
func (widget *Widget) initializeKeyboardControls() {
|
||||
widget.SetKeyboardChar("/", widget.ShowHelp, "Show/hide this help prompt")
|
||||
widget.SetKeyboardChar("r", widget.ShowHelp, "Refresh widget")
|
||||
widget.InitializeCommonControls()
|
||||
|
||||
widget.SetKeyboardChar("r", widget.Refresh, "Refresh widget")
|
||||
widget.SetKeyboardChar("j", widget.Next, "Select next item")
|
||||
widget.SetKeyboardChar("k", widget.Prev, "Select previous item")
|
||||
widget.SetKeyboardChar("o", widget.openTicket, "Open item")
|
||||
|
||||
Reference in New Issue
Block a user