mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 22:12:21 -04:00
restore mpv/mplayer missing warning that got lost in the av changes
and ensure the UI doesn't get temporarily stuck after the command fails
This commit is contained in:
parent
56b2cc58ed
commit
8c0d4c8059
2 changed files with 9 additions and 8 deletions
|
@ -82,12 +82,6 @@ your system's temporary folder may be incorrect."""
|
|||
"Your firewall or antivirus program is preventing Anki from creating a connection to itself. Please add an exception for Anki."
|
||||
)
|
||||
)
|
||||
if "install mplayer" in error:
|
||||
return showWarning(
|
||||
_(
|
||||
"Sound and video on cards will not function until mpv or mplayer is installed."
|
||||
)
|
||||
)
|
||||
if "no default input" in error.lower():
|
||||
return showWarning(
|
||||
_(
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
# Copyright: Ankitects Pty Ltd and contributors
|
||||
# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||
|
||||
import atexit
|
||||
import os
|
||||
import re
|
||||
|
@ -25,7 +24,7 @@ from aqt import gui_hooks
|
|||
from aqt.mpv import MPV, MPVBase
|
||||
from aqt.qt import *
|
||||
from aqt.taskman import TaskManager
|
||||
from aqt.utils import restoreGeom, saveGeom, startup_info
|
||||
from aqt.utils import restoreGeom, saveGeom, showWarning, startup_info
|
||||
|
||||
# AV player protocol
|
||||
##########################################################################
|
||||
|
@ -291,6 +290,14 @@ class SimpleProcessPlayer(Player): # pylint: disable=abstract-method
|
|||
except PlayerInterrupted:
|
||||
# don't fire done callback when interrupted
|
||||
return
|
||||
except FileNotFoundError:
|
||||
showWarning(
|
||||
_(
|
||||
"Sound and video on cards will not function until mpv or mplayer is installed."
|
||||
)
|
||||
)
|
||||
# must call cb() here, as we don't currently have another way
|
||||
# to flag to av_player that we've stopped
|
||||
cb()
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue