globalstate

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2025 License: GPL-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package globalstate holds the types for the ui state

Index

Constants

This section is empty.

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
	FeedLoadCustomPicker bool
	FeedIDUpdate         *int
	ReturnToTab          string
}

type GlobalState

type GlobalState struct {
	Window           *app.Window
	Explorer         *explorer.Explorer
	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"`
	CfgDisableSchedules  bool     `json:"cfg_disable_schedules"`
	CfgOfflineMode       bool     `json:"cfg_offline_mode"`
	CfgCrossfeedCompute  bool     `json:"cfg_crossfeed_compute"`
	CfgUseAgencyGTFSURLs bool     `json:"cfg_agency_gtfs_urls"`
	CfgNominatimURL      string   `json:"cfg_nominatim_url"`
}

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