Fix issue 1045 and bug 1037076: Short cut keys do not work for background audio

bzr-revno: 2045
Fixes: https://launchpad.net/bugs/1037076
This commit is contained in:
Philip Ridout 2012-08-24 22:30:19 +02:00 committed by Raoul Snyman
commit afc7ce6b2a

View File

@ -286,19 +286,20 @@ class SlideController(Controller):
text=translate('OpenLP.SlideController', 'Pause Audio'), text=translate('OpenLP.SlideController', 'Pause Audio'),
tooltip=translate('OpenLP.SlideController', 'Pause audio.'), tooltip=translate('OpenLP.SlideController', 'Pause audio.'),
checked=False, visible=False, category=self.category, checked=False, visible=False, category=self.category,
triggers=self.onAudioPauseClicked) context=QtCore.Qt.WindowShortcut,
shortcuts=[], triggers=self.onAudioPauseClicked)
self.audioMenu = QtGui.QMenu( self.audioMenu = QtGui.QMenu(
translate('OpenLP.SlideController', 'Background Audio'), self) translate('OpenLP.SlideController', 'Background Audio'), self.toolbar)
self.audioPauseItem.setMenu(self.audioMenu) self.audioPauseItem.setMenu(self.audioMenu)
self.audioPauseItem.setParent(self) self.audioPauseItem.setParent(self.toolbar)
self.toolbar.widgetForAction(self.audioPauseItem).setPopupMode( self.toolbar.widgetForAction(self.audioPauseItem).setPopupMode(
QtGui.QToolButton.MenuButtonPopup) QtGui.QToolButton.MenuButtonPopup)
self.nextTrackItem = create_action(self, u'nextTrackItem', self.nextTrackItem = create_action(self, u'nextTrackItem',
text=UiStrings().NextTrack, text=UiStrings().NextTrack,
icon=u':/slides/media_playback_next.png', tooltip=translate( icon=u':/slides/media_playback_next.png', tooltip=translate(
'OpenLP.SlideController', 'Go to next audio track.'), 'OpenLP.SlideController', 'Go to next audio track.'),
category=self.category, context=QtCore.Qt.WindowShortcut, category=self.category,
triggers=self.onNextTrackClicked) shortcuts=[], triggers=self.onNextTrackClicked)
self.audioMenu.addAction(self.nextTrackItem) self.audioMenu.addAction(self.nextTrackItem)
self.trackMenu = self.audioMenu.addMenu( self.trackMenu = self.audioMenu.addMenu(
translate('OpenLP.SlideController', 'Tracks')) translate('OpenLP.SlideController', 'Tracks'))