From acdb523fb122747827cbb34de5ddfc373e239c61 Mon Sep 17 00:00:00 2001 From: Stu Leak Date: Tue, 23 Dec 2025 17:20:07 -0500 Subject: [PATCH] Add drag and drop for Player module and enable Author module MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Player Module Drag and Drop: - Add handleDrop case for player module - Drag video files onto player to load them - Works the same way as convert module - Auto-probe and load first video file from drop Author Module: - Enable Author module button in main menu - Add "author" to enabled modules list (line 1525) - Module is now clickable and functional 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 --- main.go | 43 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 848cb8e..50a32a7 100644 --- a/main.go +++ b/main.go @@ -1522,7 +1522,7 @@ func (s *appState) showMainMenu() { Label: m.Label, Color: m.Color, Category: m.Category, - Enabled: m.ID == "convert" || m.ID == "compare" || m.ID == "inspect" || m.ID == "merge" || m.ID == "thumb" || m.ID == "player" || m.ID == "filters" || m.ID == "upscale", // Enabled modules (authoring/subtitles placeholders stay disabled) + Enabled: m.ID == "convert" || m.ID == "compare" || m.ID == "inspect" || m.ID == "merge" || m.ID == "thumb" || m.ID == "player" || m.ID == "filters" || m.ID == "upscale" || m.ID == "author", // Enabled modules }) } @@ -9763,6 +9763,47 @@ func (s *appState) handleDrop(pos fyne.Position, items []fyne.URI) { return } + // If in player module, handle single video file + if s.active == "player" { + // Collect video files from dropped items + var videoPaths []string + for _, uri := range items { + if uri.Scheme() != "file" { + continue + } + path := uri.Path() + if s.isVideoFile(path) { + videoPaths = append(videoPaths, path) + } + } + + if len(videoPaths) == 0 { + logging.Debug(logging.CatUI, "no valid video files in dropped items") + dialog.ShowInformation("VT_Player", "No video files found in dropped items.", s.window) + return + } + + // Load first video + go func() { + src, err := probeVideo(videoPaths[0]) + if err != nil { + logging.Debug(logging.CatModule, "failed to load video for player: %v", err) + fyne.CurrentApp().Driver().DoFromGoroutine(func() { + dialog.ShowError(fmt.Errorf("failed to load video: %w", err), s.window) + }, false) + return + } + + fyne.CurrentApp().Driver().DoFromGoroutine(func() { + s.playerFile = src + s.showPlayerView() + logging.Debug(logging.CatModule, "loaded video into player module") + }, false) + }() + + return + } + // Other modules don't handle file drops yet logging.Debug(logging.CatUI, "drop ignored; module %s cannot handle files", s.active) }