Documentation ¶
Overview ¶
Package ui wraps some OS-specific methods so they can be used on any architecture/OS without compile-time errors. The packages wrapped are github.com/gen2brain/dlgs and github.com/getlantern/systray. The notifiarr client application only uses these on Windows and macOS, so they are wrapped to ignore them on macOS, linux and freeBSD.
Index ¶
- Constants
- Variables
- func Entry(title, msg, val string) (string, bool, error)
- func Error(title, msg string) (bool, error)
- func HasGUI() bool
- func HideConsoleWindow()
- func Info(title, msg string) (bool, error)
- func Notify(_ string, _ ...interface{}) error
- func OpenCmd(cmd ...string) error
- func OpenFile(filePath string) error
- func OpenLog(logFile string) error
- func OpenURL(url string) error
- func Question(title, text string, defaultCancel bool) (bool, error)
- func ShowConsoleWindow()
- func StartCmd(c string, v ...string) error
- func Warning(title, msg string) (bool, error)
- type MenuItem
Constants ¶
View Source
const SystrayIcon = "files/favicon.png"
SystrayIcon is the icon in the system tray or task bar.
Variables ¶
View Source
var ErrUnsupported = fmt.Errorf("unsupported OS")
ErrUnsupported is just an error.
Functions ¶
func HasGUI ¶
func HasGUI() bool
HasGUI returns false on Linux, true on Windows and optional on macOS.
func ShowConsoleWindow ¶ added in v0.1.15
func ShowConsoleWindow()
ShowConsoleWindow does nothing on OSes besides Windows.
Types ¶
type MenuItem ¶
type MenuItem interface { Check() Checked() bool Disable() Disabled() bool Enable() Hide() SetIcon(iconBytes []byte) SetTemplateIcon(templateIconBytes []byte, regularIconBytes []byte) SetTitle(title string) SetTooltip(tooltip string) Show() String() string Uncheck() Clicked() chan struct{} }
MenuItem is an interface to allow exposing menu items to operating systems that do not have a menu or a GUI.
Click to show internal directories.
Click to hide internal directories.