diff --git a/openlp.pyw b/openlp.pyw index f3455962d..a1a616462 100755 --- a/openlp.pyw +++ b/openlp.pyw @@ -182,7 +182,7 @@ class OpenLP(QtGui.QApplication): screens = ScreenList() # Decide how many screens we have and their size for screen in xrange(0, self.desktop().numScreens()): - size = self.desktop().screenGeometry(screen); + size = self.desktop().screenGeometry(screen) screens.add_screen({u'number': screen, u'size': size, u'primary': (self.desktop().primaryScreen() == screen)}) diff --git a/openlp/core/lib/__init__.py b/openlp/core/lib/__init__.py index ebbe31597..ec8cf739c 100644 --- a/openlp/core/lib/__init__.py +++ b/openlp/core/lib/__init__.py @@ -102,7 +102,8 @@ def translate(context, text, comment=None, An identifying string for when the same text is used in different roles within the same context. """ - return QtCore.QCoreApplication.translate(context, text, comment, encoding, n) + return QtCore.QCoreApplication.translate( + context, text, comment, encoding, n) def get_text_file_string(text_file): """ diff --git a/openlp/core/lib/mediamanageritem.py b/openlp/core/lib/mediamanageritem.py index c92960163..2d6bcce46 100644 --- a/openlp/core/lib/mediamanageritem.py +++ b/openlp/core/lib/mediamanageritem.py @@ -176,7 +176,8 @@ class MediaManagerItem(QtGui.QWidget): # break compatability), but it makes sense for the icon to # come before the tooltip (as you have to have an icon, but # not neccesarily a tooltip) - return self.toolbar.addToolbarButton(title, icon, tooltip, slot, checkable) + return self.toolbar.addToolbarButton(title, icon, tooltip, slot, + checkable) def addToolbarSeparator(self): """ diff --git a/openlp/core/lib/searchedit.py b/openlp/core/lib/searchedit.py index 07279aea5..c69e1f15b 100644 --- a/openlp/core/lib/searchedit.py +++ b/openlp/core/lib/searchedit.py @@ -78,7 +78,7 @@ class SearchEdit(QtGui.QLineEdit): else: self.setStyleSheet(u'QLineEdit { padding-right: %spx; } ' % \ rightPadding) - msz = self.minimumSizeHint(); + msz = self.minimumSizeHint() self.setMinimumSize( max(msz.width(), self.clearButton.width() + (frameWidth * 2) + 2), diff --git a/openlp/core/ui/filerenamedialog.py b/openlp/core/ui/filerenamedialog.py index 43bd09a4d..c9a8a7633 100644 --- a/openlp/core/ui/filerenamedialog.py +++ b/openlp/core/ui/filerenamedialog.py @@ -38,6 +38,8 @@ class Ui_FileRenameDialog(object): self.fileNameLabel.setObjectName(u'fileNameLabel') self.dialogLayout.addWidget(self.fileNameLabel, 0, 0) self.fileNameEdit = QtGui.QLineEdit(FileRenameDialog) + self.fileNameEdit.setValidator(QtGui.QRegExpValidator( + QtCore.QRegExp(r'[^/\\?*|<>\[\]":<>+%]+'), self)) self.fileNameEdit.setObjectName(u'fileNameEdit') self.dialogLayout.addWidget(self.fileNameEdit, 0, 1) self.buttonBox = QtGui.QDialogButtonBox(FileRenameDialog) diff --git a/openlp/core/ui/generaltab.py b/openlp/core/ui/generaltab.py index 15789b0d6..773637481 100644 --- a/openlp/core/ui/generaltab.py +++ b/openlp/core/ui/generaltab.py @@ -139,6 +139,7 @@ class GeneralTab(SettingsTab): self.numberLabel = QtGui.QLabel(self.ccliGroupBox) self.numberLabel.setObjectName(u'numberLabel') self.numberEdit = QtGui.QLineEdit(self.ccliGroupBox) + self.numberEdit.setValidator(QtGui.QIntValidator()) self.numberEdit.setObjectName(u'numberEdit') self.ccliLayout.addRow(self.numberLabel, self.numberEdit) self.usernameLabel = QtGui.QLabel(self.ccliGroupBox) diff --git a/openlp/core/ui/servicemanager.py b/openlp/core/ui/servicemanager.py index 3e272da47..4053aa2ef 100644 --- a/openlp/core/ui/servicemanager.py +++ b/openlp/core/ui/servicemanager.py @@ -307,7 +307,8 @@ class ServiceManager(QtGui.QWidget): Setter for service file. """ self._fileName = unicode(fileName) - self.mainwindow.setServiceModified(self.isModified, self.shortFileName()) + self.mainwindow.setServiceModified(self.isModified(), + self.shortFileName()) QtCore.QSettings(). \ setValue(u'service/last file',QtCore.QVariant(fileName)) @@ -685,7 +686,7 @@ class ServiceManager(QtGui.QWidget): # Top Item was selected so set the last one if setLastItem: lastItem.setSelected(True) - self.isModified = True + self.setModified(True) def onMoveSelectionDown(self): """ @@ -708,7 +709,7 @@ class ServiceManager(QtGui.QWidget): serviceIterator += 1 if setSelected: firstItem.setSelected(True) - self.isModified = True + self.setModified(True) def onCollapseAll(self): """ @@ -752,7 +753,7 @@ class ServiceManager(QtGui.QWidget): self.serviceItems.remove(self.serviceItems[item]) self.serviceItems.insert(0, temp) self.repaintServiceList(0, count) - self.isModified = True + self.setModified(True) def onServiceUp(self): """ @@ -985,8 +986,8 @@ class ServiceManager(QtGui.QWidget): u'expanded':expand}) self.repaintServiceList(len(self.serviceItems) + 1, 0) else: - self.serviceItems.insert(self.dropPosition, {u'service_item': item, - u'order': self.dropPosition, + self.serviceItems.insert(self.dropPosition, + {u'service_item': item, u'order': self.dropPosition, u'expanded':expand}) self.repaintServiceList(self.dropPosition, 0) # if rebuilding list make sure live is fixed. diff --git a/openlp/core/ui/settingsform.py b/openlp/core/ui/settingsform.py index 86e3c6150..068057902 100644 --- a/openlp/core/ui/settingsform.py +++ b/openlp/core/ui/settingsform.py @@ -98,4 +98,4 @@ class SettingsForm(QtGui.QDialog, Ui_SettingsDialog): Run any post-setup code for the tabs on the form """ for tabIndex in range(0, self.settingsTabWidget.count()): - self.settingsTabWidget.widget(tabIndex).postSetUp() \ No newline at end of file + self.settingsTabWidget.widget(tabIndex).postSetUp() diff --git a/openlp/core/ui/themewizard.py b/openlp/core/ui/themewizard.py index e30570903..50e8109c5 100644 --- a/openlp/core/ui/themewizard.py +++ b/openlp/core/ui/themewizard.py @@ -249,7 +249,8 @@ class Ui_ThemeWizard(object): self.footerSizeSpinBox.setMaximum(999) self.footerSizeSpinBox.setValue(10) self.footerSizeSpinBox.setObjectName(u'FooterSizeSpinBox') - self.footerAreaLayout.addRow(self.footerSizeLabel, self.footerSizeSpinBox) + self.footerAreaLayout.addRow(self.footerSizeLabel, + self.footerSizeSpinBox) ThemeWizard.addPage(self.footerAreaPage) # Alignment Page self.alignmentPage = QtGui.QWizardPage() @@ -317,9 +318,11 @@ class Ui_ThemeWizard(object): self.areaPositionLayout.addWidget(self.mainPositionGroupBox) self.footerPositionGroupBox = QtGui.QGroupBox(self.areaPositionPage) self.footerPositionGroupBox.setObjectName(u'FooterPositionGroupBox') - self.footerPositionLayout = QtGui.QFormLayout(self.footerPositionGroupBox) + self.footerPositionLayout = QtGui.QFormLayout( + self.footerPositionGroupBox) self.footerPositionLayout.setObjectName(u'FooterPositionLayout') - self.footerPositionCheckBox = QtGui.QCheckBox(self.footerPositionGroupBox) + self.footerPositionCheckBox = QtGui.QCheckBox( + self.footerPositionGroupBox) self.footerPositionCheckBox.setObjectName(u'FooterPositionCheckBox') self.footerPositionLayout.addRow(self.footerPositionCheckBox) self.footerXLabel = QtGui.QLabel(self.footerPositionGroupBox) @@ -360,6 +363,8 @@ class Ui_ThemeWizard(object): self.themeNameLabel = QtGui.QLabel(self.previewPage) self.themeNameLabel.setObjectName(u'ThemeNameLabel') self.themeNameEdit = QtGui.QLineEdit(self.previewPage) + self.themeNameEdit.setValidator(QtGui.QRegExpValidator( + QtCore.QRegExp(r'[^/\\?*|<>\[\]":<>+%]+'), self)) self.themeNameEdit.setObjectName(u'ThemeNameEdit') self.themeNameLayout.addRow(self.themeNameLabel, self.themeNameEdit) self.previewLayout.addLayout(self.themeNameLayout) diff --git a/openlp/plugins/alerts/forms/alertform.py b/openlp/plugins/alerts/forms/alertform.py index bd03b9171..1d6a566fd 100644 --- a/openlp/plugins/alerts/forms/alertform.py +++ b/openlp/plugins/alerts/forms/alertform.py @@ -177,8 +177,8 @@ class AlertForm(QtGui.QDialog, Ui_AlertDialog): 'parameter to be replaced.\nDo you want to continue anyway?'), QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.No | QtGui.QMessageBox.Yes)) == QtGui.QMessageBox.No: - self.parameterEdit.setFocus() - return False + self.parameterEdit.setFocus() + return False # The ParameterEdit field is not empty, but we have not found '<>' # in the alert text. elif text.find(u'<>') == -1 and self.parameterEdit.text() and \ @@ -188,8 +188,8 @@ class AlertForm(QtGui.QDialog, Ui_AlertDialog): ' contain \'<>\'.\nDo want to continue anyway?'), QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.No | QtGui.QMessageBox.Yes)) == QtGui.QMessageBox.No: - self.parameterEdit.setFocus() - return False + self.parameterEdit.setFocus() + return False text = text.replace(u'<>', unicode(self.parameterEdit.text())) self.parent.alertsmanager.displayAlert(text) return True diff --git a/openlp/plugins/bibles/lib/db.py b/openlp/plugins/bibles/lib/db.py index 62068437a..9f4376da1 100644 --- a/openlp/plugins/bibles/lib/db.py +++ b/openlp/plugins/bibles/lib/db.py @@ -28,7 +28,7 @@ import logging import chardet import re -from PyQt4 import QtCore, QtGui +from PyQt4 import QtCore from sqlalchemy import Column, ForeignKey, or_, Table, types from sqlalchemy.orm import class_mapper, mapper, relation from sqlalchemy.orm.exc import UnmappedClassError diff --git a/openlp/plugins/bibles/lib/http.py b/openlp/plugins/bibles/lib/http.py index 64ee6da5a..b7e3504a6 100644 --- a/openlp/plugins/bibles/lib/http.py +++ b/openlp/plugins/bibles/lib/http.py @@ -230,7 +230,10 @@ class BGExtract(object): Receiver.send_message(u'openlp_process_events') footnotes = soup.findAll(u'sup', u'footnote') if footnotes: - [footnote.extract() for footnote in footnotes] + [footnote.extract() for footnote in footnotes] + crossrefs = soup.findAll(u'sup', u'xref') + if crossrefs: + [crossref.extract() for crossref in crossrefs] cleanup = [(re.compile('\s+'), lambda match: ' ')] verses = BeautifulSoup(str(soup), markupMassage=cleanup) content = verses.find(u'div', u'result-text-style-normal') diff --git a/openlp/plugins/bibles/lib/manager.py b/openlp/plugins/bibles/lib/manager.py index 15f171608..63c6954fb 100644 --- a/openlp/plugins/bibles/lib/manager.py +++ b/openlp/plugins/bibles/lib/manager.py @@ -26,7 +26,7 @@ import logging -from PyQt4 import QtCore, QtGui +from PyQt4 import QtCore from openlp.core.lib import Receiver, SettingsManager, translate from openlp.core.utils import AppLocation @@ -273,10 +273,10 @@ class BibleManager(object): Receiver.send_message(u'openlp_information_message', { u'title': translate('BiblesPlugin.BibleManager', 'Scripture Reference Error'), - u'message': translate('BiblesPlugin.BibleManager', 'Your scripture ' - 'reference is either not supported by OpenLP or is invalid. ' - 'Please make sure your reference conforms to one of the ' - 'following patterns:\n\n' + u'message': translate('BiblesPlugin.BibleManager', + 'Your scripture reference is either not supported by OpenLP ' + 'or is invalid. Please make sure your reference conforms to ' + 'one of the following patterns:\n\n' 'Book Chapter\n' 'Book Chapter-Chapter\n' 'Book Chapter:Verse-Verse\n' diff --git a/openlp/plugins/images/lib/mediaitem.py b/openlp/plugins/images/lib/mediaitem.py index 89e27e2fb..9f6d6c6df 100644 --- a/openlp/plugins/images/lib/mediaitem.py +++ b/openlp/plugins/images/lib/mediaitem.py @@ -30,8 +30,7 @@ import os from PyQt4 import QtCore, QtGui from openlp.core.lib import MediaManagerItem, BaseListWithDnD, build_icon, \ - context_menu_action, ItemCapabilities, SettingsManager, translate, \ - check_item_selected, Receiver + ItemCapabilities, SettingsManager, translate, check_item_selected, Receiver from openlp.core.utils import AppLocation, get_images_filter log = logging.getLogger(__name__) diff --git a/openlp/plugins/media/lib/mediaitem.py b/openlp/plugins/media/lib/mediaitem.py index fd8c6c97d..cc75dfc2b 100644 --- a/openlp/plugins/media/lib/mediaitem.py +++ b/openlp/plugins/media/lib/mediaitem.py @@ -31,7 +31,7 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import MediaManagerItem, BaseListWithDnD, build_icon, \ ItemCapabilities, SettingsManager, translate, check_item_selected, \ - context_menu_action, Receiver + Receiver log = logging.getLogger(__name__) diff --git a/openlp/plugins/presentations/lib/presentationtab.py b/openlp/plugins/presentations/lib/presentationtab.py index c4df4f4e1..fc82600df 100644 --- a/openlp/plugins/presentations/lib/presentationtab.py +++ b/openlp/plugins/presentations/lib/presentationtab.py @@ -116,7 +116,8 @@ class PresentationTab(SettingsTab): if controller.available: checkbox = self.PresenterCheckboxes[controller.name] setting_key = self.settingsSection + u'/' + controller.name - if QtCore.QSettings().value(setting_key) != checkbox.checkState(): + if QtCore.QSettings().value(setting_key) != \ + checkbox.checkState(): changed = True QtCore.QSettings().setValue(setting_key, QtCore.QVariant(checkbox.checkState())) diff --git a/openlp/plugins/songs/forms/editsongdialog.py b/openlp/plugins/songs/forms/editsongdialog.py index ac74c9c4e..c0ccd5d6a 100644 --- a/openlp/plugins/songs/forms/editsongdialog.py +++ b/openlp/plugins/songs/forms/editsongdialog.py @@ -245,6 +245,7 @@ class Ui_EditSongDialog(object): self.CCLILabel.setObjectName(u'CCLILabel') self.CCLILayout.addWidget(self.CCLILabel) self.CCLNumberEdit = QtGui.QLineEdit(self.rightsGroupBox) + self.CCLNumberEdit.setValidator(QtGui.QIntValidator()) self.CCLNumberEdit.setObjectName(u'CCLNumberEdit') self.CCLILayout.addWidget(self.CCLNumberEdit) self.rightsLayout.addLayout(self.CCLILayout)