diff --git a/openlp/core/ui/mediadockmanager.py b/openlp/core/ui/mediadockmanager.py index 1a6f86fde..1d86bc7d9 100644 --- a/openlp/core/ui/mediadockmanager.py +++ b/openlp/core/ui/mediadockmanager.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 # @@ -67,8 +67,7 @@ class MediaDockManager(object): log.debug(u'Inserting %s dock' % visible_title[u'title']) match = False for dock_index in range(self.media_dock.count()): - if self.media_dock.widget(dock_index).settingsSection == \ - media_item.plugin.name: + if self.media_dock.widget(dock_index).settingsSection == media_item.plugin.name: match = True break if not match: @@ -85,7 +84,6 @@ class MediaDockManager(object): log.debug(u'remove %s dock' % visible_title[u'title']) for dock_index in range(self.media_dock.count()): if self.media_dock.widget(dock_index): - if self.media_dock.widget(dock_index).settingsSection == \ - media_item.plugin.name: + if self.media_dock.widget(dock_index).settingsSection == media_item.plugin.name: self.media_dock.widget(dock_index).setVisible(False) self.media_dock.removeItem(dock_index) diff --git a/openlp/core/ui/plugindialog.py b/openlp/core/ui/plugindialog.py index d32aafb0a..41d567681 100644 --- a/openlp/core/ui/plugindialog.py +++ b/openlp/core/ui/plugindialog.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 # @@ -61,27 +61,20 @@ class Ui_PluginViewDialog(object): self.aboutLabel = QtGui.QLabel(self.pluginInfoGroupBox) self.aboutLabel.setObjectName(u'aboutLabel') self.aboutTextBrowser = QtGui.QTextBrowser(self.pluginInfoGroupBox) - self.aboutTextBrowser.setTextInteractionFlags( - QtCore.Qt.LinksAccessibleByMouse) + self.aboutTextBrowser.setTextInteractionFlags(QtCore.Qt.LinksAccessibleByMouse) self.aboutTextBrowser.setObjectName(u'aboutTextBrowser') self.pluginInfoLayout.addRow(self.aboutLabel, self.aboutTextBrowser) self.listLayout.addWidget(self.pluginInfoGroupBox) self.pluginLayout.addLayout(self.listLayout) - self.buttonBox = create_button_box(pluginViewDialog, u'buttonBox', - [u'ok']) + self.buttonBox = create_button_box(pluginViewDialog, u'buttonBox', [u'ok']) self.pluginLayout.addWidget(self.buttonBox) self.retranslateUi(pluginViewDialog) def retranslateUi(self, pluginViewDialog): - pluginViewDialog.setWindowTitle( - translate('OpenLP.PluginForm', 'Plugin List')) - self.pluginInfoGroupBox.setTitle( - translate('OpenLP.PluginForm', 'Plugin Details')) + pluginViewDialog.setWindowTitle(translate('OpenLP.PluginForm', 'Plugin List')) + self.pluginInfoGroupBox.setTitle(translate('OpenLP.PluginForm', 'Plugin Details')) self.versionLabel.setText(u'%s:' % UiStrings().Version) self.aboutLabel.setText(u'%s:' % UiStrings().About) - self.statusLabel.setText( - translate('OpenLP.PluginForm', 'Status:')) - self.statusComboBox.setItemText(0, - translate('OpenLP.PluginForm', 'Active')) - self.statusComboBox.setItemText(1, - translate('OpenLP.PluginForm', 'Inactive')) + self.statusLabel.setText(translate('OpenLP.PluginForm', 'Status:')) + self.statusComboBox.setItemText(0, translate('OpenLP.PluginForm', 'Active')) + self.statusComboBox.setItemText(1, translate('OpenLP.PluginForm', 'Inactive')) diff --git a/openlp/core/ui/pluginform.py b/openlp/core/ui/pluginform.py index 9d72becce..2955f469b 100644 --- a/openlp/core/ui/pluginform.py +++ b/openlp/core/ui/pluginform.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 # @@ -48,13 +48,9 @@ class PluginForm(QtGui.QDialog, Ui_PluginViewDialog): self.load() self._clearDetails() # Right, now let's put some signals and slots together! - QtCore.QObject.connect( - self.pluginListWidget, - QtCore.SIGNAL(u'itemSelectionChanged()'), + QtCore.QObject.connect(self.pluginListWidget, QtCore.SIGNAL(u'itemSelectionChanged()'), self.onPluginListWidgetSelectionChanged) - QtCore.QObject.connect( - self.statusComboBox, - QtCore.SIGNAL(u'currentIndexChanged(int)'), + QtCore.QObject.connect(self.statusComboBox, QtCore.SIGNAL(u'currentIndexChanged(int)'), self.onStatusComboBoxChanged) def load(self): @@ -85,10 +81,8 @@ class PluginForm(QtGui.QDialog, Ui_PluginViewDialog): item.setIcon(plugin.icon) self.pluginListWidget.addItem(item) pluginListWidth = max(pluginListWidth, self.fontMetrics().width( - translate('OpenLP.PluginForm', '%s (Inactive)') % - plugin.nameStrings[u'singular'])) - self.pluginListWidget.setFixedWidth(pluginListWidth + - self.pluginListWidget.iconSize().width() + 48) + translate('OpenLP.PluginForm', '%s (Inactive)') % plugin.nameStrings[u'singular'])) + self.pluginListWidget.setFixedWidth(pluginListWidth + self.pluginListWidget.iconSize().width() + 48) def _clearDetails(self): self.statusComboBox.setCurrentIndex(-1) diff --git a/openlp/core/ui/printservicedialog.py b/openlp/core/ui/printservicedialog.py index 3904d4870..df36de45c 100644 --- a/openlp/core/ui/printservicedialog.py +++ b/openlp/core/ui/printservicedialog.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 # @@ -55,21 +55,17 @@ class Ui_PrintServiceDialog(object): self.toolbar = QtGui.QToolBar(printServiceDialog) self.toolbar.setIconSize(QtCore.QSize(22, 22)) self.toolbar.setToolButtonStyle(QtCore.Qt.ToolButtonTextBesideIcon) - self.printButton = self.toolbar.addAction( - build_icon(u':/general/general_print.png'), + self.printButton = self.toolbar.addAction(build_icon(u':/general/general_print.png'), translate('OpenLP.PrintServiceForm', 'Print')) self.optionsButton = QtGui.QToolButton(self.toolbar) - self.optionsButton.setToolButtonStyle( - QtCore.Qt.ToolButtonTextBesideIcon) + self.optionsButton.setToolButtonStyle(QtCore.Qt.ToolButtonTextBesideIcon) self.optionsButton.setIcon(build_icon(u':/system/system_configure.png')) self.optionsButton.setCheckable(True) self.toolbar.addWidget(self.optionsButton) self.toolbar.addSeparator() - self.plainCopy = self.toolbar.addAction( - build_icon(u':/system/system_edit_copy.png'), + self.plainCopy = self.toolbar.addAction(build_icon(u':/system/system_edit_copy.png'), translate('OpenLP.PrintServiceForm', 'Copy')) - self.htmlCopy = self.toolbar.addAction( - build_icon(u':/system/system_edit_copy.png'), + self.htmlCopy = self.toolbar.addAction(build_icon(u':/system/system_edit_copy.png'), translate('OpenLP.PrintServiceForm', 'Copy as HTML')) self.toolbar.addSeparator() self.zoomInButton = QtGui.QToolButton(self.toolbar) @@ -78,14 +74,12 @@ class Ui_PrintServiceDialog(object): self.zoomInButton.setIconSize(QtCore.QSize(22, 22)) self.toolbar.addWidget(self.zoomInButton) self.zoomOutButton = QtGui.QToolButton(self.toolbar) - self.zoomOutButton.setIcon( - build_icon(u':/general/general_zoom_out.png')) + self.zoomOutButton.setIcon(build_icon(u':/general/general_zoom_out.png')) self.zoomOutButton.setObjectName(u'zoomOutButton') self.zoomOutButton.setIconSize(QtCore.QSize(22, 22)) self.toolbar.addWidget(self.zoomOutButton) self.zoomOriginalButton = QtGui.QToolButton(self.toolbar) - self.zoomOriginalButton.setIcon( - build_icon(u':/general/general_zoom_original.png')) + self.zoomOriginalButton.setIcon(build_icon(u':/general/general_zoom_original.png')) self.zoomOriginalButton.setObjectName(u'zoomOriginalButton') self.zoomOriginalButton.setIconSize(QtCore.QSize(22, 22)) self.toolbar.addWidget(self.zoomOriginalButton) @@ -128,34 +122,22 @@ class Ui_PrintServiceDialog(object): self.optionsLayout.addWidget(self.optionsGroupBox) self.retranslateUi(printServiceDialog) - QtCore.QObject.connect(self.optionsButton, - QtCore.SIGNAL(u'toggled(bool)'), self.toggleOptions) + QtCore.QObject.connect(self.optionsButton,QtCore.SIGNAL(u'toggled(bool)'), self.toggleOptions) def retranslateUi(self, printServiceDialog): printServiceDialog.setWindowTitle(UiStrings().PrintService) - self.zoomOutButton.setToolTip(translate('OpenLP.PrintServiceForm', - 'Zoom Out')) - self.zoomOriginalButton.setToolTip(translate('OpenLP.PrintServiceForm', - 'Zoom Original')) - self.zoomInButton.setToolTip(translate('OpenLP.PrintServiceForm', - 'Zoom In')) - self.optionsButton.setText(translate('OpenLP.PrintServiceForm', - 'Options')) + self.zoomOutButton.setToolTip(translate('OpenLP.PrintServiceForm', 'Zoom Out')) + self.zoomOriginalButton.setToolTip(translate('OpenLP.PrintServiceForm', 'Zoom Original')) + self.zoomInButton.setToolTip(translate('OpenLP.PrintServiceForm', 'Zoom In')) + self.optionsButton.setText(translate('OpenLP.PrintServiceForm', 'Options')) self.titleLabel.setText(translate('OpenLP.PrintServiceForm', 'Title:')) - self.footerLabel.setText(translate('OpenLP.PrintServiceForm', - 'Custom Footer Text:')) - self.optionsGroupBox.setTitle( - translate('OpenLP.PrintServiceForm','Other Options')) - self.slideTextCheckBox.setText(translate('OpenLP.PrintServiceForm', - 'Include slide text if available')) - self.pageBreakAfterText.setText(translate('OpenLP.PrintServiceForm', - 'Add page break before each text item')) - self.notesCheckBox.setText(translate('OpenLP.PrintServiceForm', - 'Include service item notes')) - self.metaDataCheckBox.setText(translate('OpenLP.PrintServiceForm', - 'Include play length of media items')) - self.titleLineEdit.setText(translate('OpenLP.PrintServiceForm', - 'Service Sheet')) + self.footerLabel.setText(translate('OpenLP.PrintServiceForm', 'Custom Footer Text:')) + self.optionsGroupBox.setTitle(translate('OpenLP.PrintServiceForm','Other Options')) + self.slideTextCheckBox.setText(translate('OpenLP.PrintServiceForm', 'Include slide text if available')) + self.pageBreakAfterText.setText(translate('OpenLP.PrintServiceForm', 'Add page break before each text item')) + self.notesCheckBox.setText(translate('OpenLP.PrintServiceForm', 'Include service item notes')) + self.metaDataCheckBox.setText(translate('OpenLP.PrintServiceForm', 'Include play length of media items')) + self.titleLineEdit.setText(translate('OpenLP.PrintServiceForm', 'Service Sheet')) # Do not change the order. self.zoomComboBox.addItems([ translate('OpenLP.PrintServiceDialog', 'Fit Page'), diff --git a/openlp/core/ui/printserviceform.py b/openlp/core/ui/printserviceform.py index 8e48874f9..2ed12d72e 100644 --- a/openlp/core/ui/printserviceform.py +++ b/openlp/core/ui/printserviceform.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 # @@ -124,37 +124,24 @@ class PrintServiceForm(QtGui.QDialog, Ui_PrintServiceDialog): # Load the settings for the dialog. settings = Settings() settings.beginGroup(u'advanced') - self.slideTextCheckBox.setChecked(settings.value( - u'print slide text', False)) - self.pageBreakAfterText.setChecked(settings.value( - u'add page break', False)) + self.slideTextCheckBox.setChecked(settings.value(u'print slide text', False)) + self.pageBreakAfterText.setChecked(settings.value(u'add page break', False)) if not self.slideTextCheckBox.isChecked(): self.pageBreakAfterText.setDisabled(True) - self.metaDataCheckBox.setChecked(settings.value( - u'print file meta data', False)) + self.metaDataCheckBox.setChecked(settings.value(u'print file meta data', False)) self.notesCheckBox.setChecked(settings.value(u'print notes', False)) self.zoomComboBox.setCurrentIndex(settings.value(u'display size', 0)) settings.endGroup() # Signals - QtCore.QObject.connect(self.printButton, - QtCore.SIGNAL(u'triggered()'), self.printServiceOrder) - QtCore.QObject.connect(self.zoomOutButton, - QtCore.SIGNAL(u'clicked()'), self.zoomOut) - QtCore.QObject.connect(self.zoomInButton, - QtCore.SIGNAL(u'clicked()'), self.zoomIn) - QtCore.QObject.connect(self.zoomOriginalButton, - QtCore.SIGNAL(u'clicked()'), self.zoomOriginal) - QtCore.QObject.connect(self.previewWidget, - QtCore.SIGNAL(u'paintRequested(QPrinter *)'), self.paintRequested) - QtCore.QObject.connect(self.zoomComboBox, - QtCore.SIGNAL(u'currentIndexChanged(int)'), self.displaySizeChanged) - QtCore.QObject.connect(self.plainCopy, - QtCore.SIGNAL(u'triggered()'), self.copyText) - QtCore.QObject.connect(self.htmlCopy, - QtCore.SIGNAL(u'triggered()'), self.copyHtmlText) - QtCore.QObject.connect(self.slideTextCheckBox, - QtCore.SIGNAL(u'stateChanged(int)'), - self.onSlideTextCheckBoxChanged) + QtCore.QObject.connect(self.printButton, QtCore.SIGNAL(u'triggered()'), self.printServiceOrder) + QtCore.QObject.connect(self.zoomOutButton, QtCore.SIGNAL(u'clicked()'), self.zoomOut) + QtCore.QObject.connect(self.zoomInButton, QtCore.SIGNAL(u'clicked()'), self.zoomIn) + QtCore.QObject.connect(self.zoomOriginalButton, QtCore.SIGNAL(u'clicked()'), self.zoomOriginal) + QtCore.QObject.connect(self.previewWidget, QtCore.SIGNAL(u'paintRequested(QPrinter *)'), self.paintRequested) + QtCore.QObject.connect(self.zoomComboBox, QtCore.SIGNAL(u'currentIndexChanged(int)'), self.displaySizeChanged) + QtCore.QObject.connect(self.plainCopy, QtCore.SIGNAL(u'triggered()'), self.copyText) + QtCore.QObject.connect(self.htmlCopy, QtCore.SIGNAL(u'triggered()'), self.copyHtmlText) + QtCore.QObject.connect(self.slideTextCheckBox, QtCore.SIGNAL(u'stateChanged(int)'), self.onSlideTextCheckBoxChanged) self.updatePreviewText() def toggleOptions(self, checked): @@ -175,8 +162,7 @@ class PrintServiceForm(QtGui.QDialog, Ui_PrintServiceDialog): html_data = self._addElement(u'html') self._addElement(u'head', parent=html_data) self._addElement(u'title', self.titleLineEdit.text(), html_data.head) - css_path = os.path.join( - AppLocation.get_data_path(), u'service_print.css') + css_path = os.path.join(AppLocation.get_data_path(), u'service_print.css') custom_css = get_text_file_string(css_path) if not custom_css: custom_css = DEFAULT_CSS @@ -189,13 +175,10 @@ class PrintServiceForm(QtGui.QDialog, Ui_PrintServiceDialog): self._addPreviewItem(html_data.body, item[u'service_item'], index) # Add the custom service notes: if self.footerTextEdit.toPlainText(): - div = self._addElement(u'div', parent=html_data.body, - classId=u'customNotes') - self._addElement(u'span', translate('OpenLP.ServiceManager', - 'Custom Service Notes: '), div, classId=u'customNotesTitle') - self._addElement(u'span', - cgi.escape(self.footerTextEdit.toPlainText()), - div, classId=u'customNotesText') + div = self._addElement(u'div', parent=html_data.body, classId=u'customNotes') + self._addElement(u'span', translate('OpenLP.ServiceManager', 'Custom Service Notes: '), div, + classId=u'customNotesTitle') + self._addElement(u'span', cgi.escape(self.footerTextEdit.toPlainText()), div, classId=u'customNotesText') self.document.setHtml(html.tostring(html_data)) self.previewWidget.updatePreview() @@ -203,18 +186,15 @@ class PrintServiceForm(QtGui.QDialog, Ui_PrintServiceDialog): div = self._addElement(u'div', classId=u'item', parent=body) # Add the title of the service item. item_title = self._addElement(u'h2', parent=div, classId=u'itemTitle') - self._addElement(u'img', parent=item_title, - attribute=(u'src', item.icon)) - self._addElement(u'span', - u' ' + cgi.escape(item.get_display_title()), item_title) + self._addElement(u'img', parent=item_title, attribute=(u'src', item.icon)) + self._addElement(u'span', u' ' + cgi.escape(item.get_display_title()), item_title) if self.slideTextCheckBox.isChecked(): # Add the text of the service item. if item.is_text(): verse_def = None for slide in item.get_frames(): if not verse_def or verse_def != slide[u'verseTag']: - text_div = self._addElement(u'div', parent=div, - classId=u'itemText') + text_div = self._addElement(u'div', parent=div, classId=u'itemText') else: self._addElement(u'br', parent=text_div) self._addElement(u'span', slide[u'html'], text_div) @@ -232,26 +212,22 @@ class PrintServiceForm(QtGui.QDialog, Ui_PrintServiceDialog): foot_text = foot_text.partition(u'
')[2] if foot_text: foot_text = cgi.escape(foot_text.replace(u'
', u'\n')) - self._addElement(u'div', foot_text.replace(u'\n', u'
'), - parent=div, classId=u'itemFooter') + self._addElement(u'div', foot_text.replace(u'\n', u'
'), parent=div, classId=u'itemFooter') # Add service items' notes. if self.notesCheckBox.isChecked(): if item.notes: p = self._addElement(u'div', classId=u'itemNotes', parent=div) - self._addElement(u'span', - translate('OpenLP.ServiceManager', 'Notes: '), p, + self._addElement(u'span', translate('OpenLP.ServiceManager', 'Notes: '), p, classId=u'itemNotesTitle') - self._addElement(u'span', - cgi.escape(item.notes).replace(u'\n', u'
'), p, - classId=u'itemNotesText') + self._addElement(u'span', cgi.escape(item.notes).replace(u'\n', u'
'), p, classId=u'itemNotesText') # Add play length of media files. if item.is_media() and self.metaDataCheckBox.isChecked(): tme = item.media_length if item.end_time > 0: tme = item.end_time - item.start_time title = self._addElement(u'div', classId=u'media', parent=div) - self._addElement(u'span', translate('OpenLP.ServiceManager', - 'Playing time: '), title, classId=u'mediaTitle') + self._addElement(u'span', translate('OpenLP.ServiceManager', 'Playing time: '), title, + classId=u'mediaTitle') self._addElement(u'span', unicode(datetime.timedelta(seconds=tme)), title, classId=u'mediaText') @@ -407,12 +383,9 @@ class PrintServiceForm(QtGui.QDialog, Ui_PrintServiceDialog): # Save the settings for this dialog. settings = Settings() settings.beginGroup(u'advanced') - settings.setValue(u'print slide text', - self.slideTextCheckBox.isChecked()) - settings.setValue(u'add page break', - self.pageBreakAfterText.isChecked()) - settings.setValue(u'print file meta data', - self.metaDataCheckBox.isChecked()) + settings.setValue(u'print slide text', self.slideTextCheckBox.isChecked()) + settings.setValue(u'add page break', self.pageBreakAfterText.isChecked()) + settings.setValue(u'print file meta data', self.metaDataCheckBox.isChecked()) settings.setValue(u'print notes', self.notesCheckBox.isChecked()) settings.endGroup() @@ -422,5 +395,4 @@ class PrintServiceForm(QtGui.QDialog, Ui_PrintServiceDialog): return for item in self.serviceManager.serviceItems: # Trigger Audit requests - Receiver.send_message(u'print_service_started', - [item[u'service_item']]) + Receiver.send_message(u'print_service_started', [item[u'service_item']]) diff --git a/openlp/core/ui/screen.py b/openlp/core/ui/screen.py index 87c603dbb..6ac7d8c9a 100644 --- a/openlp/core/ui/screen.py +++ b/openlp/core/ui/screen.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 # @@ -70,12 +70,8 @@ class ScreenList(object): screen_list.display_count = 0 screen_list.screen_count_changed() screen_list._load_screen_settings() - QtCore.QObject.connect(desktop, - QtCore.SIGNAL(u'resized(int)'), - screen_list.screen_resolution_changed) - QtCore.QObject.connect(desktop, - QtCore.SIGNAL(u'screenCountChanged(int)'), - screen_list.screen_count_changed) + QtCore.QObject.connect(desktop, QtCore.SIGNAL(u'resized(int)'), screen_list.screen_resolution_changed) + QtCore.QObject.connect(desktop, QtCore.SIGNAL(u'screenCountChanged(int)'), screen_list.screen_count_changed) return screen_list def screen_resolution_changed(self, number): @@ -142,8 +138,7 @@ class ScreenList(object): screen_name = u'%s %d' % (translate('OpenLP.ScreenList', 'Screen'), screen[u'number'] + 1) if screen[u'primary']: - screen_name = u'%s (%s)' % (screen_name, - translate('OpenLP.ScreenList', 'primary')) + screen_name = u'%s (%s)' % (screen_name, translate('OpenLP.ScreenList', 'primary')) screen_list.append(screen_name) return screen_list @@ -160,8 +155,7 @@ class ScreenList(object): u'size': PyQt4.QtCore.QRect(0, 0, 1024, 768) } """ - log.info(u'Screen %d found with resolution %s', - screen[u'number'], screen[u'size']) + log.info(u'Screen %d found with resolution %s', screen[u'number'], screen[u'size']) if screen[u'primary']: self.current = screen self.override = copy.deepcopy(self.current) @@ -249,8 +243,7 @@ class ScreenList(object): """ settings = Settings() settings.beginGroup(u'general') - self.set_current_display(settings.value(u'monitor', - self.display_count - 1)) + self.set_current_display(settings.value(u'monitor', self.display_count - 1)) self.display = settings.value(u'display on monitor', True) override_display = settings.value(u'override position', False) x = settings.value(u'x position', self.current[u'size'].x()) diff --git a/openlp/core/ui/serviceitemeditdialog.py b/openlp/core/ui/serviceitemeditdialog.py index afe1e6cdb..725a5efea 100644 --- a/openlp/core/ui/serviceitemeditdialog.py +++ b/openlp/core/ui/serviceitemeditdialog.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 # @@ -45,23 +45,20 @@ class Ui_ServiceItemEditDialog(object): self.dialogLayout.addWidget(self.listWidget, 0, 0) self.buttonLayout = QtGui.QVBoxLayout() self.buttonLayout.setObjectName(u'buttonLayout') - self.deleteButton = create_button(serviceItemEditDialog, - u'deleteButton', role=u'delete', + self.deleteButton = create_button(serviceItemEditDialog, u'deleteButton', role=u'delete', click=serviceItemEditDialog.onDeleteButtonClicked) self.buttonLayout.addWidget(self.deleteButton) self.buttonLayout.addStretch() - self.upButton = create_button(serviceItemEditDialog, u'upButton', - role=u'up', click=serviceItemEditDialog.onUpButtonClicked) - self.downButton = create_button(serviceItemEditDialog, u'downButton', - role=u'down', click=serviceItemEditDialog.onDownButtonClicked) + self.upButton = create_button(serviceItemEditDialog, u'upButton', role=u'up', + click=serviceItemEditDialog.onUpButtonClicked) + self.downButton = create_button(serviceItemEditDialog, u'downButton', role=u'down', + click=serviceItemEditDialog.onDownButtonClicked) self.buttonLayout.addWidget(self.upButton) self.buttonLayout.addWidget(self.downButton) self.dialogLayout.addLayout(self.buttonLayout, 0, 1) - self.buttonBox = create_button_box(serviceItemEditDialog, u'buttonBox', - [u'cancel', u'save']) + self.buttonBox = create_button_box(serviceItemEditDialog, u'buttonBox', [u'cancel', u'save']) self.dialogLayout.addWidget(self.buttonBox, 1, 0, 1, 2) self.retranslateUi(serviceItemEditDialog) def retranslateUi(self, serviceItemEditDialog): - serviceItemEditDialog.setWindowTitle( - translate('OpenLP.ServiceItemEditForm', 'Reorder Service Item')) + serviceItemEditDialog.setWindowTitle(translate('OpenLP.ServiceItemEditForm', 'Reorder Service Item')) diff --git a/openlp/core/ui/serviceitemeditform.py b/openlp/core/ui/serviceitemeditform.py index 292054782..071cd88a9 100644 --- a/openlp/core/ui/serviceitemeditform.py +++ b/openlp/core/ui/serviceitemeditform.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 ServiceItemEditForm(QtGui.QDialog, Ui_ServiceItemEditDialog): QtGui.QDialog.__init__(self, parent) self.setupUi(self) self.itemList = [] - QtCore.QObject.connect(self.listWidget, - QtCore.SIGNAL(u'currentRowChanged(int)'), self.onCurrentRowChanged) + QtCore.QObject.connect(self.listWidget, QtCore.SIGNAL(u'currentRowChanged(int)'), self.onCurrentRowChanged) def setServiceItem(self, item): self.item = item diff --git a/openlp/core/ui/servicenoteform.py b/openlp/core/ui/servicenoteform.py index e2bc3ed57..f5343f156 100644 --- a/openlp/core/ui/servicenoteform.py +++ b/openlp/core/ui/servicenoteform.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 # @@ -57,10 +57,8 @@ class ServiceNoteForm(QtGui.QDialog): self.textEdit = SpellTextEdit(self, False) self.textEdit.setObjectName(u'textEdit') self.dialogLayout.addWidget(self.textEdit) - self.buttonBox = create_button_box(self, u'buttonBox', - [u'cancel', u'save']) + self.buttonBox = create_button_box(self, u'buttonBox', [u'cancel', u'save']) self.dialogLayout.addWidget(self.buttonBox) def retranslateUi(self): - self.setWindowTitle( - translate('OpenLP.ServiceNoteForm', 'Service Item Notes')) + self.setWindowTitle(translate('OpenLP.ServiceNoteForm', 'Service Item Notes')) diff --git a/openlp/core/ui/settingsdialog.py b/openlp/core/ui/settingsdialog.py index baee8bc38..0c50b066e 100644 --- a/openlp/core/ui/settingsdialog.py +++ b/openlp/core/ui/settingsdialog.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,29 +36,23 @@ class Ui_SettingsDialog(object): def setupUi(self, settingsDialog): settingsDialog.setObjectName(u'settingsDialog') settingsDialog.resize(800, 500) - settingsDialog.setWindowIcon( - build_icon(u':/system/system_settings.png')) + settingsDialog.setWindowIcon(build_icon(u':/system/system_settings.png')) self.dialogLayout = QtGui.QGridLayout(settingsDialog) self.dialogLayout.setObjectName(u'dialogLayout') self.dialogLayout.setMargin(8) self.settingListWidget = QtGui.QListWidget(settingsDialog) self.settingListWidget.setUniformItemSizes(True) self.settingListWidget.setMinimumSize(QtCore.QSize(150, 0)) - self.settingListWidget.setHorizontalScrollBarPolicy( - QtCore.Qt.ScrollBarAlwaysOff) + self.settingListWidget.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff) self.settingListWidget.setObjectName(u'settingListWidget') self.dialogLayout.addWidget(self.settingListWidget, 0, 0, 1, 1) self.stackedLayout = QtGui.QStackedLayout() self.stackedLayout.setObjectName(u'stackedLayout') self.dialogLayout.addLayout(self.stackedLayout, 0, 1, 1, 1) - self.buttonBox = create_button_box(settingsDialog, u'buttonBox', - [u'cancel', u'ok']) + self.buttonBox = create_button_box(settingsDialog, u'buttonBox', [u'cancel', u'ok']) self.dialogLayout.addWidget(self.buttonBox, 1, 1, 1, 1) self.retranslateUi(settingsDialog) - QtCore.QObject.connect(self.settingListWidget, - QtCore.SIGNAL(u'currentRowChanged(int)'), - self.tabChanged) + QtCore.QObject.connect(self.settingListWidget, QtCore.SIGNAL(u'currentRowChanged(int)'), self.tabChanged) def retranslateUi(self, settingsDialog): - settingsDialog.setWindowTitle(translate('OpenLP.SettingsForm', - 'Configure OpenLP')) + settingsDialog.setWindowTitle(translate('OpenLP.SettingsForm', 'Configure OpenLP')) diff --git a/openlp/core/ui/settingsform.py b/openlp/core/ui/settingsform.py index 570adce42..2be59318e 100644 --- a/openlp/core/ui/settingsform.py +++ b/openlp/core/ui/settingsform.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/shortcutlistdialog.py b/openlp/core/ui/shortcutlistdialog.py index 9522ac227..84ed2ce92 100644 --- a/openlp/core/ui/shortcutlistdialog.py +++ b/openlp/core/ui/shortcutlistdialog.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 # @@ -81,27 +81,23 @@ class Ui_ShortcutListDialog(object): self.primaryPushButton = CaptureShortcutButton(shortcutListDialog) self.primaryPushButton.setObjectName(u'primaryPushButton') self.primaryPushButton.setMinimumSize(QtCore.QSize(84, 0)) - self.primaryPushButton.setIcon( - build_icon(u':/system/system_configure_shortcuts.png')) + self.primaryPushButton.setIcon(build_icon(u':/system/system_configure_shortcuts.png')) self.primaryLayout.addWidget(self.primaryPushButton) self.clearPrimaryButton = QtGui.QToolButton(shortcutListDialog) self.clearPrimaryButton.setObjectName(u'clearPrimaryButton') self.clearPrimaryButton.setMinimumSize(QtCore.QSize(0, 16)) - self.clearPrimaryButton.setIcon( - build_icon(u':/system/clear_shortcut.png')) + self.clearPrimaryButton.setIcon(build_icon(u':/system/clear_shortcut.png')) self.primaryLayout.addWidget(self.clearPrimaryButton) self.detailsLayout.addLayout(self.primaryLayout, 1, 1, 1, 1) self.alternateLayout = QtGui.QHBoxLayout() self.alternateLayout.setObjectName(u'alternateLayout') self.alternatePushButton = CaptureShortcutButton(shortcutListDialog) self.alternatePushButton.setObjectName(u'alternatePushButton') - self.alternatePushButton.setIcon( - build_icon(u':/system/system_configure_shortcuts.png')) + self.alternatePushButton.setIcon(build_icon(u':/system/system_configure_shortcuts.png')) self.alternateLayout.addWidget(self.alternatePushButton) self.clearAlternateButton = QtGui.QToolButton(shortcutListDialog) self.clearAlternateButton.setObjectName(u'clearAlternateButton') - self.clearAlternateButton.setIcon( - build_icon(u':/system/clear_shortcut.png')) + self.clearAlternateButton.setIcon(build_icon(u':/system/clear_shortcut.png')) self.alternateLayout.addWidget(self.clearAlternateButton) self.detailsLayout.addLayout(self.alternateLayout, 1, 2, 1, 1) self.primaryLabel = QtGui.QLabel(shortcutListDialog) @@ -111,33 +107,24 @@ class Ui_ShortcutListDialog(object): self.alternateLabel.setObjectName(u'alternateLabel') self.detailsLayout.addWidget(self.alternateLabel, 0, 2, 1, 1) self.shortcutListLayout.addLayout(self.detailsLayout) - self.buttonBox = create_button_box(shortcutListDialog, u'buttonBox', - [u'cancel', u'ok', u'defaults']) + self.buttonBox = create_button_box(shortcutListDialog, u'buttonBox', [u'cancel', u'ok', u'defaults']) self.buttonBox.setOrientation(QtCore.Qt.Horizontal) self.shortcutListLayout.addWidget(self.buttonBox) self.retranslateUi(shortcutListDialog) def retranslateUi(self, shortcutListDialog): - shortcutListDialog.setWindowTitle( - translate('OpenLP.ShortcutListDialog', 'Configure Shortcuts')) - self.descriptionLabel.setText(translate('OpenLP.ShortcutListDialog', - 'Select an action and click one of the buttons below to start ' - 'capturing a new primary or alternate shortcut, respectively.')) - self.treeWidget.setHeaderLabels([ - translate('OpenLP.ShortcutListDialog', 'Action'), + shortcutListDialog.setWindowTitle(translate('OpenLP.ShortcutListDialog', 'Configure Shortcuts')) + self.descriptionLabel.setText( + translate('OpenLP.ShortcutListDialog', 'Select an action and click one of the buttons below to start ' + 'capturing a new primary or alternate shortcut, respectively.')) + self.treeWidget.setHeaderLabels([translate('OpenLP.ShortcutListDialog', 'Action'), translate('OpenLP.ShortcutListDialog', 'Shortcut'), translate('OpenLP.ShortcutListDialog', 'Alternate')]) - self.defaultRadioButton.setText( - translate('OpenLP.ShortcutListDialog', 'Default')) - self.customRadioButton.setText( - translate('OpenLP.ShortcutListDialog', 'Custom')) - self.primaryPushButton.setToolTip( - translate('OpenLP.ShortcutListDialog', 'Capture shortcut.')) - self.alternatePushButton.setToolTip( - translate('OpenLP.ShortcutListDialog', 'Capture shortcut.')) - self.clearPrimaryButton.setToolTip( - translate('OpenLP.ShortcutListDialog', + self.defaultRadioButton.setText(translate('OpenLP.ShortcutListDialog', 'Default')) + self.customRadioButton.setText(translate('OpenLP.ShortcutListDialog', 'Custom')) + self.primaryPushButton.setToolTip(translate('OpenLP.ShortcutListDialog', 'Capture shortcut.')) + self.alternatePushButton.setToolTip(translate('OpenLP.ShortcutListDialog', 'Capture shortcut.')) + self.clearPrimaryButton.setToolTip(translate('OpenLP.ShortcutListDialog', 'Restore the default shortcut of this action.')) - self.clearAlternateButton.setToolTip( - translate('OpenLP.ShortcutListDialog', + self.clearAlternateButton.setToolTip(translate('OpenLP.ShortcutListDialog', 'Restore the default shortcut of this action.')) diff --git a/openlp/core/ui/shortcutlistform.py b/openlp/core/ui/shortcutlistform.py index d43c69b67..6f4358b4f 100644 --- a/openlp/core/ui/shortcutlistform.py +++ b/openlp/core/ui/shortcutlistform.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 # @@ -51,57 +51,49 @@ class ShortcutListForm(QtGui.QDialog, Ui_ShortcutListDialog): self.setupUi(self) self.changedActions = {} self.action_list = ActionList.get_instance() - QtCore.QObject.connect(self.primaryPushButton, - QtCore.SIGNAL(u'toggled(bool)'), self.onPrimaryPushButtonClicked) - QtCore.QObject.connect(self.alternatePushButton, - QtCore.SIGNAL(u'toggled(bool)'), self.onAlternatePushButtonClicked) - QtCore.QObject.connect(self.treeWidget, QtCore.SIGNAL( - u'currentItemChanged(QTreeWidgetItem*, QTreeWidgetItem*)'), - self.onCurrentItemChanged) + QtCore.QObject.connect(self.primaryPushButton, QtCore.SIGNAL(u'toggled(bool)'), + self.onPrimaryPushButtonClicked) + QtCore.QObject.connect(self.alternatePushButton, QtCore.SIGNAL(u'toggled(bool)'), + self.onAlternatePushButtonClicked) QtCore.QObject.connect(self.treeWidget, - QtCore.SIGNAL(u'itemDoubleClicked(QTreeWidgetItem*, int)'), + QtCore.SIGNAL(u'currentItemChanged(QTreeWidgetItem*, QTreeWidgetItem*)'), self.onCurrentItemChanged) + QtCore.QObject.connect(self.treeWidget, QtCore.SIGNAL(u'itemDoubleClicked(QTreeWidgetItem*, int)'), self.onItemDoubleClicked) - QtCore.QObject.connect(self.clearPrimaryButton, - QtCore.SIGNAL(u'clicked(bool)'), self.onClearPrimaryButtonClicked) - QtCore.QObject.connect(self.clearAlternateButton, - QtCore.SIGNAL(u'clicked(bool)'), self.onClearAlternateButtonClicked) - QtCore.QObject.connect(self.buttonBox, - QtCore.SIGNAL(u'clicked(QAbstractButton*)'), + QtCore.QObject.connect(self.clearPrimaryButton, QtCore.SIGNAL(u'clicked(bool)'), + self.onClearPrimaryButtonClicked) + QtCore.QObject.connect(self.clearAlternateButton, QtCore.SIGNAL(u'clicked(bool)'), + self.onClearAlternateButtonClicked) + QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(u'clicked(QAbstractButton*)'), self.onRestoreDefaultsClicked) - QtCore.QObject.connect(self.defaultRadioButton, - QtCore.SIGNAL(u'clicked(bool)'), self.onDefaultRadioButtonClicked) - QtCore.QObject.connect(self.customRadioButton, - QtCore.SIGNAL(u'clicked(bool)'), self.onCustomRadioButtonClicked) + QtCore.QObject.connect(self.defaultRadioButton, QtCore.SIGNAL(u'clicked(bool)'), + self.onDefaultRadioButtonClicked) + QtCore.QObject.connect(self.customRadioButton, QtCore.SIGNAL(u'clicked(bool)'), + self.onCustomRadioButtonClicked) def keyPressEvent(self, event): if event.key() == QtCore.Qt.Key_Space: self.keyReleaseEvent(event) - elif self.primaryPushButton.isChecked() or \ - self.alternatePushButton.isChecked(): + elif self.primaryPushButton.isChecked() or self.alternatePushButton.isChecked(): event.ignore() elif event.key() == QtCore.Qt.Key_Escape: event.accept() self.close() def keyReleaseEvent(self, event): - if not self.primaryPushButton.isChecked() and \ - not self.alternatePushButton.isChecked(): + if not self.primaryPushButton.isChecked() and not self.alternatePushButton.isChecked(): return key = event.key() if key == QtCore.Qt.Key_Shift or key == QtCore.Qt.Key_Control or \ key == QtCore.Qt.Key_Meta or key == QtCore.Qt.Key_Alt: return key_string = QtGui.QKeySequence(key).toString() - if event.modifiers() & QtCore.Qt.ControlModifier == \ - QtCore.Qt.ControlModifier: + if event.modifiers() & QtCore.Qt.ControlModifier == QtCore.Qt.ControlModifier: key_string = u'Ctrl+' + key_string if event.modifiers() & QtCore.Qt.AltModifier == QtCore.Qt.AltModifier: key_string = u'Alt+' + key_string - if event.modifiers() & QtCore.Qt.ShiftModifier == \ - QtCore.Qt.ShiftModifier: + if event.modifiers() & QtCore.Qt.ShiftModifier == QtCore.Qt.ShiftModifier: key_string = u'Shift+' + key_string - if event.modifiers() & QtCore.Qt.MetaModifier == \ - QtCore.Qt.MetaModifier: + if event.modifiers() & QtCore.Qt.MetaModifier == QtCore.Qt.MetaModifier: key_string = u'Meta+' + key_string key_sequence = QtGui.QKeySequence(key_string) if self._validiate_shortcut(self._currentItemAction(), key_sequence): @@ -272,8 +264,7 @@ class ShortcutListForm(QtGui.QDialog, Ui_ShortcutListDialog): # been triggered by a signal. if item is None: return - if primary_label_text == primary_text and \ - alternate_label_text == alternate_text: + if primary_label_text == primary_text and alternate_label_text == alternate_text: self.defaultRadioButton.toggle() else: self.customRadioButton.toggle() @@ -282,15 +273,12 @@ class ShortcutListForm(QtGui.QDialog, Ui_ShortcutListDialog): """ Restores all default shortcuts. """ - if self.buttonBox.buttonRole(button) != \ - QtGui.QDialogButtonBox.ResetRole: + if self.buttonBox.buttonRole(button) != QtGui.QDialogButtonBox.ResetRole: return - if QtGui.QMessageBox.question(self, - translate('OpenLP.ShortcutListDialog', 'Restore Default Shortcuts'), + if QtGui.QMessageBox.question(self, translate('OpenLP.ShortcutListDialog', 'Restore Default Shortcuts'), translate('OpenLP.ShortcutListDialog', 'Do you want to restore all ' - 'shortcuts to their defaults?'), QtGui.QMessageBox.StandardButtons( - QtGui.QMessageBox.Yes | - QtGui.QMessageBox.No)) == QtGui.QMessageBox.No: + 'shortcuts to their defaults?'), + QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Yes | QtGui.QMessageBox.No)) == QtGui.QMessageBox.No: return self._adjustButton(self.primaryPushButton, False, text=u'') self._adjustButton(self.alternatePushButton, False, text=u'') @@ -372,8 +360,7 @@ class ShortcutListForm(QtGui.QDialog, Ui_ShortcutListDialog): # shortcut (not the default one) will become primary shortcut, thus # the check will assume that an action were going to have the same # shortcut twice. - if not self._validiate_shortcut(action, new_shortcuts[0]) and \ - new_shortcuts[0] != shortcuts[0]: + if not self._validiate_shortcut(action, new_shortcuts[0]) and new_shortcuts[0] != shortcuts[0]: return if len(shortcuts) == 2: new_shortcuts.append(shortcuts[1]) @@ -421,11 +408,9 @@ class ShortcutListForm(QtGui.QDialog, Ui_ShortcutListDialog): if key_sequence not in shortcuts: continue if action is changing_action: - if self.primaryPushButton.isChecked() and \ - shortcuts.index(key_sequence) == 0: + if self.primaryPushButton.isChecked() and shortcuts.index(key_sequence) == 0: continue - if self.alternatePushButton.isChecked() and \ - shortcuts.index(key_sequence) == 1: + if self.alternatePushButton.isChecked() and shortcuts.index(key_sequence) == 1: continue # Have the same parent, thus they cannot have the same shortcut. if action.parent() is changing_action.parent(): @@ -436,16 +421,14 @@ class ShortcutListForm(QtGui.QDialog, Ui_ShortcutListDialog): if action.shortcutContext() in [QtCore.Qt.WindowShortcut, QtCore.Qt.ApplicationShortcut]: is_valid = False - if changing_action.shortcutContext() in \ - [QtCore.Qt.WindowShortcut, QtCore.Qt.ApplicationShortcut]: + if changing_action.shortcutContext() in [QtCore.Qt.WindowShortcut, QtCore.Qt.ApplicationShortcut]: is_valid = False if not is_valid: Receiver.send_message(u'openlp_warning_message', { - u'title': translate('OpenLP.ShortcutListDialog', - 'Duplicate Shortcut'), + u'title': translate('OpenLP.ShortcutListDialog', 'Duplicate Shortcut'), u'message': translate('OpenLP.ShortcutListDialog', - 'The shortcut "%s" is already assigned to another action, ' - 'please use a different shortcut.') % key_sequence.toString() + 'The shortcut "%s" is already assigned to another action, ' + 'please use a different shortcut.') % key_sequence.toString() }) return is_valid diff --git a/openlp/core/ui/splashscreen.py b/openlp/core/ui/splashscreen.py index 2af80e6fe..89c8cae76 100644 --- a/openlp/core/ui/splashscreen.py +++ b/openlp/core/ui/splashscreen.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 # @@ -34,8 +34,7 @@ class SplashScreen(QtGui.QSplashScreen): def __init__(self): QtGui.QSplashScreen.__init__(self) self.setupUi() - QtCore.QObject.connect(Receiver.get_receiver(), - QtCore.SIGNAL(u'close_splash'), self.close) + QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'close_splash'), self.close) def setupUi(self): self.setObjectName(u'splashScreen')