Documentation
¶
Index ¶
- Variables
- func CancelProgress()
- func ErrorMessage(err error)
- func GetDeviceFromPath(devicePath string) (bluez.Device, error)
- func InfoMessage(text string, persist bool)
- func KeyHandler(key cmd.Key, context FunctionContext) func() bool
- func NewConfirmModal(name, title, message string) string
- func NewDisplayModal(name, title, message string)
- func ResizeModal()
- func ResumeProgress()
- func SetConnections(b *bluez.Bluez, o *bluez.Obex, n *network.Network, warn string)
- func SetInput(label string, multichar ...struct{}) string
- func SetPrimaryFocus()
- func SetTrusted(devicePath string, enable bool) error
- func StartMediaPlayer()
- func StartProgress(transferPath dbus.ObjectPath, props bluez.ObexTransferProperties, ...) bool
- func StartUI()
- func StopMediaPlayer()
- func StopUI()
- func SuspendProgress()
- type AdapterStatus
- type Application
- type FilePicker
- type FunctionContext
- type Help
- type HelpArea
- type MediaPlayer
- type Menu
- type MenuOption
- type Modal
- type Operation
- type ProgressIndicator
- type ProgressUI
- type Status
Constants ¶
This section is empty.
Variables ¶
var DeviceTable *tview.Table
var ( // HelpTopics store the various help topics. HelpTopics = map[string][]Help{ "Device Screen": { {"Menu", "Open the menu", []cmd.Key{cmd.KeyMenu}, true}, {"Switch", "Navigate between menus", []cmd.Key{cmd.KeySwitch}, true}, {"Navigation", "Navigate between devices/options", []cmd.Key{cmd.KeyNavigateUp, cmd.KeyNavigateDown}, true}, {"Power", "Toggle adapter power state", []cmd.Key{cmd.KeyAdapterTogglePower}, true}, {"Discoverable", "Toggle discoverable state", []cmd.Key{cmd.KeyAdapterToggleDiscoverable}, false}, {"Pairable", "Toggle pairable state", []cmd.Key{cmd.KeyAdapterTogglePairable}, false}, {"Scan", "Toggle scan (discovery state)", []cmd.Key{cmd.KeyAdapterToggleScan}, true}, {"Adapter", "Change adapter", []cmd.Key{cmd.KeyAdapterChange}, true}, {"Send", "Send files", []cmd.Key{cmd.KeyDeviceSendFiles}, true}, {"Network", "Connect to network", []cmd.Key{cmd.KeyDeviceNetwork}, false}, {"Progress", "Progress view", []cmd.Key{cmd.KeyProgressView}, false}, {"Player", "Show/Hide player", []cmd.Key{cmd.KeyPlayerShow, cmd.KeyPlayerHide}, false}, {"Device Info", "Show device information", []cmd.Key{cmd.KeyDeviceInfo}, false}, {"Connect", "Toggle connection with selected device", []cmd.Key{cmd.KeyDeviceConnect}, true}, {"Pair", "Toggle pair with selected device", []cmd.Key{cmd.KeyDevicePair}, true}, {"Trust", "Toggle trust with selected device", []cmd.Key{cmd.KeyDeviceTrust}, false}, {"Remove", "Remove device from adapter", []cmd.Key{cmd.KeyDeviceRemove}, false}, {"Cancel", "Cancel operation", []cmd.Key{cmd.KeyCancel}, false}, {"Help", "Show help", []cmd.Key{cmd.KeyHelp}, true}, {"Quit", "Quit", []cmd.Key{cmd.KeyQuit}, false}, }, "File Picker": { {"Navigation", "Navigate between directory entries", []cmd.Key{cmd.KeyNavigateUp, cmd.KeyNavigateDown}, true}, {"ChgDir Fwd/Back", "Enter/Go back a directory", []cmd.Key{cmd.KeyNavigateRight, cmd.KeyNavigateLeft}, true}, {"One", "Select one file", []cmd.Key{cmd.KeyFilebrowserSelect}, true}, {"Invert", "Invert file selection", []cmd.Key{cmd.KeyFilebrowserInvertSelection}, true}, {"All", "Select all files", []cmd.Key{cmd.KeyFilebrowserSelectAll}, true}, {"Refresh", "Refresh current directory", []cmd.Key{cmd.KeyFilebrowserRefresh}, false}, {"Hidden", "Toggle hidden files", []cmd.Key{cmd.KeyFilebrowserToggleHidden}, false}, {"Confirm", "Confirm file(s) selection", []cmd.Key{cmd.KeyFilebrowserConfirmSelection}, true}, {"Exit", "Exit", []cmd.Key{cmd.KeyClose}, false}, }, "Progress View": { {"Navigation", "Navigate between transfers", []cmd.Key{cmd.KeyNavigateUp, cmd.KeyNavigateDown}, true}, {"Suspend", "Suspend transfer", []cmd.Key{cmd.KeyProgressTransferSuspend}, true}, {"Resume", "Resume transfer", []cmd.Key{cmd.KeyProgressTransferResume}, true}, {"Cancel", "Cancel transfer", []cmd.Key{cmd.KeyProgressTransferCancel}, true}, {"Exit", "Exit", []cmd.Key{cmd.KeyClose}, true}, }, "Media Player": { {"Play/Pause", "Toggle play/pause", []cmd.Key{cmd.KeyNavigateUp, cmd.KeyNavigateDown}, false}, {"Next", "Next", []cmd.Key{cmd.KeyPlayerNext}, false}, {"Previous", "Previous", []cmd.Key{cmd.KeyPlayerPrevious}, false}, {"Rewind", "Rewind", []cmd.Key{cmd.KeyPlayerSeekBackward}, false}, {"Forward", "Fast forward", []cmd.Key{cmd.KeyPlayerSeekForward}, false}, {"Stop", "Stop", []cmd.Key{cmd.KeyPlayerStop}, false}, }, } )
Functions ¶
func CancelProgress ¶ added in v0.0.5
func CancelProgress()
CancelProgress cancels the transfer. This does not work when a file is being received.
func ErrorMessage ¶
func ErrorMessage(err error)
ErrorMessage sends an error message to the status bar.
func GetDeviceFromPath ¶
GetDeviceFromPath gets a device from the device path.
func InfoMessage ¶
InfoMessage sends an info message to the status bar.
func KeyHandler ¶ added in v0.1.7
func KeyHandler(key cmd.Key, context FunctionContext) func() bool
KeyHandler executes the handler assigned to the key type based on the function context.
func NewConfirmModal ¶ added in v0.1.8
NewConfirmModal displays a modal, shows a message and asks for confirmation.
func NewDisplayModal ¶ added in v0.1.8
func NewDisplayModal(name, title, message string)
NewDisplayModal displays a modal with a message.
func ResizeModal ¶ added in v0.1.7
func ResizeModal()
ResizeModal resizes the modal according to the current screen dimensions.
func ResumeProgress ¶ added in v0.0.5
func ResumeProgress()
ResumeProgress resumes the transfer. This does not work when a file is being received.
func SetConnections ¶ added in v0.1.7
SetConnections sets the connections to bluez and networkmanager.
func SetPrimaryFocus ¶ added in v0.1.7
func SetPrimaryFocus()
SetPrimaryFocus sets the focus to the appropriate primitive.
func SetTrusted ¶
SetTrusted sets the trusted state of a device.
func StartMediaPlayer ¶ added in v0.0.9
func StartMediaPlayer()
StartMediaPlayer shows the media player.
func StartProgress ¶ added in v0.0.5
func StartProgress(transferPath dbus.ObjectPath, props bluez.ObexTransferProperties, path ...string) bool
StartProgress creates a new progress indicator, monitors the OBEX DBus interface for transfer events, and displays the progress on the screen. If the optional path parameter is provided, it means that a file is being received, and on transfer completion, the received file should be moved to a user-accessible directory.
func StopMediaPlayer ¶ added in v0.0.9
func StopMediaPlayer()
StopMediaPlayer closes the media player.
func SuspendProgress ¶ added in v0.0.5
func SuspendProgress()
SuspendProgress suspends the transfer. This does not work when a file is being received.
Types ¶
type AdapterStatus ¶ added in v0.1.7
type AdapterStatus struct {
// contains filtered or unexported fields
}
AdapterStatus describes the adapter status display.
type Application ¶ added in v0.1.7
type Application struct { // Pages holds the DeviceTable, along with // any menu popups that will be added. Pages *tview.Pages // Layout holds the layout of the application. Layout *tview.Flex // Status holds the status bar. Status Status // Bluez holds the current bluez DBus connection. Bluez *bluez.Bluez // Obex holds the current bluez obex DBus connection. Obex *bluez.Obex // network holds the current network connection. Network *network.Network *tview.Application // contains filtered or unexported fields }
var UI Application
type FilePicker ¶ added in v0.1.7
type FilePicker struct {
// contains filtered or unexported fields
}
FilePicker describes a filepicker.
type FunctionContext ¶ added in v0.1.7
type FunctionContext string
FunctionContext describes the context in which the function is supoosed to be executed in.
const ( FunctionClick FunctionContext = "Click" FunctionCreate FunctionContext = "Create" FunctionVisible FunctionContext = "Visible" )
The different context types for functions.
type MediaPlayer ¶ added in v0.1.7
type MediaPlayer struct {
// contains filtered or unexported fields
}
type Menu ¶ added in v0.1.7
type Menu struct {
// contains filtered or unexported fields
}
Menu describes a region to display menu items.
type MenuOption ¶
type MenuOption struct { Key cmd.Key Display string Enabled, Disabled string Toggled bool OnCreate, OnClick, Visible bool *cmd.KeyData // contains filtered or unexported fields }
MenuOption describes an option layout for a submenu.
type Modal ¶ added in v0.1.7
type Modal struct { Name string Open bool Height, Width int Flex *tview.Flex Table *tview.Table // contains filtered or unexported fields }
Modal stores a layout to display a floating modal.
func ModalExists ¶ added in v0.1.7
ModalExists returns whether the modal with the given name is displayed.
func NewMenuModal ¶ added in v0.1.7
NewMenuModal returns a menu modal.
type Operation ¶ added in v0.1.7
type Operation struct {
// contains filtered or unexported fields
}
type ProgressIndicator ¶ added in v0.1.7
type ProgressIndicator struct {
// contains filtered or unexported fields
}
ProgressIndicator describes a progress indicator, which will display a description and a progress bar.
func NewProgress ¶ added in v0.0.5
func NewProgress(transferPath dbus.ObjectPath, props bluez.ObexTransferProperties, recv bool) *ProgressIndicator
NewProgress returns a new Progress.
func (*ProgressIndicator) FinishProgress ¶ added in v0.1.7
func (p *ProgressIndicator) FinishProgress(transferPath dbus.ObjectPath, path ...string)
FinishProgress removes the progress indicator from view. If a file was received, as indicated by the path parameter, the file is moved from the "root" (usually the ~/.cache/obexd folder) to the user's home directory.
type ProgressUI ¶ added in v0.1.7
type ProgressUI struct {
// contains filtered or unexported fields
}
ProgressUI describes a file transfer progress display.
type Status ¶
type Status struct { // MessageBox is an area to display messages. MessageBox *tview.TextView // Help is an area to display help keybindings. Help *tview.TextView // InputField is an area to interact with messages. InputField *tview.InputField *tview.Pages // contains filtered or unexported fields }