diff --git a/openlp/core/lib/mediamanageritem.py b/openlp/core/lib/mediamanageritem.py index 12f4136f6..8bfefceb0 100644 --- a/openlp/core/lib/mediamanageritem.py +++ b/openlp/core/lib/mediamanageritem.py @@ -335,8 +335,8 @@ class MediaManagerItem(QtGui.QWidget): log.info(u'New files(s) %s', unicode(files)) if files: self.loadList(files) - dir = os.path.split(unicode(files[0]))[0] - SettingsManager.set_last_dir(self.settingsSection, dir) + lastDir = os.path.split(unicode(files[0]))[0] + SettingsManager.set_last_dir(self.settingsSection, lastDir) SettingsManager.set_list(self.settingsSection, self.settingsSection, self.getFileList()) diff --git a/openlp/core/lib/renderer.py b/openlp/core/lib/renderer.py index 55c66a809..55700ebac 100644 --- a/openlp/core/lib/renderer.py +++ b/openlp/core/lib/renderer.py @@ -189,7 +189,8 @@ class Renderer(object): pos = split_text.rfind(u' ') #no more spaces and we are still too long if pos == -1: - while metrics.width(split_text, -1) > line_width: + while \ + metrics.width(split_text, -1) > line_width: split_text = split_text[:-1] pos = len(split_text) else: @@ -199,12 +200,14 @@ class Renderer(object): #if we have more text add up to 10 spaces on the front. if line and self._theme.font_main_indentation > 0: line = u'%s%s' % \ - (u' '[:int(self._theme.font_main_indentation)], line) + (u' '[:int(self._theme.font_main_indentation)], + line) #Text fits in a line now for count, line in enumerate(split_lines): page.append(line) #last but one line and only 2 lines to go or end of page - if (len(page) == page_length - 1 and len(split_lines) - 3 == count) or \ + if (len(page) == page_length - 1 and + len(split_lines) - 3 == count) or \ len(page) == page_length: split_pages.append(page) page = [] @@ -559,7 +562,8 @@ class Renderer(object): self.painter.drawText(x, rowpos, line) if self._theme.display_slideTransition: # Print 2nd image with 70% weight - if self._theme.display_outline and outline_size != 0 and not footer: + if self._theme.display_outline and outline_size != 0 and \ + not footer: path = QtGui.QPainterPath() path.addText(QtCore.QPointF(x, rowpos), font, line) self.painter2.setBrush(self.painter2.pen().brush()) diff --git a/openlp/core/lib/rendermanager.py b/openlp/core/lib/rendermanager.py index e811529db..431f74564 100644 --- a/openlp/core/lib/rendermanager.py +++ b/openlp/core/lib/rendermanager.py @@ -181,7 +181,8 @@ class RenderManager(object): footer.append(u'CCLI 123456') formatted = self.renderer.format_slide(verse, False) #Only Render the first slide page returned - return self.renderer.generate_frame_from_lines(formatted[0], footer)[u'main'] + return self.renderer.generate_frame_from_lines(formatted[0], + footer)[u'main'] def format_slide(self, words): """ diff --git a/openlp/core/lib/themexmlhandler.py b/openlp/core/lib/themexmlhandler.py index 495c8983f..a6d1ec186 100644 --- a/openlp/core/lib/themexmlhandler.py +++ b/openlp/core/lib/themexmlhandler.py @@ -366,9 +366,9 @@ class ThemeXML(object): The XML string to parse. """ theme_xml = ElementTree(element=XML(xml)) - iter = theme_xml.getiterator() + xml_iter = theme_xml.getiterator() master = u'' - for element in iter: + for element in xml_iter: element.text = unicode(element.text).decode('unicode-escape') if element.getchildren(): master = element.tag + u'_' diff --git a/openlp/core/ui/aboutdialog.py b/openlp/core/ui/aboutdialog.py index fac8874f5..9e4179072 100644 --- a/openlp/core/ui/aboutdialog.py +++ b/openlp/core/ui/aboutdialog.py @@ -132,7 +132,8 @@ class Ui_AboutDialog(object): 'consider contributing by using the button below.' )) self.AboutNotebook.setTabText( - self.AboutNotebook.indexOf(self.AboutTab), translate('AboutForm', 'About')) + self.AboutNotebook.indexOf(self.AboutTab), + translate('AboutForm', 'About')) self.CreditsTextEdit.setPlainText(translate('AboutForm', 'Project Lead\n' ' Raoul "superfly" Snyman\n' diff --git a/openlp/core/ui/amendthemedialog.py b/openlp/core/ui/amendthemedialog.py index 848f6ec72..c7a8d0531 100644 --- a/openlp/core/ui/amendthemedialog.py +++ b/openlp/core/ui/amendthemedialog.py @@ -68,45 +68,56 @@ class Ui_AmendThemeDialog(object): self.BackgroundLayout.setObjectName(u'BackgroundLayout') self.BackgroundLabel = QtGui.QLabel(self.BackgroundTab) self.BackgroundLabel.setObjectName(u'BackgroundLabel') - self.BackgroundLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.BackgroundLabel) + self.BackgroundLayout.setWidget( + 0, QtGui.QFormLayout.LabelRole, self.BackgroundLabel) self.BackgroundComboBox = QtGui.QComboBox(self.BackgroundTab) self.BackgroundComboBox.setObjectName(u'BackgroundComboBox') self.BackgroundComboBox.addItem(QtCore.QString()) self.BackgroundComboBox.addItem(QtCore.QString()) - self.BackgroundLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.BackgroundComboBox) + self.BackgroundLayout.setWidget( + 0, QtGui.QFormLayout.FieldRole, self.BackgroundComboBox) self.BackgroundTypeLabel = QtGui.QLabel(self.BackgroundTab) self.BackgroundTypeLabel.setObjectName(u'BackgroundTypeLabel') - self.BackgroundLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.BackgroundTypeLabel) + self.BackgroundLayout.setWidget( + 1, QtGui.QFormLayout.LabelRole, self.BackgroundTypeLabel) self.BackgroundTypeComboBox = QtGui.QComboBox(self.BackgroundTab) self.BackgroundTypeComboBox.setObjectName(u'BackgroundTypeComboBox') self.BackgroundTypeComboBox.addItem(QtCore.QString()) self.BackgroundTypeComboBox.addItem(QtCore.QString()) self.BackgroundTypeComboBox.addItem(QtCore.QString()) - self.BackgroundLayout.setWidget(1, QtGui.QFormLayout.FieldRole, self.BackgroundTypeComboBox) + self.BackgroundLayout.setWidget( + 1, QtGui.QFormLayout.FieldRole, self.BackgroundTypeComboBox) self.Color1Label = QtGui.QLabel(self.BackgroundTab) self.Color1Label.setObjectName(u'Color1Label') - self.BackgroundLayout.setWidget(2, QtGui.QFormLayout.LabelRole, self.Color1Label) + self.BackgroundLayout.setWidget( + 2, QtGui.QFormLayout.LabelRole, self.Color1Label) self.Color1PushButton = QtGui.QPushButton(self.BackgroundTab) self.Color1PushButton.setObjectName(u'Color1PushButton') - self.BackgroundLayout.setWidget(2, QtGui.QFormLayout.FieldRole, self.Color1PushButton) + self.BackgroundLayout.setWidget( + 2, QtGui.QFormLayout.FieldRole, self.Color1PushButton) self.Color2Label = QtGui.QLabel(self.BackgroundTab) self.Color2Label.setObjectName(u'Color2Label') - self.BackgroundLayout.setWidget(3, QtGui.QFormLayout.LabelRole, self.Color2Label) + self.BackgroundLayout.setWidget( + 3, QtGui.QFormLayout.LabelRole, self.Color2Label) self.Color2PushButton = QtGui.QPushButton(self.BackgroundTab) self.Color2PushButton.setObjectName(u'Color2PushButton') - self.BackgroundLayout.setWidget(3, QtGui.QFormLayout.FieldRole, self.Color2PushButton) + self.BackgroundLayout.setWidget( + 3, QtGui.QFormLayout.FieldRole, self.Color2PushButton) self.ImageLabel = QtGui.QLabel(self.BackgroundTab) self.ImageLabel.setObjectName(u'ImageLabel') - self.BackgroundLayout.setWidget(4, QtGui.QFormLayout.LabelRole, self.ImageLabel) + self.BackgroundLayout.setWidget( + 4, QtGui.QFormLayout.LabelRole, self.ImageLabel) self.GradientLabel = QtGui.QLabel(self.BackgroundTab) self.GradientLabel.setObjectName(u'GradientLabel') - self.BackgroundLayout.setWidget(6, QtGui.QFormLayout.LabelRole, self.GradientLabel) + self.BackgroundLayout.setWidget( + 6, QtGui.QFormLayout.LabelRole, self.GradientLabel) self.GradientComboBox = QtGui.QComboBox(self.BackgroundTab) self.GradientComboBox.setObjectName(u'GradientComboBox') self.GradientComboBox.addItem(QtCore.QString()) self.GradientComboBox.addItem(QtCore.QString()) self.GradientComboBox.addItem(QtCore.QString()) - self.BackgroundLayout.setWidget(6, QtGui.QFormLayout.FieldRole, self.GradientComboBox) + self.BackgroundLayout.setWidget( + 6, QtGui.QFormLayout.FieldRole, self.GradientComboBox) self.ImageFilenameWidget = QtGui.QWidget(self.BackgroundTab) self.ImageFilenameWidget.setObjectName(u'ImageFilenameWidget') self.horizontalLayout_2 = QtGui.QHBoxLayout(self.ImageFilenameWidget) @@ -121,7 +132,8 @@ class Ui_AmendThemeDialog(object): self.ImageToolButton.setIcon(icon1) self.ImageToolButton.setObjectName(u'ImageToolButton') self.horizontalLayout_2.addWidget(self.ImageToolButton) - self.BackgroundLayout.setWidget(4, QtGui.QFormLayout.FieldRole, self.ImageFilenameWidget) + self.BackgroundLayout.setWidget( + 4, QtGui.QFormLayout.FieldRole, self.ImageFilenameWidget) self.ThemeTabWidget.addTab(self.BackgroundTab, u'') self.FontMainTab = QtGui.QWidget() self.FontMainTab.setObjectName(u'FontMainTab') @@ -138,65 +150,88 @@ class Ui_AmendThemeDialog(object): self.FontMainGroupBox = QtGui.QGroupBox(self.MainLeftWidget) self.FontMainGroupBox.setObjectName(u'FontMainGroupBox') self.MainFontLayout = QtGui.QFormLayout(self.FontMainGroupBox) - self.MainFontLayout.setFormAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter) + self.MainFontLayout.setFormAlignment( + QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter) self.MainFontLayout.setMargin(8) self.MainFontLayout.setSpacing(8) self.MainFontLayout.setObjectName(u'MainFontLayout') self.FontMainlabel = QtGui.QLabel(self.FontMainGroupBox) self.FontMainlabel.setObjectName(u'FontMainlabel') - self.MainFontLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.FontMainlabel) + self.MainFontLayout.setWidget( + 0, QtGui.QFormLayout.LabelRole, self.FontMainlabel) self.FontMainComboBox = QtGui.QFontComboBox(self.FontMainGroupBox) self.FontMainComboBox.setObjectName(u'FontMainComboBox') - self.MainFontLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.FontMainComboBox) + self.MainFontLayout.setWidget( + 0, QtGui.QFormLayout.FieldRole, self.FontMainComboBox) self.FontMainColorLabel = QtGui.QLabel(self.FontMainGroupBox) self.FontMainColorLabel.setObjectName(u'FontMainColorLabel') - self.MainFontLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.FontMainColorLabel) + self.MainFontLayout.setWidget( + 1, QtGui.QFormLayout.LabelRole, self.FontMainColorLabel) self.FontMainColorPushButton = QtGui.QPushButton(self.FontMainGroupBox) self.FontMainColorPushButton.setObjectName(u'FontMainColorPushButton') - self.MainFontLayout.setWidget(1, QtGui.QFormLayout.FieldRole, self.FontMainColorPushButton) + self.MainFontLayout.setWidget( + 1, QtGui.QFormLayout.FieldRole, self.FontMainColorPushButton) self.FontMainSize = QtGui.QLabel(self.FontMainGroupBox) self.FontMainSize.setObjectName(u'FontMainSize') - self.MainFontLayout.setWidget(2, QtGui.QFormLayout.LabelRole, self.FontMainSize) + self.MainFontLayout.setWidget( + 2, QtGui.QFormLayout.LabelRole, self.FontMainSize) self.FontMainSizeSpinBox = QtGui.QSpinBox(self.FontMainGroupBox) - sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed) + sizePolicy = QtGui.QSizePolicy( + QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.FontMainSizeSpinBox.sizePolicy().hasHeightForWidth()) + sizePolicy.setHeightForWidth( + self.FontMainSizeSpinBox.sizePolicy().hasHeightForWidth()) self.FontMainSizeSpinBox.setSizePolicy(sizePolicy) self.FontMainSizeSpinBox.setMinimumSize(QtCore.QSize(70, 0)) self.FontMainSizeSpinBox.setProperty(u'value', QtCore.QVariant(16)) self.FontMainSizeSpinBox.setMaximum(999) self.FontMainSizeSpinBox.setObjectName(u'FontMainSizeSpinBox') - self.MainFontLayout.setWidget(2, QtGui.QFormLayout.FieldRole, self.FontMainSizeSpinBox) + self.MainFontLayout.setWidget( + 2, QtGui.QFormLayout.FieldRole, self.FontMainSizeSpinBox) self.FontMainWeightComboBox = QtGui.QComboBox(self.FontMainGroupBox) - self.FontMainWeightComboBox.setObjectName("FontMainWeightComboBox") + self.FontMainWeightComboBox.setObjectName(u'FontMainWeightComboBox') self.FontMainWeightComboBox.addItem(QtCore.QString()) self.FontMainWeightComboBox.addItem(QtCore.QString()) self.FontMainWeightComboBox.addItem(QtCore.QString()) self.FontMainWeightComboBox.addItem(QtCore.QString()) - self.MainFontLayout.setWidget(3, QtGui.QFormLayout.FieldRole, self.FontMainWeightComboBox) + self.MainFontLayout.setWidget( + 3, QtGui.QFormLayout.FieldRole, self.FontMainWeightComboBox) self.FontMainWeightLabel = QtGui.QLabel(self.FontMainGroupBox) - self.FontMainWeightLabel.setObjectName("FontMainWeightLabel") - self.MainFontLayout.setWidget(3, QtGui.QFormLayout.LabelRole, self.FontMainWeightLabel) + self.FontMainWeightLabel.setObjectName(u'FontMainWeightLabel') + self.MainFontLayout.setWidget( + 3, QtGui.QFormLayout.LabelRole, self.FontMainWeightLabel) self.MainLeftLayout.addWidget(self.FontMainGroupBox) - self.FontMainWrapLineAdjustmentLabel = QtGui.QLabel(self.FontMainGroupBox) - self.FontMainWrapLineAdjustmentLabel.setObjectName("FontMainWrapLineAdjustmentLabel") - self.MainFontLayout.setWidget(4, QtGui.QFormLayout.LabelRole, self.FontMainWrapLineAdjustmentLabel) - self.FontMainLineAdjustmentSpinBox = QtGui.QSpinBox(self.FontMainGroupBox) - self.FontMainLineAdjustmentSpinBox.setObjectName("FontMainLineAdjustmentSpinBox") + self.FontMainWrapLineAdjustmentLabel = QtGui.QLabel( + self.FontMainGroupBox) + self.FontMainWrapLineAdjustmentLabel.setObjectName( + u'FontMainWrapLineAdjustmentLabel') + self.MainFontLayout.setWidget(4, QtGui.QFormLayout.LabelRole, + self.FontMainWrapLineAdjustmentLabel) + self.FontMainLineAdjustmentSpinBox = QtGui.QSpinBox( + self.FontMainGroupBox) + self.FontMainLineAdjustmentSpinBox.setObjectName( + u'FontMainLineAdjustmentSpinBox') self.FontMainLineAdjustmentSpinBox.setMinimum(-99) - self.MainFontLayout.setWidget(4, QtGui.QFormLayout.FieldRole, self.FontMainLineAdjustmentSpinBox) + self.MainFontLayout.setWidget( + 4, QtGui.QFormLayout.FieldRole, self.FontMainLineAdjustmentSpinBox) self.FontMainWrapIndentationLabel = QtGui.QLabel(self.FontMainGroupBox) - self.FontMainWrapIndentationLabel.setObjectName("FontMainWrapIndentationLabel") - self.MainFontLayout.setWidget(5, QtGui.QFormLayout.LabelRole, self.FontMainWrapIndentationLabel) + self.FontMainWrapIndentationLabel.setObjectName( + u'FontMainWrapIndentationLabel') + self.MainFontLayout.setWidget( + 5, QtGui.QFormLayout.LabelRole, self.FontMainWrapIndentationLabel) self.FontMainLineSpacingSpinBox = QtGui.QSpinBox(self.FontMainGroupBox) - self.FontMainLineSpacingSpinBox.setObjectName("FontMainLineSpacingSpinBox") + self.FontMainLineSpacingSpinBox.setObjectName( + "FontMainLineSpacingSpinBox") self.FontMainLineSpacingSpinBox.setMaximum(10) - self.MainFontLayout.setWidget(5, QtGui.QFormLayout.FieldRole, self.FontMainLineSpacingSpinBox) + self.MainFontLayout.setWidget( + 5, QtGui.QFormLayout.FieldRole, self.FontMainLineSpacingSpinBox) self.FontMainLinesPageLabel = QtGui.QLabel(self.FontMainGroupBox) - self.FontMainLinesPageLabel.setObjectName("FontMainLinesPageLabel") - self.MainFontLayout.setWidget(6, QtGui.QFormLayout.LabelRole, self.FontMainLinesPageLabel) - spacerItem1 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) + self.FontMainLinesPageLabel.setObjectName(u'FontMainLinesPageLabel') + self.MainFontLayout.setWidget( + 6, QtGui.QFormLayout.LabelRole, self.FontMainLinesPageLabel) + spacerItem1 = QtGui.QSpacerItem( + 20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) self.MainLeftLayout.addItem(spacerItem1) self.FontMainLayout.addWidget(self.MainLeftWidget) self.MainRightWidget = QtGui.QWidget(self.FontMainTab) @@ -213,66 +248,86 @@ class Ui_AmendThemeDialog(object): self.MainLocationLayout.setObjectName(u'MainLocationLayout') self.DefaultLocationLabel = QtGui.QLabel(self.MainLocationGroupBox) self.DefaultLocationLabel.setObjectName(u'DefaultLocationLabel') - self.MainLocationLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.DefaultLocationLabel) - self.FontMainDefaultCheckBox = QtGui.QCheckBox(self.MainLocationGroupBox) + self.MainLocationLayout.setWidget( + 0, QtGui.QFormLayout.LabelRole, self.DefaultLocationLabel) + self.FontMainDefaultCheckBox = QtGui.QCheckBox( + self.MainLocationGroupBox) self.FontMainDefaultCheckBox.setTristate(False) self.FontMainDefaultCheckBox.setObjectName(u'FontMainDefaultCheckBox') - self.MainLocationLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.FontMainDefaultCheckBox) + self.MainLocationLayout.setWidget( + 0, QtGui.QFormLayout.FieldRole, self.FontMainDefaultCheckBox) self.FontMainXLabel = QtGui.QLabel(self.MainLocationGroupBox) self.FontMainXLabel.setObjectName(u'FontMainXLabel') - self.MainLocationLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.FontMainXLabel) + self.MainLocationLayout.setWidget( + 1, QtGui.QFormLayout.LabelRole, self.FontMainXLabel) self.FontMainYLabel = QtGui.QLabel(self.MainLocationGroupBox) self.FontMainYLabel.setObjectName(u'FontMainYLabel') - self.MainLocationLayout.setWidget(2, QtGui.QFormLayout.LabelRole, self.FontMainYLabel) + self.MainLocationLayout.setWidget( + 2, QtGui.QFormLayout.LabelRole, self.FontMainYLabel) self.FontMainWidthLabel = QtGui.QLabel(self.MainLocationGroupBox) self.FontMainWidthLabel.setObjectName(u'FontMainWidthLabel') - self.MainLocationLayout.setWidget(3, QtGui.QFormLayout.LabelRole, self.FontMainWidthLabel) + self.MainLocationLayout.setWidget( + 3, QtGui.QFormLayout.LabelRole, self.FontMainWidthLabel) self.FontMainHeightLabel = QtGui.QLabel(self.MainLocationGroupBox) self.FontMainHeightLabel.setObjectName(u'FontMainHeightLabel') - self.MainLocationLayout.setWidget(4, QtGui.QFormLayout.LabelRole, self.FontMainHeightLabel) + self.MainLocationLayout.setWidget( + 4, QtGui.QFormLayout.LabelRole, self.FontMainHeightLabel) self.FontMainXSpinBox = QtGui.QSpinBox(self.MainLocationGroupBox) - sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed) + sizePolicy = QtGui.QSizePolicy( + QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.FontMainXSpinBox.sizePolicy().hasHeightForWidth()) + sizePolicy.setHeightForWidth( + self.FontMainXSpinBox.sizePolicy().hasHeightForWidth()) self.FontMainXSpinBox.setSizePolicy(sizePolicy) self.FontMainXSpinBox.setMinimumSize(QtCore.QSize(78, 0)) self.FontMainXSpinBox.setProperty(u'value', QtCore.QVariant(0)) self.FontMainXSpinBox.setMaximum(9999) self.FontMainXSpinBox.setObjectName(u'FontMainXSpinBox') - self.MainLocationLayout.setWidget(1, QtGui.QFormLayout.FieldRole, self.FontMainXSpinBox) + self.MainLocationLayout.setWidget( + 1, QtGui.QFormLayout.FieldRole, self.FontMainXSpinBox) self.FontMainYSpinBox = QtGui.QSpinBox(self.MainLocationGroupBox) - sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed) + sizePolicy = QtGui.QSizePolicy( + QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.FontMainYSpinBox.sizePolicy().hasHeightForWidth()) + sizePolicy.setHeightForWidth( + self.FontMainYSpinBox.sizePolicy().hasHeightForWidth()) self.FontMainYSpinBox.setSizePolicy(sizePolicy) self.FontMainYSpinBox.setMinimumSize(QtCore.QSize(78, 0)) self.FontMainYSpinBox.setMaximum(9999) self.FontMainYSpinBox.setObjectName(u'FontMainYSpinBox') - self.MainLocationLayout.setWidget(2, QtGui.QFormLayout.FieldRole, self.FontMainYSpinBox) + self.MainLocationLayout.setWidget( + 2, QtGui.QFormLayout.FieldRole, self.FontMainYSpinBox) self.FontMainWidthSpinBox = QtGui.QSpinBox(self.MainLocationGroupBox) - sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed) + sizePolicy = QtGui.QSizePolicy( + QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.FontMainWidthSpinBox.sizePolicy().hasHeightForWidth()) + sizePolicy.setHeightForWidth( + self.FontMainWidthSpinBox.sizePolicy().hasHeightForWidth()) self.FontMainWidthSpinBox.setSizePolicy(sizePolicy) self.FontMainWidthSpinBox.setMinimumSize(QtCore.QSize(78, 0)) self.FontMainWidthSpinBox.setMaximum(9999) self.FontMainWidthSpinBox.setObjectName(u'FontMainWidthSpinBox') - self.MainLocationLayout.setWidget(3, QtGui.QFormLayout.FieldRole, self.FontMainWidthSpinBox) + self.MainLocationLayout.setWidget( + 3, QtGui.QFormLayout.FieldRole, self.FontMainWidthSpinBox) self.FontMainHeightSpinBox = QtGui.QSpinBox(self.MainLocationGroupBox) - sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed) + sizePolicy = QtGui.QSizePolicy( + QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.FontMainHeightSpinBox.sizePolicy().hasHeightForWidth()) + sizePolicy.setHeightForWidth( + self.FontMainHeightSpinBox.sizePolicy().hasHeightForWidth()) self.FontMainHeightSpinBox.setSizePolicy(sizePolicy) self.FontMainHeightSpinBox.setMinimumSize(QtCore.QSize(78, 0)) self.FontMainHeightSpinBox.setMaximum(9999) self.FontMainHeightSpinBox.setObjectName(u'FontMainHeightSpinBox') - self.MainLocationLayout.setWidget(4, QtGui.QFormLayout.FieldRole, self.FontMainHeightSpinBox) + self.MainLocationLayout.setWidget( + 4, QtGui.QFormLayout.FieldRole, self.FontMainHeightSpinBox) self.MainRightLayout.addWidget(self.MainLocationGroupBox) - spacerItem2 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) + spacerItem2 = QtGui.QSpacerItem( + 20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) self.MainRightLayout.addItem(spacerItem2) self.FontMainLayout.addWidget(self.MainRightWidget) self.ThemeTabWidget.addTab(self.FontMainTab, u'') @@ -291,49 +346,64 @@ class Ui_AmendThemeDialog(object): self.FooterFontGroupBox = QtGui.QGroupBox(self.FooterLeftWidget) self.FooterFontGroupBox.setObjectName(u'FooterFontGroupBox') self.FooterFontLayout = QtGui.QFormLayout(self.FooterFontGroupBox) - self.FooterFontLayout.setFieldGrowthPolicy(QtGui.QFormLayout.ExpandingFieldsGrow) - self.FooterFontLayout.setFormAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter) + self.FooterFontLayout.setFieldGrowthPolicy( + QtGui.QFormLayout.ExpandingFieldsGrow) + self.FooterFontLayout.setFormAlignment( + QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter) self.FooterFontLayout.setMargin(8) self.FooterFontLayout.setSpacing(8) self.FooterFontLayout.setObjectName(u'FooterFontLayout') self.FontFooterLabel = QtGui.QLabel(self.FooterFontGroupBox) self.FontFooterLabel.setObjectName(u'FontFooterLabel') - self.FooterFontLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.FontFooterLabel) + self.FooterFontLayout.setWidget( + 0, QtGui.QFormLayout.LabelRole, self.FontFooterLabel) self.FontFooterComboBox = QtGui.QFontComboBox(self.FooterFontGroupBox) self.FontFooterComboBox.setObjectName(u'FontFooterComboBox') - self.FooterFontLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.FontFooterComboBox) + self.FooterFontLayout.setWidget( + 0, QtGui.QFormLayout.FieldRole, self.FontFooterComboBox) self.FontFooterColorLabel = QtGui.QLabel(self.FooterFontGroupBox) self.FontFooterColorLabel.setObjectName(u'FontFooterColorLabel') - self.FooterFontLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.FontFooterColorLabel) - self.FontFooterColorPushButton = QtGui.QPushButton(self.FooterFontGroupBox) - self.FontFooterColorPushButton.setObjectName(u'FontFooterColorPushButton') - self.FooterFontLayout.setWidget(1, QtGui.QFormLayout.FieldRole, self.FontFooterColorPushButton) + self.FooterFontLayout.setWidget( + 1, QtGui.QFormLayout.LabelRole, self.FontFooterColorLabel) + self.FontFooterColorPushButton = QtGui.QPushButton( + self.FooterFontGroupBox) + self.FontFooterColorPushButton.setObjectName( + u'FontFooterColorPushButton') + self.FooterFontLayout.setWidget( + 1, QtGui.QFormLayout.FieldRole, self.FontFooterColorPushButton) self.FontFooterSizeLabel = QtGui.QLabel(self.FooterFontGroupBox) self.FontFooterSizeLabel.setObjectName(u'FontFooterSizeLabel') - self.FooterFontLayout.setWidget(2, QtGui.QFormLayout.LabelRole, self.FontFooterSizeLabel) + self.FooterFontLayout.setWidget( + 2, QtGui.QFormLayout.LabelRole, self.FontFooterSizeLabel) self.FontFooterSizeSpinBox = QtGui.QSpinBox(self.FooterFontGroupBox) - sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed) + sizePolicy = QtGui.QSizePolicy( + QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.FontFooterSizeSpinBox.sizePolicy().hasHeightForWidth()) + sizePolicy.setHeightForWidth( + self.FontFooterSizeSpinBox.sizePolicy().hasHeightForWidth()) self.FontFooterSizeSpinBox.setSizePolicy(sizePolicy) self.FontFooterSizeSpinBox.setMinimumSize(QtCore.QSize(70, 0)) self.FontFooterSizeSpinBox.setProperty(u'value', QtCore.QVariant(10)) self.FontFooterSizeSpinBox.setMaximum(999) self.FontFooterSizeSpinBox.setObjectName(u'FontFooterSizeSpinBox') - self.FooterFontLayout.setWidget(2, QtGui.QFormLayout.FieldRole, self.FontFooterSizeSpinBox) + self.FooterFontLayout.setWidget( + 2, QtGui.QFormLayout.FieldRole, self.FontFooterSizeSpinBox) self.FontFooterWeightComboBox = QtGui.QComboBox(self.FooterFontGroupBox) - self.FontFooterWeightComboBox.setObjectName("FontFooterWeightComboBox") + self.FontFooterWeightComboBox.setObjectName(u'FontFooterWeightComboBox') self.FontFooterWeightComboBox.addItem(QtCore.QString()) self.FontFooterWeightComboBox.addItem(QtCore.QString()) self.FontFooterWeightComboBox.addItem(QtCore.QString()) self.FontFooterWeightComboBox.addItem(QtCore.QString()) - self.FooterFontLayout.setWidget(3, QtGui.QFormLayout.FieldRole, self.FontFooterWeightComboBox) + self.FooterFontLayout.setWidget( + 3, QtGui.QFormLayout.FieldRole, self.FontFooterWeightComboBox) self.FontFooterWeightLabel = QtGui.QLabel(self.FooterFontGroupBox) - self.FontFooterWeightLabel.setObjectName("FontFooterWeightLabel") - self.FooterFontLayout.setWidget(3, QtGui.QFormLayout.LabelRole, self.FontFooterWeightLabel) + self.FontFooterWeightLabel.setObjectName(u'FontFooterWeightLabel') + self.FooterFontLayout.setWidget( + 3, QtGui.QFormLayout.LabelRole, self.FontFooterWeightLabel) self.FooterLeftLayout.addWidget(self.FooterFontGroupBox) - spacerItem3 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) + spacerItem3 = QtGui.QSpacerItem( + 20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) self.FooterLeftLayout.addItem(spacerItem3) self.FontFooterLayout.addWidget(self.FooterLeftWidget) self.FooterRightWidget = QtGui.QWidget(self.FontFooterTab) @@ -344,65 +414,87 @@ class Ui_AmendThemeDialog(object): self.FooterRightLayout.setObjectName(u'FooterRightLayout') self.LocationFooterGroupBox = QtGui.QGroupBox(self.FooterRightWidget) self.LocationFooterGroupBox.setObjectName(u'LocationFooterGroupBox') - self.LocationFooterLayout = QtGui.QFormLayout(self.LocationFooterGroupBox) - self.LocationFooterLayout.setFieldGrowthPolicy(QtGui.QFormLayout.ExpandingFieldsGrow) - self.LocationFooterLayout.setFormAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter) + self.LocationFooterLayout = QtGui.QFormLayout( + self.LocationFooterGroupBox) + self.LocationFooterLayout.setFieldGrowthPolicy( + QtGui.QFormLayout.ExpandingFieldsGrow) + self.LocationFooterLayout.setFormAlignment( + QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter) self.LocationFooterLayout.setMargin(8) self.LocationFooterLayout.setSpacing(8) self.LocationFooterLayout.setObjectName(u'LocationFooterLayout') self.FontFooterDefaultLabel = QtGui.QLabel(self.LocationFooterGroupBox) self.FontFooterDefaultLabel.setObjectName(u'FontFooterDefaultLabel') - self.LocationFooterLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.FontFooterDefaultLabel) - self.FontFooterDefaultCheckBox = QtGui.QCheckBox(self.LocationFooterGroupBox) + self.LocationFooterLayout.setWidget( + 0, QtGui.QFormLayout.LabelRole, self.FontFooterDefaultLabel) + self.FontFooterDefaultCheckBox = QtGui.QCheckBox( + self.LocationFooterGroupBox) self.FontFooterDefaultCheckBox.setTristate(False) - self.FontFooterDefaultCheckBox.setObjectName(u'FontFooterDefaultCheckBox') - self.LocationFooterLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.FontFooterDefaultCheckBox) + self.FontFooterDefaultCheckBox.setObjectName( + u'FontFooterDefaultCheckBox') + self.LocationFooterLayout.setWidget( + 0, QtGui.QFormLayout.FieldRole, self.FontFooterDefaultCheckBox) self.FontFooterXLabel = QtGui.QLabel(self.LocationFooterGroupBox) self.FontFooterXLabel.setObjectName(u'FontFooterXLabel') - self.LocationFooterLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.FontFooterXLabel) + self.LocationFooterLayout.setWidget( + 1, QtGui.QFormLayout.LabelRole, self.FontFooterXLabel) self.FontFooterYLabel = QtGui.QLabel(self.LocationFooterGroupBox) self.FontFooterYLabel.setObjectName(u'FontFooterYLabel') - self.LocationFooterLayout.setWidget(2, QtGui.QFormLayout.LabelRole, self.FontFooterYLabel) + self.LocationFooterLayout.setWidget( + 2, QtGui.QFormLayout.LabelRole, self.FontFooterYLabel) self.FontFooterWidthLabel = QtGui.QLabel(self.LocationFooterGroupBox) self.FontFooterWidthLabel.setObjectName(u'FontFooterWidthLabel') - self.LocationFooterLayout.setWidget(3, QtGui.QFormLayout.LabelRole, self.FontFooterWidthLabel) + self.LocationFooterLayout.setWidget( + 3, QtGui.QFormLayout.LabelRole, self.FontFooterWidthLabel) self.FontFooterHeightLabel = QtGui.QLabel(self.LocationFooterGroupBox) self.FontFooterHeightLabel.setObjectName(u'FontFooterHeightLabel') - self.LocationFooterLayout.setWidget(4, QtGui.QFormLayout.LabelRole, self.FontFooterHeightLabel) + self.LocationFooterLayout.setWidget( + 4, QtGui.QFormLayout.LabelRole, self.FontFooterHeightLabel) self.FontFooterXSpinBox = QtGui.QSpinBox(self.LocationFooterGroupBox) - sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed) + sizePolicy = QtGui.QSizePolicy( + QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.FontFooterXSpinBox.sizePolicy().hasHeightForWidth()) + sizePolicy.setHeightForWidth( + self.FontFooterXSpinBox.sizePolicy().hasHeightForWidth()) self.FontFooterXSpinBox.setSizePolicy(sizePolicy) self.FontFooterXSpinBox.setMinimumSize(QtCore.QSize(78, 0)) self.FontFooterXSpinBox.setProperty(u'value', QtCore.QVariant(0)) self.FontFooterXSpinBox.setMaximum(9999) self.FontFooterXSpinBox.setObjectName(u'FontFooterXSpinBox') - self.LocationFooterLayout.setWidget(1, QtGui.QFormLayout.FieldRole, self.FontFooterXSpinBox) + self.LocationFooterLayout.setWidget( + 1, QtGui.QFormLayout.FieldRole, self.FontFooterXSpinBox) self.FontFooterYSpinBox = QtGui.QSpinBox(self.LocationFooterGroupBox) - sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed) + sizePolicy = QtGui.QSizePolicy( + QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.FontFooterYSpinBox.sizePolicy().hasHeightForWidth()) + sizePolicy.setHeightForWidth( + self.FontFooterYSpinBox.sizePolicy().hasHeightForWidth()) self.FontFooterYSpinBox.setSizePolicy(sizePolicy) self.FontFooterYSpinBox.setMinimumSize(QtCore.QSize(78, 0)) self.FontFooterYSpinBox.setProperty(u'value', QtCore.QVariant(0)) self.FontFooterYSpinBox.setMaximum(9999) self.FontFooterYSpinBox.setObjectName(u'FontFooterYSpinBox') - self.LocationFooterLayout.setWidget(2, QtGui.QFormLayout.FieldRole, self.FontFooterYSpinBox) - self.FontFooterWidthSpinBox = QtGui.QSpinBox(self.LocationFooterGroupBox) + self.LocationFooterLayout.setWidget( + 2, QtGui.QFormLayout.FieldRole, self.FontFooterYSpinBox) + self.FontFooterWidthSpinBox = QtGui.QSpinBox( + self.LocationFooterGroupBox) self.FontFooterWidthSpinBox.setMinimumSize(QtCore.QSize(78, 0)) self.FontFooterWidthSpinBox.setMaximum(9999) self.FontFooterWidthSpinBox.setObjectName(u'FontFooterWidthSpinBox') - self.LocationFooterLayout.setWidget(3, QtGui.QFormLayout.FieldRole, self.FontFooterWidthSpinBox) - self.FontFooterHeightSpinBox = QtGui.QSpinBox(self.LocationFooterGroupBox) + self.LocationFooterLayout.setWidget( + 3, QtGui.QFormLayout.FieldRole, self.FontFooterWidthSpinBox) + self.FontFooterHeightSpinBox = QtGui.QSpinBox( + self.LocationFooterGroupBox) self.FontFooterHeightSpinBox.setMinimumSize(QtCore.QSize(78, 0)) self.FontFooterHeightSpinBox.setMaximum(9999) self.FontFooterHeightSpinBox.setObjectName(u'FontFooterHeightSpinBox') - self.LocationFooterLayout.setWidget(4, QtGui.QFormLayout.FieldRole, self.FontFooterHeightSpinBox) + self.LocationFooterLayout.setWidget( + 4, QtGui.QFormLayout.FieldRole, self.FontFooterHeightSpinBox) self.FooterRightLayout.addWidget(self.LocationFooterGroupBox) - spacerItem4 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) + spacerItem4 = QtGui.QSpacerItem( + 20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) self.FooterRightLayout.addItem(spacerItem4) self.FontFooterLayout.addWidget(self.FooterRightWidget) self.ThemeTabWidget.addTab(self.FontFooterTab, u'') @@ -432,23 +524,29 @@ class Ui_AmendThemeDialog(object): self.OutlineLayout.setObjectName(u'OutlineLayout') self.OutlineCheckBox = QtGui.QCheckBox(self.OutlineWidget) self.OutlineCheckBox.setObjectName(u'OutlineCheckBox') - self.OutlineLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.OutlineCheckBox) + self.OutlineLayout.setWidget( + 0, QtGui.QFormLayout.FieldRole, self.OutlineCheckBox) self.OutlineSpinBox = QtGui.QSpinBox(self.OutlineWidget) - self.OutlineSpinBox.setObjectName("OutlineSpinBox") + self.OutlineSpinBox.setObjectName(u'OutlineSpinBox') self.OutlineSpinBox.setMaximum(10) - self.OutlineLayout.setWidget(1, QtGui.QFormLayout.FieldRole, self.OutlineSpinBox) + self.OutlineLayout.setWidget( + 1, QtGui.QFormLayout.FieldRole, self.OutlineSpinBox) self.OutlineSpinBoxLabel = QtGui.QLabel(self.OutlineWidget) self.OutlineSpinBoxLabel.setObjectName(u'OutlineSpinBoxLabel') - self.OutlineLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.OutlineSpinBoxLabel) + self.OutlineLayout.setWidget( + 1, QtGui.QFormLayout.LabelRole, self.OutlineSpinBoxLabel) self.OutlineColorLabel = QtGui.QLabel(self.OutlineWidget) self.OutlineColorLabel.setObjectName(u'OutlineColorLabel') - self.OutlineLayout.setWidget(2, QtGui.QFormLayout.LabelRole, self.OutlineColorLabel) + self.OutlineLayout.setWidget( + 2, QtGui.QFormLayout.LabelRole, self.OutlineColorLabel) self.OutlineColorPushButton = QtGui.QPushButton(self.OutlineWidget) self.OutlineColorPushButton.setObjectName(u'OutlineColorPushButton') - self.OutlineLayout.setWidget(2, QtGui.QFormLayout.FieldRole, self.OutlineColorPushButton) + self.OutlineLayout.setWidget( + 2, QtGui.QFormLayout.FieldRole, self.OutlineColorPushButton) self.OutlineEnabledLabel = QtGui.QLabel(self.OutlineWidget) self.OutlineEnabledLabel.setObjectName(u'OutlineEnabledLabel') - self.OutlineLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.OutlineEnabledLabel) + self.OutlineLayout.setWidget( + 0, QtGui.QFormLayout.LabelRole, self.OutlineEnabledLabel) self.verticalLayout.addWidget(self.OutlineWidget) self.OptionsLeftLayout.addWidget(self.OutlineGroupBox) self.ShadowGroupBox = QtGui.QGroupBox(self.OptionsLeftWidget) @@ -465,26 +563,33 @@ class Ui_AmendThemeDialog(object): self.ShadowLayout.setObjectName(u'ShadowLayout') self.ShadowCheckBox = QtGui.QCheckBox(self.ShadowWidget) self.ShadowCheckBox.setObjectName(u'ShadowCheckBox') - self.ShadowLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.ShadowCheckBox) + self.ShadowLayout.setWidget( + 0, QtGui.QFormLayout.FieldRole, self.ShadowCheckBox) self.ShadowSpinBox = QtGui.QSpinBox(self.OutlineWidget) - self.ShadowSpinBox.setObjectName("ShadowSpinBox") + self.ShadowSpinBox.setObjectName(u'ShadowSpinBox') self.ShadowSpinBox.setMaximum(10) - self.ShadowLayout.setWidget(1, QtGui.QFormLayout.FieldRole, self.ShadowSpinBox) + self.ShadowLayout.setWidget( + 1, QtGui.QFormLayout.FieldRole, self.ShadowSpinBox) self.ShadowSpinBoxLabel = QtGui.QLabel(self.OutlineWidget) self.ShadowSpinBoxLabel.setObjectName(u'ShadowSpinBoxLabel') - self.ShadowLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.ShadowSpinBoxLabel) + self.ShadowLayout.setWidget( + 1, QtGui.QFormLayout.LabelRole, self.ShadowSpinBoxLabel) self.ShadowColorLabel = QtGui.QLabel(self.ShadowWidget) self.ShadowColorLabel.setObjectName(u'ShadowColorLabel') - self.ShadowLayout.setWidget(2, QtGui.QFormLayout.LabelRole, self.ShadowColorLabel) + self.ShadowLayout.setWidget( + 2, QtGui.QFormLayout.LabelRole, self.ShadowColorLabel) self.ShadowColorPushButton = QtGui.QPushButton(self.ShadowWidget) self.ShadowColorPushButton.setObjectName(u'ShadowColorPushButton') - self.ShadowLayout.setWidget(2, QtGui.QFormLayout.FieldRole, self.ShadowColorPushButton) + self.ShadowLayout.setWidget( + 2, QtGui.QFormLayout.FieldRole, self.ShadowColorPushButton) self.ShadowEnabledLabel = QtGui.QLabel(self.ShadowWidget) self.ShadowEnabledLabel.setObjectName(u'ShadowEnabledLabel') - self.ShadowLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.ShadowEnabledLabel) + self.ShadowLayout.setWidget( + 0, QtGui.QFormLayout.LabelRole, self.ShadowEnabledLabel) self.verticalLayout.addWidget(self.ShadowWidget) self.OptionsLeftLayout.addWidget(self.ShadowGroupBox) - spacerItem5 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) + spacerItem5 = QtGui.QSpacerItem( + 20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) self.OptionsLeftLayout.addItem(spacerItem5) self.OtherOptionsLayout.addWidget(self.OptionsLeftWidget) self.OptionsRightWidget = QtGui.QWidget(self.OtherOptionsTab) @@ -520,14 +625,18 @@ class Ui_AmendThemeDialog(object): self.TransitionGroupBox.setObjectName(u'TransitionGroupBox') self.gridLayout_5 = QtGui.QGridLayout(self.TransitionGroupBox) self.gridLayout_5.setObjectName(u'gridLayout_5') - self.SlideTransitionCheckedBoxLabel = QtGui.QLabel(self.TransitionGroupBox) - self.SlideTransitionCheckedBoxLabel.setObjectName(u'SlideTransitionCheckedBoxLabel') - self.gridLayout_5.addWidget(self.SlideTransitionCheckedBoxLabel, 0, 0, 1, 1) + self.SlideTransitionCheckedBoxLabel = QtGui.QLabel( + self.TransitionGroupBox) + self.SlideTransitionCheckedBoxLabel.setObjectName( + u'SlideTransitionCheckedBoxLabel') + self.gridLayout_5.addWidget( + self.SlideTransitionCheckedBoxLabel, 0, 0, 1, 1) self.SlideTransitionCheckedBox = QtGui.QCheckBox(self.AlignmentGroupBox) self.SlideTransitionCheckedBox.setTristate(False) self.gridLayout_5.addWidget(self.SlideTransitionCheckedBox, 0, 1, 1, 1) self.OptionsRightLayout.addWidget(self.TransitionGroupBox) - spacerItem6 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) + spacerItem6 = QtGui.QSpacerItem( + 20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) self.OptionsRightLayout.addItem(spacerItem6) self.OtherOptionsLayout.addWidget(self.OptionsRightWidget) self.ThemeTabWidget.addTab(self.OtherOptionsTab, u'') @@ -539,13 +648,16 @@ class Ui_AmendThemeDialog(object): self.ThemePreviewLayout.setSpacing(8) self.ThemePreviewLayout.setMargin(8) self.ThemePreviewLayout.setObjectName(u'ThemePreviewLayout') - spacerItem7 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding) + spacerItem7 = QtGui.QSpacerItem( + 40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding) self.ThemePreviewLayout.addItem(spacerItem7) self.ThemePreview = QtGui.QLabel(self.PreviewGroupBox) - sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed) + sizePolicy = QtGui.QSizePolicy( + QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.ThemePreview.sizePolicy().hasHeightForWidth()) + sizePolicy.setHeightForWidth( + self.ThemePreview.sizePolicy().hasHeightForWidth()) self.ThemePreview.setSizePolicy(sizePolicy) self.ThemePreview.setMaximumSize(QtCore.QSize(300, 225)) self.ThemePreview.setFrameShape(QtGui.QFrame.WinPanel) @@ -554,88 +666,142 @@ class Ui_AmendThemeDialog(object): self.ThemePreview.setScaledContents(True) self.ThemePreview.setObjectName(u'ThemePreview') self.ThemePreviewLayout.addWidget(self.ThemePreview) - spacerItem8 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding) + spacerItem8 = QtGui.QSpacerItem( + 40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding) self.ThemePreviewLayout.addItem(spacerItem8) self.AmendThemeLayout.addWidget(self.PreviewGroupBox) self.ThemeButtonBox = QtGui.QDialogButtonBox(AmendThemeDialog) - self.ThemeButtonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok) + self.ThemeButtonBox.setStandardButtons( + QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok) self.ThemeButtonBox.setObjectName(u'ThemeButtonBox') self.AmendThemeLayout.addWidget(self.ThemeButtonBox) self.retranslateUi(AmendThemeDialog) self.ThemeTabWidget.setCurrentIndex(0) - QtCore.QObject.connect(self.ThemeButtonBox, QtCore.SIGNAL(u'accepted()'), AmendThemeDialog.accept) - QtCore.QObject.connect(self.ThemeButtonBox, QtCore.SIGNAL(u'rejected()'), AmendThemeDialog.reject) + QtCore.QObject.connect(self.ThemeButtonBox, + QtCore.SIGNAL(u'accepted()'), AmendThemeDialog.accept) + QtCore.QObject.connect(self.ThemeButtonBox, + QtCore.SIGNAL(u'rejected()'), AmendThemeDialog.reject) QtCore.QMetaObject.connectSlotsByName(AmendThemeDialog) AmendThemeDialog.setTabOrder(self.ThemeButtonBox, self.ThemeNameEdit) AmendThemeDialog.setTabOrder(self.ThemeNameEdit, self.ThemeTabWidget) - AmendThemeDialog.setTabOrder(self.ThemeTabWidget, self.BackgroundComboBox) - AmendThemeDialog.setTabOrder(self.BackgroundComboBox, self.BackgroundTypeComboBox) - AmendThemeDialog.setTabOrder(self.BackgroundTypeComboBox, self.Color1PushButton) - AmendThemeDialog.setTabOrder(self.Color1PushButton, self.Color2PushButton) + AmendThemeDialog.setTabOrder( + self.ThemeTabWidget, self.BackgroundComboBox) + AmendThemeDialog.setTabOrder( + self.BackgroundComboBox, self.BackgroundTypeComboBox) + AmendThemeDialog.setTabOrder( + self.BackgroundTypeComboBox, self.Color1PushButton) + AmendThemeDialog.setTabOrder( + self.Color1PushButton, self.Color2PushButton) AmendThemeDialog.setTabOrder(self.Color2PushButton, self.ImageLineEdit) AmendThemeDialog.setTabOrder(self.ImageLineEdit, self.ImageToolButton) - AmendThemeDialog.setTabOrder(self.ImageToolButton, self.GradientComboBox) - AmendThemeDialog.setTabOrder(self.GradientComboBox, self.FontMainComboBox) - AmendThemeDialog.setTabOrder(self.FontMainComboBox, self.FontMainColorPushButton) - AmendThemeDialog.setTabOrder(self.FontMainColorPushButton, self.FontMainSizeSpinBox) - AmendThemeDialog.setTabOrder(self.FontMainSizeSpinBox, self.FontMainWeightComboBox) - AmendThemeDialog.setTabOrder(self.FontMainWeightComboBox, self.FontMainLineSpacingSpinBox) - AmendThemeDialog.setTabOrder(self.FontMainLineSpacingSpinBox, self.FontMainDefaultCheckBox) - AmendThemeDialog.setTabOrder(self.FontMainDefaultCheckBox, self.FontMainXSpinBox) - AmendThemeDialog.setTabOrder(self.FontMainXSpinBox, self.FontMainYSpinBox) - AmendThemeDialog.setTabOrder(self.FontMainYSpinBox, self.FontMainWidthSpinBox) - AmendThemeDialog.setTabOrder(self.FontMainWidthSpinBox, self.FontMainHeightSpinBox) - AmendThemeDialog.setTabOrder(self.FontMainHeightSpinBox, self.FontFooterComboBox) - AmendThemeDialog.setTabOrder(self.FontFooterComboBox, self.FontFooterColorPushButton) - AmendThemeDialog.setTabOrder(self.FontFooterColorPushButton, self.FontFooterSizeSpinBox) - AmendThemeDialog.setTabOrder(self.FontFooterSizeSpinBox, self.FontFooterWeightComboBox) - AmendThemeDialog.setTabOrder(self.FontFooterWeightComboBox, self.FontFooterDefaultCheckBox) - AmendThemeDialog.setTabOrder(self.FontFooterDefaultCheckBox, self.FontFooterXSpinBox) - AmendThemeDialog.setTabOrder(self.FontFooterXSpinBox, self.FontFooterYSpinBox) - AmendThemeDialog.setTabOrder(self.FontFooterYSpinBox, self.FontFooterWidthSpinBox) - AmendThemeDialog.setTabOrder(self.FontFooterWidthSpinBox, self.FontFooterHeightSpinBox) - AmendThemeDialog.setTabOrder(self.FontFooterHeightSpinBox, self.OutlineCheckBox) - AmendThemeDialog.setTabOrder(self.OutlineCheckBox, self.OutlineColorPushButton) - AmendThemeDialog.setTabOrder(self.OutlineColorPushButton, self.ShadowCheckBox) - AmendThemeDialog.setTabOrder(self.ShadowCheckBox, self.ShadowColorPushButton) - AmendThemeDialog.setTabOrder(self.ShadowColorPushButton, self.HorizontalComboBox) - AmendThemeDialog.setTabOrder(self.HorizontalComboBox, self.VerticalComboBox) + AmendThemeDialog.setTabOrder( + self.ImageToolButton, self.GradientComboBox) + AmendThemeDialog.setTabOrder( + self.GradientComboBox, self.FontMainComboBox) + AmendThemeDialog.setTabOrder( + self.FontMainComboBox, self.FontMainColorPushButton) + AmendThemeDialog.setTabOrder( + self.FontMainColorPushButton, self.FontMainSizeSpinBox) + AmendThemeDialog.setTabOrder( + self.FontMainSizeSpinBox, self.FontMainWeightComboBox) + AmendThemeDialog.setTabOrder( + self.FontMainWeightComboBox, self.FontMainLineSpacingSpinBox) + AmendThemeDialog.setTabOrder( + self.FontMainLineSpacingSpinBox, self.FontMainDefaultCheckBox) + AmendThemeDialog.setTabOrder( + self.FontMainDefaultCheckBox, self.FontMainXSpinBox) + AmendThemeDialog.setTabOrder( + self.FontMainXSpinBox, self.FontMainYSpinBox) + AmendThemeDialog.setTabOrder( + self.FontMainYSpinBox, self.FontMainWidthSpinBox) + AmendThemeDialog.setTabOrder( + self.FontMainWidthSpinBox, self.FontMainHeightSpinBox) + AmendThemeDialog.setTabOrder( + self.FontMainHeightSpinBox, self.FontFooterComboBox) + AmendThemeDialog.setTabOrder( + self.FontFooterComboBox, self.FontFooterColorPushButton) + AmendThemeDialog.setTabOrder( + self.FontFooterColorPushButton, self.FontFooterSizeSpinBox) + AmendThemeDialog.setTabOrder( + self.FontFooterSizeSpinBox, self.FontFooterWeightComboBox) + AmendThemeDialog.setTabOrder( + self.FontFooterWeightComboBox, self.FontFooterDefaultCheckBox) + AmendThemeDialog.setTabOrder( + self.FontFooterDefaultCheckBox, self.FontFooterXSpinBox) + AmendThemeDialog.setTabOrder( + self.FontFooterXSpinBox, self.FontFooterYSpinBox) + AmendThemeDialog.setTabOrder( + self.FontFooterYSpinBox, self.FontFooterWidthSpinBox) + AmendThemeDialog.setTabOrder( + self.FontFooterWidthSpinBox, self.FontFooterHeightSpinBox) + AmendThemeDialog.setTabOrder( + self.FontFooterHeightSpinBox, self.OutlineCheckBox) + AmendThemeDialog.setTabOrder( + self.OutlineCheckBox, self.OutlineColorPushButton) + AmendThemeDialog.setTabOrder( + self.OutlineColorPushButton, self.ShadowCheckBox) + AmendThemeDialog.setTabOrder( + self.ShadowCheckBox, self.ShadowColorPushButton) + AmendThemeDialog.setTabOrder( + self.ShadowColorPushButton, self.HorizontalComboBox) + AmendThemeDialog.setTabOrder( + self.HorizontalComboBox, self.VerticalComboBox) def retranslateUi(self, AmendThemeDialog): - AmendThemeDialog.setWindowTitle(translate('AmendThemeForm', 'Theme Maintenance')) + AmendThemeDialog.setWindowTitle( + translate('AmendThemeForm', 'Theme Maintenance')) self.ThemeNameLabel.setText(translate('AmendThemeForm', 'Theme Name:')) self.BackgroundLabel.setText(translate('AmendThemeForm', 'Background:')) - self.BackgroundComboBox.setItemText(0, translate('AmendThemeForm', 'Opaque')) - self.BackgroundComboBox.setItemText(1, translate('AmendThemeForm', 'Transparent')) - self.BackgroundTypeLabel.setText(translate('AmendThemeForm', 'Background Type:')) - self.BackgroundTypeComboBox.setItemText(0, translate('AmendThemeForm', 'Solid Color')) - self.BackgroundTypeComboBox.setItemText(1, translate('AmendThemeForm', 'Gradient')) - self.BackgroundTypeComboBox.setItemText(2, translate('AmendThemeForm', 'Image')) + self.BackgroundComboBox.setItemText(0, + translate('AmendThemeForm', 'Opaque')) + self.BackgroundComboBox.setItemText(1, + translate('AmendThemeForm', 'Transparent')) + self.BackgroundTypeLabel.setText( + translate('AmendThemeForm', 'Background Type:')) + self.BackgroundTypeComboBox.setItemText(0, + translate('AmendThemeForm', 'Solid Color')) + self.BackgroundTypeComboBox.setItemText(1, + translate('AmendThemeForm', 'Gradient')) + self.BackgroundTypeComboBox.setItemText(2, + translate('AmendThemeForm', 'Image')) self.Color1Label.setText(translate('AmendThemeForm', '')) self.Color2Label.setText(translate('AmendThemeForm', '')) self.ImageLabel.setText(translate('AmendThemeForm', 'Image:')) self.GradientLabel.setText(translate('AmendThemeForm', 'Gradient :')) - self.GradientComboBox.setItemText(0, translate('AmendThemeForm', 'Horizontal')) - self.GradientComboBox.setItemText(1, translate('AmendThemeForm', 'Vertical')) - self.GradientComboBox.setItemText(2, translate('AmendThemeForm', 'Circular')) + self.GradientComboBox.setItemText(0, + translate('AmendThemeForm', 'Horizontal')) + self.GradientComboBox.setItemText(1, + translate('AmendThemeForm', 'Vertical')) + self.GradientComboBox.setItemText(2, + translate('AmendThemeForm', 'Circular')) self.ThemeTabWidget.setTabText( self.ThemeTabWidget.indexOf(self.BackgroundTab), translate('AmendThemeForm', 'Background')) self.FontMainGroupBox.setTitle(translate('AmendThemeForm', 'Main Font')) self.FontMainlabel.setText(translate('AmendThemeForm', 'Font:')) - self.FontMainColorLabel.setText(translate('AmendThemeForm', 'Font Color:')) + self.FontMainColorLabel.setText( + translate('AmendThemeForm', 'Font Color:')) self.FontMainSize.setText(translate('AmendThemeForm', 'Size:')) self.FontMainSizeSpinBox.setSuffix(translate('AmendThemeForm', 'pt')) - self.FontMainWrapIndentationLabel.setText(translate('AmendThemeForm', 'Wrap Indentation')) - self.FontMainWrapLineAdjustmentLabel.setText(translate('AmendThemeForm', 'Adjust Line Spacing')) - self.FontMainWeightComboBox.setItemText(0, translate('AmendThemeForm', 'Normal')) - self.FontMainWeightComboBox.setItemText(1, translate('AmendThemeForm', 'Bold')) - self.FontMainWeightComboBox.setItemText(2, translate('AmendThemeForm', 'Italics')) - self.FontMainWeightComboBox.setItemText(3, translate('AmendThemeForm', 'Bold/Italics')) - self.FontMainWeightLabel.setText(translate('AmendThemeForm', 'Font Weight:')) - self.MainLocationGroupBox.setTitle(translate('AmendThemeForm', 'Display Location')) - self.DefaultLocationLabel.setText(translate('AmendThemeForm', 'Use Default Location:')) + self.FontMainWrapIndentationLabel.setText( + translate('AmendThemeForm', 'Wrap Indentation')) + self.FontMainWrapLineAdjustmentLabel.setText( + translate('AmendThemeForm', 'Adjust Line Spacing')) + self.FontMainWeightComboBox.setItemText(0, + translate('AmendThemeForm', 'Normal')) + self.FontMainWeightComboBox.setItemText(1, + translate('AmendThemeForm', 'Bold')) + self.FontMainWeightComboBox.setItemText(2, + translate('AmendThemeForm', 'Italics')) + self.FontMainWeightComboBox.setItemText(3, + translate('AmendThemeForm', 'Bold/Italics')) + self.FontMainWeightLabel.setText( + translate('AmendThemeForm', 'Font Weight:')) + self.MainLocationGroupBox.setTitle( + translate('AmendThemeForm', 'Display Location')) + self.DefaultLocationLabel.setText( + translate('AmendThemeForm', 'Use Default Location:')) self.FontMainXLabel.setText(translate('AmendThemeForm', 'X Position:')) self.FontMainYLabel.setText(translate('AmendThemeForm', 'Y Position:')) self.FontMainWidthLabel.setText(translate('AmendThemeForm', 'Width:')) @@ -647,51 +813,81 @@ class Ui_AmendThemeDialog(object): self.ThemeTabWidget.setTabText( self.ThemeTabWidget.indexOf(self.FontMainTab), translate('AmendThemeForm', 'Font Main')) - self.FooterFontGroupBox.setTitle(translate('AmendThemeForm', 'Footer Font')) + self.FooterFontGroupBox.setTitle( + translate('AmendThemeForm', 'Footer Font')) self.FontFooterLabel.setText(translate('AmendThemeForm', 'Font:')) - self.FontFooterColorLabel.setText(translate('AmendThemeForm', 'Font Color:')) + self.FontFooterColorLabel.setText( + translate('AmendThemeForm', 'Font Color:')) self.FontFooterSizeLabel.setText(translate('AmendThemeForm', 'Size:')) self.FontFooterSizeSpinBox.setSuffix(translate('AmendThemeForm', 'pt')) - self.FontFooterWeightComboBox.setItemText(0, translate('AmendThemeForm', 'Normal')) - self.FontFooterWeightComboBox.setItemText(1, translate('AmendThemeForm', 'Bold')) - self.FontFooterWeightComboBox.setItemText(2, translate('AmendThemeForm', 'Italics')) - self.FontFooterWeightComboBox.setItemText(3, translate('AmendThemeForm', 'Bold/Italics')) - self.FontFooterWeightLabel.setText(translate('AmendThemeForm', 'Font Weight:')) - self.LocationFooterGroupBox.setTitle(translate('AmendThemeForm', 'Display Location')) - self.FontFooterDefaultLabel.setText(translate('AmendThemeForm', 'Use Default Location:')) - self.FontFooterXLabel.setText(translate('AmendThemeForm', 'X Position:')) - self.FontFooterYLabel.setText(translate('AmendThemeForm', 'Y Position:')) + self.FontFooterWeightComboBox.setItemText(0, + translate('AmendThemeForm', 'Normal')) + self.FontFooterWeightComboBox.setItemText(1, + translate('AmendThemeForm', 'Bold')) + self.FontFooterWeightComboBox.setItemText(2, + translate('AmendThemeForm', 'Italics')) + self.FontFooterWeightComboBox.setItemText(3, + translate('AmendThemeForm', 'Bold/Italics')) + self.FontFooterWeightLabel.setText( + translate('AmendThemeForm', 'Font Weight:')) + self.LocationFooterGroupBox.setTitle( + translate('AmendThemeForm', 'Display Location')) + self.FontFooterDefaultLabel.setText( + translate('AmendThemeForm', 'Use Default Location:')) + self.FontFooterXLabel.setText( + translate('AmendThemeForm', 'X Position:')) + self.FontFooterYLabel.setText( + translate('AmendThemeForm', 'Y Position:')) self.FontFooterWidthLabel.setText(translate('AmendThemeForm', 'Width:')) - self.FontFooterHeightLabel.setText(translate('AmendThemeForm', 'Height:')) + self.FontFooterHeightLabel.setText( + translate('AmendThemeForm', 'Height:')) self.FontFooterXSpinBox.setSuffix(translate('AmendThemeForm', 'px')) self.FontFooterYSpinBox.setSuffix(translate('AmendThemeForm', 'px')) self.FontFooterWidthSpinBox.setSuffix(translate('AmendThemeForm', 'px')) - self.FontFooterHeightSpinBox.setSuffix(translate('AmendThemeForm', 'px')) + self.FontFooterHeightSpinBox.setSuffix( + translate('AmendThemeForm', 'px')) self.ThemeTabWidget.setTabText( self.ThemeTabWidget.indexOf(self.FontFooterTab), translate('AmendThemeForm', 'Font Footer')) self.OutlineGroupBox.setTitle(translate('AmendThemeForm', 'Outline')) - self.OutlineSpinBoxLabel.setText(translate('AmendThemeForm', 'Outline Size:')) + self.OutlineSpinBoxLabel.setText( + translate('AmendThemeForm', 'Outline Size:')) self.OutlineSpinBox.setSuffix(translate('AmendThemeForm', 'px')) - self.OutlineColorLabel.setText(translate('AmendThemeForm', 'Outline Color:')) - self.OutlineEnabledLabel.setText(translate('AmendThemeForm', 'Show Outline:')) + self.OutlineColorLabel.setText( + translate('AmendThemeForm', 'Outline Color:')) + self.OutlineEnabledLabel.setText( + translate('AmendThemeForm', 'Show Outline:')) self.ShadowGroupBox.setTitle(translate('AmendThemeForm', 'Shadow')) - self.ShadowSpinBoxLabel.setText(translate('AmendThemeForm', 'Shadow Size:')) + self.ShadowSpinBoxLabel.setText( + translate('AmendThemeForm', 'Shadow Size:')) self.ShadowSpinBox.setSuffix(translate('AmendThemeForm', 'px')) - self.ShadowColorLabel.setText(translate('AmendThemeForm', 'Shadow Color:')) - self.ShadowEnabledLabel.setText(translate('AmendThemeForm', 'Show Shadow:')) - self.AlignmentGroupBox.setTitle(translate('AmendThemeForm', 'Alignment')) - self.HorizontalLabel.setText(translate('AmendThemeForm', 'Horizontal Align:')) - self.HorizontalComboBox.setItemText(0, translate('AmendThemeForm', 'Left')) - self.HorizontalComboBox.setItemText(1, translate('AmendThemeForm', 'Right')) - self.HorizontalComboBox.setItemText(2, translate('AmendThemeForm', 'Center')) - self.VerticalLabel.setText(translate('AmendThemeForm', 'Vertical Align:')) + self.ShadowColorLabel.setText( + translate('AmendThemeForm', 'Shadow Color:')) + self.ShadowEnabledLabel.setText( + translate('AmendThemeForm', 'Show Shadow:')) + self.AlignmentGroupBox.setTitle( + translate('AmendThemeForm', 'Alignment')) + self.HorizontalLabel.setText( + translate('AmendThemeForm', 'Horizontal Align:')) + self.HorizontalComboBox.setItemText(0, + translate('AmendThemeForm', 'Left')) + self.HorizontalComboBox.setItemText(1, + translate('AmendThemeForm', 'Right')) + self.HorizontalComboBox.setItemText(2, + translate('AmendThemeForm', 'Center')) + self.VerticalLabel.setText( + translate('AmendThemeForm', 'Vertical Align:')) self.VerticalComboBox.setItemText(0, translate('AmendThemeForm', 'Top')) - self.VerticalComboBox.setItemText(1, translate('AmendThemeForm', 'Middle')) - self.VerticalComboBox.setItemText(2, translate('AmendThemeForm', 'Bottom')) - self.TransitionGroupBox.setTitle(translate('AmendThemeForm', 'Slide Transition')) - self.SlideTransitionCheckedBoxLabel.setText(translate('AmendThemeForm', 'Transition Active:')) + self.VerticalComboBox.setItemText(1, + translate('AmendThemeForm', 'Middle')) + self.VerticalComboBox.setItemText(2, + translate('AmendThemeForm', 'Bottom')) + self.TransitionGroupBox.setTitle( + translate('AmendThemeForm', 'Slide Transition')) + self.SlideTransitionCheckedBoxLabel.setText( + translate('AmendThemeForm', 'Transition Active:')) self.ThemeTabWidget.setTabText( self.ThemeTabWidget.indexOf(self.OtherOptionsTab), translate('AmendThemeForm', 'Other Options')) self.PreviewGroupBox.setTitle(translate('AmendThemeForm', 'Preview')) + diff --git a/openlp/core/ui/plugindialog.py b/openlp/core/ui/plugindialog.py index e9c205e20..419a309da 100644 --- a/openlp/core/ui/plugindialog.py +++ b/openlp/core/ui/plugindialog.py @@ -100,10 +100,12 @@ class Ui_PluginViewDialog(object): def retranslateUi(self, PluginViewDialog): PluginViewDialog.setWindowTitle(translate('PluginForm', 'Plugin List')) - self.PluginInfoGroupBox.setTitle(translate('PluginForm', 'Plugin Details')) + self.PluginInfoGroupBox.setTitle( + translate('PluginForm', 'Plugin Details')) self.VersionLabel.setText(translate('PluginForm', 'Version:')) self.VersionNumberLabel.setText(translate('PluginForm', 'TextLabel')) self.AboutLabel.setText(translate('PluginForm', 'About:')) self.StatusLabel.setText(translate('PluginForm', 'Status:')) self.StatusComboBox.setItemText(0, translate('PluginForm', 'Active')) self.StatusComboBox.setItemText(1, translate('PluginForm', 'Inactive')) + diff --git a/openlp/core/ui/serviceitemeditdialog.py b/openlp/core/ui/serviceitemeditdialog.py index 467c2aed8..b71513e0b 100644 --- a/openlp/core/ui/serviceitemeditdialog.py +++ b/openlp/core/ui/serviceitemeditdialog.py @@ -67,7 +67,8 @@ class Ui_ServiceItemEditDialog(object): QtCore.QMetaObject.connectSlotsByName(ServiceItemEditDialog) def retranslateUi(self, ServiceItemEditDialog): - ServiceItemEditDialog.setWindowTitle(translate('ServiceItemEditForm', 'Service Item Maintenance')) + ServiceItemEditDialog.setWindowTitle( + translate('ServiceItemEditForm', 'Service Item Maintenance')) self.upButton.setText(translate('ServiceItemEditForm', 'Up')) self.deleteButton.setText(translate('ServiceItemEditForm', 'Delete')) self.downButton.setText(translate('ServiceItemEditForm', 'Down')) diff --git a/openlp/core/ui/servicenotedialog.py b/openlp/core/ui/servicenotedialog.py index b21adce8d..5b91f9272 100644 --- a/openlp/core/ui/servicenotedialog.py +++ b/openlp/core/ui/servicenotedialog.py @@ -39,7 +39,8 @@ class Ui_ServiceNoteEdit(object): self.textEdit.setObjectName(u'textEdit') self.verticalLayout.addWidget(self.textEdit) self.buttonBox = QtGui.QDialogButtonBox(self.widget) - self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Save) + self.buttonBox.setStandardButtons( + QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Save) self.buttonBox.setObjectName(u'buttonBox') self.verticalLayout.addWidget(self.buttonBox) @@ -47,4 +48,6 @@ class Ui_ServiceNoteEdit(object): QtCore.QMetaObject.connectSlotsByName(ServiceNoteEdit) def retranslateUi(self, ServiceNoteEdit): - ServiceNoteEdit.setWindowTitle(translate('ServiceNoteForm', 'Service Item Notes')) + ServiceNoteEdit.setWindowTitle( + translate('ServiceNoteForm', 'Service Item Notes')) + diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index f9dd89daf..292aad7b4 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -777,7 +777,8 @@ class SlideController(QtGui.QWidget): def updatePreview(self): rm = self.parent.RenderManager if not rm.screens.current[u'primary']: - # Grab now, but try again in a couple of seconds if slide change is slow + # Grab now, but try again in a couple of seconds if slide change + # is slow QtCore.QTimer.singleShot(0.5, self.grabMainDisplay) QtCore.QTimer.singleShot(2.5, self.grabMainDisplay) else: diff --git a/openlp/core/ui/thememanager.py b/openlp/core/ui/thememanager.py index 1c3d60088..1a81a8384 100644 --- a/openlp/core/ui/thememanager.py +++ b/openlp/core/ui/thememanager.py @@ -184,16 +184,14 @@ class ThemeManager(QtGui.QWidget): else: for plugin in self.parent.plugin_manager.plugins: if not plugin.can_delete_theme(theme): - QtGui.QMessageBox.critical( - self, self.trUtf8('Error'), - self.trUtf8('Theme %s is use in %s plugin' % (theme, plugin.name)), - QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok)) + QtGui.QMessageBox.critical(self, self.trUtf8('Error'), + self.trUtf8('Theme %s is use in %s plugin' % (theme, + plugin.name))) return if unicode(self.parent.ServiceManagerContents.ThemeComboBox.currentText()) == theme: - QtGui.QMessageBox.critical( - self, self.trUtf8('Error'), - self.trUtf8('Theme %s is use by Service Manager' % theme), - QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok)) + QtGui.QMessageBox.critical(self, self.trUtf8('Error'), + self.trUtf8('Theme %s is use by Service Manager' % + theme)) return self.themelist.remove(theme) th = theme + u'.png' diff --git a/openlp/plugins/alerts/forms/alertdialog.py b/openlp/plugins/alerts/forms/alertdialog.py index 2dc117655..31aa00388 100644 --- a/openlp/plugins/alerts/forms/alertdialog.py +++ b/openlp/plugins/alerts/forms/alertdialog.py @@ -31,7 +31,8 @@ class Ui_AlertDialog(object): AlertDialog.setObjectName(u'AlertDialog') AlertDialog.resize(567, 440) icon = QtGui.QIcon() - icon.addPixmap(QtGui.QPixmap(u':/icon/openlp.org-icon-32.bmp'), QtGui.QIcon.Normal, QtGui.QIcon.Off) + icon.addPixmap(QtGui.QPixmap(u':/icon/openlp.org-icon-32.bmp'), + QtGui.QIcon.Normal, QtGui.QIcon.Off) AlertDialog.setWindowIcon(icon) self.AlertDialogLayout = QtGui.QVBoxLayout(AlertDialog) self.AlertDialogLayout.setSpacing(8) @@ -42,22 +43,28 @@ class Ui_AlertDialog(object): self.AlertTextLayout.setSpacing(8) self.AlertTextLayout.setObjectName(u'AlertTextLayout') self.AlertEntryLabel = QtGui.QLabel(AlertDialog) - sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed) + sizePolicy = QtGui.QSizePolicy( + QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.AlertEntryLabel.sizePolicy().hasHeightForWidth()) + sizePolicy.setHeightForWidth( + self.AlertEntryLabel.sizePolicy().hasHeightForWidth()) self.AlertEntryLabel.setSizePolicy(sizePolicy) self.AlertEntryLabel.setObjectName(u'AlertEntryLabel') - self.AlertTextLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.AlertEntryLabel) + self.AlertTextLayout.setWidget( + 0, QtGui.QFormLayout.LabelRole, self.AlertEntryLabel) self.AlertParameter = QtGui.QLabel(AlertDialog) self.AlertParameter.setObjectName(u'AlertParameter') - self.AlertTextLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.AlertParameter) + self.AlertTextLayout.setWidget( + 1, QtGui.QFormLayout.LabelRole, self.AlertParameter) self.ParameterEdit = QtGui.QLineEdit(AlertDialog) self.ParameterEdit.setObjectName(u'ParameterEdit') - self.AlertTextLayout.setWidget(1, QtGui.QFormLayout.FieldRole, self.ParameterEdit) + self.AlertTextLayout.setWidget( + 1, QtGui.QFormLayout.FieldRole, self.ParameterEdit) self.AlertTextEdit = QtGui.QLineEdit(AlertDialog) self.AlertTextEdit.setObjectName(u'AlertTextEdit') - self.AlertTextLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.AlertTextEdit) + self.AlertTextLayout.setWidget( + 0, QtGui.QFormLayout.FieldRole, self.AlertTextEdit) self.AlertDialogLayout.addLayout(self.AlertTextLayout) self.ManagementLayout = QtGui.QHBoxLayout() self.ManagementLayout.setSpacing(8) @@ -72,24 +79,28 @@ class Ui_AlertDialog(object): self.ManageButtonLayout.setObjectName(u'ManageButtonLayout') self.NewButton = QtGui.QPushButton(AlertDialog) icon1 = QtGui.QIcon() - icon1.addPixmap(QtGui.QPixmap(u':/general/general_new.png'), QtGui.QIcon.Normal, QtGui.QIcon.Off) + icon1.addPixmap(QtGui.QPixmap(u':/general/general_new.png'), + QtGui.QIcon.Normal, QtGui.QIcon.Off) self.NewButton.setIcon(icon1) self.NewButton.setObjectName(u'NewButton') self.ManageButtonLayout.addWidget(self.NewButton) self.SaveButton = QtGui.QPushButton(AlertDialog) self.SaveButton.setEnabled(False) icon2 = QtGui.QIcon() - icon2.addPixmap(QtGui.QPixmap(u':/general/general_save.png'), QtGui.QIcon.Normal, QtGui.QIcon.Off) + icon2.addPixmap(QtGui.QPixmap(u':/general/general_save.png'), + QtGui.QIcon.Normal, QtGui.QIcon.Off) self.SaveButton.setIcon(icon2) self.SaveButton.setObjectName(u'SaveButton') self.ManageButtonLayout.addWidget(self.SaveButton) self.DeleteButton = QtGui.QPushButton(AlertDialog) icon3 = QtGui.QIcon() - icon3.addPixmap(QtGui.QPixmap(u':/general/general_delete.png'), QtGui.QIcon.Normal, QtGui.QIcon.Off) + icon3.addPixmap(QtGui.QPixmap(u':/general/general_delete.png'), + QtGui.QIcon.Normal, QtGui.QIcon.Off) self.DeleteButton.setIcon(icon3) self.DeleteButton.setObjectName(u'DeleteButton') self.ManageButtonLayout.addWidget(self.DeleteButton) - spacerItem = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) + spacerItem = QtGui.QSpacerItem( + 20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) self.ManageButtonLayout.addItem(spacerItem) self.ManagementLayout.addLayout(self.ManageButtonLayout) self.AlertDialogLayout.addLayout(self.ManagementLayout) diff --git a/openlp/plugins/bibles/forms/importwizardform.py b/openlp/plugins/bibles/forms/importwizardform.py index 011bf264a..cd9548998 100644 --- a/openlp/plugins/bibles/forms/importwizardform.py +++ b/openlp/plugins/bibles/forms/importwizardform.py @@ -317,7 +317,7 @@ class ImportWizardForm(QtGui.QWizard, Ui_BibleImportWizard): if not isinstance(name, unicode): name = unicode(name, u'utf8') self.web_bible_list[WebDownload.Crosswalk][ver] = name.strip() - except: + except IOError: log.exception(u'Crosswalk resources missing') finally: if books_file: @@ -336,8 +336,9 @@ class ImportWizardForm(QtGui.QWizard, Ui_BibleImportWizard): ver = unicode(ver, u'utf8') if not isinstance(name, unicode): name = unicode(name, u'utf8') - self.web_bible_list[WebDownload.BibleGateway][ver] = name.strip() - except: + self.web_bible_list[WebDownload.BibleGateway][ver] = \ + name.strip() + except IOError: log.exception(u'Biblegateway resources missing') finally: if books_file: diff --git a/openlp/plugins/bibles/lib/csvbible.py b/openlp/plugins/bibles/lib/csvbible.py index 54775bd35..faaccf303 100644 --- a/openlp/plugins/bibles/lib/csvbible.py +++ b/openlp/plugins/bibles/lib/csvbible.py @@ -80,7 +80,7 @@ class CSVBible(BibleDB): self.create_book(unicode(line[1], details['encoding']), line[2], int(line[0])) Receiver.send_message(u'openlp_process_events') - except: + except IOError: log.exception(u'Loading books from file failed') success = False finally: @@ -109,7 +109,7 @@ class CSVBible(BibleDB): unicode(line[3], details['encoding'])) Receiver.send_message(u'openlp_process_events') self.commit() - except: + except IOError: log.exception(u'Loading verses from file failed') success = False finally: diff --git a/openlp/plugins/bibles/lib/db.py b/openlp/plugins/bibles/lib/db.py index 79a650541..82fb9f767 100644 --- a/openlp/plugins/bibles/lib/db.py +++ b/openlp/plugins/bibles/lib/db.py @@ -123,7 +123,7 @@ class BibleDB(QtCore.QObject): try: os.remove(self.db_file) return True - except: + except OSError: return False def register(self, wizard): diff --git a/openlp/plugins/bibles/lib/http.py b/openlp/plugins/bibles/lib/http.py index 6cb7fe75b..629db0490 100644 --- a/openlp/plugins/bibles/lib/http.py +++ b/openlp/plugins/bibles/lib/http.py @@ -462,7 +462,8 @@ class HTTPBible(BibleDB): """ Return the list of books. """ - return [Book.populate(name=book['name']) for book in HTTPBooks.get_books()] + return [Book.populate(name=book['name']) + for book in HTTPBooks.get_books()] def lookup_book(self, book): """ diff --git a/openlp/plugins/bibles/lib/opensong.py b/openlp/plugins/bibles/lib/opensong.py index 048b569d0..4f42579d5 100644 --- a/openlp/plugins/bibles/lib/opensong.py +++ b/openlp/plugins/bibles/lib/opensong.py @@ -97,7 +97,7 @@ class OpenSongBible(BibleDB): QtCore.QString('%s %s %s' % (self.trUtf8('Importing'),\ db_book.name, chapter.attrib[u'n']))) self.commit() - except: + except IOError: log.exception(u'Loading bible from OpenSong file failed') success = False finally: diff --git a/openlp/plugins/bibles/lib/osis.py b/openlp/plugins/bibles/lib/osis.py index 9763ff24b..c6779c132 100644 --- a/openlp/plugins/bibles/lib/osis.py +++ b/openlp/plugins/bibles/lib/osis.py @@ -78,7 +78,7 @@ class OSISBible(BibleDB): book = line.split(u',') self.books[book[0]] = (book[1].lstrip().rstrip(), book[2].lstrip().rstrip()) - except: + except IOError: log.exception(u'OSIS bible import failed') finally: if fbibles: @@ -104,7 +104,7 @@ class OSISBible(BibleDB): try: detect_file = open(self.filename, u'r') details = chardet.detect(detect_file.read()) - except: + except IOError: log.exception(u'Failed to detect OSIS file encoding') return finally: @@ -173,7 +173,7 @@ class OSISBible(BibleDB): self.wizard.incrementProgressBar(u'Finishing import...') if match_count == 0: success = False - except: + except (ValueError, IOError): log.exception(u'Loading bible from OSIS file failed') success = False finally: @@ -185,4 +185,3 @@ class OSISBible(BibleDB): else: return success - diff --git a/openlp/plugins/custom/lib/manager.py b/openlp/plugins/custom/lib/manager.py index b5e0e8411..793cd8699 100644 --- a/openlp/plugins/custom/lib/manager.py +++ b/openlp/plugins/custom/lib/manager.py @@ -26,6 +26,7 @@ import logging from PyQt4 import QtCore +from sqlalchemy.exceptions import InvalidRequestError from openlp.core.utils import AppLocation from openlp.plugins.custom.lib.models import init_models, metadata, CustomSlide @@ -80,7 +81,7 @@ class CustomManager(object): self.session.commit() log.debug(u'Custom Slide saved') return True - except: + except InvalidRequestError: self.session.rollback() log.exception(u'Custom Slide save failed') return False @@ -104,7 +105,7 @@ class CustomManager(object): self.session.delete(customslide) self.session.commit() return True - except: + except InvalidRequestError: self.session.rollback() log.exception(u'Custom Slide deleton failed') return False diff --git a/openlp/plugins/images/lib/mediaitem.py b/openlp/plugins/images/lib/mediaitem.py index 613a5c24d..e432e5c61 100644 --- a/openlp/plugins/images/lib/mediaitem.py +++ b/openlp/plugins/images/lib/mediaitem.py @@ -117,7 +117,7 @@ class ImageMediaItem(MediaManagerItem): try: os.remove( os.path.join(self.servicePath, unicode(text.text()))) - except: + except OSError: #if not present do not worry pass self.ListView.takeItem(item.row()) diff --git a/openlp/plugins/presentations/lib/presentationcontroller.py b/openlp/plugins/presentations/lib/presentationcontroller.py index f2cb37b51..3d2836041 100644 --- a/openlp/plugins/presentations/lib/presentationcontroller.py +++ b/openlp/plugins/presentations/lib/presentationcontroller.py @@ -100,16 +100,17 @@ class PresentationController(object): self.docs = [] self.plugin = plugin self.name = name - self.settingsSection = self.plugin.settingsSection + self.settings_section = self.plugin.settingsSection self.available = self.check_available() if self.available: self.enabled = QtCore.QSettings().value( - self.settingsSection + u'/' + name, - QtCore.QVariant(QtCore.Qt.Unchecked)).toInt()[0] == QtCore.Qt.Checked + self.settings_section + u'/' + name, + QtCore.QVariant(QtCore.Qt.Unchecked)).toInt()[0] == \ + QtCore.Qt.Checked else: self.enabled = False self.thumbnailroot = os.path.join( - AppLocation.get_section_data_path(self.settingsSection), + AppLocation.get_section_data_path(self.settings_section), name, u'thumbnails') self.thumbnailprefix = u'slide' if not os.path.isdir(self.thumbnailroot): @@ -123,7 +124,8 @@ class PresentationController(object): def start_process(self): """ - Loads a running version of the presentation application in the background. + Loads a running version of the presentation application in the + background. """ pass diff --git a/openlp/plugins/songs/forms/editsongform.py b/openlp/plugins/songs/forms/editsongform.py index 144081c84..ce22f6345 100644 --- a/openlp/plugins/songs/forms/editsongform.py +++ b/openlp/plugins/songs/forms/editsongform.py @@ -569,7 +569,8 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): verseId = unicode((item.data(QtCore.Qt.UserRole)).toString()) bits = verseId.split(u':') sxml.add_verse_to_lyrics(bits[0], bits[1], unicode(item.text())) - text = text + unicode(self.VerseListWidget.item(i, 0).text()) + u' ' + text = text + unicode(self.VerseListWidget.item(i, 0).text()) \ + + u' ' text = text.replace(u'\'', u'') text = text.replace(u',', u'') text = text.replace(u';', u'') diff --git a/openlp/plugins/songs/lib/manager.py b/openlp/plugins/songs/lib/manager.py index 7147f4d79..43b10aeec 100644 --- a/openlp/plugins/songs/lib/manager.py +++ b/openlp/plugins/songs/lib/manager.py @@ -26,6 +26,7 @@ import logging from PyQt4 import QtCore +from sqlalchemy.exceptions import InvalidRequestError from openlp.core.utils import AppLocation from openlp.plugins.songs.lib.models import init_models, metadata, Song, \ @@ -161,7 +162,7 @@ class SongManager(object): self.session.add(song) self.session.commit() return True - except: + except InvalidRequestError: log.exception(u'Could not save song to song database') self.session.rollback() return False @@ -172,7 +173,7 @@ class SongManager(object): self.session.delete(song) self.session.commit() return True - except: + except InvalidRequestError: self.session.rollback() log.exception(u'Could not delete song from song database') return False @@ -203,7 +204,7 @@ class SongManager(object): self.session.add(author) self.session.commit() return True - except: + except InvalidRequestError: self.session.rollback() log.exception(u'Could not save author to song database') return False @@ -217,7 +218,7 @@ class SongManager(object): self.session.delete(author) self.session.commit() return True - except: + except InvalidRequestError: self.session.rollback() log.exception(u'Could not delete author from song database') return False @@ -248,7 +249,7 @@ class SongManager(object): self.session.add(topic) self.session.commit() return True - except: + except InvalidRequestError: self.session.rollback() log.exception(u'Could not save topic to song database') return False @@ -262,7 +263,7 @@ class SongManager(object): self.session.delete(topic) self.session.commit() return True - except: + except InvalidRequestError: self.session.rollback() log.exception(u'Could not delete topic from song database') return False @@ -293,7 +294,7 @@ class SongManager(object): self.session.add(book) self.session.commit() return True - except: + except InvalidRequestError: self.session.rollback() log.exception(u'Could not save book to song database') return False @@ -307,10 +308,11 @@ class SongManager(object): self.session.delete(book) self.session.commit() return True - except: + except InvalidRequestError: self.session.rollback() log.exception(u'Could not delete book from song database') return False def get_songs_for_theme(self, theme): return self.session.query(Song).filter(Song.theme_name == theme).all() + diff --git a/openlp/plugins/songs/lib/oooimport.py b/openlp/plugins/songs/lib/oooimport.py index 403738973..a2a75a872 100644 --- a/openlp/plugins/songs/lib/oooimport.py +++ b/openlp/plugins/songs/lib/oooimport.py @@ -24,7 +24,9 @@ ############################################################################### import os + from PyQt4 import QtCore + from songimport import SongImport if os.name == u'nt': @@ -35,9 +37,11 @@ if os.name == u'nt': else: try: import uno - from com.sun.star.style.BreakType import PAGE_BEFORE, PAGE_AFTER, PAGE_BOTH - except: + from com.sun.star.style.BreakType import PAGE_BEFORE, PAGE_AFTER, \ + PAGE_BOTH + except ImportError: pass + class OooImport(object): """ Import songs from Impress/Powerpoint docs using Impress @@ -75,7 +79,8 @@ class OooImport(object): """ if os.name == u'nt': self.start_ooo_process() - self.desktop = self.manager.createInstance(u'com.sun.star.frame.Desktop') + self.desktop = self.manager.createInstance( + u'com.sun.star.frame.Desktop') else: context = uno.getComponentContext() resolver = context.ServiceManager.createInstanceWithContext( @@ -101,8 +106,8 @@ class OooImport(object): self.manager._FlagAsMethod(u'Bridge_GetStruct') self.manager._FlagAsMethod(u'Bridge_GetValueObject') else: - cmd = u'openoffice.org -nologo -norestore -minimized -invisible ' \ - + u'-nofirststartwizard ' \ + cmd = u'openoffice.org -nologo -norestore -minimized ' \ + + u'-invisible -nofirststartwizard ' \ + '-accept="socket,host=localhost,port=2002;urp;"' process = QtCore.QProcess() process.startDetached(cmd) diff --git a/openlp/plugins/songs/lib/songxml.py b/openlp/plugins/songs/lib/songxml.py index 102fd3260..336fc080e 100644 --- a/openlp/plugins/songs/lib/songxml.py +++ b/openlp/plugins/songs/lib/songxml.py @@ -288,7 +288,7 @@ class Song(object): osfile.close() xml = "".join(list) self.from_opensong_buffer(xml) - except: + except IOError: log.exception(u'Failed to load opensong xml file') finally: if osfile: @@ -394,7 +394,7 @@ class Song(object): ccli_file = open(textFileName, 'r') lines = [orgline.rstrip() for orgline in ccli_file] self.from_ccli_text_buffer(lines) - except: + except IOError: log.exception(u'Failed to load CCLI text file') finally: if ccli_file: diff --git a/openlp/plugins/songs/lib/xml.py b/openlp/plugins/songs/lib/xml.py index 51fbad6b0..2be9573a2 100644 --- a/openlp/plugins/songs/lib/xml.py +++ b/openlp/plugins/songs/lib/xml.py @@ -24,6 +24,7 @@ ############################################################################### from lxml import objectify +from lxml.etree import XMLSyntaxError class LyricsXML(object): """ @@ -73,7 +74,7 @@ class LyricsXML(object): }) self.lyrics.append(language) return True - except: + except XMLSyntaxError: return False def extract(self, text): diff --git a/openlp/plugins/songusage/forms/songusagedetailform.py b/openlp/plugins/songusage/forms/songusagedetailform.py index 21d6d29c5..e568c35da 100644 --- a/openlp/plugins/songusage/forms/songusagedetailform.py +++ b/openlp/plugins/songusage/forms/songusagedetailform.py @@ -85,7 +85,7 @@ class SongUsageDetailForm(QtGui.QDialog, Ui_SongUsageDetailDialog): (instance.usagedate,instance.usagetime, instance.title, instance.copyright, instance.ccl_number , instance.authors) file.write(record) - except: + except IOError: log.exception(u'Failed to write out song usage records') finally: if file: diff --git a/openlp/plugins/songusage/lib/manager.py b/openlp/plugins/songusage/lib/manager.py index cb8ea91bf..b830fdafd 100644 --- a/openlp/plugins/songusage/lib/manager.py +++ b/openlp/plugins/songusage/lib/manager.py @@ -26,6 +26,7 @@ import logging from PyQt4 import QtCore +from sqlalchemy.exceptions import InvalidRequestError from openlp.core.utils import AppLocation from openlp.plugins.songusage.lib.models import init_models, metadata, \ @@ -87,7 +88,7 @@ class SongUsageManager(object): self.session.add(songusageitem) self.session.commit() return True - except: + except InvalidRequestError: self.session.rollback() log.exception(u'SongUsage item failed to save') return False @@ -111,7 +112,7 @@ class SongUsageManager(object): self.session.delete(songusageitem) self.session.commit() return True - except: + except InvalidRequestError: self.session.rollback() log.exception(u'SongUsage Item failed to delete') return False @@ -126,7 +127,7 @@ class SongUsageManager(object): self.session.query(SongUsageItem).delete(synchronize_session=False) self.session.commit() return True - except: + except InvalidRequestError: self.session.rollback() log.exception(u'Failed to delete all Song Usage items') return False @@ -141,7 +142,8 @@ class SongUsageManager(object): .delete(synchronize_session=False) self.session.commit() return True - except: + except InvalidRequestError: self.session.rollback() log.exception(u'Failed to delete all Song Usage items to %s' % date) return False +