Sort out number of buttons on SlideController to match song and make more KITT like

This commit is contained in:
Tim Bentley 2009-10-31 09:03:54 +00:00
parent 4eaa7a1535
commit 258bf403c8

View File

@ -176,16 +176,16 @@ class SlideController(QtGui.QWidget):
if isLive:
self.Songbar = OpenLPToolbar(self)
self.Songbar.addToolbarButton(
u'Bridge', u':/media/media_time.png',
u'Bridge', u':/slides/slide_close.png',
self.trUtf8(u'Bridge'),
self.onSongBarHandler)
self.Songbar.addToolbarButton(
u'Chorus', u':/media/media_time.png',
u'Chorus', u':/slides/slide_close.png',
self.trUtf8(u'Chorus'),
self.onSongBarHandler)
for verse in range(1, 9):
for verse in range(1, 20):
self.Songbar.addToolbarButton(
unicode(verse), u':/media/media_time.png',
unicode(verse), u':/slides/slide_close.png',
unicode(self.trUtf8(u'Verse %s'))%verse,
self.onSongBarHandler)
self.ControllerLayout.addWidget(self.Songbar)
@ -282,7 +282,15 @@ class SlideController(QtGui.QWidget):
self.Toolbar.makeWidgetsInvisible(self.image_list)
if item.name == u'Songs' and \
str_to_bool(self.songsconfig.get_config(u'display songbar', True)):
print item.verse_order
for action in self.Songbar.actions:
self.Songbar.actions[action].setVisible(False)
verses = item.verse_order.split(u' ')
for verse in verses:
try:
self.Songbar.actions[verse].setVisible(True)
except:
#More than 20 verses hard luck
pass
self.Songbar.setVisible(True)
elif item.service_item_type == ServiceType.Image:
#Not sensible to allow loops with 1 frame