forked from openlp/openlp
commit
b6b0819a50
@ -180,16 +180,25 @@ class SlideController(QtGui.QWidget):
|
||||
self.hideMenu.menu().addAction(self.themeScreen)
|
||||
self.hideMenu.menu().addAction(self.desktopScreen)
|
||||
self.toolbar.addToolbarSeparator(u'Loop Separator')
|
||||
self.toolbar.addToolbarButton(
|
||||
startLoop = self.toolbar.addToolbarButton(
|
||||
# Does not need translating - control string.
|
||||
u'Start Loop', u':/media/media_time.png',
|
||||
translate('OpenLP.SlideController', 'Start continuous loop'),
|
||||
self.onStartLoop)
|
||||
self.toolbar.addToolbarButton(
|
||||
action_list = ActionList.get_instance()
|
||||
action_list.add_action(startLoop, UiStrings().LiveToolbar)
|
||||
stopLoop = self.toolbar.addToolbarButton(
|
||||
# Does not need translating - control string.
|
||||
u'Stop Loop', u':/media/media_stop.png',
|
||||
translate('OpenLP.SlideController', 'Stop continuous loop'),
|
||||
self.onStopLoop)
|
||||
action_list.add_action(stopLoop, UiStrings().LiveToolbar)
|
||||
self.toogleLoop = shortcut_action(self, u'toogleLoop',
|
||||
[QtGui.QKeySequence(u'L')], self.onToggleLoop,
|
||||
category=UiStrings().LiveToolbar)
|
||||
self.toogleLoop.setText(translate('OpenLP.SlideController',
|
||||
'Start/Stop continuous loop'))
|
||||
self.addAction(self.toogleLoop)
|
||||
self.delaySpinBox = QtGui.QSpinBox()
|
||||
self.delaySpinBox.setMinimum(1)
|
||||
self.delaySpinBox.setMaximum(180)
|
||||
@ -494,6 +503,9 @@ class SlideController(QtGui.QWidget):
|
||||
self.mediabar.setVisible(False)
|
||||
self.toolbar.makeWidgetsInvisible([u'Song Menu'])
|
||||
self.toolbar.makeWidgetsInvisible(self.loopList)
|
||||
self.toogleLoop.setEnabled(False)
|
||||
self.toolbar.actions[u'Start Loop'].setEnabled(False)
|
||||
self.toolbar.actions[u'Stop Loop'].setEnabled(False)
|
||||
self.toolbar.actions[u'Stop Loop'].setVisible(False)
|
||||
if item.is_text():
|
||||
if QtCore.QSettings().value(
|
||||
@ -503,6 +515,9 @@ class SlideController(QtGui.QWidget):
|
||||
if item.is_capable(ItemCapabilities.AllowsLoop) and \
|
||||
len(item.get_frames()) > 1:
|
||||
self.toolbar.makeWidgetsVisible(self.loopList)
|
||||
self.toogleLoop.setEnabled(True)
|
||||
self.toolbar.actions[u'Start Loop'].setEnabled(True)
|
||||
self.toolbar.actions[u'Stop Loop'].setEnabled(True)
|
||||
if item.is_media():
|
||||
self.toolbar.setVisible(False)
|
||||
self.mediabar.setVisible(True)
|
||||
@ -995,6 +1010,15 @@ class SlideController(QtGui.QWidget):
|
||||
self.previewListWidget.rowCount() - 1)
|
||||
self.slideSelected()
|
||||
|
||||
def onToggleLoop(self, toggled):
|
||||
"""
|
||||
Toggles the loop state.
|
||||
"""
|
||||
if self.toolbar.actions[u'Start Loop'].isVisible():
|
||||
self.onStartLoop()
|
||||
else:
|
||||
self.onStopLoop()
|
||||
|
||||
def onStartLoop(self):
|
||||
"""
|
||||
Start the timer loop running and store the timer id
|
||||
|
@ -850,4 +850,4 @@ class BibleMediaItem(MediaManagerItem):
|
||||
self.settings.layout_style)
|
||||
QtCore.QSettings().setValue(
|
||||
self.settingsSection + u'/verse layout style',
|
||||
QtCore.QVariant(self.settings.layout_style))
|
||||
QtCore.QVariant(self.settings.layout_style))
|
||||
|
@ -576,11 +576,13 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
|
||||
if verse_index is not None:
|
||||
order.append(VerseType.Tags[verse_index] + u'1')
|
||||
else:
|
||||
order.append(u'') # it matches no verses anyway
|
||||
# it matches no verses anyway
|
||||
order.append(u'')
|
||||
else:
|
||||
verse_index = VerseType.from_translated_tag(item[0])
|
||||
if verse_index is None:
|
||||
order.append(u'') # same as above
|
||||
# it matches no verses anyway
|
||||
order.append(u'')
|
||||
else:
|
||||
verse_tag = VerseType.Tags[verse_index]
|
||||
verse_num = item[1:].lower()
|
||||
@ -779,4 +781,4 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
|
||||
self.song.verse_order)
|
||||
except:
|
||||
log.exception(u'Problem processing song Lyrics \n%s',
|
||||
sxml.dump_xml())
|
||||
sxml.dump_xml())
|
||||
|
@ -257,7 +257,7 @@ def clean_song(manager, song):
|
||||
``song``
|
||||
The song object.
|
||||
"""
|
||||
song.title = song.title.strip() if song.title else u''
|
||||
song.title = song.title.rstrip() if song.title else u''
|
||||
if song.alternate_title is None:
|
||||
song.alternate_title = u''
|
||||
song.alternate_title = song.alternate_title.strip()
|
||||
|
Loading…
Reference in New Issue
Block a user