diff --git a/openlp/core/theme/__init__.py b/openlp/core/theme/__init__.py index 8b4415566..e6b70c28c 100644 --- a/openlp/core/theme/__init__.py +++ b/openlp/core/theme/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4 +# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4 ############################################################################### # OpenLP - Open Source Lyrics Projection # diff --git a/openlp/core/theme/theme.py b/openlp/core/theme/theme.py index 63461b53b..4c9adebcb 100644 --- a/openlp/core/theme/theme.py +++ b/openlp/core/theme/theme.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4 +# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4 ############################################################################### # OpenLP - Open Source Lyrics Projection # @@ -194,8 +194,7 @@ class Theme(object): ``xml`` The data to apply to the theme """ - root = ElementTree(element=XML(xml.encode(u'ascii', - u'xmlcharrefreplace'))) + root = ElementTree(element=XML(xml.encode(u'ascii', u'xmlcharrefreplace'))) xml_iter = root.getiterator() for element in xml_iter: delphi_color_change = False @@ -219,16 +218,13 @@ class Theme(object): val = int(element_text) except ValueError: val = element_text - if (element.tag.find(u'Color') > 0 or - (element.tag.find(u'BackgroundParameter') == 0 and + if (element.tag.find(u'Color') > 0 or (element.tag.find(u'BackgroundParameter') == 0 and isinstance(val, int))): # convert to a wx.Colour if not delphi_color_change: - val = QtGui.QColor( - val&0xFF, (val>>8)&0xFF, (val>>16)&0xFF) + val = QtGui.QColor(val&0xFF, (val>>8)&0xFF, (val>>16)&0xFF) else: - val = QtGui.QColor( - (val>>16)&0xFF, (val>>8)&0xFF, val&0xFF) + val = QtGui.QColor((val>>16)&0xFF, (val>>8)&0xFF, val&0xFF) setattr(self, element.tag, val) def __str__(self): diff --git a/openlp/core/ui/__init__.py b/openlp/core/ui/__init__.py index 325b1d450..cce8b16bb 100644 --- a/openlp/core/ui/__init__.py +++ b/openlp/core/ui/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4 +# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4 ############################################################################### # OpenLP - Open Source Lyrics Projection # diff --git a/openlp/core/ui/aboutdialog.py b/openlp/core/ui/aboutdialog.py index 1dd447bcf..fd42edf3b 100644 --- a/openlp/core/ui/aboutdialog.py +++ b/openlp/core/ui/aboutdialog.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4 +# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4 ############################################################################### # OpenLP - Open Source Lyrics Projection # @@ -39,8 +39,7 @@ class Ui_AboutDialog(object): self.aboutDialogLayout = QtGui.QVBoxLayout(aboutDialog) self.aboutDialogLayout.setObjectName(u'aboutDialogLayout') self.logoLabel = QtGui.QLabel(aboutDialog) - self.logoLabel.setPixmap( - QtGui.QPixmap(u':/graphics/openlp-about-logo.png')) + self.logoLabel.setPixmap(QtGui.QPixmap(u':/graphics/openlp-about-logo.png')) self.logoLabel.setObjectName(u'logoLabel') self.aboutDialogLayout.addWidget(self.logoLabel) self.aboutNotebook = QtGui.QTabWidget(aboutDialog) @@ -73,10 +72,8 @@ class Ui_AboutDialog(object): self.licenseTabLayout.addWidget(self.licenseTextEdit) self.aboutNotebook.addTab(self.licenseTab, u'') self.aboutDialogLayout.addWidget(self.aboutNotebook) - self.volunteerButton = create_button(None, u'volunteerButton', - icon=u':/system/system_volunteer.png') - self.buttonBox = create_button_box(aboutDialog, u'buttonBox', - [u'close'], [self.volunteerButton]) + self.volunteerButton = create_button(None, u'volunteerButton', icon=u':/system/system_volunteer.png') + self.buttonBox = create_button_box(aboutDialog, u'buttonBox', [u'close'], [self.volunteerButton]) self.aboutDialogLayout.addWidget(self.buttonBox) self.retranslateUi(aboutDialog) self.aboutNotebook.setCurrentIndex(0) @@ -99,8 +96,7 @@ class Ui_AboutDialog(object): 'like to see more free Christian software being written, please ' 'consider volunteering by using the button below.' )) - self.aboutNotebook.setTabText( - self.aboutNotebook.indexOf(self.aboutTab), UiStrings().About) + self.aboutNotebook.setTabText(self.aboutNotebook.indexOf(self.aboutTab), UiStrings().About) lead = u'Raoul "superfly" Snyman' developers = [u'Tim "TRB143" Bentley', u'Jonathan "gushie" Corwin', u'Michael "cocooncrash" Gorven', @@ -261,8 +257,7 @@ class Ui_AboutDialog(object): u'\n '.join(translators[u'ta_LK']), u'\n '.join(translators[u'zh_CN']), u'\n '.join(documentors))) - self.aboutNotebook.setTabText( - self.aboutNotebook.indexOf(self.creditsTab), + self.aboutNotebook.setTabText(self.aboutNotebook.indexOf(self.creditsTab), translate('OpenLP.AboutForm', 'Credits')) copyright = translate('OpenLP.AboutForm', 'Copyright \xa9 2004-2012 %s\n' @@ -656,10 +651,7 @@ class Ui_AboutDialog(object): 'linking proprietary applications with the library. If this is ' 'what you want to do, use the GNU Lesser General Public License ' 'instead of this License.') - self.licenseTextEdit.setPlainText(u'%s\n\n%s\n\n%s\n\n\n%s' % - (copyright, licence, disclaimer, gpltext)) - self.aboutNotebook.setTabText( - self.aboutNotebook.indexOf(self.licenseTab), + self.licenseTextEdit.setPlainText(u'%s\n\n%s\n\n%s\n\n\n%s' % (copyright, licence, disclaimer, gpltext)) + self.aboutNotebook.setTabText(self.aboutNotebook.indexOf(self.licenseTab), translate('OpenLP.AboutForm', 'License')) - self.volunteerButton.setText(translate('OpenLP.AboutForm', - 'Volunteer')) + self.volunteerButton.setText(translate('OpenLP.AboutForm', 'Volunteer')) diff --git a/openlp/core/ui/aboutform.py b/openlp/core/ui/aboutform.py index 19929e7f3..67537b7ea 100644 --- a/openlp/core/ui/aboutform.py +++ b/openlp/core/ui/aboutform.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4 +# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4 ############################################################################### # OpenLP - Open Source Lyrics Projection # @@ -46,17 +46,14 @@ class AboutForm(QtGui.QDialog, Ui_AboutDialog): applicationVersion = get_application_version() self.setupUi(self) about_text = self.aboutTextEdit.toPlainText() - about_text = about_text.replace(u'', - applicationVersion[u'version']) + about_text = about_text.replace(u'', applicationVersion[u'version']) if applicationVersion[u'build']: - build_text = translate('OpenLP.AboutForm', ' build %s') % \ - applicationVersion[u'build'] + build_text = translate('OpenLP.AboutForm', ' build %s') % applicationVersion[u'build'] else: build_text = u'' about_text = about_text.replace(u'', build_text) self.aboutTextEdit.setPlainText(about_text) - QtCore.QObject.connect(self.volunteerButton, - QtCore.SIGNAL(u'clicked()'), self.onVolunteerButtonClicked) + QtCore.QObject.connect(self.volunteerButton, QtCore.SIGNAL(u'clicked()'), self.onVolunteerButtonClicked) def onVolunteerButtonClicked(self): """ diff --git a/openlp/core/ui/advancedtab.py b/openlp/core/ui/advancedtab.py index 32179281b..bdb24c04b 100644 --- a/openlp/core/ui/advancedtab.py +++ b/openlp/core/ui/advancedtab.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4 +# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4 ############################################################################### # OpenLP - Open Source Lyrics Projection # @@ -36,8 +36,7 @@ import sys from PyQt4 import QtCore, QtGui -from openlp.core.lib import SettingsTab, translate, build_icon, Receiver, \ - Settings +from openlp.core.lib import SettingsTab, translate, build_icon, Receiver, Settings from openlp.core.lib.ui import UiStrings from openlp.core.utils import get_images_filter, AppLocation, format_time from openlp.core.lib import SlideLimits @@ -95,12 +94,10 @@ class AdvancedTab(SettingsTab): self.doubleClickLiveCheckBox.setObjectName(u'doubleClickLiveCheckBox') self.uiLayout.addRow(self.doubleClickLiveCheckBox) self.singleClickPreviewCheckBox = QtGui.QCheckBox(self.uiGroupBox) - self.singleClickPreviewCheckBox.setObjectName( - u'singleClickPreviewCheckBox') + self.singleClickPreviewCheckBox.setObjectName(u'singleClickPreviewCheckBox') self.uiLayout.addRow(self.singleClickPreviewCheckBox) self.expandServiceItemCheckBox = QtGui.QCheckBox(self.uiGroupBox) - self.expandServiceItemCheckBox.setObjectName( - u'expandServiceItemCheckBox') + self.expandServiceItemCheckBox.setObjectName(u'expandServiceItemCheckBox') self.uiLayout.addRow(self.expandServiceItemCheckBox) self.enableAutoCloseCheckBox = QtGui.QCheckBox(self.uiGroupBox) self.enableAutoCloseCheckBox.setObjectName(u'enableAutoCloseCheckBox') @@ -125,33 +122,25 @@ class AdvancedTab(SettingsTab): self.serviceNameTimeHBox.setObjectName(u'serviceNameTimeHBox') self.serviceNameTimeHBox.addWidget(self.serviceNameDay) self.serviceNameTimeHBox.addWidget(self.serviceNameTime) - self.serviceNameLayout.addRow(self.serviceNameTimeLabel, - self.serviceNameTimeHBox) + self.serviceNameLayout.addRow(self.serviceNameTimeLabel, self.serviceNameTimeHBox) self.serviceNameLabel = QtGui.QLabel(self.serviceNameGroupBox) self.serviceNameLabel.setObjectName(u'serviceNameLabel') self.serviceNameEdit = QtGui.QLineEdit(self.serviceNameGroupBox) self.serviceNameEdit.setObjectName(u'serviceNameEdit') - self.serviceNameEdit.setValidator(QtGui.QRegExpValidator( - QtCore.QRegExp(r'[^/\\?*|<>\[\]":+]+'), self)) - self.serviceNameRevertButton = QtGui.QToolButton( - self.serviceNameGroupBox) - self.serviceNameRevertButton.setObjectName( - u'serviceNameRevertButton') - self.serviceNameRevertButton.setIcon( - build_icon(u':/general/general_revert.png')) + self.serviceNameEdit.setValidator(QtGui.QRegExpValidator(QtCore.QRegExp(r'[^/\\?*|<>\[\]":+]+'), self)) + self.serviceNameRevertButton = QtGui.QToolButton(self.serviceNameGroupBox) + self.serviceNameRevertButton.setObjectName(u'serviceNameRevertButton') + self.serviceNameRevertButton.setIcon(build_icon(u':/general/general_revert.png')) self.serviceNameHBox = QtGui.QHBoxLayout() self.serviceNameHBox.setObjectName(u'serviceNameHBox') self.serviceNameHBox.addWidget(self.serviceNameEdit) self.serviceNameHBox.addWidget(self.serviceNameRevertButton) - self.serviceNameLayout.addRow(self.serviceNameLabel, - self.serviceNameHBox) + self.serviceNameLayout.addRow(self.serviceNameLabel, self.serviceNameHBox) self.serviceNameExampleLabel = QtGui.QLabel(self.serviceNameGroupBox) - self.serviceNameExampleLabel.setObjectName( - u'serviceNameExampleLabel') + self.serviceNameExampleLabel.setObjectName(u'serviceNameExampleLabel') self.serviceNameExample = QtGui.QLabel(self.serviceNameGroupBox) self.serviceNameExample.setObjectName(u'serviceNameExample') - self.serviceNameLayout.addRow(self.serviceNameExampleLabel, - self.serviceNameExample) + self.serviceNameLayout.addRow(self.serviceNameExampleLabel, self.serviceNameExample) self.leftLayout.addWidget(self.serviceNameGroupBox) # Data Directory self.dataDirectoryGroupBox = QtGui.QGroupBox(self.leftColumn) @@ -159,8 +148,7 @@ class AdvancedTab(SettingsTab): self.dataDirectoryLayout = QtGui.QFormLayout(self.dataDirectoryGroupBox) self.dataDirectoryLayout.setObjectName(u'dataDirectoryLayout') self.dataDirectoryCurrentLabel = QtGui.QLabel(self.dataDirectoryGroupBox) - self.dataDirectoryCurrentLabel.setObjectName( - u'dataDirectoryCurrentLabel') + self.dataDirectoryCurrentLabel.setObjectName( u'dataDirectoryCurrentLabel') self.dataDirectoryLabel = QtGui.QLabel(self.dataDirectoryGroupBox) self.dataDirectoryLabel.setObjectName(u'dataDirectoryLabel') self.dataDirectoryNewLabel = QtGui.QLabel(self.dataDirectoryGroupBox) @@ -168,52 +156,32 @@ class AdvancedTab(SettingsTab): self.newDataDirectoryEdit = QtGui.QLineEdit(self.dataDirectoryGroupBox) self.newDataDirectoryEdit.setObjectName(u'newDataDirectoryEdit') self.newDataDirectoryEdit.setReadOnly(True) - self.newDataDirectoryHasFilesLabel = QtGui.QLabel( - self.dataDirectoryGroupBox) - self.newDataDirectoryHasFilesLabel.setObjectName( - u'newDataDirectoryHasFilesLabel') + self.newDataDirectoryHasFilesLabel = QtGui.QLabel(self.dataDirectoryGroupBox) + self.newDataDirectoryHasFilesLabel.setObjectName(u'newDataDirectoryHasFilesLabel') self.newDataDirectoryHasFilesLabel.setWordWrap(True) - self.dataDirectoryBrowseButton = QtGui.QToolButton( - self.dataDirectoryGroupBox) - self.dataDirectoryBrowseButton.setObjectName( - u'dataDirectoryBrowseButton') - self.dataDirectoryBrowseButton.setIcon( - build_icon(u':/general/general_open.png')) - self.dataDirectoryDefaultButton = QtGui.QToolButton( - self.dataDirectoryGroupBox) - self.dataDirectoryDefaultButton.setObjectName( - u'dataDirectoryDefaultButton') - self.dataDirectoryDefaultButton.setIcon( - build_icon(u':/general/general_revert.png')) - self.dataDirectoryCancelButton = QtGui.QToolButton( - self.dataDirectoryGroupBox) - self.dataDirectoryCancelButton.setObjectName( - u'dataDirectoryCancelButton') - self.dataDirectoryCancelButton.setIcon( - build_icon(u':/general/general_delete.png')) + self.dataDirectoryBrowseButton = QtGui.QToolButton(self.dataDirectoryGroupBox) + self.dataDirectoryBrowseButton.setObjectName(u'dataDirectoryBrowseButton') + self.dataDirectoryBrowseButton.setIcon(build_icon(u':/general/general_open.png')) + self.dataDirectoryDefaultButton = QtGui.QToolButton(self.dataDirectoryGroupBox) + self.dataDirectoryDefaultButton.setObjectName(u'dataDirectoryDefaultButton') + self.dataDirectoryDefaultButton.setIcon(build_icon(u':/general/general_revert.png')) + self.dataDirectoryCancelButton = QtGui.QToolButton(self.dataDirectoryGroupBox) + self.dataDirectoryCancelButton.setObjectName(u'dataDirectoryCancelButton') + self.dataDirectoryCancelButton.setIcon(build_icon(u':/general/general_delete.png')) self.newDataDirectoryLabelHBox = QtGui.QHBoxLayout() - self.newDataDirectoryLabelHBox.setObjectName( - u'newDataDirectoryLabelHBox') + self.newDataDirectoryLabelHBox.setObjectName(u'newDataDirectoryLabelHBox') self.newDataDirectoryLabelHBox.addWidget(self.newDataDirectoryEdit) self.newDataDirectoryLabelHBox.addWidget(self.dataDirectoryBrowseButton) - self.newDataDirectoryLabelHBox.addWidget( - self.dataDirectoryDefaultButton) + self.newDataDirectoryLabelHBox.addWidget(self.dataDirectoryDefaultButton) self.dataDirectoryCopyCheckHBox = QtGui.QHBoxLayout() - self.dataDirectoryCopyCheckHBox.setObjectName( - u'dataDirectoryCopyCheckHBox') - self.dataDirectoryCopyCheckBox = QtGui.QCheckBox( - self.dataDirectoryGroupBox) - self.dataDirectoryCopyCheckBox.setObjectName( - u'dataDirectoryCopyCheckBox') - self.dataDirectoryCopyCheckHBox.addWidget( - self.dataDirectoryCopyCheckBox) + self.dataDirectoryCopyCheckHBox.setObjectName(u'dataDirectoryCopyCheckHBox') + self.dataDirectoryCopyCheckBox = QtGui.QCheckBox(self.dataDirectoryGroupBox) + self.dataDirectoryCopyCheckBox.setObjectName(u'dataDirectoryCopyCheckBox') + self.dataDirectoryCopyCheckHBox.addWidget(self.dataDirectoryCopyCheckBox) self.dataDirectoryCopyCheckHBox.addStretch() - self.dataDirectoryCopyCheckHBox.addWidget( - self.dataDirectoryCancelButton) - self.dataDirectoryLayout.addRow(self.dataDirectoryCurrentLabel, - self.dataDirectoryLabel) - self.dataDirectoryLayout.addRow(self.dataDirectoryNewLabel, - self.newDataDirectoryLabelHBox) + self.dataDirectoryCopyCheckHBox.addWidget(self.dataDirectoryCancelButton) + self.dataDirectoryLayout.addRow(self.dataDirectoryCurrentLabel, self.dataDirectoryLabel) + self.dataDirectoryLayout.addRow(self.dataDirectoryNewLabel, self.newDataDirectoryLabelHBox) self.dataDirectoryLayout.addRow(self.dataDirectoryCopyCheckHBox) self.dataDirectoryLayout.addRow(self.newDataDirectoryHasFilesLabel) self.leftLayout.addWidget(self.dataDirectoryGroupBox) @@ -227,27 +195,23 @@ class AdvancedTab(SettingsTab): self.defaultColorLabel.setObjectName(u'defaultColorLabel') self.defaultColorButton = QtGui.QPushButton(self.defaultImageGroupBox) self.defaultColorButton.setObjectName(u'defaultColorButton') - self.defaultImageLayout.addRow(self.defaultColorLabel, - self.defaultColorButton) + self.defaultImageLayout.addRow(self.defaultColorLabel, self.defaultColorButton) self.defaultFileLabel = QtGui.QLabel(self.defaultImageGroupBox) self.defaultFileLabel.setObjectName(u'defaultFileLabel') self.defaultFileEdit = QtGui.QLineEdit(self.defaultImageGroupBox) self.defaultFileEdit.setObjectName(u'defaultFileEdit') self.defaultBrowseButton = QtGui.QToolButton(self.defaultImageGroupBox) self.defaultBrowseButton.setObjectName(u'defaultBrowseButton') - self.defaultBrowseButton.setIcon( - build_icon(u':/general/general_open.png')) + self.defaultBrowseButton.setIcon(build_icon(u':/general/general_open.png')) self.defaultRevertButton = QtGui.QToolButton(self.defaultImageGroupBox) self.defaultRevertButton.setObjectName(u'defaultRevertButton') - self.defaultRevertButton.setIcon( - build_icon(u':/general/general_revert.png')) + self.defaultRevertButton.setIcon(build_icon(u':/general/general_revert.png')) self.defaultFileLayout = QtGui.QHBoxLayout() self.defaultFileLayout.setObjectName(u'defaultFileLayout') self.defaultFileLayout.addWidget(self.defaultFileEdit) self.defaultFileLayout.addWidget(self.defaultBrowseButton) self.defaultFileLayout.addWidget(self.defaultRevertButton) - self.defaultImageLayout.addRow(self.defaultFileLabel, - self.defaultFileLayout) + self.defaultImageLayout.addRow(self.defaultFileLabel, self.defaultFileLayout) self.rightLayout.addWidget(self.defaultImageGroupBox) # Hide mouse self.hideMouseGroupBox = QtGui.QGroupBox(self.rightColumn) @@ -286,46 +250,31 @@ class AdvancedTab(SettingsTab): self.rightLayout.addWidget(self.x11GroupBox) self.rightLayout.addStretch() self.shouldUpdateServiceNameExample = False - QtCore.QObject.connect(self.serviceNameCheckBox, - QtCore.SIGNAL(u'toggled(bool)'), self.serviceNameCheckBoxToggled) - QtCore.QObject.connect(self.serviceNameDay, - QtCore.SIGNAL(u'currentIndexChanged(int)'), + QtCore.QObject.connect(self.serviceNameCheckBox, QtCore.SIGNAL(u'toggled(bool)'), + self.serviceNameCheckBoxToggled) + QtCore.QObject.connect(self.serviceNameDay, QtCore.SIGNAL(u'currentIndexChanged(int)'), self.onServiceNameDayChanged) - QtCore.QObject.connect(self.serviceNameTime, - QtCore.SIGNAL(u'timeChanged(QTime)'), + QtCore.QObject.connect(self.serviceNameTime, QtCore.SIGNAL(u'timeChanged(QTime)'), self.updateServiceNameExample) - QtCore.QObject.connect(self.serviceNameEdit, - QtCore.SIGNAL(u'textChanged(QString)'), + QtCore.QObject.connect(self.serviceNameEdit, QtCore.SIGNAL(u'textChanged(QString)'), self.updateServiceNameExample) - QtCore.QObject.connect(self.serviceNameRevertButton, - QtCore.SIGNAL(u'clicked()'), + QtCore.QObject.connect(self.serviceNameRevertButton, QtCore.SIGNAL(u'clicked()'), self.onServiceNameRevertButtonClicked) - QtCore.QObject.connect(self.defaultColorButton, - QtCore.SIGNAL(u'clicked()'), self.onDefaultColorButtonClicked) - QtCore.QObject.connect(self.defaultBrowseButton, - QtCore.SIGNAL(u'clicked()'), self.onDefaultBrowseButtonClicked) - QtCore.QObject.connect(self.defaultRevertButton, - QtCore.SIGNAL(u'clicked()'), self.onDefaultRevertButtonClicked) - QtCore.QObject.connect(self.x11BypassCheckBox, - QtCore.SIGNAL(u'toggled(bool)'), self.onX11BypassCheckBoxToggled) - QtCore.QObject.connect(self.dataDirectoryBrowseButton, - QtCore.SIGNAL(u'clicked()'), + QtCore.QObject.connect(self.defaultColorButton, QtCore.SIGNAL(u'clicked()'), self.onDefaultColorButtonClicked) + QtCore.QObject.connect(self.defaultBrowseButton, QtCore.SIGNAL(u'clicked()'), self.onDefaultBrowseButtonClicked) + QtCore.QObject.connect(self.defaultRevertButton, QtCore.SIGNAL(u'clicked()'), self.onDefaultRevertButtonClicked) + QtCore.QObject.connect(self.x11BypassCheckBox, QtCore.SIGNAL(u'toggled(bool)'), self.onX11BypassCheckBoxToggled) + QtCore.QObject.connect(self.dataDirectoryBrowseButton, QtCore.SIGNAL(u'clicked()'), self.onDataDirectoryBrowseButtonClicked) - QtCore.QObject.connect(self.dataDirectoryDefaultButton, - QtCore.SIGNAL(u'clicked()'), + QtCore.QObject.connect(self.dataDirectoryDefaultButton, QtCore.SIGNAL(u'clicked()'), self.onDataDirectoryDefaultButtonClicked) - QtCore.QObject.connect(self.dataDirectoryCancelButton, - QtCore.SIGNAL(u'clicked()'), + QtCore.QObject.connect(self.dataDirectoryCancelButton, QtCore.SIGNAL(u'clicked()'), self.onDataDirectoryCancelButtonClicked) - QtCore.QObject.connect(self.dataDirectoryCopyCheckBox, - QtCore.SIGNAL(u'toggled(bool)'), + QtCore.QObject.connect(self.dataDirectoryCopyCheckBox, QtCore.SIGNAL(u'toggled(bool)'), self.onDataDirectoryCopyCheckBoxToggled) - QtCore.QObject.connect(self.endSlideRadioButton, - QtCore.SIGNAL(u'clicked()'), self.onEndSlideButtonClicked) - QtCore.QObject.connect(self.wrapSlideRadioButton, - QtCore.SIGNAL(u'clicked()'), self.onWrapSlideButtonClicked) - QtCore.QObject.connect(self.nextItemRadioButton, - QtCore.SIGNAL(u'clicked()'), self.onnextItemButtonClicked) + QtCore.QObject.connect(self.endSlideRadioButton, QtCore.SIGNAL(u'clicked()'), self.onEndSlideButtonClicked) + QtCore.QObject.connect(self.wrapSlideRadioButton, QtCore.SIGNAL(u'clicked()'), self.onWrapSlideButtonClicked) + QtCore.QObject.connect(self.nextItemRadioButton, QtCore.SIGNAL(u'clicked()'), self.onnextItemButtonClicked) def retranslateUi(self): """ @@ -333,11 +282,8 @@ class AdvancedTab(SettingsTab): """ self.tabTitleVisible = UiStrings().Advanced self.uiGroupBox.setTitle(translate('OpenLP.AdvancedTab', 'UI Settings')) - self.dataDirectoryGroupBox.setTitle( - translate('OpenLP.AdvancedTab', 'Data Location')) - self.recentLabel.setText( - translate('OpenLP.AdvancedTab', - 'Number of recent files to display:')) + self.dataDirectoryGroupBox.setTitle(translate('OpenLP.AdvancedTab', 'Data Location')) + self.recentLabel.setText(translate('OpenLP.AdvancedTab', 'Number of recent files to display:')) self.mediaPluginCheckBox.setText(translate('OpenLP.AdvancedTab', 'Remember active media manager tab on startup')) self.doubleClickLiveCheckBox.setText(translate('OpenLP.AdvancedTab', @@ -348,96 +294,54 @@ class AdvancedTab(SettingsTab): 'Expand new service items on creation')) self.enableAutoCloseCheckBox.setText(translate('OpenLP.AdvancedTab', 'Enable application exit confirmation')) - self.serviceNameGroupBox.setTitle( - translate('OpenLP.AdvancedTab', 'Default Service Name')) - self.serviceNameCheckBox.setText( - translate('OpenLP.AdvancedTab', 'Enable default service name')) - self.serviceNameTimeLabel.setText( - translate('OpenLP.AdvancedTab', 'Date and Time:')) - self.serviceNameDay.setItemText(0, - translate('OpenLP.AdvancedTab', 'Monday')) - self.serviceNameDay.setItemText(1, - translate('OpenLP.AdvancedTab', 'Tuesday')) - self.serviceNameDay.setItemText(2, - translate('OpenLP.AdvancedTab', 'Wednesday')) - self.serviceNameDay.setItemText(3, - translate('OpenLP.AdvancedTab', 'Thurdsday')) - self.serviceNameDay.setItemText(4, - translate('OpenLP.AdvancedTab', 'Friday')) - self.serviceNameDay.setItemText(5, - translate('OpenLP.AdvancedTab', 'Saturday')) - self.serviceNameDay.setItemText(6, - translate('OpenLP.AdvancedTab', 'Sunday')) - self.serviceNameDay.setItemText(7, - translate('OpenLP.AdvancedTab', 'Now')) + self.serviceNameGroupBox.setTitle(translate('OpenLP.AdvancedTab', 'Default Service Name')) + self.serviceNameCheckBox.setText(translate('OpenLP.AdvancedTab', 'Enable default service name')) + self.serviceNameTimeLabel.setText(translate('OpenLP.AdvancedTab', 'Date and Time:')) + self.serviceNameDay.setItemText(0, translate('OpenLP.AdvancedTab', 'Monday')) + self.serviceNameDay.setItemText(1, translate('OpenLP.AdvancedTab', 'Tuesday')) + self.serviceNameDay.setItemText(2, translate('OpenLP.AdvancedTab', 'Wednesday')) + self.serviceNameDay.setItemText(3, translate('OpenLP.AdvancedTab', 'Thurdsday')) + self.serviceNameDay.setItemText(4, translate('OpenLP.AdvancedTab', 'Friday')) + self.serviceNameDay.setItemText(5, translate('OpenLP.AdvancedTab', 'Saturday')) + self.serviceNameDay.setItemText(6, translate('OpenLP.AdvancedTab', 'Sunday')) + self.serviceNameDay.setItemText(7, translate('OpenLP.AdvancedTab', 'Now')) self.serviceNameTime.setToolTip(translate('OpenLP.AdvancedTab', 'Time when usual service starts.')) - self.serviceNameLabel.setText( - translate('OpenLP.AdvancedTab', 'Name:')) - self.serviceNameEdit.setToolTip(translate('OpenLP.AdvancedTab', - 'Consult the OpenLP manual for usage.')) + self.serviceNameLabel.setText(translate('OpenLP.AdvancedTab', 'Name:')) + self.serviceNameEdit.setToolTip(translate('OpenLP.AdvancedTab', 'Consult the OpenLP manual for usage.')) self.serviceNameRevertButton.setToolTip( - translate('OpenLP.AdvancedTab', - 'Revert to the default service name "%s".') % - self.defaultServiceName) - self.serviceNameExampleLabel.setText(translate('OpenLP.AdvancedTab', - 'Example:')) - self.hideMouseGroupBox.setTitle(translate('OpenLP.AdvancedTab', - 'Mouse Cursor')) - self.hideMouseCheckBox.setText(translate('OpenLP.AdvancedTab', - 'Hide mouse cursor when over display window')) - self.defaultImageGroupBox.setTitle(translate('OpenLP.AdvancedTab', - 'Default Image')) - self.defaultColorLabel.setText(translate('OpenLP.AdvancedTab', - 'Background color:')) - self.defaultColorButton.setToolTip(translate('OpenLP.AdvancedTab', - 'Click to select a color.')) - self.defaultFileLabel.setText(translate('OpenLP.AdvancedTab', - 'Image file:')) - self.defaultBrowseButton.setToolTip(translate('OpenLP.AdvancedTab', - 'Browse for an image file to display.')) - self.defaultRevertButton.setToolTip(translate('OpenLP.AdvancedTab', - 'Revert to the default OpenLP logo.')) - self.dataDirectoryCurrentLabel.setText(translate('OpenLP.AdvancedTab', - 'Current path:')) - self.dataDirectoryNewLabel.setText(translate('OpenLP.AdvancedTab', - 'Custom path:')) - self.dataDirectoryBrowseButton.setToolTip( - translate('OpenLP.AdvancedTab', - 'Browse for new data file location.')) + translate('OpenLP.AdvancedTab', 'Revert to the default service name "%s".') % self.defaultServiceName) + self.serviceNameExampleLabel.setText(translate('OpenLP.AdvancedTab', 'Example:')) + self.hideMouseGroupBox.setTitle(translate('OpenLP.AdvancedTab', 'Mouse Cursor')) + self.hideMouseCheckBox.setText(translate('OpenLP.AdvancedTab', 'Hide mouse cursor when over display window')) + self.defaultImageGroupBox.setTitle(translate('OpenLP.AdvancedTab', 'Default Image')) + self.defaultColorLabel.setText(translate('OpenLP.AdvancedTab', 'Background color:')) + self.defaultColorButton.setToolTip(translate('OpenLP.AdvancedTab', 'Click to select a color.')) + self.defaultFileLabel.setText(translate('OpenLP.AdvancedTab', 'Image file:')) + self.defaultBrowseButton.setToolTip(translate('OpenLP.AdvancedTab', 'Browse for an image file to display.')) + self.defaultRevertButton.setToolTip(translate('OpenLP.AdvancedTab', 'Revert to the default OpenLP logo.')) + self.dataDirectoryCurrentLabel.setText(translate('OpenLP.AdvancedTab', 'Current path:')) + self.dataDirectoryNewLabel.setText(translate('OpenLP.AdvancedTab', 'Custom path:')) + self.dataDirectoryBrowseButton.setToolTip(translate('OpenLP.AdvancedTab', 'Browse for new data file location.')) self.dataDirectoryDefaultButton.setToolTip( - translate('OpenLP.AdvancedTab', - 'Set the data location to the default.')) - self.dataDirectoryCancelButton.setText( - translate('OpenLP.AdvancedTab', - 'Cancel')) + translate('OpenLP.AdvancedTab', 'Set the data location to the default.')) + self.dataDirectoryCancelButton.setText(translate('OpenLP.AdvancedTab', 'Cancel')) self.dataDirectoryCancelButton.setToolTip( - translate('OpenLP.AdvancedTab', - 'Cancel OpenLP data directory location change.')) - self.dataDirectoryCopyCheckBox.setText( - translate('OpenLP.AdvancedTab', - 'Copy data to new location.')) - self.dataDirectoryCopyCheckBox.setToolTip( - translate('OpenLP.AdvancedTab', - 'Copy the OpenLP data files to the new location.')) + translate('OpenLP.AdvancedTab', 'Cancel OpenLP data directory location change.')) + self.dataDirectoryCopyCheckBox.setText(translate('OpenLP.AdvancedTab', 'Copy data to new location.')) + self.dataDirectoryCopyCheckBox.setToolTip(translate( + 'OpenLP.AdvancedTab', 'Copy the OpenLP data files to the new location.')) self.newDataDirectoryHasFilesLabel.setText( - translate('OpenLP.AdvancedTab', - 'WARNING: New data directory location contains ' - 'OpenLP data files. These files WILL be replaced during a copy.')) + translate('OpenLP.AdvancedTab', 'WARNING: New data directory location contains ' + 'OpenLP data files. These files WILL be replaced during a copy.')) self.x11GroupBox.setTitle(translate('OpenLP.AdvancedTab', 'X11')) - self.x11BypassCheckBox.setText(translate('OpenLP.AdvancedTab', - 'Bypass X11 Window Manager')) + self.x11BypassCheckBox.setText(translate('OpenLP.AdvancedTab','Bypass X11 Window Manager')) # Slide Limits - self.slideGroupBox.setTitle( - translate('OpenLP.GeneralTab', 'Service Item Slide Limits')) - self.slideLabel.setText(translate('OpenLP.GeneralTab', - 'Behavior of next/previous on the last/first slide:')) - self.endSlideRadioButton.setText( - translate('OpenLP.GeneralTab', '&Remain on Slide')) - self.wrapSlideRadioButton.setText( - translate('OpenLP.GeneralTab', '&Wrap around')) - self.nextItemRadioButton.setText(translate('OpenLP.GeneralTab', - '&Move to next/previous service item')) + self.slideGroupBox.setTitle(translate('OpenLP.GeneralTab', 'Service Item Slide Limits')) + self.slideLabel.setText(translate('OpenLP.GeneralTab', 'Behavior of next/previous on the last/first slide:')) + self.endSlideRadioButton.setText(translate('OpenLP.GeneralTab', '&Remain on Slide')) + self.wrapSlideRadioButton.setText(translate('OpenLP.GeneralTab', '&Wrap around')) + self.nextItemRadioButton.setText(translate('OpenLP.GeneralTab', '&Move to next/previous service item')) def load(self): """ @@ -450,28 +354,19 @@ class AdvancedTab(SettingsTab): # 20 will always be used. self.recentSpinBox.setMaximum(settings.value(u'max recent files', 20)) self.recentSpinBox.setValue(settings.value(u'recent file count', 4)) - self.mediaPluginCheckBox.setChecked( - settings.value(u'save current plugin', False)) - self.doubleClickLiveCheckBox.setChecked( - settings.value(u'double click live', False)) - self.singleClickPreviewCheckBox.setChecked( - settings.value(u'single click preview', False)) - self.expandServiceItemCheckBox.setChecked( - settings.value(u'expand service item', False)) - self.enableAutoCloseCheckBox.setChecked( - settings.value(u'enable exit confirmation', True)) + self.mediaPluginCheckBox.setChecked(settings.value(u'save current plugin', False)) + self.doubleClickLiveCheckBox.setChecked(settings.value(u'double click live', False)) + self.singleClickPreviewCheckBox.setChecked(settings.value(u'single click preview', False)) + self.expandServiceItemCheckBox.setChecked(settings.value(u'expand service item', False)) + self.enableAutoCloseCheckBox.setChecked(settings.value(u'enable exit confirmation', True)) self.hideMouseCheckBox.setChecked(settings.value(u'hide mouse', True)) - self.serviceNameDay.setCurrentIndex( - settings.value(u'default service day', self.defaultServiceDay)) - self.serviceNameTime.setTime(QtCore.QTime( - settings.value(u'default service hour', self.defaultServiceHour), - settings.value(u'default service minute', - self.defaultServiceMinute))) + self.serviceNameDay.setCurrentIndex(settings.value(u'default service day', self.defaultServiceDay)) + self.serviceNameTime.setTime(QtCore.QTime(settings.value(u'default service hour', self.defaultServiceHour), + settings.value(u'default service minute',self.defaultServiceMinute))) self.shouldUpdateServiceNameExample = True self.serviceNameEdit.setText(settings.value(u'default service name', self.defaultServiceName)) - default_service_enabled = settings.value( - u'default service enabled', True) + default_service_enabled = settings.value(u'default service enabled', True) self.serviceNameCheckBox.setChecked(default_service_enabled) self.serviceNameCheckBoxToggled(default_service_enabled) # Fix for bug #1014422. @@ -483,11 +378,9 @@ class AdvancedTab(SettingsTab): # Default to False on XFce if os.environ.get(u'DESKTOP_SESSION') == u'xfce': x11_bypass_default = False - self.x11BypassCheckBox.setChecked( - settings.value(u'x11 bypass wm', x11_bypass_default)) + self.x11BypassCheckBox.setChecked(settings.value(u'x11 bypass wm', x11_bypass_default)) self.defaultColor = settings.value(u'default color', u'#ffffff') - self.defaultFileEdit.setText(settings.value(u'default image', - u':/graphics/openlp-splash-screen.png')) + self.defaultFileEdit.setText(settings.value(u'default image', u':/graphics/openlp-splash-screen.png')) self.slide_limits = settings.value(u'slide limits', SlideLimits.End) if self.slide_limits == SlideLimits.End: self.endSlideRadioButton.setChecked(True) @@ -526,11 +419,9 @@ class AdvancedTab(SettingsTab): # Set data location to default. settings.remove(u'advanced/data path') self.currentDataPath = AppLocation.get_data_path() - log.warning(u'User requested data path set to default %s' - % self.currentDataPath) + log.warning(u'User requested data path set to default %s' % self.currentDataPath) self.dataDirectoryLabel.setText(os.path.abspath(self.currentDataPath)) - self.defaultColorButton.setStyleSheet( - u'background-color: %s' % self.defaultColor) + self.defaultColorButton.setStyleSheet(u'background-color: %s' % self.defaultColor) # Don't allow data directory move if running portable. if settings.value(u'advanced/is portable', False): self.dataDirectoryGroupBox.hide() @@ -550,23 +441,15 @@ class AdvancedTab(SettingsTab): self.serviceNameEdit.setText(service_name) else: settings.setValue(u'default service name', service_name) - settings.setValue(u'default service day', - self.serviceNameDay.currentIndex()) - settings.setValue(u'default service hour', - self.serviceNameTime.time().hour()) - settings.setValue(u'default service minute', - self.serviceNameTime.time().minute()) + settings.setValue(u'default service day', self.serviceNameDay.currentIndex()) + settings.setValue(u'default service hour', self.serviceNameTime.time().hour()) + settings.setValue(u'default service minute', self.serviceNameTime.time().minute()) settings.setValue(u'recent file count', self.recentSpinBox.value()) - settings.setValue(u'save current plugin', - self.mediaPluginCheckBox.isChecked()) - settings.setValue(u'double click live', - self.doubleClickLiveCheckBox.isChecked()) - settings.setValue(u'single click preview', - self.singleClickPreviewCheckBox.isChecked()) - settings.setValue(u'expand service item', - self.expandServiceItemCheckBox.isChecked()) - settings.setValue(u'enable exit confirmation', - self.enableAutoCloseCheckBox.isChecked()) + settings.setValue(u'save current plugin', self.mediaPluginCheckBox.isChecked()) + settings.setValue(u'double click live', self.doubleClickLiveCheckBox.isChecked()) + settings.setValue(u'single click preview', self.singleClickPreviewCheckBox.isChecked()) + settings.setValue(u'expand service item', self.expandServiceItemCheckBox.isChecked()) + settings.setValue(u'enable exit confirmation', self.enableAutoCloseCheckBox.isChecked()) settings.setValue(u'hide mouse', self.hideMouseCheckBox.isChecked()) settings.setValue(u'x11 bypass wm', self.x11BypassCheckBox.isChecked()) settings.setValue(u'default color', self.defaultColor) @@ -585,8 +468,7 @@ class AdvancedTab(SettingsTab): def serviceNameCheckBoxToggled(self, default_service_enabled): self.serviceNameDay.setEnabled(default_service_enabled) - time_enabled = default_service_enabled and \ - self.serviceNameDay.currentIndex() is not 7 + time_enabled = default_service_enabled and self.serviceNameDay.currentIndex() is not 7 self.serviceNameTime.setEnabled(time_enabled) self.serviceNameEdit.setEnabled(default_service_enabled) self.serviceNameRevertButton.setEnabled(default_service_enabled) @@ -604,12 +486,10 @@ class AdvancedTab(SettingsTab): local_time = time.replace(hour = self.serviceNameTime.time().hour(), minute = self.serviceNameTime.time().minute()) try: - service_name_example = format_time(unicode( - self.serviceNameEdit.text()), local_time) + service_name_example = format_time(unicode(self.serviceNameEdit.text()), local_time) except ValueError: preset_is_valid = False - service_name_example = translate('OpenLP.AdvancedTab', - 'Syntax error.') + service_name_example = translate('OpenLP.AdvancedTab', 'Syntax error.') return preset_is_valid, service_name_example def updateServiceNameExample(self, returned_value): @@ -631,8 +511,7 @@ class AdvancedTab(SettingsTab): QtGui.QColor(self.defaultColor), self) if new_color.isValid(): self.defaultColor = new_color.name() - self.defaultColorButton.setStyleSheet( - u'background-color: %s' % self.defaultColor) + self.defaultColorButton.setStyleSheet(u'background-color: %s' % self.defaultColor) def onDefaultBrowseButtonClicked(self): file_filters = u'%s;;%s (*.*) (*)' % (get_images_filter(), @@ -650,8 +529,7 @@ class AdvancedTab(SettingsTab): old_root_path = unicode(self.dataDirectoryLabel.text()) # Get the new directory location. new_data_path = unicode(QtGui.QFileDialog.getExistingDirectory(self, - translate('OpenLP.AdvancedTab', - 'Select Data Directory Location'), old_root_path, + translate('OpenLP.AdvancedTab', 'Select Data Directory Location'), old_root_path, options = QtGui.QFileDialog.ShowDirsOnly)) # Set the new data path. if new_data_path: @@ -664,15 +542,10 @@ class AdvancedTab(SettingsTab): # Make sure they want to change the data. answer = QtGui.QMessageBox.question(self, translate('OpenLP.AdvancedTab', 'Confirm Data Directory Change'), - translate('OpenLP.AdvancedTab', - 'Are you sure you want to change the location of the OpenLP ' - 'data directory to:\n\n%s\n\n' - 'The data directory will be changed when OpenLP is closed.' - ).replace('%s', new_data_path), - QtGui.QMessageBox.StandardButtons( - QtGui.QMessageBox.Yes | - QtGui.QMessageBox.No), - QtGui.QMessageBox.No) + translate('OpenLP.AdvancedTab', 'Are you sure you want to change the location of the OpenLP ' + 'data directory to:\n\n%s\n\n ' + 'The data directory will be changed when OpenLP is closed.').replace('%s', new_data_path), + QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Yes | QtGui.QMessageBox.No), QtGui.QMessageBox.No) if answer != QtGui.QMessageBox.Yes: return # Check if data already exists here. @@ -692,14 +565,9 @@ class AdvancedTab(SettingsTab): # default. answer = QtGui.QMessageBox.question(self, translate('OpenLP.AdvancedTab', 'Reset Data Directory'), - translate('OpenLP.AdvancedTab', - 'Are you sure you want to change the location of the OpenLP ' - 'data directory to the default location?\n\n' - 'This location will be used after OpenLP is closed.'), - QtGui.QMessageBox.StandardButtons( - QtGui.QMessageBox.Yes | - QtGui.QMessageBox.No), - QtGui.QMessageBox.No) + translate('OpenLP.AdvancedTab', 'Are you sure you want to change the location of the OpenLP ' + 'data directory to the default location?\n\nThis location will be used after OpenLP is closed.'), + QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Yes | QtGui.QMessageBox.No), QtGui.QMessageBox.No) if answer != QtGui.QMessageBox.Yes: return self.checkDataOverwrite(new_data_path) @@ -728,16 +596,10 @@ class AdvancedTab(SettingsTab): # Check is they want to replace existing data. answer = QtGui.QMessageBox.warning(self, translate('OpenLP.AdvancedTab', 'Overwrite Existing Data'), - translate('OpenLP.AdvancedTab', - 'WARNING: \n\n' - 'The location you have selected \n\n%s\n\n' - 'appears to contain OpenLP data files. Do you wish to replace ' - 'these files with the current data files?' + translate('OpenLP.AdvancedTab', 'WARNING: \n\n The location you have selected \n\n%s\n\n' + 'appears to contain OpenLP data files. Do you wish to replace these files with the current data files?' ).replace('%s', os.path.abspath(data_path,)), - QtGui.QMessageBox.StandardButtons( - QtGui.QMessageBox.Yes | - QtGui.QMessageBox.No), - QtGui.QMessageBox.No) + QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Yes | QtGui.QMessageBox.No), QtGui.QMessageBox.No) if answer == QtGui.QMessageBox.Yes: self.dataDirectoryCopyCheckBox.setChecked(True) self.newDataDirectoryHasFilesLabel.show() diff --git a/openlp/core/ui/exceptiondialog.py b/openlp/core/ui/exceptiondialog.py index 7a30eff64..4e89af583 100644 --- a/openlp/core/ui/exceptiondialog.py +++ b/openlp/core/ui/exceptiondialog.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4 +# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4 ############################################################################### # OpenLP - Open Source Lyrics Projection # @@ -42,8 +42,7 @@ class Ui_ExceptionDialog(object): self.messageLayout.addSpacing(12) self.bugLabel = QtGui.QLabel(exceptionDialog) self.bugLabel.setPixmap(QtGui.QPixmap(u':/graphics/exception.png')) - self.bugLabel.setSizePolicy(QtGui.QSizePolicy.Fixed, - QtGui.QSizePolicy.Fixed) + self.bugLabel.setSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed) self.bugLabel.setObjectName(u'bugLabel') self.messageLayout.addWidget(self.bugLabel) self.messageLayout.addSpacing(12) @@ -65,18 +64,14 @@ class Ui_ExceptionDialog(object): self.exceptionTextEdit.setReadOnly(True) self.exceptionTextEdit.setObjectName(u'exceptionTextEdit') self.exceptionLayout.addWidget(self.exceptionTextEdit) - self.sendReportButton = create_button(exceptionDialog, - u'sendReportButton', icon=u':/general/general_email.png', - click=self.onSendReportButtonClicked) - self.saveReportButton = create_button(exceptionDialog, - u'saveReportButton', icon=u':/general/general_save.png', - click=self.onSaveReportButtonClicked) - self.attachFileButton = create_button(exceptionDialog, - u'attachFileButton', icon=u':/general/general_open.png', - click=self.onAttachFileButtonClicked) + self.sendReportButton = create_button(exceptionDialog, u'sendReportButton', + icon=u':/general/general_email.png', click=self.onSendReportButtonClicked) + self.saveReportButton = create_button(exceptionDialog,u'saveReportButton', + icon=u':/general/general_save.png', click=self.onSaveReportButtonClicked) + self.attachFileButton = create_button(exceptionDialog, u'attachFileButton', + icon=u':/general/general_open.png', click=self.onAttachFileButtonClicked) self.buttonBox = create_button_box(exceptionDialog, u'buttonBox', - [u'close'], [self.sendReportButton, self.saveReportButton, - self.attachFileButton]) + [u'close'], [self.sendReportButton, self.saveReportButton, self.attachFileButton]) self.exceptionLayout.addWidget(self.buttonBox) self.retranslateUi(exceptionDialog) @@ -84,8 +79,7 @@ class Ui_ExceptionDialog(object): QtCore.SIGNAL(u'textChanged()'), self.onDescriptionUpdated) def retranslateUi(self, exceptionDialog): - exceptionDialog.setWindowTitle( - translate('OpenLP.ExceptionDialog', 'Error Occurred')) + exceptionDialog.setWindowTitle(translate('OpenLP.ExceptionDialog', 'Error Occurred')) self.descriptionExplanation.setText(translate('OpenLP.ExceptionDialog', 'Please enter a description of what you were doing to cause this ' 'error \n(Minimum 20 characters)')) diff --git a/openlp/core/ui/exceptionform.py b/openlp/core/ui/exceptionform.py index 19956ad87..fca548485 100644 --- a/openlp/core/ui/exceptionform.py +++ b/openlp/core/ui/exceptionform.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4 +# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4 ############################################################################### # OpenLP - Open Source Lyrics Projection # @@ -72,10 +72,8 @@ try: arg.Name = u'nodepath' arg.Value = u'/org.openoffice.Setup/Product' context = uno.getComponentContext() - provider = context.ServiceManager.createInstance( - u'com.sun.star.configuration.ConfigurationProvider') - node = provider.createInstanceWithArguments( - u'com.sun.star.configuration.ConfigurationAccess', (arg,)) + provider = context.ServiceManager.createInstance(u'com.sun.star.configuration.ConfigurationProvider') + node = provider.createInstanceWithArguments(u'com.sun.star.configuration.ConfigurationAccess', (arg,)) UNO_VERSION = node.getByName(u'ooSetupVersion') except ImportError: UNO_VERSION = u'-' @@ -114,8 +112,7 @@ class ExceptionForm(QtGui.QDialog, Ui_ExceptionDialog): openlp_version = get_application_version() description = self.descriptionTextEdit.toPlainText() traceback = self.exceptionTextEdit.toPlainText() - system = translate('OpenLP.ExceptionForm', - 'Platform: %s\n') % platform.platform() + system = translate('OpenLP.ExceptionForm', 'Platform: %s\n') % platform.platform() libraries = u'Python: %s\n' % platform.python_version() + \ u'Qt4: %s\n' % Qt.qVersion() + \ u'Phonon: %s\n' % PHONON_VERSION + \ @@ -139,7 +136,7 @@ class ExceptionForm(QtGui.QDialog, Ui_ExceptionDialog): def onSaveReportButtonClicked(self): """ - Saving exception log and system informations to a file. + Saving exception log and system information to a file. """ report_text = translate('OpenLP.ExceptionForm', '**OpenLP Bug Report**\n' @@ -155,8 +152,7 @@ class ExceptionForm(QtGui.QDialog, Ui_ExceptionDialog): 'Text files (*.txt *.log *.text)')) if filename: filename = unicode(filename).replace(u'/', os.path.sep) - SettingsManager.set_last_dir(self.settingsSection, os.path.dirname( - filename)) + SettingsManager.set_last_dir(self.settingsSection, os.path.dirname(filename)) report_text = report_text % self._createReport() try: report_file = open(filename, u'w') @@ -211,14 +207,12 @@ class ExceptionForm(QtGui.QDialog, Ui_ExceptionDialog): else: self.__buttonState(False) self.descriptionWordCount.setText( - translate('OpenLP.ExceptionDialog', - 'Description characters to enter : %s') % count) + translate('OpenLP.ExceptionDialog', 'Description characters to enter : %s') % count) def onAttachFileButtonClicked(self): files = QtGui.QFileDialog.getOpenFileName( self, translate('ImagePlugin.ExceptionDialog', 'Select Attachment'), - SettingsManager.get_last_dir(u'exceptions'), - u'%s (*.*) (*)' % UiStrings().AllFiles) + SettingsManager.get_last_dir(u'exceptions'), u'%s (*.*) (*)' % UiStrings().AllFiles) log.info(u'New files(s) %s', unicode(files)) if files: self.fileAttachment = unicode(files) diff --git a/openlp/core/utils/__init__.py b/openlp/core/utils/__init__.py index be9d30e0c..dd0b496b7 100644 --- a/openlp/core/utils/__init__.py +++ b/openlp/core/utils/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4 +# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4 ############################################################################### # OpenLP - Open Source Lyrics Projection # @@ -105,21 +105,15 @@ class AppLocation(object): The directory type you want, for instance the data directory. """ if dir_type == AppLocation.AppDir: - return _get_frozen_path( - os.path.abspath(os.path.split(sys.argv[0])[0]), - os.path.split(openlp.__file__)[0]) + return _get_frozen_path(os.path.abspath(os.path.split(sys.argv[0])[0]), os.path.split(openlp.__file__)[0]) elif dir_type == AppLocation.PluginsDir: app_path = os.path.abspath(os.path.split(sys.argv[0])[0]) return _get_frozen_path(os.path.join(app_path, u'plugins'), os.path.join(os.path.split(openlp.__file__)[0], u'plugins')) elif dir_type == AppLocation.VersionDir: - return _get_frozen_path( - os.path.abspath(os.path.split(sys.argv[0])[0]), - os.path.split(openlp.__file__)[0]) + return _get_frozen_path(os.path.abspath(os.path.split(sys.argv[0])[0]), os.path.split(openlp.__file__)[0]) elif dir_type == AppLocation.LanguageDir: - app_path = _get_frozen_path( - os.path.abspath(os.path.split(sys.argv[0])[0]), - _get_os_dir_path(dir_type)) + app_path = _get_frozen_path(os.path.abspath(os.path.split(sys.argv[0])[0]), _get_os_dir_path(dir_type)) return os.path.join(app_path, u'i18n') elif dir_type == AppLocation.DataDir and AppLocation.BaseDir: return os.path.join(AppLocation.BaseDir, 'data') @@ -157,8 +151,7 @@ def _get_os_dir_path(dir_type): encoding = sys.getfilesystemencoding() if sys.platform == u'win32': if dir_type == AppLocation.DataDir: - return os.path.join(unicode(os.getenv(u'APPDATA'), encoding), - u'openlp', u'data') + return os.path.join(unicode(os.getenv(u'APPDATA'), encoding), u'openlp', u'data') elif dir_type == AppLocation.LanguageDir: return os.path.split(openlp.__file__)[0] return os.path.join(unicode(os.getenv(u'APPDATA'), encoding), @@ -181,17 +174,13 @@ def _get_os_dir_path(dir_type): return os.path.join(u'/usr', u'share', u'openlp') if XDG_BASE_AVAILABLE: if dir_type == AppLocation.ConfigDir: - return os.path.join(unicode(BaseDirectory.xdg_config_home, - encoding), u'openlp') + return os.path.join(unicode(BaseDirectory.xdg_config_home, encoding), u'openlp') elif dir_type == AppLocation.DataDir: - return os.path.join( - unicode(BaseDirectory.xdg_data_home, encoding), u'openlp') + return os.path.join(unicode(BaseDirectory.xdg_data_home, encoding), u'openlp') elif dir_type == AppLocation.CacheDir: - return os.path.join(unicode(BaseDirectory.xdg_cache_home, - encoding), u'openlp') + return os.path.join(unicode(BaseDirectory.xdg_cache_home, encoding), u'openlp') if dir_type == AppLocation.DataDir: - return os.path.join(unicode(os.getenv(u'HOME'), encoding), - u'.openlp', u'data') + return os.path.join(unicode(os.getenv(u'HOME'), encoding), u'.openlp', u'data') return os.path.join(unicode(os.getenv(u'HOME'), encoding), u'.openlp') @@ -231,8 +220,7 @@ def get_application_version(): if revision_id in tags: full_version = u'%s' % tags[revision_id][0] else: - full_version = '%s-bzr%s' % \ - (sorted(b.tags.get_tag_dict().keys())[-1], revno) + full_version = '%s-bzr%s' % (sorted(b.tags.get_tag_dict().keys())[-1], revno) finally: b.unlock() except: @@ -254,8 +242,7 @@ def get_application_version(): if code != 0: raise Exception(u'Error running bzr log') latest = output.split(u':')[0] - full_version = latest == revision and tag or \ - u'%s-bzr%s' % (tag, latest) + full_version = latest == revision and tag or u'%s-bzr%s' % (tag, latest) else: # We're not running the development version, let's use the file. filepath = AppLocation.get_directory(AppLocation.VersionDir) @@ -277,8 +264,7 @@ def get_application_version(): u'build': bits[1] if len(bits) > 1 else None } if APPLICATION_VERSION[u'build']: - log.info(u'Openlp version %s build %s', - APPLICATION_VERSION[u'version'], APPLICATION_VERSION[u'build']) + log.info(u'Openlp version %s build %s', APPLICATION_VERSION[u'version'], APPLICATION_VERSION[u'build']) else: log.info(u'Openlp version %s' % APPLICATION_VERSION[u'version']) return APPLICATION_VERSION @@ -302,8 +288,7 @@ def check_latest_version(current_version): settings.endGroup() if last_test != this_test: if current_version[u'build']: - req = urllib2.Request( - u'http://www.openlp.org/files/dev_version.txt') + req = urllib2.Request(u'http://www.openlp.org/files/dev_version.txt') else: req = urllib2.Request(u'http://www.openlp.org/files/version.txt') req.add_header(u'User-Agent', u'OpenLP/%s' % current_version[u'full']) @@ -358,8 +343,7 @@ def get_images_filter(): for fmt in QtGui.QImageReader.supportedImageFormats()] visible_formats = u'(*.%s)' % u'; *.'.join(formats) actual_formats = u'(*.%s)' % u' *.'.join(formats) - IMAGES_FILTER = u'%s %s %s' % (translate('OpenLP', 'Image Files'), - visible_formats, actual_formats) + IMAGES_FILTER = u'%s %s %s' % (translate('OpenLP', 'Image Files'), visible_formats, actual_formats) return IMAGES_FILTER @@ -463,11 +447,9 @@ def get_uno_instance(resolver): """ log.debug(u'get UNO Desktop Openoffice - resolve') if UNO_CONNECTION_TYPE == u'pipe': - return resolver.resolve(u'uno:pipe,name=openlp_pipe;' \ - + u'urp;StarOffice.ComponentContext') + return resolver.resolve(u'uno:pipe,name=openlp_pipe; urp;StarOffice.ComponentContext') else: - return resolver.resolve(u'uno:socket,host=localhost,port=2002;' \ - + u'urp;StarOffice.ComponentContext') + return resolver.resolve(u'uno:socket,host=localhost,port=2002; urp;StarOffice.ComponentContext') def format_time(text, local_time): diff --git a/openlp/core/utils/actions.py b/openlp/core/utils/actions.py index 01ba34a26..27f58b19e 100644 --- a/openlp/core/utils/actions.py +++ b/openlp/core/utils/actions.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4 +# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4 ############################################################################### # OpenLP - Open Source Lyrics Projection # @@ -287,8 +287,7 @@ class ActionList(object): # Remove empty categories. if not self.categories[category].actions: self.categories.remove(category) - shortcuts = map(unicode, - map(QtGui.QKeySequence.toString, action.shortcuts())) + shortcuts = map(unicode, map(QtGui.QKeySequence.toString, action.shortcuts())) for shortcut in shortcuts: # Remove action from the list of actions which are using this # shortcut. @@ -339,8 +338,7 @@ class ActionList(object): # Remove empty entries. if not ActionList.shortcut_map[old_shortcut]: del ActionList.shortcut_map[old_shortcut] - new_shortcuts = map(unicode, - map(QtGui.QKeySequence.toString, action.shortcuts())) + new_shortcuts = map(unicode, map(QtGui.QKeySequence.toString, action.shortcuts())) # Add the new shortcuts to the map. for new_shortcut in new_shortcuts: existing_actions = ActionList.shortcut_map.get(new_shortcut, []) @@ -358,8 +356,7 @@ class ActionList(object): ``action`` The action which wants to use a particular shortcut. """ - local = action.shortcutContext() in \ - [QtCore.Qt.WindowShortcut, QtCore.Qt.ApplicationShortcut] + local = action.shortcutContext() in [QtCore.Qt.WindowShortcut, QtCore.Qt.ApplicationShortcut] affected_actions = filter(lambda a: isinstance(a, QtGui.QAction), self.getAllChildObjects(action.parent())) if local else [] for existing_action in existing_actions: @@ -367,8 +364,7 @@ class ActionList(object): continue if not local or existing_action in affected_actions: return False - if existing_action.shortcutContext() \ - in [QtCore.Qt.WindowShortcut, QtCore.Qt.ApplicationShortcut]: + if existing_action.shortcutContext() in [QtCore.Qt.WindowShortcut, QtCore.Qt.ApplicationShortcut]: return False elif action in self.getAllChildObjects(existing_action.parent()): return False diff --git a/openlp/core/utils/languagemanager.py b/openlp/core/utils/languagemanager.py index 25aaa7adf..3e7f56ffb 100644 --- a/openlp/core/utils/languagemanager.py +++ b/openlp/core/utils/languagemanager.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4 +# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4 ############################################################################### # OpenLP - Open Source Lyrics Projection # @@ -63,8 +63,7 @@ class LanguageManager(object): app_translator.load(language, lang_path) # A translator for buttons and other default strings provided by Qt. if sys.platform != u'win32' and sys.platform != u'darwin': - lang_path = QtCore.QLibraryInfo.location( - QtCore.QLibraryInfo.TranslationsPath) + lang_path = QtCore.QLibraryInfo.location(QtCore.QLibraryInfo.TranslationsPath) default_translator = QtCore.QTranslator() default_translator.load(u'qt_%s' % language, lang_path) return app_translator, default_translator @@ -76,13 +75,10 @@ class LanguageManager(object): """ log.debug(u'Translation files: %s', AppLocation.get_directory( AppLocation.LanguageDir)) - trans_dir = QtCore.QDir(AppLocation.get_directory( - AppLocation.LanguageDir)) - file_names = trans_dir.entryList( - u'*.qm', QtCore.QDir.Files, QtCore.QDir.Name) + trans_dir = QtCore.QDir(AppLocation.get_directory(AppLocation.LanguageDir)) + file_names = trans_dir.entryList(u'*.qm', QtCore.QDir.Files, QtCore.QDir.Name) # Remove qm files from the list which start with "qt_". - file_names = filter( - lambda file_: not file_.startswith(u'qt_'), file_names) + file_names = filter(lambda file_: not file_.startswith(u'qt_'), file_names) return map(trans_dir.filePath, file_names) @staticmethod @@ -95,8 +91,7 @@ class LanguageManager(object): """ translator = QtCore.QTranslator() translator.load(qm_file) - return translator.translate('OpenLP.MainWindow', 'English', - 'Please add the name of your language here') + return translator.translate('OpenLP.MainWindow', 'English', 'Please add the name of your language here') @staticmethod def get_language(): @@ -138,8 +133,7 @@ class LanguageManager(object): if message: QtGui.QMessageBox.information(None, translate('OpenLP.LanguageManager', 'Language'), - translate('OpenLP.LanguageManager', - 'Please restart OpenLP to use your new language setting.')) + translate('OpenLP.LanguageManager', 'Please restart OpenLP to use your new language setting.')) @staticmethod def init_qm_list(): @@ -152,8 +146,7 @@ class LanguageManager(object): reg_ex = QtCore.QRegExp("^.*i18n/(.*).qm") if reg_ex.exactMatch(qmf): name = u'%s' % reg_ex.cap(1) - LanguageManager.__qm_list__[u'%#2i %s' % (counter + 1, - LanguageManager.language_name(qmf))] = name + LanguageManager.__qm_list__[u'%#2i %s' % (counter + 1, LanguageManager.language_name(qmf))] = name @staticmethod def get_qm_list():