settings

package
v0.76.0 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package settings provides an API for reading and writing the app's settings.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ColorTheme added in v0.31.0

type ColorTheme string
const (
	Auto  ColorTheme = "Auto"
	Light ColorTheme = "Light"
	Dark  ColorTheme = "Dark"
)

type Settings

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

Settings represents the settings for the app and provides an API for reading and writing settings. Values are cached in memory and persisted to storage asynchronously by a background goroutine, so getters and setters never block on I/O and are safe to call from any goroutine, including Fyne's UI thread. Call Close before closing the database to persist pending writes.

func New

func New(st *storage.Storage) (*Settings, error)

New returns a new Settings object, preloading all currently stored values.

func (*Settings) ApprovedContactCost added in v0.68.0

func (s *Settings) ApprovedContactCost() int

func (*Settings) ApprovedContactCostPresets added in v0.68.0

func (s *Settings) ApprovedContactCostPresets() (minimum int, maximum int, def int)

func (*Settings) Close added in v0.76.0

func (s *Settings) Close()

Close persists all pending writes and stops the background writer. Later Set* calls are ignored. Repeated calls return immediately.

func (*Settings) ColorTheme added in v0.31.0

func (s *Settings) ColorTheme() ColorTheme

func (*Settings) ColorThemeDefault added in v0.31.0

func (s *Settings) ColorThemeDefault() ColorTheme

func (*Settings) DeveloperMode

func (s *Settings) DeveloperMode() bool

func (*Settings) DisableDPIDetection added in v0.39.0

func (s *Settings) DisableDPIDetection() bool

func (*Settings) Flush added in v0.74.0

func (s *Settings) Flush()

Flush blocks until every write enqueued before this call has been persisted to storage. It returns immediately after Close.

func (*Settings) FyneScale added in v0.39.0

func (s *Settings) FyneScale() float64

func (*Settings) FyneScaleDefault added in v0.39.0

func (s *Settings) FyneScaleDefault() float64

func (*Settings) HideLimitedCorporations added in v0.40.0

func (s *Settings) HideLimitedCorporations() bool

func (*Settings) HideLimitedCorporationsDefault added in v0.40.0

func (s *Settings) HideLimitedCorporationsDefault() bool

func (*Settings) LastCharacterID

func (s *Settings) LastCharacterID() int64

func (*Settings) LastCorporationID added in v0.35.0

func (s *Settings) LastCorporationID() int64

func (*Settings) LogLevel

func (s *Settings) LogLevel() string

func (*Settings) LogLevelDefault

func (s *Settings) LogLevelDefault() string

func (*Settings) LogLevelNames

func (s *Settings) LogLevelNames() []string

LogLevelNames returns the names of all log levels in ascending order of severity.

func (*Settings) LogLevelSlog

func (s *Settings) LogLevelSlog() slog.Level

func (*Settings) MarketOrderRetentionDays added in v0.41.0

func (s *Settings) MarketOrderRetentionDays() int

func (*Settings) MarketOrderRetentionDaysPresets added in v0.41.0

func (s *Settings) MarketOrderRetentionDaysPresets() (minimum int, maximum int, def int)

func (*Settings) MaxMails

func (s *Settings) MaxMails() int

func (*Settings) MaxMailsPresets

func (s *Settings) MaxMailsPresets() (minimum int, maximum int, def int)

func (*Settings) MaxWalletTransactions

func (s *Settings) MaxWalletTransactions() int

func (*Settings) MaxWalletTransactionsPresets

func (s *Settings) MaxWalletTransactionsPresets() (minimum int, maximum int, def int)

func (*Settings) NotificationTypesEnabled

func (s *Settings) NotificationTypesEnabled() set.Set[string]

func (*Settings) NotifyCommunicationsEarliest

func (s *Settings) NotifyCommunicationsEarliest() time.Time

func (*Settings) NotifyCommunicationsEnabled

func (s *Settings) NotifyCommunicationsEnabled() bool

func (*Settings) NotifyCommunicationsEnabledDefault added in v0.39.0

func (s *Settings) NotifyCommunicationsEnabledDefault() bool

func (*Settings) NotifyContractsEarliest

func (s *Settings) NotifyContractsEarliest() time.Time

func (*Settings) NotifyContractsEnabled

func (s *Settings) NotifyContractsEnabled() bool

func (*Settings) NotifyContractsEnabledDefault added in v0.39.0

func (s *Settings) NotifyContractsEnabledDefault() bool

func (*Settings) NotifyMailsEarliest

func (s *Settings) NotifyMailsEarliest() time.Time

func (*Settings) NotifyMailsEnabled

func (s *Settings) NotifyMailsEnabled() bool

func (*Settings) NotifyMailsEnabledDefault added in v0.39.0

func (s *Settings) NotifyMailsEnabledDefault() bool

func (*Settings) NotifyPIEarliest

func (s *Settings) NotifyPIEarliest() time.Time

func (*Settings) NotifyPIEnabled

func (s *Settings) NotifyPIEnabled() bool

func (*Settings) NotifyPIEnabledDefault added in v0.39.0

func (s *Settings) NotifyPIEnabledDefault() bool

func (*Settings) NotifyTimeoutHours

func (s *Settings) NotifyTimeoutHours() int

func (*Settings) NotifyTimeoutHoursPresets

func (s *Settings) NotifyTimeoutHoursPresets() (minimum int, maximum int, def int)

func (*Settings) NotifyTrainingEarliest

func (s *Settings) NotifyTrainingEarliest() time.Time

func (*Settings) NotifyTrainingEnabled

func (s *Settings) NotifyTrainingEnabled() bool

func (*Settings) NotifyTrainingEnabledDefault added in v0.39.0

func (s *Settings) NotifyTrainingEnabledDefault() bool

func (*Settings) PreferMarketTab added in v0.25.0

func (s *Settings) PreferMarketTab() bool

func (*Settings) RecentSearches

func (s *Settings) RecentSearches() []int64

func (*Settings) ResetColorTheme added in v0.31.0

func (s *Settings) ResetColorTheme()

func (*Settings) ResetDisableDPIDetection added in v0.39.0

func (s *Settings) ResetDisableDPIDetection()

func (*Settings) ResetFyneScale added in v0.39.0

func (s *Settings) ResetFyneScale()

func (*Settings) ResetLastCharacterID

func (s *Settings) ResetLastCharacterID()

func (*Settings) ResetLastCorporationID added in v0.35.0

func (s *Settings) ResetLastCorporationID()

func (*Settings) ResetLogLevel

func (s *Settings) ResetLogLevel()

func (*Settings) ResetMaxWalletTransactions

func (s *Settings) ResetMaxWalletTransactions()

func (*Settings) ResetNotificationTypesEnabled

func (s *Settings) ResetNotificationTypesEnabled()

func (*Settings) ResetNotifyTimeoutHours

func (s *Settings) ResetNotifyTimeoutHours()

func (*Settings) ResetPreferMarketTab added in v0.25.0

func (s *Settings) ResetPreferMarketTab()

func (*Settings) ResetTabsMainID

func (s *Settings) ResetTabsMainID()

func (*Settings) ResetUI added in v0.39.0

func (s *Settings) ResetUI()

ResetUI resets all UI related settings to default.

func (*Settings) ResetWindowSize

func (s *Settings) ResetWindowSize()

func (*Settings) SetApprovedContactCost added in v0.68.0

func (s *Settings) SetApprovedContactCost(v int)

func (*Settings) SetColorTheme added in v0.31.0

func (s *Settings) SetColorTheme(v ColorTheme)

func (*Settings) SetDeveloperMode

func (s *Settings) SetDeveloperMode(v bool)

func (*Settings) SetDisableDPIDetection added in v0.39.0

func (s *Settings) SetDisableDPIDetection(v bool)

func (*Settings) SetFyneScale added in v0.39.0

func (s *Settings) SetFyneScale(v float64)

func (*Settings) SetHideLimitedCorporations added in v0.40.0

func (s *Settings) SetHideLimitedCorporations(v bool)

func (*Settings) SetLastCharacterID

func (s *Settings) SetLastCharacterID(id int64)

func (*Settings) SetLastCorporationID added in v0.35.0

func (s *Settings) SetLastCorporationID(id int64)

func (*Settings) SetLogLevel

func (s *Settings) SetLogLevel(l string)

func (*Settings) SetMarketOrdersRetentionDay added in v0.41.0

func (s *Settings) SetMarketOrdersRetentionDay(v int)

func (*Settings) SetMaxMails

func (s *Settings) SetMaxMails(v int)

func (*Settings) SetMaxWalletTransactions

func (s *Settings) SetMaxWalletTransactions(v int)

func (*Settings) SetNotificationTypesEnabled

func (s *Settings) SetNotificationTypesEnabled(v set.Set[string])

func (*Settings) SetNotifyCommunicationsEarliest

func (s *Settings) SetNotifyCommunicationsEarliest(t time.Time)

func (*Settings) SetNotifyCommunicationsEnabled

func (s *Settings) SetNotifyCommunicationsEnabled(v bool)

func (*Settings) SetNotifyContractsEarliest

func (s *Settings) SetNotifyContractsEarliest(t time.Time)

func (*Settings) SetNotifyContractsEnabled

func (s *Settings) SetNotifyContractsEnabled(v bool)

func (*Settings) SetNotifyMailsEarliest

func (s *Settings) SetNotifyMailsEarliest(t time.Time)

func (*Settings) SetNotifyMailsEnabled

func (s *Settings) SetNotifyMailsEnabled(v bool)

func (*Settings) SetNotifyPIEarliest

func (s *Settings) SetNotifyPIEarliest(t time.Time)

func (*Settings) SetNotifyPIEnabled

func (s *Settings) SetNotifyPIEnabled(v bool)

func (*Settings) SetNotifyTimeoutHours

func (s *Settings) SetNotifyTimeoutHours(v int)

func (*Settings) SetNotifyTrainingEarliest

func (s *Settings) SetNotifyTrainingEarliest(t time.Time)

func (*Settings) SetNotifyTrainingEnabled

func (s *Settings) SetNotifyTrainingEnabled(v bool)

func (*Settings) SetPreferMarketTab added in v0.25.0

func (s *Settings) SetPreferMarketTab(v bool)

func (*Settings) SetRecentSearches

func (s *Settings) SetRecentSearches(v []int64)

func (*Settings) SetSysTrayEnabled

func (s *Settings) SetSysTrayEnabled(v bool)

func (*Settings) SetTabsMainID

func (s *Settings) SetTabsMainID(v int)

func (*Settings) SetWindowSize

func (s *Settings) SetWindowSize(v fyne.Size)

func (*Settings) SysTrayEnabled

func (s *Settings) SysTrayEnabled() bool

func (*Settings) SysTrayEnabledDefault added in v0.39.0

func (s *Settings) SysTrayEnabledDefault() bool

func (*Settings) TabsMainID

func (s *Settings) TabsMainID() int

func (*Settings) WindowSize

func (s *Settings) WindowSize() fyne.Size

Jump to

Keyboard shortcuts

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