mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 16:56:36 -04:00
manually focus on osx
This commit is contained in:
parent
383840619b
commit
65d35e1881
1 changed files with 13 additions and 0 deletions
|
@ -2497,6 +2497,7 @@ it to your friends.
|
|||
anki.sound.checkForNoiseProfile()
|
||||
if sys.platform.startswith("darwin"):
|
||||
self.mainWin.actionRecordNoiseProfile.setEnabled(False)
|
||||
addHook("soundQueued", self.onSoundQueued)
|
||||
|
||||
def onRepeatAudio(self):
|
||||
clearAudioQueue()
|
||||
|
@ -2510,6 +2511,18 @@ it to your friends.
|
|||
from ui.sound import recordNoiseProfile
|
||||
recordNoiseProfile(self)
|
||||
|
||||
def onSoundQueued(self):
|
||||
if sys.platform.startswith("darwin"):
|
||||
# because the gui doesn't return focus, manually focus anki again
|
||||
t = QTimer(self)
|
||||
t.setSingleShot(True)
|
||||
t.start(1000)
|
||||
self.connect(t, SIGNAL("timeout()"),
|
||||
self.onSoundTimer)
|
||||
|
||||
def onSoundTimer(self):
|
||||
self.activateWindow()
|
||||
|
||||
# Progress info
|
||||
##########################################################################
|
||||
|
||||
|
|
Loading…
Reference in a new issue