mirror of
https://github.com/ankitects/anki.git
synced 2025-11-12 07:37:11 -05: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()
|
anki.sound.checkForNoiseProfile()
|
||||||
if sys.platform.startswith("darwin"):
|
if sys.platform.startswith("darwin"):
|
||||||
self.mainWin.actionRecordNoiseProfile.setEnabled(False)
|
self.mainWin.actionRecordNoiseProfile.setEnabled(False)
|
||||||
|
addHook("soundQueued", self.onSoundQueued)
|
||||||
|
|
||||||
def onRepeatAudio(self):
|
def onRepeatAudio(self):
|
||||||
clearAudioQueue()
|
clearAudioQueue()
|
||||||
|
|
@ -2510,6 +2511,18 @@ it to your friends.
|
||||||
from ui.sound import recordNoiseProfile
|
from ui.sound import recordNoiseProfile
|
||||||
recordNoiseProfile(self)
|
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
|
# Progress info
|
||||||
##########################################################################
|
##########################################################################
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue