Compare commits

...

4 Commits

Author SHA1 Message Date
484a636fb4 Add chapter loss warning when converting to DVD format
When converting a file with chapters to DVD/MPEG format, show
a confirmation dialog warning the user that chapters will be lost.

MPEG format does not support embedded chapters - they require
full DVD authoring with IFO files. Users are warned and given
the option to cancel or continue.

Warning appears for both 'Convert Now' and 'Add to Queue' buttons.
2025-12-17 03:05:26 -05:00
f2ac544d75 Make stats bar overlay use module tint and lighter text 2025-12-17 03:03:45 -05:00
a5ad368d0f Fix duplicate queue button declaration in inspect view 2025-12-17 02:45:39 -05:00
320f522d85 Fix queue progress calc type 2025-12-17 02:38:55 -05:00
3 changed files with 74 additions and 33 deletions

View File

@ -487,12 +487,12 @@ func (c *ConversionStatsBar) UpdateStatsWithDetails(running, pending, completed,
// CreateRenderer creates the renderer for the stats bar
func (c *ConversionStatsBar) CreateRenderer() fyne.WidgetRenderer {
bg := canvas.NewRectangle(color.NRGBA{R: 30, G: 30, B: 30, A: 255})
bg.CornerRadius = 4
bg.StrokeColor = GridColor
bg.StrokeWidth = 1
// Transparent background so the parent tinted bar color shows through
bg := canvas.NewRectangle(color.Transparent)
bg.CornerRadius = 0
bg.StrokeWidth = 0
statusText := canvas.NewText("", TextColor)
statusText := canvas.NewText("", color.NRGBA{R: 230, G: 236, B: 245, A: 255})
statusText.TextStyle = fyne.TextStyle{Monospace: true}
statusText.TextSize = 11
@ -525,7 +525,7 @@ func (r *conversionStatsRenderer) Layout(size fyne.Size) {
// Layout text and progress bar
textSize := r.statusText.MinSize()
padding := float32(8)
padding := float32(10)
// If there's a running job, show progress bar
if r.bar.running > 0 && r.bar.progress > 0 {

View File

@ -90,7 +90,7 @@ func (r *stripedProgressRenderer) Layout(size fyne.Size) {
r.bg.Resize(size)
r.bg.Move(fyne.NewPos(0, 0))
fillWidth := size.Width * r.bar.progress
fillWidth := size.Width * float32(r.bar.progress)
fillSize := fyne.NewSize(fillWidth, size.Height)
r.fill.Resize(fillSize)

93
main.go
View File

@ -4161,6 +4161,39 @@ func runLogsCLI() error {
return nil
}
func (s *appState) executeAddToQueue() {
if err := s.addConvertToQueue(); err != nil {
dialog.ShowError(err, s.window)
} else {
dialog.ShowInformation("Queue", "Job added to queue!", s.window)
// Auto-start queue if not already running
if s.jobQueue != nil && !s.jobQueue.IsRunning() && !s.convertBusy {
s.jobQueue.Start()
logging.Debug(logging.CatUI, "queue auto-started after adding job")
}
}
}
func (s *appState) executeConversion() {
// Add job to queue and start immediately
if err := s.addConvertToQueue(); err != nil {
dialog.ShowError(err, s.window)
return
}
// Start the queue if not already running
if s.jobQueue != nil && !s.jobQueue.IsRunning() {
s.jobQueue.Start()
logging.Debug(logging.CatSystem, "started queue from Convert Now")
}
// Clear the loaded video from convert module
s.clearVideo()
// Show success message
dialog.ShowInformation("Convert", "Conversion started! View progress in Job Queue.", s.window)
}
func buildConvertView(state *appState, src *videoSource) fyne.CanvasObject {
convertColor := moduleColor("convert")
@ -5735,16 +5768,25 @@ func buildConvertView(state *appState, src *videoSource) fyne.CanvasObject {
// Add to Queue button
addQueueBtn := widget.NewButton("Add to Queue", func() {
state.persistConvertConfig()
if err := state.addConvertToQueue(); err != nil {
dialog.ShowError(err, state.window)
} else {
dialog.ShowInformation("Queue", "Job added to queue!", state.window)
// Auto-start queue if not already running
if state.jobQueue != nil && !state.jobQueue.IsRunning() && !state.convertBusy {
state.jobQueue.Start()
logging.Debug(logging.CatUI, "queue auto-started after adding job")
}
// Check if converting a file with chapters to DVD format
isDVD := state.convert.SelectedFormat.Ext == ".mpg"
if state.source != nil && state.source.HasChapters && isDVD {
dialog.ShowConfirm("Chapter Warning",
"This file contains chapters, but DVD/MPEG format does not support embedded chapters.\n\n"+
"Chapters will be lost in the conversion.\n\n"+
"Consider using MKV or MP4 format to preserve chapters.\n\n"+
"Continue anyway?",
func(confirmed bool) {
if !confirmed {
return
}
state.executeAddToQueue()
}, state.window)
return
}
state.executeAddToQueue()
})
if src == nil {
addQueueBtn.Disable()
@ -5752,23 +5794,25 @@ func buildConvertView(state *appState, src *videoSource) fyne.CanvasObject {
convertBtn = widget.NewButton("CONVERT NOW", func() {
state.persistConvertConfig()
// Add job to queue and start immediately
if err := state.addConvertToQueue(); err != nil {
dialog.ShowError(err, state.window)
// Check if converting a file with chapters to DVD format
isDVD := state.convert.SelectedFormat.Ext == ".mpg"
if state.source != nil && state.source.HasChapters && isDVD {
dialog.ShowConfirm("Chapter Warning",
"This file contains chapters, but DVD/MPEG format does not support embedded chapters.\n\n"+
"Chapters will be lost in the conversion.\n\n"+
"Consider using MKV or MP4 format to preserve chapters.\n\n"+
"Continue anyway?",
func(confirmed bool) {
if !confirmed {
return
}
state.executeConversion()
}, state.window)
return
}
// Start the queue if not already running
if state.jobQueue != nil && !state.jobQueue.IsRunning() {
state.jobQueue.Start()
logging.Debug(logging.CatSystem, "started queue from Convert Now")
}
// Clear the loaded video from convert module
state.clearVideo()
// Show success message
dialog.ShowInformation("Convert", "Conversion started! View progress in Job Queue.", state.window)
state.executeConversion()
})
convertBtn.Importance = widget.HighImportance
if src == nil {
@ -10313,9 +10357,6 @@ func buildInspectView(state *appState) fyne.CanvasObject {
)
// Bottom bar with module color
queueBtn := widget.NewButton("View Queue", func() {
state.showQueue()
})
statusLabel := widget.NewLabel("Idle")
statusLabel.Alignment = fyne.TextAlignCenter