@@ -1,11 +1,11 @@
|
||||
package ui
|
||||
|
||||
import (
|
||||
"epochsilicon/pkg/log"
|
||||
"net/url"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"epochsilicon/pkg/debug"
|
||||
"epochsilicon/pkg/launcher"
|
||||
"epochsilicon/pkg/patching"
|
||||
"epochsilicon/pkg/service"
|
||||
@@ -27,7 +27,7 @@ func createOptionsComponents() {
|
||||
prefs, _ := utils.LoadPrefs()
|
||||
prefs.EnableMetalHud = checked
|
||||
utils.SavePrefs(prefs)
|
||||
debug.Printf("Metal HUD enabled: %v", launcher.EnableMetalHud)
|
||||
log.Debugf("Metal HUD enabled: %v", launcher.EnableMetalHud)
|
||||
})
|
||||
metalHudCheckbox.SetChecked(prefs.EnableMetalHud)
|
||||
launcher.EnableMetalHud = prefs.EnableMetalHud
|
||||
@@ -37,17 +37,32 @@ func createOptionsComponents() {
|
||||
prefs, _ := utils.LoadPrefs()
|
||||
prefs.ShowTerminalNormally = checked
|
||||
utils.SavePrefs(prefs)
|
||||
debug.Printf("Show terminal normally: %v", checked)
|
||||
log.Debugf("Show terminal normally: %v", checked)
|
||||
})
|
||||
showTerminalCheckbox.SetChecked(prefs.ShowTerminalNormally)
|
||||
|
||||
advancedLoggingCheckbox = widget.NewCheck("Advanced Logging", func(checked bool) {
|
||||
// Save to preferences
|
||||
prefs, _ := utils.LoadPrefs()
|
||||
prefs.AdvancedLogging = checked
|
||||
utils.SavePrefs(prefs)
|
||||
log.Debugf("Advanced logging set to %v", checked)
|
||||
|
||||
if checked {
|
||||
log.SetLevelDebug()
|
||||
} else {
|
||||
log.SetLevelInfo()
|
||||
}
|
||||
})
|
||||
advancedLoggingCheckbox.SetChecked(prefs.AdvancedLogging)
|
||||
|
||||
autoDeleteWdbCheckbox = widget.NewCheck("Auto-delete WDB directory on launch", func(checked bool) {
|
||||
launcher.AutoDeleteWdb = checked
|
||||
// Save to preferences
|
||||
prefs, _ := utils.LoadPrefs()
|
||||
prefs.AutoDeleteWdb = checked
|
||||
utils.SavePrefs(prefs)
|
||||
debug.Printf("Auto-delete WDB enabled: %v", launcher.AutoDeleteWdb)
|
||||
log.Debugf("Auto-delete WDB enabled: %v", launcher.AutoDeleteWdb)
|
||||
})
|
||||
autoDeleteWdbCheckbox.SetChecked(prefs.AutoDeleteWdb)
|
||||
launcher.AutoDeleteWdb = prefs.AutoDeleteWdb
|
||||
@@ -69,7 +84,7 @@ func createOptionsComponents() {
|
||||
prefs, _ := utils.LoadPrefs()
|
||||
prefs.EnvironmentVariables = text
|
||||
utils.SavePrefs(prefs)
|
||||
debug.Printf("Environment variables updated: %v", launcher.CustomEnvVars)
|
||||
log.Debugf("Environment variables updated: %v", launcher.CustomEnvVars)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -126,7 +141,7 @@ func createBottomBar(myWindow fyne.Window) fyne.CanvasObject {
|
||||
githubURL := "https://git.burkey.co/eburk/epochsilicon"
|
||||
parsedURL, err := url.Parse(githubURL)
|
||||
if err != nil {
|
||||
debug.Printf("Error parsing git URL: %v", err)
|
||||
log.Debugf("Error parsing git URL: %v", err)
|
||||
return
|
||||
}
|
||||
fyne.CurrentApp().OpenURL(parsedURL)
|
||||
@@ -198,7 +213,7 @@ func createWineRegistryComponents() {
|
||||
}()
|
||||
|
||||
if err := utils.SetOptionAsAltEnabled(true); err != nil {
|
||||
debug.Printf("Failed to enable Option-as-Alt mapping: %v", err)
|
||||
log.Debugf("Failed to enable Option-as-Alt mapping: %v", err)
|
||||
// Update UI on main thread
|
||||
fyne.Do(func() {
|
||||
stopPulsingEffect()
|
||||
@@ -206,7 +221,7 @@ func createWineRegistryComponents() {
|
||||
})
|
||||
time.Sleep(2 * time.Second) // Show error briefly
|
||||
} else {
|
||||
debug.Printf("Successfully enabled Option-as-Alt mapping")
|
||||
log.Debugf("Successfully enabled Option-as-Alt mapping")
|
||||
// Update preferences
|
||||
prefs, _ := utils.LoadPrefs()
|
||||
prefs.RemapOptionAsAlt = true
|
||||
@@ -240,7 +255,7 @@ func createWineRegistryComponents() {
|
||||
}()
|
||||
|
||||
if err := utils.SetOptionAsAltEnabled(false); err != nil {
|
||||
debug.Printf("Failed to disable Option-as-Alt mapping: %v", err)
|
||||
log.Debugf("Failed to disable Option-as-Alt mapping: %v", err)
|
||||
// Update UI on main thread
|
||||
fyne.Do(func() {
|
||||
stopPulsingEffect()
|
||||
@@ -248,7 +263,7 @@ func createWineRegistryComponents() {
|
||||
})
|
||||
time.Sleep(2 * time.Second) // Show error briefly
|
||||
} else {
|
||||
debug.Printf("Successfully disabled Option-as-Alt mapping")
|
||||
log.Debugf("Successfully disabled Option-as-Alt mapping")
|
||||
// Update preferences
|
||||
prefs, _ := utils.LoadPrefs()
|
||||
prefs.RemapOptionAsAlt = false
|
||||
|
Reference in New Issue
Block a user