diff options
| author | Paul Buetow <paul@buetow.org> | 2025-07-16 21:27:08 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2025-07-16 21:27:08 +0300 |
| commit | 6b0b4c9ce28b88ab0abbff03c5f367d89ba97c89 (patch) | |
| tree | fc102068a7e41c8042bdf2d17674405e715da8be /internal/gui | |
| parent | d46669426aa6b0ece71d0d05d0b6f2966686b17a (diff) | |
fix: update button labels to show lowercase hotkeys and improve export location
- Change all button labels to show lowercase letters (g, n, i, a, r, d, p)
- Update delete confirmation dialog to show lowercase y/n
- Set default export location to anki_cards directory
- Add note about CSV needing to be in same directory as media files
- Fix prompt generation to remove Bulgarian word reference
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Diffstat (limited to 'internal/gui')
| -rw-r--r-- | internal/gui/app.go | 23 | ||||
| -rw-r--r-- | internal/gui/audio_player.go | 8 | ||||
| -rw-r--r-- | internal/gui/navigation.go | 2 |
3 files changed, 21 insertions, 12 deletions
diff --git a/internal/gui/app.go b/internal/gui/app.go index 3783eb9..836ebca 100644 --- a/internal/gui/app.go +++ b/internal/gui/app.go @@ -157,7 +157,7 @@ func (a *Application) setupUI() { a.wordInput.SetPlaceHolder("Enter Bulgarian word...") a.wordInput.OnSubmitted = func(string) { a.onSubmit() } - a.submitButton = widget.NewButton("Generate (G)", a.onSubmit) + a.submitButton = widget.NewButton("Generate (g)", a.onSubmit) a.prevWordBtn = widget.NewButton("◀ Prev (←)", a.onPrevWord) a.nextWordBtn = widget.NewButton("Next (→) ▶", a.onNextWord) @@ -203,11 +203,11 @@ func (a *Application) setupUI() { ) // Create action buttons - a.keepButton = widget.NewButton("New Word (N)", a.onKeepAndContinue) - a.regenerateImageBtn = widget.NewButton("Regenerate Image (I)", a.onRegenerateImage) - a.regenerateAudioBtn = widget.NewButton("Regenerate Audio (A)", a.onRegenerateAudio) - a.regenerateAllBtn = widget.NewButton("Regenerate All (R)", a.onRegenerateAll) - a.deleteButton = widget.NewButton("Delete (D)", a.onDelete) + a.keepButton = widget.NewButton("New Word (n)", a.onKeepAndContinue) + a.regenerateImageBtn = widget.NewButton("Regenerate Image (i)", a.onRegenerateImage) + a.regenerateAudioBtn = widget.NewButton("Regenerate Audio (a)", a.onRegenerateAudio) + a.regenerateAllBtn = widget.NewButton("Regenerate All (r)", a.onRegenerateAll) + a.deleteButton = widget.NewButton("Delete (d)", a.onDelete) a.deleteButton.Importance = widget.DangerImportance // Initially disable action buttons @@ -561,12 +561,21 @@ func (a *Application) onExportToAnki() { } dialog.ShowInformation("Export Complete", - fmt.Sprintf("Exported %d cards to:\n%s", len(a.savedCards), outputPath), + fmt.Sprintf("Exported %d cards to:\n%s\n\nNote: The CSV file should be in the same directory as your media files (%s) for Anki import to work correctly.", + len(a.savedCards), outputPath, a.config.OutputDir), a.window) }, a.window) saveDialog.SetFileName("anki_import.csv") saveDialog.SetFilter(storage.NewExtensionFileFilter([]string{".csv"})) + + // Try to set the default location to the anki_cards directory + if uri, err := storage.ParseURI("file://" + a.config.OutputDir); err == nil { + if listableURI, ok := uri.(fyne.ListableURI); ok { + saveDialog.SetLocation(listableURI) + } + } + saveDialog.Show() } diff --git a/internal/gui/audio_player.go b/internal/gui/audio_player.go index 2d4b2da..f36eddf 100644 --- a/internal/gui/audio_player.go +++ b/internal/gui/audio_player.go @@ -31,7 +31,7 @@ func NewAudioPlayer() *AudioPlayer { p := &AudioPlayer{} // Create controls - p.playButton = widget.NewButton("▶ Play (P)", p.onPlay) + p.playButton = widget.NewButton("▶ Play (p)", p.onPlay) p.stopButton = widget.NewButton("■ Stop", p.onStop) p.statusLabel = widget.NewLabel("No audio loaded") @@ -98,7 +98,7 @@ func (p *AudioPlayer) onPlay() { } p.isPlaying = true - p.playButton.SetText("⏸ Pause (P)") + p.playButton.SetText("⏸ Pause (p)") p.stopButton.Enable() p.statusLabel.SetText("Playing: " + filepath.Base(p.audioFile)) } @@ -111,7 +111,7 @@ func (p *AudioPlayer) onStop() { } p.isPlaying = false - p.playButton.SetText("▶ Play (P)") + p.playButton.SetText("▶ Play (p)") p.stopButton.Disable() p.statusLabel.SetText("Stopped: " + filepath.Base(p.audioFile)) } @@ -164,7 +164,7 @@ func (p *AudioPlayer) startPlayback() error { // Playback finished normally fyne.Do(func() { p.isPlaying = false - p.playButton.SetText("▶ Play (P)") + p.playButton.SetText("▶ Play (p)") p.stopButton.Disable() p.statusLabel.SetText("Finished: " + filepath.Base(p.audioFile)) }) diff --git a/internal/gui/navigation.go b/internal/gui/navigation.go index e59b817..05bf988 100644 --- a/internal/gui/navigation.go +++ b/internal/gui/navigation.go @@ -294,7 +294,7 @@ func (a *Application) onDelete() { } // Create custom confirmation dialog with keyboard support - message := fmt.Sprintf("Delete all files for '%s'?\n\nPress Y to confirm or N to cancel", a.currentWord) + message := fmt.Sprintf("Delete all files for '%s'?\n\nPress y to confirm or n to cancel", a.currentWord) confirmDialog := dialog.NewConfirm("Delete Word", message, func(confirm bool) { a.deleteConfirming = false if confirm { |
