Code cleanUp lines to 120

This commit is contained in:
Dmitriy Marmyshev 2012-12-19 00:25:07 +04:00
parent 770f245d0c
commit 3f380c68d9
3 changed files with 14 additions and 22 deletions

View File

@ -400,6 +400,9 @@ class ServiceItem(object):
self.start_time = header.get(u'start_time', 0)
self.end_time = header.get(u'end_time', 0)
self.media_length = header.get(u'media_length', 0)
self.auto_play_slides_once = header.get(u'auto_play_slides_once', False)
self.auto_play_slides_loop = header.get(u'auto_play_slides_loop', False)
self.timed_slide_interval = header.get(u'timed_slide_interval', 0)
self.will_auto_start = header.get(u'will_auto_start', False)
if u'background_audio' in header:
self.background_audio = []
@ -424,9 +427,6 @@ class ServiceItem(object):
self.add_from_command(path, text_image[u'title'], text_image[u'image'])
else:
self.add_from_command(text_image[u'path'], text_image[u'title'], text_image[u'image'])
self.auto_play_slides_once = header.get(u'auto_play_slides_once', False)
self.auto_play_slides_loop = header.get(u'auto_play_slides_loop', False)
self.timed_slide_interval = header.get(u'timed_slide_interval', 0)
self._new_item()
def get_display_title(self):

View File

@ -260,22 +260,18 @@ class ServiceManager(QtGui.QWidget):
self.menu.addAction(self.serviceManagerList.delete)
self.menu.addSeparator()
# Add AutoPlay menu actions
self.AutoPlaySlidesGroup = QtGui.QMenu(
translate('OpenLP.ServiceManager', '&Auto play slides'))
self.AutoPlaySlidesGroup = QtGui.QMenu(translate('OpenLP.ServiceManager', '&Auto play slides'))
self.menu.addMenu(self.AutoPlaySlidesGroup)
self.AutoPlaySlidesLoop = create_widget_action(self.AutoPlaySlidesGroup,
text=translate('OpenLP.ServiceManager', 'Auto play slides &Loop'),
checked=False,
triggers=self.toggleAutoPlaySlidesLoop)
checked=False, triggers=self.toggleAutoPlaySlidesLoop)
self.AutoPlaySlidesOnce = create_widget_action(self.AutoPlaySlidesGroup,
text=translate('OpenLP.ServiceManager', 'Auto play slides &Once'),
checked=False,
triggers=self.toggleAutoPlaySlidesOnce)
checked=False, triggers=self.toggleAutoPlaySlidesOnce)
self.AutoPlaySlidesGroup.addSeparator()
self.TimedSlideInterval = create_widget_action(self.AutoPlaySlidesGroup,
text=translate('OpenLP.ServiceManager', '&Delay between slides'),
checked=False,
triggers=self.onTimedSlideInterval)
checked=False, triggers=self.onTimedSlideInterval)
self.menu.addSeparator()
self.previewAction = create_widget_action(self.menu, text=translate('OpenLP.ServiceManager', 'Show &Preview'),
icon=u':/general/general_preview.png', triggers=self.makePreview)
@ -800,7 +796,7 @@ class ServiceManager(QtGui.QWidget):
else:
delay_suffix = u' ...'
self.TimedSlideInterval.setText(translate('OpenLP.ServiceManager', '&Delay between slides') + delay_suffix)
# For future: make group explain itself more visual
# TOFO for future: make group explain itself more visually
#self.AutoPlaySlidesGroup.setChecked(
# serviceItem[u'service_item'].timed_slide_interval > 0 and
# (serviceItem[u'service_item'].auto_play_slides_once or
@ -886,14 +882,12 @@ class ServiceManager(QtGui.QWidget):
item = self.findServiceItem()[0]
service_item = self.serviceItems[item][u'service_item']
if service_item.timed_slide_interval == 0:
timed_slide_interval = Settings().value(u'loop delay',
QtCore.QVariant(5)).toInt()[0]
timed_slide_interval = Settings().value(u'loop delay', QtCore.QVariant(5)).toInt()[0]
else:
timed_slide_interval = service_item.timed_slide_interval
timed_slide_interval, ok = QtGui.QInputDialog.getInteger(self,
translate('OpenLP.ServiceManager', 'Input delay'),
translate('OpenLP.ServiceManager',
'Delay between slides in seconds.'), timed_slide_interval, 0, 180, 1)
timed_slide_interval, ok = QtGui.QInputDialog.getInteger(self, translate('OpenLP.ServiceManager',
'Input delay'), translate('OpenLP.ServiceManager', 'Delay between slides in seconds.'),
timed_slide_interval, 0, 180, 1)
if ok:
service_item.timed_slide_interval = timed_slide_interval
if service_item.timed_slide_interval <> 0\

View File

@ -694,13 +694,11 @@ class SlideController(DisplayController):
self.slideSelected()
else:
self._processItem(item, slidenum)
if self.isLive and item.auto_play_slides_loop\
and item.timed_slide_interval > 0:
if self.isLive and item.auto_play_slides_loop and item.timed_slide_interval > 0:
self.playSlidesLoop.setChecked(item.auto_play_slides_loop)
self.delaySpinBox.setValue(int(item.timed_slide_interval))
self.onPlaySlidesLoop()
elif self.isLive and item.auto_play_slides_once\
and item.timed_slide_interval > 0:
elif self.isLive and item.auto_play_slides_once and item.timed_slide_interval > 0:
self.playSlidesOnce.setChecked(item.auto_play_slides_once)
self.delaySpinBox.setValue(int(item.timed_slide_interval))
self.onPlaySlidesOnce()