gui

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2023 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VroommApplicationId string = "art.calebstew.vroomm"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Application

type Application struct {
	Config     *config.Config         // Application configuration
	Builder    *gtk.Builder           // Builder that holds the primary widgets
	Window     *gtk.ApplicationWindow // Application Window
	RootBox    *gtk.Box               // The root gtk.Box holding all window widgets
	Prompt     *gtk.Label             // Prompt label
	Entry      *gtk.Entry             // Entry widget where the user interacts
	ViewTitle  *gtk.Label             // Label showing the view path
	Stack      *gtk.Stack             // View stack
	MessageBox *gtk.Box               // A box which contains error or warning messages
	Views      []View                 // Slice of views currently in the stack
	Logger     *logrus.Logger         // A logger used to dump console and GUI logs
	LogView    *LogView               // A view that displays log entries interactively
	InfoBar    *gtk.InfoBar           // The info bar displaying the most recent log message
	ViewLock   sync.Mutex             // A lock for switching views

	*gtk.Application // GTK Application
	// contains filtered or unexported fields
}

Vroomm application

func NewApplication

func NewApplication(cfg *config.Config) *Application

func (*Application) Activation

func (app *Application) Activation(activate func(app *Application) (string, error)) func()

func (*Application) ActivationWithPulse

func (app *Application) ActivationWithPulse(message string, activate func(app *Application) (string, error)) func()

func (*Application) Fire added in v0.0.3

func (app *Application) Fire(entry *logrus.Entry) error

func (*Application) Levels added in v0.0.3

func (app *Application) Levels() []logrus.Level

func (*Application) Pop

func (app *Application) Pop()

Remove the current view and transition to the previous

func (*Application) PopNoTransition

func (app *Application) PopNoTransition()

func (*Application) PulseProgress

func (app *Application) PulseProgress(ctx context.Context, text string)

func (*Application) Push

func (app *Application) Push(view View)

Push a new view onto the GtkStack

func (*Application) ReplaceTop

func (app *Application) ReplaceTop(view View)

func (*Application) StartProgress

func (app *Application) StartProgress()

func (*Application) StopProgress

func (app *Application) StopProgress()

func (*Application) Top

func (app *Application) Top() View

Return the current view

func (*Application) Virt

func (app *Application) Virt() *virt.Connection

type BrowseAllMenu

type BrowseAllMenu struct {
	*FlowboxMenu
}

type BrowseAllView

type BrowseAllView struct {
	*FlowboxMenu
}

func NewBrowseAllView

func NewBrowseAllView() *BrowseAllView

func (*BrowseAllView) Close

func (menu *BrowseAllView) Close(app *Application) error

func (*BrowseAllView) Enter

func (menu *BrowseAllView) Enter(app *Application) error

func (*BrowseAllView) Leave

func (menu *BrowseAllView) Leave(app *Application) error

type BrowseFolderView

type BrowseFolderView struct {
	Folder string
	*FlowboxMenu
}

func NewBrowseFolderView

func NewBrowseFolderView(name string, folder string) *BrowseFolderView

func (*BrowseFolderView) Close

func (menu *BrowseFolderView) Close(app *Application) error

func (*BrowseFolderView) Enter

func (menu *BrowseFolderView) Enter(app *Application) error

func (*BrowseFolderView) Leave

func (menu *BrowseFolderView) Leave(app *Application) error

type BrowseLabelView

type BrowseLabelView struct {
	Label string
	*FlowboxMenu
}

A menu showing all VMs with a specific label

func NewBrowseLabelView

func NewBrowseLabelView(label string) *BrowseLabelView

func (*BrowseLabelView) Close

func (menu *BrowseLabelView) Close(app *Application) error

func (*BrowseLabelView) Enter

func (view *BrowseLabelView) Enter(app *Application) error

func (*BrowseLabelView) Leave

func (menu *BrowseLabelView) Leave(app *Application) error

type FlowboxMenu

type FlowboxMenu struct {
	FlowBox *gtk.FlowBox
	*gtk.ScrolledWindow
	// contains filtered or unexported fields
}

Generic menu consisting of a list of filterable list items with activations

func NewFlowboxMenu

func NewFlowboxMenu(name string) *FlowboxMenu

func (*FlowboxMenu) Activate

func (menu *FlowboxMenu) Activate(app *Application)

func (*FlowboxMenu) Add

func (menu *FlowboxMenu) Add(item Item)

func (*FlowboxMenu) EmptyItems

func (menu *FlowboxMenu) EmptyItems()

func (*FlowboxMenu) Enter

func (menu *FlowboxMenu) Enter(app *Application) error

func (*FlowboxMenu) InvalidateFilter

func (menu *FlowboxMenu) InvalidateFilter()

func (*FlowboxMenu) Name

func (menu *FlowboxMenu) Name() string

func (*FlowboxMenu) Widget

func (menu *FlowboxMenu) Widget() *gtk.Widget

type Item

type Item interface {
	Match(query string) bool
	gtk.Widgetter
	// contains filtered or unexported methods
}

type LabelItem

type LabelItem struct {
	Text string
	*gtk.FlowBoxChild
}

func NewBrowseAllItem

func NewBrowseAllItem(app *Application) *LabelItem

func NewBrowseFolderItem

func NewBrowseFolderItem(app *Application, parent string, folder string) *LabelItem

func NewLabelItem

func NewLabelItem(iconName string, text string) *LabelItem

func NewLabelItemWithAction

func NewLabelItemWithAction(icon string, text string, action func()) *LabelItem

func NewLabelsViewItem

func NewLabelsViewItem(app *Application) *LabelItem

func NewVirtualMachineItem

func NewVirtualMachineItem(app *Application, domain *virt.Domain) (*LabelItem, error)

func (*LabelItem) Match added in v0.0.2

func (item *LabelItem) Match(query string) bool

type LabelsView

type LabelsView struct {
	*FlowboxMenu
}

A menu showing all existing labels

func NewLabelsView

func NewLabelsView() *LabelsView

func (*LabelsView) Close

func (view *LabelsView) Close(app *Application) error

func (*LabelsView) Enter

func (view *LabelsView) Enter(app *Application) error

func (*LabelsView) Leave

func (view *LabelsView) Leave(app *Application) error

type LogView added in v0.0.3

type LogView struct {
	TextView *gtk.TextView
	*gtk.ScrolledWindow
}

func NewLogView added in v0.0.3

func NewLogView() *LogView

func (*LogView) Activate added in v0.0.3

func (view *LogView) Activate(app *Application)

func (*LogView) Close added in v0.0.3

func (view *LogView) Close(app *Application) error

func (*LogView) Enter added in v0.0.3

func (view *LogView) Enter(app *Application) error

func (*LogView) InvalidateFilter added in v0.0.3

func (view *LogView) InvalidateFilter()

func (*LogView) Leave added in v0.0.3

func (view *LogView) Leave(app *Application) error

func (*LogView) Name added in v0.0.3

func (view *LogView) Name() string

func (*LogView) Widget added in v0.0.3

func (view *LogView) Widget() *gtk.Widget
type MainMenu struct {
	*FlowboxMenu
}

func NewMainMenu

func NewMainMenu() *MainMenu
func (menu *MainMenu) Close(app *Application) error
func (menu *MainMenu) Enter(app *Application) error
func (menu *MainMenu) Leave(app *Application) error

type Prompt

type Prompt struct {
	Title  string
	Prompt string
	Action PromptAction
	*FlowboxMenu
}

func NewPrompt

func NewPrompt(app *Application, title string, prompt string, requireExisting bool, action PromptAction, items ...*LabelItem) *Prompt

func (*Prompt) Close

func (view *Prompt) Close(app *Application) error

func (*Prompt) Enter

func (view *Prompt) Enter(app *Application) error

func (*Prompt) Leave

func (view *Prompt) Leave(app *Application) error

func (*Prompt) Name

func (view *Prompt) Name() string

type PromptAction

type PromptAction func(app *Application, input string)

type PromptNewItem added in v0.0.2

type PromptNewItem struct {
	*LabelItem
	// contains filtered or unexported fields
}

func NewPromptNewItem added in v0.0.2

func NewPromptNewItem(app *Application, single bool, action PromptAction) *PromptNewItem

func (*PromptNewItem) Match added in v0.0.2

func (item *PromptNewItem) Match(query string) bool

type SnapshotAction

type SnapshotAction func(app *Application, domain *virt.Domain, snapshot string)

type SnapshotListView

type SnapshotListView struct {
	Domain *virt.Domain
	Action SnapshotAction
	*FlowboxMenu
}

A menu with a list of snapshots displayed

func NewSnapshotListView

func NewSnapshotListView(domain *virt.Domain, actionName string, action SnapshotAction) *SnapshotListView

func (*SnapshotListView) Close

func (view *SnapshotListView) Close(app *Application) error

func (*SnapshotListView) Enter

func (view *SnapshotListView) Enter(app *Application) error

func (*SnapshotListView) Leave

func (view *SnapshotListView) Leave(app *Application) error

type View

type View interface {
	Name() string                 // Get the display name for this view
	Enter(app *Application) error // Show this view (called every time it is brought to the focus)
	Leave(app *Application) error // Called when the view is unfocused (i.e. a new view is added)
	Close(app *Application) error // Called when the view is closed permanently
	Widget() *gtk.Widget          // Get the widget
	Activate(app *Application)    // Activate the widget
	InvalidateFilter()
	gtk.Widgetter
}

An individual view within the application For example, a folder menu or a VM view

type VirtualMachineView

type VirtualMachineView struct {
	Domain       *virt.Domain        // The domain we are interacting with
	DomainName   string              // Name of the domain
	FlowBoxMenu  *FlowboxMenu        // Menu for interactions with the VM
	PropertyView *gtk.ScrolledWindow // View for VM status
	Cancel       func()              // A method for cancelling the background update task
	*gtk.Box                         // Container for above widgets
}

func NewVirtualMachineView

func NewVirtualMachineView(app *Application, domain *virt.Domain) (*VirtualMachineView, error)

func (*VirtualMachineView) Activate

func (view *VirtualMachineView) Activate(app *Application)

func (*VirtualMachineView) Close

func (view *VirtualMachineView) Close(app *Application) error

func (*VirtualMachineView) CreateItem

func (view *VirtualMachineView) CreateItem(app *Application, icon string, text string, action func()) *LabelItem

func (*VirtualMachineView) Enter

func (view *VirtualMachineView) Enter(app *Application) error

func (*VirtualMachineView) InvalidateFilter

func (view *VirtualMachineView) InvalidateFilter()

func (*VirtualMachineView) Leave

func (view *VirtualMachineView) Leave(app *Application) error

func (*VirtualMachineView) Name

func (view *VirtualMachineView) Name() string

func (*VirtualMachineView) Widget

func (view *VirtualMachineView) Widget() *gtk.Widget

Jump to

Keyboard shortcuts

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