gioexplorer

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2024 License: BSD-3-Clause, MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrUserDecline is returned when the user doesn't select the file.
	ErrUserDecline = errors.New("user exited the file selector without selecting a file")
	// ErrNotAvailable is return when the current OS isn't supported.
	ErrNotAvailable = errors.New("current OS not supported")
)

Functions

func NewConfigFromViewEvent

func NewConfigFromViewEvent(w *app.Window, evt app.ViewEvent, title string) explorer.Config

NewConfigFromViewEvent creates a explorer.Config based on app.ViewEvent.

func UpdateConfigFromViewEvent

func UpdateConfigFromViewEvent(config *explorer.Config, w *app.Window, evt app.ViewEvent)

Types

type CancelEvent

type CancelEvent struct{}

CancelEvent is sent when the user cancels the file selector.

func (CancelEvent) ImplementsEvent

func (CancelEvent) ImplementsEvent()

type ErrorEvent

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

ErrorEvent is issued when error occurs.

func (ErrorEvent) ImplementsEvent

func (ErrorEvent) ImplementsEvent()

type OpenFileEvent

type OpenFileEvent struct {
	File io.ReadCloser
}

OpenFileEvent is sent as response to OpenFileOp.

func (OpenFileEvent) ImplementsEvent

func (OpenFileEvent) ImplementsEvent()

type OpenFileOp

type OpenFileOp struct {
	Tag      event.Tag
	Mimetype []mimetype.MimeType
}

OpenFileOp opens the file selector and returns the selected file. The Mimetype may filter the files that can be selected.

func (OpenFileOp) Add

func (o OpenFileOp) Add(ops *op.Ops)

Add adds the operation into the queue.

type SaveFileEvent

type SaveFileEvent struct {
	File io.WriteCloser
}

SaveFileEvent is sent as response to SaveFileOp.

func (SaveFileEvent) ImplementsEvent

func (SaveFileEvent) ImplementsEvent()

type SaveFileOp

type SaveFileOp struct {
	Tag      event.Tag
	Filename string
	Mimetype mimetype.MimeType
}

SaveFileOp opens the file-picker to save a file, the file is created if it doesn't exist, or replace existent file. The Filename is a suggestion for the file name, the user can change it.

func (SaveFileOp) Add

func (o SaveFileOp) Add(ops *op.Ops)

Add adds the event into the queue.

Jump to

Keyboard shortcuts

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