forked from openlp/openlp
trunk
This commit is contained in:
commit
6eb17b561d
@ -90,14 +90,15 @@ class Ui_ExceptionDialog(object):
|
|||||||
"""
|
"""
|
||||||
exception_dialog.setWindowTitle(translate('OpenLP.ExceptionDialog', 'Error Occurred'))
|
exception_dialog.setWindowTitle(translate('OpenLP.ExceptionDialog', 'Error Occurred'))
|
||||||
self.description_explanation.setText(
|
self.description_explanation.setText(
|
||||||
translate('OpenLP.ExceptionDialog', 'Please enter a description of what you were doing to cause this error '
|
translate('OpenLP.ExceptionDialog', 'Please enter a description of what you were doing to cause this error.'
|
||||||
|
' If possible, write in English.'
|
||||||
'\n(Minimum 20 characters)'))
|
'\n(Minimum 20 characters)'))
|
||||||
self.message_label.setText(
|
self.message_label.setText(
|
||||||
translate('OpenLP.ExceptionDialog', 'Oops! OpenLP hit a problem, and couldn\'t recover. The text in the '
|
translate('OpenLP.ExceptionDialog', 'Oops! OpenLP hit a problem, and couldn\'t recover. The text in the '
|
||||||
'box below contains information that might be helpful to the OpenLP '
|
'box below contains information that might be helpful to the OpenLP '
|
||||||
'developers, so please e-mail it to bugs@openlp.org, along with a '
|
'developers, so please e-mail it to bugs@openlp.org, along with a '
|
||||||
'detailed description of what you were doing when the problem '
|
'detailed description of what you were doing when the problem '
|
||||||
'occurred.'))
|
'occurred. Also attach any files that triggered the problem.'))
|
||||||
self.send_report_button.setText(translate('OpenLP.ExceptionDialog', 'Send E-Mail'))
|
self.send_report_button.setText(translate('OpenLP.ExceptionDialog', 'Send E-Mail'))
|
||||||
self.save_report_button.setText(translate('OpenLP.ExceptionDialog', 'Save to File'))
|
self.save_report_button.setText(translate('OpenLP.ExceptionDialog', 'Save to File'))
|
||||||
self.attach_tile_button.setText(translate('OpenLP.ExceptionDialog', 'Attach File'))
|
self.attach_tile_button.setText(translate('OpenLP.ExceptionDialog', 'Attach File'))
|
||||||
|
@ -97,6 +97,12 @@ class ExceptionForm(QtGui.QDialog, Ui_ExceptionDialog, RegistryProperties):
|
|||||||
super(ExceptionForm, self).__init__()
|
super(ExceptionForm, self).__init__()
|
||||||
self.setupUi(self)
|
self.setupUi(self)
|
||||||
self.settings_section = 'crashreport'
|
self.settings_section = 'crashreport'
|
||||||
|
self.report_text = '**OpenLP Bug Report**\n' \
|
||||||
|
'Version: %s\n\n' \
|
||||||
|
'--- Details of the Exception. ---\n\n%s\n\n ' \
|
||||||
|
'--- Exception Traceback ---\n%s\n' \
|
||||||
|
'--- System information ---\n%s\n' \
|
||||||
|
'--- Library Versions ---\n%s\n'
|
||||||
|
|
||||||
def exec_(self):
|
def exec_(self):
|
||||||
"""
|
"""
|
||||||
@ -143,13 +149,6 @@ class ExceptionForm(QtGui.QDialog, Ui_ExceptionDialog, RegistryProperties):
|
|||||||
"""
|
"""
|
||||||
Saving exception log and system information to a file.
|
Saving exception log and system information to a file.
|
||||||
"""
|
"""
|
||||||
report_text = translate('OpenLP.ExceptionForm',
|
|
||||||
'**OpenLP Bug Report**\n'
|
|
||||||
'Version: %s\n\n'
|
|
||||||
'--- Details of the Exception. ---\n\n%s\n\n '
|
|
||||||
'--- Exception Traceback ---\n%s\n'
|
|
||||||
'--- System information ---\n%s\n'
|
|
||||||
'--- Library Versions ---\n%s\n')
|
|
||||||
filename = QtGui.QFileDialog.getSaveFileName(
|
filename = QtGui.QFileDialog.getSaveFileName(
|
||||||
self,
|
self,
|
||||||
translate('OpenLP.ExceptionForm', 'Save Crash Report'),
|
translate('OpenLP.ExceptionForm', 'Save Crash Report'),
|
||||||
@ -158,7 +157,7 @@ class ExceptionForm(QtGui.QDialog, Ui_ExceptionDialog, RegistryProperties):
|
|||||||
if filename:
|
if filename:
|
||||||
filename = str(filename).replace('/', os.path.sep)
|
filename = str(filename).replace('/', os.path.sep)
|
||||||
Settings().setValue(self.settings_section + '/last directory', os.path.dirname(filename))
|
Settings().setValue(self.settings_section + '/last directory', os.path.dirname(filename))
|
||||||
report_text = report_text % self._create_report()
|
report_text = self.report_text % self._create_report()
|
||||||
try:
|
try:
|
||||||
report_file = open(filename, 'w')
|
report_file = open(filename, 'w')
|
||||||
try:
|
try:
|
||||||
@ -178,14 +177,6 @@ class ExceptionForm(QtGui.QDialog, Ui_ExceptionDialog, RegistryProperties):
|
|||||||
"""
|
"""
|
||||||
Opening systems default email client and inserting exception log and system information.
|
Opening systems default email client and inserting exception log and system information.
|
||||||
"""
|
"""
|
||||||
body = translate('OpenLP.ExceptionForm',
|
|
||||||
'*OpenLP Bug Report*\n'
|
|
||||||
'Version: %s\n\n'
|
|
||||||
'--- Details of the Exception. ---\n\n%s\n\n '
|
|
||||||
'--- Exception Traceback ---\n%s\n'
|
|
||||||
'--- System information ---\n%s\n'
|
|
||||||
'--- Library Versions ---\n%s\n',
|
|
||||||
'Please add the information that bug reports are favoured written in English.')
|
|
||||||
content = self._create_report()
|
content = self._create_report()
|
||||||
source = ''
|
source = ''
|
||||||
exception = ''
|
exception = ''
|
||||||
@ -197,7 +188,7 @@ class ExceptionForm(QtGui.QDialog, Ui_ExceptionDialog, RegistryProperties):
|
|||||||
subject = 'Bug report: %s in %s' % (exception, source)
|
subject = 'Bug report: %s in %s' % (exception, source)
|
||||||
mail_to_url = QtCore.QUrl('mailto:bugs@openlp.org')
|
mail_to_url = QtCore.QUrl('mailto:bugs@openlp.org')
|
||||||
mail_to_url.addQueryItem('subject', subject)
|
mail_to_url.addQueryItem('subject', subject)
|
||||||
mail_to_url.addQueryItem('body', body % content)
|
mail_to_url.addQueryItem('body', self.report_text % content)
|
||||||
if self.file_attachment:
|
if self.file_attachment:
|
||||||
mail_to_url.addQueryItem('attach', self.file_attachment)
|
mail_to_url.addQueryItem('attach', self.file_attachment)
|
||||||
QtGui.QDesktopServices.openUrl(mail_to_url)
|
QtGui.QDesktopServices.openUrl(mail_to_url)
|
||||||
|
@ -166,5 +166,6 @@ class FormattingTagController(object):
|
|||||||
return None, end
|
return None, end
|
||||||
if end and end != end_html:
|
if end and end != end_html:
|
||||||
return translate('OpenLP.FormattingTagForm',
|
return translate('OpenLP.FormattingTagForm',
|
||||||
'End tag %s does not match end tag for start tag %s') % (end, start_html), None
|
'End tag %(end)s does not match end tag for start tag %(start)s') % \
|
||||||
|
{'end': end, 'start': start_html}, None
|
||||||
return None, None
|
return None, None
|
||||||
|
@ -1089,13 +1089,13 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow, RegistryProperties):
|
|||||||
event.ignore()
|
event.ignore()
|
||||||
else:
|
else:
|
||||||
if Settings().value('advanced/enable exit confirmation'):
|
if Settings().value('advanced/enable exit confirmation'):
|
||||||
ret = QtGui.QMessageBox.question(self, translate('OpenLP.MainWindow', 'Close OpenLP'),
|
msg_box = QtGui.QMessageBox(QtGui.QMessageBox.Question, translate('OpenLP.MainWindow', 'Exit OpenLP'),
|
||||||
translate('OpenLP.MainWindow', 'Are you sure you want to close '
|
translate('OpenLP.MainWindow', 'Are you sure you want to exit OpenLP?'),
|
||||||
'OpenLP?'),
|
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Close |
|
||||||
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Yes |
|
QtGui.QMessageBox.Cancel), self)
|
||||||
QtGui.QMessageBox.No),
|
msg_box.setButtonText(QtGui.QMessageBox.Close, translate('OpenLP.MainWindow', '&Exit OpenLP'))
|
||||||
QtGui.QMessageBox.Yes)
|
msg_box.setDefaultButton(QtGui.QMessageBox.Close)
|
||||||
if ret == QtGui.QMessageBox.Yes:
|
if msg_box.exec() == QtGui.QMessageBox.Close:
|
||||||
self.clean_up()
|
self.clean_up()
|
||||||
event.accept()
|
event.accept()
|
||||||
else:
|
else:
|
||||||
|
@ -277,7 +277,7 @@ class OpenLPWizard(QtGui.QWizard, RegistryProperties):
|
|||||||
:param filters: The file extension filters. It should contain the file description
|
:param filters: The file extension filters. It should contain the file description
|
||||||
as well as the file extension. For example::
|
as well as the file extension. For example::
|
||||||
|
|
||||||
'OpenLP 2.0 Databases (*.sqlite)'
|
'OpenLP 2 Databases (*.sqlite)'
|
||||||
"""
|
"""
|
||||||
if filters:
|
if filters:
|
||||||
filters += ';;'
|
filters += ';;'
|
||||||
|
@ -547,9 +547,9 @@ class BibleUpgradeForm(OpenLPWizard):
|
|||||||
if self.includeWebBible:
|
if self.includeWebBible:
|
||||||
self.progress_label.setText(
|
self.progress_label.setText(
|
||||||
translate('BiblesPlugin.UpgradeWizardForm',
|
translate('BiblesPlugin.UpgradeWizardForm',
|
||||||
'Upgrading Bible(s): %s successful%s\nPlease note that verses from Web Bibles will be '
|
'Upgrading Bible(s): %(success)d successful%(failed_text)s\nPlease note that verses '
|
||||||
'downloaded on demand and so an Internet connection is required.') %
|
'from Web Bibles will be downloaded on demand and so an Internet connection is required.')
|
||||||
(successful_import, failed_import_text))
|
% {'success': successful_import, 'failed_text': failed_import_text})
|
||||||
else:
|
else:
|
||||||
self.progress_label.setText(
|
self.progress_label.setText(
|
||||||
translate('BiblesPlugin.UpgradeWizardForm', 'Upgrading Bible(s): %s successful%s') % (
|
translate('BiblesPlugin.UpgradeWizardForm', 'Upgrading Bible(s): %s successful%s') % (
|
||||||
|
@ -191,14 +191,14 @@ class SongFormat(object):
|
|||||||
'name': 'OpenLyrics',
|
'name': 'OpenLyrics',
|
||||||
'prefix': 'openLyrics',
|
'prefix': 'openLyrics',
|
||||||
'filter': '%s (*.xml)' % translate('SongsPlugin.ImportWizardForm', 'OpenLyrics Files'),
|
'filter': '%s (*.xml)' % translate('SongsPlugin.ImportWizardForm', 'OpenLyrics Files'),
|
||||||
'comboBoxText': translate('SongsPlugin.ImportWizardForm', 'OpenLyrics or OpenLP 2.0 Exported Song')
|
'comboBoxText': translate('SongsPlugin.ImportWizardForm', 'OpenLyrics or OpenLP 2 Exported Song')
|
||||||
},
|
},
|
||||||
OpenLP2: {
|
OpenLP2: {
|
||||||
'class': OpenLPSongImport,
|
'class': OpenLPSongImport,
|
||||||
'name': UiStrings().OLPV2,
|
'name': UiStrings().OLPV2,
|
||||||
'prefix': 'openLP2',
|
'prefix': 'openLP2',
|
||||||
'selectMode': SongFormatSelect.SingleFile,
|
'selectMode': SongFormatSelect.SingleFile,
|
||||||
'filter': '%s (*.sqlite)' % (translate('SongsPlugin.ImportWizardForm', 'OpenLP 2.0 Databases'))
|
'filter': '%s (*.sqlite)' % (translate('SongsPlugin.ImportWizardForm', 'OpenLP 2 Databases'))
|
||||||
},
|
},
|
||||||
Generic: {
|
Generic: {
|
||||||
'name': translate('SongsPlugin.ImportWizardForm', 'Generic Document/Presentation'),
|
'name': translate('SongsPlugin.ImportWizardForm', 'Generic Document/Presentation'),
|
||||||
|
@ -94,7 +94,7 @@ class OpenLPSongImport(SongImport):
|
|||||||
# Check the file type
|
# Check the file type
|
||||||
if not self.import_source.endswith('.sqlite'):
|
if not self.import_source.endswith('.sqlite'):
|
||||||
self.log_error(self.import_source, translate('SongsPlugin.OpenLPSongImport',
|
self.log_error(self.import_source, translate('SongsPlugin.OpenLPSongImport',
|
||||||
'Not a valid OpenLP 2.0 song database.'))
|
'Not a valid OpenLP 2 song database.'))
|
||||||
return
|
return
|
||||||
self.import_source = 'sqlite:///%s' % self.import_source
|
self.import_source = 'sqlite:///%s' % self.import_source
|
||||||
# Load the db file
|
# Load the db file
|
||||||
|
@ -108,8 +108,8 @@ class WordsOfWorshipImport(SongImport):
|
|||||||
if song_data.read(19).decode() != 'WoW File\nSong Words':
|
if song_data.read(19).decode() != 'WoW File\nSong Words':
|
||||||
self.log_error(source,
|
self.log_error(source,
|
||||||
str(translate('SongsPlugin.WordsofWorshipSongImport',
|
str(translate('SongsPlugin.WordsofWorshipSongImport',
|
||||||
'Invalid Words of Worship song file. Missing "WoW File\\nSong '
|
'Invalid Words of Worship song file. Missing "%s" header.'
|
||||||
'Words" header.')))
|
% 'WoW File\\nSong Words')))
|
||||||
continue
|
continue
|
||||||
# Seek to byte which stores number of blocks in the song
|
# Seek to byte which stores number of blocks in the song
|
||||||
song_data.seek(56)
|
song_data.seek(56)
|
||||||
@ -118,8 +118,8 @@ class WordsOfWorshipImport(SongImport):
|
|||||||
if song_data.read(16).decode() != 'CSongDoc::CBlock':
|
if song_data.read(16).decode() != 'CSongDoc::CBlock':
|
||||||
self.log_error(source,
|
self.log_error(source,
|
||||||
str(translate('SongsPlugin.WordsofWorshipSongImport',
|
str(translate('SongsPlugin.WordsofWorshipSongImport',
|
||||||
'Invalid Words of Worship song file. Missing "CSongDoc::CBlock" '
|
'Invalid Words of Worship song file. Missing "%s" '
|
||||||
'string.')))
|
'string.' % 'CSongDoc::CBlock')))
|
||||||
continue
|
continue
|
||||||
# Seek to the beginning of the first block
|
# Seek to the beginning of the first block
|
||||||
song_data.seek(82)
|
song_data.seek(82)
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
[pep8]
|
[pep8]
|
||||||
exclude=resources.py,vlc.py
|
exclude=resources.py,vlc.py
|
||||||
max-line-length = 120
|
max-line-length = 120
|
||||||
|
ignore = E402
|
||||||
|
@ -47,3 +47,6 @@ class TestWordsOfWorshipFileImport(SongImportTestHelper):
|
|||||||
self.load_external_result_data(os.path.join(TEST_PATH, 'Amazing Grace (6 Verses).json')))
|
self.load_external_result_data(os.path.join(TEST_PATH, 'Amazing Grace (6 Verses).json')))
|
||||||
self.file_import([os.path.join(TEST_PATH, 'When morning gilds the skies.wsg')],
|
self.file_import([os.path.join(TEST_PATH, 'When morning gilds the skies.wsg')],
|
||||||
self.load_external_result_data(os.path.join(TEST_PATH, 'When morning gilds the skies.json')))
|
self.load_external_result_data(os.path.join(TEST_PATH, 'When morning gilds the skies.json')))
|
||||||
|
self.file_import([os.path.join(TEST_PATH, 'Holy Holy Holy Lord God Almighty.wow-song')],
|
||||||
|
self.load_external_result_data(os.path.join(TEST_PATH,
|
||||||
|
'Holy Holy Holy Lord God Almighty.json')))
|
||||||
|
@ -0,0 +1,25 @@
|
|||||||
|
{
|
||||||
|
"authors": [
|
||||||
|
"Words: Reginald Heber (1783-1826). Music: John B. Dykes (1823-1876)"
|
||||||
|
],
|
||||||
|
"title": "Holy Holy Holy Lord God Almighty",
|
||||||
|
"verse_order_list": [],
|
||||||
|
"verses": [
|
||||||
|
[
|
||||||
|
"Holy, holy, holy, Lord God Almighty\nEarly in the morning\nOur song shall rise to Thee:\nHoly, holy, holy, merciful and mighty,\nGod in three Persons, blessed Trinity!",
|
||||||
|
"V"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"Holy, holy, holy! all the saints adore Thee,\nCasting down their golden crowns\nAround the glassy sea;\nCherubim and seraphim falling down before Thee,\nWho were and are and evermore shall be.",
|
||||||
|
"V"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"Holy, holy, holy! though the darkness hide Thee,\nThough the eye of sinful man\nThy glory may not see;\nOnly Thou art holy, there is none beside Thee,\nPerfect in power, in love and purity.",
|
||||||
|
"V"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"Holy, holy, holy, Lord God Almighty!\nAll Thy works shall praise Thy name\nIn earth, and sky, and sea;\nHoly, holy, holy, merciful and mighty\nGod in three Persons, blessed Trinity!",
|
||||||
|
"V"
|
||||||
|
]
|
||||||
|
]
|
||||||
|
}
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user