gui

package
v1.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 4, 2020 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrGetCwd   = errors.New("can't get current dir")
	ErrEdit     = errors.New("can't edit")
	ErrReadFile = errors.New("can't read file")
	ErrReadDir  = errors.New("can't read dir")
	ErrTokenise = errors.New("can't tokenise")
	ErrGetTime  = errors.New("can't get timespec")
)
View Source
var (
	ErrNoDirName       = errors.New("no directory name")
	ErrNoFileName      = errors.New("no file name")
	ErrNoFileOrDirName = errors.New("no file or directory name")
	ErrNoFileOrDir     = errors.New("no file or directory")
	ErrNoNewName       = errors.New("no new name")
)

Functions

This section is empty.

Types

type CmdLine

type CmdLine struct {
	*tview.InputField
}

func NewCmdLine

func NewCmdLine() *CmdLine

type Entry

type Entry struct {
	Name       string // file name
	Path       string // file path
	PathName   string // file's path and name
	Access     string
	Create     string
	Change     string
	Size       int64
	Permission string
	Owner      string
	Group      string
	Viewable   bool
	IsDir      bool
}

Entry file or dir info

type EntryManager

type EntryManager struct {
	*tview.Table
	// contains filtered or unexported fields
}

EntryManager file list

func NewEntryManager

func NewEntryManager(enableIgnorecase bool) *EntryManager

NewEntryManager new entry list

func (*EntryManager) Entries

func (e *EntryManager) Entries() []*Entry

Entries get entries

func (*EntryManager) GetSelectEntry

func (e *EntryManager) GetSelectEntry() *Entry

GetSelectEntry get selected entry

func (*EntryManager) RefreshView

func (e *EntryManager) RefreshView()

func (*EntryManager) RestorePos

func (e *EntryManager) RestorePos(path string)

RestorePos restore select position

func (*EntryManager) SetColumns

func (e *EntryManager) SetColumns()

SetColumns set entries

func (*EntryManager) SetEntries

func (e *EntryManager) SetEntries(path string) []*Entry

SetEntries set entries

func (*EntryManager) SetHeader

func (e *EntryManager) SetHeader()

SetHeader set table header

func (*EntryManager) SetSearchWord

func (e *EntryManager) SetSearchWord(word string)

func (*EntryManager) SetSelectPos

func (e *EntryManager) SetSelectPos(path string)

SetSelectPos save select position

func (*EntryManager) SetViewable

func (e *EntryManager) SetViewable(viewable bool)

func (*EntryManager) UpdateColor

func (e *EntryManager) UpdateColor()

type Gui

type Gui struct {
	InputPath      *tview.InputField
	Register       *Register
	HistoryManager *HistoryManager
	EntryManager   *EntryManager
	Preview        *Preview
	CmdLine        *CmdLine
	App            *tview.Application
	Pages          *tview.Pages
	// contains filtered or unexported fields
}

Gui gui have some manager

func New

func New(enablePreview bool, enableIgnorecase bool) *Gui

New create new gui

func (*Gui) CmdLineKeybinding

func (gui *Gui) CmdLineKeybinding()

func (*Gui) Confirm

func (gui *Gui) Confirm(message, doneLabel string, page tview.Primitive, doneFunc func() error)

func (*Gui) EntryManagerKeybinding

func (gui *Gui) EntryManagerKeybinding()

func (*Gui) ExecCmd

func (gui *Gui) ExecCmd(attachStd bool, cmd string, args ...string) error

ExecCmd execute command

func (*Gui) FocusPanel

func (gui *Gui) FocusPanel(p tview.Primitive)

func (*Gui) Form

func (gui *Gui) Form(fieldLabel map[string]string, doneLabel, title, pageName string, panel tview.Primitive,
	height int, doneFunc func(values map[string]string) error)

func (*Gui) GlobalKeybinding

func (gui *Gui) GlobalKeybinding(event *tcell.EventKey)

globalKeybinding

func (*Gui) InputPathKeybinding

func (gui *Gui) InputPathKeybinding()

func (*Gui) Message

func (gui *Gui) Message(message string, page tview.Primitive)

func (*Gui) Modal

func (gui *Gui) Modal(p tview.Primitive, width, height int) tview.Primitive

func (*Gui) Run

func (gui *Gui) Run() error

Run run ff

func (*Gui) Search

func (gui *Gui) Search()

func (*Gui) SetKeybindings

func (gui *Gui) SetKeybindings()

func (*Gui) Stop

func (gui *Gui) Stop()

Stop stop ff

type History

type History struct {
	RowIdx int
	Path   string
}

History history info

type HistoryManager

type HistoryManager struct {
	// contains filtered or unexported fields
}

HistoryManager have the move history TODO limit max history

func NewHistoryManager

func NewHistoryManager() *HistoryManager

NewHistoryManager new history manager

func (*HistoryManager) Next

func (h *HistoryManager) Next() *History

Next return the next history

func (*HistoryManager) Previous

func (h *HistoryManager) Previous() *History

Previous return the previous history

func (*HistoryManager) Save

func (h *HistoryManager) Save(rowIdx int, path string)

Save save the move history

type Preview

type Preview struct {
	*tview.TextView
	// contains filtered or unexported fields
}

func NewPreview

func NewPreview() *Preview

func (*Preview) Highlight

func (p *Preview) Highlight(entry *Entry) string

func (*Preview) ScrollDown

func (p *Preview) ScrollDown()

func (*Preview) ScrollUp

func (p *Preview) ScrollUp()

func (*Preview) UpdateView

func (p *Preview) UpdateView(g *Gui, entry *Entry)

type Register

type Register struct {
	MoveSources []*Entry
	CopySources []*Entry
	CopySource  *Entry
}

Register copy/paste file resource

func (*Register) ClearCopyResources

func (r *Register) ClearCopyResources()

ClearCopyResources clear resouces

func (*Register) ClearMoveResources

func (r *Register) ClearMoveResources()

ClearMoveResources clear resources

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL