forked from openlp/openlp
head1945
This commit is contained in:
commit
e50dc0cfbf
Binary file not shown.
Before Width: | Height: | Size: 195 KiB |
@ -41,11 +41,11 @@ class AdvancedTab(SettingsTab):
|
||||
"""
|
||||
Initialise the settings tab
|
||||
"""
|
||||
generalTranslated = translate('AdvancedTab', 'Advanced')
|
||||
SettingsTab.__init__(self, parent ,u'Advanced', generalTranslated)
|
||||
advancedTranslated = translate('OpenLP.AdvancedTab', 'Advanced')
|
||||
self.default_image = u':/graphics/openlp-splash-screen.png'
|
||||
self.default_color = u'#ffffff'
|
||||
self.icon_path = u':/system/system_settings.png'
|
||||
SettingsTab.__init__(self, parent, u'Advanced', advancedTranslated)
|
||||
|
||||
def setupUi(self):
|
||||
"""
|
||||
@ -82,14 +82,6 @@ class AdvancedTab(SettingsTab):
|
||||
u'enableAutoCloseCheckBox')
|
||||
self.uiLayout.addRow(self.enableAutoCloseCheckBox)
|
||||
self.leftLayout.addWidget(self.uiGroupBox)
|
||||
self.hideMouseGroupBox = QtGui.QGroupBox(self.leftColumn)
|
||||
self.hideMouseGroupBox.setObjectName(u'hideMouseGroupBox')
|
||||
self.hideMouseLayout = QtGui.QVBoxLayout(self.hideMouseGroupBox)
|
||||
self.hideMouseLayout.setObjectName(u'hideMouseLayout')
|
||||
self.hideMouseCheckBox = QtGui.QCheckBox(self.hideMouseGroupBox)
|
||||
self.hideMouseCheckBox.setObjectName(u'hideMouseCheckBox')
|
||||
self.hideMouseLayout.addWidget(self.hideMouseCheckBox)
|
||||
self.leftLayout.addWidget(self.hideMouseGroupBox)
|
||||
self.leftLayout.addStretch()
|
||||
self.defaultImageGroupBox = QtGui.QGroupBox(self.rightColumn)
|
||||
self.defaultImageGroupBox.setObjectName(u'defaultImageGroupBox')
|
||||
@ -109,26 +101,42 @@ class AdvancedTab(SettingsTab):
|
||||
self.defaultBrowseButton.setObjectName(u'defaultBrowseButton')
|
||||
self.defaultBrowseButton.setIcon(
|
||||
build_icon(u':/general/general_open.png'))
|
||||
self.defaultRevertButton = QtGui.QToolButton(self.defaultImageGroupBox)
|
||||
self.defaultRevertButton.setObjectName(u'defaultRevertButton')
|
||||
self.defaultRevertButton.setIcon(
|
||||
build_icon(u':/general/general_revert.png'))
|
||||
self.defaultFileLayout = QtGui.QHBoxLayout()
|
||||
self.defaultFileLayout.setObjectName(u'defaultFileLayout')
|
||||
self.defaultFileLayout.addWidget(self.defaultFileEdit)
|
||||
self.defaultFileLayout.addWidget(self.defaultBrowseButton)
|
||||
self.defaultFileLayout.addWidget(self.defaultRevertButton)
|
||||
self.defaultImageLayout.addRow(self.defaultFileLabel,
|
||||
self.defaultFileLayout)
|
||||
self.rightLayout.addWidget(self.defaultImageGroupBox)
|
||||
self.hideMouseGroupBox = QtGui.QGroupBox(self.leftColumn)
|
||||
self.hideMouseGroupBox.setObjectName(u'hideMouseGroupBox')
|
||||
self.hideMouseLayout = QtGui.QVBoxLayout(self.hideMouseGroupBox)
|
||||
self.hideMouseLayout.setObjectName(u'hideMouseLayout')
|
||||
self.hideMouseCheckBox = QtGui.QCheckBox(self.hideMouseGroupBox)
|
||||
self.hideMouseCheckBox.setObjectName(u'hideMouseCheckBox')
|
||||
self.hideMouseLayout.addWidget(self.hideMouseCheckBox)
|
||||
self.rightLayout.addWidget(self.hideMouseGroupBox)
|
||||
self.rightLayout.addStretch()
|
||||
|
||||
QtCore.QObject.connect(self.defaultColorButton,
|
||||
QtCore.SIGNAL(u'pressed()'), self.onDefaultColorButtonPressed)
|
||||
QtCore.QObject.connect(self.defaultBrowseButton,
|
||||
QtCore.SIGNAL(u'pressed()'), self.onDefaultBrowseButtonPressed)
|
||||
QtCore.QObject.connect(self.defaultRevertButton,
|
||||
QtCore.SIGNAL(u'pressed()'), self.onDefaultRevertButtonPressed)
|
||||
|
||||
def retranslateUi(self):
|
||||
"""
|
||||
Setup the interface translation strings.
|
||||
"""
|
||||
self.tabTitleVisible = UiStrings().Advanced
|
||||
self.uiGroupBox.setTitle(translate('OpenLP.AdvancedTab', 'UI Settings'))
|
||||
self.uiGroupBox.setTitle(
|
||||
translate('OpenLP.AdvancedTab', 'UI Settings'))
|
||||
self.recentLabel.setText(
|
||||
translate('OpenLP.AdvancedTab',
|
||||
'Number of recent files to display:'))
|
||||
@ -150,8 +158,14 @@ class AdvancedTab(SettingsTab):
|
||||
'Default Image'))
|
||||
self.defaultColorLabel.setText(translate('OpenLP.AdvancedTab',
|
||||
'Background color:'))
|
||||
self.defaultColorButton.setToolTip(translate('OpenLP.AdvancedTab',
|
||||
'Click to select a color.'))
|
||||
self.defaultFileLabel.setText(translate('OpenLP.AdvancedTab',
|
||||
'Image file:'))
|
||||
self.defaultBrowseButton.setToolTip(translate('OpenLP.AdvancedTab',
|
||||
'Browse for an image file to display.'))
|
||||
self.defaultRevertButton.setToolTip(translate('OpenLP.AdvancedTab',
|
||||
'Revert to the default OpenLP logo.'))
|
||||
|
||||
def load(self):
|
||||
"""
|
||||
@ -232,4 +246,8 @@ class AdvancedTab(SettingsTab):
|
||||
file_filters)
|
||||
if filename:
|
||||
self.defaultFileEdit.setText(filename)
|
||||
self.defaultFileEdit.setFocus()
|
||||
self.defaultFileEdit.setFocus()
|
||||
|
||||
def onDefaultRevertButtonPressed(self):
|
||||
self.defaultFileEdit.setText(u':/graphics/openlp-splash-screen.png')
|
||||
self.defaultFileEdit.setFocus()
|
||||
|
@ -142,7 +142,8 @@ class MainDisplay(DisplayWidget):
|
||||
image_file = QtCore.QSettings().value(u'advanced/default image',
|
||||
QtCore.QVariant(u':/graphics/openlp-splash-screen.png'))\
|
||||
.toString()
|
||||
background_color = QtGui.QColor(QtCore.QSettings().value(
|
||||
background_color = QtGui.QColor()
|
||||
background_color.setNamedColor(QtCore.QSettings().value(
|
||||
u'advanced/default color',
|
||||
QtCore.QVariant(u'#ffffff')).toString())
|
||||
if not background_color.isValid():
|
||||
|
@ -380,18 +380,21 @@ class SlideController(QtGui.QWidget):
|
||||
action_list.add_action(self.previousItem)
|
||||
action_list.add_action(self.nextItem)
|
||||
self.previousService = shortcut_action(parent, u'previousService',
|
||||
[QtCore.Qt.Key_Left], self.servicePrevious, UiStrings().LiveToolbar)
|
||||
self.previousService.setShortcutContext(QtCore.Qt.WidgetWithChildrenShortcut)
|
||||
[QtCore.Qt.Key_Left], self.servicePrevious,
|
||||
category=UiStrings().LiveToolbar,
|
||||
context=QtCore.Qt.WidgetWithChildrenShortcut)
|
||||
self.previousService.setText(
|
||||
translate('OpenLP.SlideController', 'Previous Service'))
|
||||
self.nextService = shortcut_action(parent, 'nextService',
|
||||
[QtCore.Qt.Key_Right], self.serviceNext, UiStrings().LiveToolbar)
|
||||
self.nextService.setShortcutContext(QtCore.Qt.WidgetWithChildrenShortcut)
|
||||
[QtCore.Qt.Key_Right], self.serviceNext,
|
||||
category=UiStrings().LiveToolbar,
|
||||
context=QtCore.Qt.WidgetWithChildrenShortcut)
|
||||
self.nextService.setText(
|
||||
translate('OpenLP.SlideController', 'Next Service'))
|
||||
self.escapeItem = shortcut_action(parent, 'escapeItem',
|
||||
[QtCore.Qt.Key_Escape], self.liveEscape, UiStrings().LiveToolbar)
|
||||
self.escapeItem.setShortcutContext(QtCore.Qt.WidgetWithChildrenShortcut)
|
||||
[QtCore.Qt.Key_Escape], self.liveEscape,
|
||||
category=UiStrings().LiveToolbar,
|
||||
context=QtCore.Qt.WidgetWithChildrenShortcut)
|
||||
self.escapeItem.setText(
|
||||
translate('OpenLP.SlideController', 'Escape Item'))
|
||||
|
||||
|
@ -37,6 +37,9 @@ from openlp.plugins.bibles.lib.db import BibleDB
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
def replacement(match):
|
||||
return match.group(2).upper()
|
||||
|
||||
class OSISBible(BibleDB):
|
||||
"""
|
||||
`OSIS <http://www.bibletechnologies.net/>`_ Bible format importer class.
|
||||
@ -60,6 +63,7 @@ class OSISBible(BibleDB):
|
||||
self.lg_regex = re.compile(r'<lg(.*?)>')
|
||||
self.l_regex = re.compile(r'<l (.*?)>')
|
||||
self.w_regex = re.compile(r'<w (.*?)>')
|
||||
self.q_regex = re.compile(r'<q(.*?)>')
|
||||
self.q1_regex = re.compile(r'<q(.*?)level="1"(.*?)>')
|
||||
self.q2_regex = re.compile(r'<q(.*?)level="2"(.*?)>')
|
||||
self.trans_regex = re.compile(r'<transChange(.*?)>(.*?)</transChange>')
|
||||
@ -106,6 +110,7 @@ class OSISBible(BibleDB):
|
||||
detect_file.close()
|
||||
try:
|
||||
osis = codecs.open(self.filename, u'r', details['encoding'])
|
||||
repl = replacement
|
||||
for file_record in osis:
|
||||
if self.stop_import_flag:
|
||||
break
|
||||
@ -148,12 +153,13 @@ class OSISBible(BibleDB):
|
||||
verse_text = self.rf_regex.sub(u'', verse_text)
|
||||
verse_text = self.lb_regex.sub(u' ', verse_text)
|
||||
verse_text = self.lg_regex.sub(u'', verse_text)
|
||||
verse_text = self.l_regex.sub(u'', verse_text)
|
||||
verse_text = self.l_regex.sub(u' ', verse_text)
|
||||
verse_text = self.w_regex.sub(u'', verse_text)
|
||||
verse_text = self.q1_regex.sub(u'"', verse_text)
|
||||
verse_text = self.q2_regex.sub(u'\'', verse_text)
|
||||
verse_text = self.q_regex.sub(u'', verse_text)
|
||||
verse_text = self.divine_name_regex.sub(repl, verse_text)
|
||||
verse_text = self.trans_regex.sub(u'', verse_text)
|
||||
verse_text = self.divine_name_regex.sub(u'', verse_text)
|
||||
verse_text = verse_text.replace(u'</lb>', u'')\
|
||||
.replace(u'</l>', u'').replace(u'<lg>', u'')\
|
||||
.replace(u'</lg>', u'').replace(u'</q>', u'')\
|
||||
|
BIN
resources/images/general_revert.png
Normal file
BIN
resources/images/general_revert.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 737 B |
@ -52,6 +52,7 @@
|
||||
<file>general_open.png</file>
|
||||
<file>general_save.png</file>
|
||||
<file>general_email.png</file>
|
||||
<file>general_revert.png</file>
|
||||
</qresource>
|
||||
<qresource prefix="slides">
|
||||
<file>slide_close.png</file>
|
||||
|
Loading…
Reference in New Issue
Block a user