Fixed camelCase, indentation, extra spaces, and slide timer

This commit is contained in:
Jonathan Stafford 2012-01-15 21:11:10 +08:00
parent 01f7244db7
commit c1604b64ff
4 changed files with 88 additions and 81 deletions

View File

@ -179,36 +179,36 @@ class GeneralTab(SettingsTab):
self.rightLayout.addWidget(self.audioGroupBox) self.rightLayout.addWidget(self.audioGroupBox)
self.rightLayout.addStretch() self.rightLayout.addStretch()
# Service Item Slide Advance # Service Item Slide Advance
self.SlideGroupBox = QtGui.QGroupBox(self.rightColumn) self.slideGroupBox = QtGui.QGroupBox(self.rightColumn)
self.SlideGroupBox.setObjectName(u'SlideGroupBox') self.slideGroupBox.setObjectName(u'slideGroupBox')
self.SlideLayout = QtGui.QFormLayout(self.SlideGroupBox) self.slideLayout = QtGui.QFormLayout(self.slideGroupBox)
self.SlideLayout.setLabelAlignment( self.slideLayout.setLabelAlignment(
QtCore.Qt.AlignLeft | QtCore.Qt.AlignTop) QtCore.Qt.AlignLeft | QtCore.Qt.AlignTop)
self.SlideLayout.setFormAlignment( self.slideLayout.setFormAlignment(
QtCore.Qt.AlignLeft | QtCore.Qt.AlignTop) QtCore.Qt.AlignLeft | QtCore.Qt.AlignTop)
self.SlideLayout.setObjectName(u'SlideLayout') self.slideLayout.setObjectName(u'slideLayout')
self.EndSlideRadioButton = QtGui.QRadioButton(self.SlideGroupBox) self.endSlideRadioButton = QtGui.QRadioButton(self.slideGroupBox)
self.EndSlideRadioButton.setObjectName(u'EndSlideRadioButton') self.endSlideRadioButton.setObjectName(u'endSlideRadioButton')
self.EndSlideLabel = QtGui.QLabel(self.SlideGroupBox) self.endSlideLabel = QtGui.QLabel(self.slideGroupBox)
self.EndSlideLabel.setWordWrap(True) self.endSlideLabel.setWordWrap(True)
self.EndSlideLabel.setObjectName(u'EndSlideLabel') self.endSlideLabel.setObjectName(u'endSlideLabel')
self.SlideLayout.addRow(self.EndSlideRadioButton, self.EndSlideLabel) self.slideLayout.addRow(self.endSlideRadioButton, self.endSlideLabel)
self.WrapSlideRadioButton = QtGui.QRadioButton(self.SlideGroupBox) self.wrapSlideRadioButton = QtGui.QRadioButton(self.slideGroupBox)
self.WrapSlideRadioButton.setObjectName(u'WrapSlideRadioButton') self.wrapSlideRadioButton.setObjectName(u'wrapSlideRadioButton')
self.WrapSlideLabel = QtGui.QLabel(self.SlideGroupBox) self.wrapSlideLabel = QtGui.QLabel(self.slideGroupBox)
self.WrapSlideLabel.setWordWrap(True) self.wrapSlideLabel.setWordWrap(True)
self.WrapSlideLabel.setObjectName(u'WrapSlideLabel') self.wrapSlideLabel.setObjectName(u'wrapSlideLabel')
self.SlideLayout.addRow(self.WrapSlideRadioButton, self.slideLayout.addRow(self.wrapSlideRadioButton,
self.WrapSlideLabel) self.wrapSlideLabel)
self.NextSlideRadioButton = QtGui.QRadioButton(self.SlideGroupBox) self.nextSlideRadioButton = QtGui.QRadioButton(self.slideGroupBox)
self.NextSlideRadioButton.setChecked(True) self.nextSlideRadioButton.setChecked(True)
self.NextSlideRadioButton.setObjectName(u'NextSlideRadioButton') self.nextSlideRadioButton.setObjectName(u'nextSlideRadioButton')
self.NextSlideLabel = QtGui.QLabel(self.SlideGroupBox) self.nextSlideLabel = QtGui.QLabel(self.slideGroupBox)
self.NextSlideLabel.setWordWrap(True) self.nextSlideLabel.setWordWrap(True)
self.NextSlideLabel.setObjectName(u'NextSlideLabel') self.nextSlideLabel.setObjectName(u'nextSlideLabel')
self.SlideLayout.addRow(self.NextSlideRadioButton, self.slideLayout.addRow(self.nextSlideRadioButton,
self.NextSlideLabel) self.nextSlideLabel)
self.rightLayout.addWidget(self.SlideGroupBox) self.rightLayout.addWidget(self.slideGroupBox)
self.rightLayout.addStretch() self.rightLayout.addStretch()
# Signals and slots # Signals and slots
QtCore.QObject.connect(self.overrideCheckBox, QtCore.QObject.connect(self.overrideCheckBox,
@ -226,11 +226,11 @@ class GeneralTab(SettingsTab):
# Reload the tab, as the screen resolution/count may have changed. # Reload the tab, as the screen resolution/count may have changed.
QtCore.QObject.connect(Receiver.get_receiver(), QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'config_screen_changed'), self.load) QtCore.SIGNAL(u'config_screen_changed'), self.load)
QtCore.QObject.connect(self.EndSlideRadioButton, QtCore.QObject.connect(self.endSlideRadioButton,
QtCore.SIGNAL(u'pressed()'), self.onEndSlideButtonPressed) QtCore.SIGNAL(u'pressed()'), self.onEndSlideButtonPressed)
QtCore.QObject.connect(self.WrapSlideRadioButton, QtCore.QObject.connect(self.wrapSlideRadioButton,
QtCore.SIGNAL(u'pressed()'), self.onWrapSlideButtonPressed) QtCore.SIGNAL(u'pressed()'), self.onWrapSlideButtonPressed)
QtCore.QObject.connect(self.NextSlideRadioButton, QtCore.QObject.connect(self.nextSlideRadioButton,
QtCore.SIGNAL(u'pressed()'), self.onNextSlideButtonPressed) QtCore.SIGNAL(u'pressed()'), self.onNextSlideButtonPressed)
# Remove for now # Remove for now
self.usernameLabel.setVisible(False) self.usernameLabel.setVisible(False)
@ -291,24 +291,24 @@ class GeneralTab(SettingsTab):
self.startPausedCheckBox.setText( self.startPausedCheckBox.setText(
translate('OpenLP.GeneralTab', 'Start background audio paused')) translate('OpenLP.GeneralTab', 'Start background audio paused'))
# Slide Advance # Slide Advance
self.SlideGroupBox.setTitle( self.slideGroupBox.setTitle(
translate('OpenLP.GeneralTab', 'Service Item Slide Advance')) translate('OpenLP.GeneralTab', 'Service Item Slide Advance'))
self.EndSlideRadioButton.setText( self.endSlideRadioButton.setText(
translate('OpenLP.GeneralTab', '&End Slide')) translate('OpenLP.GeneralTab', '&End Slide'))
self.EndSlideLabel.setText( self.endSlideLabel.setText(
translate('OpenLP.GeneralTab', 'Up and down arrow keys ' translate('OpenLP.GeneralTab', 'Up and down arrow keys '
'stop at the top and bottom slides of each Service Item. ')) 'stop at the top and bottom slides of each Service Item.'))
self.WrapSlideRadioButton.setText( self.wrapSlideRadioButton.setText(
translate('OpenLP.GeneralTab', '&Wrap Slide')) translate('OpenLP.GeneralTab', '&Wrap Slide'))
self.WrapSlideLabel.setText( self.wrapSlideLabel.setText(
translate('OpenLP.GeneralTab', 'Up and down arrow keys ' translate('OpenLP.GeneralTab', 'Up and down arrow keys '
'wrap around at the top and bottom slides of each Service Item. ')) 'wrap around at the top and bottom slides of each Service Item.'))
self.NextSlideRadioButton.setText( self.nextSlideRadioButton.setText(
translate('OpenLP.GeneralTab', '&Next Slide')) translate('OpenLP.GeneralTab', '&Next Slide'))
self.NextSlideLabel.setText( self.nextSlideLabel.setText(
translate('OpenLP.GeneralTab', 'Up and down arrow keys ' translate('OpenLP.GeneralTab', 'Up and down arrow keys '
'advance to the the next or previous Service Item from the ' 'advance to the the next or previous Service Item from the '
'top and bottom slides of each Service Item. ')) 'top and bottom slides of each Service Item.'))
def load(self): def load(self):
""" """
@ -367,11 +367,11 @@ class GeneralTab(SettingsTab):
u'slide advance', QtCore.QVariant(SlideAdvance.End)).toInt()[0] u'slide advance', QtCore.QVariant(SlideAdvance.End)).toInt()[0]
settings.endGroup() settings.endGroup()
if self.slide_advance == SlideAdvance.End: if self.slide_advance == SlideAdvance.End:
self.EndSlideRadioButton.setChecked(True) self.endSlideRadioButton.setChecked(True)
elif self.slide_advance == SlideAdvance.Wrap: elif self.slide_advance == SlideAdvance.Wrap:
self.WrapSlideRadioButton.setChecked(True) self.wrapSlideRadioButton.setChecked(True)
else: else:
self.NextSlideRadioButton.setChecked(True) self.nextSlideRadioButton.setChecked(True)
def save(self): def save(self):
""" """

View File

@ -1310,16 +1310,16 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
log.debug(u'Loading QSettings') log.debug(u'Loading QSettings')
# Migrate Wrap Settings to Slide Advance Settings # Migrate Wrap Settings to Slide Advance Settings
if QtCore.QSettings().contains(self.generalSettingsSection + if QtCore.QSettings().contains(self.generalSettingsSection +
u'/enable slide loop'): u'/enable slide loop'):
if QtCore.QSettings().value(self.generalSettingsSection + if QtCore.QSettings().value(self.generalSettingsSection +
u'/enable slide loop', QtCore.QVariant(True)).toBool(): u'/enable slide loop', QtCore.QVariant(True)).toBool():
slide_advance = SlideAdvance.Wrap QtCore.QSettings().setValue(self.generalSettingsSection +
else: u'/slide advance', QtCore.QVariant(SlideAdvance.Wrap))
slide_advance = SlideAdvance.End else:
QtCore.QSettings().setValue(self.generalSettingsSection + QtCore.QSettings().setValue(self.generalSettingsSection +
u'/slide advance', QtCore.QVariant(slide_advance)) u'/slide advance', QtCore.QVariant(SlideAdvance.End))
QtCore.QSettings().remove(self.generalSettingsSection + QtCore.QSettings().remove(self.generalSettingsSection +
u'/enable slide loop') u'/enable slide loop')
settings = QtCore.QSettings() settings = QtCore.QSettings()
# Remove obsolete entries. # Remove obsolete entries.
settings.remove(u'custom slide') settings.remove(u'custom slide')

View File

@ -1164,7 +1164,7 @@ class SlideController(Controller):
rect.y(), rect.width(), rect.height()) rect.y(), rect.width(), rect.height())
self.slidePreview.setPixmap(winimg) self.slidePreview.setPixmap(winimg)
def onSlideSelectedNext(self): def onSlideSelectedNext(self, wrap=None):
""" """
Go to the next slide. Go to the next slide.
""" """
@ -1177,17 +1177,24 @@ class SlideController(Controller):
else: else:
row = self.previewListWidget.currentRow() + 1 row = self.previewListWidget.currentRow() + 1
if row == self.previewListWidget.rowCount(): if row == self.previewListWidget.rowCount():
if QtCore.QSettings().value( if wrap is None:
self.parent().generalSettingsSection + u'/slide advance', if QtCore.QSettings().value(
QtCore.QVariant(SlideAdvance.End)).toInt()[0] \ self.parent().generalSettingsSection +
== SlideAdvance.Wrap: u'/slide advance',
row = 0 QtCore.QVariant(SlideAdvance.End)).toInt()[0] \
elif QtCore.QSettings().value( == SlideAdvance.Wrap:
self.parent().generalSettingsSection + u'/slide advance', row = 0
QtCore.QVariant(SlideAdvance.End)).toInt()[0] \ elif QtCore.QSettings().value(
== SlideAdvance.Next: self.parent().generalSettingsSection +
self.serviceNext() u'/slide advance',
return QtCore.QVariant(SlideAdvance.End)).toInt()[0] \
== SlideAdvance.Next:
self.serviceNext()
return
else:
row = self.previewListWidget.rowCount() - 1
elif wrap:
row = 0
else: else:
row = self.previewListWidget.rowCount() - 1 row = self.previewListWidget.rowCount() - 1
self.__checkUpdateSelectedSlide(row) self.__checkUpdateSelectedSlide(row)
@ -1207,16 +1214,16 @@ class SlideController(Controller):
row = self.previewListWidget.currentRow() - 1 row = self.previewListWidget.currentRow() - 1
if row == -1: if row == -1:
if QtCore.QSettings().value( if QtCore.QSettings().value(
self.parent().generalSettingsSection + u'/slide advance', self.parent().generalSettingsSection + u'/slide advance',
QtCore.QVariant(SlideAdvance.End)).toInt()[0] \ QtCore.QVariant(SlideAdvance.End)).toInt()[0] \
== SlideAdvance.Wrap: == SlideAdvance.Wrap:
row = self.previewListWidget.rowCount() - 1 row = self.previewListWidget.rowCount() - 1
elif QtCore.QSettings().value( elif QtCore.QSettings().value(
self.parent().generalSettingsSection + u'/slide advance', self.parent().generalSettingsSection + u'/slide advance',
QtCore.QVariant(SlideAdvance.End)).toInt()[0] \ QtCore.QVariant(SlideAdvance.End)).toInt()[0] \
== SlideAdvance.Next: == SlideAdvance.Next:
self.servicePrevious() self.servicePrevious()
return return
else: else:
row = 0 row = 0
self.__checkUpdateSelectedSlide(row) self.__checkUpdateSelectedSlide(row)

View File

@ -2321,18 +2321,18 @@ To cancel the First Time Wizard completely (and not start OpenLP), press the Can
</message> </message>
<message> <message>
<location filename="openlp/core/ui/generaltab.py" line="298"/> <location filename="openlp/core/ui/generaltab.py" line="298"/>
<source>Up and down arrow keys stop at the top and bottom slides of each Service Item. </source> <source>Up and down arrow keys stop at the top and bottom slides of each Service Item.</source>
<translation>Up and down arrow keys stop at the top and bottom slides of each Service Item. </translation> <translation>Up and down arrow keys stop at the top and bottom slides of each Service Item.</translation>
</message> </message>
<message> <message>
<location filename="openlp/core/ui/generaltab.py" line="303"/> <location filename="openlp/core/ui/generaltab.py" line="303"/>
<source>Up and down arrow keys wrap around at the top and bottom slides of each Service Item. </source> <source>Up and down arrow keys wrap around at the top and bottom slides of each Service Item.</source>
<translation>Up and down arrow keys wrap around at the top and bottom slides of each Service Item. </translation> <translation>Up and down arrow keys wrap around at the top and bottom slides of each Service Item.</translation>
</message> </message>
<message> <message>
<location filename="openlp/core/ui/generaltab.py" line="308"/> <location filename="openlp/core/ui/generaltab.py" line="308"/>
<source>Up and down arrow keys advance to the the next or previous Service Item from the top and bottom slides of each Service Item. </source> <source>Up and down arrow keys advance to the the next or previous Service Item from the top and bottom slides of each Service Item.</source>
<translation>Up and down arrow keys advance to the the next or previous Service Item from the top and bottom slides of each Service Item. </translation> <translation>Up and down arrow keys advance to the the next or previous Service Item from the top and bottom slides of each Service Item.</translation>
</message> </message>
</context> </context>
<context> <context>