Splash screen done

This commit is contained in:
Tim Bentley 2012-12-29 13:35:16 +00:00
parent 4b6292220a
commit 345b5638c8
14 changed files with 143 additions and 254 deletions

View File

@ -1,5 +1,5 @@
# -*- coding: utf-8 -*- # -*- 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 # # OpenLP - Open Source Lyrics Projection #
@ -67,8 +67,7 @@ class MediaDockManager(object):
log.debug(u'Inserting %s dock' % visible_title[u'title']) log.debug(u'Inserting %s dock' % visible_title[u'title'])
match = False match = False
for dock_index in range(self.media_dock.count()): for dock_index in range(self.media_dock.count()):
if self.media_dock.widget(dock_index).settingsSection == \ if self.media_dock.widget(dock_index).settingsSection == media_item.plugin.name:
media_item.plugin.name:
match = True match = True
break break
if not match: if not match:
@ -85,7 +84,6 @@ class MediaDockManager(object):
log.debug(u'remove %s dock' % visible_title[u'title']) log.debug(u'remove %s dock' % visible_title[u'title'])
for dock_index in range(self.media_dock.count()): for dock_index in range(self.media_dock.count()):
if self.media_dock.widget(dock_index): if self.media_dock.widget(dock_index):
if self.media_dock.widget(dock_index).settingsSection == \ if self.media_dock.widget(dock_index).settingsSection == media_item.plugin.name:
media_item.plugin.name:
self.media_dock.widget(dock_index).setVisible(False) self.media_dock.widget(dock_index).setVisible(False)
self.media_dock.removeItem(dock_index) self.media_dock.removeItem(dock_index)

View File

@ -1,5 +1,5 @@
# -*- coding: utf-8 -*- # -*- 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 # # OpenLP - Open Source Lyrics Projection #
@ -61,27 +61,20 @@ class Ui_PluginViewDialog(object):
self.aboutLabel = QtGui.QLabel(self.pluginInfoGroupBox) self.aboutLabel = QtGui.QLabel(self.pluginInfoGroupBox)
self.aboutLabel.setObjectName(u'aboutLabel') self.aboutLabel.setObjectName(u'aboutLabel')
self.aboutTextBrowser = QtGui.QTextBrowser(self.pluginInfoGroupBox) self.aboutTextBrowser = QtGui.QTextBrowser(self.pluginInfoGroupBox)
self.aboutTextBrowser.setTextInteractionFlags( self.aboutTextBrowser.setTextInteractionFlags(QtCore.Qt.LinksAccessibleByMouse)
QtCore.Qt.LinksAccessibleByMouse)
self.aboutTextBrowser.setObjectName(u'aboutTextBrowser') self.aboutTextBrowser.setObjectName(u'aboutTextBrowser')
self.pluginInfoLayout.addRow(self.aboutLabel, self.aboutTextBrowser) self.pluginInfoLayout.addRow(self.aboutLabel, self.aboutTextBrowser)
self.listLayout.addWidget(self.pluginInfoGroupBox) self.listLayout.addWidget(self.pluginInfoGroupBox)
self.pluginLayout.addLayout(self.listLayout) self.pluginLayout.addLayout(self.listLayout)
self.buttonBox = create_button_box(pluginViewDialog, u'buttonBox', self.buttonBox = create_button_box(pluginViewDialog, u'buttonBox', [u'ok'])
[u'ok'])
self.pluginLayout.addWidget(self.buttonBox) self.pluginLayout.addWidget(self.buttonBox)
self.retranslateUi(pluginViewDialog) self.retranslateUi(pluginViewDialog)
def retranslateUi(self, pluginViewDialog): def retranslateUi(self, pluginViewDialog):
pluginViewDialog.setWindowTitle( pluginViewDialog.setWindowTitle(translate('OpenLP.PluginForm', 'Plugin List'))
translate('OpenLP.PluginForm', 'Plugin List')) self.pluginInfoGroupBox.setTitle(translate('OpenLP.PluginForm', 'Plugin Details'))
self.pluginInfoGroupBox.setTitle(
translate('OpenLP.PluginForm', 'Plugin Details'))
self.versionLabel.setText(u'%s:' % UiStrings().Version) self.versionLabel.setText(u'%s:' % UiStrings().Version)
self.aboutLabel.setText(u'%s:' % UiStrings().About) self.aboutLabel.setText(u'%s:' % UiStrings().About)
self.statusLabel.setText( self.statusLabel.setText(translate('OpenLP.PluginForm', 'Status:'))
translate('OpenLP.PluginForm', 'Status:')) self.statusComboBox.setItemText(0, translate('OpenLP.PluginForm', 'Active'))
self.statusComboBox.setItemText(0, self.statusComboBox.setItemText(1, translate('OpenLP.PluginForm', 'Inactive'))
translate('OpenLP.PluginForm', 'Active'))
self.statusComboBox.setItemText(1,
translate('OpenLP.PluginForm', 'Inactive'))

View File

@ -1,5 +1,5 @@
# -*- coding: utf-8 -*- # -*- 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 # # OpenLP - Open Source Lyrics Projection #
@ -48,13 +48,9 @@ class PluginForm(QtGui.QDialog, Ui_PluginViewDialog):
self.load() self.load()
self._clearDetails() self._clearDetails()
# Right, now let's put some signals and slots together! # Right, now let's put some signals and slots together!
QtCore.QObject.connect( QtCore.QObject.connect(self.pluginListWidget, QtCore.SIGNAL(u'itemSelectionChanged()'),
self.pluginListWidget,
QtCore.SIGNAL(u'itemSelectionChanged()'),
self.onPluginListWidgetSelectionChanged) self.onPluginListWidgetSelectionChanged)
QtCore.QObject.connect( QtCore.QObject.connect(self.statusComboBox, QtCore.SIGNAL(u'currentIndexChanged(int)'),
self.statusComboBox,
QtCore.SIGNAL(u'currentIndexChanged(int)'),
self.onStatusComboBoxChanged) self.onStatusComboBoxChanged)
def load(self): def load(self):
@ -85,10 +81,8 @@ class PluginForm(QtGui.QDialog, Ui_PluginViewDialog):
item.setIcon(plugin.icon) item.setIcon(plugin.icon)
self.pluginListWidget.addItem(item) self.pluginListWidget.addItem(item)
pluginListWidth = max(pluginListWidth, self.fontMetrics().width( pluginListWidth = max(pluginListWidth, self.fontMetrics().width(
translate('OpenLP.PluginForm', '%s (Inactive)') % translate('OpenLP.PluginForm', '%s (Inactive)') % plugin.nameStrings[u'singular']))
plugin.nameStrings[u'singular'])) self.pluginListWidget.setFixedWidth(pluginListWidth + self.pluginListWidget.iconSize().width() + 48)
self.pluginListWidget.setFixedWidth(pluginListWidth +
self.pluginListWidget.iconSize().width() + 48)
def _clearDetails(self): def _clearDetails(self):
self.statusComboBox.setCurrentIndex(-1) self.statusComboBox.setCurrentIndex(-1)

View File

@ -1,5 +1,5 @@
# -*- coding: utf-8 -*- # -*- 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 # # OpenLP - Open Source Lyrics Projection #
@ -55,21 +55,17 @@ class Ui_PrintServiceDialog(object):
self.toolbar = QtGui.QToolBar(printServiceDialog) self.toolbar = QtGui.QToolBar(printServiceDialog)
self.toolbar.setIconSize(QtCore.QSize(22, 22)) self.toolbar.setIconSize(QtCore.QSize(22, 22))
self.toolbar.setToolButtonStyle(QtCore.Qt.ToolButtonTextBesideIcon) self.toolbar.setToolButtonStyle(QtCore.Qt.ToolButtonTextBesideIcon)
self.printButton = self.toolbar.addAction( self.printButton = self.toolbar.addAction(build_icon(u':/general/general_print.png'),
build_icon(u':/general/general_print.png'),
translate('OpenLP.PrintServiceForm', 'Print')) translate('OpenLP.PrintServiceForm', 'Print'))
self.optionsButton = QtGui.QToolButton(self.toolbar) self.optionsButton = QtGui.QToolButton(self.toolbar)
self.optionsButton.setToolButtonStyle( self.optionsButton.setToolButtonStyle(QtCore.Qt.ToolButtonTextBesideIcon)
QtCore.Qt.ToolButtonTextBesideIcon)
self.optionsButton.setIcon(build_icon(u':/system/system_configure.png')) self.optionsButton.setIcon(build_icon(u':/system/system_configure.png'))
self.optionsButton.setCheckable(True) self.optionsButton.setCheckable(True)
self.toolbar.addWidget(self.optionsButton) self.toolbar.addWidget(self.optionsButton)
self.toolbar.addSeparator() self.toolbar.addSeparator()
self.plainCopy = self.toolbar.addAction( self.plainCopy = self.toolbar.addAction(build_icon(u':/system/system_edit_copy.png'),
build_icon(u':/system/system_edit_copy.png'),
translate('OpenLP.PrintServiceForm', 'Copy')) translate('OpenLP.PrintServiceForm', 'Copy'))
self.htmlCopy = self.toolbar.addAction( self.htmlCopy = self.toolbar.addAction(build_icon(u':/system/system_edit_copy.png'),
build_icon(u':/system/system_edit_copy.png'),
translate('OpenLP.PrintServiceForm', 'Copy as HTML')) translate('OpenLP.PrintServiceForm', 'Copy as HTML'))
self.toolbar.addSeparator() self.toolbar.addSeparator()
self.zoomInButton = QtGui.QToolButton(self.toolbar) self.zoomInButton = QtGui.QToolButton(self.toolbar)
@ -78,14 +74,12 @@ class Ui_PrintServiceDialog(object):
self.zoomInButton.setIconSize(QtCore.QSize(22, 22)) self.zoomInButton.setIconSize(QtCore.QSize(22, 22))
self.toolbar.addWidget(self.zoomInButton) self.toolbar.addWidget(self.zoomInButton)
self.zoomOutButton = QtGui.QToolButton(self.toolbar) self.zoomOutButton = QtGui.QToolButton(self.toolbar)
self.zoomOutButton.setIcon( self.zoomOutButton.setIcon(build_icon(u':/general/general_zoom_out.png'))
build_icon(u':/general/general_zoom_out.png'))
self.zoomOutButton.setObjectName(u'zoomOutButton') self.zoomOutButton.setObjectName(u'zoomOutButton')
self.zoomOutButton.setIconSize(QtCore.QSize(22, 22)) self.zoomOutButton.setIconSize(QtCore.QSize(22, 22))
self.toolbar.addWidget(self.zoomOutButton) self.toolbar.addWidget(self.zoomOutButton)
self.zoomOriginalButton = QtGui.QToolButton(self.toolbar) self.zoomOriginalButton = QtGui.QToolButton(self.toolbar)
self.zoomOriginalButton.setIcon( self.zoomOriginalButton.setIcon(build_icon(u':/general/general_zoom_original.png'))
build_icon(u':/general/general_zoom_original.png'))
self.zoomOriginalButton.setObjectName(u'zoomOriginalButton') self.zoomOriginalButton.setObjectName(u'zoomOriginalButton')
self.zoomOriginalButton.setIconSize(QtCore.QSize(22, 22)) self.zoomOriginalButton.setIconSize(QtCore.QSize(22, 22))
self.toolbar.addWidget(self.zoomOriginalButton) self.toolbar.addWidget(self.zoomOriginalButton)
@ -128,34 +122,22 @@ class Ui_PrintServiceDialog(object):
self.optionsLayout.addWidget(self.optionsGroupBox) self.optionsLayout.addWidget(self.optionsGroupBox)
self.retranslateUi(printServiceDialog) self.retranslateUi(printServiceDialog)
QtCore.QObject.connect(self.optionsButton, QtCore.QObject.connect(self.optionsButton,QtCore.SIGNAL(u'toggled(bool)'), self.toggleOptions)
QtCore.SIGNAL(u'toggled(bool)'), self.toggleOptions)
def retranslateUi(self, printServiceDialog): def retranslateUi(self, printServiceDialog):
printServiceDialog.setWindowTitle(UiStrings().PrintService) printServiceDialog.setWindowTitle(UiStrings().PrintService)
self.zoomOutButton.setToolTip(translate('OpenLP.PrintServiceForm', self.zoomOutButton.setToolTip(translate('OpenLP.PrintServiceForm', 'Zoom Out'))
'Zoom Out')) self.zoomOriginalButton.setToolTip(translate('OpenLP.PrintServiceForm', 'Zoom Original'))
self.zoomOriginalButton.setToolTip(translate('OpenLP.PrintServiceForm', self.zoomInButton.setToolTip(translate('OpenLP.PrintServiceForm', 'Zoom In'))
'Zoom Original')) self.optionsButton.setText(translate('OpenLP.PrintServiceForm', 'Options'))
self.zoomInButton.setToolTip(translate('OpenLP.PrintServiceForm',
'Zoom In'))
self.optionsButton.setText(translate('OpenLP.PrintServiceForm',
'Options'))
self.titleLabel.setText(translate('OpenLP.PrintServiceForm', 'Title:')) self.titleLabel.setText(translate('OpenLP.PrintServiceForm', 'Title:'))
self.footerLabel.setText(translate('OpenLP.PrintServiceForm', self.footerLabel.setText(translate('OpenLP.PrintServiceForm', 'Custom Footer Text:'))
'Custom Footer Text:')) self.optionsGroupBox.setTitle(translate('OpenLP.PrintServiceForm','Other Options'))
self.optionsGroupBox.setTitle( self.slideTextCheckBox.setText(translate('OpenLP.PrintServiceForm', 'Include slide text if available'))
translate('OpenLP.PrintServiceForm','Other Options')) self.pageBreakAfterText.setText(translate('OpenLP.PrintServiceForm', 'Add page break before each text item'))
self.slideTextCheckBox.setText(translate('OpenLP.PrintServiceForm', self.notesCheckBox.setText(translate('OpenLP.PrintServiceForm', 'Include service item notes'))
'Include slide text if available')) self.metaDataCheckBox.setText(translate('OpenLP.PrintServiceForm', 'Include play length of media items'))
self.pageBreakAfterText.setText(translate('OpenLP.PrintServiceForm', self.titleLineEdit.setText(translate('OpenLP.PrintServiceForm', 'Service Sheet'))
'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. # Do not change the order.
self.zoomComboBox.addItems([ self.zoomComboBox.addItems([
translate('OpenLP.PrintServiceDialog', 'Fit Page'), translate('OpenLP.PrintServiceDialog', 'Fit Page'),

View File

@ -1,5 +1,5 @@
# -*- coding: utf-8 -*- # -*- 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 # # OpenLP - Open Source Lyrics Projection #
@ -124,37 +124,24 @@ class PrintServiceForm(QtGui.QDialog, Ui_PrintServiceDialog):
# Load the settings for the dialog. # Load the settings for the dialog.
settings = Settings() settings = Settings()
settings.beginGroup(u'advanced') settings.beginGroup(u'advanced')
self.slideTextCheckBox.setChecked(settings.value( self.slideTextCheckBox.setChecked(settings.value(u'print slide text', False))
u'print slide text', False)) self.pageBreakAfterText.setChecked(settings.value(u'add page break', False))
self.pageBreakAfterText.setChecked(settings.value(
u'add page break', False))
if not self.slideTextCheckBox.isChecked(): if not self.slideTextCheckBox.isChecked():
self.pageBreakAfterText.setDisabled(True) self.pageBreakAfterText.setDisabled(True)
self.metaDataCheckBox.setChecked(settings.value( self.metaDataCheckBox.setChecked(settings.value(u'print file meta data', False))
u'print file meta data', False))
self.notesCheckBox.setChecked(settings.value(u'print notes', False)) self.notesCheckBox.setChecked(settings.value(u'print notes', False))
self.zoomComboBox.setCurrentIndex(settings.value(u'display size', 0)) self.zoomComboBox.setCurrentIndex(settings.value(u'display size', 0))
settings.endGroup() settings.endGroup()
# Signals # Signals
QtCore.QObject.connect(self.printButton, QtCore.QObject.connect(self.printButton, QtCore.SIGNAL(u'triggered()'), self.printServiceOrder)
QtCore.SIGNAL(u'triggered()'), self.printServiceOrder) QtCore.QObject.connect(self.zoomOutButton, QtCore.SIGNAL(u'clicked()'), self.zoomOut)
QtCore.QObject.connect(self.zoomOutButton, QtCore.QObject.connect(self.zoomInButton, QtCore.SIGNAL(u'clicked()'), self.zoomIn)
QtCore.SIGNAL(u'clicked()'), self.zoomOut) QtCore.QObject.connect(self.zoomOriginalButton, QtCore.SIGNAL(u'clicked()'), self.zoomOriginal)
QtCore.QObject.connect(self.zoomInButton, QtCore.QObject.connect(self.previewWidget, QtCore.SIGNAL(u'paintRequested(QPrinter *)'), self.paintRequested)
QtCore.SIGNAL(u'clicked()'), self.zoomIn) QtCore.QObject.connect(self.zoomComboBox, QtCore.SIGNAL(u'currentIndexChanged(int)'), self.displaySizeChanged)
QtCore.QObject.connect(self.zoomOriginalButton, QtCore.QObject.connect(self.plainCopy, QtCore.SIGNAL(u'triggered()'), self.copyText)
QtCore.SIGNAL(u'clicked()'), self.zoomOriginal) QtCore.QObject.connect(self.htmlCopy, QtCore.SIGNAL(u'triggered()'), self.copyHtmlText)
QtCore.QObject.connect(self.previewWidget, QtCore.QObject.connect(self.slideTextCheckBox, QtCore.SIGNAL(u'stateChanged(int)'), self.onSlideTextCheckBoxChanged)
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() self.updatePreviewText()
def toggleOptions(self, checked): def toggleOptions(self, checked):
@ -175,8 +162,7 @@ class PrintServiceForm(QtGui.QDialog, Ui_PrintServiceDialog):
html_data = self._addElement(u'html') html_data = self._addElement(u'html')
self._addElement(u'head', parent=html_data) self._addElement(u'head', parent=html_data)
self._addElement(u'title', self.titleLineEdit.text(), html_data.head) self._addElement(u'title', self.titleLineEdit.text(), html_data.head)
css_path = os.path.join( css_path = os.path.join(AppLocation.get_data_path(), u'service_print.css')
AppLocation.get_data_path(), u'service_print.css')
custom_css = get_text_file_string(css_path) custom_css = get_text_file_string(css_path)
if not custom_css: if not custom_css:
custom_css = DEFAULT_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) self._addPreviewItem(html_data.body, item[u'service_item'], index)
# Add the custom service notes: # Add the custom service notes:
if self.footerTextEdit.toPlainText(): if self.footerTextEdit.toPlainText():
div = self._addElement(u'div', parent=html_data.body, div = self._addElement(u'div', parent=html_data.body, classId=u'customNotes')
classId=u'customNotes') self._addElement(u'span', translate('OpenLP.ServiceManager', 'Custom Service Notes: '), div,
self._addElement(u'span', translate('OpenLP.ServiceManager', classId=u'customNotesTitle')
'Custom Service Notes: '), div, classId=u'customNotesTitle') self._addElement(u'span', cgi.escape(self.footerTextEdit.toPlainText()), div, classId=u'customNotesText')
self._addElement(u'span',
cgi.escape(self.footerTextEdit.toPlainText()),
div, classId=u'customNotesText')
self.document.setHtml(html.tostring(html_data)) self.document.setHtml(html.tostring(html_data))
self.previewWidget.updatePreview() self.previewWidget.updatePreview()
@ -203,18 +186,15 @@ class PrintServiceForm(QtGui.QDialog, Ui_PrintServiceDialog):
div = self._addElement(u'div', classId=u'item', parent=body) div = self._addElement(u'div', classId=u'item', parent=body)
# Add the title of the service item. # Add the title of the service item.
item_title = self._addElement(u'h2', parent=div, classId=u'itemTitle') item_title = self._addElement(u'h2', parent=div, classId=u'itemTitle')
self._addElement(u'img', parent=item_title, self._addElement(u'img', parent=item_title, attribute=(u'src', item.icon))
attribute=(u'src', item.icon)) self._addElement(u'span', u' ' + cgi.escape(item.get_display_title()), item_title)
self._addElement(u'span',
u' ' + cgi.escape(item.get_display_title()), item_title)
if self.slideTextCheckBox.isChecked(): if self.slideTextCheckBox.isChecked():
# Add the text of the service item. # Add the text of the service item.
if item.is_text(): if item.is_text():
verse_def = None verse_def = None
for slide in item.get_frames(): for slide in item.get_frames():
if not verse_def or verse_def != slide[u'verseTag']: if not verse_def or verse_def != slide[u'verseTag']:
text_div = self._addElement(u'div', parent=div, text_div = self._addElement(u'div', parent=div, classId=u'itemText')
classId=u'itemText')
else: else:
self._addElement(u'br', parent=text_div) self._addElement(u'br', parent=text_div)
self._addElement(u'span', slide[u'html'], 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'<br>')[2] foot_text = foot_text.partition(u'<br>')[2]
if foot_text: if foot_text:
foot_text = cgi.escape(foot_text.replace(u'<br>', u'\n')) foot_text = cgi.escape(foot_text.replace(u'<br>', u'\n'))
self._addElement(u'div', foot_text.replace(u'\n', u'<br>'), self._addElement(u'div', foot_text.replace(u'\n', u'<br>'), parent=div, classId=u'itemFooter')
parent=div, classId=u'itemFooter')
# Add service items' notes. # Add service items' notes.
if self.notesCheckBox.isChecked(): if self.notesCheckBox.isChecked():
if item.notes: if item.notes:
p = self._addElement(u'div', classId=u'itemNotes', parent=div) p = self._addElement(u'div', classId=u'itemNotes', parent=div)
self._addElement(u'span', self._addElement(u'span', translate('OpenLP.ServiceManager', 'Notes: '), p,
translate('OpenLP.ServiceManager', 'Notes: '), p,
classId=u'itemNotesTitle') classId=u'itemNotesTitle')
self._addElement(u'span', self._addElement(u'span', cgi.escape(item.notes).replace(u'\n', u'<br>'), p, classId=u'itemNotesText')
cgi.escape(item.notes).replace(u'\n', u'<br>'), p,
classId=u'itemNotesText')
# Add play length of media files. # Add play length of media files.
if item.is_media() and self.metaDataCheckBox.isChecked(): if item.is_media() and self.metaDataCheckBox.isChecked():
tme = item.media_length tme = item.media_length
if item.end_time > 0: if item.end_time > 0:
tme = item.end_time - item.start_time tme = item.end_time - item.start_time
title = self._addElement(u'div', classId=u'media', parent=div) title = self._addElement(u'div', classId=u'media', parent=div)
self._addElement(u'span', translate('OpenLP.ServiceManager', self._addElement(u'span', translate('OpenLP.ServiceManager', 'Playing time: '), title,
'Playing time: '), title, classId=u'mediaTitle') classId=u'mediaTitle')
self._addElement(u'span', unicode(datetime.timedelta(seconds=tme)), self._addElement(u'span', unicode(datetime.timedelta(seconds=tme)),
title, classId=u'mediaText') title, classId=u'mediaText')
@ -407,12 +383,9 @@ class PrintServiceForm(QtGui.QDialog, Ui_PrintServiceDialog):
# Save the settings for this dialog. # Save the settings for this dialog.
settings = Settings() settings = Settings()
settings.beginGroup(u'advanced') settings.beginGroup(u'advanced')
settings.setValue(u'print slide text', settings.setValue(u'print slide text', self.slideTextCheckBox.isChecked())
self.slideTextCheckBox.isChecked()) settings.setValue(u'add page break', self.pageBreakAfterText.isChecked())
settings.setValue(u'add page break', settings.setValue(u'print file meta data', self.metaDataCheckBox.isChecked())
self.pageBreakAfterText.isChecked())
settings.setValue(u'print file meta data',
self.metaDataCheckBox.isChecked())
settings.setValue(u'print notes', self.notesCheckBox.isChecked()) settings.setValue(u'print notes', self.notesCheckBox.isChecked())
settings.endGroup() settings.endGroup()
@ -422,5 +395,4 @@ class PrintServiceForm(QtGui.QDialog, Ui_PrintServiceDialog):
return return
for item in self.serviceManager.serviceItems: for item in self.serviceManager.serviceItems:
# Trigger Audit requests # Trigger Audit requests
Receiver.send_message(u'print_service_started', Receiver.send_message(u'print_service_started', [item[u'service_item']])
[item[u'service_item']])

View File

@ -1,5 +1,5 @@
# -*- coding: utf-8 -*- # -*- 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 # # OpenLP - Open Source Lyrics Projection #
@ -70,12 +70,8 @@ class ScreenList(object):
screen_list.display_count = 0 screen_list.display_count = 0
screen_list.screen_count_changed() screen_list.screen_count_changed()
screen_list._load_screen_settings() screen_list._load_screen_settings()
QtCore.QObject.connect(desktop, QtCore.QObject.connect(desktop, QtCore.SIGNAL(u'resized(int)'), screen_list.screen_resolution_changed)
QtCore.SIGNAL(u'resized(int)'), QtCore.QObject.connect(desktop, QtCore.SIGNAL(u'screenCountChanged(int)'), screen_list.screen_count_changed)
screen_list.screen_resolution_changed)
QtCore.QObject.connect(desktop,
QtCore.SIGNAL(u'screenCountChanged(int)'),
screen_list.screen_count_changed)
return screen_list return screen_list
def screen_resolution_changed(self, number): def screen_resolution_changed(self, number):
@ -142,8 +138,7 @@ class ScreenList(object):
screen_name = u'%s %d' % (translate('OpenLP.ScreenList', 'Screen'), screen_name = u'%s %d' % (translate('OpenLP.ScreenList', 'Screen'),
screen[u'number'] + 1) screen[u'number'] + 1)
if screen[u'primary']: if screen[u'primary']:
screen_name = u'%s (%s)' % (screen_name, screen_name = u'%s (%s)' % (screen_name, translate('OpenLP.ScreenList', 'primary'))
translate('OpenLP.ScreenList', 'primary'))
screen_list.append(screen_name) screen_list.append(screen_name)
return screen_list return screen_list
@ -160,8 +155,7 @@ class ScreenList(object):
u'size': PyQt4.QtCore.QRect(0, 0, 1024, 768) u'size': PyQt4.QtCore.QRect(0, 0, 1024, 768)
} }
""" """
log.info(u'Screen %d found with resolution %s', log.info(u'Screen %d found with resolution %s', screen[u'number'], screen[u'size'])
screen[u'number'], screen[u'size'])
if screen[u'primary']: if screen[u'primary']:
self.current = screen self.current = screen
self.override = copy.deepcopy(self.current) self.override = copy.deepcopy(self.current)
@ -249,8 +243,7 @@ class ScreenList(object):
""" """
settings = Settings() settings = Settings()
settings.beginGroup(u'general') settings.beginGroup(u'general')
self.set_current_display(settings.value(u'monitor', self.set_current_display(settings.value(u'monitor', self.display_count - 1))
self.display_count - 1))
self.display = settings.value(u'display on monitor', True) self.display = settings.value(u'display on monitor', True)
override_display = settings.value(u'override position', False) override_display = settings.value(u'override position', False)
x = settings.value(u'x position', self.current[u'size'].x()) x = settings.value(u'x position', self.current[u'size'].x())

View File

@ -1,5 +1,5 @@
# -*- coding: utf-8 -*- # -*- 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 # # OpenLP - Open Source Lyrics Projection #
@ -45,23 +45,20 @@ class Ui_ServiceItemEditDialog(object):
self.dialogLayout.addWidget(self.listWidget, 0, 0) self.dialogLayout.addWidget(self.listWidget, 0, 0)
self.buttonLayout = QtGui.QVBoxLayout() self.buttonLayout = QtGui.QVBoxLayout()
self.buttonLayout.setObjectName(u'buttonLayout') self.buttonLayout.setObjectName(u'buttonLayout')
self.deleteButton = create_button(serviceItemEditDialog, self.deleteButton = create_button(serviceItemEditDialog, u'deleteButton', role=u'delete',
u'deleteButton', role=u'delete',
click=serviceItemEditDialog.onDeleteButtonClicked) click=serviceItemEditDialog.onDeleteButtonClicked)
self.buttonLayout.addWidget(self.deleteButton) self.buttonLayout.addWidget(self.deleteButton)
self.buttonLayout.addStretch() self.buttonLayout.addStretch()
self.upButton = create_button(serviceItemEditDialog, u'upButton', self.upButton = create_button(serviceItemEditDialog, u'upButton', role=u'up',
role=u'up', click=serviceItemEditDialog.onUpButtonClicked) click=serviceItemEditDialog.onUpButtonClicked)
self.downButton = create_button(serviceItemEditDialog, u'downButton', self.downButton = create_button(serviceItemEditDialog, u'downButton', role=u'down',
role=u'down', click=serviceItemEditDialog.onDownButtonClicked) click=serviceItemEditDialog.onDownButtonClicked)
self.buttonLayout.addWidget(self.upButton) self.buttonLayout.addWidget(self.upButton)
self.buttonLayout.addWidget(self.downButton) self.buttonLayout.addWidget(self.downButton)
self.dialogLayout.addLayout(self.buttonLayout, 0, 1) self.dialogLayout.addLayout(self.buttonLayout, 0, 1)
self.buttonBox = create_button_box(serviceItemEditDialog, u'buttonBox', self.buttonBox = create_button_box(serviceItemEditDialog, u'buttonBox', [u'cancel', u'save'])
[u'cancel', u'save'])
self.dialogLayout.addWidget(self.buttonBox, 1, 0, 1, 2) self.dialogLayout.addWidget(self.buttonBox, 1, 0, 1, 2)
self.retranslateUi(serviceItemEditDialog) self.retranslateUi(serviceItemEditDialog)
def retranslateUi(self, serviceItemEditDialog): def retranslateUi(self, serviceItemEditDialog):
serviceItemEditDialog.setWindowTitle( serviceItemEditDialog.setWindowTitle(translate('OpenLP.ServiceItemEditForm', 'Reorder Service Item'))
translate('OpenLP.ServiceItemEditForm', 'Reorder Service Item'))

View File

@ -1,5 +1,5 @@
# -*- coding: utf-8 -*- # -*- 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 # # OpenLP - Open Source Lyrics Projection #
@ -42,8 +42,7 @@ class ServiceItemEditForm(QtGui.QDialog, Ui_ServiceItemEditDialog):
QtGui.QDialog.__init__(self, parent) QtGui.QDialog.__init__(self, parent)
self.setupUi(self) self.setupUi(self)
self.itemList = [] self.itemList = []
QtCore.QObject.connect(self.listWidget, QtCore.QObject.connect(self.listWidget, QtCore.SIGNAL(u'currentRowChanged(int)'), self.onCurrentRowChanged)
QtCore.SIGNAL(u'currentRowChanged(int)'), self.onCurrentRowChanged)
def setServiceItem(self, item): def setServiceItem(self, item):
self.item = item self.item = item

View File

@ -1,5 +1,5 @@
# -*- coding: utf-8 -*- # -*- 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 # # OpenLP - Open Source Lyrics Projection #
@ -57,10 +57,8 @@ class ServiceNoteForm(QtGui.QDialog):
self.textEdit = SpellTextEdit(self, False) self.textEdit = SpellTextEdit(self, False)
self.textEdit.setObjectName(u'textEdit') self.textEdit.setObjectName(u'textEdit')
self.dialogLayout.addWidget(self.textEdit) self.dialogLayout.addWidget(self.textEdit)
self.buttonBox = create_button_box(self, u'buttonBox', self.buttonBox = create_button_box(self, u'buttonBox', [u'cancel', u'save'])
[u'cancel', u'save'])
self.dialogLayout.addWidget(self.buttonBox) self.dialogLayout.addWidget(self.buttonBox)
def retranslateUi(self): def retranslateUi(self):
self.setWindowTitle( self.setWindowTitle(translate('OpenLP.ServiceNoteForm', 'Service Item Notes'))
translate('OpenLP.ServiceNoteForm', 'Service Item Notes'))

View File

@ -1,5 +1,5 @@
# -*- coding: utf-8 -*- # -*- 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 # # OpenLP - Open Source Lyrics Projection #
@ -36,29 +36,23 @@ class Ui_SettingsDialog(object):
def setupUi(self, settingsDialog): def setupUi(self, settingsDialog):
settingsDialog.setObjectName(u'settingsDialog') settingsDialog.setObjectName(u'settingsDialog')
settingsDialog.resize(800, 500) settingsDialog.resize(800, 500)
settingsDialog.setWindowIcon( settingsDialog.setWindowIcon(build_icon(u':/system/system_settings.png'))
build_icon(u':/system/system_settings.png'))
self.dialogLayout = QtGui.QGridLayout(settingsDialog) self.dialogLayout = QtGui.QGridLayout(settingsDialog)
self.dialogLayout.setObjectName(u'dialogLayout') self.dialogLayout.setObjectName(u'dialogLayout')
self.dialogLayout.setMargin(8) self.dialogLayout.setMargin(8)
self.settingListWidget = QtGui.QListWidget(settingsDialog) self.settingListWidget = QtGui.QListWidget(settingsDialog)
self.settingListWidget.setUniformItemSizes(True) self.settingListWidget.setUniformItemSizes(True)
self.settingListWidget.setMinimumSize(QtCore.QSize(150, 0)) self.settingListWidget.setMinimumSize(QtCore.QSize(150, 0))
self.settingListWidget.setHorizontalScrollBarPolicy( self.settingListWidget.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff)
QtCore.Qt.ScrollBarAlwaysOff)
self.settingListWidget.setObjectName(u'settingListWidget') self.settingListWidget.setObjectName(u'settingListWidget')
self.dialogLayout.addWidget(self.settingListWidget, 0, 0, 1, 1) self.dialogLayout.addWidget(self.settingListWidget, 0, 0, 1, 1)
self.stackedLayout = QtGui.QStackedLayout() self.stackedLayout = QtGui.QStackedLayout()
self.stackedLayout.setObjectName(u'stackedLayout') self.stackedLayout.setObjectName(u'stackedLayout')
self.dialogLayout.addLayout(self.stackedLayout, 0, 1, 1, 1) self.dialogLayout.addLayout(self.stackedLayout, 0, 1, 1, 1)
self.buttonBox = create_button_box(settingsDialog, u'buttonBox', self.buttonBox = create_button_box(settingsDialog, u'buttonBox', [u'cancel', u'ok'])
[u'cancel', u'ok'])
self.dialogLayout.addWidget(self.buttonBox, 1, 1, 1, 1) self.dialogLayout.addWidget(self.buttonBox, 1, 1, 1, 1)
self.retranslateUi(settingsDialog) self.retranslateUi(settingsDialog)
QtCore.QObject.connect(self.settingListWidget, QtCore.QObject.connect(self.settingListWidget, QtCore.SIGNAL(u'currentRowChanged(int)'), self.tabChanged)
QtCore.SIGNAL(u'currentRowChanged(int)'),
self.tabChanged)
def retranslateUi(self, settingsDialog): def retranslateUi(self, settingsDialog):
settingsDialog.setWindowTitle(translate('OpenLP.SettingsForm', settingsDialog.setWindowTitle(translate('OpenLP.SettingsForm', 'Configure OpenLP'))
'Configure OpenLP'))

View File

@ -1,5 +1,5 @@
# -*- coding: utf-8 -*- # -*- 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 # # OpenLP - Open Source Lyrics Projection #

View File

@ -1,5 +1,5 @@
# -*- coding: utf-8 -*- # -*- 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 # # OpenLP - Open Source Lyrics Projection #
@ -81,27 +81,23 @@ class Ui_ShortcutListDialog(object):
self.primaryPushButton = CaptureShortcutButton(shortcutListDialog) self.primaryPushButton = CaptureShortcutButton(shortcutListDialog)
self.primaryPushButton.setObjectName(u'primaryPushButton') self.primaryPushButton.setObjectName(u'primaryPushButton')
self.primaryPushButton.setMinimumSize(QtCore.QSize(84, 0)) self.primaryPushButton.setMinimumSize(QtCore.QSize(84, 0))
self.primaryPushButton.setIcon( self.primaryPushButton.setIcon(build_icon(u':/system/system_configure_shortcuts.png'))
build_icon(u':/system/system_configure_shortcuts.png'))
self.primaryLayout.addWidget(self.primaryPushButton) self.primaryLayout.addWidget(self.primaryPushButton)
self.clearPrimaryButton = QtGui.QToolButton(shortcutListDialog) self.clearPrimaryButton = QtGui.QToolButton(shortcutListDialog)
self.clearPrimaryButton.setObjectName(u'clearPrimaryButton') self.clearPrimaryButton.setObjectName(u'clearPrimaryButton')
self.clearPrimaryButton.setMinimumSize(QtCore.QSize(0, 16)) self.clearPrimaryButton.setMinimumSize(QtCore.QSize(0, 16))
self.clearPrimaryButton.setIcon( self.clearPrimaryButton.setIcon(build_icon(u':/system/clear_shortcut.png'))
build_icon(u':/system/clear_shortcut.png'))
self.primaryLayout.addWidget(self.clearPrimaryButton) self.primaryLayout.addWidget(self.clearPrimaryButton)
self.detailsLayout.addLayout(self.primaryLayout, 1, 1, 1, 1) self.detailsLayout.addLayout(self.primaryLayout, 1, 1, 1, 1)
self.alternateLayout = QtGui.QHBoxLayout() self.alternateLayout = QtGui.QHBoxLayout()
self.alternateLayout.setObjectName(u'alternateLayout') self.alternateLayout.setObjectName(u'alternateLayout')
self.alternatePushButton = CaptureShortcutButton(shortcutListDialog) self.alternatePushButton = CaptureShortcutButton(shortcutListDialog)
self.alternatePushButton.setObjectName(u'alternatePushButton') self.alternatePushButton.setObjectName(u'alternatePushButton')
self.alternatePushButton.setIcon( self.alternatePushButton.setIcon(build_icon(u':/system/system_configure_shortcuts.png'))
build_icon(u':/system/system_configure_shortcuts.png'))
self.alternateLayout.addWidget(self.alternatePushButton) self.alternateLayout.addWidget(self.alternatePushButton)
self.clearAlternateButton = QtGui.QToolButton(shortcutListDialog) self.clearAlternateButton = QtGui.QToolButton(shortcutListDialog)
self.clearAlternateButton.setObjectName(u'clearAlternateButton') self.clearAlternateButton.setObjectName(u'clearAlternateButton')
self.clearAlternateButton.setIcon( self.clearAlternateButton.setIcon(build_icon(u':/system/clear_shortcut.png'))
build_icon(u':/system/clear_shortcut.png'))
self.alternateLayout.addWidget(self.clearAlternateButton) self.alternateLayout.addWidget(self.clearAlternateButton)
self.detailsLayout.addLayout(self.alternateLayout, 1, 2, 1, 1) self.detailsLayout.addLayout(self.alternateLayout, 1, 2, 1, 1)
self.primaryLabel = QtGui.QLabel(shortcutListDialog) self.primaryLabel = QtGui.QLabel(shortcutListDialog)
@ -111,33 +107,24 @@ class Ui_ShortcutListDialog(object):
self.alternateLabel.setObjectName(u'alternateLabel') self.alternateLabel.setObjectName(u'alternateLabel')
self.detailsLayout.addWidget(self.alternateLabel, 0, 2, 1, 1) self.detailsLayout.addWidget(self.alternateLabel, 0, 2, 1, 1)
self.shortcutListLayout.addLayout(self.detailsLayout) self.shortcutListLayout.addLayout(self.detailsLayout)
self.buttonBox = create_button_box(shortcutListDialog, u'buttonBox', self.buttonBox = create_button_box(shortcutListDialog, u'buttonBox', [u'cancel', u'ok', u'defaults'])
[u'cancel', u'ok', u'defaults'])
self.buttonBox.setOrientation(QtCore.Qt.Horizontal) self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
self.shortcutListLayout.addWidget(self.buttonBox) self.shortcutListLayout.addWidget(self.buttonBox)
self.retranslateUi(shortcutListDialog) self.retranslateUi(shortcutListDialog)
def retranslateUi(self, shortcutListDialog): def retranslateUi(self, shortcutListDialog):
shortcutListDialog.setWindowTitle( shortcutListDialog.setWindowTitle(translate('OpenLP.ShortcutListDialog', 'Configure Shortcuts'))
translate('OpenLP.ShortcutListDialog', 'Configure Shortcuts')) self.descriptionLabel.setText(
self.descriptionLabel.setText(translate('OpenLP.ShortcutListDialog', translate('OpenLP.ShortcutListDialog', 'Select an action and click one of the buttons below to start '
'Select an action and click one of the buttons below to start ' 'capturing a new primary or alternate shortcut, respectively.'))
'capturing a new primary or alternate shortcut, respectively.')) self.treeWidget.setHeaderLabels([translate('OpenLP.ShortcutListDialog', 'Action'),
self.treeWidget.setHeaderLabels([
translate('OpenLP.ShortcutListDialog', 'Action'),
translate('OpenLP.ShortcutListDialog', 'Shortcut'), translate('OpenLP.ShortcutListDialog', 'Shortcut'),
translate('OpenLP.ShortcutListDialog', 'Alternate')]) translate('OpenLP.ShortcutListDialog', 'Alternate')])
self.defaultRadioButton.setText( self.defaultRadioButton.setText(translate('OpenLP.ShortcutListDialog', 'Default'))
translate('OpenLP.ShortcutListDialog', 'Default')) self.customRadioButton.setText(translate('OpenLP.ShortcutListDialog', 'Custom'))
self.customRadioButton.setText( self.primaryPushButton.setToolTip(translate('OpenLP.ShortcutListDialog', 'Capture shortcut.'))
translate('OpenLP.ShortcutListDialog', 'Custom')) self.alternatePushButton.setToolTip(translate('OpenLP.ShortcutListDialog', 'Capture shortcut.'))
self.primaryPushButton.setToolTip( self.clearPrimaryButton.setToolTip(translate('OpenLP.ShortcutListDialog',
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.')) 'Restore the default shortcut of this action.'))
self.clearAlternateButton.setToolTip( self.clearAlternateButton.setToolTip(translate('OpenLP.ShortcutListDialog',
translate('OpenLP.ShortcutListDialog',
'Restore the default shortcut of this action.')) 'Restore the default shortcut of this action.'))

View File

@ -1,5 +1,5 @@
# -*- coding: utf-8 -*- # -*- 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 # # OpenLP - Open Source Lyrics Projection #
@ -51,57 +51,49 @@ class ShortcutListForm(QtGui.QDialog, Ui_ShortcutListDialog):
self.setupUi(self) self.setupUi(self)
self.changedActions = {} self.changedActions = {}
self.action_list = ActionList.get_instance() self.action_list = ActionList.get_instance()
QtCore.QObject.connect(self.primaryPushButton, QtCore.QObject.connect(self.primaryPushButton, QtCore.SIGNAL(u'toggled(bool)'),
QtCore.SIGNAL(u'toggled(bool)'), self.onPrimaryPushButtonClicked) self.onPrimaryPushButtonClicked)
QtCore.QObject.connect(self.alternatePushButton, QtCore.QObject.connect(self.alternatePushButton, QtCore.SIGNAL(u'toggled(bool)'),
QtCore.SIGNAL(u'toggled(bool)'), self.onAlternatePushButtonClicked) self.onAlternatePushButtonClicked)
QtCore.QObject.connect(self.treeWidget, QtCore.SIGNAL(
u'currentItemChanged(QTreeWidgetItem*, QTreeWidgetItem*)'),
self.onCurrentItemChanged)
QtCore.QObject.connect(self.treeWidget, 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) self.onItemDoubleClicked)
QtCore.QObject.connect(self.clearPrimaryButton, QtCore.QObject.connect(self.clearPrimaryButton, QtCore.SIGNAL(u'clicked(bool)'),
QtCore.SIGNAL(u'clicked(bool)'), self.onClearPrimaryButtonClicked) self.onClearPrimaryButtonClicked)
QtCore.QObject.connect(self.clearAlternateButton, QtCore.QObject.connect(self.clearAlternateButton, QtCore.SIGNAL(u'clicked(bool)'),
QtCore.SIGNAL(u'clicked(bool)'), self.onClearAlternateButtonClicked) self.onClearAlternateButtonClicked)
QtCore.QObject.connect(self.buttonBox, QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(u'clicked(QAbstractButton*)'),
QtCore.SIGNAL(u'clicked(QAbstractButton*)'),
self.onRestoreDefaultsClicked) self.onRestoreDefaultsClicked)
QtCore.QObject.connect(self.defaultRadioButton, QtCore.QObject.connect(self.defaultRadioButton, QtCore.SIGNAL(u'clicked(bool)'),
QtCore.SIGNAL(u'clicked(bool)'), self.onDefaultRadioButtonClicked) self.onDefaultRadioButtonClicked)
QtCore.QObject.connect(self.customRadioButton, QtCore.QObject.connect(self.customRadioButton, QtCore.SIGNAL(u'clicked(bool)'),
QtCore.SIGNAL(u'clicked(bool)'), self.onCustomRadioButtonClicked) self.onCustomRadioButtonClicked)
def keyPressEvent(self, event): def keyPressEvent(self, event):
if event.key() == QtCore.Qt.Key_Space: if event.key() == QtCore.Qt.Key_Space:
self.keyReleaseEvent(event) self.keyReleaseEvent(event)
elif self.primaryPushButton.isChecked() or \ elif self.primaryPushButton.isChecked() or self.alternatePushButton.isChecked():
self.alternatePushButton.isChecked():
event.ignore() event.ignore()
elif event.key() == QtCore.Qt.Key_Escape: elif event.key() == QtCore.Qt.Key_Escape:
event.accept() event.accept()
self.close() self.close()
def keyReleaseEvent(self, event): def keyReleaseEvent(self, event):
if not self.primaryPushButton.isChecked() and \ if not self.primaryPushButton.isChecked() and not self.alternatePushButton.isChecked():
not self.alternatePushButton.isChecked():
return return
key = event.key() key = event.key()
if key == QtCore.Qt.Key_Shift or key == QtCore.Qt.Key_Control or \ if key == QtCore.Qt.Key_Shift or key == QtCore.Qt.Key_Control or \
key == QtCore.Qt.Key_Meta or key == QtCore.Qt.Key_Alt: key == QtCore.Qt.Key_Meta or key == QtCore.Qt.Key_Alt:
return return
key_string = QtGui.QKeySequence(key).toString() key_string = QtGui.QKeySequence(key).toString()
if event.modifiers() & QtCore.Qt.ControlModifier == \ if event.modifiers() & QtCore.Qt.ControlModifier == QtCore.Qt.ControlModifier:
QtCore.Qt.ControlModifier:
key_string = u'Ctrl+' + key_string key_string = u'Ctrl+' + key_string
if event.modifiers() & QtCore.Qt.AltModifier == QtCore.Qt.AltModifier: if event.modifiers() & QtCore.Qt.AltModifier == QtCore.Qt.AltModifier:
key_string = u'Alt+' + key_string key_string = u'Alt+' + key_string
if event.modifiers() & QtCore.Qt.ShiftModifier == \ if event.modifiers() & QtCore.Qt.ShiftModifier == QtCore.Qt.ShiftModifier:
QtCore.Qt.ShiftModifier:
key_string = u'Shift+' + key_string key_string = u'Shift+' + key_string
if event.modifiers() & QtCore.Qt.MetaModifier == \ if event.modifiers() & QtCore.Qt.MetaModifier == QtCore.Qt.MetaModifier:
QtCore.Qt.MetaModifier:
key_string = u'Meta+' + key_string key_string = u'Meta+' + key_string
key_sequence = QtGui.QKeySequence(key_string) key_sequence = QtGui.QKeySequence(key_string)
if self._validiate_shortcut(self._currentItemAction(), key_sequence): if self._validiate_shortcut(self._currentItemAction(), key_sequence):
@ -272,8 +264,7 @@ class ShortcutListForm(QtGui.QDialog, Ui_ShortcutListDialog):
# been triggered by a signal. # been triggered by a signal.
if item is None: if item is None:
return return
if primary_label_text == primary_text and \ if primary_label_text == primary_text and alternate_label_text == alternate_text:
alternate_label_text == alternate_text:
self.defaultRadioButton.toggle() self.defaultRadioButton.toggle()
else: else:
self.customRadioButton.toggle() self.customRadioButton.toggle()
@ -282,15 +273,12 @@ class ShortcutListForm(QtGui.QDialog, Ui_ShortcutListDialog):
""" """
Restores all default shortcuts. Restores all default shortcuts.
""" """
if self.buttonBox.buttonRole(button) != \ if self.buttonBox.buttonRole(button) != QtGui.QDialogButtonBox.ResetRole:
QtGui.QDialogButtonBox.ResetRole:
return return
if QtGui.QMessageBox.question(self, if QtGui.QMessageBox.question(self, translate('OpenLP.ShortcutListDialog', 'Restore Default Shortcuts'),
translate('OpenLP.ShortcutListDialog', 'Restore Default Shortcuts'),
translate('OpenLP.ShortcutListDialog', 'Do you want to restore all ' translate('OpenLP.ShortcutListDialog', 'Do you want to restore all '
'shortcuts to their defaults?'), QtGui.QMessageBox.StandardButtons( 'shortcuts to their defaults?'),
QtGui.QMessageBox.Yes | QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Yes | QtGui.QMessageBox.No)) == QtGui.QMessageBox.No:
QtGui.QMessageBox.No)) == QtGui.QMessageBox.No:
return return
self._adjustButton(self.primaryPushButton, False, text=u'') self._adjustButton(self.primaryPushButton, False, text=u'')
self._adjustButton(self.alternatePushButton, 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 # shortcut (not the default one) will become primary shortcut, thus
# the check will assume that an action were going to have the same # the check will assume that an action were going to have the same
# shortcut twice. # shortcut twice.
if not self._validiate_shortcut(action, new_shortcuts[0]) and \ if not self._validiate_shortcut(action, new_shortcuts[0]) and new_shortcuts[0] != shortcuts[0]:
new_shortcuts[0] != shortcuts[0]:
return return
if len(shortcuts) == 2: if len(shortcuts) == 2:
new_shortcuts.append(shortcuts[1]) new_shortcuts.append(shortcuts[1])
@ -421,11 +408,9 @@ class ShortcutListForm(QtGui.QDialog, Ui_ShortcutListDialog):
if key_sequence not in shortcuts: if key_sequence not in shortcuts:
continue continue
if action is changing_action: if action is changing_action:
if self.primaryPushButton.isChecked() and \ if self.primaryPushButton.isChecked() and shortcuts.index(key_sequence) == 0:
shortcuts.index(key_sequence) == 0:
continue continue
if self.alternatePushButton.isChecked() and \ if self.alternatePushButton.isChecked() and shortcuts.index(key_sequence) == 1:
shortcuts.index(key_sequence) == 1:
continue continue
# Have the same parent, thus they cannot have the same shortcut. # Have the same parent, thus they cannot have the same shortcut.
if action.parent() is changing_action.parent(): if action.parent() is changing_action.parent():
@ -436,16 +421,14 @@ class ShortcutListForm(QtGui.QDialog, Ui_ShortcutListDialog):
if action.shortcutContext() in [QtCore.Qt.WindowShortcut, if action.shortcutContext() in [QtCore.Qt.WindowShortcut,
QtCore.Qt.ApplicationShortcut]: QtCore.Qt.ApplicationShortcut]:
is_valid = False is_valid = False
if changing_action.shortcutContext() in \ if changing_action.shortcutContext() in [QtCore.Qt.WindowShortcut, QtCore.Qt.ApplicationShortcut]:
[QtCore.Qt.WindowShortcut, QtCore.Qt.ApplicationShortcut]:
is_valid = False is_valid = False
if not is_valid: if not is_valid:
Receiver.send_message(u'openlp_warning_message', { Receiver.send_message(u'openlp_warning_message', {
u'title': translate('OpenLP.ShortcutListDialog', u'title': translate('OpenLP.ShortcutListDialog', 'Duplicate Shortcut'),
'Duplicate Shortcut'),
u'message': translate('OpenLP.ShortcutListDialog', u'message': translate('OpenLP.ShortcutListDialog',
'The shortcut "%s" is already assigned to another action, ' 'The shortcut "%s" is already assigned to another action, '
'please use a different shortcut.') % key_sequence.toString() 'please use a different shortcut.') % key_sequence.toString()
}) })
return is_valid return is_valid

View File

@ -1,5 +1,5 @@
# -*- coding: utf-8 -*- # -*- 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 # # OpenLP - Open Source Lyrics Projection #
@ -34,8 +34,7 @@ class SplashScreen(QtGui.QSplashScreen):
def __init__(self): def __init__(self):
QtGui.QSplashScreen.__init__(self) QtGui.QSplashScreen.__init__(self)
self.setupUi() self.setupUi()
QtCore.QObject.connect(Receiver.get_receiver(), QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'close_splash'), self.close)
QtCore.SIGNAL(u'close_splash'), self.close)
def setupUi(self): def setupUi(self):
self.setObjectName(u'splashScreen') self.setObjectName(u'splashScreen')