Renamed all variables by standard.

This commit is contained in:
Dmitriy Marmyshev 2012-11-14 15:47:15 +04:00
parent 7780751807
commit 2f34b5ddf2
3 changed files with 59 additions and 60 deletions

View File

@ -123,10 +123,9 @@ class ServiceItem(object):
self.background_audio = [] self.background_audio = []
self.theme_overwritten = False self.theme_overwritten = False
self.temporary_edit = False self.temporary_edit = False
self.AutoPlaySlidesOnce = False self.auto_play_slides_once = False
self.AutoPlaySlidesLoop = False self.auto_play_slides_loop = False
self.TimedSlideInterval = 0 self.timed_slide_interval = 0
self._new_item() self._new_item()
def _new_item(self): def _new_item(self):
@ -280,9 +279,9 @@ class ServiceItem(object):
u'search': self.search_string, u'search': self.search_string,
u'data': self.data_string, u'data': self.data_string,
u'xml_version': self.xml_version, u'xml_version': self.xml_version,
u'AutoPlaySlidesOnce': self.AutoPlaySlidesOnce, u'auto_play_slides_once': self.auto_play_slides_once,
u'AutoPlaySlidesLoop': self.AutoPlaySlidesLoop, u'auto_play_slides_loop': self.auto_play_slides_loop,
u'TimedSlideInterval': self.TimedSlideInterval, u'timed_slide_interval': self.timed_slide_interval,
u'start_time': self.start_time, u'start_time': self.start_time,
u'end_time': self.end_time, u'end_time': self.end_time,
u'media_length': self.media_length, u'media_length': self.media_length,
@ -349,9 +348,9 @@ class ServiceItem(object):
filename = os.path.join(path, text_image[u'title']) filename = os.path.join(path, text_image[u'title'])
self.add_from_command( self.add_from_command(
path, text_image[u'title'], text_image[u'image']) path, text_image[u'title'], text_image[u'image'])
self.AutoPlaySlidesOnce = header.get(u'AutoPlaySlidesOnce', False) self.auto_play_slides_once = header.get(u'auto_play_slides_once', False)
self.AutoPlaySlidesLoop = header.get(u'AutoPlaySlidesLoop', False) self.auto_play_slides_loop = header.get(u'auto_play_slides_loop', False)
self.TimedSlideInterval = header.get(u'TimedSlideInterval', 0) self.timed_slide_interval = header.get(u'timed_slide_interval', 0)
self._new_item() self._new_item()
def get_display_title(self): def get_display_title(self):

View File

@ -314,16 +314,16 @@ class ServiceManager(QtGui.QWidget):
self.AutoPlaySlidesGroup = QtGui.QMenu( self.AutoPlaySlidesGroup = QtGui.QMenu(
translate('OpenLP.ServiceManager', '&Auto play slides')) translate('OpenLP.ServiceManager', '&Auto play slides'))
self.menu.addMenu(self.AutoPlaySlidesGroup) self.menu.addMenu(self.AutoPlaySlidesGroup)
self.AutoPlaySlidesLoop = create_widget_action(self.AutoPlaySlidesGroup, self.auto_play_slides_loop = create_widget_action(self.AutoPlaySlidesGroup,
text=translate('OpenLP.ServiceManager', 'Auto play slides &Loop'), text=translate('OpenLP.ServiceManager', 'Auto play slides &Loop'),
checked=False, checked=False,
triggers=self.toggle_auto_play_slides_loop) triggers=self.toggle_auto_play_slides_loop)
self.AutoPlaySlidesOnce = create_widget_action(self.AutoPlaySlidesGroup, self.auto_play_slides_once = create_widget_action(self.AutoPlaySlidesGroup,
text=translate('OpenLP.ServiceManager', 'Auto play slides &Once'), text=translate('OpenLP.ServiceManager', 'Auto play slides &Once'),
checked=False, checked=False,
triggers=self.toggle_auto_play_slides_once) triggers=self.toggle_auto_play_slides_once)
self.AutoPlaySlidesGroup.addSeparator() self.AutoPlaySlidesGroup.addSeparator()
self.TimedSlideInterval = create_widget_action(self.AutoPlaySlidesGroup, self.timed_slide_interval = create_widget_action(self.AutoPlaySlidesGroup,
text=translate('OpenLP.ServiceManager', '&Delay between slides'), text=translate('OpenLP.ServiceManager', '&Delay between slides'),
checked=False, checked=False,
triggers=self.on_timed_slide_interval) triggers=self.on_timed_slide_interval)
@ -787,24 +787,24 @@ class ServiceManager(QtGui.QWidget):
if serviceItem[u'service_item'].is_capable(ItemCapabilities.CanLoop) and \ if serviceItem[u'service_item'].is_capable(ItemCapabilities.CanLoop) and \
len(serviceItem[u'service_item'].get_frames()) > 1: len(serviceItem[u'service_item'].get_frames()) > 1:
self.AutoPlaySlidesGroup.menuAction().setVisible(True) self.AutoPlaySlidesGroup.menuAction().setVisible(True)
self.AutoPlaySlidesOnce\ self.auto_play_slides_once\
.setChecked(serviceItem[u'service_item'].AutoPlaySlidesOnce) .setChecked(serviceItem[u'service_item'].auto_play_slides_once)
self.AutoPlaySlidesLoop\ self.auto_play_slides_loop\
.setChecked(serviceItem[u'service_item'].AutoPlaySlidesLoop) .setChecked(serviceItem[u'service_item'].auto_play_slides_loop)
self.TimedSlideInterval\ self.timed_slide_interval\
.setChecked(serviceItem[u'service_item'].TimedSlideInterval > 0) .setChecked(serviceItem[u'service_item'].timed_slide_interval > 0)
if serviceItem[u'service_item'].TimedSlideInterval > 0: if serviceItem[u'service_item'].timed_slide_interval > 0:
DelaySuffix = u' ' DelaySuffix = u' '
DelaySuffix += unicode(serviceItem[u'service_item'].TimedSlideInterval) DelaySuffix += unicode(serviceItem[u'service_item'].timed_slide_interval)
DelaySuffix += u' s' DelaySuffix += u' s'
else: else:
DelaySuffix = u' ...' DelaySuffix = u' ...'
self.TimedSlideInterval.setText(translate('OpenLP.ServiceManager', self.timed_slide_interval.setText(translate('OpenLP.ServiceManager',
'&Delay between slides') + DelaySuffix) '&Delay between slides') + DelaySuffix)
#self.AutoPlaySlidesGroup.setChecked( #self.AutoPlaySlidesGroup.setChecked(
# serviceItem[u'service_item'].TimedSlideInterval > 0 and # serviceItem[u'service_item'].timed_slide_interval > 0 and
# (serviceItem[u'service_item'].AutoPlaySlidesOnce or # (serviceItem[u'service_item'].auto_play_slides_once or
# serviceItem[u'service_item'].AutoPlaySlidesLoop)) # serviceItem[u'service_item'].auto_play_slides_loop))
else: else:
self.AutoPlaySlidesGroup.menuAction().setVisible(False) self.AutoPlaySlidesGroup.menuAction().setVisible(False)
if serviceItem[u'service_item']\ if serviceItem[u'service_item']\
@ -851,12 +851,12 @@ class ServiceManager(QtGui.QWidget):
""" """
item = self.findServiceItem()[0] item = self.findServiceItem()[0]
service_item = self.serviceItems[item][u'service_item'] service_item = self.serviceItems[item][u'service_item']
service_item.AutoPlaySlidesOnce = not service_item.AutoPlaySlidesOnce service_item.auto_play_slides_once = not service_item.auto_play_slides_once
if service_item.AutoPlaySlidesOnce: if service_item.auto_play_slides_once:
service_item.AutoPlaySlidesLoop = False service_item.auto_play_slides_loop = False
self.AutoPlaySlidesLoop.setChecked(False) self.auto_play_slides_loop.setChecked(False)
if service_item.AutoPlaySlidesOnce and service_item.TimedSlideInterval == 0: if service_item.auto_play_slides_once and service_item.timed_slide_interval == 0:
service_item.TimedSlideInterval = Settings().value(u'loop delay', service_item.timed_slide_interval = Settings().value(u'loop delay',
QtCore.QVariant(5)).toInt()[0] QtCore.QVariant(5)).toInt()[0]
self.setModified() self.setModified()
@ -866,12 +866,12 @@ class ServiceManager(QtGui.QWidget):
""" """
item = self.findServiceItem()[0] item = self.findServiceItem()[0]
service_item = self.serviceItems[item][u'service_item'] service_item = self.serviceItems[item][u'service_item']
service_item.AutoPlaySlidesLoop = not service_item.AutoPlaySlidesLoop service_item.auto_play_slides_loop = not service_item.auto_play_slides_loop
if service_item.AutoPlaySlidesLoop: if service_item.auto_play_slides_loop:
service_item.AutoPlaySlidesOnce = False service_item.auto_play_slides_once = False
self.AutoPlaySlidesOnce.setChecked(False) self.auto_play_slides_once.setChecked(False)
if service_item.AutoPlaySlidesLoop and service_item.TimedSlideInterval == 0: if service_item.auto_play_slides_loop and service_item.timed_slide_interval == 0:
service_item.TimedSlideInterval = Settings().value(u'loop delay', service_item.timed_slide_interval = Settings().value(u'loop delay',
QtCore.QVariant(5)).toInt()[0] QtCore.QVariant(5)).toInt()[0]
self.setModified() self.setModified()
@ -882,24 +882,24 @@ class ServiceManager(QtGui.QWidget):
""" """
item = self.findServiceItem()[0] item = self.findServiceItem()[0]
service_item = self.serviceItems[item][u'service_item'] service_item = self.serviceItems[item][u'service_item']
if service_item.TimedSlideInterval == 0: if service_item.timed_slide_interval == 0:
TimedSlideInterval = Settings().value(u'loop delay', timed_slide_interval = Settings().value(u'loop delay',
QtCore.QVariant(5)).toInt()[0] QtCore.QVariant(5)).toInt()[0]
else: else:
TimedSlideInterval = service_item.TimedSlideInterval timed_slide_interval = service_item.timed_slide_interval
TimedSlideInterval, ok = QtGui.QInputDialog.getInteger(self, timed_slide_interval, ok = QtGui.QInputDialog.getInteger(self,
translate('OpenLP.ServiceManager', 'Input delay'), translate('OpenLP.ServiceManager', 'Input delay'),
translate('OpenLP.ServiceManager', translate('OpenLP.ServiceManager',
'Delay between slides in seconds.'), TimedSlideInterval, 0, 180, 1) 'Delay between slides in seconds.'), timed_slide_interval, 0, 180, 1)
if ok: if ok:
service_item.TimedSlideInterval = TimedSlideInterval service_item.timed_slide_interval = timed_slide_interval
if service_item.TimedSlideInterval <> 0\ if service_item.timed_slide_interval <> 0\
and not service_item.AutoPlaySlidesLoop\ and not service_item.auto_play_slides_loop\
and not service_item.AutoPlaySlidesOnce: and not service_item.auto_play_slides_once:
service_item.AutoPlaySlidesLoop = True service_item.auto_play_slides_loop = True
elif service_item.TimedSlideInterval == 0: elif service_item.timed_slide_interval == 0:
service_item.AutoPlaySlidesLoop = False service_item.auto_play_slides_loop = False
service_item.AutoPlaySlidesOnce = False service_item.auto_play_slides_once = False
self.setModified() self.setModified()
def onServiceItemEditForm(self): def onServiceItemEditForm(self):
@ -1405,8 +1405,8 @@ class ServiceManager(QtGui.QWidget):
ItemCapabilities.CanPreview): ItemCapabilities.CanPreview):
self.mainwindow.previewController.addServiceManagerItem( self.mainwindow.previewController.addServiceManagerItem(
self.serviceItems[item][u'service_item'], 0) self.serviceItems[item][u'service_item'], 0)
NextItem = self.serviceManagerList.topLevelItem(item) next_item = self.serviceManagerList.topLevelItem(item)
self.serviceManagerList.setCurrentItem(NextItem) self.serviceManagerList.setCurrentItem(next_item)
self.mainwindow.liveController.previewListWidget.setFocus() self.mainwindow.liveController.previewListWidget.setFocus()
else: else:
critical_error_message_box( critical_error_message_box(

View File

@ -778,15 +778,15 @@ class SlideController(Controller):
self.slideSelected() self.slideSelected()
else: else:
self._processItem(item, slidenum) self._processItem(item, slidenum)
if self.isLive and item.AutoPlaySlidesLoop\ if self.isLive and item.auto_play_slides_loop\
and item.TimedSlideInterval > 0: and item.timed_slide_interval > 0:
self.playSlidesLoop.setChecked(item.AutoPlaySlidesLoop) self.playSlidesLoop.setChecked(item.auto_play_slides_loop)
self.delaySpinBox.setValue(int(item.TimedSlideInterval)) self.delaySpinBox.setValue(int(item.timed_slide_interval))
self.onPlaySlidesLoop() self.onPlaySlidesLoop()
elif self.isLive and item.AutoPlaySlidesOnce\ elif self.isLive and item.auto_play_slides_once\
and item.TimedSlideInterval > 0: and item.timed_slide_interval > 0:
self.playSlidesOnce.setChecked(item.AutoPlaySlidesOnce) self.playSlidesOnce.setChecked(item.auto_play_slides_once)
self.delaySpinBox.setValue(int(item.TimedSlideInterval)) self.delaySpinBox.setValue(int(item.timed_slide_interval))
self.onPlaySlidesOnce() self.onPlaySlidesOnce()
def _processItem(self, serviceItem, slideno): def _processItem(self, serviceItem, slideno):