diff options
| author | Paul Buetow <paul@buetow.org> | 2025-07-17 15:35:03 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2025-07-17 15:35:03 +0300 |
| commit | f6477f82dc79d17e9ee3193c81dca2db884a7119 (patch) | |
| tree | 3424d2342ba976791dc3bb8b108dfdd290018175 /internal/gui/navigation.go | |
| parent | 094447b570c5c5a7c751e0e60279cfa08e945755 (diff) | |
add phoenetic alphabet
Diffstat (limited to 'internal/gui/navigation.go')
| -rw-r--r-- | internal/gui/navigation.go | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/internal/gui/navigation.go b/internal/gui/navigation.go index 59c656e..62a326e 100644 --- a/internal/gui/navigation.go +++ b/internal/gui/navigation.go @@ -187,6 +187,8 @@ func (a *Application) loadWordByIndex(index int) { if job.ImageFile != "" { a.imageDisplay.SetImages([]string{job.ImageFile}) } + // Load phonetic info from disk if it exists + a.loadPhoneticInfo(word) a.updateStatus(fmt.Sprintf("Loaded from queue: %s", word)) }) @@ -225,6 +227,24 @@ func (a *Application) loadExistingFiles(word string) { } } + // Load image prompt file + promptFile := filepath.Join(a.config.OutputDir, fmt.Sprintf("%s_prompt.txt", sanitized)) + if data, err := os.ReadFile(promptFile); err == nil { + prompt := strings.TrimSpace(string(data)) + fyne.Do(func() { + a.imagePromptEntry.SetText(prompt) + }) + } + + // Load phonetic information + phoneticFile := filepath.Join(a.config.OutputDir, fmt.Sprintf("%s_phonetic.txt", sanitized)) + if data, err := os.ReadFile(phoneticFile); err == nil { + phoneticInfo := string(data) + fyne.Do(func() { + a.phoneticDisplay.SetText(phoneticInfo) + }) + } + // Load audio file audioFile := filepath.Join(a.config.OutputDir, fmt.Sprintf("%s.%s", sanitized, a.config.AudioFormat)) if _, err := os.Stat(audioFile); err == nil { @@ -240,8 +260,6 @@ func (a *Application) loadExistingFiles(word string) { patterns := []string{ fmt.Sprintf("%s.jpg", sanitized), fmt.Sprintf("%s.png", sanitized), - fmt.Sprintf("%s_0.jpg", sanitized), - fmt.Sprintf("%s_0.png", sanitized), fmt.Sprintf("%s_1.jpg", sanitized), fmt.Sprintf("%s_1.png", sanitized), } @@ -345,6 +363,7 @@ func (a *Application) deleteCurrentWord() { fmt.Sprintf("%s_*.jpg", sanitized), fmt.Sprintf("%s_*.png", sanitized), fmt.Sprintf("%s_translation.txt", sanitized), + fmt.Sprintf("%s_prompt.txt", sanitized), fmt.Sprintf("%s_attribution.txt", sanitized), fmt.Sprintf("%s_*_attribution.txt", sanitized), } |
