From ebe2f1d6d3ba0f31bdae96b6f2ece0c0608512c0 Mon Sep 17 00:00:00 2001 From: Chris Howey Date: Wed, 24 Mar 2021 14:11:08 -0500 Subject: [PATCH] save default settings --- main.go | 15 ++++++++------- metadata/en-US/changelogs/9.txt | 1 + 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/main.go b/main.go index 49e78eb..46ed0c0 100644 --- a/main.go +++ b/main.go @@ -17,13 +17,14 @@ func main() { a := app.NewWithID("com.github.howeyc.crocgui") w := a.NewWindow("croc") - a.Preferences().StringWithFallback("relay-address", "croc.schollz.com:9009") - a.Preferences().StringWithFallback("relay-password", "pass123") - a.Preferences().StringWithFallback("relay-ports", "9009,9010,9011,9012,9013") - a.Preferences().BoolWithFallback("disable-local", true) - a.Preferences().BoolWithFallback("force-local", false) - a.Preferences().BoolWithFallback("disable-multiplexing", false) - a.Preferences().BoolWithFallback("disable-compression", false) + // Defaults + a.Preferences().SetString("relay-address", a.Preferences().StringWithFallback("relay-address", "croc.schollz.com:9009")) + a.Preferences().SetString("relay-password", a.Preferences().StringWithFallback("relay-password", "pass123")) + a.Preferences().SetString("relay-ports", a.Preferences().StringWithFallback("relay-ports", "9009,9010,9011,9012,9013")) + a.Preferences().SetBool("disable-local", a.Preferences().BoolWithFallback("disable-local", true)) + a.Preferences().SetBool("force-local", a.Preferences().BoolWithFallback("force-local", false)) + a.Preferences().SetBool("disable-multiplexing", a.Preferences().BoolWithFallback("disable-multiplexing", false)) + a.Preferences().SetBool("disable-compression", a.Preferences().BoolWithFallback("disable-compression", false)) textlogores := fyne.NewStaticResource("text-logo", textlogobytes) textlogo := canvas.NewImageFromResource(textlogores) diff --git a/metadata/en-US/changelogs/9.txt b/metadata/en-US/changelogs/9.txt index c9fbcbb..af00c42 100644 --- a/metadata/en-US/changelogs/9.txt +++ b/metadata/en-US/changelogs/9.txt @@ -1,2 +1,3 @@ - Add license info - Update to show filename for content:// URI on android +- Save defaults on start so settings tab also shows defaults