gui

package
v0.0.0-...-05f81da Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2024 License: GPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ContentViewRequired is defined to map to the Required contentview
	ContentViewRequired = true

	// ContentViewAdvanced is defined to map to the Advanced contentview
	ContentViewAdvanced = false
)
View Source
const (
	// WindowWidth specifies the default width of the window
	WindowWidth int = 950

	// WindowHeight specifies the default height of the window
	WindowHeight int = 600
)

Variables

This section is empty.

Functions

func FitToMonitorSize

func FitToMonitorSize(win *Window, w float32, h float32) error

FitToMonitorSize sets a proper size for the installer if it does not fit to the monitor size

func GetThankYouMessage

func GetThankYouMessage() string

GetThankYouMessage gets the thank you message

func GetWelcomeMessage

func GetWelcomeMessage() string

GetWelcomeMessage gets the welcome message

func GnomeGetProxyValue

func GnomeGetProxyValue(prefix string) string

GnomeGetProxyValue first check the Gnome network settings for proxy settings, then falls back to Bash environment variables

func SetupGnomeProxy

func SetupGnomeProxy()

SetupGnomeProxy configures the Gnome proxy function in the proxy package

func SyncNetworkProxies

func SyncNetworkProxies()

SyncNetworkProxies copies the current values from the Network Proxy for the non-privileged user to the root Gnome environment

Types

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

Banner is used to add a nice banner widget to the front of the installer

func NewBanner

func NewBanner() (*Banner, error)

NewBanner constructs the header component

func (*Banner) GetRootWidget

func (banner *Banner) GetRootWidget() gtk.IWidget

GetRootWidget returns the embeddable root widget

func (*Banner) Hide

func (banner *Banner) Hide()

Hide will animate the banner out of view, hiding the content

func (*Banner) Show

func (banner *Banner) Show()

Show will animate the banner into view, showing the content

func (*Banner) ShowFirst

func (banner *Banner) ShowFirst()

ShowFirst will display the banner for the first time during an intro sequence

type ContentView

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

ContentView is used to encapsulate the Required/Advanced options view by wrapping them into simple styled lists

func NewContentView

func NewContentView(controller pages.Controller) (*ContentView, error)

NewContentView will attempt creation of a new ContentView

func (*ContentView) AddPage

func (view *ContentView) AddPage(page pages.Page) error

AddPage will add the relevant page to this content view. Right now it does nothing.

func (*ContentView) GetRootWidget

func (view *ContentView) GetRootWidget() gtk.IWidget

GetRootWidget will return the root widget for embedding

func (*ContentView) IsDone

func (view *ContentView) IsDone() bool

IsDone returns true if all components have been completed

func (*ContentView) UpdateView

func (view *ContentView) UpdateView(page pages.Page)

UpdateView will update the summary for the given page

type Gui

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

Gui is the main gui data struct and holds data about the higher level data for this front end, it also implements the Frontend interface

func New

func New() *Gui

New creates a new Gui frontend instance

func (*Gui) MustRun

func (gui *Gui) MustRun(args *args.Args) bool

MustRun is part of the Frontend interface implementation and tells the core that this frontend wants/must run.

func (*Gui) Run

func (gui *Gui) Run(md *model.SystemInstall, rootDir string, options args.Args) (bool, error)

Run is part of the Frontend interface implementation and is the gui frontend main entry point

type PageConstructor

type PageConstructor func(controller pages.Controller, model *model.SystemInstall) (pages.Page, error)

PageConstructor is a typedef of the constructors for our pages

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

PageHeader provides a wrapper around a page, with a consistent header region and spacing. It embeds the root widget of each page within the view.

func PageHeaderNew

func PageHeaderNew(page pages.Page) (*PageHeader, error)

PageHeaderNew constructs a new page header for the given page

func (*PageHeader) GetRootWidget

func (header *PageHeader) GetRootWidget() gtk.IWidget

GetRootWidget returns the root embeddable widget for the PageHeader

type SummaryWidget

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

SummaryWidget is used within the ContentView to represent individual steps within the installer. It provides a description of the step, as well as a brief summary of the current selection/state (if set)

In combination with the ContentView, this widget allows selection of each 'page' within the installer in a condensed form.

func NewSummaryWidget

func NewSummaryWidget(page pages.Page) (*SummaryWidget, error)

NewSummaryWidget will construct a new SummaryWidget for the given page.

func (*SummaryWidget) GetRootWidget

func (s *SummaryWidget) GetRootWidget() *gtk.ListBoxRow

GetRootWidget returns the root embeddable widget for the SummaryWidget

func (*SummaryWidget) GetRowIndex

func (s *SummaryWidget) GetRowIndex() int

GetRowIndex returns the row index of our internal GtkListBoxRow

func (*SummaryWidget) Update

func (s *SummaryWidget) Update()

Update will alter the view to show the currently configured values

type Switcher

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

Switcher is used to switch between main installer sections

func NewSwitcher

func NewSwitcher(stack *gtk.Stack) (*Switcher, error)

NewSwitcher constructs the header component

func (*Switcher) GetRootWidget

func (switcher *Switcher) GetRootWidget() gtk.IWidget

GetRootWidget returns the embeddable root widget

func (*Switcher) Hide

func (switcher *Switcher) Hide()

Hide will tween the switcher out

func (*Switcher) SetStack

func (switcher *Switcher) SetStack(stack *gtk.Stack)

SetStack updates the associated stack

func (*Switcher) Show

func (switcher *Switcher) Show()

Show will tween in the switcher

type Window

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

Window provides management of the underlying GtkWindow and associated windows to provide a level of OOP abstraction.

func NewWindow

func NewWindow(model *model.SystemInstall, rootDir string, options args.Args) (*Window, error)

NewWindow creates a new instance of the welcome page

func (*Window) ActivatePage

func (window *Window) ActivatePage(page pages.Page)

ActivatePage customizes common widgets and displays the page

func (*Window) AddPage

func (window *Window) AddPage(page pages.Page) error

AddPage adds the page to the relevant switcher screen

func (*Window) CreateFooter

func (window *Window) CreateFooter() error

CreateFooter creates the navigation footer area

func (*Window) CreateHeaderBar

func (window *Window) CreateHeaderBar() error

CreateHeaderBar creates invisible header bar

func (*Window) GetOptions

func (window *Window) GetOptions() args.Args

GetOptions returns the options given to the window

func (*Window) GetRootDir

func (window *Window) GetRootDir() string

GetRootDir returns the root dir

func (*Window) GetScanChannel

func (window *Window) GetScanChannel() chan bool

GetScanChannel is the getter for ScanInfo Channel

func (*Window) GetScanDone

func (window *Window) GetScanDone() bool

GetScanDone is the getter for ScanInfo Done

func (*Window) GetScanMedia

func (window *Window) GetScanMedia() []*storage.BlockDevice

GetScanMedia is the getter for ScanInfo Media

func (*Window) InitScreens

func (window *Window) InitScreens() error

InitScreens initializes the switcher screens

func (*Window) Panic

func (window *Window) Panic(err error)

Panic handles the gui crashes

func (*Window) SetButtonState

func (window *Window) SetButtonState(button pages.Button, enabled bool)

SetButtonState is called by the pages to enable/disable certain buttons.

func (*Window) SetButtonVisible

func (window *Window) SetButtonVisible(button pages.Button, visible bool)

SetButtonVisible is called by the pages to view/hide certain buttons.

func (*Window) SetScanDone

func (window *Window) SetScanDone(done bool)

SetScanDone is the setter for ScanInfo Done

func (*Window) SetScanMedia

func (window *Window) SetScanMedia(scannedMedia []*storage.BlockDevice)

SetScanMedia is the setter for ScanInfo Media

func (*Window) ShowMenuView

func (window *Window) ShowMenuView()

ShowMenuView displays the menu view

func (*Window) UpdateFooter

func (window *Window) UpdateFooter() error

UpdateFooter updates the navigation footer area

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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