yaac_frontend_settings

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2024 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	SettingPages = map[string]Setting{
		"email":     {"Email", emailScreen, true},
		"wiki":      {"WIKI", wikiScreen, true},
		"impressum": {"Impressum", impressumScreen, true},
	}

	SettingPagesIndex = map[string][]string{
		"": {"email", "wiki", "impressum"},
	}
)

Defines the actual Mapping from each Setting struct to it's respective index

Functions

func CheckInputValidity

func CheckInputValidity(entries []*widget.Entry) error

CheckInputValidity checks the validity of each entry before Updating the setting, passing all the entries as []*widget.Entry

func ConfigureForm

func ConfigureForm(w fyne.Window, alive bool, mailConnection string, mailUser string, mailPassword string, serverStatus *fyne.Container) *widget.Form

ConfigureForm configures the mailForm regarding input as well as functionalities passing mailConnection, mailUser, mailPassword, serverStatus returning the fully configure form.

func ConfigureInputValidation

func ConfigureInputValidation(server *widget.Entry, username *widget.Entry, password *widget.Entry)

ConfigureInputValidation takes every widget.Entry and assigns a specific Inputvalidater reducing the max input as well as the input regarding syntax passing all entries

func ConfigureSubmitButton

func ConfigureSubmitButton(w fyne.Window, alive bool, server *widget.Entry, username *widget.Entry, password *widget.Entry, submitButton *widget.Button)

ConfigureSubmitButton configures the submitButton responsible for udpating the settings DB passing sever(Entry),username(Entry),password(Entry)as well as the sumbitButton itself. returning the fully configure form.

func InputValidater

func InputValidater(entry *widget.Entry, regex string, maxLen int, failure string)

InputValidater defines the actual Vaildatorfunctions for ConfigureInputValidation passing the entry, the regex matching schema, the maxLen as well as a message for failure.

func MapMailBooleans

func MapMailBooleans(b bool) string

func ReturnForm

func ReturnForm(w fyne.Window) *widget.Form

ReturnForm returns the fully configured Email Form responsible for managing and updating mail settings

func ReturnHeader

func ReturnHeader(pageTitle string) *fyne.Container

ReturnHeader will return the canvas.Text objet of each page

func ReturnMailSettings

func ReturnMailSettings() (string, string, string)

ReturnMailSettings makes a lookup in the setting DB to assign each key to it's respective value returning all assigned values

func UpdateSetting

func UpdateSetting(w fyne.Window, key string, value string)

UpdateSetting collects the currently selected setting values, intialize a Setting Object for each and updates the changes on the database

Types

type FrontendMain

type FrontendMain struct {
	MVVM shared.MVVM
}

func New

func New(mvvm shared.MVVM) *FrontendMain

type Setting

type Setting struct {
	Title      string
	View       func(w fyne.Window) fyne.CanvasObject
	SupportWeb bool
}

Defines the Setting struct which will hold each settingPages properties

Jump to

Keyboard shortcuts

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