manually focus on osx

This commit is contained in:
Damien Elmes 2009-06-26 10:51:00 +09:00
parent 383840619b
commit 65d35e1881

View file

@ -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
##########################################################################