gui

package
v1.8.2 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2023 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ProgressFunc = func(s Stage) uint64 {
	return 0
}

ProgressFunc should be set to a function which reports the progress of the given stage.

Functions

func BlockingDialog

func BlockingDialog(title, message string, options []string, defaultOption int, dismissGuiPrompts bool) int

func ClearProblem

func ClearProblem()

func HandlePanic added in v1.3.2

func HandlePanic(launcherFlags *flags.LauncherFlags)

func HideWaitDialog

func HideWaitDialog()

func Main

func Main(ctx context.Context, cancelFunc func(), title string, showMainWindow bool) error

Main hands control over to ui.Main() to initialize and manage the GUI. It blocks until gui.Quit() is called.

func NotifyProblem

func NotifyProblem(problemMessage string, requiresUserAction bool)

func PanicInformatively added in v1.3.2

func PanicInformatively(r interface{}, launcherFlags *flags.LauncherFlags)

func Pause added in v1.4.0

func Pause(ctx context.Context, message string)

Pause shows given message in the download status panel along with a clickable link which reads "Continue" and blocks until the user clicks it.

func Quit

func Quit()

func SetStage

func SetStage(s Stage, progressTarget uint64)

SetStage sets up the GUI to determine the progress bar value based on the progress interval of the given stage. When progressTotal is >0, you can set gui.ProgressFunc to a function which reports the current progress.

func SetStageText

func SetStageText(s Stage, text string)

func ShowWaitDialog

func ShowWaitDialog(title, text string)

func WaitUntilReady

func WaitUntilReady()

Types

type DownloadStatusPanel

type DownloadStatusPanel struct {
	*ui.Box
	// contains filtered or unexported fields
}

type GuiDownloadProgressHandler

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

Implements fetching.DownloadProgressHandler

func NewGuiDownloadProgressHandler

func NewGuiDownloadProgressHandler(bucketCount int) *GuiDownloadProgressHandler

func (*GuiDownloadProgressHandler) GetProgress

func (handler *GuiDownloadProgressHandler) GetProgress() uint64

func (*GuiDownloadProgressHandler) HandleBadHttpResponse

func (handler *GuiDownloadProgressHandler) HandleBadHttpResponse(fromURL string, code int)

func (*GuiDownloadProgressHandler) HandleFailDownload

func (handler *GuiDownloadProgressHandler) HandleFailDownload(fromURL string, workerId int, err error)

func (*GuiDownloadProgressHandler) HandleFinishDownload

func (handler *GuiDownloadProgressHandler) HandleFinishDownload(fromURL string, workerId int)

func (*GuiDownloadProgressHandler) HandleHttpGetError

func (handler *GuiDownloadProgressHandler) HandleHttpGetError(fromURL string, err error)

func (*GuiDownloadProgressHandler) HandleProgress

func (handler *GuiDownloadProgressHandler) HandleProgress(fromURL string, workerId int, receivedBytes uint64)

func (*GuiDownloadProgressHandler) HandleReadError

func (handler *GuiDownloadProgressHandler) HandleReadError(fromURL string, err error, receivedByteCount int64)

func (*GuiDownloadProgressHandler) HandleStartDownload

func (handler *GuiDownloadProgressHandler) HandleStartDownload(fromURL string, workerId int)

func (*GuiDownloadProgressHandler) ResetProgress

func (handler *GuiDownloadProgressHandler) ResetProgress()

type Stage

type Stage int

Stage is an abstraction of the various steps which the launcher goes through when it runs.

const (
	StageAcquireLock Stage = iota
	StageGetDeploymentConfig
	StageDetermineLocalLauncherVersion
	StageRetrieveRemoteLauncherVersion
	StageSelfUpdate
	StageDetermineLocalBundleVersions
	StageRetrieveRemoteBundleVersions
	StageAwaitApplicationsTerminated
	StageDownloadBundleUpdates
	StageLaunchApplication
)

func (Stage) IsDownloadStage

func (s Stage) IsDownloadStage() bool

func (Stage) IsWaitingStage added in v1.4.0

func (s Stage) IsWaitingStage() bool

Jump to

Keyboard shortcuts

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