This commit is contained in:
Andreas Preikschat 2010-12-23 06:49:48 +01:00
commit 050bc7e442
26 changed files with 25460 additions and 14901 deletions

View File

@ -123,7 +123,7 @@ if sys.platform[:3] == u'win':
# Platform support for MacOS
elif sys.platform == u'darwin':
_controllers[u'open']= Controller(u'open')
_controllers[u'open'] = Controller(u'open')
_open = _controllers[u'open'].open

View File

@ -166,6 +166,17 @@ class Ui_AboutDialog(object):
' PyQt4: http://www.riverbankcomputing.co.uk/software/pyqt/'
'intro\n'
' Oxygen Icons: http://oxygen-icons.org/\n'
'\n'
'Final Credit\n'
' "For God so loved the world that He gave\n'
' His one and only Son, so that whoever\n'
' believes in Him will not perish but inherit\n'
' eternal life." -- John 3:16\n\n'
' And last but not least, final credit goes to\n'
' God our Father, for sending His Son to die\n'
' on the cross, setting us free from sin. We\n'
' bring this software to you for free because\n'
' He has set us free.'
))
self.aboutNotebook.setTabText(
self.aboutNotebook.indexOf(self.creditsTab),

View File

@ -23,7 +23,7 @@
# with this program; if not, write to the Free Software Foundation, Inc., 59 #
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
###############################################################################
import logging
import re
import os
import platform
@ -59,6 +59,8 @@ from openlp.core.lib.mailto import mailto
from exceptiondialog import Ui_ExceptionDialog
log = logging.getLogger(__name__)
class ExceptionForm(QtGui.QDialog, Ui_ExceptionDialog):
"""
The exception dialog
@ -103,7 +105,8 @@ class ExceptionForm(QtGui.QDialog, Ui_ExceptionDialog):
filename = QtGui.QFileDialog.getSaveFileName(self,
translate('OpenLP.ExceptionForm', 'Save Crash Report'),
SettingsManager.get_last_dir(self.settingsSection),
translate('OpenLP.ExceptionForm', 'Text files (*.txt *.log *.text)'))
translate('OpenLP.ExceptionForm',
'Text files (*.txt *.log *.text)'))
if filename:
filename = unicode(QtCore.QDir.toNativeSeparators(filename))
SettingsManager.set_last_dir(self.settingsSection, os.path.dirname(
@ -140,4 +143,5 @@ class ExceptionForm(QtGui.QDialog, Ui_ExceptionDialog):
if u':' in line:
exception = line.split(u'\n')[-1].split(u':')[0]
subject = u'Bug report: %s in %s' % (exception, source)
mailto(address=u'bugs@openlp.org', subject=subject, body=body % content)
mailto(address=u'bugs@openlp.org', subject=subject,
body=body % content)

View File

@ -332,11 +332,12 @@ class SlideController(QtGui.QWidget):
QtCore.SIGNAL(u'clicked(QModelIndex)'), self.onSlideSelected)
if not self.isLive:
QtCore.QObject.connect(self.PreviewListWidget,
QtCore.SIGNAL(u'doubleClicked(QModelIndex)'), self.onGoLiveClick)
QtCore.SIGNAL(u'doubleClicked(QModelIndex)'),
self.onGoLiveClick)
if isLive:
QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'slidecontroller_live_spin_delay'),
self.receiveSpinDelay)
self.receiveSpinDelay)
if isLive:
self.Toolbar.makeWidgetsInvisible(self.loopList)
self.Toolbar.actions[u'Stop Loop'].setVisible(False)

View File

@ -555,7 +555,8 @@ class Ui_ThemeWizard(object):
u'footerDefaultPositionCheckBox')
self.footerPositionLayout.setWidget(0, QtGui.QFormLayout.FieldRole,
self.footerDefaultPositionCheckBox)
self.areaPositionLayout.addWidget(self.footerPositionGroupBox, 1, 1, 1, 1)
self.areaPositionLayout.addWidget(
self.footerPositionGroupBox, 1, 1, 1, 1)
ThemeWizard.addPage(self.areaPositionPage)
self.previewPage = QtGui.QWizardPage()
self.previewPage.setObjectName(u'previewPage')
@ -720,8 +721,8 @@ class Ui_ThemeWizard(object):
self.areaPositionPage.setTitle(
translate('OpenLP.ThemeWizard', 'Output Area Locations'))
self.areaPositionPage.setSubTitle(
translate('OpenLP.ThemeWizard', 'Allows you to change and move the '
'main and footer areas.'))
translate('OpenLP.ThemeWizard', 'Allows you to change and move the'
' main and footer areas.'))
self.mainPositionGroupBox.setTitle(
translate('OpenLP.ThemeWizard', '&Main Area'))
self.mainDefaultPositionCheckBox.setText(
@ -733,18 +734,24 @@ class Ui_ThemeWizard(object):
self.mainWidthSpinBox.setSuffix(translate('OpenLP.ThemeWizard', 'px'))
self.mainWidthLabel.setText(translate('OpenLP.ThemeWizard', 'Width:'))
self.mainHeightSpinBox.setSuffix(translate('OpenLP.ThemeWizard', 'px'))
self.mainHeightLabel.setText(translate('OpenLP.ThemeWizard', 'Height:'))
self.mainHeightLabel.setText(
translate('OpenLP.ThemeWizard', 'Height:'))
self.footerPositionGroupBox.setTitle(
translate('OpenLP.ThemeWizard', 'Footer Area'))
self.footerXLabel.setText(translate('OpenLP.ThemeWizard', 'X position:'))
self.footerXLabel.setText(
translate('OpenLP.ThemeWizard', 'X position:'))
self.footerXSpinBox.setSuffix(translate('OpenLP.ThemeWizard', 'px'))
self.footerYLabel.setText(translate('OpenLP.ThemeWizard', 'Y position:'))
self.footerYLabel.setText(
translate('OpenLP.ThemeWizard', 'Y position:'))
self.footerYSpinBox.setSuffix(translate('OpenLP.ThemeWizard', 'px'))
self.footerWidthLabel.setText(translate('OpenLP.ThemeWizard', 'Width:'))
self.footerWidthSpinBox.setSuffix(translate('OpenLP.ThemeWizard', 'px'))
self.footerWidthLabel.setText(
translate('OpenLP.ThemeWizard', 'Width:'))
self.footerWidthSpinBox.setSuffix(
translate('OpenLP.ThemeWizard', 'px'))
self.footerHeightLabel.setText(
translate('OpenLP.ThemeWizard', 'Height:'))
self.footerHeightSpinBox.setSuffix(translate('OpenLP.ThemeWizard', 'px'))
self.footerHeightSpinBox.setSuffix(
translate('OpenLP.ThemeWizard', 'px'))
self.footerDefaultPositionCheckBox.setText(
translate('OpenLP.ThemeWizard', 'Use default location'))
self.previewPage.setTitle(

View File

@ -171,24 +171,23 @@ class AlertForm(QtGui.QDialog, Ui_AlertDialog):
# We found '<>' in the alert text, but the ParameterEdit field is
# empty.
if text.find(u'<>') != -1 and not self.ParameterEdit.text() and \
QtGui.QMessageBox.question(self, translate(
'AlertPlugin.AlertForm', 'No Parameter found'),
translate('AlertPlugin.AlertForm', 'You have not entered a '
'parameter to be replaced.\nDo you want to continue '
'anyway?'),
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.No |
QtGui.QMessageBox.Yes)) == QtGui.QMessageBox.No:
QtGui.QMessageBox.question(self,
translate('AlertPlugin.AlertForm', 'No Parameter found'),
translate('AlertPlugin.AlertForm', 'You have not entered a '
'parameter to be replaced.\nDo you want to continue anyway?'),
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.No |
QtGui.QMessageBox.Yes)) == QtGui.QMessageBox.No:
self.ParameterEdit.setFocus()
return False
# The ParameterEdit field is not empty, but we have not found '<>'
# in the alert text.
elif text.find(u'<>') == -1 and self.ParameterEdit.text() and \
QtGui.QMessageBox.question(self, translate(
'AlertPlugin.AlertForm', 'No Placeholder found'),
translate('AlertPlugin.AlertForm', 'The alert text does not'
' contain \'<>\'.\nDo want to continue anyway?'),
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.No |
QtGui.QMessageBox.Yes)) == QtGui.QMessageBox.No:
QtGui.QMessageBox.question(self,
translate('AlertPlugin.AlertForm', 'No Placeholder found'),
translate('AlertPlugin.AlertForm', 'The alert text does not'
' contain \'<>\'.\nDo want to continue anyway?'),
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.No |
QtGui.QMessageBox.Yes)) == QtGui.QMessageBox.No:
self.ParameterEdit.setFocus()
return False
text = text.replace(u'<>', unicode(self.ParameterEdit.text()))

View File

@ -253,14 +253,16 @@ class BibleImportForm(QtGui.QWizard, Ui_BibleImportWizard):
"""
self.getFileName(
translate('BiblesPlugin.ImportWizardForm', 'Open Books CSV File'),
self.booksLocationEdit)
self.booksLocationEdit, u'%s (*.csv)'
% translate('BiblesPlugin.ImportWizardForm', 'CSV File'))
def onCsvVersesFileButtonClicked(self):
"""
Show the file open dialog for the verses CSV file.
"""
self.getFileName(translate('BiblesPlugin.ImportWizardForm',
'Open Verses CSV File'), self.csvVerseLocationEdit)
'Open Verses CSV File'), self.csvVerseLocationEdit, u'%s (*.csv)'
% translate('BiblesPlugin.ImportWizardForm', 'CSV File'))
def onOpenSongBrowseButtonClicked(self):
"""
@ -276,7 +278,9 @@ class BibleImportForm(QtGui.QWizard, Ui_BibleImportWizard):
"""
self.getFileName(
translate('BiblesPlugin.ImportWizardForm',
'Open openlp.org 1.x Bible'), self.openlp1LocationEdit)
'Open openlp.org 1.x Bible'), self.openlp1LocationEdit,
u'%s (*.bible)' % translate('BiblesPlugin.ImportWizardForm',
'openlp.org 1.x bible'))
def onCurrentIdChanged(self, pageId):
if pageId == 3:
@ -402,9 +406,29 @@ class BibleImportForm(QtGui.QWizard, Ui_BibleImportWizard):
if books_file:
books_file.close()
def getFileName(self, title, editbox):
def getFileName(self, title, editbox, filters=u''):
"""
Opens a QFileDialog and saves the filename to the given editbox.
``title``
The title of the dialog (unicode).
``editbox``
A editbox (QLineEdit).
``filters``
The file extension filters. It should contain the file description as
well as the file extension. For example::
u'openlp.org 1.x bible (*.bible)'
"""
if filters:
filters += u';;'
filters += u'%s (*)' % translate('BiblesPlugin.ImportWizardForm',
'All Files')
filename = QtGui.QFileDialog.getOpenFileName(self, title,
SettingsManager.get_last_dir(self.bibleplugin.settingsSection, 1))
os.path.dirname(SettingsManager.get_last_dir(
self.bibleplugin.settingsSection, 1)), filters)
if filename:
editbox.setText(filename)
SettingsManager.set_last_dir(

View File

@ -244,7 +244,7 @@ class BSExtract(object):
"""
Extract verses from Bibleserver.com
"""
def __init__(self,proxyurl=None):
def __init__(self, proxyurl=None):
log.debug(u'init %s', proxyurl)
self.proxyurl = proxyurl

View File

@ -73,7 +73,7 @@ class BibleMediaItem(MediaManagerItem):
self.hasNewIcon = False
self.hasEditIcon = False
self.hasDeleteIcon = False
self.addToServiceItem = True
self.addToServiceItem = False
def addEndHeaderBar(self):
self.SearchTabWidget = QtGui.QTabWidget(self)

View File

@ -109,7 +109,7 @@ class CustomPlugin(Plugin):
}
## Name for MediaDockManager, SettingsManager ##
self.textStrings[StringContent.VisibleName] = {
u'title': translate('CustomsPlugin', 'Customs')
u'title': translate('CustomsPlugin', 'Custom')
}
# Middle Header Bar
## Import Button ##

View File

@ -736,7 +736,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
verseId = unicode(item.data(QtCore.Qt.UserRole).toString())
bits = verseId.split(u':')
sxml.add_verse_to_lyrics(bits[0], bits[1], unicode(item.text()))
text = text + whitespace.sub(u' ',
text = text + self.whitespace.sub(u' ',
unicode(self.VerseListWidget.item(i, 0).text())) + u' '
if (bits[1] > u'1') and (bits[0][0] not in multiple):
multiple.append(bits[0][0])

View File

@ -152,101 +152,101 @@ class SongImportForm(QtGui.QWizard, Ui_SongImportWizard):
if self.openLP2FilenameEdit.text().isEmpty():
QtGui.QMessageBox.critical(self,
translate('SongsPlugin.ImportWizardForm',
'No OpenLP 2.0 Song Database Selected'),
'No OpenLP 2.0 Song Database Selected'),
translate('SongsPlugin.ImportWizardForm',
'You need to select an OpenLP 2.0 song database '
'file to import from.'))
'You need to select an OpenLP 2.0 song database '
'file to import from.'))
self.openLP2BrowseButton.setFocus()
return False
elif source_format == SongFormat.OpenLP1:
if self.openLP1FilenameEdit.text().isEmpty():
QtGui.QMessageBox.critical(self,
translate('SongsPlugin.ImportWizardForm',
'No openlp.org 1.x Song Database Selected'),
'No openlp.org 1.x Song Database Selected'),
translate('SongsPlugin.ImportWizardForm',
'You need to select an openlp.org 1.x song '
'database file to import from.'))
'You need to select an openlp.org 1.x song '
'database file to import from.'))
self.openLP1BrowseButton.setFocus()
return False
elif source_format == SongFormat.OpenLyrics:
#if self.openLyricsFileListWidget.count() == 0:
# QtGui.QMessageBox.critical(self,
# translate('SongsPlugin.ImportWizardForm',
# 'No OpenLyrics Files Selected'),
# translate('SongsPlugin.ImportWizardForm',
# 'You need to add at least one OpenLyrics '
# 'song file to import from.'))
# self.openLyricsAddButton.setFocus()
# return False
# if self.openLyricsFileListWidget.count() == 0:
# QtGui.QMessageBox.critical(self,
# translate('SongsPlugin.ImportWizardForm',
# 'No OpenLyrics Files Selected'),
# translate('SongsPlugin.ImportWizardForm',
# 'You need to add at least one OpenLyrics '
# 'song file to import from.'))
# self.openLyricsAddButton.setFocus()
# return False
return False
elif source_format == SongFormat.OpenSong:
if self.openSongFileListWidget.count() == 0:
QtGui.QMessageBox.critical(self,
translate('SongsPlugin.ImportWizardForm',
'No OpenSong Files Selected'),
'No OpenSong Files Selected'),
translate('SongsPlugin.ImportWizardForm',
'You need to add at least one OpenSong '
'song file to import from.'))
'You need to add at least one OpenSong '
'song file to import from.'))
self.openSongAddButton.setFocus()
return False
elif source_format == SongFormat.WordsOfWorship:
if self.wordsOfWorshipFileListWidget.count() == 0:
QtGui.QMessageBox.critical(self,
translate('SongsPlugin.ImportWizardForm',
'No Words of Worship Files Selected'),
'No Words of Worship Files Selected'),
translate('SongsPlugin.ImportWizardForm',
'You need to add at least one Words of Worship '
'file to import from.'))
'You need to add at least one Words of Worship '
'file to import from.'))
self.wordsOfWorshipAddButton.setFocus()
return False
elif source_format == SongFormat.CCLI:
if self.ccliFileListWidget.count() == 0:
QtGui.QMessageBox.critical(self,
translate('SongsPlugin.ImportWizardForm',
'No CCLI Files Selected'),
'No CCLI Files Selected'),
translate('SongsPlugin.ImportWizardForm',
'You need to add at least one CCLI file '
'to import from.'))
'You need to add at least one CCLI file '
'to import from.'))
self.ccliAddButton.setFocus()
return False
elif source_format == SongFormat.SongsOfFellowship:
if self.songsOfFellowshipFileListWidget.count() == 0:
QtGui.QMessageBox.critical(self,
translate('SongsPlugin.ImportWizardForm',
'No Songs of Fellowship File Selected'),
'No Songs of Fellowship File Selected'),
translate('SongsPlugin.ImportWizardForm',
'You need to add at least one Songs of Fellowship '
'file to import from.'))
'You need to add at least one Songs of Fellowship '
'file to import from.'))
self.songsOfFellowshipAddButton.setFocus()
return False
elif source_format == SongFormat.Generic:
if self.genericFileListWidget.count() == 0:
QtGui.QMessageBox.critical(self,
translate('SongsPlugin.ImportWizardForm',
'No Document/Presentation Selected'),
'No Document/Presentation Selected'),
translate('SongsPlugin.ImportWizardForm',
'You need to add at least one document or '
'presentation file to import from.'))
'You need to add at least one document or '
'presentation file to import from.'))
self.genericAddButton.setFocus()
return False
elif source_format == SongFormat.EasyWorship:
if self.ewFilenameEdit.text().isEmpty():
QtGui.QMessageBox.critical(self,
translate('SongsPlugin.ImportWizardForm',
'No EasyWorship Song Database Selected'),
'No EasyWorship Song Database Selected'),
translate('SongsPlugin.ImportWizardForm',
'You need to select an EasyWorship song database '
'file to import from.'))
'You need to select an EasyWorship song database '
'file to import from.'))
self.ewBrowseButton.setFocus()
return False
elif source_format == SongFormat.SongBeamer:
if self.songBeamerFileListWidget.count() == 0:
QtGui.QMessageBox.critical(self,
translate('SongsPlugin.ImportWizardForm',
'No SongBeamer File Selected'),
'No SongBeamer File Selected'),
translate('SongsPlugin.ImportWizardForm',
'You need to add at least one SongBeamer '
'file to import from.'))
'You need to add at least one SongBeamer '
'file to import from.'))
self.songBeamerAddButton.setFocus()
return False
return True
@ -254,24 +254,57 @@ class SongImportForm(QtGui.QWizard, Ui_SongImportWizard):
# Progress page
return True
def getFileName(self, title, editbox,
filters = '%s (*)' % translate('SongsPlugin.ImportWizardForm',
'All Files')):
def getFileName(self, title, editbox, filters=u''):
"""
Opens a QFileDialog and writes the filename to the given editbox.
``title``
The title of the dialog (unicode).
``editbox``
A editbox (QLineEdit).
``filters``
The file extension filters. It should contain the file descriptions
as well as the file extensions. For example::
u'OpenLP 2.0 Databases (*.sqlite)'
"""
if filters:
filters += u';;'
filters += u'%s (*)' % translate('SongsPlugin.ImportWizardForm',
'All Files')
filename = QtGui.QFileDialog.getOpenFileName(self, title,
SettingsManager.get_last_dir(self.plugin.settingsSection, 1),
filters)
os.path.dirname(SettingsManager.get_last_dir(
self.plugin.settingsSection, 1)), filters)
if filename:
editbox.setText(filename)
SettingsManager.set_last_dir(
self.plugin.settingsSection,
SettingsManager.set_last_dir(self.plugin.settingsSection,
os.path.split(unicode(filename))[0], 1)
def getFiles(self, title, listbox,
filters = u'%s (*)' % translate('SongsPlugin.ImportWizardForm',
'All Files')):
def getFiles(self, title, listbox, filters=u''):
"""
Opens a QFileDialog and writes the filenames to the given listbox.
``title``
The title of the dialog (unicode).
``listbox``
A listbox (QListWidget).
``filters``
The file extension filters. It should contain the file descriptions
as well as the file extensions. For example::
u'SongBeamer files (*.sng)'
"""
if filters:
filters += u';;'
filters += u'%s (*)' % translate('SongsPlugin.ImportWizardForm',
'All Files')
filenames = QtGui.QFileDialog.getOpenFileNames(self, title,
SettingsManager.get_last_dir(self.plugin.settingsSection, 1),
filters)
os.path.dirname(SettingsManager.get_last_dir(
self.plugin.settingsSection, 1)), filters)
if filenames:
listbox.addItems(filenames)
SettingsManager.set_last_dir(
@ -293,24 +326,18 @@ class SongImportForm(QtGui.QWizard, Ui_SongImportWizard):
self.getFileName(
translate('SongsPlugin.ImportWizardForm',
'Select OpenLP 2.0 Database File'),
self.openLP2FilenameEdit,
u'%s (*.sqlite);;%s (*)'
self.openLP2FilenameEdit, u'%s (*.sqlite)'
% (translate('SongsPlugin.ImportWizardForm',
'OpenLP 2.0 Databases'),
translate('SongsPlugin.ImportWizardForm',
'All Files'))
'OpenLP 2.0 Databases'))
)
def onOpenLP1BrowseButtonClicked(self):
self.getFileName(
translate('SongsPlugin.ImportWizardForm',
'Select openlp.org 1.x Database File'),
self.openLP1FilenameEdit,
u'%s (*.olp);;%s (*)'
% (translate('SongsPlugin.ImportWizardForm',
'openlp.org v1.x Databases'),
translate('SongsPlugin.ImportWizardForm',
'All Files'))
self.openLP1FilenameEdit, u'%s (*.olp)'
% translate('SongsPlugin.ImportWizardForm',
'openlp.org v1.x Databases')
)
#def onOpenLyricsAddButtonClicked(self):
@ -337,12 +364,9 @@ class SongImportForm(QtGui.QWizard, Ui_SongImportWizard):
self.getFiles(
translate('SongsPlugin.ImportWizardForm',
'Select Words of Worship Files'),
self.wordsOfWorshipFileListWidget,
u'%s (*.wsg *.wow-song);;%s (*)'
% (translate('SongsPlugin.ImportWizardForm',
'Words Of Worship Song Files'),
translate('SongsPlugin.ImportWizardForm',
'All Files'))
self.wordsOfWorshipFileListWidget, u'%s (*.wsg *.wow-song)'
% translate('SongsPlugin.ImportWizardForm',
'Words Of Worship Song Files')
)
def onWordsOfWorshipRemoveButtonClicked(self):
@ -362,12 +386,9 @@ class SongImportForm(QtGui.QWizard, Ui_SongImportWizard):
self.getFiles(
translate('SongsPlugin.ImportWizardForm',
'Select Songs of Fellowship Files'),
self.songsOfFellowshipFileListWidget,
u'%s (*.rtf);;%s (*)'
% (translate('SongsPlugin.ImportWizardForm',
'Songs Of Felloship Song Files'),
translate('SongsPlugin.ImportWizardForm',
'All Files'))
self.songsOfFellowshipFileListWidget, u'%s (*.rtf)'
% translate('SongsPlugin.ImportWizardForm',
'Songs Of Felloship Song Files')
)
def onSongsOfFellowshipRemoveButtonClicked(self):
@ -394,7 +415,8 @@ class SongImportForm(QtGui.QWizard, Ui_SongImportWizard):
self.getFiles(
translate('SongsPlugin.ImportWizardForm',
'Select SongBeamer Files'),
self.songBeamerFileListWidget
self.songBeamerFileListWidget, u'%s (*.sng)' %
translate('SongsPlugin.ImportWizardForm', 'SongBeamer files')
)
def onSongBeamerRemoveButtonClicked(self):

View File

@ -71,7 +71,8 @@ class VerseType(object):
The string to return a VerseType for
"""
verse_type = verse_type.lower()
if verse_type == unicode(VerseType.to_string(VerseType.Verse)).lower()[0]:
if verse_type == \
unicode(VerseType.to_string(VerseType.Verse)).lower()[0]:
return translate('SongsPlugin.VerseType', 'Verse')
elif verse_type == \
unicode(VerseType.to_string(VerseType.Chorus)).lower()[0]:

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff