pages

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: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// PageIDWelcome is the language page key
	PageIDWelcome = iota

	// PageIDTimezone is the timezone page key
	PageIDTimezone = iota

	// PageIDKeyboard is the keyboard page key
	PageIDKeyboard = iota

	// PageIDBundle is the bundle page key
	PageIDBundle = iota

	// PageIDNetwork is the network check page key
	PageIDNetwork = iota

	// PageIDTelemetry is the telemetry page key
	PageIDTelemetry = iota

	// PageIDUserAdd is the user add page key
	PageIDUserAdd = iota

	// PageIDDiskConfig is the disk configuration page key
	PageIDDiskConfig = iota

	// PageIDHostname is the hostname page key
	PageIDHostname = iota

	// PageIDInstall is the special installation page key
	PageIDInstall = iota

	// PageIDConfigKernel is the advanced option page for kernel selection
	PageIDConfigKernel = iota

	// PageIDConfigSwupd is the advanced option page to configure swupd
	PageIDConfigSwupd = iota
)
View Source
const (
	// CommonSetting is a common setting used by widgets
	CommonSetting int = 150
)
View Source
const (
	// IconDirectory is where we can find bundle icons
	IconDirectory = "/usr/share/clear/bundle-icons"
)

Variables

View Source
var (
	// IconSuffixes is the supported set of suffixes for the
	// current Clear Bundles
	IconSuffixes = []string{
		".svg",
		".png",
	}
)

Functions

func GetTelemetryMessage

func GetTelemetryMessage(model *model.SystemInstall) string

GetTelemetryMessage gets the telemetry message

func LookupBundleIcon

func LookupBundleIcon(bundle *swupd.Bundle) (string, bool)

LookupBundleIcon attempts to find the icon for the given bundle. If it is found, we'll return true and the icon path, otherwise we'll return false with an empty string.

Types

type Bundle

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

Bundle is a simple page to help with Bundle settings

func (*Bundle) GetConfiguredValue

func (bundle *Bundle) GetConfiguredValue() string

GetConfiguredValue returns our current config

func (*Bundle) GetID

func (bundle *Bundle) GetID() int

GetID returns the ID for this page

func (*Bundle) GetIcon

func (bundle *Bundle) GetIcon() string

GetIcon returns the icon for this page

func (*Bundle) GetRootWidget

func (bundle *Bundle) GetRootWidget() gtk.IWidget

GetRootWidget returns the root embeddable widget for this page

func (*Bundle) GetSummary

func (bundle *Bundle) GetSummary() string

GetSummary will return the summary for this page

func (*Bundle) GetTitle

func (bundle *Bundle) GetTitle() string

GetTitle will return the title for this page

func (*Bundle) IsDone

func (bundle *Bundle) IsDone() bool

IsDone checks if all the steps are completed

func (*Bundle) IsRequired

func (bundle *Bundle) IsRequired() bool

IsRequired will return false as we have default values

func (*Bundle) ResetChanges

func (bundle *Bundle) ResetChanges()

ResetChanges will reset this page to match the model

func (*Bundle) StoreChanges

func (bundle *Bundle) StoreChanges()

StoreChanges will store this pages changes into the model

type Button

type Button uint

Button allows us to flag up different buttons

const (
	// ButtonCancel enables the cancel button
	ButtonCancel Button = 1 << iota

	// ButtonConfirm enables the confirm button
	ButtonConfirm Button = 1 << iota

	// ButtonQuit enables the quit button
	ButtonQuit Button = 1 << iota

	// ButtonBack enables the back button
	ButtonBack Button = 1 << iota

	// ButtonNext enables the next button
	ButtonNext Button = 1 << iota

	// ButtonExit enables the exit button
	ButtonExit Button = 1 << iota
)

type ConfigKernelPage

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

ConfigKernelPage is a page to change kernel installation configuration

func (*ConfigKernelPage) GetConfiguredValue

func (page *ConfigKernelPage) GetConfiguredValue() string

GetConfiguredValue returns a string representation of the current config

func (*ConfigKernelPage) GetID

func (page *ConfigKernelPage) GetID() int

GetID returns the ID for this page

func (*ConfigKernelPage) GetIcon

func (page *ConfigKernelPage) GetIcon() string

GetIcon returns the icon for this page

func (*ConfigKernelPage) GetRootWidget

func (page *ConfigKernelPage) GetRootWidget() gtk.IWidget

GetRootWidget returns the root embeddable widget for this page

func (*ConfigKernelPage) GetSummary

func (page *ConfigKernelPage) GetSummary() string

GetSummary will return the summary for this page

func (*ConfigKernelPage) GetTitle

func (page *ConfigKernelPage) GetTitle() string

GetTitle will return the title for this page

func (*ConfigKernelPage) IsDone

func (page *ConfigKernelPage) IsDone() bool

IsDone checks if all the steps are completed

func (*ConfigKernelPage) IsRequired

func (page *ConfigKernelPage) IsRequired() bool

IsRequired will return false as we have default values

func (*ConfigKernelPage) ResetChanges

func (page *ConfigKernelPage) ResetChanges()

ResetChanges will reset this page to match the model

func (*ConfigKernelPage) StoreChanges

func (page *ConfigKernelPage) StoreChanges()

StoreChanges will store this pages changes into the model

type Controller

type Controller interface {
	ActivatePage(Page)
	SetButtonState(flags Button, enabled bool)
	GetRootDir() string
	GetOptions() args.Args

	// Getters and Setters for ScanInfo
	GetScanChannel() chan bool
	GetScanDone() bool
	SetScanDone(bool)
	GetScanMedia() []*storage.BlockDevice
	SetScanMedia([]*storage.BlockDevice)
	Panic(err error)
}

Controller is implemented by the Window struct, and is used by pages and ContentView to exert some control over workflow.

type DiskConfig

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

DiskConfig is a simple page to help with DiskConfig settings

func (*DiskConfig) GetConfiguredValue

func (disk *DiskConfig) GetConfiguredValue() string

GetConfiguredValue returns our current config

func (*DiskConfig) GetID

func (disk *DiskConfig) GetID() int

GetID returns the ID for this page

func (*DiskConfig) GetIcon

func (disk *DiskConfig) GetIcon() string

GetIcon returns the icon for this page

func (*DiskConfig) GetRootWidget

func (disk *DiskConfig) GetRootWidget() gtk.IWidget

GetRootWidget returns the root embeddable widget for this page

func (*DiskConfig) GetSummary

func (disk *DiskConfig) GetSummary() string

GetSummary will return the summary for this page

func (*DiskConfig) GetTitle

func (disk *DiskConfig) GetTitle() string

GetTitle will return the title for this page

func (*DiskConfig) IsDone

func (disk *DiskConfig) IsDone() bool

IsDone checks if all the steps are completed

func (*DiskConfig) IsRequired

func (disk *DiskConfig) IsRequired() bool

IsRequired will return true as we always need a DiskConfig

func (*DiskConfig) ResetChanges

func (disk *DiskConfig) ResetChanges()

ResetChanges will reset this page to match the model

func (*DiskConfig) StoreChanges

func (disk *DiskConfig) StoreChanges()

StoreChanges will store this pages changes into the model

type HostnamePage

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

HostnamePage is a simple page to enter the hostname

func (*HostnamePage) GetConfiguredValue

func (page *HostnamePage) GetConfiguredValue() string

GetConfiguredValue returns our current config

func (*HostnamePage) GetID

func (page *HostnamePage) GetID() int

GetID returns the ID for this page

func (*HostnamePage) GetIcon

func (page *HostnamePage) GetIcon() string

GetIcon returns the icon for this page

func (*HostnamePage) GetRootWidget

func (page *HostnamePage) GetRootWidget() gtk.IWidget

GetRootWidget returns the root embeddable widget for this page

func (*HostnamePage) GetSummary

func (page *HostnamePage) GetSummary() string

GetSummary will return the summary for this page

func (*HostnamePage) GetTitle

func (page *HostnamePage) GetTitle() string

GetTitle will return the title for this page

func (*HostnamePage) IsDone

func (page *HostnamePage) IsDone() bool

IsDone checks if all the steps are completed

func (*HostnamePage) IsRequired

func (page *HostnamePage) IsRequired() bool

IsRequired will return false as we have default values

func (*HostnamePage) ResetChanges

func (page *HostnamePage) ResetChanges()

ResetChanges will reset this page to match the model

func (*HostnamePage) StoreChanges

func (page *HostnamePage) StoreChanges()

StoreChanges will store this pages changes into the model

type InstallPage

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

InstallPage is a specialised page type with no corresponding ContentView summary. It handles the actual install routine.

func (*InstallPage) Desc

func (page *InstallPage) Desc(desc string)

Desc will push a description box into the view for later marking

func (*InstallPage) Failure

func (page *InstallPage) Failure()

Failure handles failure to install

func (*InstallPage) GetConfiguredValue

func (page *InstallPage) GetConfiguredValue() string

GetConfiguredValue returns nothing here

func (*InstallPage) GetID

func (page *InstallPage) GetID() int

GetID returns the ID for this page

func (*InstallPage) GetIcon

func (page *InstallPage) GetIcon() string

GetIcon returns the icon for this page

func (*InstallPage) GetRootWidget

func (page *InstallPage) GetRootWidget() gtk.IWidget

GetRootWidget returns the root embeddable widget for this page

func (*InstallPage) GetSummary

func (page *InstallPage) GetSummary() string

GetSummary will return the summary for this page

func (*InstallPage) GetTitle

func (page *InstallPage) GetTitle() string

GetTitle will return the title for this page

func (*InstallPage) IsDone

func (page *InstallPage) IsDone() bool

IsDone is just here for the Page API

func (*InstallPage) IsRequired

func (page *InstallPage) IsRequired() bool

IsRequired is just here for the Page API

func (*InstallPage) LoopWaitDuration

func (page *InstallPage) LoopWaitDuration() time.Duration

LoopWaitDuration will return the duration for step-waits

func (*InstallPage) Partial

func (page *InstallPage) Partial(total int, step int)

Partial handles an actual progress update

func (*InstallPage) ResetChanges

func (page *InstallPage) ResetChanges()

ResetChanges begins as our initial execution point as we're only going to get called when showing our page.

func (*InstallPage) Step

func (page *InstallPage) Step()

Step will step the progressbar in indeterminate mode

func (*InstallPage) StoreChanges

func (page *InstallPage) StoreChanges()

StoreChanges will store this pages changes into the model

func (*InstallPage) Success

func (page *InstallPage) Success()

Success notes the install was successful

type InstallWidget

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

InstallWidget provides a description with tickes/crosses to let the user know which parts of the install have been completed

func NewInstallWidget

func NewInstallWidget(desc string) (*InstallWidget, error)

NewInstallWidget will return a new install widget for display

func (*InstallWidget) Completed

func (widget *InstallWidget) Completed()

Completed will mark the widget as completed (no longer active)

func (*InstallWidget) GetRootWidget

func (widget *InstallWidget) GetRootWidget() gtk.IWidget

GetRootWidget will return the root embeddable widget

func (*InstallWidget) MarkStatus

func (widget *InstallWidget) MarkStatus(success bool)

MarkStatus will mark the section

type KeyboardPage

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

KeyboardPage is a simple page to help with KeyboardPage settings

func (*KeyboardPage) GetConfiguredValue

func (page *KeyboardPage) GetConfiguredValue() string

GetConfiguredValue returns our current config

func (*KeyboardPage) GetID

func (page *KeyboardPage) GetID() int

GetID returns the ID for this page

func (*KeyboardPage) GetIcon

func (page *KeyboardPage) GetIcon() string

GetIcon returns the icon for this page

func (*KeyboardPage) GetRootWidget

func (page *KeyboardPage) GetRootWidget() gtk.IWidget

GetRootWidget returns the root embeddable widget for this page

func (*KeyboardPage) GetSummary

func (page *KeyboardPage) GetSummary() string

GetSummary will return the summary for this page

func (*KeyboardPage) GetTitle

func (page *KeyboardPage) GetTitle() string

GetTitle will return the title for this page

func (*KeyboardPage) IsDone

func (page *KeyboardPage) IsDone() bool

IsDone checks if all the steps are completed

func (*KeyboardPage) IsRequired

func (page *KeyboardPage) IsRequired() bool

IsRequired will return true as we always need a KeyboardPage

func (*KeyboardPage) ResetChanges

func (page *KeyboardPage) ResetChanges()

ResetChanges will reset this page to match the model

func (*KeyboardPage) StoreChanges

func (page *KeyboardPage) StoreChanges()

StoreChanges will store this pages changes into the model

type LanguagePage

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

LanguagePage is a simple page to help with LanguagePage settings

func (*LanguagePage) GetConfiguredValue

func (page *LanguagePage) GetConfiguredValue() string

GetConfiguredValue returns our current config

func (*LanguagePage) GetID

func (page *LanguagePage) GetID() int

GetID returns the ID for this page

func (*LanguagePage) GetIcon

func (page *LanguagePage) GetIcon() string

GetIcon returns the icon for this page

func (*LanguagePage) GetRootWidget

func (page *LanguagePage) GetRootWidget() gtk.IWidget

GetRootWidget returns the root embeddable widget for this page

func (*LanguagePage) GetSummary

func (page *LanguagePage) GetSummary() string

GetSummary will return the summary for this page

func (*LanguagePage) GetTitle

func (page *LanguagePage) GetTitle() string

GetTitle will return the title for this page

func (*LanguagePage) IsDone

func (page *LanguagePage) IsDone() bool

IsDone checks if all the steps are completed

func (*LanguagePage) IsRequired

func (page *LanguagePage) IsRequired() bool

IsRequired will return true as we always need a LanguagePage

func (*LanguagePage) ResetChanges

func (page *LanguagePage) ResetChanges()

ResetChanges will reset this page to match the model

func (*LanguagePage) StoreChanges

func (page *LanguagePage) StoreChanges()

StoreChanges will store this pages changes into the model

type NetworkCheckPage

type NetworkCheckPage struct {
}

NetworkCheckPage is an empty page that creates a menu entry that triggers a network check.

func (*NetworkCheckPage) GetConfiguredValue

func (page *NetworkCheckPage) GetConfiguredValue() string

GetConfiguredValue returns our current config

func (*NetworkCheckPage) GetID

func (page *NetworkCheckPage) GetID() int

GetID returns the ID for this page

func (*NetworkCheckPage) GetIcon

func (page *NetworkCheckPage) GetIcon() string

GetIcon returns the icon for this page

func (*NetworkCheckPage) GetRootWidget

func (page *NetworkCheckPage) GetRootWidget() gtk.IWidget

GetRootWidget returns the root embeddable widget for this page

func (*NetworkCheckPage) GetSummary

func (page *NetworkCheckPage) GetSummary() string

GetSummary will return the summary for this page

func (*NetworkCheckPage) GetTitle

func (page *NetworkCheckPage) GetTitle() string

GetTitle will return the title for this page

func (*NetworkCheckPage) IsDone

func (page *NetworkCheckPage) IsDone() bool

IsDone checks if all the steps are completed

func (*NetworkCheckPage) IsRequired

func (page *NetworkCheckPage) IsRequired() bool

IsRequired will return false as we have default values

func (*NetworkCheckPage) ResetChanges

func (page *NetworkCheckPage) ResetChanges()

ResetChanges will reset this page to match the model

func (*NetworkCheckPage) StoreChanges

func (page *NetworkCheckPage) StoreChanges()

StoreChanges will store this pages changes into the model

type Page

type Page interface {
	IsRequired() bool
	IsDone() bool
	GetID() int
	GetSummary() string
	GetTitle() string
	GetIcon() string
	GetConfiguredValue() string
	GetRootWidget() gtk.IWidget
	StoreChanges() // Store changes in the model
	ResetChanges() // Reset data to model
}

Page interface provides a common definition that other pages can share to give a standard interface for the main controller, the Window

func NewBundlePage

func NewBundlePage(windowController Controller, model *model.SystemInstall) (Page, error)

NewBundlePage returns a new BundlePage

func NewConfigKernelPage

func NewConfigKernelPage(controller Controller, model *model.SystemInstall) (Page, error)

NewConfigKernelPage returns a new NewConfigKernelPage

func NewDiskConfigPage

func NewDiskConfigPage(controller Controller, model *model.SystemInstall) (Page, error)

NewDiskConfigPage returns a new DiskConfigPage nolint: gocyclo // TODO: Refactor this

func NewHostnamePage

func NewHostnamePage(controller Controller, model *model.SystemInstall) (Page, error)

NewHostnamePage returns a new NewHostnamePage

func NewInstallPage

func NewInstallPage(controller Controller, model *model.SystemInstall) (Page, error)

NewInstallPage constructs a new InstallPage.

func NewKeyboardPage

func NewKeyboardPage(controller Controller, model *model.SystemInstall) (Page, error)

NewKeyboardPage returns a new KeyboardPage

func NewLanguagePage

func NewLanguagePage(controller Controller, model *model.SystemInstall) (Page, error)

NewLanguagePage returns a new LanguagePage

func NewNetworkPage

func NewNetworkPage(ctlr Controller, model *model.SystemInstall) (Page, error)

NewNetworkPage only exists to add a menu entry that creates a network test pop-up.

func NewSwupdConfigPage

func NewSwupdConfigPage(controller Controller, model *model.SystemInstall) (Page, error)

NewSwupdConfigPage returns a new NewSwupdConfigPage

func NewTelemetryPage

func NewTelemetryPage(controller Controller, model *model.SystemInstall) (Page, error)

NewTelemetryPage returns a new TelemetryPage

func NewTimezonePage

func NewTimezonePage(controller Controller, model *model.SystemInstall) (Page, error)

NewTimezonePage returns a new TimezonePage

func NewUserAddPage

func NewUserAddPage(controller Controller, model *model.SystemInstall) (Page, error)

NewUserAddPage returns a new User Add page

type ScanInfo

type ScanInfo struct {
	Channel chan bool              // Bool channel for scanning media
	Done    bool                   // Used to check if scanning has been done at least once
	Media   []*storage.BlockDevice // Scanned media
}

ScanInfo holds the information related to scanning the media

type SwupdConfigPage

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

SwupdConfigPage is a page to change swupd configuration

func (*SwupdConfigPage) GetConfiguredValue

func (page *SwupdConfigPage) GetConfiguredValue() string

GetConfiguredValue returns a string representation of the current config

func (*SwupdConfigPage) GetID

func (page *SwupdConfigPage) GetID() int

GetID returns the ID for this page

func (*SwupdConfigPage) GetIcon

func (page *SwupdConfigPage) GetIcon() string

GetIcon returns the icon for this page

func (*SwupdConfigPage) GetRootWidget

func (page *SwupdConfigPage) GetRootWidget() gtk.IWidget

GetRootWidget returns the root embeddable widget for this page

func (*SwupdConfigPage) GetSummary

func (page *SwupdConfigPage) GetSummary() string

GetSummary will return the summary for this page

func (*SwupdConfigPage) GetTitle

func (page *SwupdConfigPage) GetTitle() string

GetTitle will return the title for this page

func (*SwupdConfigPage) IsDone

func (page *SwupdConfigPage) IsDone() bool

IsDone checks if all the steps are completed

func (*SwupdConfigPage) IsRequired

func (page *SwupdConfigPage) IsRequired() bool

IsRequired will return false as we have default values

func (*SwupdConfigPage) ResetChanges

func (page *SwupdConfigPage) ResetChanges()

ResetChanges will reset this page to match the model

func (*SwupdConfigPage) StoreChanges

func (page *SwupdConfigPage) StoreChanges()

StoreChanges will store this pages changes into the model

type Telemetry

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

Telemetry is a simple page to help with Telemetry settings

func (*Telemetry) GetConfiguredValue

func (page *Telemetry) GetConfiguredValue() string

GetConfiguredValue returns our current config

func (*Telemetry) GetID

func (page *Telemetry) GetID() int

GetID returns the ID for this page

func (*Telemetry) GetIcon

func (page *Telemetry) GetIcon() string

GetIcon returns the icon for this page

func (*Telemetry) GetRootWidget

func (page *Telemetry) GetRootWidget() gtk.IWidget

GetRootWidget returns the root embeddable widget for this page

func (*Telemetry) GetSummary

func (page *Telemetry) GetSummary() string

GetSummary will return the summary for this page

func (*Telemetry) GetTitle

func (page *Telemetry) GetTitle() string

GetTitle will return the title for this page

func (*Telemetry) IsDone

func (page *Telemetry) IsDone() bool

IsDone checks if all the steps are completed

func (*Telemetry) IsRequired

func (page *Telemetry) IsRequired() bool

IsRequired will return true as we always need a Telemetry

func (*Telemetry) ResetChanges

func (page *Telemetry) ResetChanges()

ResetChanges will reset this page to match the model

func (*Telemetry) StoreChanges

func (page *Telemetry) StoreChanges()

StoreChanges will store this pages changes into the model

type TimezonePage

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

TimezonePage is a simple page to help with TimezonePage settings

func (*TimezonePage) GetConfiguredValue

func (page *TimezonePage) GetConfiguredValue() string

GetConfiguredValue returns our current config

func (*TimezonePage) GetID

func (page *TimezonePage) GetID() int

GetID returns the ID for this page

func (*TimezonePage) GetIcon

func (page *TimezonePage) GetIcon() string

GetIcon returns the icon for this page

func (*TimezonePage) GetRootWidget

func (page *TimezonePage) GetRootWidget() gtk.IWidget

GetRootWidget returns the root embeddable widget for this page

func (*TimezonePage) GetSummary

func (page *TimezonePage) GetSummary() string

GetSummary will return the summary for this page

func (*TimezonePage) GetTitle

func (page *TimezonePage) GetTitle() string

GetTitle will return the title for this page

func (*TimezonePage) IsDone

func (page *TimezonePage) IsDone() bool

IsDone checks if all the steps are completed

func (*TimezonePage) IsRequired

func (page *TimezonePage) IsRequired() bool

IsRequired will return true as we always need a TimezonePage

func (*TimezonePage) ResetChanges

func (page *TimezonePage) ResetChanges()

ResetChanges will reset this page to match the model

func (*TimezonePage) StoreChanges

func (page *TimezonePage) StoreChanges()

StoreChanges will store this pages changes into the model

type UserAddPage

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

UserAddPage is a simple page to add/modify the user

func (*UserAddPage) GetConfiguredValue

func (page *UserAddPage) GetConfiguredValue() string

GetConfiguredValue returns our current config

func (*UserAddPage) GetID

func (page *UserAddPage) GetID() int

GetID returns the ID for this page

func (*UserAddPage) GetIcon

func (page *UserAddPage) GetIcon() string

GetIcon returns the icon for this page

func (*UserAddPage) GetRootWidget

func (page *UserAddPage) GetRootWidget() gtk.IWidget

GetRootWidget returns the root embeddable widget for this page

func (*UserAddPage) GetSummary

func (page *UserAddPage) GetSummary() string

GetSummary will return the summary for this page

func (*UserAddPage) GetTitle

func (page *UserAddPage) GetTitle() string

GetTitle will return the title for this page

func (*UserAddPage) IsDone

func (page *UserAddPage) IsDone() bool

IsDone checks if all the steps are completed

func (*UserAddPage) IsRequired

func (page *UserAddPage) IsRequired() bool

IsRequired will return false as we have default values

func (*UserAddPage) ResetChanges

func (page *UserAddPage) ResetChanges()

ResetChanges will reset this page to match the model

func (*UserAddPage) StoreChanges

func (page *UserAddPage) StoreChanges()

StoreChanges will store this pages changes into the model

Jump to

Keyboard shortcuts

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