ui

package
v0.0.0-...-04c4c42 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2021 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MockHasKDialogExecutable

func MockHasKDialogExecutable(f func() bool) func()

func MockHasZenityExecutable

func MockHasZenityExecutable(f func() bool) func()

Types

type DialogOptions

type DialogOptions struct {
	Footer  string
	Timeout time.Duration
}

Options for the UI interface

type KDialog

type KDialog struct{}

KDialog provides a kdialog based UI interface

func (*KDialog) YesNo

func (*KDialog) YesNo(primary, secondary string, options *DialogOptions) bool

YesNo asks a yes/no question using kdialog

type UI

type UI interface {
	// YesNo asks a yes/no question. The primary text
	// will be printed in a larger font, the secondary text
	// in the standard font and the (optional) footer will
	// be printed in a small font.
	//
	// The value "true" is returned if the user clicks "yes",
	// otherwise "false".
	YesNo(primary, secondary string, options *DialogOptions) bool
}

UI is an interface for user interaction

func New

func New() (UI, error)

New returns the best matching UI interface for the given system or an error if no ui can be created.

type Zenity

type Zenity struct{}

Zenity provides a zenity based UI interface

func (*Zenity) YesNo

func (*Zenity) YesNo(primary, secondary string, options *DialogOptions) bool

YesNo asks a yes/no question using zenity

Jump to

Keyboard shortcuts

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