1
0
mirror of https://github.com/taigrr/crocgui synced 2025-01-18 04:03:16 -08:00

additional settings

This commit is contained in:
Chris Howey 2021-02-20 14:16:39 -06:00
parent ae5dbd3d18
commit ebfac6f2e2
4 changed files with 43 additions and 20 deletions

View File

@ -20,6 +20,10 @@ func main() {
a.Preferences().StringWithFallback("relay-address", "croc.schollz.com:9009") a.Preferences().StringWithFallback("relay-address", "croc.schollz.com:9009")
a.Preferences().StringWithFallback("relay-password", "pass123") a.Preferences().StringWithFallback("relay-password", "pass123")
a.Preferences().StringWithFallback("relay-ports", "9009,9010,9011,9012,9013") 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)
textlogores := fyne.NewStaticResource("text-logo", textlogobytes) textlogores := fyne.NewStaticResource("text-logo", textlogobytes)
textlogo := canvas.NewImageFromResource(textlogores) textlogo := canvas.NewImageFromResource(textlogores)

View File

@ -41,7 +41,10 @@ func recvTabItem(a fyne.App) *container.TabItem {
RelayPassword: a.Preferences().String("relay-password"), RelayPassword: a.Preferences().String("relay-password"),
Stdout: false, Stdout: false,
NoPrompt: true, NoPrompt: true,
DisableLocal: true, DisableLocal: a.Preferences().Bool("disable-local"),
NoMultiplexing: a.Preferences().Bool("disable-multiplexing"),
OnlyLocal: a.Preferences().Bool("force-local"),
NoCompress: a.Preferences().Bool("disable-compression"),
}) })
if err != nil { if err != nil {
log.Println("Receive setup error:", err) log.Println("Receive setup error:", err)

View File

@ -52,7 +52,10 @@ func sendTabItem(a fyne.App, w fyne.Window) *container.TabItem {
RelayPassword: a.Preferences().String("relay-password"), RelayPassword: a.Preferences().String("relay-password"),
Stdout: false, Stdout: false,
NoPrompt: true, NoPrompt: true,
DisableLocal: true, DisableLocal: a.Preferences().Bool("disable-local"),
NoMultiplexing: a.Preferences().Bool("disable-multiplexing"),
OnlyLocal: a.Preferences().Bool("force-local"),
NoCompress: a.Preferences().Bool("disable-compression"),
}) })
var filename string var filename string
if err != nil { if err != nil {

View File

@ -10,10 +10,23 @@ import (
func settingsTabItem(a fyne.App) *container.TabItem { func settingsTabItem(a fyne.App) *container.TabItem {
return container.NewTabItemWithIcon("Settings", theme.SettingsIcon(), container.NewVBox( return container.NewTabItemWithIcon("Settings", theme.SettingsIcon(), container.NewVBox(
widget.NewLabelWithStyle("Relay", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}),
widget.NewForm( widget.NewForm(
widget.NewFormItem("Relay Address", widget.NewEntryWithData(binding.BindPreferenceString("relay-address", a.Preferences()))), widget.NewFormItem("Address", widget.NewEntryWithData(binding.BindPreferenceString("relay-address", a.Preferences()))),
widget.NewFormItem("Relay Password", widget.NewEntryWithData(binding.BindPreferenceString("relay-password", a.Preferences()))), widget.NewFormItem("Ports", widget.NewEntryWithData(binding.BindPreferenceString("relay-ports", a.Preferences()))),
widget.NewFormItem("Relay Ports", widget.NewEntryWithData(binding.BindPreferenceString("relay-ports", a.Preferences()))), widget.NewFormItem("Password", widget.NewEntryWithData(binding.BindPreferenceString("relay-password", a.Preferences()))),
),
widget.NewSeparator(),
widget.NewLabelWithStyle("Network Local", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}),
widget.NewForm(
widget.NewFormItem("", widget.NewCheckWithData("Disable Local", binding.BindPreferenceBool("disable-local", a.Preferences()))),
widget.NewFormItem("", widget.NewCheckWithData("Force Local Only", binding.BindPreferenceBool("force-local", a.Preferences()))),
),
widget.NewSeparator(),
widget.NewLabelWithStyle("Transfer Options", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}),
widget.NewForm(
widget.NewFormItem("", widget.NewCheckWithData("Disable Multiplexing", binding.BindPreferenceBool("disable-multiplexing", a.Preferences()))),
widget.NewFormItem("", widget.NewCheckWithData("Disable Compression", binding.BindPreferenceBool("disable-compression", a.Preferences()))),
), ),
)) ))
} }