globalstate

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2024 License: GPL-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package globalstate holds the types for the ui state

Index

Constants

View Source
const (
	AppStageMessageUI = iota
	AppStageTabbedUI
)

Variables

This section is empty.

Functions

func FileSave

func FileSave(s *GlobalStateSave) error

func IntervalSaveWatch

func IntervalSaveWatch(s *GlobalStateSave) error

IntervalSaveWatch is expected to be called from the main rendering loop of the application and just deltas lastSaveTime, if the delta exceeds the saveIntervalSeconds threshold, FileSave() is rerun

Types

type AppQueueload

type AppQueueload struct {
	RuntimeInitialize    bool
	FeedIDLoadAndCompute *int
	FeedIDUpdate         *int
	ReturnToTab          string
}

type AppStage

type AppStage int

type GlobalState

type GlobalState struct {
	Window           *app.Window
	Theme            *material.Theme
	MarkdownRenderer *markdown.Renderer
	MobrouteRuntime  *mobroute.MobrouteRuntime
	MobrouteLog      *bytes.Buffer

	PendingLoadInfo PendingLoadInfo
	AppQueueload    *AppQueueload

	// Unsaved global state
	TabSelected        string
	LocationFromCoords []float64
	LocationFromLabel  string
	LocationToLabel    string
	LocationToCoords   []float64

	// Saved global state (will be written to file & restored on quit/boot)
	Save GlobalStateSave
}

type GlobalStateSave

type GlobalStateSave struct {
	FeedIDsEnabled      []int    `json:"feed_ids_enabled"`
	Favorites           []string `json:"favorites"`
	CfgOmitSchedule     bool     `json:"cfg_omit_schedule"`
	CfgOfflineMode      bool     `json:"cfg_offline_mode"`
	CfgCrossfeedCompute bool     `json:"cfg_crossfeed_compute"`
}

func FileLoad

func FileLoad() (*GlobalStateSave, error)

func FileLoadWarnError

func FileLoadWarnError() GlobalStateSave

type PendingLoadInfo added in v0.8.0

type PendingLoadInfo struct {
	TimerStart *time.Time
	Message    string
	SubMessage string
	IsError    bool
}

Jump to

Keyboard shortcuts

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