Fix stats bar UI thread updates
This commit is contained in:
parent
f558119f4f
commit
2761d35ed6
1
DONE.md
1
DONE.md
|
|
@ -771,6 +771,7 @@ This file tracks completed features, fixes, and milestones.
|
||||||
- ✅ Prevented snippet runaway bitrates when using Match Source Format
|
- ✅ Prevented snippet runaway bitrates when using Match Source Format
|
||||||
- ✅ History sidebar refreshes when jobs complete (snippet entries now appear)
|
- ✅ History sidebar refreshes when jobs complete (snippet entries now appear)
|
||||||
- ✅ Benchmark errors now show non-blocking notifications instead of OK popups
|
- ✅ Benchmark errors now show non-blocking notifications instead of OK popups
|
||||||
|
- ✅ Fixed stats bar updates to run on the UI thread to avoid Fyne warnings
|
||||||
- ✅ Stabilized video seeking and embedded rendering
|
- ✅ Stabilized video seeking and embedded rendering
|
||||||
- ✅ Improved player window positioning
|
- ✅ Improved player window positioning
|
||||||
- ✅ Fixed clear video functionality
|
- ✅ Fixed clear video functionality
|
||||||
|
|
|
||||||
1
TODO.md
1
TODO.md
|
|
@ -45,6 +45,7 @@ This file tracks upcoming features, improvements, and known issues.
|
||||||
- Target size unit selector and numeric entry
|
- Target size unit selector and numeric entry
|
||||||
- Snippet history updates in sidebar
|
- Snippet history updates in sidebar
|
||||||
- Non-blocking benchmark error notifications
|
- Non-blocking benchmark error notifications
|
||||||
|
- Stats bar updates run on the UI thread
|
||||||
|
|
||||||
## Priority Features for dev20+
|
## Priority Features for dev20+
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -468,29 +468,44 @@ func NewConversionStatsBar(onTapped func()) *ConversionStatsBar {
|
||||||
|
|
||||||
// UpdateStats updates the stats display
|
// UpdateStats updates the stats display
|
||||||
func (c *ConversionStatsBar) UpdateStats(running, pending, completed, failed, cancelled int, progress float64, jobTitle string) {
|
func (c *ConversionStatsBar) UpdateStats(running, pending, completed, failed, cancelled int, progress float64, jobTitle string) {
|
||||||
c.running = running
|
c.updateStats(func() {
|
||||||
c.pending = pending
|
c.running = running
|
||||||
c.completed = completed
|
c.pending = pending
|
||||||
c.failed = failed
|
c.completed = completed
|
||||||
c.cancelled = cancelled
|
c.failed = failed
|
||||||
c.progress = progress
|
c.cancelled = cancelled
|
||||||
c.jobTitle = jobTitle
|
c.progress = progress
|
||||||
c.Refresh()
|
c.jobTitle = jobTitle
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// UpdateStatsWithDetails updates the stats display with detailed conversion info
|
// UpdateStatsWithDetails updates the stats display with detailed conversion info
|
||||||
func (c *ConversionStatsBar) UpdateStatsWithDetails(running, pending, completed, failed, cancelled int, progress, fps, speed float64, eta, jobTitle string) {
|
func (c *ConversionStatsBar) UpdateStatsWithDetails(running, pending, completed, failed, cancelled int, progress, fps, speed float64, eta, jobTitle string) {
|
||||||
c.running = running
|
c.updateStats(func() {
|
||||||
c.pending = pending
|
c.running = running
|
||||||
c.completed = completed
|
c.pending = pending
|
||||||
c.failed = failed
|
c.completed = completed
|
||||||
c.cancelled = cancelled
|
c.failed = failed
|
||||||
c.progress = progress
|
c.cancelled = cancelled
|
||||||
c.fps = fps
|
c.progress = progress
|
||||||
c.speed = speed
|
c.fps = fps
|
||||||
c.eta = eta
|
c.speed = speed
|
||||||
c.jobTitle = jobTitle
|
c.eta = eta
|
||||||
c.Refresh()
|
c.jobTitle = jobTitle
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *ConversionStatsBar) updateStats(update func()) {
|
||||||
|
app := fyne.CurrentApp()
|
||||||
|
if app == nil || app.Driver() == nil {
|
||||||
|
update()
|
||||||
|
c.Refresh()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
app.Driver().DoFromGoroutine(func() {
|
||||||
|
update()
|
||||||
|
c.Refresh()
|
||||||
|
}, false)
|
||||||
}
|
}
|
||||||
|
|
||||||
// CreateRenderer creates the renderer for the stats bar
|
// CreateRenderer creates the renderer for the stats bar
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user