From a35b50e7277b77104f0764d604fe7b0ae82e4362 Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Mon, 3 Jan 2011 22:14:56 +0100 Subject: [PATCH 001/123] reindex tool adds 'author unknown' if songs do not have any author --- openlp/plugins/songs/songsplugin.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/openlp/plugins/songs/songsplugin.py b/openlp/plugins/songs/songsplugin.py index 545497acb..63d104d24 100644 --- a/openlp/plugins/songs/songsplugin.py +++ b/openlp/plugins/songs/songsplugin.py @@ -32,7 +32,7 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import Plugin, StringContent, build_icon, translate from openlp.core.lib.db import Manager from openlp.plugins.songs.lib import SongMediaItem, SongsTab, SongXMLParser -from openlp.plugins.songs.lib.db import init_schema, Song +from openlp.plugins.songs.lib.db import Author, init_schema, Song from openlp.plugins.songs.lib.importer import SongFormat log = logging.getLogger(__name__) @@ -146,6 +146,15 @@ class SongsPlugin(Plugin): counter = 0 for song in songs: counter += 1 + # The song does not have any author, add one. + if not song.authors: + name = unicode(translate('SongsPlugin', 'Author unknown')) + author = self.manager.get_object_filtered(Author, + Author.display_name == name) + if author is None: + author = Author.populate(first_name=name.rsplit(u' ', 1)[0], + last_name=name.rsplit(u' ', 1)[1], display_name=name) + song.authors.append(author) if song.title is None: song.title = u'' if song.alternate_title is None: From 8498b3e2ae4380f3fbed7a965570331702c862ee Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Thu, 10 Feb 2011 18:11:14 +0100 Subject: [PATCH 002/123] --- openlp/plugins/songs/songsplugin.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/openlp/plugins/songs/songsplugin.py b/openlp/plugins/songs/songsplugin.py index 37f11582a..2bd636097 100644 --- a/openlp/plugins/songs/songsplugin.py +++ b/openlp/plugins/songs/songsplugin.py @@ -149,12 +149,14 @@ class SongsPlugin(Plugin): counter += 1 # The song does not have any author, add one. if not song.authors: - name = unicode(translate('SongsPlugin', 'Author unknown')) + name = unicode(translate('SongsPlugin', 'Author unknown', + 'Translation must contain a blank character!')) author = self.manager.get_object_filtered(Author, Author.display_name == name) if author is None: - author = Author.populate(first_name=name.rsplit(u' ', 1)[0], - last_name=name.rsplit(u' ', 1)[1], display_name=name) + author = Author.populate( + first_name=name.split(u' ', 1)[:-1], + last_name=name.split(u' ', 1)[-1], display_name=name) song.authors.append(author) if song.title is None: song.title = u'' From 9366155924284ee2403279674a6325aa2352e224 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Fri, 11 Feb 2011 21:17:56 +0000 Subject: [PATCH 003/123] UiStrings and SongStrings --- openlp/core/lib/mediamanageritem.py | 10 ++-- openlp/core/lib/theme.py | 4 +- openlp/core/lib/ui.py | 15 +++--- openlp/core/ui/serviceitemeditdialog.py | 5 +- openlp/plugins/alerts/forms/alertdialog.py | 5 +- .../plugins/bibles/forms/bibleimportform.py | 33 ++++--------- openlp/plugins/custom/customplugin.py | 2 +- .../plugins/custom/forms/editcustomdialog.py | 6 ++- openlp/plugins/custom/forms/editcustomform.py | 7 +-- openlp/plugins/songs/forms/authorsdialog.py | 3 +- openlp/plugins/songs/forms/editsongdialog.py | 9 ++-- openlp/plugins/songs/forms/songbookdialog.py | 3 +- openlp/plugins/songs/forms/songimportform.py | 46 +++++-------------- .../songs/forms/songmaintenancedialog.py | 18 ++++---- openlp/plugins/songs/forms/topicsdialog.py | 3 +- openlp/plugins/songs/lib/mediaitem.py | 5 +- openlp/plugins/songs/lib/ui.py | 43 +++++++++++++++++ 17 files changed, 114 insertions(+), 103 deletions(-) create mode 100644 openlp/plugins/songs/lib/ui.py diff --git a/openlp/core/lib/mediamanageritem.py b/openlp/core/lib/mediamanageritem.py index f74ba63a9..52b4f560b 100644 --- a/openlp/core/lib/mediamanageritem.py +++ b/openlp/core/lib/mediamanageritem.py @@ -449,8 +449,7 @@ class MediaManagerItem(QtGui.QWidget): Add a selected item to the current service """ if not self.listView.selectedIndexes() and not self.remoteTriggered: - QtGui.QMessageBox.information(self, - translate('OpenLP.MediaManagerItem', 'No Items Selected'), + QtGui.QMessageBox.information(self, UiStrings.NISp, translate('OpenLP.MediaManagerItem', 'You must select one or more items.')) else: @@ -476,17 +475,14 @@ class MediaManagerItem(QtGui.QWidget): Add a selected item to an existing item in the current service. """ if not self.listView.selectedIndexes() and not self.remoteTriggered: - QtGui.QMessageBox.information(self, - translate('OpenLP.MediaManagerItem', 'No Items Selected'), + QtGui.QMessageBox.information(self, UiStrings.NISp, translate('OpenLP.MediaManagerItem', 'You must select one or more items')) else: log.debug(u'%s Add requested', self.plugin.name) serviceItem = self.parent.serviceManager.getServiceItem() if not serviceItem: - QtGui.QMessageBox.information(self, - translate('OpenLP.MediaManagerItem', - 'No Service Item Selected'), + QtGui.QMessageBox.information(self, UiStrings.NISs, translate('OpenLP.MediaManagerItem', 'You must select an existing service item to add to.')) elif self.plugin.name.lower() == serviceItem.name.lower(): diff --git a/openlp/core/lib/theme.py b/openlp/core/lib/theme.py index 06340c2eb..67ce33ca4 100644 --- a/openlp/core/lib/theme.py +++ b/openlp/core/lib/theme.py @@ -178,9 +178,9 @@ class HorizontalType(object): """ Return a string representation of a horizontal type. """ - if horizontal_type == Horizontal.Right: + if horizontal_type == HorizontalType.Right: return u'right' - elif horizontal_type == Horizontal.Center: + elif horizontal_type == HorizontalType.Center: return u'center' else: return u'left' diff --git a/openlp/core/lib/ui.py b/openlp/core/lib/ui.py index a3b442801..0c5fe2bf9 100644 --- a/openlp/core/lib/ui.py +++ b/openlp/core/lib/ui.py @@ -46,7 +46,6 @@ class UiStrings(object): 'Add the selected %s to the service.')) Advanced = translate('OpenLP.Ui', 'Advanced') AllFiles = translate('OpenLP.Ui', 'All Files') - Authors = translate('OpenLP.Ui', 'Authors') CreateANew = unicode(translate('OpenLP.Ui', 'Create a new %s.')) Delete = translate('OpenLP.Ui', '&Delete') DeleteSelect = unicode(translate('OpenLP.Ui', 'Delete the selected %s.')) @@ -54,6 +53,7 @@ class UiStrings(object): Edit = translate('OpenLP.Ui', '&Edit') EditSelect = unicode(translate('OpenLP.Ui', 'Edit the selected %s.')) EditType = unicode(translate('OpenLP.Ui', 'Edit %s')) + EmptyField = translate('OpenLP.Ui', 'Empty Field') Error = translate('OpenLP.Ui', 'Error') ExportType = unicode(translate('OpenLP.Ui', 'Export %s')) Import = translate('OpenLP.Ui', 'Import') @@ -63,6 +63,10 @@ class UiStrings(object): LoadANew = unicode(translate('OpenLP.Ui', 'Load a new %s.')) New = translate('OpenLP.Ui', 'New') NewType = unicode(translate('OpenLP.Ui', 'New %s')) + NFSs = translate('OpenLP.Ui', 'No File Selected', 'Singular') + NFSp = translate('OpenLP.Ui', 'No Files Selected', 'Plural') + NISs = translate('OpenLP.Ui', 'No Item Selected', 'Singular') + NISp = translate('OpenLP.Ui', 'No Items Selected', 'Plural') OLPV2 = translate('OpenLP.Ui', 'OpenLP 2.0') OpenType = unicode(translate('OpenLP.Ui', 'Open %s')) Preview = translate('OpenLP.Ui', 'Preview') @@ -75,8 +79,8 @@ class UiStrings(object): SendSelectLive = unicode(translate('OpenLP.Ui', 'Send the selected %s live.')) Service = translate('OpenLP.Ui', 'Service') - Theme = translate('OpenLP.Ui', 'Theme') - Themes = translate('OpenLP.Ui', 'Themes') + Theme = translate('OpenLP.Ui', 'Theme', 'Singular') + Themes = translate('OpenLP.Ui', 'Themes', 'Plural') def add_welcome_page(parent, image): @@ -168,7 +172,7 @@ def media_item_combo_box(parent, name): combo.setSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Fixed) return combo -def create_delete_push_button(parent, icon=None): +def create_delete_push_button(parent, item_name, icon=None): """ Creates a standard push button with a delete label and optional icon. The button is connected to the parent's ``onDeleteButtonClicked()`` method to @@ -186,8 +190,7 @@ def create_delete_push_button(parent, icon=None): delete_icon = icon if icon else u':/general/general_delete.png' delete_button.setIcon(build_icon(delete_icon)) delete_button.setText(UiStrings.Delete) - delete_button.setToolTip( - translate('OpenLP.Ui', 'Delete the selected item.')) + delete_button.setToolTip(UiStrings.DeleteSelect % item_name) QtCore.QObject.connect(delete_button, QtCore.SIGNAL(u'clicked()'), parent.onDeleteButtonClicked) return delete_button diff --git a/openlp/core/ui/serviceitemeditdialog.py b/openlp/core/ui/serviceitemeditdialog.py index ef7e99a5f..0f9ddb4ac 100644 --- a/openlp/core/ui/serviceitemeditdialog.py +++ b/openlp/core/ui/serviceitemeditdialog.py @@ -27,7 +27,7 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import translate -from openlp.core.lib.ui import create_accept_reject_button_box, \ +from openlp.core.lib.ui import UiStrings, create_accept_reject_button_box, \ create_delete_push_button, create_up_down_push_button_set class Ui_ServiceItemEditDialog(object): @@ -41,7 +41,8 @@ class Ui_ServiceItemEditDialog(object): self.dialogLayout.addWidget(self.listWidget, 0, 0) self.buttonLayout = QtGui.QVBoxLayout() self.buttonLayout.setObjectName(u'buttonLayout') - self.deleteButton = create_delete_push_button(serviceItemEditDialog) + self.deleteButton = create_delete_push_button( + serviceItemEditDialog, UiStrings.Service.toLower()) self.buttonLayout.addWidget(self.deleteButton) self.buttonLayout.addStretch() self.upButton, self.downButton = create_up_down_push_button_set( diff --git a/openlp/plugins/alerts/forms/alertdialog.py b/openlp/plugins/alerts/forms/alertdialog.py index 93f7ead06..12f5c04be 100644 --- a/openlp/plugins/alerts/forms/alertdialog.py +++ b/openlp/plugins/alerts/forms/alertdialog.py @@ -26,7 +26,7 @@ from PyQt4 import QtCore, QtGui -from openlp.core.lib import build_icon, translate +from openlp.core.lib import StringContent, build_icon, translate from openlp.core.lib.ui import create_delete_push_button class Ui_AlertDialog(object): @@ -66,7 +66,8 @@ class Ui_AlertDialog(object): self.saveButton.setIcon(build_icon(u':/general/general_save.png')) self.saveButton.setObjectName(u'saveButton') self.manageButtonLayout.addWidget(self.saveButton) - self.deleteButton = create_delete_push_button(alertDialog) + self.deleteButton = create_delete_push_button(alertDialog, + self.parent.getString(StringContent.Name)[u'singular'].toLower()) self.deleteButton.setEnabled(False) self.manageButtonLayout.addWidget(self.deleteButton) self.manageButtonLayout.addStretch() diff --git a/openlp/plugins/bibles/forms/bibleimportform.py b/openlp/plugins/bibles/forms/bibleimportform.py index 463c838c9..0e21b7496 100644 --- a/openlp/plugins/bibles/forms/bibleimportform.py +++ b/openlp/plugins/bibles/forms/bibleimportform.py @@ -35,7 +35,7 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import Receiver, translate from openlp.core.lib.db import delete_database -from openlp.core.lib.ui import critical_error_message_box +from openlp.core.lib.ui import UiStrings, critical_error_message_box from openlp.core.ui.wizard import OpenLPWizard from openlp.core.utils import AppLocation, string_is_unicode from openlp.plugins.bibles.lib.manager import BibleFormat @@ -468,9 +468,7 @@ class BibleImportForm(OpenLPWizard): elif self.currentPage() == self.selectPage: if self.field(u'source_format').toInt()[0] == BibleFormat.OSIS: if not self.field(u'osis_location').toString(): - critical_error_message_box( - translate('BiblesPlugin.ImportWizardForm', - 'Invalid Bible Location'), + critical_error_message_box(UiStrings.NFSs, translate('BiblesPlugin.ImportWizardForm', 'You need to specify a file to import your ' 'Bible from.')) @@ -478,8 +476,7 @@ class BibleImportForm(OpenLPWizard): return False elif self.field(u'source_format').toInt()[0] == BibleFormat.CSV: if not self.field(u'csv_testamentsfile').toString(): - answer = critical_error_message_box(translate( - 'BiblesPlugin.ImportWizardForm', 'No Testaments File'), + answer = critical_error_message_box(UiStrings.NFSs, translate('BiblesPlugin.ImportWizardForm', 'You have not specified a testaments file. Do you ' 'want to proceed with the import?'), question=True) @@ -487,18 +484,14 @@ class BibleImportForm(OpenLPWizard): self.csvTestamentsEdit.setFocus() return False elif not self.field(u'csv_booksfile').toString(): - critical_error_message_box( - translate('BiblesPlugin.ImportWizardForm', - 'Invalid Books File'), + critical_error_message_box(UiStrings.NFSs, translate('BiblesPlugin.ImportWizardForm', 'You need to specify a file with books of ' 'the Bible to use in the import.')) self.csvBooksEdit.setFocus() return False elif not self.field(u'csv_versefile').toString(): - critical_error_message_box( - translate('BiblesPlugin.ImportWizardForm', - 'Invalid Verse File'), + critical_error_message_box(UiStrings.NFSs, translate('BiblesPlugin.ImportWizardForm', 'You need to specify a file of Bible ' 'verses to import.')) @@ -507,9 +500,7 @@ class BibleImportForm(OpenLPWizard): elif self.field(u'source_format').toInt()[0] == \ BibleFormat.OpenSong: if not self.field(u'opensong_file').toString(): - critical_error_message_box( - translate('BiblesPlugin.ImportWizardForm', - 'Invalid OpenSong Bible'), + critical_error_message_box(UiStrings.NFSs, translate('BiblesPlugin.ImportWizardForm', 'You need to specify an OpenSong Bible ' 'file to import.')) @@ -517,9 +508,7 @@ class BibleImportForm(OpenLPWizard): return False elif self.field(u'source_format').toInt()[0] == BibleFormat.OpenLP1: if not self.field(u'openlp1_location').toString(): - critical_error_message_box( - translate('BiblesPlugin.ImportWizardForm', - 'Invalid Bible Location'), + critical_error_message_box(UiStrings.NFSs, translate('BiblesPlugin.ImportWizardForm', 'You need to specify a file to import your ' 'Bible from.')) @@ -531,17 +520,13 @@ class BibleImportForm(OpenLPWizard): license_copyright = \ unicode(self.field(u'license_copyright').toString()) if not license_version: - critical_error_message_box( - translate('BiblesPlugin.ImportWizardForm', - 'Empty Version Name'), + critical_error_message_box(UiStrings.EmptyField, translate('BiblesPlugin.ImportWizardForm', 'You need to specify a version name for your Bible.')) self.versionNameEdit.setFocus() return False elif not license_copyright: - critical_error_message_box( - translate('BiblesPlugin.ImportWizardForm', - 'Empty Copyright'), + critical_error_message_box(UiStrings.EmptyField, translate('BiblesPlugin.ImportWizardForm', 'You need to set a copyright for your Bible. ' 'Bibles in the Public Domain need to be marked as such.')) diff --git a/openlp/plugins/custom/customplugin.py b/openlp/plugins/custom/customplugin.py index 92546cd4f..13f5c5696 100644 --- a/openlp/plugins/custom/customplugin.py +++ b/openlp/plugins/custom/customplugin.py @@ -52,7 +52,7 @@ class CustomPlugin(Plugin): CustomMediaItem, CustomTab) self.weight = -5 self.manager = Manager(u'custom', init_schema) - self.edit_custom_form = EditCustomForm(self.manager) + self.edit_custom_form = EditCustomForm(self) self.icon_path = u':/plugins/plugin_custom.png' self.icon = build_icon(self.icon_path) diff --git a/openlp/plugins/custom/forms/editcustomdialog.py b/openlp/plugins/custom/forms/editcustomdialog.py index 2e8a64a9d..e63c057d0 100644 --- a/openlp/plugins/custom/forms/editcustomdialog.py +++ b/openlp/plugins/custom/forms/editcustomdialog.py @@ -26,7 +26,7 @@ from PyQt4 import QtCore, QtGui -from openlp.core.lib import build_icon, translate +from openlp.core.lib import StringContent, build_icon, translate from openlp.core.lib.ui import UiStrings, create_accept_reject_button_box, \ create_delete_push_button, create_up_down_push_button_set @@ -66,7 +66,9 @@ class Ui_CustomEditDialog(object): self.editAllButton = QtGui.QPushButton(customEditDialog) self.editAllButton.setObjectName(u'editAllButton') self.buttonLayout.addWidget(self.editAllButton) - self.deleteButton = create_delete_push_button(customEditDialog) + self.deleteButton = create_delete_push_button(customEditDialog, + customEditDialog.parent.getString( + StringContent.Name)[u'singular'].toLower()) self.deleteButton.setEnabled(False) self.buttonLayout.addWidget(self.deleteButton) self.buttonLayout.addStretch() diff --git a/openlp/plugins/custom/forms/editcustomform.py b/openlp/plugins/custom/forms/editcustomform.py index b667cd529..a86b28489 100644 --- a/openlp/plugins/custom/forms/editcustomform.py +++ b/openlp/plugins/custom/forms/editcustomform.py @@ -42,14 +42,15 @@ class EditCustomForm(QtGui.QDialog, Ui_CustomEditDialog): Class documentation goes here. """ log.info(u'Custom Editor loaded') - def __init__(self, manager, parent=None): + def __init__(self, parent): """ Constructor """ - QtGui.QDialog.__init__(self, parent) + QtGui.QDialog.__init__(self) + self.parent = parent + self.manager = self.parent.manager self.setupUi(self) # Create other objects and forms. - self.manager = manager self.editSlideForm = EditCustomSlideForm(self) # Connecting signals and slots QtCore.QObject.connect(self.previewButton, diff --git a/openlp/plugins/songs/forms/authorsdialog.py b/openlp/plugins/songs/forms/authorsdialog.py index 09c723364..6cfe83e67 100644 --- a/openlp/plugins/songs/forms/authorsdialog.py +++ b/openlp/plugins/songs/forms/authorsdialog.py @@ -28,6 +28,7 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import translate from openlp.core.lib.ui import create_accept_reject_button_box +from openlp.plugins.songs.lib.ui import SongStrings class Ui_AuthorsDialog(object): def setupUi(self, authorsDialog): @@ -64,7 +65,7 @@ class Ui_AuthorsDialog(object): def retranslateUi(self, authorsDialog): authorsDialog.setWindowTitle( - translate('SongsPlugin.AuthorsForm', 'Author Maintenance')) + SongStrings.TypeMaintenance % SongStrings.Author) self.displayLabel.setText( translate('SongsPlugin.AuthorsForm', 'Display name:')) self.firstNameLabel.setText( diff --git a/openlp/plugins/songs/forms/editsongdialog.py b/openlp/plugins/songs/forms/editsongdialog.py index 234d92283..491f4fa74 100644 --- a/openlp/plugins/songs/forms/editsongdialog.py +++ b/openlp/plugins/songs/forms/editsongdialog.py @@ -28,6 +28,7 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import build_icon, translate from openlp.core.lib.ui import UiStrings, create_accept_reject_button_box +from openlp.plugins.songs.lib.ui import SongStrings class Ui_EditSongDialog(object): def setupUi(self, editSongDialog): @@ -265,21 +266,19 @@ class Ui_EditSongDialog(object): self.songTabWidget.setTabText( self.songTabWidget.indexOf(self.lyricsTab), translate('SongsPlugin.EditSongForm', 'Title && Lyrics')) - self.authorsGroupBox.setTitle(UiStrings.Authors) + self.authorsGroupBox.setTitle(SongStrings.Authors) self.authorAddButton.setText( translate('SongsPlugin.EditSongForm', '&Add to Song')) self.authorRemoveButton.setText( translate('SongsPlugin.EditSongForm', '&Remove')) self.maintenanceButton.setText(translate('SongsPlugin.EditSongForm', '&Manage Authors, Topics, Song Books')) - self.topicsGroupBox.setTitle( - translate('SongsPlugin.EditSongForm', 'Topic')) + self.topicsGroupBox.setTitle(SongStrings.Topic) self.topicAddButton.setText( translate('SongsPlugin.EditSongForm', 'A&dd to Song')) self.topicRemoveButton.setText( translate('SongsPlugin.EditSongForm', 'R&emove')) - self.songBookGroupBox.setTitle( - translate('SongsPlugin.EditSongForm', 'Song Book')) + self.songBookGroupBox.setTitle(SongStrings.SongBook) self.songBookNameLabel.setText(translate('SongsPlugin.EditSongForm', 'Book:')) self.songBookNumberLabel.setText(translate('SongsPlugin.EditSongForm', diff --git a/openlp/plugins/songs/forms/songbookdialog.py b/openlp/plugins/songs/forms/songbookdialog.py index f6dd3930c..d185a9e1e 100644 --- a/openlp/plugins/songs/forms/songbookdialog.py +++ b/openlp/plugins/songs/forms/songbookdialog.py @@ -28,6 +28,7 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import translate from openlp.core.lib.ui import create_accept_reject_button_box +from openlp.plugins.songs.lib.ui import SongStrings class Ui_SongBookDialog(object): def setupUi(self, songBookDialog): @@ -58,7 +59,7 @@ class Ui_SongBookDialog(object): def retranslateUi(self, songBookDialog): songBookDialog.setWindowTitle( - translate('SongsPlugin.SongBookForm', 'Song Book Maintenance')) + SongStrings.TypeMaintenance % SongStrings.SongBook) self.nameLabel.setText(translate('SongsPlugin.SongBookForm', '&Name:')) self.publisherLabel.setText( translate('SongsPlugin.SongBookForm', '&Publisher:')) diff --git a/openlp/plugins/songs/forms/songimportform.py b/openlp/plugins/songs/forms/songimportform.py index b84af8dde..cb9d67b6a 100644 --- a/openlp/plugins/songs/forms/songimportform.py +++ b/openlp/plugins/songs/forms/songimportform.py @@ -330,9 +330,7 @@ class SongImportForm(OpenLPWizard): source_format = self.formatComboBox.currentIndex() if source_format == SongFormat.OpenLP2: if self.openLP2FilenameEdit.text().isEmpty(): - critical_error_message_box( - translate('SongsPlugin.ImportWizardForm', - 'No OpenLP 2.0 Song Database Selected'), + critical_error_message_box(UiStrings.NFSs, translate('SongsPlugin.ImportWizardForm', 'You need to select an OpenLP 2.0 song database ' 'file to import from.')) @@ -340,9 +338,7 @@ class SongImportForm(OpenLPWizard): return False elif source_format == SongFormat.OpenLP1: if self.openLP1FilenameEdit.text().isEmpty(): - critical_error_message_box( - translate('SongsPlugin.ImportWizardForm', - 'No openlp.org 1.x Song Database Selected'), + critical_error_message_box(UiStrings.NFSs, translate('SongsPlugin.ImportWizardForm', 'You need to select an openlp.org 1.x song ' 'database file to import from.')) @@ -350,9 +346,7 @@ class SongImportForm(OpenLPWizard): return False elif source_format == SongFormat.OpenLyrics: if self.openLyricsFileListWidget.count() == 0: - critical_error_message_box( - translate('SongsPlugin.ImportWizardForm', - 'No OpenLyrics Files Selected'), + critical_error_message_box(UiStrings.NFSp, translate('SongsPlugin.ImportWizardForm', 'You need to add at least one OpenLyrics ' 'song file to import from.')) @@ -360,9 +354,7 @@ class SongImportForm(OpenLPWizard): return False elif source_format == SongFormat.OpenSong: if self.openSongFileListWidget.count() == 0: - critical_error_message_box( - translate('SongsPlugin.ImportWizardForm', - 'No OpenSong Files Selected'), + critical_error_message_box(UiStrings.NFSp, translate('SongsPlugin.ImportWizardForm', 'You need to add at least one OpenSong ' 'song file to import from.')) @@ -370,9 +362,7 @@ class SongImportForm(OpenLPWizard): return False elif source_format == SongFormat.WordsOfWorship: if self.wordsOfWorshipFileListWidget.count() == 0: - critical_error_message_box( - translate('SongsPlugin.ImportWizardForm', - 'No Words of Worship Files Selected'), + critical_error_message_box(UiStrings.NFSp, translate('SongsPlugin.ImportWizardForm', 'You need to add at least one Words of Worship ' 'file to import from.')) @@ -380,9 +370,7 @@ class SongImportForm(OpenLPWizard): return False elif source_format == SongFormat.CCLI: if self.ccliFileListWidget.count() == 0: - critical_error_message_box( - translate('SongsPlugin.ImportWizardForm', - 'No CCLI Files Selected'), + critical_error_message_box(UiStrings.NFSp, translate('SongsPlugin.ImportWizardForm', 'You need to add at least one CCLI file ' 'to import from.')) @@ -390,9 +378,7 @@ class SongImportForm(OpenLPWizard): return False elif source_format == SongFormat.SongsOfFellowship: if self.songsOfFellowshipFileListWidget.count() == 0: - critical_error_message_box( - translate('SongsPlugin.ImportWizardForm', - 'No Songs of Fellowship File Selected'), + critical_error_message_box(UiStrings.NFSp, translate('SongsPlugin.ImportWizardForm', 'You need to add at least one Songs of Fellowship ' 'file to import from.')) @@ -400,9 +386,7 @@ class SongImportForm(OpenLPWizard): return False elif source_format == SongFormat.Generic: if self.genericFileListWidget.count() == 0: - critical_error_message_box( - translate('SongsPlugin.ImportWizardForm', - 'No Document/Presentation Selected'), + critical_error_message_box(UiStrings.NFSp, translate('SongsPlugin.ImportWizardForm', 'You need to add at least one document or ' 'presentation file to import from.')) @@ -410,9 +394,7 @@ class SongImportForm(OpenLPWizard): return False elif source_format == SongFormat.EasiSlides: if self.easiSlidesFilenameEdit.text().isEmpty(): - critical_error_message_box( - translate('SongsPlugin.ImportWizardForm', - 'No Easislides Songs file selected'), + critical_error_message_box(UiStrings.NFSp, translate('SongsPlugin.ImportWizardForm', 'You need to select an xml song file exported from ' 'EasiSlides, to import from.')) @@ -420,9 +402,7 @@ class SongImportForm(OpenLPWizard): return False elif source_format == SongFormat.EasyWorship: if self.ewFilenameEdit.text().isEmpty(): - critical_error_message_box( - translate('SongsPlugin.ImportWizardForm', - 'No EasyWorship Song Database Selected'), + critical_error_message_box(UiStrings.NFSs, translate('SongsPlugin.ImportWizardForm', 'You need to select an EasyWorship song database ' 'file to import from.')) @@ -430,9 +410,7 @@ class SongImportForm(OpenLPWizard): return False elif source_format == SongFormat.SongBeamer: if self.songBeamerFileListWidget.count() == 0: - critical_error_message_box( - translate('SongsPlugin.ImportWizardForm', - 'No SongBeamer File Selected'), + critical_error_message_box(UiStrings.NFSp, translate('SongsPlugin.ImportWizardForm', 'You need to add at least one SongBeamer ' 'file to import from.')) @@ -585,7 +563,7 @@ class SongImportForm(OpenLPWizard): 'Select Songs of Fellowship Files'), self.songsOfFellowshipFileListWidget, u'%s (*.rtf)' % translate('SongsPlugin.ImportWizardForm', - 'Songs Of Felloship Song Files') + 'Songs Of Fellowship Song Files') ) def onSongsOfFellowshipRemoveButtonClicked(self): diff --git a/openlp/plugins/songs/forms/songmaintenancedialog.py b/openlp/plugins/songs/forms/songmaintenancedialog.py index 0fa3335dc..10827868c 100644 --- a/openlp/plugins/songs/forms/songmaintenancedialog.py +++ b/openlp/plugins/songs/forms/songmaintenancedialog.py @@ -28,6 +28,7 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import build_icon, translate from openlp.core.lib.ui import UiStrings +from openlp.plugins.songs.lib.ui import SongStrings class Ui_SongMaintenanceDialog(object): def setupUi(self, songMaintenanceDialog): @@ -145,13 +146,10 @@ class Ui_SongMaintenanceDialog(object): def retranslateUi(self, songMaintenanceDialog): songMaintenanceDialog.setWindowTitle( - translate('SongsPlugin.SongMaintenanceForm', 'Song Maintenance')) - authorsString = UiStrings.Authors - topicsString = translate('SongsPlugin.SongMaintenanceForm', 'Topics') - booksString = translate('SongsPlugin.SongMaintenanceForm', 'Song Books') - self.listItemAuthors.setText(authorsString) - self.listItemTopics.setText(topicsString) - self.listItemBooks.setText(booksString) + SongStrings.TypeMaintenance % SongStrings.Song) + self.listItemAuthors.setText(SongStrings.Authors) + self.listItemTopics.setText(SongStrings.Topics) + self.listItemBooks.setText(SongStrings.SongBooks) self.authorsAddButton.setText(UiStrings.Add) self.authorsEditButton.setText(UiStrings.Edit) self.authorsDeleteButton.setText(UiStrings.Delete) @@ -161,8 +159,8 @@ class Ui_SongMaintenanceDialog(object): self.booksAddButton.setText(UiStrings.Add) self.booksEditButton.setText(UiStrings.Edit) self.booksDeleteButton.setText(UiStrings.Delete) - typeListWidth = max(self.fontMetrics().width(authorsString), - self.fontMetrics().width(topicsString), - self.fontMetrics().width(booksString)) + typeListWidth = max(self.fontMetrics().width(SongStrings.Authors), + self.fontMetrics().width(SongStrings.Topics), + self.fontMetrics().width(SongStrings.SongBooks)) self.typeListWidget.setFixedWidth(typeListWidth + self.typeListWidget.iconSize().width() + 32) diff --git a/openlp/plugins/songs/forms/topicsdialog.py b/openlp/plugins/songs/forms/topicsdialog.py index 1e7bdb6a0..4e2349019 100644 --- a/openlp/plugins/songs/forms/topicsdialog.py +++ b/openlp/plugins/songs/forms/topicsdialog.py @@ -28,6 +28,7 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import translate from openlp.core.lib.ui import create_accept_reject_button_box +from openlp.plugins.songs.lib.ui import SongStrings class Ui_TopicsDialog(object): def setupUi(self, topicsDialog): @@ -52,6 +53,6 @@ class Ui_TopicsDialog(object): def retranslateUi(self, topicsDialog): topicsDialog.setWindowTitle( - translate('SongsPlugin.TopicsForm', 'Topic Maintenance')) + SongStrings.TypeMaintenance % SongStrings.Topic) self.nameLabel.setText( translate('SongsPlugin.TopicsForm', 'Topic name:')) diff --git a/openlp/plugins/songs/lib/mediaitem.py b/openlp/plugins/songs/lib/mediaitem.py index 283aa6c03..8d704d51d 100644 --- a/openlp/plugins/songs/lib/mediaitem.py +++ b/openlp/plugins/songs/lib/mediaitem.py @@ -38,6 +38,7 @@ from openlp.plugins.songs.forms import EditSongForm, SongMaintenanceForm, \ SongImportForm, SongExportForm from openlp.plugins.songs.lib import OpenLyrics, SongXML from openlp.plugins.songs.lib.db import Author, Song +from openlp.plugins.songs.lib.ui import SongStrings from openlp.core.lib.searchedit import SearchEdit log = logging.getLogger(__name__) @@ -129,7 +130,7 @@ class SongMediaItem(MediaManagerItem): self.searchTextButton.setText( translate('SongsPlugin.MediaItem', 'Search')) self.maintenanceAction.setText( - translate('SongsPlugin.MediaItem', 'Song Maintenance')) + SongStrings.TypeMaintenance % SongString.Song) self.maintenanceAction.setToolTip(translate('SongsPlugin.MediaItem', 'Maintain the lists of authors, topics and books')) @@ -141,7 +142,7 @@ class SongMediaItem(MediaManagerItem): translate('SongsPlugin.MediaItem', 'Titles')), (3, u':/songs/song_search_lyrics.png', translate('SongsPlugin.MediaItem', 'Lyrics')), - (4, u':/songs/song_search_author.png', UiStrings.Authors), + (4, u':/songs/song_search_author.png', SongStrings.Authors), (5, u':/slides/slide_theme.png', UiStrings.Themes) ]) self.configUpdated() diff --git a/openlp/plugins/songs/lib/ui.py b/openlp/plugins/songs/lib/ui.py new file mode 100644 index 000000000..2a67fce55 --- /dev/null +++ b/openlp/plugins/songs/lib/ui.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4 + +############################################################################### +# OpenLP - Open Source Lyrics Projection # +# --------------------------------------------------------------------------- # +# Copyright (c) 2008-2011 Raoul Snyman # +# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # +# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # +# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # +# Carsten Tinggaard, Frode Woldsund # +# --------------------------------------------------------------------------- # +# This program is free software; you can redistribute it and/or modify it # +# under the terms of the GNU General Public License as published by the Free # +# Software Foundation; version 2 of the License. # +# # +# This program is distributed in the hope that it will be useful, but WITHOUT # +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for # +# more details. # +# # +# You should have received a copy of the GNU General Public License along # +# with this program; if not, write to the Free Software Foundation, Inc., 59 # +# Temple Place, Suite 330, Boston, MA 02111-1307 USA # +############################################################################### +""" +The :mod:`openlp.plugins.songs.lib.ui` module provides standard UI components +for the songs plugin. +""" +from openlp.core.lib import translate + +class SongStrings(object): + """ + Provide standard strings for use throughout the songs plugin. + """ + # These strings should need a good reason to be retranslated elsewhere. + Author = translate('OpenLP.Ui', 'Author', 'Singular') + Authors = translate('OpenLP.Ui', 'Authors', 'Plural') + SongBook = translate('OpenLP.Ui', 'Song Book', 'Singular') + SongBooks = translate('OpenLP.Ui', 'Song Books', 'Plural') + Topic = translate('OpenLP.Ui', 'Topic', 'Singular') + Topics = translate('OpenLP.Ui', 'Topics', 'Plural') + TypeMaintenance = unicode(translate('OpenLP.Ui', '%s Maintenance')) From 23eb12be1a6ee2ca015f90a630bd6d942e078d61 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Fri, 11 Feb 2011 21:40:43 +0000 Subject: [PATCH 004/123] Fixes --- openlp/core/lib/mediamanageritem.py | 1 + openlp/plugins/songs/forms/songmaintenancedialog.py | 2 +- openlp/plugins/songs/lib/mediaitem.py | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/openlp/core/lib/mediamanageritem.py b/openlp/core/lib/mediamanageritem.py index 52b4f560b..74dbf7fe1 100644 --- a/openlp/core/lib/mediamanageritem.py +++ b/openlp/core/lib/mediamanageritem.py @@ -34,6 +34,7 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import context_menu_action, context_menu_separator, \ SettingsManager, OpenLPToolbar, ServiceItem, StringContent, build_icon, \ translate, Receiver, ListWidgetWithDnD +from openlp.core.lib.ui import UiStrings log = logging.getLogger(__name__) diff --git a/openlp/plugins/songs/forms/songmaintenancedialog.py b/openlp/plugins/songs/forms/songmaintenancedialog.py index 10827868c..f6454fcb0 100644 --- a/openlp/plugins/songs/forms/songmaintenancedialog.py +++ b/openlp/plugins/songs/forms/songmaintenancedialog.py @@ -26,7 +26,7 @@ from PyQt4 import QtCore, QtGui -from openlp.core.lib import build_icon, translate +from openlp.core.lib import build_icon from openlp.core.lib.ui import UiStrings from openlp.plugins.songs.lib.ui import SongStrings diff --git a/openlp/plugins/songs/lib/mediaitem.py b/openlp/plugins/songs/lib/mediaitem.py index 8d704d51d..b59d0a7b8 100644 --- a/openlp/plugins/songs/lib/mediaitem.py +++ b/openlp/plugins/songs/lib/mediaitem.py @@ -130,7 +130,7 @@ class SongMediaItem(MediaManagerItem): self.searchTextButton.setText( translate('SongsPlugin.MediaItem', 'Search')) self.maintenanceAction.setText( - SongStrings.TypeMaintenance % SongString.Song) + SongStrings.TypeMaintenance % SongStrings.Song) self.maintenanceAction.setToolTip(translate('SongsPlugin.MediaItem', 'Maintain the lists of authors, topics and books')) From 65cdc31a88228a8c0a14d43f67aab3d7c4b1f5dc Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Fri, 11 Feb 2011 22:15:13 +0000 Subject: [PATCH 005/123] UiStrings --- openlp/core/lib/ui.py | 8 ++++++++ openlp/core/ui/mainwindow.py | 39 +++++++++++++++++------------------- 2 files changed, 26 insertions(+), 21 deletions(-) diff --git a/openlp/core/lib/ui.py b/openlp/core/lib/ui.py index 0c5fe2bf9..1c4137371 100644 --- a/openlp/core/lib/ui.py +++ b/openlp/core/lib/ui.py @@ -59,8 +59,10 @@ class UiStrings(object): Import = translate('OpenLP.Ui', 'Import') ImportType = unicode(translate('OpenLP.Ui', 'Import %s')) Live = translate('OpenLP.Ui', 'Live') + LivePanel = translate('OpenLP.Ui', 'Live Panel') Load = translate('OpenLP.Ui', 'Load') LoadANew = unicode(translate('OpenLP.Ui', 'Load a new %s.')) + MediaManager = translate('OpenLP.Ui', 'Media Manager') New = translate('OpenLP.Ui', 'New') NewType = unicode(translate('OpenLP.Ui', 'New %s')) NFSs = translate('OpenLP.Ui', 'No File Selected', 'Singular') @@ -70,6 +72,7 @@ class UiStrings(object): OLPV2 = translate('OpenLP.Ui', 'OpenLP 2.0') OpenType = unicode(translate('OpenLP.Ui', 'Open %s')) Preview = translate('OpenLP.Ui', 'Preview') + PreviewPanel = translate('OpenLP.Ui', 'Preview Panel') PreviewSelect = unicode(translate('OpenLP.Ui', 'Preview the selected %s.')) ReplaceBG = translate('OpenLP.Ui', 'Replace Background') ReplaceLiveBG = translate('OpenLP.Ui', 'Replace Live Background') @@ -79,8 +82,13 @@ class UiStrings(object): SendSelectLive = unicode(translate('OpenLP.Ui', 'Send the selected %s live.')) Service = translate('OpenLP.Ui', 'Service') + ServiceManager = translate('OpenLP.Ui', 'Service Manager') Theme = translate('OpenLP.Ui', 'Theme', 'Singular') Themes = translate('OpenLP.Ui', 'Themes', 'Plural') + ThemeManager = translate('OpenLP.Ui', 'Theme Manager') + ToggleType = unicode(translate('OpenLP.Ui', 'Toggle %s')) + ToggleVisibility = unicode(translate('OpenLP.Ui', + 'Toggle the visibility of the %s.')) def add_welcome_page(parent, image): diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index 4840ef5da..91c5da716 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -312,12 +312,9 @@ class Ui_MainWindow(object): self.SettingsLanguageMenu.setTitle(translate('OpenLP.MainWindow', '&Language')) self.HelpMenu.setTitle(translate('OpenLP.MainWindow', '&Help')) - self.mediaManagerDock.setWindowTitle( - translate('OpenLP.MainWindow', 'Media Manager')) - self.serviceManagerDock.setWindowTitle( - translate('OpenLP.MainWindow', 'Service Manager')) - self.themeManagerDock.setWindowTitle( - translate('OpenLP.MainWindow', 'Theme Manager')) + self.mediaManagerDock.setWindowTitle(UiStrings.MediaManager) + self.serviceManagerDock.setWindowTitle(UiStrings.ServiceManager) + self.themeManagerDock.setWindowTitle(UiStrings.ThemeManager) self.FileNewItem.setText(translate('OpenLP.MainWindow', '&New')) self.FileNewItem.setToolTip(UiStrings.NewType % UiStrings.Service) self.FileNewItem.setStatusTip( @@ -368,41 +365,41 @@ class Ui_MainWindow(object): self.ViewMediaManagerItem.setText( translate('OpenLP.MainWindow', '&Media Manager')) self.ViewMediaManagerItem.setToolTip( - translate('OpenLP.MainWindow', 'Toggle Media Manager')) - self.ViewMediaManagerItem.setStatusTip(translate('OpenLP.MainWindow', - 'Toggle the visibility of the media manager.')) + UiStrings.Toggle % UiStrings.MediaManager) + self.ViewMediaManagerItem.setStatusTip( + UiStrings.ToggleVisibility % UiStrings.MediaManager.toLower()) self.ViewMediaManagerItem.setShortcut( translate('OpenLP.MainWindow', 'F8')) self.ViewThemeManagerItem.setText( translate('OpenLP.MainWindow', '&Theme Manager')) self.ViewThemeManagerItem.setToolTip( - translate('OpenLP.MainWindow', 'Toggle Theme Manager')) - self.ViewThemeManagerItem.setStatusTip(translate('OpenLP.MainWindow', - 'Toggle the visibility of the theme manager.')) + UiStrings.Toggle % UiStrings.ThemeManager) + self.ViewThemeManagerItem.setStatusTip( + UiStrings.ToggleVisibility % UiStrings.ThemeManager.toLower()) self.ViewThemeManagerItem.setShortcut( translate('OpenLP.MainWindow', 'F10')) self.ViewServiceManagerItem.setText( translate('OpenLP.MainWindow', '&Service Manager')) self.ViewServiceManagerItem.setToolTip( - translate('OpenLP.MainWindow', 'Toggle Service Manager')) - self.ViewServiceManagerItem.setStatusTip(translate('OpenLP.MainWindow', - 'Toggle the visibility of the service manager.')) + UiStrings.Toggle % UiStrings.ServiceManager) + self.ViewServiceManagerItem.setStatusTip( + UiStrings.ToggleVisibility % UiStrings.ServiceManager.toLower()) self.ViewServiceManagerItem.setShortcut( translate('OpenLP.MainWindow', 'F9')) self.ViewPreviewPanel.setText( translate('OpenLP.MainWindow', '&Preview Panel')) self.ViewPreviewPanel.setToolTip( - translate('OpenLP.MainWindow', 'Toggle Preview Panel')) - self.ViewPreviewPanel.setStatusTip(translate('OpenLP.MainWindow', - 'Toggle the visibility of the preview panel.')) + UiStrings.Toggle % UiStrings.PreviewPanel) + self.ViewPreviewPanel.setStatusTip( + UiStrings.ToggleVisibility % UiStrings.PreviewPanel.toLower()) self.ViewPreviewPanel.setShortcut( translate('OpenLP.MainWindow', 'F11')) self.ViewLivePanel.setText( translate('OpenLP.MainWindow', '&Live Panel')) self.ViewLivePanel.setToolTip( - translate('OpenLP.MainWindow', 'Toggle Live Panel')) - self.ViewLivePanel.setStatusTip(translate('OpenLP.MainWindow', - 'Toggle the visibility of the live panel.')) + UiStrings.Toggle % UiStrings.LivePanel) + self.ViewLivePanel.setStatusTip( + UiStrings.ToggleVisibility % UiStrings.LivePanel.toLower()) self.ViewLivePanel.setShortcut( translate('OpenLP.MainWindow', 'F12')) self.settingsPluginListItem.setText(translate('OpenLP.MainWindow', From 314697427dad27a12bcaf80a67602c5736c7595d Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Sat, 12 Feb 2011 00:41:09 +0000 Subject: [PATCH 006/123] Fixes --- openlp/core/ui/mainwindow.py | 10 +++++----- openlp/plugins/songs/forms/songmaintenancedialog.py | 7 ++++--- openlp/plugins/songs/lib/mediaitem.py | 6 +++--- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index 91c5da716..3891c22b1 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -365,7 +365,7 @@ class Ui_MainWindow(object): self.ViewMediaManagerItem.setText( translate('OpenLP.MainWindow', '&Media Manager')) self.ViewMediaManagerItem.setToolTip( - UiStrings.Toggle % UiStrings.MediaManager) + UiStrings.ToggleType % UiStrings.MediaManager) self.ViewMediaManagerItem.setStatusTip( UiStrings.ToggleVisibility % UiStrings.MediaManager.toLower()) self.ViewMediaManagerItem.setShortcut( @@ -373,7 +373,7 @@ class Ui_MainWindow(object): self.ViewThemeManagerItem.setText( translate('OpenLP.MainWindow', '&Theme Manager')) self.ViewThemeManagerItem.setToolTip( - UiStrings.Toggle % UiStrings.ThemeManager) + UiStrings.ToggleType % UiStrings.ThemeManager) self.ViewThemeManagerItem.setStatusTip( UiStrings.ToggleVisibility % UiStrings.ThemeManager.toLower()) self.ViewThemeManagerItem.setShortcut( @@ -381,7 +381,7 @@ class Ui_MainWindow(object): self.ViewServiceManagerItem.setText( translate('OpenLP.MainWindow', '&Service Manager')) self.ViewServiceManagerItem.setToolTip( - UiStrings.Toggle % UiStrings.ServiceManager) + UiStrings.ToggleType % UiStrings.ServiceManager) self.ViewServiceManagerItem.setStatusTip( UiStrings.ToggleVisibility % UiStrings.ServiceManager.toLower()) self.ViewServiceManagerItem.setShortcut( @@ -389,7 +389,7 @@ class Ui_MainWindow(object): self.ViewPreviewPanel.setText( translate('OpenLP.MainWindow', '&Preview Panel')) self.ViewPreviewPanel.setToolTip( - UiStrings.Toggle % UiStrings.PreviewPanel) + UiStrings.ToggleType % UiStrings.PreviewPanel) self.ViewPreviewPanel.setStatusTip( UiStrings.ToggleVisibility % UiStrings.PreviewPanel.toLower()) self.ViewPreviewPanel.setShortcut( @@ -397,7 +397,7 @@ class Ui_MainWindow(object): self.ViewLivePanel.setText( translate('OpenLP.MainWindow', '&Live Panel')) self.ViewLivePanel.setToolTip( - UiStrings.Toggle % UiStrings.LivePanel) + UiStrings.ToggleType % UiStrings.LivePanel) self.ViewLivePanel.setStatusTip( UiStrings.ToggleVisibility % UiStrings.LivePanel.toLower()) self.ViewLivePanel.setShortcut( diff --git a/openlp/plugins/songs/forms/songmaintenancedialog.py b/openlp/plugins/songs/forms/songmaintenancedialog.py index f6454fcb0..14ad1132d 100644 --- a/openlp/plugins/songs/forms/songmaintenancedialog.py +++ b/openlp/plugins/songs/forms/songmaintenancedialog.py @@ -26,7 +26,7 @@ from PyQt4 import QtCore, QtGui -from openlp.core.lib import build_icon +from openlp.core.lib import build_icon, StringContent from openlp.core.lib.ui import UiStrings from openlp.plugins.songs.lib.ui import SongStrings @@ -145,8 +145,9 @@ class Ui_SongMaintenanceDialog(object): QtCore.QMetaObject.connectSlotsByName(songMaintenanceDialog) def retranslateUi(self, songMaintenanceDialog): - songMaintenanceDialog.setWindowTitle( - SongStrings.TypeMaintenance % SongStrings.Song) + songMaintenanceDialog.setWindowTitle(SongStrings.TypeMaintenance % + songMaintenanceDialog.parent().plugin.getString( + StringContent.Name)[u'singular']) self.listItemAuthors.setText(SongStrings.Authors) self.listItemTopics.setText(SongStrings.Topics) self.listItemBooks.setText(SongStrings.SongBooks) diff --git a/openlp/plugins/songs/lib/mediaitem.py b/openlp/plugins/songs/lib/mediaitem.py index b59d0a7b8..99a827a4e 100644 --- a/openlp/plugins/songs/lib/mediaitem.py +++ b/openlp/plugins/songs/lib/mediaitem.py @@ -32,7 +32,7 @@ from PyQt4 import QtCore, QtGui from sqlalchemy.sql import or_ from openlp.core.lib import MediaManagerItem, Receiver, ItemCapabilities, \ - translate, check_item_selected, PluginStatus + translate, check_item_selected, PluginStatus, StringContent from openlp.core.lib.ui import UiStrings from openlp.plugins.songs.forms import EditSongForm, SongMaintenanceForm, \ SongImportForm, SongExportForm @@ -129,8 +129,8 @@ class SongMediaItem(MediaManagerItem): translate('SongsPlugin.MediaItem', 'Search:')) self.searchTextButton.setText( translate('SongsPlugin.MediaItem', 'Search')) - self.maintenanceAction.setText( - SongStrings.TypeMaintenance % SongStrings.Song) + self.maintenanceAction.setText(SongStrings.TypeMaintenance % + self.plugin.getString(StringContent.Name)[u'singular']) self.maintenanceAction.setToolTip(translate('SongsPlugin.MediaItem', 'Maintain the lists of authors, topics and books')) From 8d18a51f09eda9d48a7c58c214642bb11faee6df Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Sat, 12 Feb 2011 02:43:13 +0000 Subject: [PATCH 007/123] WizardStrings --- openlp/core/lib/ui.py | 1 + openlp/core/ui/wizard.py | 23 +++++++++++-- .../plugins/bibles/forms/bibleimportform.py | 34 ++++++++----------- openlp/plugins/songs/forms/songexportform.py | 10 +++--- openlp/plugins/songs/forms/songimportform.py | 32 +++++++---------- 5 files changed, 53 insertions(+), 47 deletions(-) diff --git a/openlp/core/lib/ui.py b/openlp/core/lib/ui.py index 1c4137371..99b266e6e 100644 --- a/openlp/core/lib/ui.py +++ b/openlp/core/lib/ui.py @@ -55,6 +55,7 @@ class UiStrings(object): EditType = unicode(translate('OpenLP.Ui', 'Edit %s')) EmptyField = translate('OpenLP.Ui', 'Empty Field') Error = translate('OpenLP.Ui', 'Error') + Export = translate('OpenLP.Ui', 'Export') ExportType = unicode(translate('OpenLP.Ui', 'Export %s')) Import = translate('OpenLP.Ui', 'Import') ImportType = unicode(translate('OpenLP.Ui', 'Import %s')) diff --git a/openlp/core/ui/wizard.py b/openlp/core/ui/wizard.py index d3410ded9..fff1e2552 100644 --- a/openlp/core/ui/wizard.py +++ b/openlp/core/ui/wizard.py @@ -31,11 +31,30 @@ import os from PyQt4 import QtCore, QtGui -from openlp.core.lib import build_icon, Receiver, SettingsManager +from openlp.core.lib import build_icon, Receiver, SettingsManager, translate from openlp.core.lib.ui import UiStrings, add_welcome_page log = logging.getLogger(__name__) +class WizardStrings(object): + """ + Provide standard strings for wizards to use. + """ + # These strings should need a good reason to be retranslated elsewhere. + Description = unicode(translate('OpenLP.Ui', 'This wizard will help you ' + 'to %s %s from a variety of formats. Click the next button ' + 'below to start the process by selecting a format to %s from.', + 'Variable 1 & 3 are import/export. Variable 2 is a type like Bibles')) + FinishedType = unicode(translate('OpenLP.Ui', 'Finished %s.')) + FormatLabel = translate('OpenLP.Ui', 'Format:') + ImportSelect = translate('OpenLP.Ui', 'Select Import Source') + ImportSelectLong = unicode(translate('OpenLP.Ui', + 'Select the import format and the location to import from.')) + Welcome = u'%s' % \ + translate('OpenLP.Ui', 'Welcome to the %s %s Wizard', + 'Variable 1 is the type e.g. Bible and variable 2 is import/export') + + class OpenLPWizard(QtGui.QWizard): """ Generic OpenLP wizard to provide generic functionality and a unified look @@ -43,6 +62,7 @@ class OpenLPWizard(QtGui.QWizard): """ def __init__(self, parent, plugin, name, image): QtGui.QWizard.__init__(self, parent) + self.plugin = plugin self.setObjectName(name) self.openIcon = build_icon(u':/general/general_open.png') self.deleteIcon = build_icon(u':/general/general_delete.png') @@ -50,7 +70,6 @@ class OpenLPWizard(QtGui.QWizard): self.cancelButton = self.button(QtGui.QWizard.CancelButton) self.setupUi(image) self.registerFields() - self.plugin = plugin self.customInit() self.customSignals() QtCore.QObject.connect(self, QtCore.SIGNAL(u'currentIdChanged(int)'), diff --git a/openlp/plugins/bibles/forms/bibleimportform.py b/openlp/plugins/bibles/forms/bibleimportform.py index 0e21b7496..d97299a42 100644 --- a/openlp/plugins/bibles/forms/bibleimportform.py +++ b/openlp/plugins/bibles/forms/bibleimportform.py @@ -33,10 +33,10 @@ import os.path from PyQt4 import QtCore, QtGui -from openlp.core.lib import Receiver, translate +from openlp.core.lib import Receiver, StringContent, translate from openlp.core.lib.db import delete_database from openlp.core.lib.ui import UiStrings, critical_error_message_box -from openlp.core.ui.wizard import OpenLPWizard +from openlp.core.ui.wizard import OpenLPWizard, WizardStrings from openlp.core.utils import AppLocation, string_is_unicode from openlp.plugins.bibles.lib.manager import BibleFormat @@ -363,22 +363,16 @@ class BibleImportForm(OpenLPWizard): """ self.setWindowTitle( translate('BiblesPlugin.ImportWizardForm', 'Bible Import Wizard')) - self.titleLabel.setText( - u'%s' % \ - translate('BiblesPlugin.ImportWizardForm', - 'Welcome to the Bible Import Wizard')) - self.informationLabel.setText( - translate('BiblesPlugin.ImportWizardForm', - 'This wizard will help you to import Bibles from a ' - 'variety of formats. Click the next button below to start the ' - 'process by selecting a format to import from.')) - self.selectPage.setTitle(translate('BiblesPlugin.ImportWizardForm', - 'Select Import Source')) - self.selectPage.setSubTitle( - translate('BiblesPlugin.ImportWizardForm', - 'Select the import format, and where to import from.')) - self.formatLabel.setText( - translate('BiblesPlugin.ImportWizardForm', 'Format:')) + self.titleLabel.setText(WizardStrings.Welcome % ( + self.plugin.getString(StringContent.Name)[u'singular'], + UiStrings.Import)) + self.informationLabel.setText(WizardStrings.Description % ( + UiStrings.Import.toLower(), + self.plugin.getString(StringContent.Name)[u'plural'], + UiStrings.Import.toLower())) + self.selectPage.setTitle(WizardStrings.ImportSelect) + self.selectPage.setSubTitle(WizardStrings.ImportSelectLong) + self.formatLabel.setText(WizardStrings.FormatLabel) self.formatComboBox.setItemText(0, translate('BiblesPlugin.ImportWizardForm', 'OSIS')) self.formatComboBox.setItemText(1, @@ -796,8 +790,8 @@ class BibleImportForm(OpenLPWizard): 'bible. Please note, that verses will be downloaded on\n' 'demand and thus an internet connection is required.')) else: - self.progressLabel.setText(translate( - 'BiblesPlugin.ImportWizardForm', 'Finished import.')) + self.progressLabel.setText( + WizardStrings.FinishedType % UiStrings.Import.toLower()) else: self.progressLabel.setText(translate( 'BiblesPlugin.ImportWizardForm', 'Your Bible import failed.')) diff --git a/openlp/plugins/songs/forms/songexportform.py b/openlp/plugins/songs/forms/songexportform.py index 849a1ad1e..9e528a969 100644 --- a/openlp/plugins/songs/forms/songexportform.py +++ b/openlp/plugins/songs/forms/songexportform.py @@ -32,8 +32,8 @@ import logging from PyQt4 import QtCore, QtGui from openlp.core.lib import build_icon, Receiver, SettingsManager, translate -from openlp.core.lib.ui import critical_error_message_box -from openlp.core.ui.wizard import OpenLPWizard +from openlp.core.lib.ui import UiStrings, critical_error_message_box +from openlp.core.ui.wizard import OpenLPWizard, WizardStrings from openlp.plugins.songs.lib.db import Song from openlp.plugins.songs.lib.openlyricsexport import OpenLyricsExport @@ -213,9 +213,7 @@ class SongExportForm(OpenLPWizard): self.availableListWidget) if item.checkState() ] if not items: - critical_error_message_box( - translate('SongsPlugin.ExportWizardForm', - 'No Song Selected'), + critical_error_message_box(UiStrings.NISp, translate('SongsPlugin.ExportWizardForm', 'You need to add at least one Song to export.')) return False @@ -289,7 +287,7 @@ class SongExportForm(OpenLPWizard): self, songs, unicode(self.directoryLineEdit.text())) if exporter.do_export(): self.progressLabel.setText( - translate('SongsPlugin.SongExportForm', 'Finished export.')) + WizardStrings.FinishedType % UiStrings.Export.toLower()) else: self.progressLabel.setText( translate('SongsPlugin.SongExportForm', diff --git a/openlp/plugins/songs/forms/songimportform.py b/openlp/plugins/songs/forms/songimportform.py index cb9d67b6a..b8dd2975a 100644 --- a/openlp/plugins/songs/forms/songimportform.py +++ b/openlp/plugins/songs/forms/songimportform.py @@ -31,9 +31,9 @@ import os from PyQt4 import QtCore, QtGui -from openlp.core.lib import Receiver, SettingsManager, translate +from openlp.core.lib import Receiver, SettingsManager, StringContent, translate from openlp.core.lib.ui import UiStrings, critical_error_message_box -from openlp.core.ui.wizard import OpenLPWizard +from openlp.core.ui.wizard import OpenLPWizard, WizardStrings from openlp.plugins.songs.lib.importer import SongFormat log = logging.getLogger(__name__) @@ -199,22 +199,16 @@ class SongImportForm(OpenLPWizard): """ self.setWindowTitle( translate('SongsPlugin.ImportWizardForm', 'Song Import Wizard')) - self.titleLabel.setText( - u'%s' % \ - translate('SongsPlugin.ImportWizardForm', - 'Welcome to the Song Import Wizard')) - self.informationLabel.setText( - translate('SongsPlugin.ImportWizardForm', - 'This wizard will help you to import songs from a variety of ' - 'formats. Click the next button below to start the process by ' - 'selecting a format to import from.')) - self.sourcePage.setTitle( - translate('SongsPlugin.ImportWizardForm', 'Select Import Source')) - self.sourcePage.setSubTitle( - translate('SongsPlugin.ImportWizardForm', - 'Select the import format, and where to import from.')) - self.formatLabel.setText( - translate('SongsPlugin.ImportWizardForm', 'Format:')) + self.titleLabel.setText(WizardStrings.Welcome % ( + self.plugin.getString(StringContent.Name)[u'singular'], + UiStrings.Import)) + self.informationLabel.setText(WizardStrings.Description % ( + UiStrings.Import.toLower(), + self.plugin.getString(StringContent.Name)[u'plural'], + UiStrings.Import.toLower())) + self.sourcePage.setTitle(WizardStrings.ImportSelect) + self.sourcePage.setSubTitle(WizardStrings.ImportSelectLong) + self.formatLabel.setText(WizardStrings.FormatLabel) self.formatComboBox.setItemText(0, UiStrings.OLPV2) self.formatComboBox.setItemText(1, translate('SongsPlugin.ImportWizardForm', 'openlp.org 1.x')) @@ -719,7 +713,7 @@ class SongImportForm(OpenLPWizard): ) if importer.do_import(): self.progressLabel.setText( - translate('SongsPlugin.SongImportForm', 'Finished import.')) + WizardStrings.FinishedType % UiStrings.Import.toLower()) else: self.progressLabel.setText( translate('SongsPlugin.SongImportForm', From a8f16262fc7ae4b6e2e77b1df17a7d0663aa1c9c Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Sat, 12 Feb 2011 04:09:03 +0000 Subject: [PATCH 008/123] More string refactoring --- openlp/core/lib/ui.py | 5 ++++ openlp/core/ui/aboutdialog.py | 7 +++-- openlp/core/ui/advancedtab.py | 2 +- openlp/core/ui/plugindialog.py | 8 +++--- openlp/core/ui/servicemanager.py | 3 +-- openlp/core/ui/themewizard.py | 7 +++-- openlp/core/ui/wizard.py | 14 ++++++++-- .../plugins/bibles/forms/bibleimportform.py | 11 +++----- openlp/plugins/bibles/lib/mediaitem.py | 12 +++------ openlp/plugins/images/lib/mediaitem.py | 2 +- openlp/plugins/songs/forms/songexportform.py | 15 ++++------- openlp/plugins/songs/forms/songimportform.py | 26 +++++++------------ openlp/plugins/songs/lib/mediaitem.py | 6 ++--- 13 files changed, 54 insertions(+), 64 deletions(-) diff --git a/openlp/core/lib/ui.py b/openlp/core/lib/ui.py index 99b266e6e..6ce04af75 100644 --- a/openlp/core/lib/ui.py +++ b/openlp/core/lib/ui.py @@ -40,12 +40,14 @@ class UiStrings(object): """ # These strings should need a good reason to be retranslated elsewhere. # Should some/more/less of these have an & attached? + About = translate('OpenLP.Ui', 'About') Add = translate('OpenLP.Ui', '&Add') AddANew = unicode(translate('OpenLP.Ui', 'Add a new %s.')) AddSelectService = unicode(translate('OpenLP.Ui', 'Add the selected %s to the service.')) Advanced = translate('OpenLP.Ui', 'Advanced') AllFiles = translate('OpenLP.Ui', 'All Files') + Browse = translate('OpenLP.Ui', 'Browse...') CreateANew = unicode(translate('OpenLP.Ui', 'Create a new %s.')) Delete = translate('OpenLP.Ui', '&Delete') DeleteSelect = unicode(translate('OpenLP.Ui', 'Delete the selected %s.')) @@ -57,6 +59,7 @@ class UiStrings(object): Error = translate('OpenLP.Ui', 'Error') Export = translate('OpenLP.Ui', 'Export') ExportType = unicode(translate('OpenLP.Ui', 'Export %s')) + Image = translate('OpenLP.Ui', 'Image') Import = translate('OpenLP.Ui', 'Import') ImportType = unicode(translate('OpenLP.Ui', 'Import %s')) Live = translate('OpenLP.Ui', 'Live') @@ -80,6 +83,7 @@ class UiStrings(object): ResetBG = translate('OpenLP.Ui', 'Reset Background') ResetLiveBG = translate('OpenLP.Ui', 'Reset Live Background') SaveType = unicode(translate('OpenLP.Ui', 'Save %s')) + Search = translate('OpenLP.Ui', 'Search') SendSelectLive = unicode(translate('OpenLP.Ui', 'Send the selected %s live.')) Service = translate('OpenLP.Ui', 'Service') @@ -90,6 +94,7 @@ class UiStrings(object): ToggleType = unicode(translate('OpenLP.Ui', 'Toggle %s')) ToggleVisibility = unicode(translate('OpenLP.Ui', 'Toggle the visibility of the %s.')) + Version = translate('OpenLP.Ui', 'Version') def add_welcome_page(parent, image): diff --git a/openlp/core/ui/aboutdialog.py b/openlp/core/ui/aboutdialog.py index bb09ab91f..19a61b3f8 100644 --- a/openlp/core/ui/aboutdialog.py +++ b/openlp/core/ui/aboutdialog.py @@ -27,6 +27,7 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import build_icon, translate +from openlp.core.lib.ui import UiStrings class Ui_AboutDialog(object): def setupUi(self, aboutDialog): @@ -86,8 +87,7 @@ class Ui_AboutDialog(object): QtCore.QMetaObject.connectSlotsByName(aboutDialog) def retranslateUi(self, aboutDialog): - aboutDialog.setWindowTitle(translate('OpenLP.AboutForm', - 'About OpenLP')) + aboutDialog.setWindowTitle(u'%s OpenLP' % UiStrings.About) self.aboutTextEdit.setPlainText(translate('OpenLP.AboutForm', 'OpenLP - Open Source Lyrics ' 'Projection\n' @@ -105,8 +105,7 @@ class Ui_AboutDialog(object): 'consider contributing by using the button below.' )) self.aboutNotebook.setTabText( - self.aboutNotebook.indexOf(self.aboutTab), - translate('OpenLP.AboutForm', 'About')) + self.aboutNotebook.indexOf(self.aboutTab), UiStrings.About) self.creditsTextEdit.setPlainText(translate('OpenLP.AboutForm', 'Project Lead\n' ' Raoul "superfly" Snyman\n' diff --git a/openlp/core/ui/advancedtab.py b/openlp/core/ui/advancedtab.py index 918335b2e..39fec1f9d 100644 --- a/openlp/core/ui/advancedtab.py +++ b/openlp/core/ui/advancedtab.py @@ -135,7 +135,7 @@ class AdvancedTab(SettingsTab): # self.sharedCheckBox.setText( # translate('AdvancedTab', 'Enable a shared data location')) # self.sharedLabel.setText(translate('AdvancedTab', 'Store location:')) -# self.sharedPushButton.setText(translate('AdvancedTab', 'Browse...')) +# self.sharedPushButton.setText(UiStrings.Browse) # self.databaseGroupBox.setTitle(translate('AdvancedTab', 'Databases')) def load(self): diff --git a/openlp/core/ui/plugindialog.py b/openlp/core/ui/plugindialog.py index 74b2d36c0..84f897a65 100644 --- a/openlp/core/ui/plugindialog.py +++ b/openlp/core/ui/plugindialog.py @@ -25,7 +25,9 @@ ############################################################################### from PyQt4 import QtCore, QtGui + from openlp.core.lib import translate +from openlp.core.lib.ui import UiStrings class Ui_PluginViewDialog(object): def setupUi(self, pluginViewDialog): @@ -76,10 +78,8 @@ class Ui_PluginViewDialog(object): translate('OpenLP.PluginForm', 'Plugin List')) self.pluginInfoGroupBox.setTitle( translate('OpenLP.PluginForm', 'Plugin Details')) - self.versionLabel.setText( - translate('OpenLP.PluginForm', 'Version:')) - self.aboutLabel.setText( - translate('OpenLP.PluginForm', 'About:')) + self.versionLabel.setText(u'%s:' % UiStrings.Version) + self.aboutLabel.setText(u'%s:' % UiStrings.About) self.statusLabel.setText( translate('OpenLP.PluginForm', 'Status:')) self.statusComboBox.setItemText(0, diff --git a/openlp/core/ui/servicemanager.py b/openlp/core/ui/servicemanager.py index 744da7b46..9041b47a7 100644 --- a/openlp/core/ui/servicemanager.py +++ b/openlp/core/ui/servicemanager.py @@ -110,8 +110,7 @@ class ServiceManager(QtGui.QWidget): translate('OpenLP.ServiceManager', 'Save this service'), self.saveFile) self.toolbar.addSeparator() - self.themeLabel = QtGui.QLabel(translate('OpenLP.ServiceManager', - 'Theme:'), self) + self.themeLabel = QtGui.QLabel(u'%s:' % UiStrings.Theme, self) self.themeLabel.setMargin(3) self.themeLabel.setObjectName(u'themeLabel') self.toolbar.addToolbarWidget(u'ThemeLabel', self.themeLabel) diff --git a/openlp/core/ui/themewizard.py b/openlp/core/ui/themewizard.py index 38dd9f1dc..281e216d3 100644 --- a/openlp/core/ui/themewizard.py +++ b/openlp/core/ui/themewizard.py @@ -27,7 +27,7 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import translate, build_icon -from openlp.core.lib.ui import add_welcome_page, create_valign_combo +from openlp.core.lib.ui import UiStrings, add_welcome_page, create_valign_combo class Ui_ThemeWizard(object): def setupUi(self, themeWizard): @@ -421,8 +421,7 @@ class Ui_ThemeWizard(object): translate('OpenLP.ThemeWizard', 'Solid Color')) self.backgroundComboBox.setItemText(1, translate('OpenLP.ThemeWizard', 'Gradient')) - self.backgroundComboBox.setItemText(2, - translate('OpenLP.ThemeWizard', 'Image')) + self.backgroundComboBox.setItemText(2, UiStrings.Image) self.colorLabel.setText(translate('OpenLP.ThemeWizard', 'Color:')) self.gradientStartLabel.setText( translate(u'OpenLP.ThemeWizard', 'Starting color:')) @@ -440,7 +439,7 @@ class Ui_ThemeWizard(object): translate('OpenLP.ThemeWizard', 'Top Left - Bottom Right')) self.gradientComboBox.setItemText(4, translate('OpenLP.ThemeWizard', 'Bottom Left - Top Right')) - self.imageLabel.setText(translate('OpenLP.ThemeWizard', 'Image:')) + self.imageLabel.setText(u'%s:' % UiStrings.Image) self.mainAreaPage.setTitle( translate('OpenLP.ThemeWizard', 'Main Area Font Details')) self.mainAreaPage.setSubTitle( diff --git a/openlp/core/ui/wizard.py b/openlp/core/ui/wizard.py index fff1e2552..1599b4738 100644 --- a/openlp/core/ui/wizard.py +++ b/openlp/core/ui/wizard.py @@ -31,7 +31,8 @@ import os from PyQt4 import QtCore, QtGui -from openlp.core.lib import build_icon, Receiver, SettingsManager, translate +from openlp.core.lib import build_icon, Receiver, SettingsManager, translate, \ + StringContent from openlp.core.lib.ui import UiStrings, add_welcome_page log = logging.getLogger(__name__) @@ -60,10 +61,12 @@ class OpenLPWizard(QtGui.QWizard): Generic OpenLP wizard to provide generic functionality and a unified look and feel. """ - def __init__(self, parent, plugin, name, image): + def __init__(self, parent, plugin, name, image, direction): QtGui.QWizard.__init__(self, parent) self.plugin = plugin self.setObjectName(name) + self.itemType = self.plugin.getString(StringContent.Name) + self.direction = direction self.openIcon = build_icon(u':/general/general_open.png') self.deleteIcon = build_icon(u':/general/general_delete.png') self.finishButton = self.button(QtGui.QWizard.FinishButton) @@ -90,6 +93,13 @@ class OpenLPWizard(QtGui.QWizard): self.retranslateUi() QtCore.QMetaObject.connectSlotsByName(self) + def retranslateUi(self): + """ + Provides generic wizard localisation + """ + self.titleLabel.setText(WizardStrings.Welcome % + (self.itemType[u'singular'], self.direction)) + def registerFields(self): """ Hook method for wizards to register any fields they need. diff --git a/openlp/plugins/bibles/forms/bibleimportform.py b/openlp/plugins/bibles/forms/bibleimportform.py index d97299a42..115d30bfe 100644 --- a/openlp/plugins/bibles/forms/bibleimportform.py +++ b/openlp/plugins/bibles/forms/bibleimportform.py @@ -88,7 +88,7 @@ class BibleImportForm(OpenLPWizard): self.manager = manager self.web_bible_list = {} OpenLPWizard.__init__(self, parent, bibleplugin, u'bibleImportWizard', - u':/wizards/wizard_importbible.bmp') + u':/wizards/wizard_importbible.bmp', UiStrings.Import) def setupUi(self, image): """ @@ -361,15 +361,12 @@ class BibleImportForm(OpenLPWizard): """ Allow for localisation of the bible import wizard. """ + OpenLPWizard.retranslateUi(self) self.setWindowTitle( translate('BiblesPlugin.ImportWizardForm', 'Bible Import Wizard')) - self.titleLabel.setText(WizardStrings.Welcome % ( - self.plugin.getString(StringContent.Name)[u'singular'], - UiStrings.Import)) self.informationLabel.setText(WizardStrings.Description % ( - UiStrings.Import.toLower(), - self.plugin.getString(StringContent.Name)[u'plural'], - UiStrings.Import.toLower())) + self.direction.toLower(), self.itemType[u'plural'], + self.direction.toLower())) self.selectPage.setTitle(WizardStrings.ImportSelect) self.selectPage.setSubTitle(WizardStrings.ImportSelectLong) self.formatLabel.setText(WizardStrings.FormatLabel) diff --git a/openlp/plugins/bibles/lib/mediaitem.py b/openlp/plugins/bibles/lib/mediaitem.py index 58dc11a6a..a0fdc801a 100644 --- a/openlp/plugins/bibles/lib/mediaitem.py +++ b/openlp/plugins/bibles/lib/mediaitem.py @@ -227,20 +227,17 @@ class BibleMediaItem(MediaManagerItem): def retranslateUi(self): log.debug(u'retranslateUi') - self.quickVersionLabel.setText( - translate('BiblesPlugin.MediaItem', 'Version:')) + self.quickVersionLabel.setText(u'%s:' % UiStrings.Version) self.quickSecondLabel.setText( translate('BiblesPlugin.MediaItem', 'Second:')) self.quickSearchTypeLabel.setText( translate('BiblesPlugin.MediaItem', 'Search type:')) self.quickSearchLabel.setText( translate('BiblesPlugin.MediaItem', 'Find:')) - self.quickSearchButton.setText( - translate('BiblesPlugin.MediaItem', 'Search')) + self.quickSearchButton.setText(UiStrings.Search) self.quickClearLabel.setText( translate('BiblesPlugin.MediaItem', 'Results:')) - self.advancedVersionLabel.setText( - translate('BiblesPlugin.MediaItem', 'Version:')) + self.advancedVersionLabel.setText(u'%s:' % UiStrings.Version) self.advancedSecondLabel.setText( translate('BiblesPlugin.MediaItem', 'Second:')) self.advancedBookLabel.setText( @@ -255,8 +252,7 @@ class BibleMediaItem(MediaManagerItem): translate('BiblesPlugin.MediaItem', 'To:')) self.advancedClearLabel.setText( translate('BiblesPlugin.MediaItem', 'Results:')) - self.advancedSearchButton.setText( - translate('BiblesPlugin.MediaItem', 'Search')) + self.advancedSearchButton.setText(UiStrings.Search) self.quickSearchComboBox.addItem( translate('BiblesPlugin.MediaItem', 'Verse Search')) self.quickSearchComboBox.addItem( diff --git a/openlp/plugins/images/lib/mediaitem.py b/openlp/plugins/images/lib/mediaitem.py index 5f95a239c..2a66038ef 100644 --- a/openlp/plugins/images/lib/mediaitem.py +++ b/openlp/plugins/images/lib/mediaitem.py @@ -126,7 +126,7 @@ class ImageMediaItem(MediaManagerItem): items = self.listView.selectedIndexes() if items: service_item.title = unicode( - translate('ImagePlugin.MediaItem', 'Images')) + self.plugin.getString(StringContent.Name)[u'plural']) service_item.add_capability(ItemCapabilities.AllowsMaintain) service_item.add_capability(ItemCapabilities.AllowsPreview) service_item.add_capability(ItemCapabilities.AllowsLoop) diff --git a/openlp/plugins/songs/forms/songexportform.py b/openlp/plugins/songs/forms/songexportform.py index 9e528a969..86b4e448c 100644 --- a/openlp/plugins/songs/forms/songexportform.py +++ b/openlp/plugins/songs/forms/songexportform.py @@ -56,9 +56,8 @@ class SongExportForm(OpenLPWizard): ``plugin`` The songs plugin. """ - self.plugin = plugin OpenLPWizard.__init__(self, parent, plugin, u'songExportWizard', - u':/wizards/wizard_exportsong.bmp') + u':/wizards/wizard_exportsong.bmp', UiStrings.Export) self.stop_export_flag = False QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'openlp_stop_wizard'), self.stop_export) @@ -163,12 +162,9 @@ class SongExportForm(OpenLPWizard): """ Song wizard localisation. """ + OpenLPWizard.retranslateUi(self) self.setWindowTitle( translate('SongsPlugin.ExportWizardForm', 'Song Export Wizard')) - self.titleLabel.setText( - u'%s' % - translate('SongsPlugin.ExportWizardForm', - 'Welcome to the Song Export Wizard')) self.informationLabel.setText( translate('SongsPlugin.ExportWizardForm', 'This wizard will help to' ' export your songs to the open and free OpenLyrics worship song ' @@ -177,15 +173,14 @@ class SongExportForm(OpenLPWizard): translate('SongsPlugin.ExportWizardForm', 'Select Songs')) self.availableSongsPage.setSubTitle( translate('SongsPlugin.ExportWizardForm', - 'Check the songs, you want to export.')) - self.searchLabel.setText( - translate('SongsPlugin.ExportWizardForm', 'Search:')) + 'Check the songs you want to export.')) + self.searchLabel.setText(u'%s:' % UiStrings.Search) self.uncheckButton.setText( translate('SongsPlugin.ExportWizardForm', 'Uncheck All')) self.checkButton.setText( translate('SongsPlugin.ExportWizardForm', 'Check All')) self.exportSongPage.setTitle( - translate('SongsPlugin.ExportWizardForm', 'Select Directory')) + translate('SongsPlugin.ExportWizardForm', 'Select Directory')) self.exportSongPage.setSubTitle( translate('SongsPlugin.ExportWizardForm', 'Select the directory you want the songs to be saved.')) diff --git a/openlp/plugins/songs/forms/songimportform.py b/openlp/plugins/songs/forms/songimportform.py index b8dd2975a..99ff63b3d 100644 --- a/openlp/plugins/songs/forms/songimportform.py +++ b/openlp/plugins/songs/forms/songimportform.py @@ -56,7 +56,7 @@ class SongImportForm(OpenLPWizard): The songs plugin. """ OpenLPWizard.__init__(self, parent, plugin, u'songImportWizard', - u':/wizards/wizard_importsong.bmp') + u':/wizards/wizard_importsong.bmp', UiStrings.Import) def setupUi(self, image): """ @@ -197,15 +197,12 @@ class SongImportForm(OpenLPWizard): """ Song wizard localisation. """ + OpenLPWizard.retranslateUi(self) self.setWindowTitle( translate('SongsPlugin.ImportWizardForm', 'Song Import Wizard')) - self.titleLabel.setText(WizardStrings.Welcome % ( - self.plugin.getString(StringContent.Name)[u'singular'], - UiStrings.Import)) self.informationLabel.setText(WizardStrings.Description % ( - UiStrings.Import.toLower(), - self.plugin.getString(StringContent.Name)[u'plural'], - UiStrings.Import.toLower())) + self.direction.toLower(), self.itemType[u'plural'], + self.direction.toLower())) self.sourcePage.setTitle(WizardStrings.ImportSelect) self.sourcePage.setSubTitle(WizardStrings.ImportSelectLong) self.formatLabel.setText(WizardStrings.FormatLabel) @@ -235,12 +232,10 @@ class SongImportForm(OpenLPWizard): # translate('SongsPlugin.ImportWizardForm', 'CSV')) self.openLP2FilenameLabel.setText( translate('SongsPlugin.ImportWizardForm', 'Filename:')) - self.openLP2BrowseButton.setText( - translate('SongsPlugin.ImportWizardForm', 'Browse...')) + self.openLP2BrowseButton.setText(UiStrings.Browse) self.openLP1FilenameLabel.setText( translate('SongsPlugin.ImportWizardForm', 'Filename:')) - self.openLP1BrowseButton.setText( - translate('SongsPlugin.ImportWizardForm', 'Browse...')) + self.openLP1BrowseButton.setText(UiStrings.Browse) self.openLP1DisabledLabel.setText( translate('SongsPlugin.ImportWizardForm', 'The openlp.org 1.x ' 'importer has been disabled due to a missing Python module. If ' @@ -285,20 +280,17 @@ class SongImportForm(OpenLPWizard): 'find OpenOffice.org on your computer.')) self.easiSlidesFilenameLabel.setText( translate('SongsPlugin.ImportWizardForm', 'Filename:')) - self.easiSlidesBrowseButton.setText( - translate('SongsPlugin.ImportWizardForm', 'Browse...')) + self.easiSlidesBrowseButton.setText(UiStrings.Browse) self.ewFilenameLabel.setText( translate('SongsPlugin.ImportWizardForm', 'Filename:')) - self.ewBrowseButton.setText( - translate('SongsPlugin.ImportWizardForm', 'Browse...')) + self.ewBrowseButton.setText(UiStrings.Browse) self.songBeamerAddButton.setText( translate('SongsPlugin.ImportWizardForm', 'Add Files...')) self.songBeamerRemoveButton.setText( translate('SongsPlugin.ImportWizardForm', 'Remove File(s)')) # self.csvFilenameLabel.setText( # translate('SongsPlugin.ImportWizardForm', 'Filename:')) -# self.csvBrowseButton.setText( -# translate('SongsPlugin.ImportWizardForm', 'Browse...')) +# self.csvBrowseButton.setText(UiStrings.Browse) self.progressPage.setTitle( translate('SongsPlugin.ImportWizardForm', 'Importing')) self.progressPage.setSubTitle( diff --git a/openlp/plugins/songs/lib/mediaitem.py b/openlp/plugins/songs/lib/mediaitem.py index 99a827a4e..b95a28c74 100644 --- a/openlp/plugins/songs/lib/mediaitem.py +++ b/openlp/plugins/songs/lib/mediaitem.py @@ -125,10 +125,8 @@ class SongMediaItem(MediaManagerItem): QtCore.QVariant(u'True')).toBool() def retranslateUi(self): - self.searchTextLabel.setText( - translate('SongsPlugin.MediaItem', 'Search:')) - self.searchTextButton.setText( - translate('SongsPlugin.MediaItem', 'Search')) + self.searchTextLabel.setText(u'%s:' % UiStrings.Search) + self.searchTextButton.setText(UiStrings.Search) self.maintenanceAction.setText(SongStrings.TypeMaintenance % self.plugin.getString(StringContent.Name)[u'singular']) self.maintenanceAction.setToolTip(translate('SongsPlugin.MediaItem', From 0988158c560992b9d65ee8072eec5c445079402c Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Sat, 12 Feb 2011 04:20:53 +0000 Subject: [PATCH 009/123] Import fixes --- openlp/plugins/bibles/forms/bibleimportform.py | 2 +- openlp/plugins/images/lib/mediaitem.py | 2 +- openlp/plugins/songs/forms/songimportform.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/openlp/plugins/bibles/forms/bibleimportform.py b/openlp/plugins/bibles/forms/bibleimportform.py index 115d30bfe..e4f1a2342 100644 --- a/openlp/plugins/bibles/forms/bibleimportform.py +++ b/openlp/plugins/bibles/forms/bibleimportform.py @@ -33,7 +33,7 @@ import os.path from PyQt4 import QtCore, QtGui -from openlp.core.lib import Receiver, StringContent, translate +from openlp.core.lib import Receiver, translate from openlp.core.lib.db import delete_database from openlp.core.lib.ui import UiStrings, critical_error_message_box from openlp.core.ui.wizard import OpenLPWizard, WizardStrings diff --git a/openlp/plugins/images/lib/mediaitem.py b/openlp/plugins/images/lib/mediaitem.py index 2a66038ef..ef5b6174a 100644 --- a/openlp/plugins/images/lib/mediaitem.py +++ b/openlp/plugins/images/lib/mediaitem.py @@ -31,7 +31,7 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import MediaManagerItem, build_icon, ItemCapabilities, \ SettingsManager, translate, check_item_selected, check_directory_exists, \ - Receiver + Receiver, StringContent from openlp.core.lib.ui import UiStrings, critical_error_message_box from openlp.core.utils import AppLocation, delete_file, get_images_filter diff --git a/openlp/plugins/songs/forms/songimportform.py b/openlp/plugins/songs/forms/songimportform.py index 99ff63b3d..b0ca243ca 100644 --- a/openlp/plugins/songs/forms/songimportform.py +++ b/openlp/plugins/songs/forms/songimportform.py @@ -31,7 +31,7 @@ import os from PyQt4 import QtCore, QtGui -from openlp.core.lib import Receiver, SettingsManager, StringContent, translate +from openlp.core.lib import Receiver, SettingsManager, translate from openlp.core.lib.ui import UiStrings, critical_error_message_box from openlp.core.ui.wizard import OpenLPWizard, WizardStrings from openlp.plugins.songs.lib.importer import SongFormat From 34cf16fd0671eeb5cf47b05f3be5b3dac2cb948a Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Sat, 12 Feb 2011 15:37:02 +0000 Subject: [PATCH 010/123] WizardStrings --- openlp/core/ui/wizard.py | 1 + openlp/plugins/bibles/forms/bibleimportform.py | 3 +-- openlp/plugins/songs/forms/songimportform.py | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/openlp/core/ui/wizard.py b/openlp/core/ui/wizard.py index 1599b4738..0bb610104 100644 --- a/openlp/core/ui/wizard.py +++ b/openlp/core/ui/wizard.py @@ -48,6 +48,7 @@ class WizardStrings(object): 'Variable 1 & 3 are import/export. Variable 2 is a type like Bibles')) FinishedType = unicode(translate('OpenLP.Ui', 'Finished %s.')) FormatLabel = translate('OpenLP.Ui', 'Format:') + Importing = translate('OpenLP.Ui', 'Importing') ImportSelect = translate('OpenLP.Ui', 'Select Import Source') ImportSelectLong = unicode(translate('OpenLP.Ui', 'Select the import format and the location to import from.')) diff --git a/openlp/plugins/bibles/forms/bibleimportform.py b/openlp/plugins/bibles/forms/bibleimportform.py index e4f1a2342..b3fa403e8 100644 --- a/openlp/plugins/bibles/forms/bibleimportform.py +++ b/openlp/plugins/bibles/forms/bibleimportform.py @@ -426,8 +426,7 @@ class BibleImportForm(OpenLPWizard): translate('BiblesPlugin.ImportWizardForm', 'Copyright:')) self.permissionsLabel.setText( translate('BiblesPlugin.ImportWizardForm', 'Permissions:')) - self.progressPage.setTitle( - translate('BiblesPlugin.ImportWizardForm', 'Importing')) + self.progressPage.setTitle(WizardStrings.Importing) self.progressPage.setSubTitle( translate('BiblesPlugin.ImportWizardForm', 'Please wait while your Bible is imported.')) diff --git a/openlp/plugins/songs/forms/songimportform.py b/openlp/plugins/songs/forms/songimportform.py index b0ca243ca..8d79acec0 100644 --- a/openlp/plugins/songs/forms/songimportform.py +++ b/openlp/plugins/songs/forms/songimportform.py @@ -291,8 +291,7 @@ class SongImportForm(OpenLPWizard): # self.csvFilenameLabel.setText( # translate('SongsPlugin.ImportWizardForm', 'Filename:')) # self.csvBrowseButton.setText(UiStrings.Browse) - self.progressPage.setTitle( - translate('SongsPlugin.ImportWizardForm', 'Importing')) + self.progressPage.setTitle(WizardStrings.Importing) self.progressPage.setSubTitle( translate('SongsPlugin.ImportWizardForm', 'Please wait while your songs are imported.')) From 0561fa2525321aebe096bab4f927d8299fd748c1 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Sat, 12 Feb 2011 18:43:23 +0000 Subject: [PATCH 011/123] Strings --- openlp/core/lib/ui.py | 5 +++-- openlp/core/ui/thememanager.py | 6 +++--- openlp/plugins/songs/forms/songmaintenanceform.py | 13 +++++++------ 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/openlp/core/lib/ui.py b/openlp/core/lib/ui.py index 6ce04af75..5a8293617 100644 --- a/openlp/core/lib/ui.py +++ b/openlp/core/lib/ui.py @@ -52,13 +52,14 @@ class UiStrings(object): Delete = translate('OpenLP.Ui', '&Delete') DeleteSelect = unicode(translate('OpenLP.Ui', 'Delete the selected %s.')) DeleteType = unicode(translate('OpenLP.Ui', 'Delete %s')) + AmpDeleteType = unicode(translate('OpenLP.Ui', '&Delete %s')) Edit = translate('OpenLP.Ui', '&Edit') EditSelect = unicode(translate('OpenLP.Ui', 'Edit the selected %s.')) - EditType = unicode(translate('OpenLP.Ui', 'Edit %s')) + EditType = unicode(translate('OpenLP.Ui', '&Edit %s')) EmptyField = translate('OpenLP.Ui', 'Empty Field') Error = translate('OpenLP.Ui', 'Error') Export = translate('OpenLP.Ui', 'Export') - ExportType = unicode(translate('OpenLP.Ui', 'Export %s')) + ExportType = unicode(translate('OpenLP.Ui', '&Export %s')) Image = translate('OpenLP.Ui', 'Image') Import = translate('OpenLP.Ui', 'Import') ImportType = unicode(translate('OpenLP.Ui', 'Import %s')) diff --git a/openlp/core/ui/thememanager.py b/openlp/core/ui/thememanager.py index 36abb19c1..8dcc2454e 100644 --- a/openlp/core/ui/thememanager.py +++ b/openlp/core/ui/thememanager.py @@ -105,7 +105,7 @@ class ThemeManager(QtGui.QWidget): # build the context menu self.menu = QtGui.QMenu() self.editAction = self.menu.addAction( - translate('OpenLP.ThemeManager', '&Edit Theme')) + UiStrings.EditType % UiStrings.Theme) self.editAction.setIcon(build_icon(u':/themes/theme_edit.png')) self.copyAction = self.menu.addAction( translate('OpenLP.ThemeManager', '&Copy Theme')) @@ -114,14 +114,14 @@ class ThemeManager(QtGui.QWidget): translate('OpenLP.ThemeManager', '&Rename Theme')) self.renameAction.setIcon(build_icon(u':/themes/theme_edit.png')) self.deleteAction = self.menu.addAction( - translate('OpenLP.ThemeManager', '&Delete Theme')) + UiStrings.AmpDeleteType % UiStrings.Theme) self.deleteAction.setIcon(build_icon(u':/general/general_delete.png')) self.separator = self.menu.addSeparator() self.globalAction = self.menu.addAction( translate('OpenLP.ThemeManager', 'Set As &Global Default')) self.globalAction.setIcon(build_icon(u':/general/general_export.png')) self.exportAction = self.menu.addAction( - translate('OpenLP.ThemeManager', '&Export Theme')) + UiStrings.ExportType % UiStrings.Theme) self.exportAction.setIcon(build_icon(u':/general/general_export.png')) # Signals QtCore.QObject.connect(self.themeListWidget, diff --git a/openlp/plugins/songs/forms/songmaintenanceform.py b/openlp/plugins/songs/forms/songmaintenanceform.py index 1eb63fbf4..218debd7d 100644 --- a/openlp/plugins/songs/forms/songmaintenanceform.py +++ b/openlp/plugins/songs/forms/songmaintenanceform.py @@ -29,9 +29,10 @@ from PyQt4 import QtGui, QtCore from sqlalchemy.sql import and_ from openlp.core.lib import Receiver, translate -from openlp.core.lib.ui import critical_error_message_box +from openlp.core.lib.ui import UiStrings, critical_error_message_box from openlp.plugins.songs.forms import AuthorsForm, TopicsForm, SongBookForm from openlp.plugins.songs.lib.db import Author, Book, Topic, Song +from openlp.plugins.songs.lib.ui import SongStrings from songmaintenancedialog import Ui_SongMaintenanceDialog log = logging.getLogger(__name__) @@ -447,7 +448,7 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog): Delete the author if the author is not attached to any songs. """ self._deleteItem(Author, self.authorsListWidget, self.resetAuthors, - translate('SongsPlugin.SongMaintenanceForm', 'Delete Author'), + UiStrings.DeleteType % SongStrings.Author, translate('SongsPlugin.SongMaintenanceForm', 'Are you sure you want to delete the selected author?'), translate('SongsPlugin.SongMaintenanceForm', @@ -457,10 +458,10 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog): def onTopicDeleteButtonClick(self): """ - Delete the Book is the Book is not attached to any songs. + Delete the Book if the Book is not attached to any songs. """ self._deleteItem(Topic, self.topicsListWidget, self.resetTopics, - translate('SongsPlugin.SongMaintenanceForm', 'Delete Topic'), + UiStrings.DeleteType % SongStrings.Topic, translate('SongsPlugin.SongMaintenanceForm', 'Are you sure you want to delete the selected topic?'), translate('SongsPlugin.SongMaintenanceForm', @@ -470,10 +471,10 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog): def onBookDeleteButtonClick(self): """ - Delete the Book is the Book is not attached to any songs. + Delete the Book if the Book is not attached to any songs. """ self._deleteItem(Book, self.booksListWidget, self.resetBooks, - translate('SongsPlugin.SongMaintenanceForm', 'Delete Book'), + UiStrings.DeleteType % SongStrings.SongBook, translate('SongsPlugin.SongMaintenanceForm', 'Are you sure you want to delete the selected book?'), translate('SongsPlugin.SongMaintenanceForm', From bffa44a1cb1c3bd9099bc168b568866ea8c28dc3 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Sat, 12 Feb 2011 20:25:40 +0000 Subject: [PATCH 012/123] Wizards and applications --- openlp/core/lib/ui.py | 1 + openlp/core/ui/wizard.py | 17 +++ .../plugins/bibles/forms/bibleimportform.py | 48 +++--- openlp/plugins/songs/forms/songimportform.py | 140 +++++------------- 4 files changed, 75 insertions(+), 131 deletions(-) diff --git a/openlp/core/lib/ui.py b/openlp/core/lib/ui.py index 5a8293617..737bb75d2 100644 --- a/openlp/core/lib/ui.py +++ b/openlp/core/lib/ui.py @@ -74,6 +74,7 @@ class UiStrings(object): NFSp = translate('OpenLP.Ui', 'No Files Selected', 'Plural') NISs = translate('OpenLP.Ui', 'No Item Selected', 'Singular') NISp = translate('OpenLP.Ui', 'No Items Selected', 'Plural') + OLPV1 = translate('OpenLP.Ui', 'openlp.org 1.x') OLPV2 = translate('OpenLP.Ui', 'OpenLP 2.0') OpenType = unicode(translate('OpenLP.Ui', 'Open %s')) Preview = translate('OpenLP.Ui', 'Preview') diff --git a/openlp/core/ui/wizard.py b/openlp/core/ui/wizard.py index 0bb610104..14511f21f 100644 --- a/openlp/core/ui/wizard.py +++ b/openlp/core/ui/wizard.py @@ -41,6 +41,20 @@ class WizardStrings(object): """ Provide standard strings for wizards to use. """ + # Applications/Formats we import from or export to. These get used in + # multiple places but do not need translating unless you find evidence of + # the writers translating their own product name. + CCLI = u'CCLI/SongSelect' + CSV = u'CSV' + EW = u'EasyWorship' + ES = u'EasiSlides' + GDP = translate('OpenLP.Ui', 'Generic Document or Presentation') + OL = u'OpenLyrics' + OS = u'OpenSong' + OSIS = u'OSIS' + SB = u'SongBeamer' + SoF = u'Songs of Fellowship' + WoW = u'Words of Worship' # These strings should need a good reason to be retranslated elsewhere. Description = unicode(translate('OpenLP.Ui', 'This wizard will help you ' 'to %s %s from a variety of formats. Click the next button ' @@ -52,9 +66,12 @@ class WizardStrings(object): ImportSelect = translate('OpenLP.Ui', 'Select Import Source') ImportSelectLong = unicode(translate('OpenLP.Ui', 'Select the import format and the location to import from.')) + OpenTypeFile = unicode(translate('OpenLP.Ui', 'Open %s File')) Welcome = u'%s' % \ translate('OpenLP.Ui', 'Welcome to the %s %s Wizard', 'Variable 1 is the type e.g. Bible and variable 2 is import/export') + YouSpecifyFile = unicode(translate('OpenLP.Ui', 'You need to specify at ' + 'least one %s file to import from.', 'A file type e.g. OpenSong')) class OpenLPWizard(QtGui.QWizard): diff --git a/openlp/plugins/bibles/forms/bibleimportform.py b/openlp/plugins/bibles/forms/bibleimportform.py index b3fa403e8..80f44e481 100644 --- a/openlp/plugins/bibles/forms/bibleimportform.py +++ b/openlp/plugins/bibles/forms/bibleimportform.py @@ -370,12 +370,9 @@ class BibleImportForm(OpenLPWizard): self.selectPage.setTitle(WizardStrings.ImportSelect) self.selectPage.setSubTitle(WizardStrings.ImportSelectLong) self.formatLabel.setText(WizardStrings.FormatLabel) - self.formatComboBox.setItemText(0, - translate('BiblesPlugin.ImportWizardForm', 'OSIS')) - self.formatComboBox.setItemText(1, - translate('BiblesPlugin.ImportWizardForm', 'CSV')) - self.formatComboBox.setItemText(2, - translate('BiblesPlugin.ImportWizardForm', 'OpenSong')) + self.formatComboBox.setItemText(0, WizardStrings.OSIS) + self.formatComboBox.setItemText(1, WizardStrings.CSV) + self.formatComboBox.setItemText(2, WizardStrings.OS) self.formatComboBox.setItemText(3, translate('BiblesPlugin.ImportWizardForm', 'Web Download')) self.formatComboBox.setItemText(4, @@ -459,9 +456,7 @@ class BibleImportForm(OpenLPWizard): if self.field(u'source_format').toInt()[0] == BibleFormat.OSIS: if not self.field(u'osis_location').toString(): critical_error_message_box(UiStrings.NFSs, - translate('BiblesPlugin.ImportWizardForm', - 'You need to specify a file to import your ' - 'Bible from.')) + WizardStrings.YouSpecifyFile % WizardStrings.OSIS) self.osisFileEdit.setFocus() return False elif self.field(u'source_format').toInt()[0] == BibleFormat.CSV: @@ -473,7 +468,7 @@ class BibleImportForm(OpenLPWizard): if answer == QtGui.QMessageBox.No: self.csvTestamentsEdit.setFocus() return False - elif not self.field(u'csv_booksfile').toString(): + if not self.field(u'csv_booksfile').toString(): critical_error_message_box(UiStrings.NFSs, translate('BiblesPlugin.ImportWizardForm', 'You need to specify a file with books of ' @@ -491,17 +486,13 @@ class BibleImportForm(OpenLPWizard): BibleFormat.OpenSong: if not self.field(u'opensong_file').toString(): critical_error_message_box(UiStrings.NFSs, - translate('BiblesPlugin.ImportWizardForm', - 'You need to specify an OpenSong Bible ' - 'file to import.')) + WizardStrings.YouSpecifyFile % WizardStrings.OS) self.openSongFileEdit.setFocus() return False elif self.field(u'source_format').toInt()[0] == BibleFormat.OpenLP1: if not self.field(u'openlp1_location').toString(): critical_error_message_box(UiStrings.NFSs, - translate('BiblesPlugin.ImportWizardForm', - 'You need to specify a file to import your ' - 'Bible from.')) + WizardStrings.YouSpecifyFile % UiStrings.OLPV1) self.openlp1FileEdit.setFocus() return False return True @@ -551,24 +542,22 @@ class BibleImportForm(OpenLPWizard): """ Show the file open dialog for the OSIS file. """ - self.getFileName( - translate('BiblesPlugin.ImportWizardForm', 'Open OSIS File'), + self.getFileName(WizardStrings.OpenTypeFile % WizardStrings.OSIS, self.osisFileEdit) def onCsvTestamentsBrowseButtonClicked(self): """ Show the file open dialog for the testaments CSV file. """ - self.getFileName(translate('BiblesPlugin.ImportWizardForm', - 'Open Testaments CSV File'), self.csvTestamentsEdit, u'%s (*.csv)' + self.getFileName(WizardStrings.OpenTypeFile % WizardStrings.CSV, + self.csvTestamentsEdit, u'%s (*.csv)' % translate('BiblesPlugin.ImportWizardForm', 'CSV File')) def onCsvBooksBrowseButtonClicked(self): """ Show the file open dialog for the books CSV file. """ - self.getFileName( - translate('BiblesPlugin.ImportWizardForm', 'Open Books CSV File'), + self.getFileName(WizardStrings.OpenTypeFile % WizardStrings.CSV, self.csvBooksEdit, u'%s (*.csv)' % translate('BiblesPlugin.ImportWizardForm', 'CSV File')) @@ -576,27 +565,24 @@ class BibleImportForm(OpenLPWizard): """ Show the file open dialog for the verses CSV file. """ - self.getFileName(translate('BiblesPlugin.ImportWizardForm', - 'Open Verses CSV File'), self.csvVersesEdit, u'%s (*.csv)' + self.getFileName(WizardStrings.OpenTypeFile % WizardStrings.CSV, + self.csvVersesEdit, u'%s (*.csv)' % translate('BiblesPlugin.ImportWizardForm', 'CSV File')) def onOpenSongBrowseButtonClicked(self): """ Show the file open dialog for the OpenSong file. """ - self.getFileName( - translate('BiblesPlugin.ImportWizardForm', 'Open OpenSong Bible'), + self.getFileName(WizardStrings.OpenTypeFile % WizardStrings.OS, self.openSongFileEdit) def onOpenlp1BrowseButtonClicked(self): """ Show the file open dialog for the openlp.org 1.x file. """ - self.getFileName( - translate('BiblesPlugin.ImportWizardForm', - 'Open openlp.org 1.x Bible'), self.openlp1FileEdit, - u'%s (*.bible)' % translate('BiblesPlugin.ImportWizardForm', - 'openlp.org 1.x bible')) + self.getFileName(WizardStrings.OpenTypeFile % WizardStrings.OLPV1, + self.openlp1FileEdit, u'%s (*.bible)' % + translate('BiblesPlugin.ImportWizardForm', 'openlp.org 1.x bible')) def registerFields(self): """ diff --git a/openlp/plugins/songs/forms/songimportform.py b/openlp/plugins/songs/forms/songimportform.py index 8d79acec0..6c851b04b 100644 --- a/openlp/plugins/songs/forms/songimportform.py +++ b/openlp/plugins/songs/forms/songimportform.py @@ -207,29 +207,17 @@ class SongImportForm(OpenLPWizard): self.sourcePage.setSubTitle(WizardStrings.ImportSelectLong) self.formatLabel.setText(WizardStrings.FormatLabel) self.formatComboBox.setItemText(0, UiStrings.OLPV2) - self.formatComboBox.setItemText(1, - translate('SongsPlugin.ImportWizardForm', 'openlp.org 1.x')) - self.formatComboBox.setItemText(2, - translate('SongsPlugin.ImportWizardForm', 'OpenLyrics')) - self.formatComboBox.setItemText(3, - translate('SongsPlugin.ImportWizardForm', 'OpenSong')) - self.formatComboBox.setItemText(4, - translate('SongsPlugin.ImportWizardForm', 'Words of Worship')) - self.formatComboBox.setItemText(5, - translate('SongsPlugin.ImportWizardForm', 'CCLI/SongSelect')) - self.formatComboBox.setItemText(6, - translate('SongsPlugin.ImportWizardForm', 'Songs of Fellowship')) - self.formatComboBox.setItemText(7, - translate('SongsPlugin.ImportWizardForm', - 'Generic Document/Presentation')) - self.formatComboBox.setItemText(8, - translate('SongsPlugin.ImportWizardForm', 'EasiSlides')) - self.formatComboBox.setItemText(9, - translate('SongsPlugin.ImportWizardForm', 'EasyWorship')) - self.formatComboBox.setItemText(10, - translate('SongsPlugin.ImportWizardForm', 'SongBeamer')) -# self.formatComboBox.setItemText(11, -# translate('SongsPlugin.ImportWizardForm', 'CSV')) + self.formatComboBox.setItemText(1, UiStrings.OLPV1) + self.formatComboBox.setItemText(2, WizardStrings.OL) + self.formatComboBox.setItemText(3, WizardStrings.OS) + self.formatComboBox.setItemText(4, WizardStrings.WoW) + self.formatComboBox.setItemText(5, WizardStrings.CCLI) + self.formatComboBox.setItemText(6, WizardStrings.SoF) + self.formatComboBox.setItemText(7, WizardStrings.GDP) + self.formatComboBox.setItemText(8, WizardStrings.ES) + self.formatComboBox.setItemText(9, WizardStrings.EW) + self.formatComboBox.setItemText(10, WizardStrings.SB) +# self.formatComboBox.setItemText(11, WizardStrings.CSV) self.openLP2FilenameLabel.setText( translate('SongsPlugin.ImportWizardForm', 'Filename:')) self.openLP2BrowseButton.setText(UiStrings.Browse) @@ -316,89 +304,68 @@ class SongImportForm(OpenLPWizard): if source_format == SongFormat.OpenLP2: if self.openLP2FilenameEdit.text().isEmpty(): critical_error_message_box(UiStrings.NFSs, - translate('SongsPlugin.ImportWizardForm', - 'You need to select an OpenLP 2.0 song database ' - 'file to import from.')) + WizardStrings.YouSpecifyFile % UiStrings.OLPV2) self.openLP2BrowseButton.setFocus() return False elif source_format == SongFormat.OpenLP1: if self.openLP1FilenameEdit.text().isEmpty(): critical_error_message_box(UiStrings.NFSs, - translate('SongsPlugin.ImportWizardForm', - 'You need to select an openlp.org 1.x song ' - 'database file to import from.')) + WizardStrings.YouSpecifyFile % UiStrings.OLPV1) self.openLP1BrowseButton.setFocus() return False elif source_format == SongFormat.OpenLyrics: if self.openLyricsFileListWidget.count() == 0: critical_error_message_box(UiStrings.NFSp, - translate('SongsPlugin.ImportWizardForm', - 'You need to add at least one OpenLyrics ' - 'song file to import from.')) + WizardStrings.YouSpecifyFile % WizardStrings.OL) self.openLyricsAddButton.setFocus() return False elif source_format == SongFormat.OpenSong: if self.openSongFileListWidget.count() == 0: critical_error_message_box(UiStrings.NFSp, - translate('SongsPlugin.ImportWizardForm', - 'You need to add at least one OpenSong ' - 'song file to import from.')) + WizardStrings.YouSpecifyFile % WizardStrings.OS) self.openSongAddButton.setFocus() return False elif source_format == SongFormat.WordsOfWorship: if self.wordsOfWorshipFileListWidget.count() == 0: critical_error_message_box(UiStrings.NFSp, - translate('SongsPlugin.ImportWizardForm', - 'You need to add at least one Words of Worship ' - 'file to import from.')) + WizardStrings.YouSpecifyFile % WizardStrings.WoW) self.wordsOfWorshipAddButton.setFocus() return False elif source_format == SongFormat.CCLI: if self.ccliFileListWidget.count() == 0: critical_error_message_box(UiStrings.NFSp, - translate('SongsPlugin.ImportWizardForm', - 'You need to add at least one CCLI file ' - 'to import from.')) + WizardStrings.YouSpecifyFile % WizardStrings.CCLI) self.ccliAddButton.setFocus() return False elif source_format == SongFormat.SongsOfFellowship: if self.songsOfFellowshipFileListWidget.count() == 0: critical_error_message_box(UiStrings.NFSp, - translate('SongsPlugin.ImportWizardForm', - 'You need to add at least one Songs of Fellowship ' - 'file to import from.')) + WizardStrings.YouSpecifyFile % WizardStrings.SoF) self.songsOfFellowshipAddButton.setFocus() return False elif source_format == SongFormat.Generic: if self.genericFileListWidget.count() == 0: critical_error_message_box(UiStrings.NFSp, - translate('SongsPlugin.ImportWizardForm', - 'You need to add at least one document or ' - 'presentation file to import from.')) + WizardStrings.YouSpecifyFile % + WizardStrings.GDP.toLower()) self.genericAddButton.setFocus() return False elif source_format == SongFormat.EasiSlides: if self.easiSlidesFilenameEdit.text().isEmpty(): critical_error_message_box(UiStrings.NFSp, - translate('SongsPlugin.ImportWizardForm', - 'You need to select an xml song file exported from ' - 'EasiSlides, to import from.')) + WizardStrings.YouSpecifyFile % WizardStrings.ES) self.easiSlidesBrowseButton.setFocus() return False elif source_format == SongFormat.EasyWorship: if self.ewFilenameEdit.text().isEmpty(): critical_error_message_box(UiStrings.NFSs, - translate('SongsPlugin.ImportWizardForm', - 'You need to select an EasyWorship song database ' - 'file to import from.')) + WizardStrings.YouSpecifyFile % WizardStrings.EW) self.ewBrowseButton.setFocus() return False elif source_format == SongFormat.SongBeamer: if self.songBeamerFileListWidget.count() == 0: critical_error_message_box(UiStrings.NFSp, - translate('SongsPlugin.ImportWizardForm', - 'You need to add at least one SongBeamer ' - 'file to import from.')) + WizardStrings.YouSpecifyFile % WizardStrings.SB) self.songBeamerAddButton.setFocus() return False return True @@ -454,9 +421,7 @@ class SongImportForm(OpenLPWizard): """ Get OpenLP v2 song database file """ - self.getFileName( - translate('SongsPlugin.ImportWizardForm', - 'Select OpenLP 2.0 Database File'), + self.getFileName(WizardStrings.OpenTypeFile % UiStrings.OLPV2, self.openLP2FilenameEdit, u'%s (*.sqlite)' % (translate('SongsPlugin.ImportWizardForm', 'OpenLP 2.0 Databases')) @@ -466,9 +431,7 @@ class SongImportForm(OpenLPWizard): """ Get OpenLP v1 song database file """ - self.getFileName( - translate('SongsPlugin.ImportWizardForm', - 'Select openlp.org 1.x Database File'), + self.getFileName(WizardStrings.OpenTypeFile % UiStrings.OLPV1, self.openLP1FilenameEdit, u'%s (*.olp)' % translate('SongsPlugin.ImportWizardForm', 'openlp.org v1.x Databases') @@ -478,11 +441,8 @@ class SongImportForm(OpenLPWizard): """ Get OpenLyrics song database files """ - self.getFiles( - translate('SongsPlugin.ImportWizardForm', - 'Select OpenLyrics Files'), - self.openLyricsFileListWidget - ) + self.getFileName(WizardStrings.OpenTypeFile % WizardStrings.OL, + self.openLyricsFileListWidget) def onOpenLyricsRemoveButtonClicked(self): """ @@ -494,10 +454,8 @@ class SongImportForm(OpenLPWizard): """ Get OpenSong song database files """ - self.getFiles( - translate('SongsPlugin.ImportWizardForm', 'Select Open Song Files'), - self.openSongFileListWidget - ) + self.getFileName(WizardStrings.OpenTypeFile % WizardStrings.OS, + self.openSongFileListWidget) def onOpenSongRemoveButtonClicked(self): """ @@ -509,9 +467,7 @@ class SongImportForm(OpenLPWizard): """ Get Words of Worship song database files """ - self.getFiles( - translate('SongsPlugin.ImportWizardForm', - 'Select Words of Worship Files'), + self.getFileName(WizardStrings.OpenTypeFile % WizardStrings.WoW, self.wordsOfWorshipFileListWidget, u'%s (*.wsg *.wow-song)' % translate('SongsPlugin.ImportWizardForm', 'Words Of Worship Song Files') @@ -527,11 +483,8 @@ class SongImportForm(OpenLPWizard): """ Get CCLI song database files """ - self.getFiles( - translate('SongsPlugin.ImportWizardForm', - 'Select CCLI Files'), - self.ccliFileListWidget - ) + self.getFileName(WizardStrings.OpenTypeFile % WizardStrings.CCLI, + self.ccliFileListWidget) def onCCLIRemoveButtonClicked(self): """ @@ -543,9 +496,7 @@ class SongImportForm(OpenLPWizard): """ Get Songs of Fellowship song database files """ - self.getFiles( - translate('SongsPlugin.ImportWizardForm', - 'Select Songs of Fellowship Files'), + self.getFileName(WizardStrings.OpenTypeFile % WizardStrings.SoF, self.songsOfFellowshipFileListWidget, u'%s (*.rtf)' % translate('SongsPlugin.ImportWizardForm', 'Songs Of Fellowship Song Files') @@ -561,11 +512,8 @@ class SongImportForm(OpenLPWizard): """ Get song database files """ - self.getFiles( - translate('SongsPlugin.ImportWizardForm', - 'Select Document/Presentation Files'), - self.genericFileListWidget - ) + self.getFileName(WizardStrings.OpenTypeFile % WizardStrings.GDP, + self.genericFileListWidget) def onGenericRemoveButtonClicked(self): """ @@ -574,29 +522,21 @@ class SongImportForm(OpenLPWizard): self.removeSelectedItems(self.genericFileListWidget) def onEasiSlidesBrowseButtonClicked(self): - self.getFileName( - translate('SongsPlugin.ImportWizardForm', - 'Select EasiSlides songfile'), - self.easiSlidesFilenameEdit - ) + self.getFileName(WizardStrings.OpenTypeFile % WizardStrings.ES, + self.easiSlidesFilenameEdit) def onEWBrowseButtonClicked(self): """ Get EasyWorship song database files """ - self.getFileName( - translate('SongsPlugin.ImportWizardForm', - 'Select EasyWorship Database File'), - self.ewFilenameEdit - ) + self.getFileName(WizardStrings.OpenTypeFile % WizardStrings.EW, + self.ewFilenameEdit) def onSongBeamerAddButtonClicked(self): """ Get SongBeamer song database files """ - self.getFiles( - translate('SongsPlugin.ImportWizardForm', - 'Select SongBeamer Files'), + self.getFileName(WizardStrings.OpenTypeFile % WizardStrings.SB, self.songBeamerFileListWidget, u'%s (*.sng)' % translate('SongsPlugin.ImportWizardForm', 'SongBeamer files') ) From ad03f8588e2c9ee8265f379b9f371a47e298d61c Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Sat, 12 Feb 2011 22:01:18 +0000 Subject: [PATCH 013/123] Magic number -> SongSearch --- openlp/plugins/songs/lib/mediaitem.py | 33 ++++++++++++++++++--------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/openlp/plugins/songs/lib/mediaitem.py b/openlp/plugins/songs/lib/mediaitem.py index b95a28c74..bbd1aad9c 100644 --- a/openlp/plugins/songs/lib/mediaitem.py +++ b/openlp/plugins/songs/lib/mediaitem.py @@ -33,16 +33,26 @@ from sqlalchemy.sql import or_ from openlp.core.lib import MediaManagerItem, Receiver, ItemCapabilities, \ translate, check_item_selected, PluginStatus, StringContent +from openlp.core.lib.searchedit import SearchEdit from openlp.core.lib.ui import UiStrings from openlp.plugins.songs.forms import EditSongForm, SongMaintenanceForm, \ SongImportForm, SongExportForm from openlp.plugins.songs.lib import OpenLyrics, SongXML from openlp.plugins.songs.lib.db import Author, Song from openlp.plugins.songs.lib.ui import SongStrings -from openlp.core.lib.searchedit import SearchEdit log = logging.getLogger(__name__) +class SongSearch(object): + """ + An enumeration for song search methods. + """ + Entire = 1 + Titles = 2 + Lyrics = 3 + Authors = 4 + Themes = 5 + class SongMediaItem(MediaManagerItem): """ This is the custom media manager item for Songs. @@ -134,14 +144,15 @@ class SongMediaItem(MediaManagerItem): def initialise(self): self.searchTextEdit.setSearchTypes([ - (1, u':/songs/song_search_all.png', + (SongSearch.Entire, u':/songs/song_search_all.png', translate('SongsPlugin.MediaItem', 'Entire Song')), - (2, u':/songs/song_search_title.png', + (SongSearch.Titles, u':/songs/song_search_title.png', translate('SongsPlugin.MediaItem', 'Titles')), - (3, u':/songs/song_search_lyrics.png', + (SongSearch.Lyrics, u':/songs/song_search_lyrics.png', translate('SongsPlugin.MediaItem', 'Lyrics')), - (4, u':/songs/song_search_author.png', SongStrings.Authors), - (5, u':/slides/slide_theme.png', UiStrings.Themes) + (SongSearch.Authors, u':/songs/song_search_author.png', + SongStrings.Authors), + (SongSearch.Themes, u':/slides/slide_theme.png', UiStrings.Themes) ]) self.configUpdated() @@ -150,7 +161,7 @@ class SongMediaItem(MediaManagerItem): search_results = [] # search_type = self.searchTypeComboBox.currentIndex() search_type = self.searchTextEdit.currentSearchType() - if search_type == 1: + if search_type == SongSearch.Entire: log.debug(u'Entire Song Search') search_results = self.parent.manager.get_all_objects(Song, or_(Song.search_title.like(u'%' + self.whitespace.sub(u' ', @@ -158,25 +169,25 @@ class SongMediaItem(MediaManagerItem): Song.search_lyrics.like(u'%' + search_keywords.lower() + \ u'%')), Song.search_title.asc()) self.displayResultsSong(search_results) - if search_type == 2: + elif search_type == SongSearch.Titles: log.debug(u'Titles Search') search_results = self.parent.manager.get_all_objects(Song, Song.search_title.like(u'%' + self.whitespace.sub(u' ', search_keywords.lower()) + u'%'), Song.search_title.asc()) self.displayResultsSong(search_results) - elif search_type == 3: + elif search_type == SongSearch.Lyrics: log.debug(u'Lyrics Search') search_results = self.parent.manager.get_all_objects(Song, Song.search_lyrics.like(u'%' + search_keywords.lower() + u'%'), Song.search_lyrics.asc()) self.displayResultsSong(search_results) - elif search_type == 4: + elif search_type == SongSearch.Authors: log.debug(u'Authors Search') search_results = self.parent.manager.get_all_objects(Author, Author.display_name.like(u'%' + search_keywords + u'%'), Author.display_name.asc()) self.displayResultsAuthor(search_results) - elif search_type == 5: + elif search_type == SongSearch.Themes: log.debug(u'Theme Search') search_results = self.parent.manager.get_all_objects(Song, Song.theme_name == search_keywords, Song.search_lyrics.asc()) From 323ab52848eb387f4e5a5c1daebb23b944763a99 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Sun, 13 Feb 2011 01:09:04 +0000 Subject: [PATCH 014/123] Strings and magic numbers --- openlp/core/lib/mediamanageritem.py | 6 +-- openlp/core/lib/ui.py | 1 + openlp/core/ui/displaytagtab.py | 2 +- openlp/core/ui/themeform.py | 2 +- openlp/core/ui/wizard.py | 7 ++++ openlp/plugins/alerts/forms/alertform.py | 7 ++-- .../plugins/bibles/forms/bibleimportform.py | 25 ++++------- openlp/plugins/bibles/lib/openlp1.py | 4 +- openlp/plugins/media/lib/mediaitem.py | 4 +- openlp/plugins/presentations/lib/mediaitem.py | 7 ++-- openlp/plugins/songs/forms/songexportform.py | 3 +- openlp/plugins/songs/forms/songimportform.py | 42 +++++++++---------- openlp/plugins/songs/lib/importer.py | 2 +- openlp/plugins/songs/lib/mediaitem.py | 4 +- openlp/plugins/songs/lib/openlyricsimport.py | 6 +-- openlp/plugins/songs/lib/songbeamerimport.py | 6 +-- 16 files changed, 62 insertions(+), 66 deletions(-) diff --git a/openlp/core/lib/mediamanageritem.py b/openlp/core/lib/mediamanageritem.py index 74dbf7fe1..0bb765c6e 100644 --- a/openlp/core/lib/mediamanageritem.py +++ b/openlp/core/lib/mediamanageritem.py @@ -417,8 +417,7 @@ class MediaManagerItem(QtGui.QWidget): item to the preview slide controller. """ if not self.listView.selectedIndexes() and not self.remoteTriggered: - QtGui.QMessageBox.information(self, - translate('OpenLP.MediaManagerItem', 'No Items Selected'), + QtGui.QMessageBox.information(self, UiStrings.NISp, translate('OpenLP.MediaManagerItem', 'You must select one or more items to preview.')) else: @@ -434,8 +433,7 @@ class MediaManagerItem(QtGui.QWidget): item to the live slide controller. """ if not self.listView.selectedIndexes(): - QtGui.QMessageBox.information(self, - translate('OpenLP.MediaManagerItem', 'No Items Selected'), + QtGui.QMessageBox.information(self, UiStrings.NISp, translate('OpenLP.MediaManagerItem', 'You must select one or more items to send live.')) else: diff --git a/openlp/core/lib/ui.py b/openlp/core/lib/ui.py index 737bb75d2..c8ffb8262 100644 --- a/openlp/core/lib/ui.py +++ b/openlp/core/lib/ui.py @@ -86,6 +86,7 @@ class UiStrings(object): ResetLiveBG = translate('OpenLP.Ui', 'Reset Live Background') SaveType = unicode(translate('OpenLP.Ui', 'Save %s')) Search = translate('OpenLP.Ui', 'Search') + SelectDelete = translate('OpenLP.Ui', 'You must select an item to delete.') SendSelectLive = unicode(translate('OpenLP.Ui', 'Send the selected %s live.')) Service = translate('OpenLP.Ui', 'Service') diff --git a/openlp/core/ui/displaytagtab.py b/openlp/core/ui/displaytagtab.py index abf0ca44f..30c593d36 100644 --- a/openlp/core/ui/displaytagtab.py +++ b/openlp/core/ui/displaytagtab.py @@ -167,7 +167,7 @@ class DisplayTagTab(SettingsTab): self.deletePushButton.setText(UiStrings.Delete) self.defaultPushButton.setText( translate('OpenLP.DisplayTagTab', 'Default')) - self.newPushButton.setText(translate('OpenLP.DisplayTagTab', 'New')) + self.newPushButton.setText(UiStrings.New) self.tagTableWidget.horizontalHeaderItem(0)\ .setText(translate('OpenLP.DisplayTagTab', 'Description')) self.tagTableWidget.horizontalHeaderItem(1)\ diff --git a/openlp/core/ui/themeform.py b/openlp/core/ui/themeform.py index f86fa0143..8e5bddc79 100644 --- a/openlp/core/ui/themeform.py +++ b/openlp/core/ui/themeform.py @@ -301,7 +301,7 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard): 'Edit Theme - %s')) % self.theme.theme_name) self.next() else: - self.setWindowTitle(translate('OpenLP.ThemeWizard', 'New Theme')) + self.setWindowTitle(UiStrings.NewType % UiStrings.Theme) return QtGui.QWizard.exec_(self) def initializePage(self, id): diff --git a/openlp/core/ui/wizard.py b/openlp/core/ui/wizard.py index 14511f21f..0a3a1cab7 100644 --- a/openlp/core/ui/wizard.py +++ b/openlp/core/ui/wizard.py @@ -63,10 +63,17 @@ class WizardStrings(object): FinishedType = unicode(translate('OpenLP.Ui', 'Finished %s.')) FormatLabel = translate('OpenLP.Ui', 'Format:') Importing = translate('OpenLP.Ui', 'Importing') + ImportingType = unicode(translate('OpenLP.Ui', 'Importing %s...')) ImportSelect = translate('OpenLP.Ui', 'Select Import Source') ImportSelectLong = unicode(translate('OpenLP.Ui', 'Select the import format and the location to import from.')) + NoSqlite = translate('OpenLP.Ui', 'The openlp.org 1.x importer has been ' + 'disabled due to a missing Python module. If you want to use this ' + 'importer, you will need to install the "python-sqlite" ' + 'module.') OpenTypeFile = unicode(translate('OpenLP.Ui', 'Open %s File')) + Ready = translate('OpenLP.Ui', 'Ready.') + StartingImport = translate('OpenLP.Ui', 'Starting import...') Welcome = u'%s' % \ translate('OpenLP.Ui', 'Welcome to the %s %s Wizard', 'Variable 1 is the type e.g. Bible and variable 2 is import/export') diff --git a/openlp/plugins/alerts/forms/alertform.py b/openlp/plugins/alerts/forms/alertform.py index 0639f2bb1..93d64a401 100644 --- a/openlp/plugins/alerts/forms/alertform.py +++ b/openlp/plugins/alerts/forms/alertform.py @@ -26,7 +26,8 @@ from PyQt4 import QtGui, QtCore -from openlp.core.lib import translate +from openlp.core.lib import translate, StringContent +from openlp.core.lib.ui import UiStrings from openlp.plugins.alerts.lib.db import AlertItem from alertdialog import Ui_AlertDialog @@ -95,8 +96,8 @@ class AlertForm(QtGui.QDialog, Ui_AlertDialog): def onNewClick(self): if len(self.alertTextEdit.text()) == 0: - QtGui.QMessageBox.information(self, - translate('AlertsPlugin.AlertForm', 'New Alert'), + QtGui.QMessageBox.information(self, UiStrings.NewType % + self.plugin.getString(StringContent.Name)[u'singular'] translate('AlertsPlugin.AlertForm', 'You haven\'t specified ' 'any text for your alert. Please type in some text before ' 'clicking New.')) diff --git a/openlp/plugins/bibles/forms/bibleimportform.py b/openlp/plugins/bibles/forms/bibleimportform.py index 80f44e481..81ae6607a 100644 --- a/openlp/plugins/bibles/forms/bibleimportform.py +++ b/openlp/plugins/bibles/forms/bibleimportform.py @@ -370,13 +370,12 @@ class BibleImportForm(OpenLPWizard): self.selectPage.setTitle(WizardStrings.ImportSelect) self.selectPage.setSubTitle(WizardStrings.ImportSelectLong) self.formatLabel.setText(WizardStrings.FormatLabel) - self.formatComboBox.setItemText(0, WizardStrings.OSIS) - self.formatComboBox.setItemText(1, WizardStrings.CSV) - self.formatComboBox.setItemText(2, WizardStrings.OS) - self.formatComboBox.setItemText(3, + self.formatComboBox.setItemText(BibleFormat.OSIS, WizardStrings.OSIS) + self.formatComboBox.setItemText(BibleFormat.CSV, WizardStrings.CSV) + self.formatComboBox.setItemText(BibleFormat.OpenSong, WizardStrings.OS) + self.formatComboBox.setItemText(BibleFormat.WebDownload, translate('BiblesPlugin.ImportWizardForm', 'Web Download')) - self.formatComboBox.setItemText(4, - translate('BiblesPlugin.ImportWizardForm', 'openlp.org 1.x')) + self.formatComboBox.setItemText(BibleFormat.OpenLP1, UiStrings.OLPV1) self.openlp1FileLabel.setText( translate('BiblesPlugin.ImportWizardForm', 'Bible file:')) self.osisFileLabel.setText( @@ -427,14 +426,9 @@ class BibleImportForm(OpenLPWizard): self.progressPage.setSubTitle( translate('BiblesPlugin.ImportWizardForm', 'Please wait while your Bible is imported.')) - self.progressLabel.setText( - translate('BiblesPlugin.ImportWizardForm', 'Ready.')) + self.progressLabel.setText(WizardStrings.Ready) self.progressBar.setFormat(u'%p%') - self.openlp1DisabledLabel.setText( - translate('BiblesPlugin.ImportWizardForm', 'The openlp.org 1.x ' - 'importer has been disabled due to a missing Python module. If ' - 'you want to use this importer, you will need to install the ' - '"python-sqlite" module.')) + self.openlp1DisabledLabel.setText(WizardStrings.NoSqlite) # Align all QFormLayouts towards each other. labelWidth = max(self.formatLabel.minimumSizeHint().width(), self.osisFileLabel.minimumSizeHint().width(), @@ -580,7 +574,7 @@ class BibleImportForm(OpenLPWizard): """ Show the file open dialog for the openlp.org 1.x file. """ - self.getFileName(WizardStrings.OpenTypeFile % WizardStrings.OLPV1, + self.getFileName(WizardStrings.OpenTypeFile % UiStrings.OLPV1, self.openlp1FileEdit, u'%s (*.bible)' % translate('BiblesPlugin.ImportWizardForm', 'openlp.org 1.x bible')) @@ -699,8 +693,7 @@ class BibleImportForm(OpenLPWizard): 'BiblesPlugin.ImportWizardForm', 'Starting Registering bible...')) else: - self.progressLabel.setText(translate( - 'BiblesPlugin.ImportWizardForm', 'Starting import...')) + self.progressLabel.setText(translate(WizardStrings.StartingImport) Receiver.send_message(u'openlp_process_events') def performWizard(self): diff --git a/openlp/plugins/bibles/lib/openlp1.py b/openlp/plugins/bibles/lib/openlp1.py index 2df6b1677..27731d7ea 100644 --- a/openlp/plugins/bibles/lib/openlp1.py +++ b/openlp/plugins/bibles/lib/openlp1.py @@ -30,6 +30,7 @@ import sqlite from PyQt4 import QtCore from openlp.core.lib import Receiver, translate +from openlp.core.ui.wizard import WizardStrings from openlp.plugins.bibles.lib.db import BibleDB log = logging.getLogger(__name__) @@ -73,8 +74,7 @@ class OpenLP1Bible(BibleDB): abbreviation = unicode(book[3], u'cp1252') self.create_book(name, abbreviation, testament_id) # Update the progess bar. - self.wizard.incrementProgressBar(unicode(translate( - 'BiblesPlugin.OpenLP1Import', 'Importing %s...')) % name) + self.wizard.incrementProgressBar(WizardStrings.ImportingType % name) # Import the verses for this book. cursor.execute(u'SELECT chapter, verse, text || \'\' AS text FROM ' 'verse WHERE book_id=%s' % book_id) diff --git a/openlp/plugins/media/lib/mediaitem.py b/openlp/plugins/media/lib/mediaitem.py index 7fb0ed0c1..758bd2e64 100644 --- a/openlp/plugins/media/lib/mediaitem.py +++ b/openlp/plugins/media/lib/mediaitem.py @@ -30,7 +30,7 @@ import os from PyQt4 import QtCore, QtGui from openlp.core.lib import MediaManagerItem, build_icon, ItemCapabilities, \ - SettingsManager, translate, check_item_selected, Receiver + SettingsManager, translate, check_item_selected, Receiver, StringContent from openlp.core.lib.ui import UiStrings, critical_error_message_box log = logging.getLogger(__name__) @@ -121,7 +121,7 @@ class MediaMediaItem(MediaManagerItem): filename = unicode(item.data(QtCore.Qt.UserRole).toString()) if os.path.exists(filename): service_item.title = unicode( - translate('MediaPlugin.MediaItem', 'Media')) + self.plugin.getString(StringContent.Name)[u'singular']) service_item.add_capability(ItemCapabilities.RequiresMedia) # force a nonexistent theme service_item.theme = -1 diff --git a/openlp/plugins/presentations/lib/mediaitem.py b/openlp/plugins/presentations/lib/mediaitem.py index 0b6ab39cd..64c1f7ece 100644 --- a/openlp/plugins/presentations/lib/mediaitem.py +++ b/openlp/plugins/presentations/lib/mediaitem.py @@ -31,7 +31,8 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import MediaManagerItem, build_icon, SettingsManager, \ translate, check_item_selected, Receiver, ItemCapabilities -from openlp.core.lib.ui import critical_error_message_box, media_item_combo_box +from openlp.core.lib.ui import UiStrings, critical_error_message_box, \ + media_item_combo_box from openlp.plugins.presentations.lib import MessageListener log = logging.getLogger(__name__) @@ -202,9 +203,7 @@ class PresentationMediaItem(MediaManagerItem): """ Remove a presentation item from the list """ - if check_item_selected(self.listView, - translate('PresentationPlugin.MediaItem', - 'You must select an item to delete.')): + if check_item_selected(self.listView, UiStrings.SelectDelete): items = self.listView.selectedIndexes() row_list = [item.row() for item in items] row_list.sort(reverse=True) diff --git a/openlp/plugins/songs/forms/songexportform.py b/openlp/plugins/songs/forms/songexportform.py index 86b4e448c..66003532b 100644 --- a/openlp/plugins/songs/forms/songexportform.py +++ b/openlp/plugins/songs/forms/songexportform.py @@ -191,8 +191,7 @@ class SongExportForm(OpenLPWizard): self.progressPage.setSubTitle( translate('SongsPlugin.ExportWizardForm', 'Please wait while your songs are exported.')) - self.progressLabel.setText( - translate('SongsPlugin.ExportWizardForm', 'Ready.')) + self.progressLabel.setText(WizardStrings.Ready) self.progressBar.setFormat( translate('SongsPlugin.ExportWizardForm', '%p%')) diff --git a/openlp/plugins/songs/forms/songimportform.py b/openlp/plugins/songs/forms/songimportform.py index 6c851b04b..1ebbafb45 100644 --- a/openlp/plugins/songs/forms/songimportform.py +++ b/openlp/plugins/songs/forms/songimportform.py @@ -206,29 +206,31 @@ class SongImportForm(OpenLPWizard): self.sourcePage.setTitle(WizardStrings.ImportSelect) self.sourcePage.setSubTitle(WizardStrings.ImportSelectLong) self.formatLabel.setText(WizardStrings.FormatLabel) - self.formatComboBox.setItemText(0, UiStrings.OLPV2) - self.formatComboBox.setItemText(1, UiStrings.OLPV1) - self.formatComboBox.setItemText(2, WizardStrings.OL) - self.formatComboBox.setItemText(3, WizardStrings.OS) - self.formatComboBox.setItemText(4, WizardStrings.WoW) - self.formatComboBox.setItemText(5, WizardStrings.CCLI) - self.formatComboBox.setItemText(6, WizardStrings.SoF) - self.formatComboBox.setItemText(7, WizardStrings.GDP) - self.formatComboBox.setItemText(8, WizardStrings.ES) - self.formatComboBox.setItemText(9, WizardStrings.EW) - self.formatComboBox.setItemText(10, WizardStrings.SB) -# self.formatComboBox.setItemText(11, WizardStrings.CSV) + self.formatComboBox.setItemText(SongFormat.OpenLP2, UiStrings.OLPV2) + self.formatComboBox.setItemText(SongFormat.OpenLP1, UiStrings.OLPV1) + self.formatComboBox.setItemText( + SongFormat.OpenLyrics, WizardStrings.OL) + self.formatComboBox.setItemText(SongFormat.OpenSong, WizardStrings.OS) + self.formatComboBox.setItemText( + SongFormat.WordsOfWorship, WizardStrings.WoW) + self.formatComboBox.setItemText(SongFormat.CCLI, WizardStrings.CCLI) + self.formatComboBox.setItemText( + SongFormat.SongsOfFellowship, WizardStrings.SoF) + self.formatComboBox.setItemText(SongFormat.Generic, WizardStrings.GDP) + self.formatComboBox.setItemText( + SongFormat.EasiSlides, WizardStrings.ES) + self.formatComboBox.setItemText( + SongFormat.EasyWorship, WizardStrings.EW) + self.formatComboBox.setItemText( + SongFormat.SongBeamer, WizardStrings.SB) +# self.formatComboBox.setItemText(SongFormat.CSV, WizardStrings.CSV) self.openLP2FilenameLabel.setText( translate('SongsPlugin.ImportWizardForm', 'Filename:')) self.openLP2BrowseButton.setText(UiStrings.Browse) self.openLP1FilenameLabel.setText( translate('SongsPlugin.ImportWizardForm', 'Filename:')) self.openLP1BrowseButton.setText(UiStrings.Browse) - self.openLP1DisabledLabel.setText( - translate('SongsPlugin.ImportWizardForm', 'The openlp.org 1.x ' - 'importer has been disabled due to a missing Python module. If ' - 'you want to use this importer, you will need to install the ' - '"python-sqlite" module.')) + self.openLP1DisabledLabel.setText(WizardStrings.NoSqlite) self.openLyricsAddButton.setText( translate('SongsPlugin.ImportWizardForm', 'Add Files...')) self.openLyricsRemoveButton.setText( @@ -283,8 +285,7 @@ class SongImportForm(OpenLPWizard): self.progressPage.setSubTitle( translate('SongsPlugin.ImportWizardForm', 'Please wait while your songs are imported.')) - self.progressLabel.setText( - translate('SongsPlugin.ImportWizardForm', 'Ready.')) + self.progressLabel.setText(WizardStrings.Ready) self.progressBar.setFormat( translate('SongsPlugin.ImportWizardForm', '%p%')) # Align all QFormLayouts towards each other. @@ -573,8 +574,7 @@ class SongImportForm(OpenLPWizard): Perform pre import tasks """ OpenLPWizard.preWizard(self) - self.progressLabel.setText( - translate('SongsPlugin.ImportWizardForm', 'Starting import...')) + self.progressLabel.setText(WizardStrings.StartingImport) Receiver.send_message(u'openlp_process_events') def performWizard(self): diff --git a/openlp/plugins/songs/lib/importer.py b/openlp/plugins/songs/lib/importer.py index 6f566ff4f..c38392df8 100644 --- a/openlp/plugins/songs/lib/importer.py +++ b/openlp/plugins/songs/lib/importer.py @@ -67,10 +67,10 @@ class SongFormat(object): CCLI = 5 SongsOfFellowship = 6 Generic = 7 - #CSV = 8 EasiSlides = 8 EasyWorship = 9 SongBeamer = 10 + #CSV = 11 @staticmethod def get_class(format): diff --git a/openlp/plugins/songs/lib/mediaitem.py b/openlp/plugins/songs/lib/mediaitem.py index bbd1aad9c..50203902d 100644 --- a/openlp/plugins/songs/lib/mediaitem.py +++ b/openlp/plugins/songs/lib/mediaitem.py @@ -318,9 +318,7 @@ class SongMediaItem(MediaManagerItem): """ Remove a song from the list and database """ - if check_item_selected(self.listView, - translate('SongsPlugin.MediaItem', - 'You must select an item to delete.')): + if check_item_selected(self.listView, UiStrings.SelectDelete): items = self.listView.selectedIndexes() if QtGui.QMessageBox.question(self, translate('SongsPlugin.MediaItem', 'Delete Song(s)?'), diff --git a/openlp/plugins/songs/lib/openlyricsimport.py b/openlp/plugins/songs/lib/openlyricsimport.py index 37407c75c..20d780992 100644 --- a/openlp/plugins/songs/lib/openlyricsimport.py +++ b/openlp/plugins/songs/lib/openlyricsimport.py @@ -34,6 +34,7 @@ import os from lxml import etree from openlp.core.lib import translate +from openlp.core.ui.wizard import WizardStrings from openlp.plugins.songs.lib.songimport import SongImport from openlp.plugins.songs.lib import OpenLyrics @@ -65,9 +66,8 @@ class OpenLyricsImport(SongImport): for file_path in self.import_source: if self.stop_import_flag: return False - self.import_wizard.incrementProgressBar(unicode(translate( - 'SongsPlugin.OpenLyricsImport', 'Importing %s...')) % - os.path.basename(file_path)) + self.import_wizard.incrementProgressBar( + WizardStrings.ImportingType % os.path.basename(file_path)) try: parsed_file = etree.parse(file_path, parser) xml = unicode(etree.tostring(parsed_file)) diff --git a/openlp/plugins/songs/lib/songbeamerimport.py b/openlp/plugins/songs/lib/songbeamerimport.py index 47290bfbd..ddbe0525b 100644 --- a/openlp/plugins/songs/lib/songbeamerimport.py +++ b/openlp/plugins/songs/lib/songbeamerimport.py @@ -34,6 +34,7 @@ import os import re from openlp.core.lib import translate +from openlp.core.ui.wizard import WizardStrings from openlp.plugins.songs.lib.songimport import SongImport log = logging.getLogger(__name__) @@ -134,9 +135,8 @@ class SongBeamerImport(SongImport): self.add_verse(self.current_verse, self.current_verse_type) if self.check_complete(): self.finish() - self.import_wizard.incrementProgressBar(unicode(translate( - 'SongsPlugin.SongBeamerImport', 'Importing %s...')) % - file_name) + self.import_wizard.incrementProgressBar( + WizardStrings.ImportingType % file_name) return True def replace_html_tags(self): From 321269b11bc88ca080a7cd28dccaecaeb072d044 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Sun, 13 Feb 2011 01:24:47 +0000 Subject: [PATCH 015/123] Fixes and cleanups --- openlp/plugins/alerts/forms/alertform.py | 2 +- openlp/plugins/bibles/forms/bibleimportform.py | 2 +- openlp/plugins/bibles/lib/openlp1.py | 2 +- openlp/plugins/songs/lib/openlyricsimport.py | 1 - openlp/plugins/songs/lib/songbeamerimport.py | 1 - 5 files changed, 3 insertions(+), 5 deletions(-) diff --git a/openlp/plugins/alerts/forms/alertform.py b/openlp/plugins/alerts/forms/alertform.py index 93d64a401..bd4c8e735 100644 --- a/openlp/plugins/alerts/forms/alertform.py +++ b/openlp/plugins/alerts/forms/alertform.py @@ -97,7 +97,7 @@ class AlertForm(QtGui.QDialog, Ui_AlertDialog): def onNewClick(self): if len(self.alertTextEdit.text()) == 0: QtGui.QMessageBox.information(self, UiStrings.NewType % - self.plugin.getString(StringContent.Name)[u'singular'] + self.plugin.getString(StringContent.Name)[u'singular'], translate('AlertsPlugin.AlertForm', 'You haven\'t specified ' 'any text for your alert. Please type in some text before ' 'clicking New.')) diff --git a/openlp/plugins/bibles/forms/bibleimportform.py b/openlp/plugins/bibles/forms/bibleimportform.py index 81ae6607a..7854a7096 100644 --- a/openlp/plugins/bibles/forms/bibleimportform.py +++ b/openlp/plugins/bibles/forms/bibleimportform.py @@ -693,7 +693,7 @@ class BibleImportForm(OpenLPWizard): 'BiblesPlugin.ImportWizardForm', 'Starting Registering bible...')) else: - self.progressLabel.setText(translate(WizardStrings.StartingImport) + self.progressLabel.setText(WizardStrings.StartingImport) Receiver.send_message(u'openlp_process_events') def performWizard(self): diff --git a/openlp/plugins/bibles/lib/openlp1.py b/openlp/plugins/bibles/lib/openlp1.py index 27731d7ea..73b7eb91a 100644 --- a/openlp/plugins/bibles/lib/openlp1.py +++ b/openlp/plugins/bibles/lib/openlp1.py @@ -29,7 +29,7 @@ import sqlite from PyQt4 import QtCore -from openlp.core.lib import Receiver, translate +from openlp.core.lib import Receiver from openlp.core.ui.wizard import WizardStrings from openlp.plugins.bibles.lib.db import BibleDB diff --git a/openlp/plugins/songs/lib/openlyricsimport.py b/openlp/plugins/songs/lib/openlyricsimport.py index 20d780992..f4506c2be 100644 --- a/openlp/plugins/songs/lib/openlyricsimport.py +++ b/openlp/plugins/songs/lib/openlyricsimport.py @@ -33,7 +33,6 @@ import os from lxml import etree -from openlp.core.lib import translate from openlp.core.ui.wizard import WizardStrings from openlp.plugins.songs.lib.songimport import SongImport from openlp.plugins.songs.lib import OpenLyrics diff --git a/openlp/plugins/songs/lib/songbeamerimport.py b/openlp/plugins/songs/lib/songbeamerimport.py index ddbe0525b..eeabc0e5d 100644 --- a/openlp/plugins/songs/lib/songbeamerimport.py +++ b/openlp/plugins/songs/lib/songbeamerimport.py @@ -33,7 +33,6 @@ import logging import os import re -from openlp.core.lib import translate from openlp.core.ui.wizard import WizardStrings from openlp.plugins.songs.lib.songimport import SongImport From 816b17c245795ebcca05d44e2324a3f0e079f8b0 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Sun, 13 Feb 2011 14:21:12 +0000 Subject: [PATCH 016/123] UiStrings --- openlp/core/lib/ui.py | 1 + openlp/plugins/custom/lib/mediaitem.py | 9 +++------ openlp/plugins/songs/lib/mediaitem.py | 4 +--- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/openlp/core/lib/ui.py b/openlp/core/lib/ui.py index c8ffb8262..4852bc3ca 100644 --- a/openlp/core/lib/ui.py +++ b/openlp/core/lib/ui.py @@ -87,6 +87,7 @@ class UiStrings(object): SaveType = unicode(translate('OpenLP.Ui', 'Save %s')) Search = translate('OpenLP.Ui', 'Search') SelectDelete = translate('OpenLP.Ui', 'You must select an item to delete.') + SelectEdit = translate('OpenLP.Ui', 'You must select an item to edit.') SendSelectLive = unicode(translate('OpenLP.Ui', 'Send the selected %s live.')) Service = translate('OpenLP.Ui', 'Service') diff --git a/openlp/plugins/custom/lib/mediaitem.py b/openlp/plugins/custom/lib/mediaitem.py index c1da5bdfa..522d36e5c 100644 --- a/openlp/plugins/custom/lib/mediaitem.py +++ b/openlp/plugins/custom/lib/mediaitem.py @@ -30,6 +30,7 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import MediaManagerItem, Receiver, ItemCapabilities, \ translate, check_item_selected +from openlp.core.lib.ui import UiStrings from openlp.plugins.custom.lib import CustomXMLParser from openlp.plugins.custom.lib.db import CustomSlide @@ -108,9 +109,7 @@ class CustomMediaItem(MediaManagerItem): """ Edit a custom item """ - if check_item_selected(self.listView, - translate('CustomPlugin.MediaItem', - 'You haven\'t selected an item to edit.')): + if check_item_selected(self.listView, UiStrings.SelectEdit): item = self.listView.currentItem() item_id = (item.data(QtCore.Qt.UserRole)).toInt()[0] self.parent.edit_custom_form.loadCustom(item_id, False) @@ -121,9 +120,7 @@ class CustomMediaItem(MediaManagerItem): """ Remove a custom item from the list and database """ - if check_item_selected(self.listView, - translate('CustomPlugin.MediaItem', - 'You haven\'t selected an item to delete.')): + if check_item_selected(self.listView, UiStrings.SelectDelete): row_list = [item.row() for item in self.listView.selectedIndexes()] row_list.sort(reverse=True) id_list = [(item.data(QtCore.Qt.UserRole)).toInt()[0] diff --git a/openlp/plugins/songs/lib/mediaitem.py b/openlp/plugins/songs/lib/mediaitem.py index 50203902d..ccfb8df90 100644 --- a/openlp/plugins/songs/lib/mediaitem.py +++ b/openlp/plugins/songs/lib/mediaitem.py @@ -306,9 +306,7 @@ class SongMediaItem(MediaManagerItem): Edit a song """ log.debug(u'onEditClick') - if check_item_selected(self.listView, - translate('SongsPlugin.MediaItem', - 'You must select an item to edit.')): + if check_item_selected(self.listView, UiStrings.SelectEdit): self.editItem = self.listView.currentItem() item_id = (self.editItem.data(QtCore.Qt.UserRole)).toInt()[0] self.edit_song_form.loadSong(item_id, False) From ffd4d4176091c712c095fbb929afd95ecfb4f47c Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Sun, 13 Feb 2011 15:11:06 +0000 Subject: [PATCH 017/123] Strings including Author Unknown --- openlp/core/lib/ui.py | 1 + openlp/core/ui/slidecontroller.py | 3 +-- openlp/core/ui/starttimedialog.py | 4 ++-- openlp/plugins/alerts/lib/alertstab.py | 3 +-- openlp/plugins/songs/lib/opensongimport.py | 4 ++-- openlp/plugins/songs/lib/songimport.py | 3 +-- openlp/plugins/songs/lib/ui.py | 1 + openlp/plugins/songs/lib/xml.py | 4 +--- 8 files changed, 10 insertions(+), 13 deletions(-) diff --git a/openlp/core/lib/ui.py b/openlp/core/lib/ui.py index f335c165f..f4aa8162e 100644 --- a/openlp/core/lib/ui.py +++ b/openlp/core/lib/ui.py @@ -85,6 +85,7 @@ class UiStrings(object): ReplaceLiveBG = translate('OpenLP.Ui', 'Replace Live Background') ResetBG = translate('OpenLP.Ui', 'Reset Background') ResetLiveBG = translate('OpenLP.Ui', 'Reset Live Background') + S = translate('OpenLP.Ui', 's', 'The abbreviated unit for seconds') SaveType = unicode(translate('OpenLP.Ui', 'Save %s')) Search = translate('OpenLP.Ui', 'Search') SelectDelete = translate('OpenLP.Ui', 'You must select an item to delete.') diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index 52626f24f..f3bf7ee52 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -191,8 +191,7 @@ class SlideController(QtGui.QWidget): self.delaySpinBox.setMinimum(1) self.delaySpinBox.setMaximum(180) self.toolbar.addToolbarWidget(u'Image SpinBox', self.delaySpinBox) - self.delaySpinBox.setSuffix(translate('OpenLP.SlideController', - 's')) + self.delaySpinBox.setSuffix(UiStrings.S) self.delaySpinBox.setToolTip(translate('OpenLP.SlideController', 'Delay between slides in seconds')) else: diff --git a/openlp/core/ui/starttimedialog.py b/openlp/core/ui/starttimedialog.py index 8dcc2c9ee..d87df71c4 100644 --- a/openlp/core/ui/starttimedialog.py +++ b/openlp/core/ui/starttimedialog.py @@ -27,7 +27,7 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import translate -from openlp.core.lib.ui import create_accept_reject_button_box +from openlp.core.lib.ui import UiStrings, create_accept_reject_button_box class Ui_StartTimeDialog(object): def setupUi(self, StartTimeDialog): @@ -65,6 +65,6 @@ class Ui_StartTimeDialog(object): self.hourLabel.setText(translate('OpenLP.StartTimeForm', 'Hours:')) self.hourSpinBox.setSuffix(translate('OpenLP.StartTimeForm', 'h')) self.minuteSpinBox.setSuffix(translate('OpenLP.StartTimeForm', 'm')) - self.secondSpinBox.setSuffix(translate('OpenLP.StartTimeForm', 's')) + self.secondSpinBox.setSuffix(UiStrings.S) self.minuteLabel.setText(translate('OpenLP.StartTimeForm', 'Minutes:')) self.secondLabel.setText(translate('OpenLP.StartTimeForm', 'Seconds:')) diff --git a/openlp/plugins/alerts/lib/alertstab.py b/openlp/plugins/alerts/lib/alertstab.py index 48a4527ed..8c1538e4d 100644 --- a/openlp/plugins/alerts/lib/alertstab.py +++ b/openlp/plugins/alerts/lib/alertstab.py @@ -113,8 +113,7 @@ class AlertsTab(SettingsTab): translate('AlertsPlugin.AlertsTab', 'pt')) self.TimeoutLabel.setText( translate('AlertsPlugin.AlertsTab', 'Alert timeout:')) - self.TimeoutSpinBox.setSuffix( - translate('AlertsPlugin.AlertsTab', 's')) + self.TimeoutSpinBox.setSuffix(UiStrings.S) self.PreviewGroupBox.setTitle(UiStrings.Preview) self.FontPreview.setText(UiStrings.OLPV2) diff --git a/openlp/plugins/songs/lib/opensongimport.py b/openlp/plugins/songs/lib/opensongimport.py index 8c6d283e3..24043d6f0 100644 --- a/openlp/plugins/songs/lib/opensongimport.py +++ b/openlp/plugins/songs/lib/opensongimport.py @@ -32,6 +32,7 @@ from lxml.etree import Error, LxmlError import re from openlp.core.lib import translate +from openlp.core.ui.wizard import WizardStrings from openlp.plugins.songs.lib.songimport import SongImport log = logging.getLogger(__name__) @@ -159,8 +160,7 @@ class OpenSongImport(SongImport): # not a zipfile log.info(u'Direct import %s', filename) self.import_wizard.incrementProgressBar( - unicode(translate('SongsPlugin.ImportWizardForm', - 'Importing %s...')) % os.path.split(filename)[-1]) + WizardStrings.ImportingType % os.path.split(filename)[-1]) file = open(filename) self.do_import_file(file) if self.commit: diff --git a/openlp/plugins/songs/lib/songimport.py b/openlp/plugins/songs/lib/songimport.py index da017d4f5..b56b54b58 100644 --- a/openlp/plugins/songs/lib/songimport.py +++ b/openlp/plugins/songs/lib/songimport.py @@ -260,8 +260,7 @@ class SongImport(QtCore.QObject): All fields have been set to this song. Write the song to disk. """ if not self.authors: - self.authors.append(unicode(translate('SongsPlugin.SongImport', - 'Author unknown'))) + self.authors.append(u'Author Unknown') log.info(u'commiting song %s to database', self.title) song = Song() song.title = self.title diff --git a/openlp/plugins/songs/lib/ui.py b/openlp/plugins/songs/lib/ui.py index 2a67fce55..d712b9922 100644 --- a/openlp/plugins/songs/lib/ui.py +++ b/openlp/plugins/songs/lib/ui.py @@ -36,6 +36,7 @@ class SongStrings(object): # These strings should need a good reason to be retranslated elsewhere. Author = translate('OpenLP.Ui', 'Author', 'Singular') Authors = translate('OpenLP.Ui', 'Authors', 'Plural') + AuthorUnknown = translate('OpenLP.Ui', 'Author Unknown') SongBook = translate('OpenLP.Ui', 'Song Book', 'Singular') SongBooks = translate('OpenLP.Ui', 'Song Books', 'Plural') Topic = translate('OpenLP.Ui', 'Topic', 'Singular') diff --git a/openlp/plugins/songs/lib/xml.py b/openlp/plugins/songs/lib/xml.py index b96e79961..73c65f7c8 100644 --- a/openlp/plugins/songs/lib/xml.py +++ b/openlp/plugins/songs/lib/xml.py @@ -377,9 +377,7 @@ class OpenLyrics(object): except AttributeError: pass if not authors: - # Add "Author unknown" (can be translated). - authors.append((unicode(translate('SongsPlugin.XML', - 'Author unknown')))) + authors.append(u'Author Unknown') for display_name in authors: author = self.manager.get_object_filtered(Author, Author.display_name == display_name) From d129085d87745a10a756ca8bba747ff7316dd04a Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Sun, 13 Feb 2011 15:17:42 +0000 Subject: [PATCH 018/123] Improve Author Unknown strings --- openlp/plugins/songs/lib/songimport.py | 3 ++- openlp/plugins/songs/lib/ui.py | 3 ++- openlp/plugins/songs/lib/xml.py | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/openlp/plugins/songs/lib/songimport.py b/openlp/plugins/songs/lib/songimport.py index b56b54b58..7f0e622bd 100644 --- a/openlp/plugins/songs/lib/songimport.py +++ b/openlp/plugins/songs/lib/songimport.py @@ -31,6 +31,7 @@ from PyQt4 import QtCore from openlp.core.lib import Receiver, translate from openlp.plugins.songs.lib import VerseType from openlp.plugins.songs.lib.db import Song, Author, Topic, Book, MediaFile +from openlp.plugins.songs.lib.ui import SongStrings from openlp.plugins.songs.lib.xml import SongXML log = logging.getLogger(__name__) @@ -260,7 +261,7 @@ class SongImport(QtCore.QObject): All fields have been set to this song. Write the song to disk. """ if not self.authors: - self.authors.append(u'Author Unknown') + self.authors.append(SongStrings.AuthorUnknownUnT) log.info(u'commiting song %s to database', self.title) song = Song() song.title = self.title diff --git a/openlp/plugins/songs/lib/ui.py b/openlp/plugins/songs/lib/ui.py index d712b9922..3871c80b0 100644 --- a/openlp/plugins/songs/lib/ui.py +++ b/openlp/plugins/songs/lib/ui.py @@ -36,7 +36,8 @@ class SongStrings(object): # These strings should need a good reason to be retranslated elsewhere. Author = translate('OpenLP.Ui', 'Author', 'Singular') Authors = translate('OpenLP.Ui', 'Authors', 'Plural') - AuthorUnknown = translate('OpenLP.Ui', 'Author Unknown') + AuthorUnknown = translate('OpenLP.Ui', 'Author Unknown') # Used in the UI. + AuthorUnknownUnT = u'Author Unknown' # Used to populate the database. SongBook = translate('OpenLP.Ui', 'Song Book', 'Singular') SongBooks = translate('OpenLP.Ui', 'Song Books', 'Plural') Topic = translate('OpenLP.Ui', 'Topic', 'Singular') diff --git a/openlp/plugins/songs/lib/xml.py b/openlp/plugins/songs/lib/xml.py index 73c65f7c8..64fefdad2 100644 --- a/openlp/plugins/songs/lib/xml.py +++ b/openlp/plugins/songs/lib/xml.py @@ -69,6 +69,7 @@ from lxml import etree, objectify from openlp.core.lib import translate from openlp.plugins.songs.lib import VerseType from openlp.plugins.songs.lib.db import Author, Book, Song, Topic +from openlp.plugins.songs.lib.ui import SongStrings log = logging.getLogger(__name__) @@ -377,7 +378,7 @@ class OpenLyrics(object): except AttributeError: pass if not authors: - authors.append(u'Author Unknown') + authors.append(SongStrings.AuthorUnknownUnT) for display_name in authors: author = self.manager.get_object_filtered(Author, Author.display_name == display_name) From 365072c05c79637510324fb47f6a3388368c8665 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Sun, 13 Feb 2011 16:02:12 +0000 Subject: [PATCH 019/123] SongStrings --- .../songs/forms/songmaintenanceform.py | 30 +++++++------------ openlp/plugins/songs/lib/ui.py | 2 ++ 2 files changed, 13 insertions(+), 19 deletions(-) diff --git a/openlp/plugins/songs/forms/songmaintenanceform.py b/openlp/plugins/songs/forms/songmaintenanceform.py index 218debd7d..41f3e4237 100644 --- a/openlp/plugins/songs/forms/songmaintenanceform.py +++ b/openlp/plugins/songs/forms/songmaintenanceform.py @@ -215,13 +215,11 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog): if self.manager.save_object(author): self.resetAuthors() else: - critical_error_message_box( - message=translate('SongsPlugin.SongMaintenanceForm', - 'Could not add your author.')) + critical_error_message_box(SongStrings.CouldNotAdd % + SongStrings.Author.toLower()) else: critical_error_message_box( - message=translate('SongsPlugin.SongMaintenanceForm', - 'This author already exists.')) + SongStrings.ThisTypeExists % SongStrings.Author.toLower()) def onTopicAddButtonClick(self): if self.topicform.exec_(): @@ -230,13 +228,11 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog): if self.manager.save_object(topic): self.resetTopics() else: - critical_error_message_box( - message=translate('SongsPlugin.SongMaintenanceForm', - 'Could not add your topic.')) + critical_error_message_box(SongStrings.CouldNotAdd % + SongStrings.Topic.toLower()) else: critical_error_message_box( - message=translate('SongsPlugin.SongMaintenanceForm', - 'This topic already exists.')) + SongStrings.ThisTypeExists % SongStrings.Topic.toLower()) def onBookAddButtonClick(self): if self.bookform.exec_(): @@ -246,13 +242,11 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog): if self.manager.save_object(book): self.resetBooks() else: - critical_error_message_box( - message=translate('SongsPlugin.SongMaintenanceForm', - 'Could not add your book.')) + critical_error_message_box(SongStrings.CouldNotAdd % + SongStrings.SongBook.toLower()) else: critical_error_message_box( - message=translate('SongsPlugin.SongMaintenanceForm', - 'This book already exists.')) + SongStrings.ThisTypeExists % SongStrings.SongBook.toLower()) def onAuthorEditButtonClick(self): author_id = self._getCurrentItemId(self.authorsListWidget) @@ -269,11 +263,9 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog): temp_last_name = author.last_name temp_display_name = author.display_name if self.authorform.exec_(False): - author.first_name = unicode( - self.authorform.firstNameEdit.text()) + author.first_name = unicode(self.authorform.firstNameEdit.text()) author.last_name = unicode(self.authorform.lastNameEdit.text()) - author.display_name = unicode( - self.authorform.displayEdit.text()) + author.display_name = unicode(self.authorform.displayEdit.text()) if self.checkAuthor(author, True): if self.manager.save_object(author): self.resetAuthors() diff --git a/openlp/plugins/songs/lib/ui.py b/openlp/plugins/songs/lib/ui.py index 3871c80b0..0203c166e 100644 --- a/openlp/plugins/songs/lib/ui.py +++ b/openlp/plugins/songs/lib/ui.py @@ -38,8 +38,10 @@ class SongStrings(object): Authors = translate('OpenLP.Ui', 'Authors', 'Plural') AuthorUnknown = translate('OpenLP.Ui', 'Author Unknown') # Used in the UI. AuthorUnknownUnT = u'Author Unknown' # Used to populate the database. + CouldNotAdd = unicode(translate('OpenLP.Ui', 'Could not add your %s.')) SongBook = translate('OpenLP.Ui', 'Song Book', 'Singular') SongBooks = translate('OpenLP.Ui', 'Song Books', 'Plural') + ThisTypeExists = unicode(translate('OpenLP.Ui', 'This %s already exists.')) Topic = translate('OpenLP.Ui', 'Topic', 'Singular') Topics = translate('OpenLP.Ui', 'Topics', 'Plural') TypeMaintenance = unicode(translate('OpenLP.Ui', '%s Maintenance')) From 043665d154f6da3bf2c6a9dc2ef532ef51d1c535 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Sun, 13 Feb 2011 16:39:03 +0000 Subject: [PATCH 020/123] Fixes --- openlp/plugins/custom/lib/mediaitem.py | 2 +- openlp/plugins/songs/lib/opensongimport.py | 3 +-- openlp/plugins/songs/lib/songshowplusimport.py | 12 ++++++------ openlp/plugins/songs/lib/xml.py | 1 - 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/openlp/plugins/custom/lib/mediaitem.py b/openlp/plugins/custom/lib/mediaitem.py index 522d36e5c..b0834f170 100644 --- a/openlp/plugins/custom/lib/mediaitem.py +++ b/openlp/plugins/custom/lib/mediaitem.py @@ -29,7 +29,7 @@ import logging from PyQt4 import QtCore, QtGui from openlp.core.lib import MediaManagerItem, Receiver, ItemCapabilities, \ - translate, check_item_selected + check_item_selected from openlp.core.lib.ui import UiStrings from openlp.plugins.custom.lib import CustomXMLParser from openlp.plugins.custom.lib.db import CustomSlide diff --git a/openlp/plugins/songs/lib/opensongimport.py b/openlp/plugins/songs/lib/opensongimport.py index 24043d6f0..b2d82c081 100644 --- a/openlp/plugins/songs/lib/opensongimport.py +++ b/openlp/plugins/songs/lib/opensongimport.py @@ -147,8 +147,7 @@ class OpenSongImport(SongImport): continue log.info(u'Zip importing %s', parts[-1]) self.import_wizard.incrementProgressBar( - unicode(translate('SongsPlugin.ImportWizardForm', - 'Importing %s...')) % parts[-1]) + WizardStrings.ImportingType % parts[-1]) songfile = z.open(song) self.do_import_file(songfile) if self.commit: diff --git a/openlp/plugins/songs/lib/songshowplusimport.py b/openlp/plugins/songs/lib/songshowplusimport.py index 78c2e838d..924f7eeaf 100644 --- a/openlp/plugins/songs/lib/songshowplusimport.py +++ b/openlp/plugins/songs/lib/songshowplusimport.py @@ -116,27 +116,27 @@ class SongShowPlusImport(SongImport): u'Importing %s' % (file_name), 0) songData = open(file, 'rb') while (1): - blockKey, = struct.unpack("I",songData.read(4)) + blockKey, = struct.unpack("I", songData.read(4)) # The file ends with 4 NUL's if blockKey == 0: break - nextBlockStarts, = struct.unpack("I",songData.read(4)) + nextBlockStarts, = struct.unpack("I", songData.read(4)) if blockKey == VERSE or blockKey == CHORUS: - null, verseNo, = struct.unpack("BB",songData.read(2)) + null, verseNo, = struct.unpack("BB", songData.read(2)) elif blockKey == CUSTOM_VERSE: null, verseNameLength, = struct.unpack("BB", songData.read(2)) verseName = songData.read(verseNameLength) - lengthDescriptorSize, = struct.unpack("B",songData.read(1)) + lengthDescriptorSize, = struct.unpack("B", songData.read(1)) # Detect if/how long the length descriptor is if lengthDescriptorSize == 12: - lengthDescriptor, = struct.unpack("I",songData.read(4)) + lengthDescriptor, = struct.unpack("I", songData.read(4)) elif lengthDescriptorSize == 2: lengthDescriptor = 1 elif lengthDescriptorSize == 9: lengthDescriptor = 0 else: - lengthDescriptor, = struct.unpack("B",songData.read(1)) + lengthDescriptor, = struct.unpack("B", songData.read(1)) data = songData.read(lengthDescriptor) if blockKey == TITLE: diff --git a/openlp/plugins/songs/lib/xml.py b/openlp/plugins/songs/lib/xml.py index 64fefdad2..6d015701f 100644 --- a/openlp/plugins/songs/lib/xml.py +++ b/openlp/plugins/songs/lib/xml.py @@ -66,7 +66,6 @@ import re from lxml import etree, objectify -from openlp.core.lib import translate from openlp.plugins.songs.lib import VerseType from openlp.plugins.songs.lib.db import Author, Book, Song, Topic from openlp.plugins.songs.lib.ui import SongStrings From 1d91192e3b00cd5e04557a25e440487abf4cbc7c Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Mon, 14 Feb 2011 00:35:53 +0000 Subject: [PATCH 021/123] WizardStrings --- openlp/core/lib/ui.py | 1 + openlp/plugins/songs/forms/editsongform.py | 16 ++++++++-------- openlp/plugins/songs/lib/easislidesimport.py | 4 ++-- openlp/plugins/songs/lib/ewimport.py | 4 ++-- openlp/plugins/songs/lib/olp1import.py | 4 ++-- openlp/plugins/songs/lib/songbeamerimport.py | 2 +- openlp/plugins/songs/lib/songshowplusimport.py | 14 +++++++------- openlp/plugins/songs/lib/wowimport.py | 5 +++-- 8 files changed, 26 insertions(+), 24 deletions(-) diff --git a/openlp/core/lib/ui.py b/openlp/core/lib/ui.py index f4aa8162e..196a8567f 100644 --- a/openlp/core/lib/ui.py +++ b/openlp/core/lib/ui.py @@ -45,6 +45,7 @@ class UiStrings(object): AddANew = unicode(translate('OpenLP.Ui', 'Add a new %s.')) AddSelectService = unicode(translate('OpenLP.Ui', 'Add the selected %s to the service.')) + AddType = unicode(translate('OpenLP.Ui', 'Add %s')) Advanced = translate('OpenLP.Ui', 'Advanced') AllFiles = translate('OpenLP.Ui', 'All Files') Browse = translate('OpenLP.Ui', 'Browse...') diff --git a/openlp/plugins/songs/forms/editsongform.py b/openlp/plugins/songs/forms/editsongform.py index 8536d38b8..d792afa2f 100644 --- a/openlp/plugins/songs/forms/editsongform.py +++ b/openlp/plugins/songs/forms/editsongform.py @@ -30,10 +30,12 @@ import re from PyQt4 import QtCore, QtGui from openlp.core.lib import Receiver, translate -from openlp.core.lib.ui import add_widget_completer, critical_error_message_box +from openlp.core.lib.ui import UiStrings, add_widget_completer, \ + critical_error_message_box from openlp.plugins.songs.forms import EditVerseForm from openlp.plugins.songs.lib import SongXML, VerseType from openlp.plugins.songs.lib.db import Book, Song, Author, Topic +from openlp.plugins.songs.lib.ui import SongStrings from editsongdialog import Ui_EditSongDialog log = logging.getLogger(__name__) @@ -307,7 +309,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): text = unicode(self.authorsComboBox.currentText()) if item == 0 and text: if QtGui.QMessageBox.question(self, - translate('SongsPlugin.EditSongForm', 'Add Author'), + UiStrings.AddType % SongStrings.Author, translate('SongsPlugin.EditSongForm', 'This author does not ' 'exist, do you want to add them?'), QtGui.QMessageBox.Yes | QtGui.QMessageBox.No, @@ -336,8 +338,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): self.__addAuthorToList(author) self.authorsComboBox.setCurrentIndex(0) else: - QtGui.QMessageBox.warning(self, - translate('SongsPlugin.EditSongForm', 'No Author Selected'), + QtGui.QMessageBox.warning(self, UiStrings.NISs, translate('SongsPlugin.EditSongForm', 'You have not selected ' 'a valid author. Either select an author from the list, ' 'or type in a new author and click the "Add Author to ' @@ -366,7 +367,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): text = unicode(self.topicsComboBox.currentText()) if item == 0 and text: if QtGui.QMessageBox.question(self, - translate('SongsPlugin.EditSongForm', 'Add Topic'), + UiStrings.AddType % SongStrings.Topic, translate('SongsPlugin.EditSongForm', 'This topic does not ' 'exist, do you want to add it?'), QtGui.QMessageBox.Yes | QtGui.QMessageBox.No, @@ -396,8 +397,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): self.topicsListView.addItem(topic_item) self.topicsComboBox.setCurrentIndex(0) else: - QtGui.QMessageBox.warning(self, - translate('SongsPlugin.EditSongForm', 'No Topic Selected'), + QtGui.QMessageBox.warning(self, UiStrings.NISs, translate('SongsPlugin.EditSongForm', 'You have not selected ' 'a valid topic. Either select a topic from the list, or ' 'type in a new topic and click the "Add Topic to Song" ' @@ -584,7 +584,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): text = unicode(self.songBookComboBox.currentText()) if self.songBookComboBox.findText(text, QtCore.Qt.MatchExactly) < 0: if QtGui.QMessageBox.question(self, - translate('SongsPlugin.EditSongForm', 'Add Book'), + UiStrings.AddType % SongStrings.SongBook, translate('SongsPlugin.EditSongForm', 'This song book does ' 'not exist, do you want to add it?'), QtGui.QMessageBox.Yes | QtGui.QMessageBox.No, diff --git a/openlp/plugins/songs/lib/easislidesimport.py b/openlp/plugins/songs/lib/easislidesimport.py index 5d56af8ce..232202c4f 100644 --- a/openlp/plugins/songs/lib/easislidesimport.py +++ b/openlp/plugins/songs/lib/easislidesimport.py @@ -30,6 +30,7 @@ from lxml import etree, objectify import re from openlp.core.lib import translate +from openlp.core.ui.wizard import WizardStrings from openlp.plugins.songs.lib.songimport import SongImport log = logging.getLogger(__name__) @@ -64,8 +65,7 @@ class EasiSlidesImport(SongImport): xml = unicode(etree.tostring(file)) song_xml = objectify.fromstring(xml) self.import_wizard.incrementProgressBar( - unicode(translate('SongsPlugin.ImportWizardForm', - u'Importing %s...')) % os.path.split(self.filename)[-1]) + WizardStrings.ImportingType % os.path.split(self.filename)[-1]) self.import_wizard.progressBar.setMaximum(len(song_xml.Item)) for song in song_xml.Item: self.import_wizard.incrementProgressBar( diff --git a/openlp/plugins/songs/lib/ewimport.py b/openlp/plugins/songs/lib/ewimport.py index 312e3b759..df88f025b 100644 --- a/openlp/plugins/songs/lib/ewimport.py +++ b/openlp/plugins/songs/lib/ewimport.py @@ -32,6 +32,7 @@ import os import struct from openlp.core.lib import translate +from openlp.core.ui.wizard import WizardStrings from openlp.plugins.songs.lib import retrieve_windows_encoding from songimport import SongImport @@ -231,8 +232,7 @@ class EasyWorshipSongImport(SongImport): title = self.get_field(fi_title) if title: self.import_wizard.incrementProgressBar( - unicode(translate('SongsPlugin.ImportWizardForm', - 'Importing "%s"...')) % title, 0) + WizardStrings.ImportingType % title, 0) self.title = title # Get remaining fields copy = self.get_field(fi_copy) diff --git a/openlp/plugins/songs/lib/olp1import.py b/openlp/plugins/songs/lib/olp1import.py index c3e1ca6b4..daf3629a4 100644 --- a/openlp/plugins/songs/lib/olp1import.py +++ b/openlp/plugins/songs/lib/olp1import.py @@ -33,6 +33,7 @@ from chardet.universaldetector import UniversalDetector import sqlite from openlp.core.lib import translate +from openlp.core.ui.wizard import WizardStrings from openlp.plugins.songs.lib import retrieve_windows_encoding from songimport import SongImport @@ -103,8 +104,7 @@ class OpenLP1SongImport(SongImport): lyrics = song[2].replace(u'\r\n', u'\n') copyright = song[3] self.import_wizard.incrementProgressBar( - unicode(translate('SongsPlugin.ImportWizardForm', - 'Importing "%s"...')) % title) + WizardStrings.ImportingType % title) self.title = title verses = lyrics.split(u'\n\n') for verse in verses: diff --git a/openlp/plugins/songs/lib/songbeamerimport.py b/openlp/plugins/songs/lib/songbeamerimport.py index eeabc0e5d..9b47b2c52 100644 --- a/openlp/plugins/songs/lib/songbeamerimport.py +++ b/openlp/plugins/songs/lib/songbeamerimport.py @@ -96,7 +96,7 @@ class SongBeamerImport(SongImport): read_verses = False file_name = os.path.split(file)[1] self.import_wizard.incrementProgressBar( - u'Importing %s' % (file_name), 0) + WizardStrings.ImportingType % file_name, 0) if os.path.isfile(file): detect_file = open(file, u'r') details = chardet.detect(detect_file.read(2048)) diff --git a/openlp/plugins/songs/lib/songshowplusimport.py b/openlp/plugins/songs/lib/songshowplusimport.py index 924f7eeaf..289fd2860 100644 --- a/openlp/plugins/songs/lib/songshowplusimport.py +++ b/openlp/plugins/songs/lib/songshowplusimport.py @@ -31,6 +31,7 @@ import os import logging import struct +from openlp.core.ui.wizard import WizardStrings from openlp.plugins.songs.lib.songimport import SongImport TITLE = 1 @@ -113,7 +114,7 @@ class SongShowPlusImport(SongImport): otherList = {} file_name = os.path.split(file)[1] self.import_wizard.incrementProgressBar( - u'Importing %s' % (file_name), 0) + WizardStrings.ImportingType % file_name, 0) songData = open(file, 'rb') while (1): blockKey, = struct.unpack("I", songData.read(4)) @@ -138,7 +139,6 @@ class SongShowPlusImport(SongImport): else: lengthDescriptor, = struct.unpack("B", songData.read(1)) data = songData.read(lengthDescriptor) - if blockKey == TITLE: self.title = unicode(data, u'cp1252') elif blockKey == AUTHOR: @@ -153,10 +153,10 @@ class SongShowPlusImport(SongImport): elif blockKey == CCLI_NO: self.ccli_number = int(data) elif blockKey == VERSE: - self.add_verse(unicode(data, u'cp1252'), + self.add_verse(unicode(data, u'cp1252'), "V%s" % verseNo) elif blockKey == CHORUS: - self.add_verse(unicode(data, u'cp1252'), + self.add_verse(unicode(data, u'cp1252'), "C%s" % verseNo) elif blockKey == TOPIC: self.topics.append(unicode(data, u'cp1252')) @@ -180,11 +180,11 @@ class SongShowPlusImport(SongImport): songData.close() self.finish() self.import_wizard.incrementProgressBar( - u'Importing %s' % (file_name)) + WizardStrings.ImportingType % file_name) return True - + def toOpenLPVerseTag(self, verseName): - if verseName.find(" ")!=-1: + if verseName.find(" ") != -1: verseParts = verseName.split(" ") verseType = verseParts[0] verseNumber = verseParts[1] diff --git a/openlp/plugins/songs/lib/wowimport.py b/openlp/plugins/songs/lib/wowimport.py index b90a47de6..c7bd5d743 100644 --- a/openlp/plugins/songs/lib/wowimport.py +++ b/openlp/plugins/songs/lib/wowimport.py @@ -30,6 +30,7 @@ Worship songs into the OpenLP database. import os import logging +from openlp.core.ui.wizard import WizardStrings from openlp.plugins.songs.lib.songimport import SongImport BLOCK_TYPES = (u'V', u'C', u'B') @@ -116,7 +117,7 @@ class WowImport(SongImport): copyright = u'' file_name = os.path.split(file)[1] self.import_wizard.incrementProgressBar( - u'Importing %s' % (file_name), 0) + WizardStrings.ImportingType % file_name, 0) # Get the song title self.title = file_name.rpartition(u'.')[0] songData = open(file, 'rb') @@ -162,5 +163,5 @@ class WowImport(SongImport): songData.close() self.finish() self.import_wizard.incrementProgressBar( - u'Importing %s' % (file_name)) + WizardStrings.ImportingType % file_name) return True From 71cbbfcbf22443a36ea794cbcc6d3d8a6490ba2a Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Mon, 14 Feb 2011 01:55:34 +0000 Subject: [PATCH 022/123] Unused imports --- openlp/plugins/songs/lib/olp1import.py | 1 - openlp/plugins/songs/lib/opensongimport.py | 1 - 2 files changed, 2 deletions(-) diff --git a/openlp/plugins/songs/lib/olp1import.py b/openlp/plugins/songs/lib/olp1import.py index daf3629a4..a8fb29691 100644 --- a/openlp/plugins/songs/lib/olp1import.py +++ b/openlp/plugins/songs/lib/olp1import.py @@ -32,7 +32,6 @@ import logging from chardet.universaldetector import UniversalDetector import sqlite -from openlp.core.lib import translate from openlp.core.ui.wizard import WizardStrings from openlp.plugins.songs.lib import retrieve_windows_encoding from songimport import SongImport diff --git a/openlp/plugins/songs/lib/opensongimport.py b/openlp/plugins/songs/lib/opensongimport.py index b2d82c081..081c4c662 100644 --- a/openlp/plugins/songs/lib/opensongimport.py +++ b/openlp/plugins/songs/lib/opensongimport.py @@ -31,7 +31,6 @@ from lxml import objectify from lxml.etree import Error, LxmlError import re -from openlp.core.lib import translate from openlp.core.ui.wizard import WizardStrings from openlp.plugins.songs.lib.songimport import SongImport From 2316ab4ed47bba894c9c31bd71ba17947e8da418 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Mon, 14 Feb 2011 02:54:24 +0000 Subject: [PATCH 023/123] Deleting song items --- .../songs/forms/songmaintenanceform.py | 38 ++++++------------- openlp/plugins/songs/lib/ui.py | 4 ++ 2 files changed, 15 insertions(+), 27 deletions(-) diff --git a/openlp/plugins/songs/forms/songmaintenanceform.py b/openlp/plugins/songs/forms/songmaintenanceform.py index 41f3e4237..ffea2ffa6 100644 --- a/openlp/plugins/songs/forms/songmaintenanceform.py +++ b/openlp/plugins/songs/forms/songmaintenanceform.py @@ -103,20 +103,22 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog): else: return -1 - def _deleteItem(self, item_class, list_widget, reset_func, dlg_title, - del_text, err_text, sel_text): + def _deleteItem(self, item_class, list_widget, reset_func, del_type): + dlg_title = UiStrings.DeleteType % del_type item_id = self._getCurrentItemId(list_widget) if item_id != -1: item = self.manager.get_object(item_class, item_id) if item and len(item.songs) == 0: - if critical_error_message_box(title=dlg_title, message=del_text, - parent=self, question=True) == QtGui.QMessageBox.Yes: + if critical_error_message_box(dlg_title, + SongStrings.SureDeleteType % del_type, + self, True) == QtGui.QMessageBox.Yes: self.manager.delete_object(item_class, item.id) reset_func() else: - critical_error_message_box(dlg_title, err_text) + critical_error_message_box(dlg_title, + SongStrings.NoDeleteAssigned % del_type) else: - critical_error_message_box(dlg_title, sel_text) + critical_error_message_box(dlg_title, UiStrings.NISs) def resetAuthors(self): """ @@ -440,39 +442,21 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog): Delete the author if the author is not attached to any songs. """ self._deleteItem(Author, self.authorsListWidget, self.resetAuthors, - UiStrings.DeleteType % SongStrings.Author, - translate('SongsPlugin.SongMaintenanceForm', - 'Are you sure you want to delete the selected author?'), - translate('SongsPlugin.SongMaintenanceForm', - 'This author cannot be deleted, they are currently ' - 'assigned to at least one song.'), - translate('SongsPlugin.SongMaintenanceForm', 'No author selected!')) + SongStrings.Author) def onTopicDeleteButtonClick(self): """ Delete the Book if the Book is not attached to any songs. """ self._deleteItem(Topic, self.topicsListWidget, self.resetTopics, - UiStrings.DeleteType % SongStrings.Topic, - translate('SongsPlugin.SongMaintenanceForm', - 'Are you sure you want to delete the selected topic?'), - translate('SongsPlugin.SongMaintenanceForm', - 'This topic cannot be deleted, it is currently ' - 'assigned to at least one song.'), - translate('SongsPlugin.SongMaintenanceForm', 'No topic selected!')) + SongStrings.Topic) def onBookDeleteButtonClick(self): """ Delete the Book if the Book is not attached to any songs. """ self._deleteItem(Book, self.booksListWidget, self.resetBooks, - UiStrings.DeleteType % SongStrings.SongBook, - translate('SongsPlugin.SongMaintenanceForm', - 'Are you sure you want to delete the selected book?'), - translate('SongsPlugin.SongMaintenanceForm', - 'This book cannot be deleted, it is currently ' - 'assigned to at least one song.'), - translate('SongsPlugin.SongMaintenanceForm', 'No book selected!')) + SongStrings.SongBook) def onAuthorsListRowChanged(self, row): """ diff --git a/openlp/plugins/songs/lib/ui.py b/openlp/plugins/songs/lib/ui.py index 0203c166e..e16835ba3 100644 --- a/openlp/plugins/songs/lib/ui.py +++ b/openlp/plugins/songs/lib/ui.py @@ -39,8 +39,12 @@ class SongStrings(object): AuthorUnknown = translate('OpenLP.Ui', 'Author Unknown') # Used in the UI. AuthorUnknownUnT = u'Author Unknown' # Used to populate the database. CouldNotAdd = unicode(translate('OpenLP.Ui', 'Could not add your %s.')) + NoDeleteAssigned = unicode(translate('OpenLP.Ui', 'This %s cannot be ' + 'deleted as it is currently assigned to at least one song.')) SongBook = translate('OpenLP.Ui', 'Song Book', 'Singular') SongBooks = translate('OpenLP.Ui', 'Song Books', 'Plural') + SureDeleteType = unicode(translate('OpenLP.Ui', + 'Are you sure you want to delete the selected %s?')) ThisTypeExists = unicode(translate('OpenLP.Ui', 'This %s already exists.')) Topic = translate('OpenLP.Ui', 'Topic', 'Singular') Topics = translate('OpenLP.Ui', 'Topics', 'Plural') From 910df1cfde9da62bac277e3f799b520a3cd86c07 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Mon, 14 Feb 2011 03:19:30 +0000 Subject: [PATCH 024/123] More song items --- openlp/plugins/songs/forms/editsongform.py | 17 +++++++---------- openlp/plugins/songs/lib/ui.py | 4 ++++ 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/openlp/plugins/songs/forms/editsongform.py b/openlp/plugins/songs/forms/editsongform.py index d792afa2f..d8052ca57 100644 --- a/openlp/plugins/songs/forms/editsongform.py +++ b/openlp/plugins/songs/forms/editsongform.py @@ -310,8 +310,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): if item == 0 and text: if QtGui.QMessageBox.question(self, UiStrings.AddType % SongStrings.Author, - translate('SongsPlugin.EditSongForm', 'This author does not ' - 'exist, do you want to add them?'), + SongStrings.TypeNotExistAdd % SongStrings.Author.toLower(), QtGui.QMessageBox.Yes | QtGui.QMessageBox.No, QtGui.QMessageBox.Yes) == QtGui.QMessageBox.Yes: if text.find(u' ') == -1: @@ -332,8 +331,8 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): if self.authorsListView.findItems(unicode(author.display_name), QtCore.Qt.MatchExactly): critical_error_message_box( - message=translate('SongsPlugin.EditSongForm', - 'This author is already in the list.')) + message=SongStrings.TypeInList % + SongStrings.Author.toLower()) else: self.__addAuthorToList(author) self.authorsComboBox.setCurrentIndex(0) @@ -368,8 +367,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): if item == 0 and text: if QtGui.QMessageBox.question(self, UiStrings.AddType % SongStrings.Topic, - translate('SongsPlugin.EditSongForm', 'This topic does not ' - 'exist, do you want to add it?'), + SongStrings.TypeNotExistAdd % SongStrings.Topic.toLower(), QtGui.QMessageBox.Yes | QtGui.QMessageBox.No, QtGui.QMessageBox.Yes) == QtGui.QMessageBox.Yes: topic = Topic.populate(name=text) @@ -388,8 +386,8 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): if self.topicsListView.findItems(unicode(topic.name), QtCore.Qt.MatchExactly): critical_error_message_box( - message=translate('SongsPlugin.EditSongForm', - 'This topic is already in the list.')) + message=SongStrings.TypeInList % + SongStrings.Topic.toLower()) else: topic_item = QtGui.QListWidgetItem(unicode(topic.name)) topic_item.setData(QtCore.Qt.UserRole, @@ -585,8 +583,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): if self.songBookComboBox.findText(text, QtCore.Qt.MatchExactly) < 0: if QtGui.QMessageBox.question(self, UiStrings.AddType % SongStrings.SongBook, - translate('SongsPlugin.EditSongForm', 'This song book does ' - 'not exist, do you want to add it?'), + SongStrings.TypeNotExistAdd % SongStrings.SongBook.toLower(), QtGui.QMessageBox.Yes | QtGui.QMessageBox.No, QtGui.QMessageBox.Yes) == QtGui.QMessageBox.Yes: book = Book.populate(name=text, publisher=u'') diff --git a/openlp/plugins/songs/lib/ui.py b/openlp/plugins/songs/lib/ui.py index e16835ba3..beab16dd0 100644 --- a/openlp/plugins/songs/lib/ui.py +++ b/openlp/plugins/songs/lib/ui.py @@ -48,4 +48,8 @@ class SongStrings(object): ThisTypeExists = unicode(translate('OpenLP.Ui', 'This %s already exists.')) Topic = translate('OpenLP.Ui', 'Topic', 'Singular') Topics = translate('OpenLP.Ui', 'Topics', 'Plural') + TypeInList = unicode(translate('OpenLP.Ui', + 'This %s is already in the list.')) TypeMaintenance = unicode(translate('OpenLP.Ui', '%s Maintenance')) + TypeNotExistAdd = unicode(translate('OpenLP.Ui', + 'This %s does not exist, do you want to add it?')) From 68d6bc46d682d3f87bf9b27461f01f7a8b797eff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Armin=20K=C3=B6hler?= Date: Mon, 14 Feb 2011 13:20:30 +0100 Subject: [PATCH 025/123] Comment 14.02.2011 --- openlp/plugins/songs/forms/songimportform.py | 46 ++++++++++++++++++++ openlp/plugins/songs/lib/importer.py | 7 ++- 2 files changed, 52 insertions(+), 1 deletion(-) diff --git a/openlp/plugins/songs/forms/songimportform.py b/openlp/plugins/songs/forms/songimportform.py index 433c9abfc..e07b8c019 100644 --- a/openlp/plugins/songs/forms/songimportform.py +++ b/openlp/plugins/songs/forms/songimportform.py @@ -140,6 +140,12 @@ class SongImportForm(OpenLPWizard): QtCore.QObject.connect(self.songBeamerRemoveButton, QtCore.SIGNAL(u'clicked()'), self.onSongBeamerRemoveButtonClicked) + QtCore.QObject.connect(self.foilPresenterAddButton, + QtCore.SIGNAL(u'clicked()'), + self.onFoilPresenterAddButtonClicked), + QtCore.QObject.connect(self.foilPresenterRemoveButton, + QtCore.SIGNAL(u'clicked()'), + self.onFoilPresenterRemoveButtonClicked) def addCustomPages(self): """ @@ -186,6 +192,8 @@ class SongImportForm(OpenLPWizard): self.addSingleFileSelectItem(u'ew') # Words of Worship self.addMultiFileSelectItem(u'songBeamer') + # Foilpresenter + self.addMultiFileSelectItem(u'foilPresenter') # Commented out for future use. # self.addSingleFileSelectItem(u'csv', u'CSV') self.sourceLayout.addLayout(self.formatStack) @@ -236,6 +244,8 @@ class SongImportForm(OpenLPWizard): translate('SongsPlugin.ImportWizardForm', 'EasyWorship')) self.formatComboBox.setItemText(10, translate('SongsPlugin.ImportWizardForm', 'SongBeamer')) + self.formatComboBox.setItemText(11, + translate('SongsPlugin.ImportWizardForm', 'FoilPresenter')) # self.formatComboBox.setItemText(11, # translate('SongsPlugin.ImportWizardForm', 'CSV')) self.openLP2FilenameLabel.setText( @@ -300,6 +310,10 @@ class SongImportForm(OpenLPWizard): translate('SongsPlugin.ImportWizardForm', 'Add Files...')) self.songBeamerRemoveButton.setText( translate('SongsPlugin.ImportWizardForm', 'Remove File(s)')) + self.foilPresenterAddButton.setText( + translate('SongsPlugin.ImportWizardForm', 'Add Files...')) + self.foilPresenterRemoveButton.setText( + translate('SongsPlugin.ImportWizardForm', 'Remove File(s)')) # self.csvFilenameLabel.setText( # translate('SongsPlugin.ImportWizardForm', 'Filename:')) # self.csvBrowseButton.setText( @@ -447,6 +461,16 @@ class SongImportForm(OpenLPWizard): 'file to import from.')) self.songBeamerAddButton.setFocus() return False + elif source_format == SongFormat.FoilPresenter: + if self.foilPresenterFileListWidget.count() == 0: + criticalErrorMessageBox( + translate('SongsPlugin.ImportWizardForm', + 'No Foilpresenter Files Selected'), + translate('SongsPlugin.ImportWizardForm', + 'You need to add at least one Foilpresenter ' + 'song file to import from.')) + self.foilPresenterAddButton.setFocus() + return False return True elif self.currentPage() == self.progressPage: return True @@ -682,6 +706,22 @@ class SongImportForm(OpenLPWizard): """ self.removeSelectedItems(self.songBeamerFileListWidget) + def onFoilPresenterAddButtonClicked(self): + """ + Get FoilPresenter song database files + """ + self.getFiles( + translate('SongsPlugin.ImportWizardForm', + 'Select FoilPresenter Files'), + self.foilPresenterFileListWidget + ) + + def onFoilPresenterRemoveButtonClicked(self): + """ + Remove selected FoilPresenter files from the import list + """ + self.removeSelectedItems(self.foilPresenterFileListWidget) + def registerFields(self): """ Register song import wizard fields. @@ -707,6 +747,7 @@ class SongImportForm(OpenLPWizard): self.easiSlidesFilenameEdit.setText(u'') self.ewFilenameEdit.setText(u'') self.songBeamerFileListWidget.clear() + self.foilPresenterFileListWidget.clear() #self.csvFilenameEdit.setText(u'') def preWizard(self): @@ -783,6 +824,11 @@ class SongImportForm(OpenLPWizard): importer = self.plugin.importSongs(SongFormat.SongBeamer, filenames=self.getListOfFiles(self.songBeamerFileListWidget) ) + elif source_format == SongFormat.FoilPresenter: + # Import Foilpresenter songs + importer = self.plugin.importSongs(SongFormat.FoilPresenter, + filenames=self.getListOfFiles(self.foilPresenterFileListWidget) + ) if importer.do_import(): # reload songs self.progressLabel.setText( diff --git a/openlp/plugins/songs/lib/importer.py b/openlp/plugins/songs/lib/importer.py index 91d3d7e6f..e914cc6ac 100644 --- a/openlp/plugins/songs/lib/importer.py +++ b/openlp/plugins/songs/lib/importer.py @@ -34,6 +34,7 @@ from wowimport import WowImport from cclifileimport import CCLIFileImport from ewimport import EasyWorshipSongImport from songbeamerimport import SongBeamerImport +from foilpresenterimport import FoilPresenterImport # Imports that might fail try: from olp1import import OpenLP1SongImport @@ -71,6 +72,7 @@ class SongFormat(object): EasiSlides = 8 EasyWorship = 9 SongBeamer = 10 + FoilPresenter = 11 @staticmethod def get_class(format): @@ -102,6 +104,8 @@ class SongFormat(object): return EasyWorshipSongImport elif format == SongFormat.SongBeamer: return SongBeamerImport + elif format == SongFormat.FoilPresenter: + return FoilPresenterImport return None @staticmethod @@ -120,7 +124,8 @@ class SongFormat(object): SongFormat.Generic, SongFormat.EasiSlides, SongFormat.EasyWorship, - SongFormat.SongBeamer + SongFormat.SongBeamer, + SongFormat.FoilPresenter ] @staticmethod From cafd7b397d3301431d05ef6a6c01aafaa3798fc3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Armin=20K=C3=B6hler?= Date: Mon, 14 Feb 2011 14:01:52 +0100 Subject: [PATCH 026/123] 14.02.2011 --- openlp/plugins/songs/forms/songimportform.py | 17 +++++++++-------- openlp/plugins/songs/lib/importer.py | 5 +---- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/openlp/plugins/songs/forms/songimportform.py b/openlp/plugins/songs/forms/songimportform.py index 6c5c90838..b6c7286bc 100644 --- a/openlp/plugins/songs/forms/songimportform.py +++ b/openlp/plugins/songs/forms/songimportform.py @@ -140,18 +140,18 @@ class SongImportForm(OpenLPWizard): QtCore.QObject.connect(self.songBeamerRemoveButton, QtCore.SIGNAL(u'clicked()'), self.onSongBeamerRemoveButtonClicked) - QtCore.QObject.connect(self.foilPresenterAddButton, - QtCore.SIGNAL(u'clicked()'), - self.onFoilPresenterAddButtonClicked), - QtCore.QObject.connect(self.foilPresenterRemoveButton, - QtCore.SIGNAL(u'clicked()'), - self.onFoilPresenterRemoveButtonClicked) QtCore.QObject.connect(self.songShowPlusAddButton, QtCore.SIGNAL(u'clicked()'), self.onSongShowPlusAddButtonClicked) QtCore.QObject.connect(self.songShowPlusRemoveButton, QtCore.SIGNAL(u'clicked()'), self.onSongShowPlusRemoveButtonClicked) + QtCore.QObject.connect(self.foilPresenterAddButton, + QtCore.SIGNAL(u'clicked()'), + self.onFoilPresenterAddButtonClicked) + QtCore.QObject.connect(self.foilPresenterRemoveButton, + QtCore.SIGNAL(u'clicked()'), + self.onFoilPresenterRemoveButtonClicked) def addCustomPages(self): """ @@ -200,10 +200,10 @@ class SongImportForm(OpenLPWizard): self.addFileSelectItem(u'ew', single_select=True) # Words of Worship self.addFileSelectItem(u'songBeamer') - # Foilpresenter - self.addFileSelectItem(u'foilPresenter') # Song Show Plus self.addFileSelectItem(u'songShowPlus') + # Foilpresenter + self.addFileSelectItem(u'foilPresenter') # Commented out for future use. # self.addFileSelectItem(u'csv', u'CSV', single_select=True) self.sourceLayout.addLayout(self.formatStack) @@ -475,6 +475,7 @@ class SongImportForm(OpenLPWizard): 'You need to add at least one SongShow Plus ' 'file to import from.')) self.wordsOfWorshipAddButton.setFocus() + return False elif source_format == SongFormat.FoilPresenter: if self.foilPresenterFileListWidget.count() == 0: criticalErrorMessageBox( diff --git a/openlp/plugins/songs/lib/importer.py b/openlp/plugins/songs/lib/importer.py index dbbcad596..53ba17de9 100644 --- a/openlp/plugins/songs/lib/importer.py +++ b/openlp/plugins/songs/lib/importer.py @@ -34,11 +34,8 @@ from wowimport import WowImport from cclifileimport import CCLIFileImport from ewimport import EasyWorshipSongImport from songbeamerimport import SongBeamerImport -<<<<<<< TREE -from foilpresenterimport import FoilPresenterImport -======= from songshowplusimport import SongShowPlusImport ->>>>>>> MERGE-SOURCE +from foilpresenterimport import FoilPresenterImport # Imports that might fail try: from olp1import import OpenLP1SongImport From d5596583ff1e0804c71c8d2829c726df27aa5b4e Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Mon, 14 Feb 2011 16:08:17 +0000 Subject: [PATCH 027/123] Fixes, cleanups, strings --- openlp/core/lib/mediamanageritem.py | 1 - openlp/core/lib/plugin.py | 3 ++- openlp/core/lib/serviceitem.py | 1 - openlp/core/lib/ui.py | 3 +++ openlp/core/ui/pluginform.py | 13 +++++-------- openlp/core/ui/settingsdialog.py | 1 - openlp/core/ui/themeform.py | 2 +- openlp/core/ui/thememanager.py | 1 - openlp/core/ui/wizard.py | 6 ++---- openlp/plugins/alerts/forms/alertdialog.py | 4 ++-- openlp/plugins/alerts/forms/alertform.py | 6 +++--- openlp/plugins/bibles/forms/bibleimportform.py | 2 +- openlp/plugins/images/lib/mediaitem.py | 13 +++++-------- openlp/plugins/media/lib/mediaitem.py | 13 +++++-------- openlp/plugins/songs/forms/songimportform.py | 2 +- openlp/plugins/songs/lib/mediaitem.py | 4 ++-- openlp/plugins/songs/lib/songshowplusimport.py | 3 +-- 17 files changed, 33 insertions(+), 45 deletions(-) diff --git a/openlp/core/lib/mediamanageritem.py b/openlp/core/lib/mediamanageritem.py index 0bb765c6e..6f446619e 100644 --- a/openlp/core/lib/mediamanageritem.py +++ b/openlp/core/lib/mediamanageritem.py @@ -253,7 +253,6 @@ class MediaManagerItem(QtGui.QWidget): self.pageLayout.addWidget(self.listView) # define and add the context menu self.listView.setContextMenuPolicy(QtCore.Qt.ActionsContextMenu) - name_string = self.plugin.getString(StringContent.Name) if self.hasEditIcon: self.listView.addAction( context_menu_action( diff --git a/openlp/core/lib/plugin.py b/openlp/core/lib/plugin.py index a073d31ea..1b58ec71c 100644 --- a/openlp/core/lib/plugin.py +++ b/openlp/core/lib/plugin.py @@ -339,6 +339,7 @@ class Plugin(QtCore.QObject): """ Called to define all translatable texts of the plugin """ + self.nameStrings = self.textStrings[StringContent.Name] ## Load Action ## self._setSingularTextString(StringContent.Load, UiStrings.Load, UiStrings.LoadANew) @@ -368,4 +369,4 @@ class Plugin(QtCore.QObject): after this has been set. """ self.textStrings[name] = { u'title': title, u'tooltip': tooltip % - self.getString(StringContent.Name)[u'singular']} + self.nameStrings[u'singular']} diff --git a/openlp/core/lib/serviceitem.py b/openlp/core/lib/serviceitem.py index 1b5261773..92c82087f 100644 --- a/openlp/core/lib/serviceitem.py +++ b/openlp/core/lib/serviceitem.py @@ -433,7 +433,6 @@ class ServiceItem(object): """ Returns the start and finish time for a media item """ - tooltip = None start = None end = None if self.start_time != 0: diff --git a/openlp/core/lib/ui.py b/openlp/core/lib/ui.py index 196a8567f..0e5fcfd08 100644 --- a/openlp/core/lib/ui.py +++ b/openlp/core/lib/ui.py @@ -66,6 +66,7 @@ class UiStrings(object): ImportType = unicode(translate('OpenLP.Ui', 'Import %s')) LengthTime = unicode(translate('OpenLP.Ui', 'Length %s')) Live = translate('OpenLP.Ui', 'Live') + LiveBGError = translate('OpenLP.Ui', 'Live Background Error') LivePanel = translate('OpenLP.Ui', 'Live Panel') Load = translate('OpenLP.Ui', 'Load') LoadANew = unicode(translate('OpenLP.Ui', 'Load a new %s.')) @@ -82,6 +83,8 @@ class UiStrings(object): Preview = translate('OpenLP.Ui', 'Preview') PreviewPanel = translate('OpenLP.Ui', 'Preview Panel') PreviewSelect = unicode(translate('OpenLP.Ui', 'Preview the selected %s.')) + ProbReplaceBG = unicode(translate('OpenLP.Ui', 'There was a problem ' + 'replacing your background, the %s file "%s" no longer exists.')) ReplaceBG = translate('OpenLP.Ui', 'Replace Background') ReplaceLiveBG = translate('OpenLP.Ui', 'Replace Live Background') ResetBG = translate('OpenLP.Ui', 'Reset Background') diff --git a/openlp/core/ui/pluginform.py b/openlp/core/ui/pluginform.py index 6318a44a5..f8bfe4713 100644 --- a/openlp/core/ui/pluginform.py +++ b/openlp/core/ui/pluginform.py @@ -28,7 +28,7 @@ import logging from PyQt4 import QtCore, QtGui -from openlp.core.lib import PluginStatus, Receiver, StringContent, translate +from openlp.core.lib import PluginStatus, Receiver, translate from plugindialog import Ui_PluginViewDialog log = logging.getLogger(__name__) @@ -80,15 +80,14 @@ class PluginForm(QtGui.QDialog, Ui_PluginViewDialog): # PluginStatus.Inactive status_text = unicode( translate('OpenLP.PluginForm', '%s (Inactive)')) - name_string = plugin.getString(StringContent.Name) - item.setText(status_text % name_string[u'singular']) + item.setText(status_text % plugin.nameStrings[u'singular']) # If the plugin has an icon, set it! if plugin.icon: item.setIcon(plugin.icon) self.pluginListWidget.addItem(item) pluginListWidth = max(pluginListWidth, self.fontMetrics().width( unicode(translate('OpenLP.PluginForm', '%s (Inactive)')) % - name_string[u'singular'])) + plugin.nameStrings[u'singular'])) self.pluginListWidget.setFixedWidth(pluginListWidth + self.pluginListWidget.iconSize().width() + 48) @@ -118,8 +117,7 @@ class PluginForm(QtGui.QDialog, Ui_PluginViewDialog): self.pluginListWidget.currentItem().text().split(u' ')[0] self.activePlugin = None for plugin in self.parent.pluginManager.plugins: - name_string = plugin.getString(StringContent.Name) - if name_string[u'singular'] == plugin_name_singular: + if plugin.nameStrings[u'singular'] == plugin_name_singular: self.activePlugin = plugin break if self.activePlugin: @@ -147,6 +145,5 @@ class PluginForm(QtGui.QDialog, Ui_PluginViewDialog): elif self.activePlugin.status == PluginStatus.Disabled: status_text = unicode( translate('OpenLP.PluginForm', '%s (Disabled)')) - name_string = self.activePlugin.getString(StringContent.Name) self.pluginListWidget.currentItem().setText( - status_text % name_string[u'singular']) + status_text % self.activePlugin.nameStrings[u'singular']) diff --git a/openlp/core/ui/settingsdialog.py b/openlp/core/ui/settingsdialog.py index 99acadc14..41b6baccb 100644 --- a/openlp/core/ui/settingsdialog.py +++ b/openlp/core/ui/settingsdialog.py @@ -36,7 +36,6 @@ class Ui_SettingsDialog(object): settingsDialog.setWindowIcon( build_icon(u':/system/system_settings.png')) self.settingsLayout = QtGui.QVBoxLayout(settingsDialog) - margins = self.settingsLayout.contentsMargins() self.settingsLayout.setObjectName(u'settingsLayout') self.settingsTabWidget = QtGui.QTabWidget(settingsDialog) self.settingsTabWidget.setObjectName(u'settingsTabWidget') diff --git a/openlp/core/ui/themeform.py b/openlp/core/ui/themeform.py index 8e5bddc79..db31daa6c 100644 --- a/openlp/core/ui/themeform.py +++ b/openlp/core/ui/themeform.py @@ -204,7 +204,7 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard): # Do not trigger on start up if self.currentPage != self.welcomePage: self.updateTheme() - frame = self.thememanager.generateImage(self.theme, True) + self.thememanager.generateImage(self.theme, True) def updateLinesText(self, lines): """ diff --git a/openlp/core/ui/thememanager.py b/openlp/core/ui/thememanager.py index 8dcc2454e..24571882f 100644 --- a/openlp/core/ui/thememanager.py +++ b/openlp/core/ui/thememanager.py @@ -314,7 +314,6 @@ class ThemeManager(QtGui.QWidget): translate('OpenLP.ThemeManager', 'You must select a theme to edit.')): item = self.themeListWidget.currentItem() - themeName = unicode(item.text()) theme = self.getThemeData( unicode(item.data(QtCore.Qt.UserRole).toString())) if theme.background_type == u'image': diff --git a/openlp/core/ui/wizard.py b/openlp/core/ui/wizard.py index 9a6324d6a..c72d6a084 100644 --- a/openlp/core/ui/wizard.py +++ b/openlp/core/ui/wizard.py @@ -31,8 +31,7 @@ import os from PyQt4 import QtCore, QtGui -from openlp.core.lib import build_icon, Receiver, SettingsManager, translate, \ - StringContent +from openlp.core.lib import build_icon, Receiver, SettingsManager, translate from openlp.core.lib.ui import UiStrings, add_welcome_page log = logging.getLogger(__name__) @@ -91,7 +90,6 @@ class OpenLPWizard(QtGui.QWizard): QtGui.QWizard.__init__(self, parent) self.plugin = plugin self.setObjectName(name) - self.itemType = self.plugin.getString(StringContent.Name) self.direction = direction self.openIcon = build_icon(u':/general/general_open.png') self.deleteIcon = build_icon(u':/general/general_delete.png') @@ -124,7 +122,7 @@ class OpenLPWizard(QtGui.QWizard): Provides generic wizard localisation """ self.titleLabel.setText(WizardStrings.Welcome % - (self.itemType[u'singular'], self.direction)) + (self.plugin.nameStrings[u'singular'], self.direction)) def registerFields(self): """ diff --git a/openlp/plugins/alerts/forms/alertdialog.py b/openlp/plugins/alerts/forms/alertdialog.py index 12f5c04be..11596b700 100644 --- a/openlp/plugins/alerts/forms/alertdialog.py +++ b/openlp/plugins/alerts/forms/alertdialog.py @@ -26,7 +26,7 @@ from PyQt4 import QtCore, QtGui -from openlp.core.lib import StringContent, build_icon, translate +from openlp.core.lib import build_icon, translate from openlp.core.lib.ui import create_delete_push_button class Ui_AlertDialog(object): @@ -67,7 +67,7 @@ class Ui_AlertDialog(object): self.saveButton.setObjectName(u'saveButton') self.manageButtonLayout.addWidget(self.saveButton) self.deleteButton = create_delete_push_button(alertDialog, - self.parent.getString(StringContent.Name)[u'singular'].toLower()) + self.parent.nameStrings[u'singular'].toLower()) self.deleteButton.setEnabled(False) self.manageButtonLayout.addWidget(self.deleteButton) self.manageButtonLayout.addStretch() diff --git a/openlp/plugins/alerts/forms/alertform.py b/openlp/plugins/alerts/forms/alertform.py index bd4c8e735..f2594d44a 100644 --- a/openlp/plugins/alerts/forms/alertform.py +++ b/openlp/plugins/alerts/forms/alertform.py @@ -26,7 +26,7 @@ from PyQt4 import QtGui, QtCore -from openlp.core.lib import translate, StringContent +from openlp.core.lib import translate from openlp.core.lib.ui import UiStrings from openlp.plugins.alerts.lib.db import AlertItem @@ -96,8 +96,8 @@ class AlertForm(QtGui.QDialog, Ui_AlertDialog): def onNewClick(self): if len(self.alertTextEdit.text()) == 0: - QtGui.QMessageBox.information(self, UiStrings.NewType % - self.plugin.getString(StringContent.Name)[u'singular'], + QtGui.QMessageBox.information(self, + UiStrings.NewType % self.plugin.nameStrings[u'singular'], translate('AlertsPlugin.AlertForm', 'You haven\'t specified ' 'any text for your alert. Please type in some text before ' 'clicking New.')) diff --git a/openlp/plugins/bibles/forms/bibleimportform.py b/openlp/plugins/bibles/forms/bibleimportform.py index 7854a7096..b27d12a44 100644 --- a/openlp/plugins/bibles/forms/bibleimportform.py +++ b/openlp/plugins/bibles/forms/bibleimportform.py @@ -365,7 +365,7 @@ class BibleImportForm(OpenLPWizard): self.setWindowTitle( translate('BiblesPlugin.ImportWizardForm', 'Bible Import Wizard')) self.informationLabel.setText(WizardStrings.Description % ( - self.direction.toLower(), self.itemType[u'plural'], + self.direction.toLower(), self.plugin.nameStrings[u'plural'], self.direction.toLower())) self.selectPage.setTitle(WizardStrings.ImportSelect) self.selectPage.setSubTitle(WizardStrings.ImportSelectLong) diff --git a/openlp/plugins/images/lib/mediaitem.py b/openlp/plugins/images/lib/mediaitem.py index ef5b6174a..556fff22b 100644 --- a/openlp/plugins/images/lib/mediaitem.py +++ b/openlp/plugins/images/lib/mediaitem.py @@ -31,7 +31,7 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import MediaManagerItem, build_icon, ItemCapabilities, \ SettingsManager, translate, check_item_selected, check_directory_exists, \ - Receiver, StringContent + Receiver from openlp.core.lib.ui import UiStrings, critical_error_message_box from openlp.core.utils import AppLocation, delete_file, get_images_filter @@ -125,8 +125,7 @@ class ImageMediaItem(MediaManagerItem): def generateSlideData(self, service_item, item=None, xmlVersion=False): items = self.listView.selectedIndexes() if items: - service_item.title = unicode( - self.plugin.getString(StringContent.Name)[u'plural']) + service_item.title = unicode(self.plugin.nameStrings[u'plural']) service_item.add_capability(ItemCapabilities.AllowsMaintain) service_item.add_capability(ItemCapabilities.AllowsPreview) service_item.add_capability(ItemCapabilities.AllowsLoop) @@ -198,8 +197,6 @@ class ImageMediaItem(MediaManagerItem): self.parent.liveController.display.directImage(name, filename) self.resetAction.setVisible(True) else: - critical_error_message_box( - translate('ImagePlugin.MediaItem', 'Live Background Error'), - unicode(translate('ImagePlugin.MediaItem', - 'There was a problem replacing your background, ' - 'the image file "%s" no longer exists.')) % filename) + critical_error_message_box(UiStrings.LiveBGError, + UiStrings.ProbReplaceBG % ( + self.plugin.nameStrings[u'singular'].toLower(), filename)) diff --git a/openlp/plugins/media/lib/mediaitem.py b/openlp/plugins/media/lib/mediaitem.py index e50740be9..d57af14cf 100644 --- a/openlp/plugins/media/lib/mediaitem.py +++ b/openlp/plugins/media/lib/mediaitem.py @@ -30,7 +30,7 @@ import os from PyQt4 import QtCore, QtGui from openlp.core.lib import MediaManagerItem, build_icon, ItemCapabilities, \ - SettingsManager, translate, check_item_selected, Receiver, StringContent + SettingsManager, translate, check_item_selected, Receiver from openlp.core.lib.ui import UiStrings, critical_error_message_box log = logging.getLogger(__name__) @@ -107,11 +107,9 @@ class MediaMediaItem(MediaManagerItem): self.parent.liveController.display.video(filename, 0, True) self.resetAction.setVisible(True) else: - critical_error_message_box(translate('MediaPlugin.MediaItem', - 'Live Background Error'), - unicode(translate('MediaPlugin.MediaItem', - 'There was a problem replacing your background, ' - 'the media file "%s" no longer exists.')) % filename) + critical_error_message_box(UiStrings.LiveBGError, + UiStrings.ProbReplaceBG % ( + self.plugin.nameStrings[u'singular'].toLower(), filename)) def generateSlideData(self, service_item, item=None, xmlVersion=False): if item is None: @@ -120,8 +118,7 @@ class MediaMediaItem(MediaManagerItem): return False filename = unicode(item.data(QtCore.Qt.UserRole).toString()) if os.path.exists(filename): - service_item.title = unicode( - self.plugin.getString(StringContent.Name)[u'singular']) + service_item.title = unicode(self.plugin.nameStrings[u'singular']) service_item.add_capability(ItemCapabilities.RequiresMedia) service_item.add_capability(ItemCapabilities.AllowsVarableStartTime) # force a nonexistent theme diff --git a/openlp/plugins/songs/forms/songimportform.py b/openlp/plugins/songs/forms/songimportform.py index 40ab0fc3d..dacba36aa 100644 --- a/openlp/plugins/songs/forms/songimportform.py +++ b/openlp/plugins/songs/forms/songimportform.py @@ -209,7 +209,7 @@ class SongImportForm(OpenLPWizard): self.setWindowTitle( translate('SongsPlugin.ImportWizardForm', 'Song Import Wizard')) self.informationLabel.setText(WizardStrings.Description % ( - self.direction.toLower(), self.itemType[u'plural'], + self.direction.toLower(), self.plugin.nameStrings[u'plural'], self.direction.toLower())) self.sourcePage.setTitle(WizardStrings.ImportSelect) self.sourcePage.setSubTitle(WizardStrings.ImportSelectLong) diff --git a/openlp/plugins/songs/lib/mediaitem.py b/openlp/plugins/songs/lib/mediaitem.py index ccfb8df90..30b1060bf 100644 --- a/openlp/plugins/songs/lib/mediaitem.py +++ b/openlp/plugins/songs/lib/mediaitem.py @@ -32,7 +32,7 @@ from PyQt4 import QtCore, QtGui from sqlalchemy.sql import or_ from openlp.core.lib import MediaManagerItem, Receiver, ItemCapabilities, \ - translate, check_item_selected, PluginStatus, StringContent + translate, check_item_selected, PluginStatus from openlp.core.lib.searchedit import SearchEdit from openlp.core.lib.ui import UiStrings from openlp.plugins.songs.forms import EditSongForm, SongMaintenanceForm, \ @@ -138,7 +138,7 @@ class SongMediaItem(MediaManagerItem): self.searchTextLabel.setText(u'%s:' % UiStrings.Search) self.searchTextButton.setText(UiStrings.Search) self.maintenanceAction.setText(SongStrings.TypeMaintenance % - self.plugin.getString(StringContent.Name)[u'singular']) + self.plugin.nameStrings[u'singular']) self.maintenanceAction.setToolTip(translate('SongsPlugin.MediaItem', 'Maintain the lists of authors, topics and books')) diff --git a/openlp/plugins/songs/lib/songshowplusimport.py b/openlp/plugins/songs/lib/songshowplusimport.py index 289fd2860..d39557bb5 100644 --- a/openlp/plugins/songs/lib/songshowplusimport.py +++ b/openlp/plugins/songs/lib/songshowplusimport.py @@ -108,7 +108,6 @@ class SongShowPlusImport(SongImport): self.import_wizard.progressBar.setMaximum(len(self.import_source)) for file in self.import_source: author = u'' - copyright = u'' self.sspVerseOrderList = [] otherCount = 0 otherList = {} @@ -203,7 +202,7 @@ class SongShowPlusImport(SongImport): elif verseType == "bridge": verseTag = "B" else: - if not self.otherList.has_key(verseName): + if not self.otherList.has_key(verseName): self.otherCount = self.otherCount + 1 self.otherList[verseName] = str(self.otherCount) verseTag = "O" From 4c0928699df3ec647f541f3470808b3a5cc9f6c5 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Mon, 14 Feb 2011 19:52:05 +0000 Subject: [PATCH 028/123] Print Dialog fixes --- openlp.pyw | 3 ++- openlp/core/ui/mainwindow.py | 5 +++-- openlp/core/ui/printserviceorderform.py | 6 ++++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/openlp.pyw b/openlp.pyw index 100c3336f..d425a0b37 100755 --- a/openlp.pyw +++ b/openlp.pyw @@ -188,7 +188,8 @@ class OpenLP(QtGui.QApplication): u'primary': (self.desktop().primaryScreen() == screen)}) log.info(u'Screen %d found with resolution %s', screen, size) # start the main app window - self.mainWindow = MainWindow(screens, app_version) + self.appClipboard = self.clipboard() + self.mainWindow = MainWindow(screens, app_version, self.appClipboard) self.mainWindow.show() if show_splash: # now kill the splashscreen diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index 4840ef5da..f498c1bc3 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -240,7 +240,7 @@ class Ui_MainWindow(object): languageItem.setChecked(True) add_actions(self.LanguageGroup, [languageItem]) self.SettingsShortcutsItem = icon_action(mainWindow, - u'SettingsShortcutsItem', + u'SettingsShortcutsItem', u':/system/system_configure_shortcuts.png') self.SettingsConfigureItem = icon_action(mainWindow, u'SettingsConfigureItem', u':/system/system_settings.png') @@ -458,7 +458,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): actionList = ActionList() - def __init__(self, screens, applicationVersion): + def __init__(self, screens, applicationVersion, clipboard): """ This constructor sets up the interface, the various managers, and the plugins. @@ -467,6 +467,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): self.screens = screens self.actionList = ActionList() self.applicationVersion = applicationVersion + self.clipboard = clipboard # Set up settings sections for the main application # (not for use by plugins) self.uiSettingsSection = u'user interface' diff --git a/openlp/core/ui/printserviceorderform.py b/openlp/core/ui/printserviceorderform.py index 70128cb89..cad654280 100644 --- a/openlp/core/ui/printserviceorderform.py +++ b/openlp/core/ui/printserviceorderform.py @@ -37,6 +37,7 @@ class PrintServiceOrderForm(QtGui.QDialog, Ui_PrintServiceOrderDialog): Constructor """ QtGui.QDialog.__init__(self, parent) + self.parent = parent self.serviceManager = serviceManager self.printer = QtGui.QPrinter() self.printDialog = QtGui.QPrintDialog(self.printer, self) @@ -86,14 +87,14 @@ class PrintServiceOrderForm(QtGui.QDialog, Ui_PrintServiceOrderDialog): for item in self.serviceManager.serviceItems: item = item[u'service_item'] # Add the title of the service item. - text += u'

%s

' % (item.icon, + text += u'

%s

' % (item.icon, item.get_display_title()) # Add slide text of the service item. if self.printSlideTextCheckBox.isChecked(): if item.is_text(): # Add the text of the service item. for slide in item.get_frames(): - text += u'

' + slide[u'text'] + u'

' + text += u'

' + slide[u'html'] + u'

' elif item.is_image(): # Add the image names of the service item. text += u'
    ' @@ -120,6 +121,7 @@ class PrintServiceOrderForm(QtGui.QDialog, Ui_PrintServiceOrderDialog): u'Custom Service Notes:'), self.customNoteEdit.toPlainText()) self.document.setHtml(text) self.previewWidget.updatePreview() + self.parent.clipboard.setText(text) def paintRequested(self, printer): """ From a0aba0a715a95d4bd36953d9b35a05f112b24d4e Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Tue, 15 Feb 2011 14:17:35 +0000 Subject: [PATCH 029/123] Remove grammar breaking strings --- openlp/core/ui/wizard.py | 11 +---------- openlp/plugins/songs/lib/ui.py | 11 ----------- 2 files changed, 1 insertion(+), 21 deletions(-) diff --git a/openlp/core/ui/wizard.py b/openlp/core/ui/wizard.py index c72d6a084..b3b4f9233 100644 --- a/openlp/core/ui/wizard.py +++ b/openlp/core/ui/wizard.py @@ -47,7 +47,6 @@ class WizardStrings(object): CSV = u'CSV' EW = u'EasyWorship' ES = u'EasiSlides' - GDP = translate('OpenLP.Ui', 'Generic Document or Presentation') OL = u'OpenLyrics' OS = u'OpenSong' OSIS = u'OSIS' @@ -56,14 +55,9 @@ class WizardStrings(object): SSP = u'SongShow Plus' WoW = u'Words of Worship' # These strings should need a good reason to be retranslated elsewhere. - Description = unicode(translate('OpenLP.Ui', 'This wizard will help you ' - 'to %s %s from a variety of formats. Click the next button ' - 'below to start the process by selecting a format to %s from.', - 'Variable 1 & 3 are import/export. Variable 2 is a type like Bibles')) - FinishedType = unicode(translate('OpenLP.Ui', 'Finished %s.')) FormatLabel = translate('OpenLP.Ui', 'Format:') Importing = translate('OpenLP.Ui', 'Importing') - ImportingType = unicode(translate('OpenLP.Ui', 'Importing %s...')) + ImportingType = unicode(translate('OpenLP.Ui', 'Importing "%s"...')) ImportSelect = translate('OpenLP.Ui', 'Select Import Source') ImportSelectLong = unicode(translate('OpenLP.Ui', 'Select the import format and the location to import from.')) @@ -74,9 +68,6 @@ class WizardStrings(object): OpenTypeFile = unicode(translate('OpenLP.Ui', 'Open %s File')) Ready = translate('OpenLP.Ui', 'Ready.') StartingImport = translate('OpenLP.Ui', 'Starting import...') - Welcome = u'%s' % \ - translate('OpenLP.Ui', 'Welcome to the %s %s Wizard', - 'Variable 1 is the type e.g. Bible and variable 2 is import/export') YouSpecifyFile = unicode(translate('OpenLP.Ui', 'You need to specify at ' 'least one %s file to import from.', 'A file type e.g. OpenSong')) diff --git a/openlp/plugins/songs/lib/ui.py b/openlp/plugins/songs/lib/ui.py index beab16dd0..85d609762 100644 --- a/openlp/plugins/songs/lib/ui.py +++ b/openlp/plugins/songs/lib/ui.py @@ -38,18 +38,7 @@ class SongStrings(object): Authors = translate('OpenLP.Ui', 'Authors', 'Plural') AuthorUnknown = translate('OpenLP.Ui', 'Author Unknown') # Used in the UI. AuthorUnknownUnT = u'Author Unknown' # Used to populate the database. - CouldNotAdd = unicode(translate('OpenLP.Ui', 'Could not add your %s.')) - NoDeleteAssigned = unicode(translate('OpenLP.Ui', 'This %s cannot be ' - 'deleted as it is currently assigned to at least one song.')) SongBook = translate('OpenLP.Ui', 'Song Book', 'Singular') SongBooks = translate('OpenLP.Ui', 'Song Books', 'Plural') - SureDeleteType = unicode(translate('OpenLP.Ui', - 'Are you sure you want to delete the selected %s?')) - ThisTypeExists = unicode(translate('OpenLP.Ui', 'This %s already exists.')) Topic = translate('OpenLP.Ui', 'Topic', 'Singular') Topics = translate('OpenLP.Ui', 'Topics', 'Plural') - TypeInList = unicode(translate('OpenLP.Ui', - 'This %s is already in the list.')) - TypeMaintenance = unicode(translate('OpenLP.Ui', '%s Maintenance')) - TypeNotExistAdd = unicode(translate('OpenLP.Ui', - 'This %s does not exist, do you want to add it?')) From f980d1e0b9503e00f579d6b636ca49be83ca071f Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Tue, 15 Feb 2011 18:51:37 +0000 Subject: [PATCH 030/123] Finish Print dialog updates --- openlp/core/lib/ui.py | 2 ++ openlp/core/ui/printserviceorderdialog.py | 19 ++++++++--- openlp/core/ui/printserviceorderform.py | 41 +++++++++++++++++++++-- 3 files changed, 56 insertions(+), 6 deletions(-) diff --git a/openlp/core/lib/ui.py b/openlp/core/lib/ui.py index 400381b0c..224145a99 100644 --- a/openlp/core/lib/ui.py +++ b/openlp/core/lib/ui.py @@ -48,6 +48,8 @@ class UiStrings(object): AllFiles = translate('OpenLP.Ui', 'All Files') Authors = translate('OpenLP.Ui', 'Authors') CreateANew = unicode(translate('OpenLP.Ui', 'Create a new %s.')) + CopyToHtml = translate('OpenLP.Ui', 'Copy to Html') + CopyToText = translate('OpenLP.Ui', 'Copy to Text') Delete = translate('OpenLP.Ui', '&Delete') DeleteSelect = unicode(translate('OpenLP.Ui', 'Delete the selected %s.')) DeleteType = unicode(translate('OpenLP.Ui', 'Delete %s')) diff --git a/openlp/core/ui/printserviceorderdialog.py b/openlp/core/ui/printserviceorderdialog.py index f8db4d1c0..c464a7814 100644 --- a/openlp/core/ui/printserviceorderdialog.py +++ b/openlp/core/ui/printserviceorderdialog.py @@ -27,6 +27,7 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import build_icon, translate, SpellTextEdit +from openlp.core.lib.ui import UiStrings class Ui_PrintServiceOrderDialog(object): def setupUi(self, printServiceOrderDialog): @@ -75,6 +76,9 @@ class Ui_PrintServiceOrderDialog(object): self.printMetaDataCheckBox = QtGui.QCheckBox(printServiceOrderDialog) self.printMetaDataCheckBox.setObjectName(u'printMetaDataCheckBox') self.settingsLayout.addWidget(self.printMetaDataCheckBox) + self.copyMetaDataCheckBox = QtGui.QCheckBox(printServiceOrderDialog) + self.copyMetaDataCheckBox.setObjectName(u'copyMetaDataCheckBox') + self.settingsLayout.addWidget(self.copyMetaDataCheckBox) spacerItem = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) self.settingsLayout.addItem(spacerItem) @@ -90,12 +94,15 @@ class Ui_PrintServiceOrderDialog(object): spacerItem = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) self.buttonLayout.addItem(spacerItem) - self.cancelButton = QtGui.QPushButton(printServiceOrderDialog) - self.cancelButton.setObjectName(u'cancelButton') - self.buttonLayout.addWidget(self.cancelButton) + self.copyTextButton = QtGui.QPushButton(printServiceOrderDialog) + self.copyTextButton.setObjectName(u'copyTextButton') + self.buttonLayout.addWidget(self.copyTextButton) self.printButton = QtGui.QPushButton(printServiceOrderDialog) self.printButton.setObjectName(u'printButton') self.buttonLayout.addWidget(self.printButton) + self.cancelButton = QtGui.QPushButton(printServiceOrderDialog) + self.cancelButton.setObjectName(u'cancelButton') + self.buttonLayout.addWidget(self.cancelButton) self.dialogLayout.addLayout(self.buttonLayout, 1, 3, 1, 1) self.zoomButtonLayout = QtGui.QHBoxLayout() self.zoomButtonLayout.setObjectName(u'zoomButtonLayout') @@ -119,7 +126,7 @@ class Ui_PrintServiceOrderDialog(object): printServiceOrderDialog.setWindowTitle( translate('OpenLP.PrintServiceOrderForm', 'Print Service Order')) self.previewLabel.setText( - translate('OpenLP.ServiceManager', 'Preview:')) + translate('OpenLP.PrintServiceOrderForm', 'Preview:')) self.printSlideTextCheckBox.setText(translate( 'OpenLP.PrintServiceOrderForm', 'Include slide text if available')) self.printNotesCheckBox.setText(translate( @@ -127,10 +134,14 @@ class Ui_PrintServiceOrderDialog(object): self.printMetaDataCheckBox.setText( translate('OpenLP.PrintServiceOrderForm', 'Include play length of media items')) + self.copyMetaDataCheckBox.setText( + translate('OpenLP.PrintServiceOrderForm', + 'Copy output as HTML')) self.serviceTitleLabel.setText(translate( 'OpenLP.PrintServiceOrderForm', 'Title:')) self.serviceTitleLineEdit.setText(translate('OpenLP.ServiceManager', 'Service Order Sheet')) + self.copyTextButton.setText(UiStrings.CopyToText) self.printButton.setText(translate('OpenLP.ServiceManager', 'Print')) self.cancelButton.setText(translate('OpenLP.ServiceManager', 'Cancel')) self.customNotesLabel.setText( diff --git a/openlp/core/ui/printserviceorderform.py b/openlp/core/ui/printserviceorderform.py index cad654280..78ff34e1c 100644 --- a/openlp/core/ui/printserviceorderform.py +++ b/openlp/core/ui/printserviceorderform.py @@ -29,9 +29,11 @@ import os from PyQt4 import QtCore, QtGui from openlp.core.lib import translate +from openlp.core.lib.ui import UiStrings from openlp.core.ui.printserviceorderdialog import Ui_PrintServiceOrderDialog class PrintServiceOrderForm(QtGui.QDialog, Ui_PrintServiceOrderDialog): + def __init__(self, parent, serviceManager): """ Constructor @@ -52,6 +54,10 @@ class PrintServiceOrderForm(QtGui.QDialog, Ui_PrintServiceOrderDialog): u'print file meta data', QtCore.QVariant(False)).toBool()) self.printNotesCheckBox.setChecked(settings.value( u'print notes', QtCore.QVariant(False)).toBool()) + self.copyMetaDataCheckBox.setChecked(settings.value( + u'html copy', QtCore.QVariant(False)).toBool()) + if self.copyMetaDataCheckBox.isChecked(): + self.copyTextButton.setText(UiStrings.CopyToHtml) settings.endGroup() # Signals QtCore.QObject.connect(self.printButton, @@ -75,6 +81,10 @@ class PrintServiceOrderForm(QtGui.QDialog, Ui_PrintServiceOrderDialog): QtCore.SIGNAL(u'textChanged()'), self.updatePreviewText) QtCore.QObject.connect(self.cancelButton, QtCore.SIGNAL(u'clicked()'), self.reject) + QtCore.QObject.connect(self.copyTextButton, + QtCore.SIGNAL(u'clicked()'), self.copyText) + QtCore.QObject.connect(self.copyMetaDataCheckBox, + QtCore.SIGNAL(u'stateChanged(int)'), self.updateTextFormat) self.updatePreviewText() def updatePreviewText(self): @@ -93,8 +103,17 @@ class PrintServiceOrderForm(QtGui.QDialog, Ui_PrintServiceOrderDialog): if self.printSlideTextCheckBox.isChecked(): if item.is_text(): # Add the text of the service item. + verse = None for slide in item.get_frames(): - text += u'

    ' + slide[u'html'] + u'

    ' + if not verse: + text += u'

    ' + slide[u'html'] + verse = slide[u'verseTag'] + elif verse != slide[u'verseTag']: + text += u'<\p>

    ' + slide[u'html'] + verse = slide[u'verseTag'] + else: + text += u'
    ' + slide[u'html'] + text += u'

    ' elif item.is_image(): # Add the image names of the service item. text += u'
      ' @@ -121,7 +140,6 @@ class PrintServiceOrderForm(QtGui.QDialog, Ui_PrintServiceOrderDialog): u'Custom Service Notes:'), self.customNoteEdit.toPlainText()) self.document.setHtml(text) self.previewWidget.updatePreview() - self.parent.clipboard.setText(text) def paintRequested(self, printer): """ @@ -132,6 +150,13 @@ class PrintServiceOrderForm(QtGui.QDialog, Ui_PrintServiceOrderDialog): """ self.document.print_(printer) + def copyText(self): + if self.copyMetaDataCheckBox.isChecked(): + self.parent.clipboard.setText(self.document.toHtml()) + else: + self.parent.clipboard.setText(self.document.toPlainText()) + self.accept() + def printServiceOrder(self): """ Called, when the *printButton* is clicked. Opens the *printDialog*. @@ -154,6 +179,16 @@ class PrintServiceOrderForm(QtGui.QDialog, Ui_PrintServiceOrderDialog): """ self.previewWidget.zoomOut() + def updateTextFormat(self, value): + """ + Called when html copy check box is selected. + """ + if value == QtCore.Qt.Checked: + self.copyTextButton.setText(UiStrings.CopyToHtml) + else: + self.copyTextButton.setText(UiStrings.CopyToText) + + def accept(self): """ Save the settings and close the dialog. @@ -167,6 +202,8 @@ class PrintServiceOrderForm(QtGui.QDialog, Ui_PrintServiceOrderDialog): QtCore.QVariant(self.printMetaDataCheckBox.isChecked())) settings.setValue(u'print notes', QtCore.QVariant(self.printNotesCheckBox.isChecked())) + settings.setValue(u'html copy', + QtCore.QVariant(self.copyMetaDataCheckBox.isChecked())) settings.endGroup() # Close the dialog. return QtGui.QDialog.accept(self) From 33a77b72f784a0d9d62a580beff6aaa9ff72a2f9 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Tue, 15 Feb 2011 19:26:43 +0000 Subject: [PATCH 031/123] Fixes --- openlp/core/lib/ui.py | 2 +- openlp/core/ui/printserviceorderform.py | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/openlp/core/lib/ui.py b/openlp/core/lib/ui.py index 8a1bf828f..27c510eb2 100644 --- a/openlp/core/lib/ui.py +++ b/openlp/core/lib/ui.py @@ -44,7 +44,7 @@ class UiStrings(object): Advanced = translate('OpenLP.Ui', 'Advanced') AllFiles = translate('OpenLP.Ui', 'All Files') Authors = translate('OpenLP.Ui', 'Authors') - CopyToHtml = translate('OpenLP.Ui', 'Copy to Html') + CopyToHtml = translate('OpenLP.Ui', 'Copy to HTML') CopyToText = translate('OpenLP.Ui', 'Copy to Text') CreateService = translate('OpenLP.Ui', 'Create a new service.') Delete = translate('OpenLP.Ui', '&Delete') diff --git a/openlp/core/ui/printserviceorderform.py b/openlp/core/ui/printserviceorderform.py index 0fca2c297..cfd0f7a52 100644 --- a/openlp/core/ui/printserviceorderform.py +++ b/openlp/core/ui/printserviceorderform.py @@ -187,7 +187,6 @@ class PrintServiceOrderForm(QtGui.QDialog, Ui_PrintServiceOrderDialog): else: self.copyTextButton.setText(UiStrings.CopyToText) - def accept(self): """ Save the settings and close the dialog. From f27e6755cc9e040852f41e8f9354e1e3f415af81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20P=C3=B5ldaru?= Date: Tue, 15 Feb 2011 23:19:45 +0200 Subject: [PATCH 032/123] easislides import to work again --- openlp/plugins/songs/lib/easislidesimport.py | 43 +++++++------------- 1 file changed, 15 insertions(+), 28 deletions(-) diff --git a/openlp/plugins/songs/lib/easislidesimport.py b/openlp/plugins/songs/lib/easislidesimport.py index 5d56af8ce..b31e50862 100644 --- a/openlp/plugins/songs/lib/easislidesimport.py +++ b/openlp/plugins/songs/lib/easislidesimport.py @@ -81,14 +81,16 @@ class EasiSlidesImport(SongImport): def _parse_song(self, song): self._success = True - self._add_unicode_attribute(self.title, song.Title1, True) - self._add_unicode_attribute(self.alternate_title, song.Title2) - self._add_unicode_attribute(self.song_number, song.SongNumber) + self._add_unicode_attribute(u'title', song.Title1, True) + self._add_unicode_attribute(u'alternate_title', song.Title2) + self._add_unicode_attribute(u'song_number', song.SongNumber) if self.song_number == u'0': self.song_number = u'' self._add_authors(song) - self._add_copyright(song) - self._add_unicode_attribute(self.song_book_name, song.BookReference) + self._add_copyright(song.Copyright) + self._add_copyright(song.LicenceAdmin1) + self._add_copyright(song.LicenceAdmin2) + self._add_unicode_attribute(u'song_book_name', song.BookReference) self._parse_and_add_lyrics(song) return self._success @@ -110,7 +112,7 @@ class EasiSlidesImport(SongImport): Signals that this attribute must exist in a valid song. """ try: - self_attribute = unicode(import_attribute).strip() + setattr(self, self_attribute, unicode(import_attribute).strip()) except UnicodeDecodeError: log.exception(u'UnicodeDecodeError decoding %s' % import_attribute) self._success = False @@ -124,7 +126,7 @@ class EasiSlidesImport(SongImport): authors = unicode(song.Writer).split(u',') for author in authors: author = author.strip() - if len(author) > 0: + if len(author): self.authors.append(author) except UnicodeDecodeError: log.exception(u'Unicode decode error while decoding Writer') @@ -132,35 +134,18 @@ class EasiSlidesImport(SongImport): except AttributeError: pass - def _add_copyright(self, song): - """ - Assign the copyright information from the import to the song being - created. - - ``song`` - The current song being imported. - """ - copyright_list = [] - self.__add_copyright_element(copyright_list, song.Copyright) - self.__add_copyright_element(copyright_list, song.LicenceAdmin1) - self.__add_copyright_element(copyright_list, song.LicenceAdmin2) - self.add_copyright(u' '.join(copyright_list)) - - def __add_copyright_element(self, copyright_list, element): + def _add_copyright(self, element): """ Add a piece of copyright to the total copyright information for the song. - ``copyright_list`` - The array to add the information to. - ``element`` The imported variable to get the data from. """ try: - copyright_list.append(unicode(element).strip()) + self.add_copyright(unicode(element).strip()) except UnicodeDecodeError: - log.exception(u'Unicode error decoding %s' % element) + log.exception(u'Unicode error on decoding copyright: %s' % element) self._success = False except AttributeError: pass @@ -285,10 +270,12 @@ class EasiSlidesImport(SongImport): # as these appeared originally in the file for [reg, vt, vn, inst] in our_verse_order: if self._listHas(verses, [reg, vt, vn, inst]): + # this is false, but needs user input + lang = None versetag = u'%s%s' % (vt, vn) versetags.append(versetag) lines = u'\n'.join(verses[reg][vt][vn][inst]) - self.verses.append([versetag, lines]) + self.verses.append([versetag, lines, lang]) SeqTypes = { u'p': u'P1', From a8d2d3661db5abac51da47d35852083967b62c57 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Wed, 16 Feb 2011 03:06:34 +0000 Subject: [PATCH 033/123] Sort grammar breakers --- openlp/core/lib/plugin.py | 2 +- openlp/core/lib/ui.py | 5 +- openlp/core/ui/mainwindow.py | 30 +++++----- openlp/core/ui/themeform.py | 2 +- openlp/core/ui/thememanager.py | 6 +- openlp/core/ui/wizard.py | 10 +--- openlp/plugins/alerts/forms/alertform.py | 3 +- .../plugins/bibles/forms/bibleimportform.py | 15 +++-- openlp/plugins/images/lib/mediaitem.py | 5 +- openlp/plugins/media/lib/mediaitem.py | 5 +- openlp/plugins/songs/forms/authorsdialog.py | 3 +- openlp/plugins/songs/forms/editsongform.py | 24 ++++---- openlp/plugins/songs/forms/songbookdialog.py | 3 +- openlp/plugins/songs/forms/songexportform.py | 5 +- openlp/plugins/songs/forms/songimportform.py | 36 +++++++----- .../songs/forms/songmaintenancedialog.py | 7 +-- .../songs/forms/songmaintenanceform.py | 55 ++++++++++++------- openlp/plugins/songs/forms/topicsdialog.py | 3 +- openlp/plugins/songs/lib/mediaitem.py | 4 +- 19 files changed, 122 insertions(+), 101 deletions(-) diff --git a/openlp/core/lib/plugin.py b/openlp/core/lib/plugin.py index 4f65a924e..39f13c37e 100644 --- a/openlp/core/lib/plugin.py +++ b/openlp/core/lib/plugin.py @@ -144,6 +144,7 @@ class Plugin(QtCore.QObject): self.name = name self.textStrings = {} self.setPluginTextStrings() + self.nameStrings = self.textStrings[StringContent.Name] if version: self.version = version self.settingsSection = self.name.lower() @@ -339,7 +340,6 @@ class Plugin(QtCore.QObject): """ Called to define all translatable texts of the plugin """ - self.nameStrings = self.textStrings[StringContent.Name] ## Load Action ## self.__setNameTextString(StringContent.Load, UiStrings.Load, tooltips[u'load']) diff --git a/openlp/core/lib/ui.py b/openlp/core/lib/ui.py index 59c6cd4d2..1e11133f4 100644 --- a/openlp/core/lib/ui.py +++ b/openlp/core/lib/ui.py @@ -177,7 +177,7 @@ def media_item_combo_box(parent, name): combo.setSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Fixed) return combo -def create_delete_push_button(parent, item_name, icon=None): +def create_delete_push_button(parent, icon=None): """ Creates a standard push button with a delete label and optional icon. The button is connected to the parent's ``onDeleteButtonClicked()`` method to @@ -195,7 +195,8 @@ def create_delete_push_button(parent, item_name, icon=None): delete_icon = icon if icon else u':/general/general_delete.png' delete_button.setIcon(build_icon(delete_icon)) delete_button.setText(UiStrings.Delete) - delete_button.setToolTip(UiStrings.DeleteSelect % item_name) + delete_button.setToolTip( + translate('OpenLP.Ui', 'Delete the selected item.')) QtCore.QObject.connect(delete_button, QtCore.SIGNAL(u'clicked()'), parent.onDeleteButtonClicked) return delete_button diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index fc78fa54c..2ef1f834f 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -364,41 +364,41 @@ class Ui_MainWindow(object): self.ViewMediaManagerItem.setText( translate('OpenLP.MainWindow', '&Media Manager')) self.ViewMediaManagerItem.setToolTip( - UiStrings.ToggleType % UiStrings.MediaManager) - self.ViewMediaManagerItem.setStatusTip( - UiStrings.ToggleVisibility % UiStrings.MediaManager.toLower()) + translate('OpenLP.MainWindow', 'Toggle Media Manager')) + self.ViewMediaManagerItem.setStatusTip(translate('OpenLP.MainWindow', + 'Toggle the visibility of the media manager.')) self.ViewMediaManagerItem.setShortcut( translate('OpenLP.MainWindow', 'F8')) self.ViewThemeManagerItem.setText( translate('OpenLP.MainWindow', '&Theme Manager')) self.ViewThemeManagerItem.setToolTip( - UiStrings.ToggleType % UiStrings.ThemeManager) - self.ViewThemeManagerItem.setStatusTip( - UiStrings.ToggleVisibility % UiStrings.ThemeManager.toLower()) + translate('OpenLP.MainWindow', 'Toggle Theme Manager')) + self.ViewThemeManagerItem.setStatusTip(translate('OpenLP.MainWindow', + 'Toggle the visibility of the theme manager.')) self.ViewThemeManagerItem.setShortcut( translate('OpenLP.MainWindow', 'F10')) self.ViewServiceManagerItem.setText( translate('OpenLP.MainWindow', '&Service Manager')) self.ViewServiceManagerItem.setToolTip( - UiStrings.ToggleType % UiStrings.ServiceManager) - self.ViewServiceManagerItem.setStatusTip( - UiStrings.ToggleVisibility % UiStrings.ServiceManager.toLower()) + translate('OpenLP.MainWindow', 'Toggle Service Manager')) + self.ViewServiceManagerItem.setStatusTip(translate('OpenLP.MainWindow', + 'Toggle the visibility of the service manager.')) self.ViewServiceManagerItem.setShortcut( translate('OpenLP.MainWindow', 'F9')) self.ViewPreviewPanel.setText( translate('OpenLP.MainWindow', '&Preview Panel')) self.ViewPreviewPanel.setToolTip( - UiStrings.ToggleType % UiStrings.PreviewPanel) - self.ViewPreviewPanel.setStatusTip( - UiStrings.ToggleVisibility % UiStrings.PreviewPanel.toLower()) + translate('OpenLP.MainWindow', 'Toggle Preview Panel')) + self.ViewPreviewPanel.setStatusTip(translate('OpenLP.MainWindow', + 'Toggle the visibility of the preview panel.')) self.ViewPreviewPanel.setShortcut( translate('OpenLP.MainWindow', 'F11')) self.ViewLivePanel.setText( translate('OpenLP.MainWindow', '&Live Panel')) self.ViewLivePanel.setToolTip( - UiStrings.ToggleType % UiStrings.LivePanel) - self.ViewLivePanel.setStatusTip( - UiStrings.ToggleVisibility % UiStrings.LivePanel.toLower()) + translate('OpenLP.MainWindow', 'Toggle Live Panel')) + self.ViewLivePanel.setStatusTip(translate('OpenLP.MainWindow', + 'Toggle the visibility of the live panel.')) self.ViewLivePanel.setShortcut( translate('OpenLP.MainWindow', 'F12')) self.settingsPluginListItem.setText(translate('OpenLP.MainWindow', diff --git a/openlp/core/ui/themeform.py b/openlp/core/ui/themeform.py index 06be52dbe..f34e2b8d2 100644 --- a/openlp/core/ui/themeform.py +++ b/openlp/core/ui/themeform.py @@ -301,7 +301,7 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard): 'Edit Theme - %s')) % self.theme.theme_name) self.next() else: - self.setWindowTitle(UiStrings.NewType % UiStrings.Theme) + self.setWindowTitle(translate('OpenLP.ThemeWizard', 'New Theme')) return QtGui.QWizard.exec_(self) def initializePage(self, id): diff --git a/openlp/core/ui/thememanager.py b/openlp/core/ui/thememanager.py index eddc1c3cf..739de7182 100644 --- a/openlp/core/ui/thememanager.py +++ b/openlp/core/ui/thememanager.py @@ -105,7 +105,7 @@ class ThemeManager(QtGui.QWidget): # build the context menu self.menu = QtGui.QMenu() self.editAction = self.menu.addAction( - UiStrings.EditType % UiStrings.Theme) + translate('OpenLP.ThemeManager', '&Edit Theme')) self.editAction.setIcon(build_icon(u':/themes/theme_edit.png')) self.copyAction = self.menu.addAction( translate('OpenLP.ThemeManager', '&Copy Theme')) @@ -114,14 +114,14 @@ class ThemeManager(QtGui.QWidget): translate('OpenLP.ThemeManager', '&Rename Theme')) self.renameAction.setIcon(build_icon(u':/themes/theme_edit.png')) self.deleteAction = self.menu.addAction( - UiStrings.AmpDeleteType % UiStrings.Theme) + translate('OpenLP.ThemeManager', '&Delete Theme')) self.deleteAction.setIcon(build_icon(u':/general/general_delete.png')) self.separator = self.menu.addSeparator() self.globalAction = self.menu.addAction( translate('OpenLP.ThemeManager', 'Set As &Global Default')) self.globalAction.setIcon(build_icon(u':/general/general_export.png')) self.exportAction = self.menu.addAction( - UiStrings.ExportType % UiStrings.Theme) + translate('OpenLP.ThemeManager', '&Export Theme')) self.exportAction.setIcon(build_icon(u':/general/general_export.png')) # Signals QtCore.QObject.connect(self.themeListWidget, diff --git a/openlp/core/ui/wizard.py b/openlp/core/ui/wizard.py index b3b4f9233..7e9511c33 100644 --- a/openlp/core/ui/wizard.py +++ b/openlp/core/ui/wizard.py @@ -56,6 +56,7 @@ class WizardStrings(object): WoW = u'Words of Worship' # These strings should need a good reason to be retranslated elsewhere. FormatLabel = translate('OpenLP.Ui', 'Format:') + Header = u'%s' Importing = translate('OpenLP.Ui', 'Importing') ImportingType = unicode(translate('OpenLP.Ui', 'Importing "%s"...')) ImportSelect = translate('OpenLP.Ui', 'Select Import Source') @@ -63,7 +64,7 @@ class WizardStrings(object): 'Select the import format and the location to import from.')) NoSqlite = translate('OpenLP.Ui', 'The openlp.org 1.x importer has been ' 'disabled due to a missing Python module. If you want to use this ' - 'importer, you will need to install the "python-sqlite" ' + 'importer, you will need to install the "python-sqlite" ' 'module.') OpenTypeFile = unicode(translate('OpenLP.Ui', 'Open %s File')) Ready = translate('OpenLP.Ui', 'Ready.') @@ -108,13 +109,6 @@ class OpenLPWizard(QtGui.QWizard): self.retranslateUi() QtCore.QMetaObject.connectSlotsByName(self) - def retranslateUi(self): - """ - Provides generic wizard localisation - """ - self.titleLabel.setText(WizardStrings.Welcome % - (self.plugin.nameStrings[u'singular'], self.direction)) - def registerFields(self): """ Hook method for wizards to register any fields they need. diff --git a/openlp/plugins/alerts/forms/alertform.py b/openlp/plugins/alerts/forms/alertform.py index f2594d44a..0639f2bb1 100644 --- a/openlp/plugins/alerts/forms/alertform.py +++ b/openlp/plugins/alerts/forms/alertform.py @@ -27,7 +27,6 @@ from PyQt4 import QtGui, QtCore from openlp.core.lib import translate -from openlp.core.lib.ui import UiStrings from openlp.plugins.alerts.lib.db import AlertItem from alertdialog import Ui_AlertDialog @@ -97,7 +96,7 @@ class AlertForm(QtGui.QDialog, Ui_AlertDialog): def onNewClick(self): if len(self.alertTextEdit.text()) == 0: QtGui.QMessageBox.information(self, - UiStrings.NewType % self.plugin.nameStrings[u'singular'], + translate('AlertsPlugin.AlertForm', 'New Alert'), translate('AlertsPlugin.AlertForm', 'You haven\'t specified ' 'any text for your alert. Please type in some text before ' 'clicking New.')) diff --git a/openlp/plugins/bibles/forms/bibleimportform.py b/openlp/plugins/bibles/forms/bibleimportform.py index b27d12a44..b3b7aeb7e 100644 --- a/openlp/plugins/bibles/forms/bibleimportform.py +++ b/openlp/plugins/bibles/forms/bibleimportform.py @@ -361,12 +361,15 @@ class BibleImportForm(OpenLPWizard): """ Allow for localisation of the bible import wizard. """ - OpenLPWizard.retranslateUi(self) self.setWindowTitle( translate('BiblesPlugin.ImportWizardForm', 'Bible Import Wizard')) - self.informationLabel.setText(WizardStrings.Description % ( - self.direction.toLower(), self.plugin.nameStrings[u'plural'], - self.direction.toLower())) + self.titleLabel.setText(WizardStrings.Header % + translate('OpenLP.Ui', 'Welcome to the Bible Import Wizard')) + self.informationLabel.setText( + translate('BiblesPlugin.ImportWizardForm', + 'This wizard will help you to import Bibles from a variety of ' + 'formats. Click the next button below to start the process by ' + 'selecting a format to import from.')) self.selectPage.setTitle(WizardStrings.ImportSelect) self.selectPage.setSubTitle(WizardStrings.ImportSelectLong) self.formatLabel.setText(WizardStrings.FormatLabel) @@ -765,8 +768,8 @@ class BibleImportForm(OpenLPWizard): 'bible. Please note, that verses will be downloaded on\n' 'demand and thus an internet connection is required.')) else: - self.progressLabel.setText( - WizardStrings.FinishedType % UiStrings.Import.toLower()) + self.progressLabel.setText(translate( + 'BiblesPlugin.ImportWizardForm', 'Finished import.')) else: self.progressLabel.setText(translate( 'BiblesPlugin.ImportWizardForm', 'Your Bible import failed.')) diff --git a/openlp/plugins/images/lib/mediaitem.py b/openlp/plugins/images/lib/mediaitem.py index 556fff22b..137485eb5 100644 --- a/openlp/plugins/images/lib/mediaitem.py +++ b/openlp/plugins/images/lib/mediaitem.py @@ -198,5 +198,6 @@ class ImageMediaItem(MediaManagerItem): self.resetAction.setVisible(True) else: critical_error_message_box(UiStrings.LiveBGError, - UiStrings.ProbReplaceBG % ( - self.plugin.nameStrings[u'singular'].toLower(), filename)) + unicode(translate('ImagePlugin.MediaItem', + 'There was a problem replacing your background, ' + 'the image file "%s" no longer exists.')) % filename) diff --git a/openlp/plugins/media/lib/mediaitem.py b/openlp/plugins/media/lib/mediaitem.py index 93c201c14..89db9d993 100644 --- a/openlp/plugins/media/lib/mediaitem.py +++ b/openlp/plugins/media/lib/mediaitem.py @@ -113,8 +113,9 @@ class MediaMediaItem(MediaManagerItem): self.resetAction.setVisible(True) else: critical_error_message_box(UiStrings.LiveBGError, - UiStrings.ProbReplaceBG % ( - self.plugin.nameStrings[u'singular'].toLower(), filename)) + unicode(translate('MediaPlugin.MediaItem', + 'There was a problem replacing your background, ' + 'the media file "%s" no longer exists.')) % filename) def generateSlideData(self, service_item, item=None, xmlVersion=False): if item is None: diff --git a/openlp/plugins/songs/forms/authorsdialog.py b/openlp/plugins/songs/forms/authorsdialog.py index 6cfe83e67..09c723364 100644 --- a/openlp/plugins/songs/forms/authorsdialog.py +++ b/openlp/plugins/songs/forms/authorsdialog.py @@ -28,7 +28,6 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import translate from openlp.core.lib.ui import create_accept_reject_button_box -from openlp.plugins.songs.lib.ui import SongStrings class Ui_AuthorsDialog(object): def setupUi(self, authorsDialog): @@ -65,7 +64,7 @@ class Ui_AuthorsDialog(object): def retranslateUi(self, authorsDialog): authorsDialog.setWindowTitle( - SongStrings.TypeMaintenance % SongStrings.Author) + translate('SongsPlugin.AuthorsForm', 'Author Maintenance')) self.displayLabel.setText( translate('SongsPlugin.AuthorsForm', 'Display name:')) self.firstNameLabel.setText( diff --git a/openlp/plugins/songs/forms/editsongform.py b/openlp/plugins/songs/forms/editsongform.py index 2f0475828..9874b7952 100644 --- a/openlp/plugins/songs/forms/editsongform.py +++ b/openlp/plugins/songs/forms/editsongform.py @@ -35,7 +35,6 @@ from openlp.core.lib.ui import UiStrings, add_widget_completer, \ from openlp.plugins.songs.forms import EditVerseForm from openlp.plugins.songs.lib import SongXML, VerseType from openlp.plugins.songs.lib.db import Book, Song, Author, Topic -from openlp.plugins.songs.lib.ui import SongStrings from editsongdialog import Ui_EditSongDialog log = logging.getLogger(__name__) @@ -310,8 +309,9 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): text = unicode(self.authorsComboBox.currentText()) if item == 0 and text: if QtGui.QMessageBox.question(self, - UiStrings.AddType % SongStrings.Author, - SongStrings.TypeNotExistAdd % SongStrings.Author.toLower(), + translate('SongsPlugin.EditSongForm', 'Add Author'), + translate('SongsPlugin.EditSongForm', 'This author does not ' + 'exist, do you want to add them?'), QtGui.QMessageBox.Yes | QtGui.QMessageBox.No, QtGui.QMessageBox.Yes) == QtGui.QMessageBox.Yes: if text.find(u' ') == -1: @@ -332,8 +332,8 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): if self.authorsListView.findItems(unicode(author.display_name), QtCore.Qt.MatchExactly): critical_error_message_box( - message=SongStrings.TypeInList % - SongStrings.Author.toLower()) + message=translate('SongsPlugin.EditSongForm', + 'This author is already in the list.')) else: self.__addAuthorToList(author) self.authorsComboBox.setCurrentIndex(0) @@ -367,8 +367,9 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): text = unicode(self.topicsComboBox.currentText()) if item == 0 and text: if QtGui.QMessageBox.question(self, - UiStrings.AddType % SongStrings.Topic, - SongStrings.TypeNotExistAdd % SongStrings.Topic.toLower(), + translate('SongsPlugin.EditSongForm', 'Add Topic'), + translate('SongsPlugin.EditSongForm', 'This topic does not ' + 'exist, do you want to add it?'), QtGui.QMessageBox.Yes | QtGui.QMessageBox.No, QtGui.QMessageBox.Yes) == QtGui.QMessageBox.Yes: topic = Topic.populate(name=text) @@ -387,8 +388,8 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): if self.topicsListView.findItems(unicode(topic.name), QtCore.Qt.MatchExactly): critical_error_message_box( - message=SongStrings.TypeInList % - SongStrings.Topic.toLower()) + message=translate('SongsPlugin.EditSongForm', + 'This topic is already in the list.')) else: topic_item = QtGui.QListWidgetItem(unicode(topic.name)) topic_item.setData(QtCore.Qt.UserRole, @@ -583,8 +584,9 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): text = unicode(self.songBookComboBox.currentText()) if self.songBookComboBox.findText(text, QtCore.Qt.MatchExactly) < 0: if QtGui.QMessageBox.question(self, - UiStrings.AddType % SongStrings.SongBook, - SongStrings.TypeNotExistAdd % SongStrings.SongBook.toLower(), + translate('SongsPlugin.EditSongForm', 'Add Book'), + translate('SongsPlugin.EditSongForm', 'This song book does ' + 'not exist, do you want to add it?'), QtGui.QMessageBox.Yes | QtGui.QMessageBox.No, QtGui.QMessageBox.Yes) == QtGui.QMessageBox.Yes: book = Book.populate(name=text, publisher=u'') diff --git a/openlp/plugins/songs/forms/songbookdialog.py b/openlp/plugins/songs/forms/songbookdialog.py index d185a9e1e..f6dd3930c 100644 --- a/openlp/plugins/songs/forms/songbookdialog.py +++ b/openlp/plugins/songs/forms/songbookdialog.py @@ -28,7 +28,6 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import translate from openlp.core.lib.ui import create_accept_reject_button_box -from openlp.plugins.songs.lib.ui import SongStrings class Ui_SongBookDialog(object): def setupUi(self, songBookDialog): @@ -59,7 +58,7 @@ class Ui_SongBookDialog(object): def retranslateUi(self, songBookDialog): songBookDialog.setWindowTitle( - SongStrings.TypeMaintenance % SongStrings.SongBook) + translate('SongsPlugin.SongBookForm', 'Song Book Maintenance')) self.nameLabel.setText(translate('SongsPlugin.SongBookForm', '&Name:')) self.publisherLabel.setText( translate('SongsPlugin.SongBookForm', '&Publisher:')) diff --git a/openlp/plugins/songs/forms/songexportform.py b/openlp/plugins/songs/forms/songexportform.py index 66003532b..231e9ff19 100644 --- a/openlp/plugins/songs/forms/songexportform.py +++ b/openlp/plugins/songs/forms/songexportform.py @@ -162,9 +162,10 @@ class SongExportForm(OpenLPWizard): """ Song wizard localisation. """ - OpenLPWizard.retranslateUi(self) self.setWindowTitle( translate('SongsPlugin.ExportWizardForm', 'Song Export Wizard')) + self.titleLabel.setText(WizardStrings.Header % + translate('OpenLP.Ui', 'Welcome to the Song Export Wizard')) self.informationLabel.setText( translate('SongsPlugin.ExportWizardForm', 'This wizard will help to' ' export your songs to the open and free OpenLyrics worship song ' @@ -281,7 +282,7 @@ class SongExportForm(OpenLPWizard): self, songs, unicode(self.directoryLineEdit.text())) if exporter.do_export(): self.progressLabel.setText( - WizardStrings.FinishedType % UiStrings.Export.toLower()) + translate('SongsPlugin.SongExportForm', 'Finished export.')) else: self.progressLabel.setText( translate('SongsPlugin.SongExportForm', diff --git a/openlp/plugins/songs/forms/songimportform.py b/openlp/plugins/songs/forms/songimportform.py index 9f85762f2..aa65501b3 100644 --- a/openlp/plugins/songs/forms/songimportform.py +++ b/openlp/plugins/songs/forms/songimportform.py @@ -205,12 +205,15 @@ class SongImportForm(OpenLPWizard): """ Song wizard localisation. """ - OpenLPWizard.retranslateUi(self) self.setWindowTitle( translate('SongsPlugin.ImportWizardForm', 'Song Import Wizard')) - self.informationLabel.setText(WizardStrings.Description % ( - self.direction.toLower(), self.plugin.nameStrings[u'plural'], - self.direction.toLower())) + self.titleLabel.setText(WizardStrings.Header % + translate('OpenLP.Ui', 'Welcome to the Song Import Wizard')) + self.informationLabel.setText( + translate('SongsPlugin.ImportWizardForm', + 'This wizard will help you to import songs from a variety of ' + 'formats. Click the next button below to start the process by ' + 'selecting a format to import from.')) self.sourcePage.setTitle(WizardStrings.ImportSelect) self.sourcePage.setSubTitle(WizardStrings.ImportSelectLong) self.formatLabel.setText(WizardStrings.FormatLabel) @@ -224,7 +227,9 @@ class SongImportForm(OpenLPWizard): self.formatComboBox.setItemText(SongFormat.CCLI, WizardStrings.CCLI) self.formatComboBox.setItemText( SongFormat.SongsOfFellowship, WizardStrings.SoF) - self.formatComboBox.setItemText(SongFormat.Generic, WizardStrings.GDP) + self.formatComboBox.setItemText(SongFormat.Generic, + translate('SongsPlugin.ImportWizardForm', + 'Generic Document/Presentation')) self.formatComboBox.setItemText( SongFormat.EasiSlides, WizardStrings.ES) self.formatComboBox.setItemText( @@ -361,8 +366,9 @@ class SongImportForm(OpenLPWizard): elif source_format == SongFormat.Generic: if self.genericFileListWidget.count() == 0: critical_error_message_box(UiStrings.NFSp, - WizardStrings.YouSpecifyFile % - WizardStrings.GDP.toLower()) + translate('SongsPlugin.ImportWizardForm', + 'You need to add at least one document or ' + 'presentation file to import from.')) self.genericAddButton.setFocus() return False elif source_format == SongFormat.EasiSlides: @@ -417,8 +423,7 @@ class SongImportForm(OpenLPWizard): filters) if filenames: listbox.addItems(filenames) - SettingsManager.set_last_dir( - self.plugin.settingsSection, + SettingsManager.set_last_dir(self.plugin.settingsSection, os.path.split(unicode(filenames[0]))[0], 1) def getListOfFiles(self, listbox): @@ -533,8 +538,11 @@ class SongImportForm(OpenLPWizard): """ Get song database files """ - self.getFileName(WizardStrings.OpenTypeFile % WizardStrings.GDP, - self.genericFileListWidget) + self.getFileName( + translate('SongsPlugin.ImportWizardForm', + 'Select Document/Presentation Files'), + self.genericFileListWidget + ) def onGenericRemoveButtonClicked(self): """ @@ -572,7 +580,7 @@ class SongImportForm(OpenLPWizard): """ Get SongShow Plus song database files """ - self.getFiles(WizardStrings.OpenFileType % WizardStrings.SSP, + self.getFiles(WizardStrings.OpenTypeFile % WizardStrings.SSP, self.songShowPlusFileListWidget, u'%s (*.sbsong)' % translate('SongsPlugin.ImportWizardForm', 'SongShow Plus Song Files') @@ -660,7 +668,7 @@ class SongImportForm(OpenLPWizard): self.songsOfFellowshipFileListWidget) ) elif source_format == SongFormat.Generic: - # Import a generic document or presentatoin + # Import a generic document or presentation importer = self.plugin.importSongs(SongFormat.Generic, filenames=self.getListOfFiles(self.genericFileListWidget) ) @@ -686,7 +694,7 @@ class SongImportForm(OpenLPWizard): ) if importer.do_import(): self.progressLabel.setText( - WizardStrings.FinishedType % UiStrings.Import.toLower()) + translate('SongsPlugin.SongImportForm', 'Finished import.')) else: self.progressLabel.setText( translate('SongsPlugin.SongImportForm', diff --git a/openlp/plugins/songs/forms/songmaintenancedialog.py b/openlp/plugins/songs/forms/songmaintenancedialog.py index 14ad1132d..d17442b4c 100644 --- a/openlp/plugins/songs/forms/songmaintenancedialog.py +++ b/openlp/plugins/songs/forms/songmaintenancedialog.py @@ -26,7 +26,7 @@ from PyQt4 import QtCore, QtGui -from openlp.core.lib import build_icon, StringContent +from openlp.core.lib import build_icon, translate from openlp.core.lib.ui import UiStrings from openlp.plugins.songs.lib.ui import SongStrings @@ -145,9 +145,8 @@ class Ui_SongMaintenanceDialog(object): QtCore.QMetaObject.connectSlotsByName(songMaintenanceDialog) def retranslateUi(self, songMaintenanceDialog): - songMaintenanceDialog.setWindowTitle(SongStrings.TypeMaintenance % - songMaintenanceDialog.parent().plugin.getString( - StringContent.Name)[u'singular']) + songMaintenanceDialog.setWindowTitle( + translate('SongsPlugin.SongMaintenanceForm', 'Song Maintenance')) self.listItemAuthors.setText(SongStrings.Authors) self.listItemTopics.setText(SongStrings.Topics) self.listItemBooks.setText(SongStrings.SongBooks) diff --git a/openlp/plugins/songs/forms/songmaintenanceform.py b/openlp/plugins/songs/forms/songmaintenanceform.py index ffea2ffa6..7f9b8bec5 100644 --- a/openlp/plugins/songs/forms/songmaintenanceform.py +++ b/openlp/plugins/songs/forms/songmaintenanceform.py @@ -32,7 +32,6 @@ from openlp.core.lib import Receiver, translate from openlp.core.lib.ui import UiStrings, critical_error_message_box from openlp.plugins.songs.forms import AuthorsForm, TopicsForm, SongBookForm from openlp.plugins.songs.lib.db import Author, Book, Topic, Song -from openlp.plugins.songs.lib.ui import SongStrings from songmaintenancedialog import Ui_SongMaintenanceDialog log = logging.getLogger(__name__) @@ -103,20 +102,18 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog): else: return -1 - def _deleteItem(self, item_class, list_widget, reset_func, del_type): - dlg_title = UiStrings.DeleteType % del_type + def _deleteItem(self, item_class, list_widget, reset_func, dlg_title, + del_text, err_text): item_id = self._getCurrentItemId(list_widget) if item_id != -1: item = self.manager.get_object(item_class, item_id) if item and len(item.songs) == 0: - if critical_error_message_box(dlg_title, - SongStrings.SureDeleteType % del_type, - self, True) == QtGui.QMessageBox.Yes: + if critical_error_message_box(dlg_title, del_text, self, + True) == QtGui.QMessageBox.Yes: self.manager.delete_object(item_class, item.id) reset_func() else: - critical_error_message_box(dlg_title, - SongStrings.NoDeleteAssigned % del_type) + critical_error_message_box(dlg_title, err_text) else: critical_error_message_box(dlg_title, UiStrings.NISs) @@ -217,11 +214,13 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog): if self.manager.save_object(author): self.resetAuthors() else: - critical_error_message_box(SongStrings.CouldNotAdd % - SongStrings.Author.toLower()) + critical_error_message_box( + message=translate('SongsPlugin.SongMaintenanceForm', + 'Could not add your author.')) else: critical_error_message_box( - SongStrings.ThisTypeExists % SongStrings.Author.toLower()) + message=translate('SongsPlugin.SongMaintenanceForm', + 'This author already exists.')) def onTopicAddButtonClick(self): if self.topicform.exec_(): @@ -230,11 +229,13 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog): if self.manager.save_object(topic): self.resetTopics() else: - critical_error_message_box(SongStrings.CouldNotAdd % - SongStrings.Topic.toLower()) + critical_error_message_box( + message=translate('SongsPlugin.SongMaintenanceForm', + 'Could not add your topic.')) else: critical_error_message_box( - SongStrings.ThisTypeExists % SongStrings.Topic.toLower()) + message=translate('SongsPlugin.SongMaintenanceForm', + 'This topic already exists.')) def onBookAddButtonClick(self): if self.bookform.exec_(): @@ -244,11 +245,13 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog): if self.manager.save_object(book): self.resetBooks() else: - critical_error_message_box(SongStrings.CouldNotAdd % - SongStrings.SongBook.toLower()) + critical_error_message_box( + message=translate('SongsPlugin.SongMaintenanceForm', + 'Could not add your book.')) else: critical_error_message_box( - SongStrings.ThisTypeExists % SongStrings.SongBook.toLower()) + message=translate('SongsPlugin.SongMaintenanceForm', + 'This book already exists.')) def onAuthorEditButtonClick(self): author_id = self._getCurrentItemId(self.authorsListWidget) @@ -442,21 +445,33 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog): Delete the author if the author is not attached to any songs. """ self._deleteItem(Author, self.authorsListWidget, self.resetAuthors, - SongStrings.Author) + translate('SongsPlugin.SongMaintenanceForm', 'Delete Author'), + translate('SongsPlugin.SongMaintenanceForm', + 'Are you sure you want to delete the selected author?'), + translate('SongsPlugin.SongMaintenanceForm', 'This author cannot ' + 'be deleted, they are currently assigned to at least one song.')) def onTopicDeleteButtonClick(self): """ Delete the Book if the Book is not attached to any songs. """ self._deleteItem(Topic, self.topicsListWidget, self.resetTopics, - SongStrings.Topic) + translate('SongsPlugin.SongMaintenanceForm', 'Delete Topic'), + translate('SongsPlugin.SongMaintenanceForm', + 'Are you sure you want to delete the selected topic?'), + translate('SongsPlugin.SongMaintenanceForm', 'This topic cannot ' + 'be deleted, it is currently assigned to at least one song.')) def onBookDeleteButtonClick(self): """ Delete the Book if the Book is not attached to any songs. """ self._deleteItem(Book, self.booksListWidget, self.resetBooks, - SongStrings.SongBook) + translate('SongsPlugin.SongMaintenanceForm', 'Delete Book'), + translate('SongsPlugin.SongMaintenanceForm', + 'Are you sure you want to delete the selected book?'), + translate('SongsPlugin.SongMaintenanceForm', 'This book cannot be ' + 'deleted, it is currently assigned to at least one song.')) def onAuthorsListRowChanged(self, row): """ diff --git a/openlp/plugins/songs/forms/topicsdialog.py b/openlp/plugins/songs/forms/topicsdialog.py index 4e2349019..1e7bdb6a0 100644 --- a/openlp/plugins/songs/forms/topicsdialog.py +++ b/openlp/plugins/songs/forms/topicsdialog.py @@ -28,7 +28,6 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import translate from openlp.core.lib.ui import create_accept_reject_button_box -from openlp.plugins.songs.lib.ui import SongStrings class Ui_TopicsDialog(object): def setupUi(self, topicsDialog): @@ -53,6 +52,6 @@ class Ui_TopicsDialog(object): def retranslateUi(self, topicsDialog): topicsDialog.setWindowTitle( - SongStrings.TypeMaintenance % SongStrings.Topic) + translate('SongsPlugin.TopicsForm', 'Topic Maintenance')) self.nameLabel.setText( translate('SongsPlugin.TopicsForm', 'Topic name:')) diff --git a/openlp/plugins/songs/lib/mediaitem.py b/openlp/plugins/songs/lib/mediaitem.py index 30b1060bf..6e0c9537d 100644 --- a/openlp/plugins/songs/lib/mediaitem.py +++ b/openlp/plugins/songs/lib/mediaitem.py @@ -137,8 +137,8 @@ class SongMediaItem(MediaManagerItem): def retranslateUi(self): self.searchTextLabel.setText(u'%s:' % UiStrings.Search) self.searchTextButton.setText(UiStrings.Search) - self.maintenanceAction.setText(SongStrings.TypeMaintenance % - self.plugin.nameStrings[u'singular']) + self.maintenanceAction.setText( + translate('SongsPlugin.MediaItem', 'Song Maintenance')) self.maintenanceAction.setToolTip(translate('SongsPlugin.MediaItem', 'Maintain the lists of authors, topics and books')) From 1fbc873a8c09dcbe14acc494b0efefb1b512fada Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Wed, 16 Feb 2011 03:28:06 +0000 Subject: [PATCH 034/123] Cleanups --- openlp/core/lib/rendermanager.py | 11 +++++------ openlp/core/lib/serviceitem.py | 2 +- openlp/core/ui/exceptionform.py | 2 +- openlp/core/ui/screen.py | 4 ++-- openlp/core/ui/servicemanager.py | 4 ++-- openlp/core/ui/slidecontroller.py | 4 ++-- openlp/core/ui/thememanager.py | 2 +- openlp/plugins/custom/forms/editcustomslideform.py | 4 ++-- openlp/plugins/custom/lib/mediaitem.py | 2 +- openlp/plugins/songs/lib/cclifileimport.py | 2 +- 10 files changed, 18 insertions(+), 19 deletions(-) diff --git a/openlp/core/lib/rendermanager.py b/openlp/core/lib/rendermanager.py index 32a29915f..3935b4b15 100644 --- a/openlp/core/lib/rendermanager.py +++ b/openlp/core/lib/rendermanager.py @@ -173,14 +173,13 @@ class RenderManager(object): main_rect = None footer_rect = None if not theme.font_main_override: - main_rect = QtCore.QRect(10, 0, - self.width - 20, self.footer_start) + main_rect = QtCore.QRect(10, 0, self.width - 20, self.footer_start) else: main_rect = QtCore.QRect(theme.font_main_x, theme.font_main_y, theme.font_main_width - 1, theme.font_main_height - 1) if not theme.font_footer_override: - footer_rect = QtCore.QRect(10, self.footer_start, - self.width - 20, self.height - self.footer_start) + footer_rect = QtCore.QRect(10, self.footer_start, self.width - 20, + self.height - self.footer_start) else: footer_rect = QtCore.QRect(theme.font_footer_x, theme.font_footer_y, theme.font_footer_width - 1, @@ -215,7 +214,7 @@ class RenderManager(object): else: self.image_manager.del_image(theme_data.theme_name) footer = [] - footer.append(u'Arky Arky (Unknown)' ) + footer.append(u'Arky Arky (Unknown)') footer.append(u'Public Domain') footer.append(u'CCLI 123456') # build a service item to generate preview @@ -258,6 +257,6 @@ class RenderManager(object): self.height = screen.height() self.screen_ratio = float(self.height) / float(self.width) log.debug(u'calculate default %d, %d, %f', - self.width, self.height, self.screen_ratio ) + self.width, self.height, self.screen_ratio) # 90% is start of footer self.footer_start = int(self.height * 0.90) diff --git a/openlp/core/lib/serviceitem.py b/openlp/core/lib/serviceitem.py index f9d690ba2..f5b606467 100644 --- a/openlp/core/lib/serviceitem.py +++ b/openlp/core/lib/serviceitem.py @@ -323,7 +323,7 @@ class ServiceItem(object): for text_image in serviceitem[u'serviceitem'][u'data']: filename = os.path.join(path, text_image[u'title']) self.add_from_command( - path, text_image[u'title'], text_image[u'image'] ) + path, text_image[u'title'], text_image[u'image']) self._new_item() def get_display_title(self): diff --git a/openlp/core/ui/exceptionform.py b/openlp/core/ui/exceptionform.py index f0c1c9ab0..cb3cc4ef4 100644 --- a/openlp/core/ui/exceptionform.py +++ b/openlp/core/ui/exceptionform.py @@ -170,7 +170,7 @@ class ExceptionForm(QtGui.QDialog, Ui_ExceptionDialog): self.__buttonState(False) self.descriptionWordCount.setText( unicode(translate('OpenLP.ExceptionDialog', - 'Description characters to enter : %s')) % count ) + 'Description characters to enter : %s')) % count) def onAttachFileButtonPressed(self): files = QtGui.QFileDialog.getOpenFileName( diff --git a/openlp/core/ui/screen.py b/openlp/core/ui/screen.py index 430426fd5..82238d738 100644 --- a/openlp/core/ui/screen.py +++ b/openlp/core/ui/screen.py @@ -71,7 +71,7 @@ class ScreenList(object): """ Set up the current screen dimensions """ - log.debug(u'set_current_display %s', number, ) + log.debug(u'set_current_display %s', number) if number + 1 > self.display_count: self.current = self.screen_list[0] self.override = copy.deepcopy(self.current) @@ -99,4 +99,4 @@ class ScreenList(object): user wants to use the correct screen attributes """ log.debug(u'reset_current_display') - self.set_current_display(self.current_display) \ No newline at end of file + self.set_current_display(self.current_display) diff --git a/openlp/core/ui/servicemanager.py b/openlp/core/ui/servicemanager.py index 0bddbc5a5..3dfcb6ded 100644 --- a/openlp/core/ui/servicemanager.py +++ b/openlp/core/ui/servicemanager.py @@ -1061,8 +1061,8 @@ class ServiceManager(QtGui.QWidget): if self.serviceItems[item][u'service_item']\ .is_capable(ItemCapabilities.AllowsEdit): Receiver.send_message(u'%s_edit' % - self.serviceItems[item][u'service_item'].name.lower(), u'L:%s' % - self.serviceItems[item][u'service_item'].edit_id ) + self.serviceItems[item][u'service_item'].name.lower(), + u'L:%s' % self.serviceItems[item][u'service_item'].edit_id) def findServiceItem(self): """ diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index f3bf7ee52..14ec92983 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -603,8 +603,8 @@ class SlideController(QtGui.QWidget): if self.serviceItem.is_text(): if frame[u'verseTag']: bits = frame[u'verseTag'].split(u':') - tag = u'%s\n%s' % (bits[0][0], bits[1][0:] ) - tag1 = u'%s%s' % (bits[0][0], bits[1][0:] ) + tag = u'%s\n%s' % (bits[0][0], bits[1][0:]) + tag1 = u'%s%s' % (bits[0][0], bits[1][0:]) row = tag if self.isLive: if tag1 not in self.slideList: diff --git a/openlp/core/ui/thememanager.py b/openlp/core/ui/thememanager.py index 015e48f23..90f74fcfa 100644 --- a/openlp/core/ui/thememanager.py +++ b/openlp/core/ui/thememanager.py @@ -36,7 +36,7 @@ from openlp.core.lib import OpenLPToolbar, ThemeXML, get_text_file_string, \ build_icon, Receiver, SettingsManager, translate, check_item_selected, \ BackgroundType, BackgroundGradientType, check_directory_exists, \ VerticalType -from openlp.core.lib.ui import UiStrings, critical_error_message_box +from openlp.core.lib.ui import critical_error_message_box from openlp.core.theme import Theme from openlp.core.ui import FileRenameForm, ThemeForm from openlp.core.utils import AppLocation, delete_file, file_is_unicode, \ diff --git a/openlp/plugins/custom/forms/editcustomslideform.py b/openlp/plugins/custom/forms/editcustomslideform.py index c8b74a387..80141cfb3 100644 --- a/openlp/plugins/custom/forms/editcustomslideform.py +++ b/openlp/plugins/custom/forms/editcustomslideform.py @@ -71,5 +71,5 @@ class EditCustomSlideForm(QtGui.QDialog, Ui_CustomSlideEditDialog): """ if self.slideTextEdit.textCursor().columnNumber() != 0: self.slideTextEdit.insertPlainText(u'\n') - self.slideTextEdit.insertPlainText(u'[---]\n' ) - self.slideTextEdit.setFocus() \ No newline at end of file + self.slideTextEdit.insertPlainText(u'[---]\n') + self.slideTextEdit.setFocus() diff --git a/openlp/plugins/custom/lib/mediaitem.py b/openlp/plugins/custom/lib/mediaitem.py index b0834f170..7ffdfd0b2 100644 --- a/openlp/plugins/custom/lib/mediaitem.py +++ b/openlp/plugins/custom/lib/mediaitem.py @@ -55,7 +55,7 @@ class CustomMediaItem(MediaManagerItem): QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'custom_edit'), self.onRemoteEdit) QtCore.QObject.connect(Receiver.get_receiver(), - QtCore.SIGNAL(u'custom_edit_clear' ), self.onRemoteEditClear) + QtCore.SIGNAL(u'custom_edit_clear'), self.onRemoteEditClear) QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'custom_load_list'), self.initialise) QtCore.QObject.connect(Receiver.get_receiver(), diff --git a/openlp/plugins/songs/lib/cclifileimport.py b/openlp/plugins/songs/lib/cclifileimport.py index 441391d02..534cbeab7 100644 --- a/openlp/plugins/songs/lib/cclifileimport.py +++ b/openlp/plugins/songs/lib/cclifileimport.py @@ -187,7 +187,7 @@ class CCLIFileImport(SongImport): if check_first_verse_line: if verse_lines[0].startswith(u'(PRE-CHORUS'): verse_type = u'P' - log.debug(u'USR verse PRE-CHORUS: %s', verse_lines[0] ) + log.debug(u'USR verse PRE-CHORUS: %s', verse_lines[0]) verse_text = verse_lines[1] elif verse_lines[0].startswith(u'(BRIDGE'): verse_type = u'B' From 7e18b8e3e6641342f32094b65130ddebabda371c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20P=C3=B5ldaru?= Date: Wed, 16 Feb 2011 11:36:59 +0200 Subject: [PATCH 035/123] fix opensong order shuffling + refactoring --- openlp/plugins/songs/lib/opensongimport.py | 152 ++++++++++----------- openlp/plugins/songs/lib/songimport.py | 17 ++- 2 files changed, 83 insertions(+), 86 deletions(-) diff --git a/openlp/plugins/songs/lib/opensongimport.py b/openlp/plugins/songs/lib/opensongimport.py index 8c6d283e3..66ccdd3cc 100644 --- a/openlp/plugins/songs/lib/opensongimport.py +++ b/openlp/plugins/songs/lib/opensongimport.py @@ -149,23 +149,25 @@ class OpenSongImport(SongImport): unicode(translate('SongsPlugin.ImportWizardForm', 'Importing %s...')) % parts[-1]) songfile = z.open(song) - self.do_import_file(songfile) - if self.commit: + if self.do_import_file(songfile) and self.commit and \ + not self.stop_import_flag: self.finish() - if self.stop_import_flag: - success = False - break + else: + success = False + break else: # not a zipfile log.info(u'Direct import %s', filename) self.import_wizard.incrementProgressBar( unicode(translate('SongsPlugin.ImportWizardForm', 'Importing %s...')) % os.path.split(filename)[-1]) - file = open(filename) - self.do_import_file(file) - if self.commit: + songfile = open(filename) + if self.do_import_file(songfile) and self.commit and \ + not self.stop_import_flag: self.finish() - + else: + success = False + break return success def do_import_file(self, file): @@ -178,7 +180,7 @@ class OpenSongImport(SongImport): tree = objectify.parse(file) except (Error, LxmlError): log.exception(u'Error parsing XML') - return + return False root = tree.getroot() fields = dir(root) decode = { @@ -196,19 +198,22 @@ class OpenSongImport(SongImport): setattr(self, fn_or_string, ustring) else: fn_or_string(ustring) + if not len(self.title): + # to prevent creation of empty songs from wrong files + return False if u'theme' in fields and unicode(root.theme) not in self.topics: self.topics.append(unicode(root.theme)) if u'alttheme' in fields and unicode(root.alttheme) not in self.topics: self.topics.append(unicode(root.alttheme)) # data storage while importing verses = {} - # keep track of a "default" verse order, in case none is specified + # keep track of verses appearance order our_verse_order = [] - verses_seen = {} - # in the absence of any other indication, verses are the default, - # erm, versetype! - versetype = u'V' - versenum = None + # default versetype + vt = u'V' + vn = u'1' + # for the case where song has several sections with same marker + inst = 1 lyrics = unicode(root.lyrics) for thisline in lyrics.split(u'\n'): # remove comments @@ -216,14 +221,14 @@ class OpenSongImport(SongImport): if semicolon >= 0: thisline = thisline[:semicolon] thisline = thisline.strip() - if len(thisline) == 0: + if not len(thisline): continue - # skip inthisline guitar chords and page and column breaks - if thisline[0] == u'.' or thisline.startswith(u'---') \ + # skip guitar chords and page and column breaks + if thisline.startswith(u'.') or thisline.startswith(u'---') \ or thisline.startswith(u'-!!'): continue # verse/chorus/etc. marker - if thisline[0] == u'[': + if thisline.startswith(u'['): # drop the square brackets right_bracket = thisline.find(u']') content = thisline[1:right_bracket].upper() @@ -232,78 +237,63 @@ class OpenSongImport(SongImport): # to the end (even if there are some alpha chars on the end) match = re.match(u'(.*)(\d+.*)', content) if match is not None: - versetype = match.group(1) - versenum = match.group(2) + vt = match.group(1) + vn = match.group(2) else: # otherwise we assume number 1 and take the whole prefix as # the versetype - versetype = content - versenum = u'1' + vt = content + vn = u'1' + inst = 1 + if [vt, vn, inst] in our_verse_order and verses.has_key(vt) \ + and verses[vt].has_key(vn): + inst = len(verses[vt][vn])+1 + our_verse_order.append([vt, vn, inst]) continue - words = None # number at start of line.. it's verse number if thisline[0].isdigit(): - versenum = thisline[0] - words = thisline[1:].strip() - if words is None: - words = thisline - if not versenum: - versenum = u'1' - if versenum is not None: - versetag = u'%s%s' % (versetype, versenum) - if not verses.has_key(versetype): - verses[versetype] = {} - if not verses[versetype].has_key(versenum): - # storage for lines in this verse - verses[versetype][versenum] = [] - if not verses_seen.has_key(versetag): - verses_seen[versetag] = 1 - our_verse_order.append(versetag) + vn = thisline[0] + thisline = thisline[1:].strip() + our_verse_order.append([vt, vn, inst]) + if not verses.has_key(vt): + verses[vt] = {} + if not verses[vt].has_key(vn): + verses[vt][vn] = {} + if not verses[vt][vn].has_key(inst): + verses[vt][vn][inst] = [] if words: # Tidy text and remove the ____s from extended words - words = self.tidy_text(words) - words = words.replace('_', '') - verses[versetype][versenum].append(words) + thisline = self.tidy_text(thisline) + thisline = thisline.replace(u'_', u'') + thisline = thisline.replace(u'|', u'\n') + verses[vt][vn][inst].append(thisline) # done parsing - versetypes = verses.keys() - versetypes.sort() - versetags = {} - for versetype in versetypes: - our_verse_type = versetype - if our_verse_type == u'': - our_verse_type = u'V' - versenums = verses[versetype].keys() - versenums.sort() - for num in versenums: - versetag = u'%s%s' % (our_verse_type, num) - lines = u'\n'.join(verses[versetype][num]) - self.add_verse(lines, versetag) - # Keep track of what we have for error checking later - versetags[versetag] = 1 - # now figure out the presentation order - order = [] + # add verses in original order + for (vt, vn, inst) in our_verse_order: + vtag = u'%s%s' % (vt, vn) + lines = u'\n'.join(verses[vt][vn][inst]) + self.add_verse(lines, vtag) + # figure out the presentation order, if present if u'presentation' in fields and root.presentation != u'': order = unicode(root.presentation) # We make all the tags in the lyrics upper case, so match that here # and then split into a list on the whitespace order = order.upper().split() - else: - if len(our_verse_order) > 0: - order = our_verse_order - else: - log.warn(u'No verse order available for %s, skipping.', - self.title) - # TODO: make sure that the default order list will be overwritten, if - # the songs provides its own order list. - for tag in order: - if tag[0].isdigit(): - # Assume it's a verse if it has no prefix - tag = u'V' + tag - elif not re.search('\d+', tag): - # Assume it's no.1 if there's no digits - tag = tag + u'1' - if not versetags.has_key(tag): - log.info(u'Got order %s but not in versetags, dropping this' - u'item from presentation order', tag) - else: - self.verse_order_list.append(tag) + for tag in order: + match = re.match(u'(.*)(\d+.*)', tag) + if match is not None: + vt = match.group(1) + vn = match.group(2) + if not len(vt): + vt = u'V' + else: + # Assume it's no.1 if there are no digits + vt = tag + vn = u'1' + vtagString = u'%s%s' % (vt, vn) + if verses.has_key(vt) and verses[vt].has_key(vn): + self.verse_order_list.append(vtagString) + else: + log.info(u'Got order %s but not in versetags, dropping' + u'this item from presentation order', vtagString) + return True diff --git a/openlp/plugins/songs/lib/songimport.py b/openlp/plugins/songs/lib/songimport.py index da017d4f5..ca54009cb 100644 --- a/openlp/plugins/songs/lib/songimport.py +++ b/openlp/plugins/songs/lib/songimport.py @@ -75,6 +75,8 @@ class SongImport(QtCore.QObject): self.media_files = [] self.song_book_name = u'' self.song_book_pub = u'' + self.verse_order_list_generated_useful = False + self.verse_order_list_generated = [] self.verse_order_list = [] self.verses = [] self.versecounts = {} @@ -217,7 +219,8 @@ class SongImport(QtCore.QObject): """ for (oldversetag, oldverse, oldlang) in self.verses: if oldverse.strip() == versetext.strip(): - self.verse_order_list.append(oldversetag) + self.verse_order_list_generated.append(oldversetag) + self.verse_order_list_generated_useful = True return if versetag[0] in self.versecounts: self.versecounts[versetag[0]] += 1 @@ -228,15 +231,15 @@ class SongImport(QtCore.QObject): elif int(versetag[1:]) > self.versecounts[versetag[0]]: self.versecounts[versetag[0]] = int(versetag[1:]) self.verses.append([versetag, versetext.rstrip(), lang]) - self.verse_order_list.append(versetag) - if versetag.startswith(u'V') and u'C1' in self.verse_order_list: - self.verse_order_list.append(u'C1') + self.verse_order_list_generated.append(versetag) def repeat_verse(self): """ Repeat the previous verse in the verse order """ - self.verse_order_list.append(self.verse_order_list[-1]) + self.verse_order_list_generated.append( + self.verse_order_list_generated[-1]) + self.verse_order_list_generated_useful = True def check_complete(self): """ @@ -297,6 +300,9 @@ class SongImport(QtCore.QObject): song.search_lyrics += u' ' + self.remove_punctuation(versetext) song.search_lyrics = song.search_lyrics.lower() song.lyrics = unicode(sxml.extract_xml(), u'utf-8') + if not len(self.verse_order_list) and \ + self.verse_order_list_generated_useful: + self.verse_order_list = self.verse_order_list_generated for i, current_verse_tag in enumerate(self.verse_order_list): if verses_changed_to_other.has_key(current_verse_tag): self.verse_order_list[i] = \ @@ -348,6 +354,7 @@ class SongImport(QtCore.QObject): for (versetag, versetext, lang) in self.verses: print u'VERSE ' + versetag + u': ' + versetext print u'ORDER: ' + u' '.join(self.verse_order_list) + print u'GENERATED ORDER: ' + u' '.join(self.verse_order_list_generated) for author in self.authors: print u'AUTHOR: ' + author if self.copyright: From 31fbb999f912063a81c0b9e2e1a7cdc97071d083 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20P=C3=B5ldaru?= Date: Wed, 16 Feb 2011 11:43:07 +0200 Subject: [PATCH 036/123] forgot one --- openlp/plugins/songs/lib/opensongimport.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/openlp/plugins/songs/lib/opensongimport.py b/openlp/plugins/songs/lib/opensongimport.py index 66ccdd3cc..83a26249a 100644 --- a/openlp/plugins/songs/lib/opensongimport.py +++ b/openlp/plugins/songs/lib/opensongimport.py @@ -261,12 +261,11 @@ class OpenSongImport(SongImport): verses[vt][vn] = {} if not verses[vt][vn].has_key(inst): verses[vt][vn][inst] = [] - if words: - # Tidy text and remove the ____s from extended words - thisline = self.tidy_text(thisline) - thisline = thisline.replace(u'_', u'') - thisline = thisline.replace(u'|', u'\n') - verses[vt][vn][inst].append(thisline) + # Tidy text and remove the ____s from extended words + thisline = self.tidy_text(thisline) + thisline = thisline.replace(u'_', u'') + thisline = thisline.replace(u'|', u'\n') + verses[vt][vn][inst].append(thisline) # done parsing # add verses in original order for (vt, vn, inst) in our_verse_order: From cd431652caab01542a020a2938e40a16b041e556 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20P=C3=B5ldaru?= Date: Wed, 16 Feb 2011 12:20:25 +0200 Subject: [PATCH 037/123] no translation for song tags in database --- openlp/plugins/songs/lib/songimport.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/openlp/plugins/songs/lib/songimport.py b/openlp/plugins/songs/lib/songimport.py index ca54009cb..8c3457ebf 100644 --- a/openlp/plugins/songs/lib/songimport.py +++ b/openlp/plugins/songs/lib/songimport.py @@ -138,12 +138,12 @@ class SongImport(QtCore.QObject): def process_verse_text(self, text): lines = text.split(u'\n') if text.lower().find(self.copyright_string) >= 0 \ - or text.lower().find(self.copyright_symbol) >= 0: + or text.find(self.copyright_symbol) >= 0: copyright_found = False for line in lines: if (copyright_found or line.lower().find(self.copyright_string) >= 0 or - line.lower().find(self.copyright_symbol) >= 0): + line.find(self.copyright_symbol) >= 0): copyright_found = True self.add_copyright(line) else: @@ -219,6 +219,7 @@ class SongImport(QtCore.QObject): """ for (oldversetag, oldverse, oldlang) in self.verses: if oldverse.strip() == versetext.strip(): + # this verse is already present self.verse_order_list_generated.append(oldversetag) self.verse_order_list_generated_useful = True return @@ -278,17 +279,17 @@ class SongImport(QtCore.QObject): other_count = 1 for (versetag, versetext, lang) in self.verses: if versetag[0] == u'C': - versetype = VerseType.to_string(VerseType.Chorus) + versetype = u'Chorus' elif versetag[0] == u'V': - versetype = VerseType.to_string(VerseType.Verse) + versetype = u'Verse' elif versetag[0] == u'B': - versetype = VerseType.to_string(VerseType.Bridge) + versetype = u'Bridge' elif versetag[0] == u'I': - versetype = VerseType.to_string(VerseType.Intro) + versetype = u'Intro' elif versetag[0] == u'P': - versetype = VerseType.to_string(VerseType.PreChorus) + versetype = u'Pre-Chorus' elif versetag[0] == u'E': - versetype = VerseType.to_string(VerseType.Ending) + versetype = u'Ending' else: newversetag = u'O%d' % other_count verses_changed_to_other[versetag] = newversetag From 04a90fe42bc70ee82f06d0f394eb65aff4f59512 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20P=C3=B5ldaru?= Date: Wed, 16 Feb 2011 16:51:40 +0200 Subject: [PATCH 038/123] longer variable names --- openlp/plugins/songs/lib/opensongimport.py | 62 +++++++++++----------- 1 file changed, 32 insertions(+), 30 deletions(-) diff --git a/openlp/plugins/songs/lib/opensongimport.py b/openlp/plugins/songs/lib/opensongimport.py index 83a26249a..29648214e 100644 --- a/openlp/plugins/songs/lib/opensongimport.py +++ b/openlp/plugins/songs/lib/opensongimport.py @@ -210,8 +210,8 @@ class OpenSongImport(SongImport): # keep track of verses appearance order our_verse_order = [] # default versetype - vt = u'V' - vn = u'1' + versetype = u'V' + versenum = u'1' # for the case where song has several sections with same marker inst = 1 lyrics = unicode(root.lyrics) @@ -237,40 +237,41 @@ class OpenSongImport(SongImport): # to the end (even if there are some alpha chars on the end) match = re.match(u'(.*)(\d+.*)', content) if match is not None: - vt = match.group(1) - vn = match.group(2) + versetype = match.group(1) + versenum = match.group(2) else: # otherwise we assume number 1 and take the whole prefix as # the versetype - vt = content - vn = u'1' + versetype = content + versenum = u'1' inst = 1 - if [vt, vn, inst] in our_verse_order and verses.has_key(vt) \ - and verses[vt].has_key(vn): - inst = len(verses[vt][vn])+1 - our_verse_order.append([vt, vn, inst]) + if [versetype, versenum, inst] in our_verse_order \ + and verses.has_key(versetype) \ + and verses[versetype].has_key(versenum): + inst = len(verses[versetype][versenum])+1 + our_verse_order.append([versetype, versenum, inst]) continue # number at start of line.. it's verse number if thisline[0].isdigit(): - vn = thisline[0] + versenum = thisline[0] thisline = thisline[1:].strip() - our_verse_order.append([vt, vn, inst]) - if not verses.has_key(vt): - verses[vt] = {} - if not verses[vt].has_key(vn): - verses[vt][vn] = {} - if not verses[vt][vn].has_key(inst): - verses[vt][vn][inst] = [] + our_verse_order.append([versetype, versenum, inst]) + if not verses.has_key(versetype): + verses[versetype] = {} + if not verses[versetype].has_key(versenum): + verses[versetype][versenum] = {} + if not verses[versetype][versenum].has_key(inst): + verses[versetype][versenum][inst] = [] # Tidy text and remove the ____s from extended words thisline = self.tidy_text(thisline) thisline = thisline.replace(u'_', u'') thisline = thisline.replace(u'|', u'\n') - verses[vt][vn][inst].append(thisline) + verses[versetype][versenum][inst].append(thisline) # done parsing # add verses in original order - for (vt, vn, inst) in our_verse_order: - vtag = u'%s%s' % (vt, vn) - lines = u'\n'.join(verses[vt][vn][inst]) + for (versetype, versenum, inst) in our_verse_order: + vtag = u'%s%s' % (versetype, versenum) + lines = u'\n'.join(verses[versetype][versenum][inst]) self.add_verse(lines, vtag) # figure out the presentation order, if present if u'presentation' in fields and root.presentation != u'': @@ -281,16 +282,17 @@ class OpenSongImport(SongImport): for tag in order: match = re.match(u'(.*)(\d+.*)', tag) if match is not None: - vt = match.group(1) - vn = match.group(2) - if not len(vt): - vt = u'V' + versetype = match.group(1) + versenum = match.group(2) + if not len(versetype): + versetype = u'V' else: # Assume it's no.1 if there are no digits - vt = tag - vn = u'1' - vtagString = u'%s%s' % (vt, vn) - if verses.has_key(vt) and verses[vt].has_key(vn): + versetype = tag + versenum = u'1' + vtagString = u'%s%s' % (versetype, versenum) + if verses.has_key(versetype) \ + and verses[versetype].has_key(versenum): self.verse_order_list.append(vtagString) else: log.info(u'Got order %s but not in versetags, dropping' From 175bfd2f97a7bb62a086e9a86a4f1faead832783 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20P=C3=B5ldaru?= Date: Wed, 16 Feb 2011 19:09:35 +0200 Subject: [PATCH 039/123] change back, leave massive change for later --- openlp/plugins/songs/lib/songimport.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/openlp/plugins/songs/lib/songimport.py b/openlp/plugins/songs/lib/songimport.py index 8c3457ebf..ad18b57ef 100644 --- a/openlp/plugins/songs/lib/songimport.py +++ b/openlp/plugins/songs/lib/songimport.py @@ -279,17 +279,17 @@ class SongImport(QtCore.QObject): other_count = 1 for (versetag, versetext, lang) in self.verses: if versetag[0] == u'C': - versetype = u'Chorus' + versetype = VerseType.to_string(VerseType.Chorus) elif versetag[0] == u'V': - versetype = u'Verse' + versetype = VerseType.to_string(VerseType.Verse) elif versetag[0] == u'B': - versetype = u'Bridge' + versetype = VerseType.to_string(VerseType.Bridge) elif versetag[0] == u'I': - versetype = u'Intro' + versetype = VerseType.to_string(VerseType.Intro) elif versetag[0] == u'P': - versetype = u'Pre-Chorus' + versetype = VerseType.to_string(VerseType.PreChorus) elif versetag[0] == u'E': - versetype = u'Ending' + versetype = VerseType.to_string(VerseType.Ending) else: newversetag = u'O%d' % other_count verses_changed_to_other[versetag] = newversetag From 032c48df60c295181b39888d56d0a1cb1c1b8d96 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Wed, 16 Feb 2011 17:54:31 +0000 Subject: [PATCH 040/123] Finish grammar corrections, more strings and cleanups --- openlp/core/lib/mediamanageritem.py | 2 +- openlp/core/lib/ui.py | 9 +++---- openlp/core/ui/exceptionform.py | 24 +++++++++---------- openlp/core/ui/mainwindow.py | 12 ++++++---- openlp/core/ui/printserviceorderdialog.py | 4 ++-- openlp/core/ui/serviceitemeditdialog.py | 5 ++-- openlp/core/ui/shortcutlistform.py | 3 ++- openlp/core/ui/themewizard.py | 2 +- openlp/core/ui/wizard.py | 7 +++--- openlp/plugins/alerts/forms/alertdialog.py | 3 +-- openlp/plugins/alerts/lib/alertstab.py | 3 +-- .../plugins/bibles/forms/bibleimportform.py | 7 +++--- openlp/plugins/bibles/lib/osis.py | 4 ++-- .../plugins/custom/forms/editcustomdialog.py | 9 +++---- openlp/plugins/songs/forms/editsongform.py | 6 ++--- openlp/plugins/songs/forms/songexportform.py | 7 +++--- openlp/plugins/songs/forms/songimportform.py | 12 ++++------ .../songs/forms/songmaintenancedialog.py | 5 ++-- openlp/plugins/songs/lib/mediaitem.py | 3 +-- openlp/plugins/songs/lib/songimport.py | 6 ++--- openlp/plugins/songs/lib/ui.py | 2 ++ 21 files changed, 64 insertions(+), 71 deletions(-) diff --git a/openlp/core/lib/mediamanageritem.py b/openlp/core/lib/mediamanageritem.py index 6f446619e..2fb100f30 100644 --- a/openlp/core/lib/mediamanageritem.py +++ b/openlp/core/lib/mediamanageritem.py @@ -475,7 +475,7 @@ class MediaManagerItem(QtGui.QWidget): if not self.listView.selectedIndexes() and not self.remoteTriggered: QtGui.QMessageBox.information(self, UiStrings.NISp, translate('OpenLP.MediaManagerItem', - 'You must select one or more items')) + 'You must select one or more items.')) else: log.debug(u'%s Add requested', self.plugin.name) serviceItem = self.parent.serviceManager.getServiceItem() diff --git a/openlp/core/lib/ui.py b/openlp/core/lib/ui.py index 1e11133f4..e77ad2f10 100644 --- a/openlp/core/lib/ui.py +++ b/openlp/core/lib/ui.py @@ -52,6 +52,8 @@ class UiStrings(object): EmptyField = translate('OpenLP.Ui', 'Empty Field') Error = translate('OpenLP.Ui', 'Error') Export = translate('OpenLP.Ui', 'Export') + FontSizePtUnit = translate('OpenLP.Ui', 'pt', + 'Abbreviated font pointsize unit') Image = translate('OpenLP.Ui', 'Image') Import = translate('OpenLP.Ui', 'Import') LengthTime = unicode(translate('OpenLP.Ui', 'Length %s')) @@ -59,33 +61,32 @@ class UiStrings(object): LiveBGError = translate('OpenLP.Ui', 'Live Background Error') LivePanel = translate('OpenLP.Ui', 'Live Panel') Load = translate('OpenLP.Ui', 'Load') - MediaManager = translate('OpenLP.Ui', 'Media Manager') New = translate('OpenLP.Ui', 'New') + NewService = translate('OpenLP.Ui', 'New Service') NFSs = translate('OpenLP.Ui', 'No File Selected', 'Singular') NFSp = translate('OpenLP.Ui', 'No Files Selected', 'Plural') NISs = translate('OpenLP.Ui', 'No Item Selected', 'Singular') NISp = translate('OpenLP.Ui', 'No Items Selected', 'Plural') OLPV1 = translate('OpenLP.Ui', 'openlp.org 1.x') - NewService = translate('OpenLP.Ui', 'New Service') OLPV2 = translate('OpenLP.Ui', 'OpenLP 2.0') OpenService = translate('OpenLP.Ui', 'Open Service') Preview = translate('OpenLP.Ui', 'Preview') PreviewPanel = translate('OpenLP.Ui', 'Preview Panel') + PrintServiceOrder = translate('OpenLP.Ui', 'Print Service Order') ReplaceBG = translate('OpenLP.Ui', 'Replace Background') ReplaceLiveBG = translate('OpenLP.Ui', 'Replace Live Background') ResetBG = translate('OpenLP.Ui', 'Reset Background') ResetLiveBG = translate('OpenLP.Ui', 'Reset Live Background') S = translate('OpenLP.Ui', 's', 'The abbreviated unit for seconds') + SaveAndPreview = translate('OpenLP.Ui', 'Save && Preview') Search = translate('OpenLP.Ui', 'Search') SelectDelete = translate('OpenLP.Ui', 'You must select an item to delete.') SelectEdit = translate('OpenLP.Ui', 'You must select an item to edit.') SaveService = translate('OpenLP.Ui', 'Save Service') Service = translate('OpenLP.Ui', 'Service') - ServiceManager = translate('OpenLP.Ui', 'Service Manager') StartTimeCode = unicode(translate('OpenLP.Ui', 'Start %s')) Theme = translate('OpenLP.Ui', 'Theme', 'Singular') Themes = translate('OpenLP.Ui', 'Themes', 'Plural') - ThemeManager = translate('OpenLP.Ui', 'Theme Manager') Version = translate('OpenLP.Ui', 'Version') def add_welcome_page(parent, image): diff --git a/openlp/core/ui/exceptionform.py b/openlp/core/ui/exceptionform.py index cb3cc4ef4..023bb6b36 100644 --- a/openlp/core/ui/exceptionform.py +++ b/openlp/core/ui/exceptionform.py @@ -35,24 +35,24 @@ from PyQt4 import Qt, QtCore, QtGui try: from PyQt4.phonon import Phonon - phonon_version = Phonon.phononVersion() + PHONON_VERSION = Phonon.phononVersion() except ImportError: - phonon_version = u'-' + PHONON_VERSION = u'-' try: import chardet - chardet_version = chardet.__version__ + CHARDET_VERSION = chardet.__version__ except ImportError: - chardet_version = u'-' + CHARDET_VERSION = u'-' try: import enchant - enchant_version = enchant.__version__ + ENCHANT_VERSION = enchant.__version__ except ImportError: - enchant_version = u'-' + ENCHANT_VERSION = u'-' try: import sqlite - sqlite_version = sqlite.version + SQLITE_VERSION = sqlite.version except ImportError: - sqlite_version = u'-' + SQLITE_VERSION = u'-' from openlp.core.lib import translate, SettingsManager from openlp.core.lib.mailto import mailto @@ -85,14 +85,14 @@ class ExceptionForm(QtGui.QDialog, Ui_ExceptionDialog): 'Platform: %s\n')) % platform.platform() libraries = u'Python: %s\n' % platform.python_version() + \ u'Qt4: %s\n' % Qt.qVersion() + \ - u'Phonon: %s\n' % phonon_version + \ + u'Phonon: %s\n' % PHONON_VERSION + \ u'PyQt4: %s\n' % Qt.PYQT_VERSION_STR + \ u'SQLAlchemy: %s\n' % sqlalchemy.__version__ + \ u'BeautifulSoup: %s\n' % BeautifulSoup.__version__ + \ u'lxml: %s\n' % etree.__version__ + \ - u'Chardet: %s\n' % chardet_version + \ - u'PyEnchant: %s\n' % enchant_version + \ - u'PySQLite: %s\n' % sqlite_version + u'Chardet: %s\n' % CHARDET_VERSION + \ + u'PyEnchant: %s\n' % ENCHANT_VERSION + \ + u'PySQLite: %s\n' % SQLITE_VERSION if platform.system() == u'Linux': if os.environ.get(u'KDE_FULL_SESSION') == u'true': system = system + u'Desktop: KDE SC\n' diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index 2ef1f834f..30afe4d13 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -312,9 +312,12 @@ class Ui_MainWindow(object): self.SettingsLanguageMenu.setTitle(translate('OpenLP.MainWindow', '&Language')) self.HelpMenu.setTitle(translate('OpenLP.MainWindow', '&Help')) - self.mediaManagerDock.setWindowTitle(UiStrings.MediaManager) - self.serviceManagerDock.setWindowTitle(UiStrings.ServiceManager) - self.themeManagerDock.setWindowTitle(UiStrings.ThemeManager) + self.mediaManagerDock.setWindowTitle( + translate('OpenLP.MainWindow', 'Media Manager')) + self.serviceManagerDock.setWindowTitle( + translate('OpenLP.MainWindow', 'Service Manager')) + self.themeManagerDock.setWindowTitle( + translate('OpenLP.MainWindow', 'Theme Manager')) self.FileNewItem.setText(translate('OpenLP.MainWindow', '&New')) self.FileNewItem.setToolTip(UiStrings.NewService) self.FileNewItem.setStatusTip(UiStrings.CreateService) @@ -337,8 +340,7 @@ class Ui_MainWindow(object): 'Save the current service under a new name.')) self.FileSaveAsItem.setShortcut( translate('OpenLP.MainWindow', 'Ctrl+Shift+S')) - self.printServiceOrderItem.setText( - translate('OpenLP.MainWindow', 'Print Service Order')) + self.printServiceOrderItem.setText(UiStrings.PrintServiceOrder) self.printServiceOrderItem.setStatusTip(translate('OpenLP.MainWindow', 'Print the current Service Order.')) self.printServiceOrderItem.setShortcut( diff --git a/openlp/core/ui/printserviceorderdialog.py b/openlp/core/ui/printserviceorderdialog.py index f8db4d1c0..22f8e9292 100644 --- a/openlp/core/ui/printserviceorderdialog.py +++ b/openlp/core/ui/printserviceorderdialog.py @@ -27,6 +27,7 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import build_icon, translate, SpellTextEdit +from openlp.core.lib.ui import UiStrings class Ui_PrintServiceOrderDialog(object): def setupUi(self, printServiceOrderDialog): @@ -116,8 +117,7 @@ class Ui_PrintServiceOrderDialog(object): QtCore.QMetaObject.connectSlotsByName(printServiceOrderDialog) def retranslateUi(self, printServiceOrderDialog): - printServiceOrderDialog.setWindowTitle( - translate('OpenLP.PrintServiceOrderForm', 'Print Service Order')) + printServiceOrderDialog.setWindowTitle(UiStrings.PrintServiceOrder) self.previewLabel.setText( translate('OpenLP.ServiceManager', 'Preview:')) self.printSlideTextCheckBox.setText(translate( diff --git a/openlp/core/ui/serviceitemeditdialog.py b/openlp/core/ui/serviceitemeditdialog.py index 0f9ddb4ac..ef7e99a5f 100644 --- a/openlp/core/ui/serviceitemeditdialog.py +++ b/openlp/core/ui/serviceitemeditdialog.py @@ -27,7 +27,7 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import translate -from openlp.core.lib.ui import UiStrings, create_accept_reject_button_box, \ +from openlp.core.lib.ui import create_accept_reject_button_box, \ create_delete_push_button, create_up_down_push_button_set class Ui_ServiceItemEditDialog(object): @@ -41,8 +41,7 @@ class Ui_ServiceItemEditDialog(object): self.dialogLayout.addWidget(self.listWidget, 0, 0) self.buttonLayout = QtGui.QVBoxLayout() self.buttonLayout.setObjectName(u'buttonLayout') - self.deleteButton = create_delete_push_button( - serviceItemEditDialog, UiStrings.Service.toLower()) + self.deleteButton = create_delete_push_button(serviceItemEditDialog) self.buttonLayout.addWidget(self.deleteButton) self.buttonLayout.addStretch() self.upButton, self.downButton = create_up_down_push_button_set( diff --git a/openlp/core/ui/shortcutlistform.py b/openlp/core/ui/shortcutlistform.py index 0de4bea7f..240bbf93c 100644 --- a/openlp/core/ui/shortcutlistform.py +++ b/openlp/core/ui/shortcutlistform.py @@ -101,7 +101,8 @@ class ShortcutListForm(QtGui.QDialog, Ui_ShortcutListDialog): else: shortcutText = action.shortcut().toString() alternateText = u'' - actionItem = QtGui.QTreeWidgetItem([actionText, shortcutText, alternateText]) + actionItem = QtGui.QTreeWidgetItem( + [actionText, shortcutText, alternateText]) actionItem.setIcon(0, action.icon()) item.addChild(actionItem) item.setExpanded(True) diff --git a/openlp/core/ui/themewizard.py b/openlp/core/ui/themewizard.py index 281e216d3..fc25e11fa 100644 --- a/openlp/core/ui/themewizard.py +++ b/openlp/core/ui/themewizard.py @@ -470,7 +470,7 @@ class Ui_ThemeWizard(object): self.footerFontLabel.setText(translate('OpenLP.ThemeWizard', 'Font:')) self.footerColorLabel.setText(translate('OpenLP.ThemeWizard', 'Color:')) self.footerSizeLabel.setText(translate('OpenLP.ThemeWizard', 'Size:')) - self.footerSizeSpinBox.setSuffix(translate('OpenLP.ThemeWizard', 'pt')) + self.footerSizeSpinBox.setSuffix(UiStrings.FontSizePtUnit) self.alignmentPage.setTitle( translate('OpenLP.ThemeWizard', 'Text Formatting Details')) self.alignmentPage.setSubTitle( diff --git a/openlp/core/ui/wizard.py b/openlp/core/ui/wizard.py index 7e9511c33..2960607e4 100644 --- a/openlp/core/ui/wizard.py +++ b/openlp/core/ui/wizard.py @@ -55,8 +55,9 @@ class WizardStrings(object): SSP = u'SongShow Plus' WoW = u'Words of Worship' # These strings should need a good reason to be retranslated elsewhere. + FinishedImport = translate('OpenLP.Ui', 'Finished import.') FormatLabel = translate('OpenLP.Ui', 'Format:') - Header = u'%s' + HeaderStyle = u'%s' Importing = translate('OpenLP.Ui', 'Importing') ImportingType = unicode(translate('OpenLP.Ui', 'Importing "%s"...')) ImportSelect = translate('OpenLP.Ui', 'Select Import Source') @@ -67,6 +68,7 @@ class WizardStrings(object): 'importer, you will need to install the "python-sqlite" ' 'module.') OpenTypeFile = unicode(translate('OpenLP.Ui', 'Open %s File')) + PercentSymbolFormat = unicode(translate('OpenLP.Ui', '%p%')) Ready = translate('OpenLP.Ui', 'Ready.') StartingImport = translate('OpenLP.Ui', 'Starting import...') YouSpecifyFile = unicode(translate('OpenLP.Ui', 'You need to specify at ' @@ -78,11 +80,10 @@ class OpenLPWizard(QtGui.QWizard): Generic OpenLP wizard to provide generic functionality and a unified look and feel. """ - def __init__(self, parent, plugin, name, image, direction): + def __init__(self, parent, plugin, name, image): QtGui.QWizard.__init__(self, parent) self.plugin = plugin self.setObjectName(name) - self.direction = direction self.openIcon = build_icon(u':/general/general_open.png') self.deleteIcon = build_icon(u':/general/general_delete.png') self.finishButton = self.button(QtGui.QWizard.FinishButton) diff --git a/openlp/plugins/alerts/forms/alertdialog.py b/openlp/plugins/alerts/forms/alertdialog.py index 11596b700..93f7ead06 100644 --- a/openlp/plugins/alerts/forms/alertdialog.py +++ b/openlp/plugins/alerts/forms/alertdialog.py @@ -66,8 +66,7 @@ class Ui_AlertDialog(object): self.saveButton.setIcon(build_icon(u':/general/general_save.png')) self.saveButton.setObjectName(u'saveButton') self.manageButtonLayout.addWidget(self.saveButton) - self.deleteButton = create_delete_push_button(alertDialog, - self.parent.nameStrings[u'singular'].toLower()) + self.deleteButton = create_delete_push_button(alertDialog) self.deleteButton.setEnabled(False) self.manageButtonLayout.addWidget(self.deleteButton) self.manageButtonLayout.addStretch() diff --git a/openlp/plugins/alerts/lib/alertstab.py b/openlp/plugins/alerts/lib/alertstab.py index 8c1538e4d..ac7316df2 100644 --- a/openlp/plugins/alerts/lib/alertstab.py +++ b/openlp/plugins/alerts/lib/alertstab.py @@ -109,8 +109,7 @@ class AlertsTab(SettingsTab): translate('AlertsPlugin.AlertsTab', 'Background color:')) self.FontSizeLabel.setText( translate('AlertsPlugin.AlertsTab', 'Font size:')) - self.FontSizeSpinBox.setSuffix( - translate('AlertsPlugin.AlertsTab', 'pt')) + self.FontSizeSpinBox.setSuffix(UiStrings.FontSizePtUnit) self.TimeoutLabel.setText( translate('AlertsPlugin.AlertsTab', 'Alert timeout:')) self.TimeoutSpinBox.setSuffix(UiStrings.S) diff --git a/openlp/plugins/bibles/forms/bibleimportform.py b/openlp/plugins/bibles/forms/bibleimportform.py index b3b7aeb7e..83e7065ac 100644 --- a/openlp/plugins/bibles/forms/bibleimportform.py +++ b/openlp/plugins/bibles/forms/bibleimportform.py @@ -88,7 +88,7 @@ class BibleImportForm(OpenLPWizard): self.manager = manager self.web_bible_list = {} OpenLPWizard.__init__(self, parent, bibleplugin, u'bibleImportWizard', - u':/wizards/wizard_importbible.bmp', UiStrings.Import) + u':/wizards/wizard_importbible.bmp') def setupUi(self, image): """ @@ -363,7 +363,7 @@ class BibleImportForm(OpenLPWizard): """ self.setWindowTitle( translate('BiblesPlugin.ImportWizardForm', 'Bible Import Wizard')) - self.titleLabel.setText(WizardStrings.Header % + self.titleLabel.setText(WizardStrings.HeaderStyle % translate('OpenLP.Ui', 'Welcome to the Bible Import Wizard')) self.informationLabel.setText( translate('BiblesPlugin.ImportWizardForm', @@ -768,8 +768,7 @@ class BibleImportForm(OpenLPWizard): 'bible. Please note, that verses will be downloaded on\n' 'demand and thus an internet connection is required.')) else: - self.progressLabel.setText(translate( - 'BiblesPlugin.ImportWizardForm', 'Finished import.')) + self.progressLabel.setText(WizardStrings.FinishedImport) else: self.progressLabel.setText(translate( 'BiblesPlugin.ImportWizardForm', 'Your Bible import failed.')) diff --git a/openlp/plugins/bibles/lib/osis.py b/openlp/plugins/bibles/lib/osis.py index 4a001987d..d21227090 100644 --- a/openlp/plugins/bibles/lib/osis.py +++ b/openlp/plugins/bibles/lib/osis.py @@ -69,7 +69,7 @@ class OSISBible(BibleDB): self.q1_regex = re.compile(r'') self.q2_regex = re.compile(r'') self.trans_regex = re.compile(r'(.*?)') - self.divineName_regex = re.compile( + self.divine_name_regex = re.compile( r'(.*?)') self.spaces_regex = re.compile(r'([ ]{2,})') filepath = os.path.join( @@ -161,7 +161,7 @@ class OSISBible(BibleDB): verse_text = self.q1_regex.sub(u'"', verse_text) verse_text = self.q2_regex.sub(u'\'', verse_text) verse_text = self.trans_regex.sub(u'', verse_text) - verse_text = self.divineName_regex.sub(u'', verse_text) + verse_text = self.divine_name_regex.sub(u'', verse_text) verse_text = verse_text.replace(u'', u'')\ .replace(u'', u'').replace(u'', u'')\ .replace(u'', u'').replace(u'', u'')\ diff --git a/openlp/plugins/custom/forms/editcustomdialog.py b/openlp/plugins/custom/forms/editcustomdialog.py index e63c057d0..8746d5548 100644 --- a/openlp/plugins/custom/forms/editcustomdialog.py +++ b/openlp/plugins/custom/forms/editcustomdialog.py @@ -26,7 +26,7 @@ from PyQt4 import QtCore, QtGui -from openlp.core.lib import StringContent, build_icon, translate +from openlp.core.lib import build_icon, translate from openlp.core.lib.ui import UiStrings, create_accept_reject_button_box, \ create_delete_push_button, create_up_down_push_button_set @@ -66,9 +66,7 @@ class Ui_CustomEditDialog(object): self.editAllButton = QtGui.QPushButton(customEditDialog) self.editAllButton.setObjectName(u'editAllButton') self.buttonLayout.addWidget(self.editAllButton) - self.deleteButton = create_delete_push_button(customEditDialog, - customEditDialog.parent.getString( - StringContent.Name)[u'singular'].toLower()) + self.deleteButton = create_delete_push_button(customEditDialog) self.deleteButton.setEnabled(False) self.buttonLayout.addWidget(self.deleteButton) self.buttonLayout.addStretch() @@ -126,5 +124,4 @@ class Ui_CustomEditDialog(object): translate('CustomPlugin.EditCustomForm', 'The&me:')) self.creditLabel.setText( translate('CustomPlugin.EditCustomForm', '&Credits:')) - self.previewButton.setText( - translate('CustomPlugin.EditCustomForm', 'Save && Preview')) + self.previewButton.setText(UiStrings.SaveAndPreview) diff --git a/openlp/plugins/songs/forms/editsongform.py b/openlp/plugins/songs/forms/editsongform.py index 9874b7952..6a8946c78 100644 --- a/openlp/plugins/songs/forms/editsongform.py +++ b/openlp/plugins/songs/forms/editsongform.py @@ -35,6 +35,7 @@ from openlp.core.lib.ui import UiStrings, add_widget_completer, \ from openlp.plugins.songs.forms import EditVerseForm from openlp.plugins.songs.lib import SongXML, VerseType from openlp.plugins.songs.lib.db import Book, Song, Author, Topic +from openlp.plugins.songs.lib.ui import SongStrings from editsongdialog import Ui_EditSongDialog log = logging.getLogger(__name__) @@ -95,8 +96,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): QtCore.SIGNAL(u'theme_update_list'), self.loadThemes) self.previewButton = QtGui.QPushButton() self.previewButton.setObjectName(u'previewButton') - self.previewButton.setText( - translate('SongsPlugin.EditSongForm', 'Save && Preview')) + self.previewButton.setText(UiStrings.SaveAndPreview) self.buttonBox.addButton( self.previewButton, QtGui.QDialogButtonBox.ActionRole) QtCore.QObject.connect(self.buttonBox, @@ -598,7 +598,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): def onCopyrightInsertButtonTriggered(self): text = self.copyrightEdit.text() pos = self.copyrightEdit.cursorPosition() - sign = translate('SongsPlugin.EditSongForm', '\xa9') + sign = SongStrings.CopyrightSymbol text = text[:pos] + sign + text[pos:] self.copyrightEdit.setText(text) self.copyrightEdit.setFocus() diff --git a/openlp/plugins/songs/forms/songexportform.py b/openlp/plugins/songs/forms/songexportform.py index 231e9ff19..202150394 100644 --- a/openlp/plugins/songs/forms/songexportform.py +++ b/openlp/plugins/songs/forms/songexportform.py @@ -57,7 +57,7 @@ class SongExportForm(OpenLPWizard): The songs plugin. """ OpenLPWizard.__init__(self, parent, plugin, u'songExportWizard', - u':/wizards/wizard_exportsong.bmp', UiStrings.Export) + u':/wizards/wizard_exportsong.bmp') self.stop_export_flag = False QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'openlp_stop_wizard'), self.stop_export) @@ -164,7 +164,7 @@ class SongExportForm(OpenLPWizard): """ self.setWindowTitle( translate('SongsPlugin.ExportWizardForm', 'Song Export Wizard')) - self.titleLabel.setText(WizardStrings.Header % + self.titleLabel.setText(WizardStrings.HeaderStyle % translate('OpenLP.Ui', 'Welcome to the Song Export Wizard')) self.informationLabel.setText( translate('SongsPlugin.ExportWizardForm', 'This wizard will help to' @@ -193,8 +193,7 @@ class SongExportForm(OpenLPWizard): translate('SongsPlugin.ExportWizardForm', 'Please wait while your songs are exported.')) self.progressLabel.setText(WizardStrings.Ready) - self.progressBar.setFormat( - translate('SongsPlugin.ExportWizardForm', '%p%')) + self.progressBar.setFormat(WizardStrings.PercentSymbolFormat) def validateCurrentPage(self): """ diff --git a/openlp/plugins/songs/forms/songimportform.py b/openlp/plugins/songs/forms/songimportform.py index aa65501b3..eef0a7004 100644 --- a/openlp/plugins/songs/forms/songimportform.py +++ b/openlp/plugins/songs/forms/songimportform.py @@ -56,7 +56,7 @@ class SongImportForm(OpenLPWizard): The songs plugin. """ OpenLPWizard.__init__(self, parent, plugin, u'songImportWizard', - u':/wizards/wizard_importsong.bmp', UiStrings.Import) + u':/wizards/wizard_importsong.bmp') def setupUi(self, image): """ @@ -207,7 +207,7 @@ class SongImportForm(OpenLPWizard): """ self.setWindowTitle( translate('SongsPlugin.ImportWizardForm', 'Song Import Wizard')) - self.titleLabel.setText(WizardStrings.Header % + self.titleLabel.setText(WizardStrings.HeaderStyle % translate('OpenLP.Ui', 'Welcome to the Song Import Wizard')) self.informationLabel.setText( translate('SongsPlugin.ImportWizardForm', @@ -305,8 +305,7 @@ class SongImportForm(OpenLPWizard): translate('SongsPlugin.ImportWizardForm', 'Please wait while your songs are imported.')) self.progressLabel.setText(WizardStrings.Ready) - self.progressBar.setFormat( - translate('SongsPlugin.ImportWizardForm', '%p%')) + self.progressBar.setFormat(WizardStrings.PercentSymbolFormat) # Align all QFormLayouts towards each other. width = max(self.formatLabel.minimumSizeHint().width(), self.openLP2FilenameLabel.minimumSizeHint().width()) @@ -367,7 +366,7 @@ class SongImportForm(OpenLPWizard): if self.genericFileListWidget.count() == 0: critical_error_message_box(UiStrings.NFSp, translate('SongsPlugin.ImportWizardForm', - 'You need to add at least one document or ' + 'You need to specify at least one document or ' 'presentation file to import from.')) self.genericAddButton.setFocus() return False @@ -693,8 +692,7 @@ class SongImportForm(OpenLPWizard): filenames=self.getListOfFiles(self.songShowPlusFileListWidget) ) if importer.do_import(): - self.progressLabel.setText( - translate('SongsPlugin.SongImportForm', 'Finished import.')) + self.progressLabel.setText(WizardStrings.FinishedImport) else: self.progressLabel.setText( translate('SongsPlugin.SongImportForm', diff --git a/openlp/plugins/songs/forms/songmaintenancedialog.py b/openlp/plugins/songs/forms/songmaintenancedialog.py index d17442b4c..0316ab42b 100644 --- a/openlp/plugins/songs/forms/songmaintenancedialog.py +++ b/openlp/plugins/songs/forms/songmaintenancedialog.py @@ -26,7 +26,7 @@ from PyQt4 import QtCore, QtGui -from openlp.core.lib import build_icon, translate +from openlp.core.lib import build_icon from openlp.core.lib.ui import UiStrings from openlp.plugins.songs.lib.ui import SongStrings @@ -145,8 +145,7 @@ class Ui_SongMaintenanceDialog(object): QtCore.QMetaObject.connectSlotsByName(songMaintenanceDialog) def retranslateUi(self, songMaintenanceDialog): - songMaintenanceDialog.setWindowTitle( - translate('SongsPlugin.SongMaintenanceForm', 'Song Maintenance')) + songMaintenanceDialog.setWindowTitle(SongStrings.SongMaintenance) self.listItemAuthors.setText(SongStrings.Authors) self.listItemTopics.setText(SongStrings.Topics) self.listItemBooks.setText(SongStrings.SongBooks) diff --git a/openlp/plugins/songs/lib/mediaitem.py b/openlp/plugins/songs/lib/mediaitem.py index 6e0c9537d..9666a9351 100644 --- a/openlp/plugins/songs/lib/mediaitem.py +++ b/openlp/plugins/songs/lib/mediaitem.py @@ -137,8 +137,7 @@ class SongMediaItem(MediaManagerItem): def retranslateUi(self): self.searchTextLabel.setText(u'%s:' % UiStrings.Search) self.searchTextButton.setText(UiStrings.Search) - self.maintenanceAction.setText( - translate('SongsPlugin.MediaItem', 'Song Maintenance')) + self.maintenanceAction.setText(SongStrings.SongMaintenance) self.maintenanceAction.setToolTip(translate('SongsPlugin.MediaItem', 'Maintain the lists of authors, topics and books')) diff --git a/openlp/plugins/songs/lib/songimport.py b/openlp/plugins/songs/lib/songimport.py index 7f0e622bd..79379106d 100644 --- a/openlp/plugins/songs/lib/songimport.py +++ b/openlp/plugins/songs/lib/songimport.py @@ -81,8 +81,6 @@ class SongImport(QtCore.QObject): self.versecounts = {} self.copyright_string = unicode(translate( 'SongsPlugin.SongImport', 'copyright')) - self.copyright_symbol = unicode(translate( - 'SongsPlugin.SongImport', '\xa9')) def stop_import(self): """ @@ -137,12 +135,12 @@ class SongImport(QtCore.QObject): def process_verse_text(self, text): lines = text.split(u'\n') if text.lower().find(self.copyright_string) >= 0 \ - or text.lower().find(self.copyright_symbol) >= 0: + or text.lower().find(SongStrings.CopyrightSymbol) >= 0: copyright_found = False for line in lines: if (copyright_found or line.lower().find(self.copyright_string) >= 0 or - line.lower().find(self.copyright_symbol) >= 0): + line.lower().find(SongStrings.CopyrightSymbol) >= 0): copyright_found = True self.add_copyright(line) else: diff --git a/openlp/plugins/songs/lib/ui.py b/openlp/plugins/songs/lib/ui.py index 85d609762..65f473e63 100644 --- a/openlp/plugins/songs/lib/ui.py +++ b/openlp/plugins/songs/lib/ui.py @@ -38,7 +38,9 @@ class SongStrings(object): Authors = translate('OpenLP.Ui', 'Authors', 'Plural') AuthorUnknown = translate('OpenLP.Ui', 'Author Unknown') # Used in the UI. AuthorUnknownUnT = u'Author Unknown' # Used to populate the database. + CopyrightSymbol = translate('OpenLP.Ui', '\xa9', 'Copyright symbol.') SongBook = translate('OpenLP.Ui', 'Song Book', 'Singular') SongBooks = translate('OpenLP.Ui', 'Song Books', 'Plural') + SongMaintenance = translate('OpenLP.Ui', 'Song Maintenance') Topic = translate('OpenLP.Ui', 'Topic', 'Singular') Topics = translate('OpenLP.Ui', 'Topics', 'Plural') From 89181e387dfa9193cccb8190eb52101a52c26716 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20P=C3=B5ldaru?= Date: Wed, 16 Feb 2011 20:37:51 +0200 Subject: [PATCH 041/123] VerseType changes --- openlp/plugins/songs/lib/__init__.py | 161 +++++++++++++++++++-------- 1 file changed, 115 insertions(+), 46 deletions(-) diff --git a/openlp/plugins/songs/lib/__init__.py b/openlp/plugins/songs/lib/__init__.py index c763d70b9..4adeb5345 100644 --- a/openlp/plugins/songs/lib/__init__.py +++ b/openlp/plugins/songs/lib/__init__.py @@ -39,69 +39,138 @@ class VerseType(object): Intro = 4 Ending = 5 Other = 6 + Tags = [ + u'v', + u'c', + u'b', + u'p', + u'i', + u'e', + u'o'] + Names = [ + u'Verse', + u'Chorus', + u'Bridge', + u'Pre-Chorus', + u'Intro', + u'Ending', + u'Other'] + Translations = [ + translate('SongsPlugin.VerseType', 'Verse'), + translate('SongsPlugin.VerseType', 'Chorus'), + translate('SongsPlugin.VerseType', 'Bridge'), + translate('SongsPlugin.VerseType', 'Pre-Chorus'), + translate('SongsPlugin.VerseType', 'Intro'), + translate('SongsPlugin.VerseType', 'Ending'), + translate('SongsPlugin.VerseType', 'Other')] @staticmethod - def to_string(verse_type): + def tag(verse_type, strict=False): """ - Return a string for a given VerseType + Return a string for a given VerseType tag + + ``verse_type`` + The verse type to return a string for + + ``strict`` + If strict, False is returned instead of Other, when not found + """ + if isinstance(verse_type, int): + if verse_type >=0 and verse_type <= 6: + return VerseType.Tags[verse_type] + else: + return self.returnvalue(VerseType.Tags, strict) + elif verse_type[0].lower() in VerseType.Tags: + return verse_type[0].lower() + else: + return VerseType.returnvalue(VerseType.Tags, strict) + + @staticmethod + def to_string(verse_type, strict=False): + """ + Return a string for a given VerseType Name ``verse_type`` The type to return a string for + + ``strict`` + If strict, False is returned instead of Other, when not found """ - if not isinstance(verse_type, int): - verse_type = verse_type.lower() - if verse_type == VerseType.Verse or verse_type == \ - unicode(VerseType.to_string(VerseType.Verse)).lower()[0]: - return translate('SongsPlugin.VerseType', 'Verse') - elif verse_type == VerseType.Chorus or verse_type == \ - unicode(VerseType.to_string(VerseType.Chorus)).lower()[0]: - return translate('SongsPlugin.VerseType', 'Chorus') - elif verse_type == VerseType.Bridge or verse_type == \ - unicode(VerseType.to_string(VerseType.Bridge)).lower()[0]: - return translate('SongsPlugin.VerseType', 'Bridge') - elif verse_type == VerseType.PreChorus or verse_type == \ - unicode(VerseType.to_string(VerseType.PreChorus)).lower()[0]: - return translate('SongsPlugin.VerseType', 'Pre-Chorus') - elif verse_type == VerseType.Intro or verse_type == \ - unicode(VerseType.to_string(VerseType.Intro)).lower()[0]: - return translate('SongsPlugin.VerseType', 'Intro') - elif verse_type == VerseType.Ending or verse_type == \ - unicode(VerseType.to_string(VerseType.Ending)).lower()[0]: - return translate('SongsPlugin.VerseType', 'Ending') - elif verse_type == VerseType.Other or verse_type == \ - unicode(VerseType.to_string(VerseType.Other)).lower()[0]: - return translate('SongsPlugin.VerseType', 'Other') + if isinstance(verse_type, int): + if verse_type >=0 and verse_type <= 6: + return VerseType.Names[verse_type] + else: + return self.returnvalue(VerseType.Names, strict) + else: + verse_type = verse_type[0].lower() + for num, tag in enumerate(VerseType.Tags): + if verse_type == tag: + return VerseType.Names[num] + return VerseType.returnvalue(VerseType.Names, strict) @staticmethod - def from_string(verse_type): + def to_translated_string(verse_type, strict=False): + """ + Return a string for a given VerseType Name + + ``verse_type`` + The type to return a string for + + ``strict`` + If strict, False is returned instead of Other, when not found + """ + if isinstance(verse_type, int): + if verse_type >=0 and verse_type <= 6: + return VerseType.Translations[verse_type] + else: + return self.returnvalue(VerseType.Translations, strict) + else: + verse_type = verse_type[0].lower() + for num, tag in enumerate(VerseType.Tags): + if verse_type == tag: + return VerseType.Translations[num] + return VerseType.returnvalue(VerseType.Translations, strict) + + @staticmethod + def from_string(verse_type, strict=False): """ Return the VerseType for a given string ``verse_type`` The string to return a VerseType for + + ``strict`` + If strict, False is returned instead of Other, when not found """ verse_type = verse_type.lower() - if verse_type == unicode(VerseType.to_string(VerseType.Verse)).lower(): - return VerseType.Verse - elif verse_type == \ - unicode(VerseType.to_string(VerseType.Chorus)).lower(): - return VerseType.Chorus - elif verse_type == \ - unicode(VerseType.to_string(VerseType.Bridge)).lower(): - return VerseType.Bridge - elif verse_type == \ - unicode(VerseType.to_string(VerseType.PreChorus)).lower(): - return VerseType.PreChorus - elif verse_type == \ - unicode(VerseType.to_string(VerseType.Intro)).lower(): - return VerseType.Intro - elif verse_type == \ - unicode(VerseType.to_string(VerseType.Ending)).lower(): - return VerseType.Ending - elif verse_type == \ - unicode(VerseType.to_string(VerseType.Other)).lower(): - return VerseType.Other + for num, string in enumerate(VerseType.Names): + if verse_type == string: + return num + return VerseType.returnvalue(range(0,7), strict) + @staticmethod + def from_translated_string(verse_type, strict=False): + """ + Return the VerseType for a given string + + ``verse_type`` + The string to return a VerseType for + + ``strict`` + If strict, False is returned instead of Other, when not found + """ + verse_type = verse_type.lower() + for num, translation in enumerate(VerseType.Translations): + if verse_type == translation: + return num + return VerseType.returnvalue(range(0,7), strict) + + @staticmethod + def returnvalue(lst, strict): + if strict: + return False + else: + return lst[VerseType.Other] def retrieve_windows_encoding(recommendation=None): """ From 425ec8ece0636ac0ec66135c9bd109ecf9ee1db1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20P=C3=B5ldaru?= Date: Wed, 16 Feb 2011 21:09:06 +0200 Subject: [PATCH 042/123] more changes reflecting VerseType changes --- openlp/plugins/songs/lib/opensongimport.py | 4 ++-- openlp/plugins/songs/lib/songimport.py | 21 ++++++--------------- 2 files changed, 8 insertions(+), 17 deletions(-) diff --git a/openlp/plugins/songs/lib/opensongimport.py b/openlp/plugins/songs/lib/opensongimport.py index 29648214e..320339f36 100644 --- a/openlp/plugins/songs/lib/opensongimport.py +++ b/openlp/plugins/songs/lib/opensongimport.py @@ -210,7 +210,7 @@ class OpenSongImport(SongImport): # keep track of verses appearance order our_verse_order = [] # default versetype - versetype = u'V' + versetype = u'v' versenum = u'1' # for the case where song has several sections with same marker inst = 1 @@ -285,7 +285,7 @@ class OpenSongImport(SongImport): versetype = match.group(1) versenum = match.group(2) if not len(versetype): - versetype = u'V' + versetype = u'v' else: # Assume it's no.1 if there are no digits versetype = tag diff --git a/openlp/plugins/songs/lib/songimport.py b/openlp/plugins/songs/lib/songimport.py index ad18b57ef..f4a43c3b4 100644 --- a/openlp/plugins/songs/lib/songimport.py +++ b/openlp/plugins/songs/lib/songimport.py @@ -200,7 +200,7 @@ class SongImport(QtCore.QObject): return self.media_files.append(filename) - def add_verse(self, versetext, versetag=u'V', lang=None): + def add_verse(self, versetext, versetag=u'v', lang=None): """ Add a verse. This is the whole verse, lines split by \\n. It will also attempt to detect duplicates. In this case it will just add to the verse @@ -278,23 +278,14 @@ class SongImport(QtCore.QObject): sxml = SongXML() other_count = 1 for (versetag, versetext, lang) in self.verses: - if versetag[0] == u'C': - versetype = VerseType.to_string(VerseType.Chorus) - elif versetag[0] == u'V': - versetype = VerseType.to_string(VerseType.Verse) - elif versetag[0] == u'B': - versetype = VerseType.to_string(VerseType.Bridge) - elif versetag[0] == u'I': - versetype = VerseType.to_string(VerseType.Intro) - elif versetag[0] == u'P': - versetype = VerseType.to_string(VerseType.PreChorus) - elif versetag[0] == u'E': - versetype = VerseType.to_string(VerseType.Ending) + if versetag[0].lower() in VerseType.Tags: + versetype = versetag[0].lower() else: - newversetag = u'O%d' % other_count + newversetag = u'%s%d' % (VerseType.Tags[VerseType.Other], + other_count) verses_changed_to_other[versetag] = newversetag other_count += 1 - versetype = VerseType.to_string(VerseType.Other) + versetype = VerseType.Tags[VerseType.Other] log.info(u'Versetype %s changing to %s' , versetag, newversetag) versetag = newversetag sxml.add_verse_to_lyrics(versetype, versetag[1:], versetext, lang) From 18f43fc8589df13160085a37b0cc447d9984bc12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20P=C3=B5ldaru?= Date: Wed, 16 Feb 2011 21:28:55 +0200 Subject: [PATCH 043/123] more lower case tags --- openlp/plugins/songs/lib/opensongimport.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/openlp/plugins/songs/lib/opensongimport.py b/openlp/plugins/songs/lib/opensongimport.py index 320339f36..36d46b903 100644 --- a/openlp/plugins/songs/lib/opensongimport.py +++ b/openlp/plugins/songs/lib/opensongimport.py @@ -231,7 +231,7 @@ class OpenSongImport(SongImport): if thisline.startswith(u'['): # drop the square brackets right_bracket = thisline.find(u']') - content = thisline[1:right_bracket].upper() + content = thisline[1:right_bracket].lower() # have we got any digits? # If so, versenumber is everything from the digits # to the end (even if there are some alpha chars on the end) @@ -276,9 +276,9 @@ class OpenSongImport(SongImport): # figure out the presentation order, if present if u'presentation' in fields and root.presentation != u'': order = unicode(root.presentation) - # We make all the tags in the lyrics upper case, so match that here + # We make all the tags in the lyrics lower case, so match that here # and then split into a list on the whitespace - order = order.upper().split() + order = order.lower().split() for tag in order: match = re.match(u'(.*)(\d+.*)', tag) if match is not None: From e401bc851d59e0eb416fc2132bd679bc693adf02 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Thu, 17 Feb 2011 02:33:12 +0000 Subject: [PATCH 044/123] Some naming cleanups --- openlp/core/lib/mediamanageritem.py | 9 ++--- openlp/core/ui/mainwindow.py | 34 +++++++++---------- openlp/core/ui/themestab.py | 2 +- openlp/plugins/images/lib/mediaitem.py | 4 +-- openlp/plugins/media/lib/mediaitem.py | 10 +++--- openlp/plugins/presentations/lib/mediaitem.py | 4 +-- 6 files changed, 32 insertions(+), 31 deletions(-) diff --git a/openlp/core/lib/mediamanageritem.py b/openlp/core/lib/mediamanageritem.py index 2fb100f30..8b6731681 100644 --- a/openlp/core/lib/mediamanageritem.py +++ b/openlp/core/lib/mediamanageritem.py @@ -66,10 +66,11 @@ class MediaManagerItem(QtGui.QWidget): When creating a descendant class from this class for your plugin, the following member variables should be set. - ``self.OnNewPrompt`` + ``self.onNewPrompt`` + Defaults to *'Select Image(s)'*. - ``self.OnNewFileMasks`` + ``self.onNewFileMasks`` Defaults to *'Images (*.jpg *jpeg *.gif *.png *.bmp)'*. This assumes that the new action is to load a file. If not, you need to override the ``OnNew`` method. @@ -317,9 +318,9 @@ class MediaManagerItem(QtGui.QWidget): Add a file to the list widget to make it available for showing """ files = QtGui.QFileDialog.getOpenFileNames( - self, self.OnNewPrompt, + self, self.onNewPrompt, SettingsManager.get_last_dir(self.settingsSection), - self.OnNewFileMasks) + self.onNewFileMasks) log.info(u'New files(s) %s', unicode(files)) if files: Receiver.send_message(u'cursor_busy') diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index 30afe4d13..c41ad4b17 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -73,15 +73,15 @@ class Ui_MainWindow(object): # Set up the main container, which contains all the other form widgets. self.MainContent = QtGui.QWidget(mainWindow) self.MainContent.setObjectName(u'MainContent') - self.MainContentLayout = QtGui.QHBoxLayout(self.MainContent) - self.MainContentLayout.setSpacing(0) - self.MainContentLayout.setMargin(0) - self.MainContentLayout.setObjectName(u'MainContentLayout') + self.mainContentLayout = QtGui.QHBoxLayout(self.MainContent) + self.mainContentLayout.setSpacing(0) + self.mainContentLayout.setMargin(0) + self.mainContentLayout.setObjectName(u'mainContentLayout') mainWindow.setCentralWidget(self.MainContent) self.controlSplitter = QtGui.QSplitter(self.MainContent) self.controlSplitter.setOrientation(QtCore.Qt.Horizontal) self.controlSplitter.setObjectName(u'controlSplitter') - self.MainContentLayout.addWidget(self.controlSplitter) + self.mainContentLayout.addWidget(self.controlSplitter) # Create slide controllers self.previewController = SlideController(self, self.settingsmanager, self.screens) @@ -152,10 +152,10 @@ class Ui_MainWindow(object): u'themeManagerDock', u':/system/system_thememanager.png') self.themeManagerDock.setMinimumWidth( self.settingsmanager.mainwindow_right) - self.ThemeManagerContents = ThemeManager(mainWindow, + self.themeManagerContents = ThemeManager(mainWindow, self.themeManagerDock) - self.ThemeManagerContents.setObjectName(u'ThemeManagerContents') - self.themeManagerDock.setWidget(self.ThemeManagerContents) + self.themeManagerContents.setObjectName(u'themeManagerContents') + self.themeManagerDock.setWidget(self.themeManagerContents) mainWindow.addDockWidget(QtCore.Qt.RightDockWidgetArea, self.themeManagerDock) # Create the menu items @@ -256,8 +256,8 @@ class Ui_MainWindow(object): self.HelpOnlineHelpItem = base_action(mainWindow, u'HelpOnlineHelpItem') self.HelpOnlineHelpItem.setEnabled(False) mainWindow.actionList.add_action(self.HelpOnlineHelpItem, u'Help') - self.HelpWebSiteItem = base_action(mainWindow, u'HelpWebSiteItem') - mainWindow.actionList.add_action(self.HelpWebSiteItem, u'Help') + self.helpWebSiteItem = base_action(mainWindow, u'helpWebSiteItem') + mainWindow.actionList.add_action(self.helpWebSiteItem, u'Help') add_actions(self.FileImportMenu, (self.ImportThemeItem, self.ImportLanguageItem)) add_actions(self.FileExportMenu, @@ -281,7 +281,7 @@ class Ui_MainWindow(object): add_actions(self.ToolsMenu, (self.ToolsAddToolItem, None)) add_actions(self.ToolsMenu, (self.ToolsOpenDataFolder, None)) add_actions(self.HelpMenu, (self.HelpDocumentationItem, - self.HelpOnlineHelpItem, None, self.HelpWebSiteItem, + self.HelpOnlineHelpItem, None, self.helpWebSiteItem, self.HelpAboutItem)) add_actions(self.MenuBar, (self.FileMenu.menuAction(), self.viewMenu.menuAction(), self.ToolsMenu.menuAction(), @@ -418,7 +418,7 @@ class Ui_MainWindow(object): translate('OpenLP.MainWindow', 'Ctrl+F1')) self.HelpOnlineHelpItem.setText( translate('OpenLP.MainWindow', '&Online Help')) - self.HelpWebSiteItem.setText( + self.helpWebSiteItem.setText( translate('OpenLP.MainWindow', '&Web Site')) self.AutoLanguageItem.setText( translate('OpenLP.MainWindow', '&Auto Detect')) @@ -491,10 +491,10 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): # Set up signals and slots QtCore.QObject.connect(self.ImportThemeItem, QtCore.SIGNAL(u'triggered()'), - self.ThemeManagerContents.onImportTheme) + self.themeManagerContents.onImportTheme) QtCore.QObject.connect(self.ExportThemeItem, QtCore.SIGNAL(u'triggered()'), - self.ThemeManagerContents.onExportTheme) + self.themeManagerContents.onExportTheme) QtCore.QObject.connect(self.ViewMediaManagerItem, QtCore.SIGNAL(u'triggered(bool)'), self.toggleMediaManager) QtCore.QObject.connect(self.ViewServiceManagerItem, @@ -514,7 +514,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): QtCore.QObject.connect(self.themeManagerDock, QtCore.SIGNAL(u'visibilityChanged(bool)'), self.ViewThemeManagerItem.setChecked) - QtCore.QObject.connect(self.HelpWebSiteItem, + QtCore.QObject.connect(self.helpWebSiteItem, QtCore.SIGNAL(u'triggered()'), self.onHelpWebSiteClicked) QtCore.QObject.connect(self.HelpAboutItem, QtCore.SIGNAL(u'triggered()'), self.onHelpAboutItemClicked) @@ -573,7 +573,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): # RenderManager needs to call ThemeManager and # ThemeManager needs to call RenderManager self.renderManager = RenderManager( - self.ThemeManagerContents, self.screens) + self.themeManagerContents, self.screens) # Define the media Dock Manager self.mediaDockManager = MediaDockManager(self.MediaToolBox) log.info(u'Load Plugins') @@ -607,7 +607,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): self.pluginManager.initialise_plugins() # Once all components are initialised load the Themes log.info(u'Load Themes') - self.ThemeManagerContents.loadThemes() + self.themeManagerContents.loadThemes() log.info(u'Load data from Settings') if QtCore.QSettings().value(u'advanced/save current plugin', QtCore.QVariant(False)).toBool(): diff --git a/openlp/core/ui/themestab.py b/openlp/core/ui/themestab.py index ba4ce5acb..20bd9a183 100644 --- a/openlp/core/ui/themestab.py +++ b/openlp/core/ui/themestab.py @@ -199,7 +199,7 @@ class ThemesTab(SettingsTab): """ Utility method to update the global theme preview image. """ - image = self.parent.ThemeManagerContents.getPreviewImage( + image = self.parent.themeManagerContents.getPreviewImage( self.global_theme) preview = QtGui.QPixmap(unicode(image)) if not preview.isNull(): diff --git a/openlp/plugins/images/lib/mediaitem.py b/openlp/plugins/images/lib/mediaitem.py index 137485eb5..5aa34cc24 100644 --- a/openlp/plugins/images/lib/mediaitem.py +++ b/openlp/plugins/images/lib/mediaitem.py @@ -50,10 +50,10 @@ class ImageMediaItem(MediaManagerItem): QtCore.SIGNAL(u'live_theme_changed'), self.liveThemeChanged) def retranslateUi(self): - self.OnNewPrompt = translate('ImagePlugin.MediaItem', + self.onNewPrompt = translate('ImagePlugin.MediaItem', 'Select Image(s)') file_formats = get_images_filter() - self.OnNewFileMasks = u'%s;;%s (*.*) (*)' % (file_formats, + self.onNewFileMasks = u'%s;;%s (*.*) (*)' % (file_formats, UiStrings.AllFiles) self.replaceAction.setText(UiStrings.ReplaceBG) self.replaceAction.setToolTip(UiStrings.ReplaceLiveBG) diff --git a/openlp/plugins/media/lib/mediaitem.py b/openlp/plugins/media/lib/mediaitem.py index 89db9d993..fd98cdefa 100644 --- a/openlp/plugins/media/lib/mediaitem.py +++ b/openlp/plugins/media/lib/mediaitem.py @@ -58,8 +58,8 @@ class MediaMediaItem(MediaManagerItem): self.videoStart) def retranslateUi(self): - self.OnNewPrompt = translate('MediaPlugin.MediaItem', 'Select Media') - self.OnNewFileMasks = unicode(translate('MediaPlugin.MediaItem', + self.onNewPrompt = translate('MediaPlugin.MediaItem', 'Select Media') + self.onNewFileMasks = unicode(translate('MediaPlugin.MediaItem', 'Videos (%s);;Audio (%s);;%s (*)')) % (self.parent.video_list, self.parent.audio_list, UiStrings.AllFiles) self.replaceAction.setText(UiStrings.ReplaceBG) @@ -124,7 +124,7 @@ class MediaMediaItem(MediaManagerItem): return False filename = unicode(item.data(QtCore.Qt.UserRole).toString()) if os.path.exists(filename): - self.MediaState = None + self.mediaState = None self.mediaObject.stop() self.mediaObject.clearQueue() self.mediaObject.setCurrentSource(Phonon.MediaSource(filename)) @@ -136,7 +136,7 @@ class MediaMediaItem(MediaManagerItem): service_item.theme = -1 frame = u':/media/image_clapperboard.png' (path, name) = os.path.split(filename) - while not self.MediaState: + while not self.mediaState: Receiver.send_message(u'openlp_process_events') service_item.media_length = self.mediaLength service_item.add_from_command(path, name, frame) @@ -182,6 +182,6 @@ class MediaMediaItem(MediaManagerItem): Start the video at a predetermined point. """ if newState == Phonon.PlayingState: - self.MediaState = newState + self.mediaState = newState self.mediaLength = self.mediaObject.totalTime()/1000 self.mediaObject.stop() diff --git a/openlp/plugins/presentations/lib/mediaitem.py b/openlp/plugins/presentations/lib/mediaitem.py index 64c1f7ece..35db047e2 100644 --- a/openlp/plugins/presentations/lib/mediaitem.py +++ b/openlp/plugins/presentations/lib/mediaitem.py @@ -60,7 +60,7 @@ class PresentationMediaItem(MediaManagerItem): """ The name of the plugin media displayed in UI """ - self.OnNewPrompt = translate('PresentationPlugin.MediaItem', + self.onNewPrompt = translate('PresentationPlugin.MediaItem', 'Select Presentation(s)') self.Automatic = translate('PresentationPlugin.MediaItem', 'Automatic') @@ -80,7 +80,7 @@ class PresentationMediaItem(MediaManagerItem): if fileType.find(type) == -1: fileType += u'*.%s ' % type self.parent.serviceManager.supportedSuffixes(type) - self.OnNewFileMasks = unicode(translate('PresentationPlugin.MediaItem', + self.onNewFileMasks = unicode(translate('PresentationPlugin.MediaItem', 'Presentations (%s)')) % fileType def requiredIcons(self): From 02c1bd441332c9b7c53044d12a3d93e7f7749df1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20P=C3=B5ldaru?= Date: Thu, 17 Feb 2011 17:05:58 +0200 Subject: [PATCH 045/123] first working example with unilanguage tags handling --- openlp/plugins/songs/forms/editsongform.py | 72 +++++++++-- openlp/plugins/songs/forms/editversedialog.py | 14 +-- openlp/plugins/songs/forms/editverseform.py | 30 +++-- openlp/plugins/songs/lib/__init__.py | 115 ++++++++++-------- openlp/plugins/songs/lib/mediaitem.py | 16 ++- 5 files changed, 161 insertions(+), 86 deletions(-) diff --git a/openlp/plugins/songs/forms/editsongform.py b/openlp/plugins/songs/forms/editsongform.py index 39f1ba256..7ff129de8 100644 --- a/openlp/plugins/songs/forms/editsongform.py +++ b/openlp/plugins/songs/forms/editsongform.py @@ -228,7 +228,14 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): self.verseListWidget.clear() self.verseListWidget.setRowCount(0) if self.song.verse_order: - self.verseOrderEdit.setText(self.song.verse_order) + # we translate verse order + translated = [] + for verse in self.song.verse_order.split(): + verseindex = VerseType.from_tag(verse[0]) + versetype = VerseType.Translations[verseindex][0] + versetag = verse[1:] + translated.append(u'%s%s' % (versetype, versetag)) + self.verseOrderEdit.setText(u' '.join(translated)) else: self.verseOrderEdit.setText(u'') if self.song.comments: @@ -256,6 +263,20 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): for count, verse in enumerate(verseList): self.verseListWidget.setRowCount( self.verseListWidget.rowCount() + 1) + # this takes care of silently migrating from old or any markup + # if we entirely trusted the database, this should + # be unnecessary in the future + vtype = verse[0][u'type'] + index = None + if len(vtype) > 1: + index = VerseType.from_translated_string(vtype) + if index is None: + index = VerseType.from_string(vtype) + if index is None: + index = VerseType.from_tag(vtype) + if index is None: + index = VerseType.Other + verse[0][u'type'] = VerseType.Tags[index] variant = u'%s:%s' % (verse[0][u'type'], verse[0][u'label']) item = QtGui.QTableWidgetItem(verse[1]) item.setData(QtCore.Qt.UserRole, QtCore.QVariant(variant)) @@ -267,7 +288,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): self.verseListWidget.rowCount() + 1) item = QtGui.QTableWidgetItem(verse) variant = u'%s:%s' % \ - (VerseType.to_string(VerseType.Verse), unicode(count + 1)) + (VerseType.Tags[VerseType.Verse], unicode(count + 1)) item.setData(QtCore.Qt.UserRole, QtCore.QVariant(variant)) self.verseListWidget.setItem(count, 0, item) self.verseListWidget.resizeRowsToContents() @@ -299,7 +320,8 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): item = self.verseListWidget.item(row, 0) data = unicode(item.data(QtCore.Qt.UserRole).toString()) bit = data.split(u':') - rowTag = u'%s%s' % (bit[0][0:1], bit[1]) + bit[0] = VerseType.Translations[VerseType.from_tag(bit[0])][0] + rowTag = u'%s%s' % (bit[0], bit[1]) rowLabel.append(rowTag) self.verseListWidget.setVerticalHeaderLabels(rowLabel) @@ -467,7 +489,9 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): for row in range(0, self.verseListWidget.rowCount()): item = self.verseListWidget.item(row, 0) field = unicode(item.data(QtCore.Qt.UserRole).toString()) - verse_list += u'---[%s]---\n' % field + versetype, versenum = field.split(u':') + versetype = VerseType.to_translated_string(versetype) + verse_list += u'---[%s:%s]---\n' % (versetype, versenum) verse_list += item.text() verse_list += u'\n' self.verse_form.setVerse(verse_list) @@ -483,9 +507,18 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): for count, parts in enumerate(match.split(u']---\n')): if len(parts) > 1: if count == 0: - # make sure the tag is correctly cased - variant = u'%s%s' % \ - (parts[0:1].upper(), parts[1:].lower()) + # handling carefully user inputted versetags + separator = parts.find(u':') + if separator >= 0: + verse = parts[0:separator].strip() + subVerse = parts[separator+1:].strip() + else: + verse = parts + verseIndex = VerseType.from_loose_input(verse) + verseType = VerseType.Tags[verseIndex] + if not len(subVerse): + subVerse = u'1' + variant = u'%s:%s' % (verseType, subVerse) else: if parts.endswith(u'\n'): parts = parts.rstrip(u'\n') @@ -543,9 +576,13 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): order_names = unicode(self.verseOrderEdit.text()).split() for item in order_names: if len(item) == 1: - order.append(item.lower() + u'1') + order.append(VerseType.Tags[VerseType.from_translated_tag( + item)] + u'1') else: - order.append(item.lower()) + versetag = VerseType.Tags[ + VerseType.from_translated_tag(item[0])] + versenum = item[1:].lower() + order.append(u'%s%s' % (versetag, versenum)) verses = [] verse_names = [] for index in range (0, self.verseListWidget.rowCount()): @@ -561,7 +598,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): self.verseOrderEdit.setFocus() valid = verses.pop(0) for verse in verses: - valid = valid + u', ' + verse + valid = valid + u', ' + verse.upper() critical_error_message_box( message=unicode(translate('SongsPlugin.EditSongForm', 'The verse order is invalid. There is no verse ' @@ -572,12 +609,16 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): if verse not in order: self.songTabWidget.setCurrentIndex(0) self.verseOrderEdit.setFocus() + versetype, versenum = verse_names[count].split(u':') + verseindex = VerseType.from_tag(versetype) + versetype = VerseType.Translations[verseindex][0] + versename = u'%s%s' % (versetype, versenum) answer = QtGui.QMessageBox.warning(self, translate('SongsPlugin.EditSongForm', 'Warning'), unicode(translate('SongsPlugin.EditSongForm', 'You have not used %s anywhere in the verse ' 'order. Are you sure you want to save the song ' - 'like this?')) % verse_names[count].replace(u':', u' '), + 'like this?')) % versename, QtGui.QMessageBox.Yes | QtGui.QMessageBox.No) if answer == QtGui.QMessageBox.No: return False @@ -684,7 +725,14 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): else: self.song.search_title = self.song.title self.song.comments = unicode(self.commentsEdit.toPlainText()) - self.song.verse_order = unicode(self.verseOrderEdit.text()) + ordertext = unicode(self.verseOrderEdit.text()) + order = [] + for item in ordertext.split(): + versetag = VerseType.Tags[ + VerseType.from_translated_tag(item[0])] + versenum = item[1:].lower() + order.append(u'%s%s' % (versetag, versenum)) + self.song.verse_order = u' '.join(order) self.song.ccli_number = unicode(self.CCLNumberEdit.text()) self.song.song_number = unicode(self.songBookNumberEdit.text()) book_name = unicode(self.songBookComboBox.currentText()) diff --git a/openlp/plugins/songs/forms/editversedialog.py b/openlp/plugins/songs/forms/editversedialog.py index 7caf782e6..fe857e12a 100644 --- a/openlp/plugins/songs/forms/editversedialog.py +++ b/openlp/plugins/songs/forms/editversedialog.py @@ -71,18 +71,18 @@ class Ui_EditVerseDialog(object): self.verseTypeLabel.setText( translate('SongsPlugin.EditVerseForm', '&Verse type:')) self.verseTypeComboBox.setItemText(0, - VerseType.to_string(VerseType.Verse)) + VerseType.Translations[VerseType.Verse]) self.verseTypeComboBox.setItemText(1, - VerseType.to_string(VerseType.Chorus)) + VerseType.Translations[VerseType.Chorus]) self.verseTypeComboBox.setItemText(2, - VerseType.to_string(VerseType.Bridge)) + VerseType.Translations[VerseType.Bridge]) self.verseTypeComboBox.setItemText(3, - VerseType.to_string(VerseType.PreChorus)) + VerseType.Translations[VerseType.PreChorus]) self.verseTypeComboBox.setItemText(4, - VerseType.to_string(VerseType.Intro)) + VerseType.Translations[VerseType.Intro]) self.verseTypeComboBox.setItemText(5, - VerseType.to_string(VerseType.Ending)) + VerseType.Translations[VerseType.Ending]) self.verseTypeComboBox.setItemText(6, - VerseType.to_string(VerseType.Other)) + VerseType.Translations[VerseType.Other]) self.insertButton.setText( translate('SongsPlugin.EditVerseForm', '&Insert')) diff --git a/openlp/plugins/songs/forms/editverseform.py b/openlp/plugins/songs/forms/editverseform.py index e67e0733a..bb9d9e906 100644 --- a/openlp/plugins/songs/forms/editverseform.py +++ b/openlp/plugins/songs/forms/editverseform.py @@ -57,7 +57,7 @@ class EditVerseForm(QtGui.QDialog, Ui_EditVerseDialog): QtCore.QObject.connect(self.verseTypeComboBox, QtCore.SIGNAL(u'currentIndexChanged(int)'), self.onVerseTypeComboBoxChanged) - self.verse_regex = re.compile(r'---\[([-\w]+):([\d]+)\]---') + self.verse_regex = re.compile(r'---\[(.+):(.+)\]---') def contextMenu(self, point): item = self.serviceManagerList.itemAt(point) @@ -70,8 +70,8 @@ class EditVerseForm(QtGui.QDialog, Ui_EditVerseDialog): def onInsertButtonClicked(self): verse_type = self.verseTypeComboBox.currentIndex() - if VerseType.to_string(verse_type) is not None: - self.insertVerse(VerseType.to_string(verse_type), + if VerseType.to_translated_string(verse_type) is not None: + self.insertVerse(VerseType.to_translated_string(verse_type), self.verseNumberBox.value()) def onVerseTypeComboBoxChanged(self): @@ -81,7 +81,8 @@ class EditVerseForm(QtGui.QDialog, Ui_EditVerseDialog): """ position = self.verseTextEdit.textCursor().position() text = unicode(self.verseTextEdit.toPlainText()) - verse_type = VerseType.to_string(self.verseTypeComboBox.currentIndex()) + verse_type = VerseType.Translations[ + self.verseTypeComboBox.currentIndex()] if not text: return position = text.rfind(u'---[%s' % verse_type, 0, position) @@ -97,7 +98,11 @@ class EditVerseForm(QtGui.QDialog, Ui_EditVerseDialog): if match: verse_type = match.group(1) verse_number = int(match.group(2)) - verse_type_index = VerseType.from_string(verse_type) + verse_type_index = VerseType.from_translated_string(verse_type) + if verse_type_index is None: + verse_type_index = VerseType.from_string(verse_type) + if verse_type_index is None: + verse_type_index = VerseType.from_tag(verse_type) if verse_type_index is not None: self.verseNumberBox.setValue(verse_number) @@ -125,24 +130,25 @@ class EditVerseForm(QtGui.QDialog, Ui_EditVerseDialog): if match: verse_type = match.group(1) verse_number = int(match.group(2)) - verse_type_index = VerseType.from_string(verse_type) + verse_type_index = VerseType.from_loose_input(verse_type) if verse_type_index is not None: self.verseTypeComboBox.setCurrentIndex(verse_type_index) self.verseNumberBox.setValue(verse_number) def setVerse(self, text, single=False, - tag=u'%s:1' % VerseType.to_string(VerseType.Verse)): + tag=u'%s:1' % VerseType.tag(VerseType.Verse)): self.hasSingleVerse = single if single: verse_type, verse_number = tag.split(u':') - verse_type_index = VerseType.from_string(verse_type) + verse_type_index = VerseType.from_tag(verse_type) if verse_type_index is not None: self.verseTypeComboBox.setCurrentIndex(verse_type_index) self.verseNumberBox.setValue(int(verse_number)) self.insertButton.setVisible(False) else: if not text: - text = u'---[%s:1]---\n' % VerseType.to_string(VerseType.Verse) + text = u'---[%s:1]---\n' % \ + VerseType.to_translated_string(VerseType.Verse) self.verseTypeComboBox.setCurrentIndex(0) self.verseNumberBox.setValue(1) self.insertButton.setVisible(True) @@ -152,14 +158,14 @@ class EditVerseForm(QtGui.QDialog, Ui_EditVerseDialog): def getVerse(self): return self.verseTextEdit.toPlainText(), \ - VerseType.to_string(self.verseTypeComboBox.currentIndex()), \ + VerseType.Tags[self.verseTypeComboBox.currentIndex()], \ unicode(self.verseNumberBox.value()) def getVerseAll(self): text = self.verseTextEdit.toPlainText() if not text.startsWith(u'---['): - text = u'---[%s:1]---\n%s' % (VerseType.to_string(VerseType.Verse), - text) + text = u'---[%s:1]---\n%s' % \ + (VerseType.to_translated_string(VerseType.Verse), text) return text def accept(self): diff --git a/openlp/plugins/songs/lib/__init__.py b/openlp/plugins/songs/lib/__init__.py index 4adeb5345..7853f6c61 100644 --- a/openlp/plugins/songs/lib/__init__.py +++ b/openlp/plugins/songs/lib/__init__.py @@ -56,121 +56,138 @@ class VerseType(object): u'Ending', u'Other'] Translations = [ - translate('SongsPlugin.VerseType', 'Verse'), - translate('SongsPlugin.VerseType', 'Chorus'), - translate('SongsPlugin.VerseType', 'Bridge'), - translate('SongsPlugin.VerseType', 'Pre-Chorus'), - translate('SongsPlugin.VerseType', 'Intro'), - translate('SongsPlugin.VerseType', 'Ending'), - translate('SongsPlugin.VerseType', 'Other')] + unicode(translate('SongsPlugin.VerseType', 'Verse')), + unicode(translate('SongsPlugin.VerseType', 'Chorus')), + unicode(translate('SongsPlugin.VerseType', 'Bridge')), + unicode(translate('SongsPlugin.VerseType', 'Pre-Chorus')), + unicode(translate('SongsPlugin.VerseType', 'Intro')), + unicode(translate('SongsPlugin.VerseType', 'Ending')), + unicode(translate('SongsPlugin.VerseType', 'Other'))] @staticmethod - def tag(verse_type, strict=False): + def tag(verse_type): """ Return a string for a given VerseType tag ``verse_type`` The verse type to return a string for - - ``strict`` - If strict, False is returned instead of Other, when not found """ if isinstance(verse_type, int): - if verse_type >=0 and verse_type <= 6: + try: return VerseType.Tags[verse_type] - else: - return self.returnvalue(VerseType.Tags, strict) + except: + return elif verse_type[0].lower() in VerseType.Tags: return verse_type[0].lower() - else: - return VerseType.returnvalue(VerseType.Tags, strict) @staticmethod - def to_string(verse_type, strict=False): + def to_string(verse_type): """ Return a string for a given VerseType Name ``verse_type`` The type to return a string for - - ``strict`` - If strict, False is returned instead of Other, when not found """ if isinstance(verse_type, int): - if verse_type >=0 and verse_type <= 6: + try: return VerseType.Names[verse_type] - else: - return self.returnvalue(VerseType.Names, strict) + except: + return else: verse_type = verse_type[0].lower() for num, tag in enumerate(VerseType.Tags): if verse_type == tag: return VerseType.Names[num] - return VerseType.returnvalue(VerseType.Names, strict) @staticmethod - def to_translated_string(verse_type, strict=False): + def to_translated_string(verse_type): """ Return a string for a given VerseType Name ``verse_type`` The type to return a string for - - ``strict`` - If strict, False is returned instead of Other, when not found """ if isinstance(verse_type, int): - if verse_type >=0 and verse_type <= 6: + try: return VerseType.Translations[verse_type] - else: - return self.returnvalue(VerseType.Translations, strict) + except: + return else: verse_type = verse_type[0].lower() for num, tag in enumerate(VerseType.Tags): if verse_type == tag: return VerseType.Translations[num] - return VerseType.returnvalue(VerseType.Translations, strict) @staticmethod - def from_string(verse_type, strict=False): + def from_tag(verse_type): + """ + Return the VerseType for a given tag + + ``verse_type`` + The string to return a VerseType for + """ + verse_type = verse_type[0].lower() + for num, string in enumerate(VerseType.Tags): + if verse_type == string: + return num + + @staticmethod + def from_translated_tag(verse_type): + """ + Return the VerseType for a given tag + + ``verse_type`` + The string to return a VerseType for + """ + verse_type = verse_type[0].lower() + for num, string in enumerate(VerseType.Translations): + if verse_type == string[0].lower(): + return num + + @staticmethod + def from_string(verse_type): """ Return the VerseType for a given string ``verse_type`` The string to return a VerseType for - - ``strict`` - If strict, False is returned instead of Other, when not found """ verse_type = verse_type.lower() for num, string in enumerate(VerseType.Names): - if verse_type == string: + if verse_type == string.lower(): return num - return VerseType.returnvalue(range(0,7), strict) @staticmethod - def from_translated_string(verse_type, strict=False): + def from_translated_string(verse_type): """ Return the VerseType for a given string ``verse_type`` The string to return a VerseType for - - ``strict`` - If strict, False is returned instead of Other, when not found """ verse_type = verse_type.lower() for num, translation in enumerate(VerseType.Translations): - if verse_type == translation: + if verse_type == translation.lower(): return num - return VerseType.returnvalue(range(0,7), strict) @staticmethod - def returnvalue(lst, strict): - if strict: - return False - else: - return lst[VerseType.Other] + def from_loose_input(verse_type): + """ + Return the VerseType for a given string, Other if not found + + ``verse_type`` + The string to return a VerseType for + """ + verseIndex = None + if len(verse_type) > 1: + verseIndex = VerseType.from_translated_string(verse_type) + if verseIndex is None: + verseIndex = VerseType.from_string(verse_type) + if verseIndex is None: + verseIndex = VerseType.from_translated_tag(verse_type) + elif verseIndex is None: + verseIndex = VerseType.from_tag(verse_type) + return verseIndex def retrieve_windows_encoding(recommendation=None): """ diff --git a/openlp/plugins/songs/lib/mediaitem.py b/openlp/plugins/songs/lib/mediaitem.py index 283aa6c03..28f7822cb 100644 --- a/openlp/plugins/songs/lib/mediaitem.py +++ b/openlp/plugins/songs/lib/mediaitem.py @@ -36,7 +36,7 @@ from openlp.core.lib import MediaManagerItem, Receiver, ItemCapabilities, \ from openlp.core.lib.ui import UiStrings from openlp.plugins.songs.forms import EditSongForm, SongMaintenanceForm, \ SongImportForm, SongExportForm -from openlp.plugins.songs.lib import OpenLyrics, SongXML +from openlp.plugins.songs.lib import OpenLyrics, SongXML, VerseType from openlp.plugins.songs.lib.db import Author, Song from openlp.core.lib.searchedit import SearchEdit @@ -344,22 +344,26 @@ class SongMediaItem(MediaManagerItem): if song.lyrics.startswith(u' Date: Thu, 17 Feb 2011 17:19:02 +0200 Subject: [PATCH 046/123] fix when loading from db to show preview/live --- openlp/plugins/songs/lib/mediaitem.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/openlp/plugins/songs/lib/mediaitem.py b/openlp/plugins/songs/lib/mediaitem.py index 28f7822cb..e71939bb7 100644 --- a/openlp/plugins/songs/lib/mediaitem.py +++ b/openlp/plugins/songs/lib/mediaitem.py @@ -346,8 +346,20 @@ class SongMediaItem(MediaManagerItem): # no verse list or only 1 space (in error) if not song.verse_order.strip(): for verse in verseList: - verseindex = VerseType.from_tag(verse[0][u'type']) - versetype = VerseType.Translations[verseindex][0] + # we cannot use from_loose_input() here, because database + # is supposed to contain English lowercase singlechar tags + verse_type = verse[0][u'type'] + verseIndex = None + if len(verse_type) > 1: + verseIndex = \ + VerseType.from_translated_string(verse_type) + if verseIndex is None: + verseIndex = VerseType.from_string(verse_type) + if verseIndex is None: + verseIndex = VerseType.from_tag(verse_type) + if verseIndex is None: + verseIndex = VerseType.Other + versetype = VerseType.Translations[verseIndex][0] verseTag = u'%s:%s' % (versetype, verse[0][u'label']) service_item.add_from_text( verse[1][:30], unicode(verse[1]), verseTag) From 9e6cfcfed4c7006db976cbe3f9ecf1b6feeb02cc Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Thu, 17 Feb 2011 17:11:32 +0100 Subject: [PATCH 047/123] clear search edit, when starting the wizard again; check/uncheck button change state of visible songs --- openlp/plugins/songs/forms/songexportform.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/openlp/plugins/songs/forms/songexportform.py b/openlp/plugins/songs/forms/songexportform.py index 849a1ad1e..f331fbcb9 100644 --- a/openlp/plugins/songs/forms/songexportform.py +++ b/openlp/plugins/songs/forms/songexportform.py @@ -252,6 +252,7 @@ class SongExportForm(OpenLPWizard): self.availableListWidget.clear() self.selectedListWidget.clear() self.directoryLineEdit.clear() + self.searchLineEdit.clear() # Load the list of songs. Receiver.send_message(u'cursor_busy') songs = self.plugin.manager.get_all_objects(Song) @@ -340,19 +341,21 @@ class SongExportForm(OpenLPWizard): def onUncheckButtonClicked(self): """ - The *uncheckButton* has been clicked. Set all songs unchecked. + The *uncheckButton* has been clicked. Set all visible songs unchecked. """ for row in range(self.availableListWidget.count()): item = self.availableListWidget.item(row) - item.setCheckState(QtCore.Qt.Unchecked) + if not item.isHidden(): + item.setCheckState(QtCore.Qt.Unchecked) def onCheckButtonClicked(self): """ - The *checkButton* has been clicked. Set all songs checked. + The *checkButton* has been clicked. Set all visible songs checked. """ for row in range(self.availableListWidget.count()): item = self.availableListWidget.item(row) - item.setCheckState(QtCore.Qt.Checked) + if not item.isHidden(): + item.setCheckState(QtCore.Qt.Checked) def onDirectoryButtonClicked(self): """ From 059ca9ac08487a845b935d45dc904550ae66dfa9 Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Thu, 17 Feb 2011 21:02:47 +0200 Subject: [PATCH 048/123] Updated InnoSetup script to add a 'Debug' shortcut to the Start Menu which invokes debug logging. --- resources/windows/OpenLP-2.0.iss | 1 + 1 file changed, 1 insertion(+) diff --git a/resources/windows/OpenLP-2.0.iss b/resources/windows/OpenLP-2.0.iss index a85b41187..c64e2b488 100644 --- a/resources/windows/OpenLP-2.0.iss +++ b/resources/windows/OpenLP-2.0.iss @@ -68,6 +68,7 @@ Source: ..\..\dist\OpenLP\*; DestDir: {app}; Flags: ignoreversion recursesubdirs [Icons] Name: {group}\{#AppName}; Filename: {app}\{#AppExeName} +Name: {group}\{#AppName} (Debug); Filename: {app}\{#AppExeName}; Parameters: -l debug Name: {group}\{cm:ProgramOnTheWeb,{#AppName}}; Filename: {#AppURL} Name: {group}\{cm:UninstallProgram,{#AppName}}; Filename: {uninstallexe} Name: {commondesktop}\{#AppName}; Filename: {app}\{#AppExeName}; Tasks: desktopicon From dff393b6a4df6ff4e04190487fc49e254d6aac5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20P=C3=B5ldaru?= Date: Thu, 17 Feb 2011 21:46:01 +0200 Subject: [PATCH 049/123] just another massive set of changes --- openlp/core/ui/slidecontroller.py | 15 ++-- openlp/plugins/songs/forms/editsongform.py | 87 +++++++++++-------- openlp/plugins/songs/forms/editversedialog.py | 28 +++--- openlp/plugins/songs/forms/editverseform.py | 46 +++++----- openlp/plugins/songs/lib/__init__.py | 86 ++++-------------- openlp/plugins/songs/lib/mediaitem.py | 16 ++-- openlp/plugins/songs/lib/xml.py | 5 +- 7 files changed, 122 insertions(+), 161 deletions(-) diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index 52626f24f..fda151c19 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -603,14 +603,15 @@ class SlideController(QtGui.QWidget): slideHeight = 0 if self.serviceItem.is_text(): if frame[u'verseTag']: - bits = frame[u'verseTag'].split(u':') - tag = u'%s\n%s' % (bits[0][0], bits[1][0:] ) - tag1 = u'%s%s' % (bits[0][0], bits[1][0:] ) - row = tag + # These tags are already translated. + versetag = frame[u'verseTag'] + versetag = u'%s%s' % (versetag[0].upper(), versetag[1:]) + twolineTag = u'%s\n%s' % (versetag[0], versetag[1:] ) + row = twolineTag if self.isLive: - if tag1 not in self.slideList: - self.slideList[tag1] = framenumber - self.songMenu.menu().addAction(tag1, + if versetag not in self.slideList: + self.slideList[versetag] = framenumber + self.songMenu.menu().addAction(versetag, self.onSongBarHandler) else: row += 1 diff --git a/openlp/plugins/songs/forms/editsongform.py b/openlp/plugins/songs/forms/editsongform.py index 7ff129de8..34cab3c74 100644 --- a/openlp/plugins/songs/forms/editsongform.py +++ b/openlp/plugins/songs/forms/editsongform.py @@ -230,11 +230,11 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): if self.song.verse_order: # we translate verse order translated = [] - for verse in self.song.verse_order.split(): - verseindex = VerseType.from_tag(verse[0]) - versetype = VerseType.Translations[verseindex][0] - versetag = verse[1:] - translated.append(u'%s%s' % (versetype, versetag)) + for versetag in self.song.verse_order.split(): + verseindex = VerseType.from_tag(versetag[0]) + versetype = VerseType.TranslatedTags[verseindex] + versenum = versetag[1:] + translated.append(u'%s%s' % (versetype.upper(), versenum)) self.verseOrderEdit.setText(u' '.join(translated)) else: self.verseOrderEdit.setText(u'') @@ -263,9 +263,8 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): for count, verse in enumerate(verseList): self.verseListWidget.setRowCount( self.verseListWidget.rowCount() + 1) - # this takes care of silently migrating from old or any markup - # if we entirely trusted the database, this should - # be unnecessary in the future + # This silently migrates from localized verse type markup. + # If we trusted the database, this would be unnecessary. vtype = verse[0][u'type'] index = None if len(vtype) > 1: @@ -277,7 +276,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): if index is None: index = VerseType.Other verse[0][u'type'] = VerseType.Tags[index] - variant = u'%s:%s' % (verse[0][u'type'], verse[0][u'label']) + variant = u'%s%s' % (verse[0][u'type'], verse[0][u'label']) item = QtGui.QTableWidgetItem(verse[1]) item.setData(QtCore.Qt.UserRole, QtCore.QVariant(variant)) self.verseListWidget.setItem(count, 0, item) @@ -318,10 +317,10 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): rowLabel = [] for row in range(0, self.verseListWidget.rowCount()): item = self.verseListWidget.item(row, 0) - data = unicode(item.data(QtCore.Qt.UserRole).toString()) - bit = data.split(u':') - bit[0] = VerseType.Translations[VerseType.from_tag(bit[0])][0] - rowTag = u'%s%s' % (bit[0], bit[1]) + versetag = unicode(item.data(QtCore.Qt.UserRole).toString()) + versetype = VerseType.TranslatedTags[ + VerseType.from_tag(versetag[0])].upper() + rowTag = u'%s%s' % (versetype, versetag[1:]) rowLabel.append(rowTag) self.verseListWidget.setVerticalHeaderLabels(rowLabel) @@ -442,10 +441,10 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): def onVerseAddButtonClicked(self): self.verse_form.setVerse(u'', True) if self.verse_form.exec_(): - afterText, verse, subVerse = self.verse_form.getVerse() - data = u'%s:%s' % (verse, subVerse) + afterText, versetype, versenum = self.verse_form.getVerse() + versetag = u'%s%s' % (versetype, versenum) item = QtGui.QTableWidgetItem(afterText) - item.setData(QtCore.Qt.UserRole, QtCore.QVariant(data)) + item.setData(QtCore.Qt.UserRole, QtCore.QVariant(versetag)) item.setText(afterText) self.verseListWidget.setRowCount( self.verseListWidget.rowCount() + 1) @@ -462,9 +461,9 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): verseId = unicode(item.data(QtCore.Qt.UserRole).toString()) self.verse_form.setVerse(tempText, True, verseId) if self.verse_form.exec_(): - afterText, verse, subVerse = self.verse_form.getVerse() - data = u'%s:%s' % (verse, subVerse) - item.setData(QtCore.Qt.UserRole, QtCore.QVariant(data)) + afterText, versetype, versenum = self.verse_form.getVerse() + versetag = u'%s%s' % (versetype, versenum) + item.setData(QtCore.Qt.UserRole, QtCore.QVariant(versetag)) item.setText(afterText) # number of lines has change so repaint the list moving the data if len(tempText.split(u'\n')) != len(afterText.split(u'\n')): @@ -489,8 +488,9 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): for row in range(0, self.verseListWidget.rowCount()): item = self.verseListWidget.item(row, 0) field = unicode(item.data(QtCore.Qt.UserRole).toString()) - versetype, versenum = field.split(u':') - versetype = VerseType.to_translated_string(versetype) + versetypeindex = VerseType.from_tag(field[0]) + versetype = VerseType.TranslatedNames[versetypeindex] + versenum = field[1:] verse_list += u'---[%s:%s]---\n' % (versetype, versenum) verse_list += item.text() verse_list += u'\n' @@ -510,15 +510,25 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): # handling carefully user inputted versetags separator = parts.find(u':') if separator >= 0: - verse = parts[0:separator].strip() - subVerse = parts[separator+1:].strip() + versetype = parts[0:separator].strip() + versenum = parts[separator+1:].strip() else: - verse = parts - verseIndex = VerseType.from_loose_input(verse) - verseType = VerseType.Tags[verseIndex] - if not len(subVerse): - subVerse = u'1' - variant = u'%s:%s' % (verseType, subVerse) + versetype = parts + versenum = u'1' + verseindex = \ + VerseType.from_loose_input(versetype) + if verseindex is None: + verseindex = VerseType.Verse + versetype = VerseType.Tags[verseindex] + # Later we need to handle v1a as well. + #regex = re.compile(r'(\d+\w.)') + regex = re.compile(r'\D*(\d+)\D*') + match = regex.match(versenum) + if match: + versenum = match.group(1) + else: + versenum = u'1' + variant = u'%s%s' % (versetype, versenum) else: if parts.endswith(u'\n'): parts = parts.rstrip(u'\n') @@ -585,7 +595,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): order.append(u'%s%s' % (versetag, versenum)) verses = [] verse_names = [] - for index in range (0, self.verseListWidget.rowCount()): + for index in range(0, self.verseListWidget.rowCount()): verse = self.verseListWidget.item(index, 0) verse = unicode(verse.data(QtCore.Qt.UserRole).toString()) if verse not in verse_names: @@ -609,9 +619,10 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): if verse not in order: self.songTabWidget.setCurrentIndex(0) self.verseOrderEdit.setFocus() - versetype, versenum = verse_names[count].split(u':') + versetype = verse_names[count][0] + versenum = verse_names[count][1:] verseindex = VerseType.from_tag(versetype) - versetype = VerseType.Translations[verseindex][0] + versetype = VerseType.TranslatedTags[verseindex].upper() versename = u'%s%s' % (versetype, versenum) answer = QtGui.QMessageBox.warning(self, translate('SongsPlugin.EditSongForm', 'Warning'), @@ -731,7 +742,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): versetag = VerseType.Tags[ VerseType.from_translated_tag(item[0])] versenum = item[1:].lower() - order.append(u'%s%s' % (versetag, versenum)) + order.append(u'%s%s' % (versetag, versenum)) self.song.verse_order = u' '.join(order) self.song.ccli_number = unicode(self.CCLNumberEdit.text()) self.song.song_number = unicode(self.songBookNumberEdit.text()) @@ -775,12 +786,14 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): for i in range(0, self.verseListWidget.rowCount()): item = self.verseListWidget.item(i, 0) verseId = unicode(item.data(QtCore.Qt.UserRole).toString()) - bits = verseId.split(u':') - sxml.add_verse_to_lyrics(bits[0], bits[1], unicode(item.text())) + versetype = verseId[0] + versenum = verseId[1:] + sxml.add_verse_to_lyrics(versetype, versenum, + unicode(item.text())) 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]) + if (versenum > u'1') and (versetype not in multiple): + multiple.append(versetype) self.song.search_lyrics = text.lower() self.song.lyrics = unicode(sxml.extract_xml(), u'utf-8') for verse in multiple: diff --git a/openlp/plugins/songs/forms/editversedialog.py b/openlp/plugins/songs/forms/editversedialog.py index fe857e12a..64da3e89e 100644 --- a/openlp/plugins/songs/forms/editversedialog.py +++ b/openlp/plugins/songs/forms/editversedialog.py @@ -70,19 +70,19 @@ class Ui_EditVerseDialog(object): translate('SongsPlugin.EditVerseForm', 'Edit Verse')) self.verseTypeLabel.setText( translate('SongsPlugin.EditVerseForm', '&Verse type:')) - self.verseTypeComboBox.setItemText(0, - VerseType.Translations[VerseType.Verse]) - self.verseTypeComboBox.setItemText(1, - VerseType.Translations[VerseType.Chorus]) - self.verseTypeComboBox.setItemText(2, - VerseType.Translations[VerseType.Bridge]) - self.verseTypeComboBox.setItemText(3, - VerseType.Translations[VerseType.PreChorus]) - self.verseTypeComboBox.setItemText(4, - VerseType.Translations[VerseType.Intro]) - self.verseTypeComboBox.setItemText(5, - VerseType.Translations[VerseType.Ending]) - self.verseTypeComboBox.setItemText(6, - VerseType.Translations[VerseType.Other]) + self.verseTypeComboBox.setItemText(VerseType.Verse, + VerseType.TranslatedNames[VerseType.Verse]) + self.verseTypeComboBox.setItemText(VerseType.Chorus, + VerseType.TranslatedNames[VerseType.Chorus]) + self.verseTypeComboBox.setItemText(VerseType.Bridge, + VerseType.TranslatedNames[VerseType.Bridge]) + self.verseTypeComboBox.setItemText(VerseType.PreChorus, + VerseType.TranslatedNames[VerseType.PreChorus]) + self.verseTypeComboBox.setItemText(VerseType.Intro, + VerseType.TranslatedNames[VerseType.Intro]) + self.verseTypeComboBox.setItemText(VerseType.Ending, + VerseType.TranslatedNames[VerseType.Ending]) + self.verseTypeComboBox.setItemText(VerseType.Other, + VerseType.TranslatedNames[VerseType.Other]) self.insertButton.setText( translate('SongsPlugin.EditVerseForm', '&Insert')) diff --git a/openlp/plugins/songs/forms/editverseform.py b/openlp/plugins/songs/forms/editverseform.py index bb9d9e906..a8fe1302d 100644 --- a/openlp/plugins/songs/forms/editverseform.py +++ b/openlp/plugins/songs/forms/editverseform.py @@ -57,22 +57,23 @@ class EditVerseForm(QtGui.QDialog, Ui_EditVerseDialog): QtCore.QObject.connect(self.verseTypeComboBox, QtCore.SIGNAL(u'currentIndexChanged(int)'), self.onVerseTypeComboBoxChanged) - self.verse_regex = re.compile(r'---\[(.+):(.+)\]---') + self.verse_regex = re.compile(r'---\[(.+):\D*(\d+)\D*\]---') def contextMenu(self, point): item = self.serviceManagerList.itemAt(point) - def insertVerse(self, title, num=1): + def insertVerse(self, versetype, num=1): if self.verseTextEdit.textCursor().columnNumber() != 0: self.verseTextEdit.insertPlainText(u'\n') - self.verseTextEdit.insertPlainText(u'---[%s:%s]---\n' % (title, num)) + versetype = VerseType.TranslatedNames[VerseTag.from_tag(versetype)] + self.verseTextEdit.insertPlainText(u'---[%s:%s]---\n' % \ + (versetype, num)) self.verseTextEdit.setFocus() def onInsertButtonClicked(self): - verse_type = self.verseTypeComboBox.currentIndex() - if VerseType.to_translated_string(verse_type) is not None: - self.insertVerse(VerseType.to_translated_string(verse_type), - self.verseNumberBox.value()) + vtypeindex = self.verseTypeComboBox.currentIndex() + self.insertVerse(VerseType.Tags[vtypeindex], + self.verseNumberBox.value()) def onVerseTypeComboBoxChanged(self): """ @@ -81,7 +82,7 @@ class EditVerseForm(QtGui.QDialog, Ui_EditVerseDialog): """ position = self.verseTextEdit.textCursor().position() text = unicode(self.verseTextEdit.toPlainText()) - verse_type = VerseType.Translations[ + verse_type = VerseType.TranslatedNames[ self.verseTypeComboBox.currentIndex()] if not text: return @@ -98,11 +99,7 @@ class EditVerseForm(QtGui.QDialog, Ui_EditVerseDialog): if match: verse_type = match.group(1) verse_number = int(match.group(2)) - verse_type_index = VerseType.from_translated_string(verse_type) - if verse_type_index is None: - verse_type_index = VerseType.from_string(verse_type) - if verse_type_index is None: - verse_type_index = VerseType.from_tag(verse_type) + verse_type_index = VerseType.from_loose_input(verse_type) if verse_type_index is not None: self.verseNumberBox.setValue(verse_number) @@ -128,19 +125,20 @@ class EditVerseForm(QtGui.QDialog, Ui_EditVerseDialog): text = text[:position + 4] match = self.verse_regex.match(text) if match: - verse_type = match.group(1) - verse_number = int(match.group(2)) - verse_type_index = VerseType.from_loose_input(verse_type) - if verse_type_index is not None: - self.verseTypeComboBox.setCurrentIndex(verse_type_index) - self.verseNumberBox.setValue(verse_number) + versetype = match.group(1) + vtypeindex = VerseType.from_loose_input(versetype) + regex = re.compile(r'(\d+)') + versenum = int(match.group(2)) + if vtypeindex is not None: + self.verseTypeComboBox.setCurrentIndex(vtypeindex) + self.verseNumberBox.setValue(versenum) def setVerse(self, text, single=False, - tag=u'%s:1' % VerseType.tag(VerseType.Verse)): + tag=u'%s1' % VerseType.Tags[VerseType.Verse]): self.hasSingleVerse = single if single: - verse_type, verse_number = tag.split(u':') - verse_type_index = VerseType.from_tag(verse_type) + verse_type_index = VerseType.from_tag(tag[0]) + verse_number = tag[1:] if verse_type_index is not None: self.verseTypeComboBox.setCurrentIndex(verse_type_index) self.verseNumberBox.setValue(int(verse_number)) @@ -148,7 +146,7 @@ class EditVerseForm(QtGui.QDialog, Ui_EditVerseDialog): else: if not text: text = u'---[%s:1]---\n' % \ - VerseType.to_translated_string(VerseType.Verse) + VerseType.TranslatedNames[VerseType.Verse] self.verseTypeComboBox.setCurrentIndex(0) self.verseNumberBox.setValue(1) self.insertButton.setVisible(True) @@ -165,7 +163,7 @@ class EditVerseForm(QtGui.QDialog, Ui_EditVerseDialog): text = self.verseTextEdit.toPlainText() if not text.startsWith(u'---['): text = u'---[%s:1]---\n%s' % \ - (VerseType.to_translated_string(VerseType.Verse), text) + (VerseType.TranslatedNames[VerseType.Verse], text) return text def accept(self): diff --git a/openlp/plugins/songs/lib/__init__.py b/openlp/plugins/songs/lib/__init__.py index 7853f6c61..da3b97574 100644 --- a/openlp/plugins/songs/lib/__init__.py +++ b/openlp/plugins/songs/lib/__init__.py @@ -39,14 +39,7 @@ class VerseType(object): Intro = 4 Ending = 5 Other = 6 - Tags = [ - u'v', - u'c', - u'b', - u'p', - u'i', - u'e', - u'o'] + Names = [ u'Verse', u'Chorus', @@ -55,7 +48,11 @@ class VerseType(object): u'Intro', u'Ending', u'Other'] - Translations = [ + Tags = [] + for name in Names: + Tags.append(name[0].lower()) + + TranslatedNames = [ unicode(translate('SongsPlugin.VerseType', 'Verse')), unicode(translate('SongsPlugin.VerseType', 'Chorus')), unicode(translate('SongsPlugin.VerseType', 'Bridge')), @@ -63,60 +60,9 @@ class VerseType(object): unicode(translate('SongsPlugin.VerseType', 'Intro')), unicode(translate('SongsPlugin.VerseType', 'Ending')), unicode(translate('SongsPlugin.VerseType', 'Other'))] - - @staticmethod - def tag(verse_type): - """ - Return a string for a given VerseType tag - - ``verse_type`` - The verse type to return a string for - """ - if isinstance(verse_type, int): - try: - return VerseType.Tags[verse_type] - except: - return - elif verse_type[0].lower() in VerseType.Tags: - return verse_type[0].lower() - - @staticmethod - def to_string(verse_type): - """ - Return a string for a given VerseType Name - - ``verse_type`` - The type to return a string for - """ - if isinstance(verse_type, int): - try: - return VerseType.Names[verse_type] - except: - return - else: - verse_type = verse_type[0].lower() - for num, tag in enumerate(VerseType.Tags): - if verse_type == tag: - return VerseType.Names[num] - - @staticmethod - def to_translated_string(verse_type): - """ - Return a string for a given VerseType Name - - ``verse_type`` - The type to return a string for - """ - if isinstance(verse_type, int): - try: - return VerseType.Translations[verse_type] - except: - return - else: - verse_type = verse_type[0].lower() - for num, tag in enumerate(VerseType.Tags): - if verse_type == tag: - return VerseType.Translations[num] + TranslatedTags = [] + for name in TranslatedNames: + TranslatedTags.append(name[0].lower()) @staticmethod def from_tag(verse_type): @@ -140,9 +86,9 @@ class VerseType(object): The string to return a VerseType for """ verse_type = verse_type[0].lower() - for num, string in enumerate(VerseType.Translations): - if verse_type == string[0].lower(): - return num + for vtypeIndex, vtypeTag in enumerate(VerseType.TranslatedTags): + if verse_type == vtypeTag: + return vtypeIndex @staticmethod def from_string(verse_type): @@ -153,9 +99,9 @@ class VerseType(object): The string to return a VerseType for """ verse_type = verse_type.lower() - for num, string in enumerate(VerseType.Names): - if verse_type == string.lower(): - return num + for vtypeIndex, vtypeName in enumerate(VerseType.Names): + if verse_type == vtypeName.lower(): + return vtypeIndex @staticmethod def from_translated_string(verse_type): @@ -166,7 +112,7 @@ class VerseType(object): The string to return a VerseType for """ verse_type = verse_type.lower() - for num, translation in enumerate(VerseType.Translations): + for num, translation in enumerate(VerseType.TranslatedNames): if verse_type == translation.lower(): return num diff --git a/openlp/plugins/songs/lib/mediaitem.py b/openlp/plugins/songs/lib/mediaitem.py index e71939bb7..147450efd 100644 --- a/openlp/plugins/songs/lib/mediaitem.py +++ b/openlp/plugins/songs/lib/mediaitem.py @@ -346,8 +346,8 @@ class SongMediaItem(MediaManagerItem): # no verse list or only 1 space (in error) if not song.verse_order.strip(): for verse in verseList: - # we cannot use from_loose_input() here, because database - # is supposed to contain English lowercase singlechar tags + # We cannot use from_loose_input() here, because database + # is supposed to contain English lowercase singlechar tags. verse_type = verse[0][u'type'] verseIndex = None if len(verse_type) > 1: @@ -359,13 +359,12 @@ class SongMediaItem(MediaManagerItem): verseIndex = VerseType.from_tag(verse_type) if verseIndex is None: verseIndex = VerseType.Other - versetype = VerseType.Translations[verseIndex][0] - verseTag = u'%s:%s' % (versetype, verse[0][u'label']) + versetype = VerseType.TranslatedTags[verseIndex].upper() + verseTag = u'%s%s' % (versetype, verse[0][u'label']) service_item.add_from_text( verse[1][:30], unicode(verse[1]), verseTag) else: # Loop through the verse list and expand the song accordingly. - print song.verse_order for order in song.verse_order.lower().split(): if len(order) == 0: break @@ -373,9 +372,10 @@ class SongMediaItem(MediaManagerItem): if verse[0][u'type'][0] == order[0] and \ (verse[0][u'label'] == order[1:] or not order[1:]): verseindex = VerseType.from_tag(verse[0][u'type']) - versetype = VerseType.Translations[verseindex][0] - verseTag = u'%s:%s' % \ - (versetype, verse[0][u'label']) + versetype = VerseType.TranslatedTags[verseindex]\ + .upper() + verseTag = u'%s%s' % (versetype, + verse[0][u'label']) service_item.add_from_text( verse[1][:30], verse[1], verseTag) else: diff --git a/openlp/plugins/songs/lib/xml.py b/openlp/plugins/songs/lib/xml.py index b96e79961..bfae14db7 100644 --- a/openlp/plugins/songs/lib/xml.py +++ b/openlp/plugins/songs/lib/xml.py @@ -464,7 +464,10 @@ class OpenLyrics(object): text += u'\n' text += u'\n'.join([unicode(line) for line in lines.line]) verse_name = self._get(verse, u'name') - verse_type = unicode(VerseType.to_string(verse_name[0])) + verse_type_index = VerseType.from_tag(verse_name[0]) + if verse_type_index is None: + verse_type_index = VerseType.Other + verse_type = VerseType.Names[verse_type_index] verse_number = re.compile(u'[a-zA-Z]*').sub(u'', verse_name) verse_part = re.compile(u'[0-9]*').sub(u'', verse_name[1:]) # OpenLyrics allows e. g. "c", but we need "c1". From aac40357aee340028b83c7318b5f5e2e45456cb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20P=C3=B5ldaru?= Date: Fri, 18 Feb 2011 02:48:58 +0200 Subject: [PATCH 050/123] better variable names, fixed translation issues for verse sequences --- openlp/core/ui/slidecontroller.py | 14 +- openlp/plugins/songs/forms/editsongform.py | 163 ++++++++++---------- openlp/plugins/songs/forms/editverseform.py | 38 ++--- openlp/plugins/songs/lib/__init__.py | 139 +++++++++++------ openlp/plugins/songs/lib/mediaitem.py | 51 +++--- openlp/plugins/songs/lib/xml.py | 2 - 6 files changed, 230 insertions(+), 177 deletions(-) diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index fda151c19..ec9fe2080 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -604,14 +604,14 @@ class SlideController(QtGui.QWidget): if self.serviceItem.is_text(): if frame[u'verseTag']: # These tags are already translated. - versetag = frame[u'verseTag'] - versetag = u'%s%s' % (versetag[0].upper(), versetag[1:]) - twolineTag = u'%s\n%s' % (versetag[0], versetag[1:] ) - row = twolineTag + verse_def = frame[u'verseTag'] + verse_def = u'%s%s' % (verse_def[0].upper(), verse_def[1:]) + two_line_def = u'%s\n%s' % (verse_def[0], verse_def[1:] ) + row = two_line_def if self.isLive: - if versetag not in self.slideList: - self.slideList[versetag] = framenumber - self.songMenu.menu().addAction(versetag, + if verse_def not in self.slideList: + self.slideList[verse_def] = framenumber + self.songMenu.menu().addAction(verse_def, self.onSongBarHandler) else: row += 1 diff --git a/openlp/plugins/songs/forms/editsongform.py b/openlp/plugins/songs/forms/editsongform.py index 34cab3c74..a9c5bac86 100644 --- a/openlp/plugins/songs/forms/editsongform.py +++ b/openlp/plugins/songs/forms/editsongform.py @@ -227,17 +227,6 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): self.copyrightEdit.setText(u'') self.verseListWidget.clear() self.verseListWidget.setRowCount(0) - if self.song.verse_order: - # we translate verse order - translated = [] - for versetag in self.song.verse_order.split(): - verseindex = VerseType.from_tag(versetag[0]) - versetype = VerseType.TranslatedTags[verseindex] - versenum = versetag[1:] - translated.append(u'%s%s' % (versetype.upper(), versenum)) - self.verseOrderEdit.setText(u' '.join(translated)) - else: - self.verseOrderEdit.setText(u'') if self.song.comments: self.commentsEdit.setPlainText(self.song.comments) else: @@ -257,6 +246,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): # This is just because occasionally the lyrics come back as a "buffer" if isinstance(self.song.lyrics, buffer): self.song.lyrics = unicode(self.song.lyrics) + verse_tags_translated = False if self.song.lyrics.startswith(u' 1: - index = VerseType.from_translated_string(vtype) + if len(verse_tag) > 1: + index = VerseType.from_translated_string(verse_tag) if index is None: - index = VerseType.from_string(vtype) + index = VerseType.from_string(verse_tag) + else: + verse_tags_translated = True if index is None: - index = VerseType.from_tag(vtype) + index = VerseType.from_tag(verse_tag) if index is None: index = VerseType.Other verse[0][u'type'] = VerseType.Tags[index] - variant = u'%s%s' % (verse[0][u'type'], verse[0][u'label']) + verse_def = u'%s%s' % (verse[0][u'type'], verse[0][u'label']) item = QtGui.QTableWidgetItem(verse[1]) - item.setData(QtCore.Qt.UserRole, QtCore.QVariant(variant)) + item.setData(QtCore.Qt.UserRole, QtCore.QVariant(verse_def)) self.verseListWidget.setItem(count, 0, item) else: verses = self.song.lyrics.split(u'\n\n') @@ -286,10 +278,24 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): self.verseListWidget.setRowCount( self.verseListWidget.rowCount() + 1) item = QtGui.QTableWidgetItem(verse) - variant = u'%s:%s' % \ + verse_def = u'%s%s' % \ (VerseType.Tags[VerseType.Verse], unicode(count + 1)) - item.setData(QtCore.Qt.UserRole, QtCore.QVariant(variant)) + item.setData(QtCore.Qt.UserRole, QtCore.QVariant(verse_def)) self.verseListWidget.setItem(count, 0, item) + if self.song.verse_order: + # we translate verse order + translated = [] + for verse_def in self.song.verse_order.split(): + verse_index = None + if verse_tags_translated: + verse_index = VerseType.from_translated_tag(verse_def[0]) + if verse_index is None: + verse_index = VerseType.from_tag(verse_def[0]) + verse_tag = VerseType.TranslatedTags[verse_index].upper() + translated.append(u'%s%s' % (verse_tag, verse_def[1:])) + self.verseOrderEdit.setText(u' '.join(translated)) + else: + self.verseOrderEdit.setText(u'') self.verseListWidget.resizeRowsToContents() self.tagRows() # clear the results @@ -314,15 +320,14 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): """ Tag the Song List rows based on the verse list """ - rowLabel = [] + row_label = [] for row in range(0, self.verseListWidget.rowCount()): item = self.verseListWidget.item(row, 0) - versetag = unicode(item.data(QtCore.Qt.UserRole).toString()) - versetype = VerseType.TranslatedTags[ - VerseType.from_tag(versetag[0])].upper() - rowTag = u'%s%s' % (versetype, versetag[1:]) - rowLabel.append(rowTag) - self.verseListWidget.setVerticalHeaderLabels(rowLabel) + verse_def = unicode(item.data(QtCore.Qt.UserRole).toString()) + verse_tag = VerseType.translated_tag(verse_def[0]) + row_def = u'%s%s' % (verse_tag, verse_def[1:]) + row_label.append(row_def) + self.verseListWidget.setVerticalHeaderLabels(row_label) def onAuthorAddButtonClicked(self): item = int(self.authorsComboBox.currentIndex()) @@ -441,11 +446,11 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): def onVerseAddButtonClicked(self): self.verse_form.setVerse(u'', True) if self.verse_form.exec_(): - afterText, versetype, versenum = self.verse_form.getVerse() - versetag = u'%s%s' % (versetype, versenum) + after_text, verse_tag, verse_num = self.verse_form.getVerse() + verse_def = u'%s%s' % (verse_tag, verse_num) item = QtGui.QTableWidgetItem(afterText) - item.setData(QtCore.Qt.UserRole, QtCore.QVariant(versetag)) - item.setText(afterText) + item.setData(QtCore.Qt.UserRole, QtCore.QVariant(verse_def)) + item.setText(after_text) self.verseListWidget.setRowCount( self.verseListWidget.rowCount() + 1) self.verseListWidget.setItem( @@ -461,12 +466,12 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): verseId = unicode(item.data(QtCore.Qt.UserRole).toString()) self.verse_form.setVerse(tempText, True, verseId) if self.verse_form.exec_(): - afterText, versetype, versenum = self.verse_form.getVerse() - versetag = u'%s%s' % (versetype, versenum) - item.setData(QtCore.Qt.UserRole, QtCore.QVariant(versetag)) - item.setText(afterText) + after_text, verse_tag, verse_num = self.verse_form.getVerse() + verse_def = u'%s%s' % (verse_tag, verse_num) + item.setData(QtCore.Qt.UserRole, QtCore.QVariant(verse_def)) + item.setText(after_text) # number of lines has change so repaint the list moving the data - if len(tempText.split(u'\n')) != len(afterText.split(u'\n')): + if len(tempText.split(u'\n')) != len(after_text.split(u'\n')): tempList = {} tempId = {} for row in range(0, self.verseListWidget.rowCount()): @@ -488,10 +493,9 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): for row in range(0, self.verseListWidget.rowCount()): item = self.verseListWidget.item(row, 0) field = unicode(item.data(QtCore.Qt.UserRole).toString()) - versetypeindex = VerseType.from_tag(field[0]) - versetype = VerseType.TranslatedNames[versetypeindex] - versenum = field[1:] - verse_list += u'---[%s:%s]---\n' % (versetype, versenum) + verse_tag = VerseType.translated_name(field[0]) + verse_num = field[1:] + verse_list += u'---[%s:%s]---\n' % (verse_tag, verse_num) verse_list += item.text() verse_list += u'\n' self.verse_form.setVerse(verse_list) @@ -510,31 +514,29 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): # handling carefully user inputted versetags separator = parts.find(u':') if separator >= 0: - versetype = parts[0:separator].strip() - versenum = parts[separator+1:].strip() + verse_name = parts[0:separator].strip() + verse_num = parts[separator+1:].strip() else: - versetype = parts - versenum = u'1' - verseindex = \ - VerseType.from_loose_input(versetype) - if verseindex is None: - verseindex = VerseType.Verse - versetype = VerseType.Tags[verseindex] + verse_name = parts + verse_num = u'1' + verse_index = \ + VerseType.from_loose_input(verse_name) + verse_tag = VerseType.Tags[verse_index] # Later we need to handle v1a as well. #regex = re.compile(r'(\d+\w.)') regex = re.compile(r'\D*(\d+)\D*') - match = regex.match(versenum) + match = regex.match(verse_num) if match: - versenum = match.group(1) + verse_num = match.group(1) else: - versenum = u'1' - variant = u'%s%s' % (versetype, versenum) + verse_num = u'1' + verse_def = u'%s%s' % (verse_tag, verse_num) else: if parts.endswith(u'\n'): parts = parts.rstrip(u'\n') item = QtGui.QTableWidgetItem(parts) item.setData(QtCore.Qt.UserRole, - QtCore.QVariant(variant)) + QtCore.QVariant(verse_def)) self.verseListWidget.setRowCount( self.verseListWidget.rowCount() + 1) self.verseListWidget.setItem( @@ -586,29 +588,31 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): order_names = unicode(self.verseOrderEdit.text()).split() for item in order_names: if len(item) == 1: - order.append(VerseType.Tags[VerseType.from_translated_tag( - item)] + u'1') + verse_index = VerseType.from_translated_tag(item) + if verse_index is not None: + order.append(VerseType.Tags[verse_index] + u'1') + else: + order.append(u'') # it matches no verses anyway else: - versetag = VerseType.Tags[ - VerseType.from_translated_tag(item[0])] - versenum = item[1:].lower() - order.append(u'%s%s' % (versetag, versenum)) + verse_index = VerseType.from_translated_tag(item[0]) + if verse_index is None: + order.append(u'') # same as above + else: + verse_tag = VerseType.Tags[verse_index] + verse_num = item[1:].lower() + order.append(verse_tag + verse_num) verses = [] verse_names = [] for index in range(0, self.verseListWidget.rowCount()): verse = self.verseListWidget.item(index, 0) verse = unicode(verse.data(QtCore.Qt.UserRole).toString()) if verse not in verse_names: - verses.append( - re.sub(r'(.)[^:]*:(.*)', r'\1\2', verse.lower())) - verse_names.append(verse) + verses.append(verse) + verse_names.append(u'%s%s' % ( + VerseType.translated_tag(verse[0]), verse[1:])) for count, item in enumerate(order): if item not in verses: - self.songTabWidget.setCurrentIndex(0) - self.verseOrderEdit.setFocus() - valid = verses.pop(0) - for verse in verses: - valid = valid + u', ' + verse.upper() + valid = u', '.join(verse_names) critical_error_message_box( message=unicode(translate('SongsPlugin.EditSongForm', 'The verse order is invalid. There is no verse ' @@ -619,17 +623,12 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): if verse not in order: self.songTabWidget.setCurrentIndex(0) self.verseOrderEdit.setFocus() - versetype = verse_names[count][0] - versenum = verse_names[count][1:] - verseindex = VerseType.from_tag(versetype) - versetype = VerseType.TranslatedTags[verseindex].upper() - versename = u'%s%s' % (versetype, versenum) answer = QtGui.QMessageBox.warning(self, translate('SongsPlugin.EditSongForm', 'Warning'), unicode(translate('SongsPlugin.EditSongForm', 'You have not used %s anywhere in the verse ' 'order. Are you sure you want to save the song ' - 'like this?')) % versename, + 'like this?')) % verse_names[count], QtGui.QMessageBox.Yes | QtGui.QMessageBox.No) if answer == QtGui.QMessageBox.No: return False @@ -739,10 +738,10 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): ordertext = unicode(self.verseOrderEdit.text()) order = [] for item in ordertext.split(): - versetag = VerseType.Tags[ + verse_tag = VerseType.Tags[ VerseType.from_translated_tag(item[0])] - versenum = item[1:].lower() - order.append(u'%s%s' % (versetag, versenum)) + verse_num = item[1:].lower() + order.append(u'%s%s' % (verse_tag, verse_num)) self.song.verse_order = u' '.join(order) self.song.ccli_number = unicode(self.CCLNumberEdit.text()) self.song.song_number = unicode(self.songBookNumberEdit.text()) @@ -786,14 +785,14 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): for i in range(0, self.verseListWidget.rowCount()): item = self.verseListWidget.item(i, 0) verseId = unicode(item.data(QtCore.Qt.UserRole).toString()) - versetype = verseId[0] - versenum = verseId[1:] - sxml.add_verse_to_lyrics(versetype, versenum, + verse_tag = verseId[0] + verse_num = verseId[1:] + sxml.add_verse_to_lyrics(verse_type, verse_num, unicode(item.text())) text = text + self.whitespace.sub(u' ', unicode(self.verseListWidget.item(i, 0).text())) + u' ' - if (versenum > u'1') and (versetype not in multiple): - multiple.append(versetype) + if (verse_num > u'1') and (verse_tag not in multiple): + multiple.append(verse_tag) self.song.search_lyrics = text.lower() self.song.lyrics = unicode(sxml.extract_xml(), u'utf-8') for verse in multiple: diff --git a/openlp/plugins/songs/forms/editverseform.py b/openlp/plugins/songs/forms/editverseform.py index a8fe1302d..ada612c43 100644 --- a/openlp/plugins/songs/forms/editverseform.py +++ b/openlp/plugins/songs/forms/editverseform.py @@ -57,22 +57,22 @@ class EditVerseForm(QtGui.QDialog, Ui_EditVerseDialog): QtCore.QObject.connect(self.verseTypeComboBox, QtCore.SIGNAL(u'currentIndexChanged(int)'), self.onVerseTypeComboBoxChanged) - self.verse_regex = re.compile(r'---\[(.+):\D*(\d+)\D*\]---') + self.verse_regex = re.compile(r'---\[(.+):\D*(\d.)\D*\]---') def contextMenu(self, point): item = self.serviceManagerList.itemAt(point) - def insertVerse(self, versetype, num=1): + def insertVerse(self, verse_tag, verse_num=1): if self.verseTextEdit.textCursor().columnNumber() != 0: self.verseTextEdit.insertPlainText(u'\n') - versetype = VerseType.TranslatedNames[VerseTag.from_tag(versetype)] - self.verseTextEdit.insertPlainText(u'---[%s:%s]---\n' % \ - (versetype, num)) + verse_tag = VerseType.translated_name(verse_tag) + self.verseTextEdit.insertPlainText(u'---[%s:%s]---\n' % + (verse_tag, verse_num)) self.verseTextEdit.setFocus() def onInsertButtonClicked(self): - vtypeindex = self.verseTypeComboBox.currentIndex() - self.insertVerse(VerseType.Tags[vtypeindex], + verse_type_index = self.verseTypeComboBox.currentIndex() + self.insertVerse(VerseType.Tags[verse_type_index], self.verseNumberBox.value()) def onVerseTypeComboBoxChanged(self): @@ -82,11 +82,11 @@ class EditVerseForm(QtGui.QDialog, Ui_EditVerseDialog): """ position = self.verseTextEdit.textCursor().position() text = unicode(self.verseTextEdit.toPlainText()) - verse_type = VerseType.TranslatedNames[ + verse_name = VerseType.TranslatedNames[ self.verseTypeComboBox.currentIndex()] if not text: return - position = text.rfind(u'---[%s' % verse_type, 0, position) + position = text.rfind(u'---[%s' % verse_name, 0, position) if position == -1: self.verseNumberBox.setValue(1) return @@ -97,11 +97,11 @@ class EditVerseForm(QtGui.QDialog, Ui_EditVerseDialog): text = text[:position + 4] match = self.verse_regex.match(text) if match: - verse_type = match.group(1) - verse_number = int(match.group(2)) - verse_type_index = VerseType.from_loose_input(verse_type) + verse_tag = match.group(1) + verse_num = int(match.group(2)) + verse_type_index = VerseType.from_loose_input(verse_tag) if verse_type_index is not None: - self.verseNumberBox.setValue(verse_number) + self.verseNumberBox.setValue(verse_num) def onCursorPositionChanged(self): """ @@ -125,13 +125,13 @@ class EditVerseForm(QtGui.QDialog, Ui_EditVerseDialog): text = text[:position + 4] match = self.verse_regex.match(text) if match: - versetype = match.group(1) - vtypeindex = VerseType.from_loose_input(versetype) + verse_type = match.group(1) + verse_type_index = VerseType.from_loose_input(verse_type) regex = re.compile(r'(\d+)') - versenum = int(match.group(2)) - if vtypeindex is not None: - self.verseTypeComboBox.setCurrentIndex(vtypeindex) - self.verseNumberBox.setValue(versenum) + verse_num = int(match.group(2)) + if verse_type_index is not None: + self.verseTypeComboBox.setCurrentIndex(verse_type_index) + self.verseNumberBox.setValue(verse_num) def setVerse(self, text, single=False, tag=u'%s1' % VerseType.Tags[VerseType.Verse]): diff --git a/openlp/plugins/songs/lib/__init__.py b/openlp/plugins/songs/lib/__init__.py index da3b97574..a1cc7e19d 100644 --- a/openlp/plugins/songs/lib/__init__.py +++ b/openlp/plugins/songs/lib/__init__.py @@ -48,9 +48,7 @@ class VerseType(object): u'Intro', u'Ending', u'Other'] - Tags = [] - for name in Names: - Tags.append(name[0].lower()) + Tags = [name[0].lower() for name in Names] TranslatedNames = [ unicode(translate('SongsPlugin.VerseType', 'Verse')), @@ -60,80 +58,129 @@ class VerseType(object): unicode(translate('SongsPlugin.VerseType', 'Intro')), unicode(translate('SongsPlugin.VerseType', 'Ending')), unicode(translate('SongsPlugin.VerseType', 'Other'))] - TranslatedTags = [] - for name in TranslatedNames: - TranslatedTags.append(name[0].lower()) + TranslatedTags = [name[0].lower() for name in TranslatedNames] @staticmethod - def from_tag(verse_type): + def translated_tag(verse_tag, strict=False): + """ + Return the translated UPPERCASE tag for a given tag, + used to show translated verse tags in UI + + ``verse_tag`` + The string to return a VerseType for + + ``strict`` + Determines if the default Other or None should be returned + """ + if strict: + not_found_value = None + else: + not_found_value = VerseType.TranslatedTags[VerseType.Other].upper() + verse_tag = verse_tag[0].lower() + for num, tag in enumerate(VerseType.Tags): + if verse_tag == tag: + return VerseType.TranslatedTags[num].upper() + return not_found_value + + @staticmethod + def translated_name(verse_tag, strict=False): + """ + Return the translated name for a given tag + + ``verse_tag`` + The string to return a VerseType for + + ``strict`` + Determines if the default Other or None should be returned + """ + if strict: + not_found_value = None + else: + not_found_value = VerseType.TranslatedNames[VerseType.Other] + verse_tag = verse_tag[0].lower() + for num, tag in enumerate(VerseType.Tags): + if verse_tag == tag: + return VerseType.TranslatedNames[num] + return not_found_value + + @staticmethod + def from_tag(verse_tag, strict=False): """ Return the VerseType for a given tag - ``verse_type`` + ``verse_tag`` + The string to return a VerseType for + + ``strict`` + Determines if the default Other or None should be returned + """ + if strict: + no_return_value = None + else: + no_return_value = VerseType.Other + verse_tag = verse_tag[0].lower() + for num, tag in enumerate(VerseType.Tags): + if verse_tag == tag: + return num + return no_return_value + + @staticmethod + def from_translated_tag(verse_tag): + """ + Return the VerseType for a given tag + + ``verse_tag`` The string to return a VerseType for """ - verse_type = verse_type[0].lower() - for num, string in enumerate(VerseType.Tags): - if verse_type == string: + verse_tag = verse_tag[0].lower() + for num, tag in enumerate(VerseType.TranslatedTags): + if verse_tag == tag: return num @staticmethod - def from_translated_tag(verse_type): - """ - Return the VerseType for a given tag - - ``verse_type`` - The string to return a VerseType for - """ - verse_type = verse_type[0].lower() - for vtypeIndex, vtypeTag in enumerate(VerseType.TranslatedTags): - if verse_type == vtypeTag: - return vtypeIndex - - @staticmethod - def from_string(verse_type): + def from_string(verse_name): """ Return the VerseType for a given string - ``verse_type`` + ``verse_name`` The string to return a VerseType for """ - verse_type = verse_type.lower() - for vtypeIndex, vtypeName in enumerate(VerseType.Names): - if verse_type == vtypeName.lower(): - return vtypeIndex + verse_name = verse_name.lower() + for num, name in enumerate(VerseType.Names): + if verse_name == name.lower(): + return num @staticmethod - def from_translated_string(verse_type): + def from_translated_string(verse_name): """ Return the VerseType for a given string - ``verse_type`` + ``verse_name`` The string to return a VerseType for """ - verse_type = verse_type.lower() + verse_name = verse_name.lower() for num, translation in enumerate(VerseType.TranslatedNames): - if verse_type == translation.lower(): + if verse_name == translation.lower(): return num @staticmethod - def from_loose_input(verse_type): + def from_loose_input(verse_name): """ Return the VerseType for a given string, Other if not found - ``verse_type`` + ``verse_name`` The string to return a VerseType for """ - verseIndex = None - if len(verse_type) > 1: - verseIndex = VerseType.from_translated_string(verse_type) - if verseIndex is None: - verseIndex = VerseType.from_string(verse_type) - if verseIndex is None: - verseIndex = VerseType.from_translated_tag(verse_type) - elif verseIndex is None: - verseIndex = VerseType.from_tag(verse_type) - return verseIndex + verse_index = None + if len(verse_name) > 1: + verse_index = VerseType.from_translated_string(verse_name) + if verse_index is None: + verseIndex = VerseType.from_string(verse_name) + if verse_index is None: + verse_index = VerseType.from_translated_tag(verse_name) + elif verse_index is None: + verse_index = VerseType.from_tag(verse_name) + return verse_index def retrieve_windows_encoding(recommendation=None): """ diff --git a/openlp/plugins/songs/lib/mediaitem.py b/openlp/plugins/songs/lib/mediaitem.py index 147450efd..c7e9bae3b 100644 --- a/openlp/plugins/songs/lib/mediaitem.py +++ b/openlp/plugins/songs/lib/mediaitem.py @@ -344,40 +344,49 @@ class SongMediaItem(MediaManagerItem): if song.lyrics.startswith(u' 1: - verseIndex = \ - VerseType.from_translated_string(verse_type) - if verseIndex is None: - verseIndex = VerseType.from_string(verse_type) - if verseIndex is None: - verseIndex = VerseType.from_tag(verse_type) - if verseIndex is None: - verseIndex = VerseType.Other - versetype = VerseType.TranslatedTags[verseIndex].upper() - verseTag = u'%s%s' % (versetype, verse[0][u'label']) + verse_tag = verse[0][u'type'] + verse_index = None + if len(verse_tag) > 1: + verse_index = \ + VerseType.from_translated_string(verse_tag) + if verse_index is None: + verse_index = VerseType.from_string(verse_tag) + if verse_index is None: + verse_index = VerseType.from_tag(verse_tag) + verse_tag = VerseType.TranslatedTags[verse_index].upper() + verse_def = u'%s%s' % (verse_tag, verse[0][u'label']) service_item.add_from_text( - verse[1][:30], unicode(verse[1]), verseTag) + verse[1][:30], unicode(verse[1]), verse_def) else: # Loop through the verse list and expand the song accordingly. for order in song.verse_order.lower().split(): if len(order) == 0: break for verse in verseList: - if verse[0][u'type'][0] == order[0] and \ - (verse[0][u'label'] == order[1:] or not order[1:]): - verseindex = VerseType.from_tag(verse[0][u'type']) - versetype = VerseType.TranslatedTags[verseindex]\ - .upper() - verseTag = u'%s%s' % (versetype, + if verse[0][u'type'][0].lower() == order[0] and \ + (verse[0][u'label'].lower() == order[1:] or \ + not order[1:]): + if verse_tags_translated: + verse_index = VerseType.from_translated_tag( + verse[0][u'type']) + else: + verse_index = VerseType.from_tag( + verse[0][u'type']) + if verse_index is None: + verse_index = VerseType.Other + verse_tag = VerseType.TranslatedTags[verse_index] + verse_def = u'%s%s' % (verse_tag, verse[0][u'label']) service_item.add_from_text( - verse[1][:30], verse[1], verseTag) + verse[1][:30], verse[1], verse_def) else: verses = song.lyrics.split(u'\n\n') for slide in verses: diff --git a/openlp/plugins/songs/lib/xml.py b/openlp/plugins/songs/lib/xml.py index bfae14db7..e5c3963c0 100644 --- a/openlp/plugins/songs/lib/xml.py +++ b/openlp/plugins/songs/lib/xml.py @@ -465,8 +465,6 @@ class OpenLyrics(object): text += u'\n'.join([unicode(line) for line in lines.line]) verse_name = self._get(verse, u'name') verse_type_index = VerseType.from_tag(verse_name[0]) - if verse_type_index is None: - verse_type_index = VerseType.Other verse_type = VerseType.Names[verse_type_index] verse_number = re.compile(u'[a-zA-Z]*').sub(u'', verse_name) verse_part = re.compile(u'[0-9]*').sub(u'', verse_name[1:]) From 0d498bc3f09f8bc28d39aa56b86a5f1e80761be5 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Fri, 18 Feb 2011 01:07:55 +0000 Subject: [PATCH 051/123] UiStrings --- openlp/core/lib/ui.py | 4 +++- openlp/core/ui/generaltab.py | 4 ++-- openlp/core/ui/printserviceorderdialog.py | 2 +- openlp/core/ui/themeform.py | 2 +- openlp/core/ui/thememanager.py | 5 ++--- openlp/core/ui/themewizard.py | 8 ++++---- openlp/plugins/songs/forms/editsongdialog.py | 6 ++---- openlp/plugins/songs/songsplugin.py | 4 ++-- 8 files changed, 17 insertions(+), 18 deletions(-) diff --git a/openlp/core/lib/ui.py b/openlp/core/lib/ui.py index e77ad2f10..006e2c9f5 100644 --- a/openlp/core/lib/ui.py +++ b/openlp/core/lib/ui.py @@ -45,7 +45,8 @@ class UiStrings(object): Advanced = translate('OpenLP.Ui', 'Advanced') AllFiles = translate('OpenLP.Ui', 'All Files') Browse = translate('OpenLP.Ui', 'Browse...') - Authors = translate('OpenLP.Ui', 'Authors') + Cancel = translate('OpenLP.Ui', 'Cancel') + CCLINumberLabel = translate('OpenLP.Ui', 'CCLI number:') CreateService = translate('OpenLP.Ui', 'Create a new service.') Delete = translate('OpenLP.Ui', '&Delete') Edit = translate('OpenLP.Ui', '&Edit') @@ -63,6 +64,7 @@ class UiStrings(object): Load = translate('OpenLP.Ui', 'Load') New = translate('OpenLP.Ui', 'New') NewService = translate('OpenLP.Ui', 'New Service') + NewTheme = translate('OpenLP.Ui', 'New Theme') NFSs = translate('OpenLP.Ui', 'No File Selected', 'Singular') NFSp = translate('OpenLP.Ui', 'No Files Selected', 'Plural') NISs = translate('OpenLP.Ui', 'No Item Selected', 'Singular') diff --git a/openlp/core/ui/generaltab.py b/openlp/core/ui/generaltab.py index 12353fed8..2b95088ab 100644 --- a/openlp/core/ui/generaltab.py +++ b/openlp/core/ui/generaltab.py @@ -28,6 +28,7 @@ import logging from PyQt4 import QtCore, QtGui from openlp.core.lib import SettingsTab, Receiver, translate +from openlp.core.lib.ui import UiStrings log = logging.getLogger(__name__) @@ -267,8 +268,7 @@ class GeneralTab(SettingsTab): translate('OpenLP.GeneralTab', ' sec')) self.ccliGroupBox.setTitle( translate('OpenLP.GeneralTab', 'CCLI Details')) - self.numberLabel.setText( - translate('OpenLP.GeneralTab', 'CCLI number:')) + self.numberLabel.setText(UiStrings.CCLINumberLabel) self.usernameLabel.setText( translate('OpenLP.GeneralTab', 'SongSelect username:')) self.passwordLabel.setText( diff --git a/openlp/core/ui/printserviceorderdialog.py b/openlp/core/ui/printserviceorderdialog.py index 22f8e9292..c27035fda 100644 --- a/openlp/core/ui/printserviceorderdialog.py +++ b/openlp/core/ui/printserviceorderdialog.py @@ -132,6 +132,6 @@ class Ui_PrintServiceOrderDialog(object): self.serviceTitleLineEdit.setText(translate('OpenLP.ServiceManager', 'Service Order Sheet')) self.printButton.setText(translate('OpenLP.ServiceManager', 'Print')) - self.cancelButton.setText(translate('OpenLP.ServiceManager', 'Cancel')) + self.cancelButton.setText(UiStrings.Cancel) self.customNotesLabel.setText( translate('OpenLP.ServiceManager', 'Custom Service Notes:')) diff --git a/openlp/core/ui/themeform.py b/openlp/core/ui/themeform.py index f34e2b8d2..1b6d8d524 100644 --- a/openlp/core/ui/themeform.py +++ b/openlp/core/ui/themeform.py @@ -301,7 +301,7 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard): 'Edit Theme - %s')) % self.theme.theme_name) self.next() else: - self.setWindowTitle(translate('OpenLP.ThemeWizard', 'New Theme')) + self.setWindowTitle(UiStrings.NewTheme) return QtGui.QWizard.exec_(self) def initializePage(self, id): diff --git a/openlp/core/ui/thememanager.py b/openlp/core/ui/thememanager.py index 5c996f688..981058408 100644 --- a/openlp/core/ui/thememanager.py +++ b/openlp/core/ui/thememanager.py @@ -36,7 +36,7 @@ from openlp.core.lib import OpenLPToolbar, ThemeXML, get_text_file_string, \ build_icon, Receiver, SettingsManager, translate, check_item_selected, \ BackgroundType, BackgroundGradientType, check_directory_exists, \ VerticalType -from openlp.core.lib.ui import critical_error_message_box +from openlp.core.lib.ui import UiStrings, critical_error_message_box from openlp.core.theme import Theme from openlp.core.ui import FileRenameForm, ThemeForm from openlp.core.utils import AppLocation, delete_file, file_is_unicode, \ @@ -62,8 +62,7 @@ class ThemeManager(QtGui.QWidget): self.layout.setMargin(0) self.layout.setObjectName(u'layout') self.toolbar = OpenLPToolbar(self) - self.toolbar.addToolbarButton( - translate('OpenLP.ThemeManager', 'New Theme'), + self.toolbar.addToolbarButton(UiStrings.NewTheme, u':/themes/theme_new.png', translate('OpenLP.ThemeManager', 'Create a new theme.'), self.onAddTheme) diff --git a/openlp/core/ui/themewizard.py b/openlp/core/ui/themewizard.py index fc25e11fa..c968db821 100644 --- a/openlp/core/ui/themewizard.py +++ b/openlp/core/ui/themewizard.py @@ -448,17 +448,17 @@ class Ui_ThemeWizard(object): self.mainFontLabel.setText(translate('OpenLP.ThemeWizard', 'Font:')) self.mainColorLabel.setText(translate('OpenLP.ThemeWizard', 'Color:')) self.mainSizeLabel.setText(translate('OpenLP.ThemeWizard', 'Size:')) - self.mainSizeSpinBox.setSuffix(translate('OpenLP.ThemeWizard', 'pt')) + self.mainSizeSpinBox.setSuffix(UiStrings.FontSizePtUnit) self.lineSpacingLabel.setText( translate('OpenLP.ThemeWizard', 'Line Spacing:')) - self.lineSpacingSpinBox.setSuffix(translate('OpenLP.ThemeWizard', 'pt')) + self.lineSpacingSpinBox.setSuffix(UiStrings.FontSizePtUnit) self.outlineCheckBox.setText( translate('OpenLP.ThemeWizard', '&Outline:')) self.outlineSizeLabel.setText(translate('OpenLP.ThemeWizard', 'Size:')) - self.outlineSizeSpinBox.setSuffix(translate('OpenLP.ThemeWizard', 'pt')) + self.outlineSizeSpinBox.setSuffix(UiStrings.FontSizePtUnit) self.shadowCheckBox.setText(translate('OpenLP.ThemeWizard', '&Shadow:')) self.shadowSizeLabel.setText(translate('OpenLP.ThemeWizard', 'Size:')) - self.shadowSizeSpinBox.setSuffix(translate('OpenLP.ThemeWizard', 'pt')) + self.shadowSizeSpinBox.setSuffix(UiStrings.FontSizePtUnit) self.mainBoldCheckBox.setText(translate('OpenLP.ThemeWizard', 'Bold')) self.mainItalicsCheckBox.setText( translate('OpenLP.ThemeWizard', 'Italic')) diff --git a/openlp/plugins/songs/forms/editsongdialog.py b/openlp/plugins/songs/forms/editsongdialog.py index 491f4fa74..bcc075574 100644 --- a/openlp/plugins/songs/forms/editsongdialog.py +++ b/openlp/plugins/songs/forms/editsongdialog.py @@ -292,10 +292,8 @@ class Ui_EditSongDialog(object): translate('SongsPlugin.EditSongForm', 'New &Theme')) self.rightsGroupBox.setTitle( translate('SongsPlugin.EditSongForm', 'Copyright Information')) - self.copyrightInsertButton.setText( - translate('SongsPlugin.EditSongForm', '\xa9')) - self.CCLILabel.setText( - translate('SongsPlugin.EditSongForm', 'CCLI number:')) + self.copyrightInsertButton.setText(SongStrings.CopyrightSymbol) + self.CCLILabel.setText(UiStrings.CCLINumberLabel) self.commentsGroupBox.setTitle( translate('SongsPlugin.EditSongForm', 'Comments')) self.songTabWidget.setTabText( diff --git a/openlp/plugins/songs/songsplugin.py b/openlp/plugins/songs/songsplugin.py index 887ddb7b2..bf33cd56e 100644 --- a/openlp/plugins/songs/songsplugin.py +++ b/openlp/plugins/songs/songsplugin.py @@ -31,6 +31,7 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import Plugin, StringContent, build_icon, translate from openlp.core.lib.db import Manager +from openlp.core.lib.ui import UiStrings from openlp.plugins.songs.lib import SongMediaItem, SongsTab, SongXML from openlp.plugins.songs.lib.db import init_schema, Song from openlp.plugins.songs.lib.importer import SongFormat @@ -137,8 +138,7 @@ class SongsPlugin(Plugin): """ maxSongs = self.manager.get_object_count(Song) progressDialog = QtGui.QProgressDialog( - translate('SongsPlugin', 'Reindexing songs...'), - translate('SongsPlugin', 'Cancel'), + translate('SongsPlugin', 'Reindexing songs...'), UiStrings.Cancel, 0, maxSongs + 1, self.formparent) progressDialog.setWindowModality(QtCore.Qt.WindowModal) songs = self.manager.get_all_objects(Song) From dc41ce5ab404b9e24c11f747bf12b33824779feb Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Fri, 18 Feb 2011 03:15:09 +0000 Subject: [PATCH 052/123] Enumerations and magic numbers --- openlp/core/lib/__init__.py | 2 -- openlp/core/lib/htmlbuilder.py | 15 +++----- openlp/core/lib/rendermanager.py | 3 +- openlp/core/lib/theme.py | 34 ++++++------------- openlp/core/lib/ui.py | 9 +++-- openlp/core/ui/servicemanager.py | 4 +-- openlp/core/ui/themeform.py | 4 +-- openlp/core/ui/thememanager.py | 9 ++--- openlp/core/ui/themestab.py | 3 +- openlp/core/ui/themewizard.py | 25 ++++++++------ .../plugins/bibles/forms/bibleimportform.py | 33 ++++-------------- openlp/plugins/bibles/lib/__init__.py | 19 +++++++++++ openlp/plugins/bibles/lib/biblestab.py | 15 ++++---- openlp/plugins/bibles/lib/mediaitem.py | 24 +++++++------ .../presentations/lib/presentationtab.py | 2 +- 15 files changed, 96 insertions(+), 105 deletions(-) diff --git a/openlp/core/lib/__init__.py b/openlp/core/lib/__init__.py index 80bf4a67b..ab4c8e26f 100644 --- a/openlp/core/lib/__init__.py +++ b/openlp/core/lib/__init__.py @@ -321,8 +321,6 @@ def check_directory_exists(dir): os.makedirs(dir) from listwidgetwithdnd import ListWidgetWithDnD -from theme import ThemeLevel, ThemeXML, BackgroundGradientType, \ - BackgroundType, HorizontalType, VerticalType from displaytags import DisplayTags from spelltextedit import SpellTextEdit from eventreceiver import Receiver diff --git a/openlp/core/lib/htmlbuilder.py b/openlp/core/lib/htmlbuilder.py index 34d583181..720b4b3f8 100644 --- a/openlp/core/lib/htmlbuilder.py +++ b/openlp/core/lib/htmlbuilder.py @@ -28,8 +28,8 @@ import logging from PyQt4 import QtWebKit -from openlp.core.lib import BackgroundType, BackgroundGradientType, \ - VerticalType +from openlp.core.lib.theme import BackgroundType, BackgroundGradientType, \ + VerticalType, HorizontalType log = logging.getLogger(__name__) @@ -531,13 +531,8 @@ def build_lyrics_format_css(theme, width, height): Height of the lyrics block """ - if theme.display_horizontal_align == 2: - align = u'center' - elif theme.display_horizontal_align == 1: - align = u'right' - else: - align = u'left' - valign = VerticalType.to_string(theme.display_vertical_align) + align = HorizontalType.Names[theme.display_horizontal_align] + valign = VerticalType.Names[theme.display_vertical_align] if theme.font_main_outline: left_margin = int(theme.font_main_outline_size) * 2 else: @@ -630,7 +625,7 @@ def build_alert_css(alertTab, width): """ if not alertTab: return u'' - align = VerticalType.to_string(alertTab.location) + align = VerticalType.Names[alertTab.location] alert = style % (width, align, alertTab.font_face, alertTab.font_size, alertTab.font_color, alertTab.bg_color) return alert diff --git a/openlp/core/lib/rendermanager.py b/openlp/core/lib/rendermanager.py index 4c50b856a..7d579f7a4 100644 --- a/openlp/core/lib/rendermanager.py +++ b/openlp/core/lib/rendermanager.py @@ -28,7 +28,8 @@ import logging from PyQt4 import QtCore -from openlp.core.lib import Renderer, ThemeLevel, ServiceItem, ImageManager +from openlp.core.lib import Renderer, ServiceItem, ImageManager +from openlp.core.lib.theme import ThemeLevel from openlp.core.ui import MainDisplay log = logging.getLogger(__name__) diff --git a/openlp/core/lib/theme.py b/openlp/core/lib/theme.py index 225e1335c..67ddde72d 100644 --- a/openlp/core/lib/theme.py +++ b/openlp/core/lib/theme.py @@ -33,7 +33,8 @@ import logging from xml.dom.minidom import Document from lxml import etree, objectify -from openlp.core.lib import str_to_bool +from openlp.core.lib import str_to_bool, translate +from openlp.core.lib.ui import UiStrings log = logging.getLogger(__name__) @@ -170,20 +171,14 @@ class HorizontalType(object): Type enumeration for horizontal alignment. """ Left = 0 - Center = 2 Right = 1 + Center = 2 - @staticmethod - def to_string(horizontal_type): - """ - Return a string representation of a horizontal type. - """ - if horizontal_type == HorizontalType.Right: - return u'right' - elif horizontal_type == HorizontalType.Center: - return u'center' - else: - return u'left' + Names = [u'left', u'right', u'center'] + TranslatedNames = [ + translate('OpenLP.ThemeWizard', 'Left'), + translate('OpenLP.ThemeWizard', 'Right'), + translate('OpenLP.ThemeWizard', 'Center')] class VerticalType(object): @@ -194,17 +189,8 @@ class VerticalType(object): Middle = 1 Bottom = 2 - @staticmethod - def to_string(vertical_type): - """ - Return a string representation of a vertical type. - """ - if vertical_type == VerticalType.Bottom: - return u'bottom' - elif vertical_type == VerticalType.Middle: - return u'middle' - else: - return u'top' + Names = [u'top', u'middle', u'bottom'] + TranslatedNames = [UiStrings.Top, UiStrings.Middle, UiStrings.Bottom] BOOLEAN_LIST = [u'bold', u'italics', u'override', u'outline', u'shadow', diff --git a/openlp/core/lib/ui.py b/openlp/core/lib/ui.py index 006e2c9f5..2cdda13ac 100644 --- a/openlp/core/lib/ui.py +++ b/openlp/core/lib/ui.py @@ -44,6 +44,7 @@ class UiStrings(object): Add = translate('OpenLP.Ui', '&Add') Advanced = translate('OpenLP.Ui', 'Advanced') AllFiles = translate('OpenLP.Ui', 'All Files') + Bottom = translate('OpenLP.Ui', 'Bottom') Browse = translate('OpenLP.Ui', 'Browse...') Cancel = translate('OpenLP.Ui', 'Cancel') CCLINumberLabel = translate('OpenLP.Ui', 'CCLI number:') @@ -62,6 +63,7 @@ class UiStrings(object): LiveBGError = translate('OpenLP.Ui', 'Live Background Error') LivePanel = translate('OpenLP.Ui', 'Live Panel') Load = translate('OpenLP.Ui', 'Load') + Middle = translate('OpenLP.Ui', 'Middle') New = translate('OpenLP.Ui', 'New') NewService = translate('OpenLP.Ui', 'New Service') NewTheme = translate('OpenLP.Ui', 'New Theme') @@ -89,6 +91,7 @@ class UiStrings(object): StartTimeCode = unicode(translate('OpenLP.Ui', 'Start %s')) Theme = translate('OpenLP.Ui', 'Theme', 'Singular') Themes = translate('OpenLP.Ui', 'Themes', 'Plural') + Top = translate('OpenLP.Ui', 'Top') Version = translate('OpenLP.Ui', 'Version') def add_welcome_page(parent, image): @@ -302,8 +305,8 @@ def create_valign_combo(form, parent, layout): verticalLabel.setText(translate('OpenLP.Ui', '&Vertical Align:')) form.verticalComboBox = QtGui.QComboBox(parent) form.verticalComboBox.setObjectName(u'VerticalComboBox') - form.verticalComboBox.addItem(translate('OpenLP.Ui', 'Top')) - form.verticalComboBox.addItem(translate('OpenLP.Ui', 'Middle')) - form.verticalComboBox.addItem(translate('OpenLP.Ui', 'Bottom')) + form.verticalComboBox.addItem(UiStrings.Top) + form.verticalComboBox.addItem(UiStrings.Middle) + form.verticalComboBox.addItem(UiStrings.Bottom) verticalLabel.setBuddy(form.verticalComboBox) layout.addRow(verticalLabel, form.verticalComboBox) diff --git a/openlp/core/ui/servicemanager.py b/openlp/core/ui/servicemanager.py index 3dfcb6ded..5568ba431 100644 --- a/openlp/core/ui/servicemanager.py +++ b/openlp/core/ui/servicemanager.py @@ -33,8 +33,8 @@ log = logging.getLogger(__name__) from PyQt4 import QtCore, QtGui from openlp.core.lib import OpenLPToolbar, ServiceItem, context_menu_action, \ - Receiver, build_icon, ItemCapabilities, SettingsManager, translate, \ - ThemeLevel + Receiver, build_icon, ItemCapabilities, SettingsManager, translate +from openlp.core.lib.theme import ThemeLevel from openlp.core.lib.ui import UiStrings, critical_error_message_box from openlp.core.ui import ServiceNoteForm, ServiceItemEditForm, StartTimeForm from openlp.core.ui.printserviceorderform import PrintServiceOrderForm diff --git a/openlp/core/ui/themeform.py b/openlp/core/ui/themeform.py index 1b6d8d524..17572f530 100644 --- a/openlp/core/ui/themeform.py +++ b/openlp/core/ui/themeform.py @@ -29,8 +29,8 @@ import os from PyQt4 import QtCore, QtGui -from openlp.core.lib import translate, BackgroundType, BackgroundGradientType, \ - Receiver +from openlp.core.lib import Receiver, translate +from openlp.core.lib.theme import BackgroundType, BackgroundGradientType from openlp.core.lib.ui import UiStrings, critical_error_message_box from openlp.core.utils import get_images_filter from themewizard import Ui_ThemeWizard diff --git a/openlp/core/ui/thememanager.py b/openlp/core/ui/thememanager.py index 981058408..378f5b365 100644 --- a/openlp/core/ui/thememanager.py +++ b/openlp/core/ui/thememanager.py @@ -32,10 +32,11 @@ import logging from xml.etree.ElementTree import ElementTree, XML from PyQt4 import QtCore, QtGui -from openlp.core.lib import OpenLPToolbar, ThemeXML, get_text_file_string, \ - build_icon, Receiver, SettingsManager, translate, check_item_selected, \ - BackgroundType, BackgroundGradientType, check_directory_exists, \ - VerticalType +from openlp.core.lib import OpenLPToolbar, get_text_file_string, build_icon, \ + Receiver, SettingsManager, translate, check_item_selected, \ + check_directory_exists +from openlp.core.lib.theme import ThemeXML, BackgroundType, VerticalType, \ + BackgroundGradientType from openlp.core.lib.ui import UiStrings, critical_error_message_box from openlp.core.theme import Theme from openlp.core.ui import FileRenameForm, ThemeForm diff --git a/openlp/core/ui/themestab.py b/openlp/core/ui/themestab.py index 20bd9a183..6a3505e93 100644 --- a/openlp/core/ui/themestab.py +++ b/openlp/core/ui/themestab.py @@ -26,7 +26,8 @@ from PyQt4 import QtCore, QtGui -from openlp.core.lib import SettingsTab, Receiver, ThemeLevel, translate +from openlp.core.lib import SettingsTab, Receiver, translate +from openlp.core.lib.theme import ThemeLevel from openlp.core.lib.ui import UiStrings class ThemesTab(SettingsTab): diff --git a/openlp/core/ui/themewizard.py b/openlp/core/ui/themewizard.py index c968db821..a482e2703 100644 --- a/openlp/core/ui/themewizard.py +++ b/openlp/core/ui/themewizard.py @@ -27,6 +27,8 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import translate, build_icon +from openlp.core.lib.theme import HorizontalType, BackgroundType, \ + BackgroundGradientType from openlp.core.lib.ui import UiStrings, add_welcome_page, create_valign_combo class Ui_ThemeWizard(object): @@ -417,11 +419,12 @@ class Ui_ThemeWizard(object): 'according to the parameters below.')) self.backgroundLabel.setText( translate('OpenLP.ThemeWizard', 'Background type:')) - self.backgroundComboBox.setItemText(0, + self.backgroundComboBox.setItemText(BackgroundType.Solid, translate('OpenLP.ThemeWizard', 'Solid Color')) - self.backgroundComboBox.setItemText(1, + self.backgroundComboBox.setItemText(BackgroundType.Gradient, translate('OpenLP.ThemeWizard', 'Gradient')) - self.backgroundComboBox.setItemText(2, UiStrings.Image) + self.backgroundComboBox.setItemText( + BackgroundType.Image, UiStrings.Image) self.colorLabel.setText(translate('OpenLP.ThemeWizard', 'Color:')) self.gradientStartLabel.setText( translate(u'OpenLP.ThemeWizard', 'Starting color:')) @@ -429,15 +432,15 @@ class Ui_ThemeWizard(object): translate(u'OpenLP.ThemeWizard', 'Ending color:')) self.gradientTypeLabel.setText( translate('OpenLP.ThemeWizard', 'Gradient:')) - self.gradientComboBox.setItemText(0, + self.gradientComboBox.setItemText(BackgroundGradientType.Horizontal, translate('OpenLP.ThemeWizard', 'Horizontal')) - self.gradientComboBox.setItemText(1, + self.gradientComboBox.setItemText(BackgroundGradientType.Vertical, translate('OpenLP.ThemeWizard', 'Vertical')) - self.gradientComboBox.setItemText(2, + self.gradientComboBox.setItemText(BackgroundGradientType.Circular, translate('OpenLP.ThemeWizard', 'Circular')) - self.gradientComboBox.setItemText(3, + self.gradientComboBox.setItemText(BackgroundGradientType.LeftTop, translate('OpenLP.ThemeWizard', 'Top Left - Bottom Right')) - self.gradientComboBox.setItemText(4, + self.gradientComboBox.setItemText(BackgroundGradientType.LeftBottom, translate('OpenLP.ThemeWizard', 'Bottom Left - Top Right')) self.imageLabel.setText(u'%s:' % UiStrings.Image) self.mainAreaPage.setTitle( @@ -478,11 +481,11 @@ class Ui_ThemeWizard(object): 'formatting information to be defined')) self.horizontalLabel.setText( translate('OpenLP.ThemeWizard', 'Horizontal Align:')) - self.horizontalComboBox.setItemText(0, + self.horizontalComboBox.setItemText(HorizontalType.Left, translate('OpenLP.ThemeWizard', 'Left')) - self.horizontalComboBox.setItemText(1, + self.horizontalComboBox.setItemText(HorizontalType.Right, translate('OpenLP.ThemeWizard', 'Right')) - self.horizontalComboBox.setItemText(2, + self.horizontalComboBox.setItemText(HorizontalType.Center, translate('OpenLP.ThemeWizard', 'Center')) self.transitionsLabel.setText( translate('OpenLP.ThemeWizard', 'Transitions:')) diff --git a/openlp/plugins/bibles/forms/bibleimportform.py b/openlp/plugins/bibles/forms/bibleimportform.py index 83e7065ac..7ec8e1394 100644 --- a/openlp/plugins/bibles/forms/bibleimportform.py +++ b/openlp/plugins/bibles/forms/bibleimportform.py @@ -51,18 +51,7 @@ class WebDownload(object): BibleGateway = 1 Bibleserver = 2 - Names = { - 0: u'Crosswalk', - 1: u'BibleGateway', - 2: u'Bibleserver' - } - - @classmethod - def get_name(cls, name): - """ - Get the web bible type name. - """ - return cls.Names[name] + Names = [u'Crosswalk', u'BibleGateway', u'Bibleserver'] class BibleImportForm(OpenLPWizard): @@ -393,11 +382,11 @@ class BibleImportForm(OpenLPWizard): translate('BiblesPlugin.ImportWizardForm', 'Bible file:')) self.webSourceLabel.setText( translate('BiblesPlugin.ImportWizardForm', 'Location:')) - self.webSourceComboBox.setItemText(0, + self.webSourceComboBox.setItemText(WebDownload.Crosswalk, translate('BiblesPlugin.ImportWizardForm', 'Crosswalk')) - self.webSourceComboBox.setItemText(1, + self.webSourceComboBox.setItemText(WebDownload.BibleGateway, translate('BiblesPlugin.ImportWizardForm', 'BibleGateway')) - self.webSourceComboBox.setItemText(2, + self.webSourceComboBox.setItemText(WebDownload.Bibleserver, translate('BiblesPlugin.ImportWizardForm', 'Bibleserver')) self.webTranslationLabel.setText( translate('BiblesPlugin.ImportWizardForm', 'Bible:')) @@ -680,7 +669,7 @@ class BibleImportForm(OpenLPWizard): self.web_bible_list[download_type][ver] = name.strip() except IOError: log.exception(u'%s resources missing' % - WebDownload.get_name(download_type)) + WebDownload.Names[download_type]) finally: if books_file: books_file.close() @@ -734,18 +723,10 @@ class BibleImportForm(OpenLPWizard): self.progressBar.setMaximum(1) download_location = self.field(u'web_location').toInt()[0] bible_version = unicode(self.webTranslationComboBox.currentText()) - if download_location == WebDownload.Crosswalk: - bible = \ - self.web_bible_list[WebDownload.Crosswalk][bible_version] - elif download_location == WebDownload.BibleGateway: - bible = \ - self.web_bible_list[WebDownload.BibleGateway][bible_version] - elif download_location == WebDownload.Bibleserver: - bible = \ - self.web_bible_list[WebDownload.Bibleserver][bible_version] + bible = self.web_bible_list[download_location][bible_version] importer = self.manager.import_bible( BibleFormat.WebDownload, name=license_version, - download_source=WebDownload.get_name(download_location), + download_source=WebDownload.Names[download_location], download_name=bible, proxy_server=unicode(self.field(u'proxy_server').toString()), proxy_username=\ diff --git a/openlp/plugins/bibles/lib/__init__.py b/openlp/plugins/bibles/lib/__init__.py index 314651ced..78cb6b645 100644 --- a/openlp/plugins/bibles/lib/__init__.py +++ b/openlp/plugins/bibles/lib/__init__.py @@ -32,6 +32,25 @@ import re log = logging.getLogger(__name__) +class LayoutStyle(object): + """ + An enumeration for bible screen layout styles. + """ + VersePerSlide = 0 + VersePerLine = 1 + Continuous = 2 + + +class DisplayStyle(object): + """ + An enumeration for bible text bracket display styles. + """ + NoBrackets = 0 + Round = 1 + Curly = 2 + Square = 3 + + def get_reference_match(match_type): """ Provides the regexes and matches to use while parsing strings for bible diff --git a/openlp/plugins/bibles/lib/biblestab.py b/openlp/plugins/bibles/lib/biblestab.py index f6bd27324..09e32ad8c 100644 --- a/openlp/plugins/bibles/lib/biblestab.py +++ b/openlp/plugins/bibles/lib/biblestab.py @@ -29,6 +29,7 @@ import logging from PyQt4 import QtCore, QtGui from openlp.core.lib import Receiver, SettingsTab, translate +from openlp.plugins.bibles.lib import LayoutStyle, DisplayStyle log = logging.getLogger(__name__) @@ -122,19 +123,19 @@ class BiblesTab(SettingsTab): translate('BiblesPlugin.BiblesTab', 'Display style:')) self.BibleThemeLabel.setText( translate('BiblesPlugin.BiblesTab', 'Bible theme:')) - self.LayoutStyleComboBox.setItemText(0, + self.LayoutStyleComboBox.setItemText(LayoutStyle.VersePerSlide, translate('BiblesPlugin.BiblesTab', 'Verse Per Slide')) - self.LayoutStyleComboBox.setItemText(1, + self.LayoutStyleComboBox.setItemText(LayoutStyle.VersePerLine, translate('BiblesPlugin.BiblesTab', 'Verse Per Line')) - self.LayoutStyleComboBox.setItemText(2, + self.LayoutStyleComboBox.setItemText(LayoutStyle.Continuous, translate('BiblesPlugin.BiblesTab', 'Continuous')) - self.DisplayStyleComboBox.setItemText(0, + self.DisplayStyleComboBox.setItemText(DisplayStyle.NoBrackets, translate('BiblesPlugin.BiblesTab', 'No Brackets')) - self.DisplayStyleComboBox.setItemText(1, + self.DisplayStyleComboBox.setItemText(DisplayStyle.Round, translate('BiblesPlugin.BiblesTab', '( And )')) - self.DisplayStyleComboBox.setItemText(2, + self.DisplayStyleComboBox.setItemText(DisplayStyle.Curly, translate('BiblesPlugin.BiblesTab', '{ And }')) - self.DisplayStyleComboBox.setItemText(3, + self.DisplayStyleComboBox.setItemText(DisplayStyle.Square, translate('BiblesPlugin.BiblesTab', '[ And ]')) self.ChangeNoteLabel.setText(translate('BiblesPlugin.BiblesTab', 'Note:\nChanges do not affect verses already in the service.')) diff --git a/openlp/plugins/bibles/lib/mediaitem.py b/openlp/plugins/bibles/lib/mediaitem.py index 5dbe9655d..deae98fcb 100644 --- a/openlp/plugins/bibles/lib/mediaitem.py +++ b/openlp/plugins/bibles/lib/mediaitem.py @@ -34,7 +34,8 @@ from openlp.core.lib.searchedit import SearchEdit from openlp.core.lib.ui import UiStrings, add_widget_completer, \ media_item_combo_box, critical_error_message_box from openlp.plugins.bibles.forms import BibleImportForm -from openlp.plugins.bibles.lib import get_reference_match +from openlp.plugins.bibles.lib import LayoutStyle, DisplayStyle, \ + get_reference_match log = logging.getLogger(__name__) @@ -56,6 +57,7 @@ class BibleMediaItem(MediaManagerItem): self.IconPath = u'songs/song' MediaManagerItem.__init__(self, parent, plugin, icon) # Place to store the search results for both bibles. + self.settings = self.parent.settings_tab self.search_results = {} self.second_search_results = {} QtCore.QObject.connect(Receiver.get_receiver(), @@ -666,12 +668,12 @@ class BibleMediaItem(MediaManagerItem): raw_slides.append(bible_text.rstrip()) bible_text = u'' # If we are 'Verse Per Slide' then create a new slide. - elif self.parent.settings_tab.layout_style == 0: + elif self.settings.layout_style == LayoutStyle.VersePerSlide: bible_text = u'%s %s' % (verse_text, text) raw_slides.append(bible_text.rstrip()) bible_text = u'' # If we are 'Verse Per Line' then force a new line. - elif self.parent.settings_tab.layout_style == 1: + elif self.settings.layout_style == LayoutStyle.VersePerLine: bible_text = u'%s %s %s\n' % (bible_text, verse_text, text) # We have to be 'Continuous'. else: @@ -689,7 +691,8 @@ class BibleMediaItem(MediaManagerItem): raw_slides.append(bible_text.lstrip()) bible_text = u'' # Service Item: Capabilities - if self.parent.settings_tab.layout_style == 2 and not second_bible: + if self.settings.layout_style == LayoutStyle.Continuous and \ + not second_bible: # Split the line but do not replace line breaks in renderer. service_item.add_capability(ItemCapabilities.NoLineBreaks) service_item.add_capability(ItemCapabilities.AllowsPreview) @@ -701,10 +704,10 @@ class BibleMediaItem(MediaManagerItem): else: service_item.title += u', ' + title # Service Item: Theme - if len(self.parent.settings_tab.bible_theme) == 0: + if len(self.settings.bible_theme) == 0: service_item.theme = None else: - service_item.theme = self.parent.settings_tab.bible_theme + service_item.theme = self.settings.bible_theme for slide in raw_slides: service_item.add_from_text(slide[:30], slide) if service_item.raw_footer: @@ -813,16 +816,15 @@ class BibleMediaItem(MediaManagerItem): The verse number (int). """ verse_separator = get_reference_match(u'sep_v_display') - if not self.parent.settings_tab.show_new_chapters or \ - old_chapter != chapter: + if not self.settings.show_new_chapters or old_chapter != chapter: verse_text = unicode(chapter) + verse_separator + unicode(verse) else: verse_text = unicode(verse) - if self.parent.settings_tab.display_style == 1: + if self.settings.display_style == DisplayStyle.Round: verse_text = u'{su}(' + verse_text + u'){/su}' - elif self.parent.settings_tab.display_style == 2: + elif self.settings.display_style == DisplayStyle.Curly: verse_text = u'{su}{' + verse_text + u'}{/su}' - elif self.parent.settings_tab.display_style == 3: + elif self.settings.display_style == DisplayStyle.Square: verse_text = u'{su}[' + verse_text + u']{/su}' else: verse_text = u'{su}' + verse_text + u'{/su}' diff --git a/openlp/plugins/presentations/lib/presentationtab.py b/openlp/plugins/presentations/lib/presentationtab.py index fdb66c511..8bcb7474a 100644 --- a/openlp/plugins/presentations/lib/presentationtab.py +++ b/openlp/plugins/presentations/lib/presentationtab.py @@ -85,7 +85,7 @@ class PresentationTab(SettingsTab): else: checkbox.setText( unicode(translate('PresentationPlugin.PresentationTab', - '%s (unvailable)')) % controller.name) + '%s (unavailable)')) % controller.name) self.AdvancedGroupBox.setTitle(UiStrings.Advanced) self.OverrideAppCheckBox.setText( translate('PresentationPlugin.PresentationTab', From 1651e42bcada1aa44b2aaa5cd2160445ae436fa3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20P=C3=B5ldaru?= Date: Fri, 18 Feb 2011 09:53:40 +0200 Subject: [PATCH 053/123] more variable name changes --- openlp/plugins/songs/forms/editsongform.py | 2 +- openlp/plugins/songs/forms/editverseform.py | 5 +- openlp/plugins/songs/lib/__init__.py | 2 +- openlp/plugins/songs/lib/opensongimport.py | 116 ++++++++++---------- openlp/plugins/songs/lib/songimport.py | 64 +++++------ 5 files changed, 94 insertions(+), 95 deletions(-) diff --git a/openlp/plugins/songs/forms/editsongform.py b/openlp/plugins/songs/forms/editsongform.py index a9c5bac86..0470a2d32 100644 --- a/openlp/plugins/songs/forms/editsongform.py +++ b/openlp/plugins/songs/forms/editsongform.py @@ -787,7 +787,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): verseId = unicode(item.data(QtCore.Qt.UserRole).toString()) verse_tag = verseId[0] verse_num = verseId[1:] - sxml.add_verse_to_lyrics(verse_type, verse_num, + sxml.add_verse_to_lyrics(verse_tag, verse_num, unicode(item.text())) text = text + self.whitespace.sub(u' ', unicode(self.verseListWidget.item(i, 0).text())) + u' ' diff --git a/openlp/plugins/songs/forms/editverseform.py b/openlp/plugins/songs/forms/editverseform.py index ada612c43..a5b8e2696 100644 --- a/openlp/plugins/songs/forms/editverseform.py +++ b/openlp/plugins/songs/forms/editverseform.py @@ -127,11 +127,10 @@ class EditVerseForm(QtGui.QDialog, Ui_EditVerseDialog): if match: verse_type = match.group(1) verse_type_index = VerseType.from_loose_input(verse_type) - regex = re.compile(r'(\d+)') - verse_num = int(match.group(2)) + verse_number = int(match.group(2)) if verse_type_index is not None: self.verseTypeComboBox.setCurrentIndex(verse_type_index) - self.verseNumberBox.setValue(verse_num) + self.verseNumberBox.setValue(verse_number) def setVerse(self, text, single=False, tag=u'%s1' % VerseType.Tags[VerseType.Verse]): diff --git a/openlp/plugins/songs/lib/__init__.py b/openlp/plugins/songs/lib/__init__.py index a1cc7e19d..8b64618c0 100644 --- a/openlp/plugins/songs/lib/__init__.py +++ b/openlp/plugins/songs/lib/__init__.py @@ -175,7 +175,7 @@ class VerseType(object): if len(verse_name) > 1: verse_index = VerseType.from_translated_string(verse_name) if verse_index is None: - verseIndex = VerseType.from_string(verse_name) + verse_index = VerseType.from_string(verse_name) if verse_index is None: verse_index = VerseType.from_translated_tag(verse_name) elif verse_index is None: diff --git a/openlp/plugins/songs/lib/opensongimport.py b/openlp/plugins/songs/lib/opensongimport.py index 36d46b903..00fdbf044 100644 --- a/openlp/plugins/songs/lib/opensongimport.py +++ b/openlp/plugins/songs/lib/opensongimport.py @@ -161,8 +161,8 @@ class OpenSongImport(SongImport): self.import_wizard.incrementProgressBar( unicode(translate('SongsPlugin.ImportWizardForm', 'Importing %s...')) % os.path.split(filename)[-1]) - songfile = open(filename) - if self.do_import_file(songfile) and self.commit and \ + song_file = open(filename) + if self.do_import_file(song_file) and self.commit and \ not self.stop_import_flag: self.finish() else: @@ -209,92 +209,92 @@ class OpenSongImport(SongImport): verses = {} # keep track of verses appearance order our_verse_order = [] - # default versetype - versetype = u'v' - versenum = u'1' + # default verse + verse_tag = u'v' + verse_num = u'1' # for the case where song has several sections with same marker inst = 1 lyrics = unicode(root.lyrics) - for thisline in lyrics.split(u'\n'): + for this_line in lyrics.split(u'\n'): # remove comments - semicolon = thisline.find(u';') + semicolon = this_line.find(u';') if semicolon >= 0: - thisline = thisline[:semicolon] - thisline = thisline.strip() - if not len(thisline): + this_line = this_line[:semicolon] + this_line = this_line.strip() + if not len(this_line): continue # skip guitar chords and page and column breaks - if thisline.startswith(u'.') or thisline.startswith(u'---') \ - or thisline.startswith(u'-!!'): + if this_line.startswith(u'.') or this_line.startswith(u'---') \ + or this_line.startswith(u'-!!'): continue # verse/chorus/etc. marker - if thisline.startswith(u'['): + if this_line.startswith(u'['): # drop the square brackets - right_bracket = thisline.find(u']') - content = thisline[1:right_bracket].lower() + right_bracket = this_line.find(u']') + content = this_line[1:right_bracket].lower() # have we got any digits? - # If so, versenumber is everything from the digits + # If so, verse number is everything from the digits # to the end (even if there are some alpha chars on the end) match = re.match(u'(.*)(\d+.*)', content) if match is not None: - versetype = match.group(1) - versenum = match.group(2) + verse_tag = match.group(1) + verse_num = match.group(2) else: # otherwise we assume number 1 and take the whole prefix as - # the versetype - versetype = content - versenum = u'1' + # the verse tag + verse_tag = content + verse_num = u'1' inst = 1 - if [versetype, versenum, inst] in our_verse_order \ - and verses.has_key(versetype) \ - and verses[versetype].has_key(versenum): - inst = len(verses[versetype][versenum])+1 - our_verse_order.append([versetype, versenum, inst]) + if [verse_tag, verse_num, inst] in our_verse_order \ + and verses.has_key(verse_tag) \ + and verses[verse_tag].has_key(verse_num): + inst = len(verses[verse_tag][verse_num])+1 + our_verse_order.append([verse_tag, verse_num, inst]) continue # number at start of line.. it's verse number - if thisline[0].isdigit(): - versenum = thisline[0] - thisline = thisline[1:].strip() - our_verse_order.append([versetype, versenum, inst]) - if not verses.has_key(versetype): - verses[versetype] = {} - if not verses[versetype].has_key(versenum): - verses[versetype][versenum] = {} - if not verses[versetype][versenum].has_key(inst): - verses[versetype][versenum][inst] = [] + if this_line[0].isdigit(): + verse_num = this_line[0] + this_line = this_line[1:].strip() + our_verse_order.append([verse_tag, verse_num, inst]) + if not verses.has_key(verse_tag): + verses[verse_tag] = {} + if not verses[verse_tag].has_key(verse_num): + verses[verse_tag][verse_num] = {} + if not verses[verse_tag][verse_num].has_key(inst): + verses[verse_tag][verse_num][inst] = [] # Tidy text and remove the ____s from extended words - thisline = self.tidy_text(thisline) - thisline = thisline.replace(u'_', u'') - thisline = thisline.replace(u'|', u'\n') - verses[versetype][versenum][inst].append(thisline) + this_line = self.tidy_text(this_line) + this_line = this_line.replace(u'_', u'') + this_line = this_line.replace(u'|', u'\n') + verses[verse_tag][verse_num][inst].append(this_line) # done parsing # add verses in original order - for (versetype, versenum, inst) in our_verse_order: - vtag = u'%s%s' % (versetype, versenum) - lines = u'\n'.join(verses[versetype][versenum][inst]) - self.add_verse(lines, vtag) + for (verse_tag, verse_num, inst) in our_verse_order: + verse_def = u'%s%s' % (verse_tag, verse_num) + lines = u'\n'.join(verses[verse_tag][verse_num][inst]) + self.add_verse(lines, verse_def) # figure out the presentation order, if present if u'presentation' in fields and root.presentation != u'': order = unicode(root.presentation) # We make all the tags in the lyrics lower case, so match that here # and then split into a list on the whitespace order = order.lower().split() - for tag in order: - match = re.match(u'(.*)(\d+.*)', tag) + for verse_def in order: + match = re.match(u'(.*)(\d+.*)', verse_def) if match is not None: - versetype = match.group(1) - versenum = match.group(2) - if not len(versetype): - versetype = u'v' + verse_tag = match.group(1) + verse_num = match.group(2) + if not len(verse_tag): + verse_tag = u'v' else: # Assume it's no.1 if there are no digits - versetype = tag - versenum = u'1' - vtagString = u'%s%s' % (versetype, versenum) - if verses.has_key(versetype) \ - and verses[versetype].has_key(versenum): - self.verse_order_list.append(vtagString) + verse_tag = verse_def + verse_num = u'1' + verse_def = u'%s%s' % (verse_tag, verse_num) + if verses.has_key(verse_tag) \ + and verses[verse_tag].has_key(verse_num): + self.verse_order_list.append(verse_def) else: - log.info(u'Got order %s but not in versetags, dropping' - u'this item from presentation order', vtagString) + log.info(u'Got order %s but not in verse tags, dropping' + u'this item from presentation order', verse_def) return True diff --git a/openlp/plugins/songs/lib/songimport.py b/openlp/plugins/songs/lib/songimport.py index f4a43c3b4..f1f4b4249 100644 --- a/openlp/plugins/songs/lib/songimport.py +++ b/openlp/plugins/songs/lib/songimport.py @@ -200,39 +200,38 @@ class SongImport(QtCore.QObject): return self.media_files.append(filename) - def add_verse(self, versetext, versetag=u'v', lang=None): + def add_verse(self, verse_text, verse_def=u'v', lang=None): """ Add a verse. This is the whole verse, lines split by \\n. It will also attempt to detect duplicates. In this case it will just add to the verse order. - ``versetext`` + ``verse_text`` The text of the verse. - ``versetag`` - The verse tag can be V1/C1/B etc, or 'V' and 'C' (will count the + ``verse_def`` + The verse tag can be v1/c1/b etc, or 'v' and 'c' (will count the verses/choruses itself) or None, where it will assume verse. ``lang`` The language code (ISO-639) of the verse, for example *en* or *de*. """ - for (oldversetag, oldverse, oldlang) in self.verses: - if oldverse.strip() == versetext.strip(): - # this verse is already present - self.verse_order_list_generated.append(oldversetag) + for (old_verse_def, old_verse, old_lang) in self.verses: + if old_verse.strip() == verse_text.strip(): + self.verse_order_list_generated.append(old_verse_def) self.verse_order_list_generated_useful = True return - if versetag[0] in self.versecounts: - self.versecounts[versetag[0]] += 1 + if verse_def[0] in self.verse_counts: + self.verse_counts[verse_def[0]] += 1 else: - self.versecounts[versetag[0]] = 1 - if len(versetag) == 1: - versetag += unicode(self.versecounts[versetag[0]]) - elif int(versetag[1:]) > self.versecounts[versetag[0]]: - self.versecounts[versetag[0]] = int(versetag[1:]) - self.verses.append([versetag, versetext.rstrip(), lang]) - self.verse_order_list_generated.append(versetag) + self.verse_counts[verse_def[0]] = 1 + if len(verse_def) == 1: + verse_def += unicode(self.versecounts[verse_def[0]]) + elif int(verse_def[1:]) > self.versecounts[verse_def[0]]: + self.versecounts[verse_def[0]] = int(verse_def[1:]) + self.verses.append([verse_def, versetext.rstrip(), lang]) + self.verse_order_list_generated.append(verse_def) def repeat_verse(self): """ @@ -277,28 +276,29 @@ class SongImport(QtCore.QObject): verses_changed_to_other = {} sxml = SongXML() other_count = 1 - for (versetag, versetext, lang) in self.verses: - if versetag[0].lower() in VerseType.Tags: - versetype = versetag[0].lower() + for (verse_def, verse_text, lang) in self.verses: + if verse_def[0].lower() in VerseType.Tags: + verse_def = verse_def[0].lower() else: - newversetag = u'%s%d' % (VerseType.Tags[VerseType.Other], + new_verse_def = u'%s%d' % (VerseType.Tags[VerseType.Other], other_count) - verses_changed_to_other[versetag] = newversetag + verses_changed_to_other[verse_def] = new_verse_def other_count += 1 - versetype = VerseType.Tags[VerseType.Other] - log.info(u'Versetype %s changing to %s' , versetag, newversetag) - versetag = newversetag - sxml.add_verse_to_lyrics(versetype, versetag[1:], versetext, lang) - song.search_lyrics += u' ' + self.remove_punctuation(versetext) + verse_tag = VerseType.Tags[VerseType.Other] + log.info(u'Versetype %s changing to %s' , verse_def, + new_verse_def) + verse_def = new_verse_def + sxml.add_verse_to_lyrics(verse_tag, verse_def[1:], verse_text, lang) + song.search_lyrics += u' ' + self.remove_punctuation(verse_text) song.search_lyrics = song.search_lyrics.lower() song.lyrics = unicode(sxml.extract_xml(), u'utf-8') if not len(self.verse_order_list) and \ self.verse_order_list_generated_useful: self.verse_order_list = self.verse_order_list_generated - for i, current_verse_tag in enumerate(self.verse_order_list): - if verses_changed_to_other.has_key(current_verse_tag): + for i, current_verse_def in enumerate(self.verse_order_list): + if verses_changed_to_other.has_key(current_verse_def): self.verse_order_list[i] = \ - verses_changed_to_other[current_verse_tag] + verses_changed_to_other[current_verse_def] song.verse_order = u' '.join(self.verse_order_list) song.copyright = self.copyright song.comments = self.comments @@ -343,8 +343,8 @@ class SongImport(QtCore.QObject): + u'========================================' print u'TITLE: ' + self.title print u'ALT TITLE: ' + self.alternate_title - for (versetag, versetext, lang) in self.verses: - print u'VERSE ' + versetag + u': ' + versetext + for (verse_def, verse_text, lang) in self.verses: + print u'VERSE ' + verse_def + u': ' + verse_text print u'ORDER: ' + u' '.join(self.verse_order_list) print u'GENERATED ORDER: ' + u' '.join(self.verse_order_list_generated) for author in self.authors: From 62091b92fe01f0f05c6166d1f597f80149725c94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20P=C3=B5ldaru?= Date: Fri, 18 Feb 2011 10:25:43 +0200 Subject: [PATCH 054/123] These would have been left behind. 2% less typos now. --- openlp/plugins/songs/forms/editsongform.py | 2 +- openlp/plugins/songs/forms/editverseform.py | 2 +- openlp/plugins/songs/lib/__init__.py | 2 +- openlp/plugins/songs/lib/songimport.py | 20 ++++++++++---------- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/openlp/plugins/songs/forms/editsongform.py b/openlp/plugins/songs/forms/editsongform.py index 0470a2d32..77caf012e 100644 --- a/openlp/plugins/songs/forms/editsongform.py +++ b/openlp/plugins/songs/forms/editsongform.py @@ -448,7 +448,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): if self.verse_form.exec_(): after_text, verse_tag, verse_num = self.verse_form.getVerse() verse_def = u'%s%s' % (verse_tag, verse_num) - item = QtGui.QTableWidgetItem(afterText) + item = QtGui.QTableWidgetItem(after_text) item.setData(QtCore.Qt.UserRole, QtCore.QVariant(verse_def)) item.setText(after_text) self.verseListWidget.setRowCount( diff --git a/openlp/plugins/songs/forms/editverseform.py b/openlp/plugins/songs/forms/editverseform.py index a5b8e2696..6156e6821 100644 --- a/openlp/plugins/songs/forms/editverseform.py +++ b/openlp/plugins/songs/forms/editverseform.py @@ -57,7 +57,7 @@ class EditVerseForm(QtGui.QDialog, Ui_EditVerseDialog): QtCore.QObject.connect(self.verseTypeComboBox, QtCore.SIGNAL(u'currentIndexChanged(int)'), self.onVerseTypeComboBoxChanged) - self.verse_regex = re.compile(r'---\[(.+):\D*(\d.)\D*\]---') + self.verse_regex = re.compile(r'---\[(.+):\D*(\d*)\D*.*\]---') def contextMenu(self, point): item = self.serviceManagerList.itemAt(point) diff --git a/openlp/plugins/songs/lib/__init__.py b/openlp/plugins/songs/lib/__init__.py index 8b64618c0..95fae92a8 100644 --- a/openlp/plugins/songs/lib/__init__.py +++ b/openlp/plugins/songs/lib/__init__.py @@ -178,7 +178,7 @@ class VerseType(object): verse_index = VerseType.from_string(verse_name) if verse_index is None: verse_index = VerseType.from_translated_tag(verse_name) - elif verse_index is None: + if verse_index is None: verse_index = VerseType.from_tag(verse_name) return verse_index diff --git a/openlp/plugins/songs/lib/songimport.py b/openlp/plugins/songs/lib/songimport.py index f1f4b4249..e0e078c43 100644 --- a/openlp/plugins/songs/lib/songimport.py +++ b/openlp/plugins/songs/lib/songimport.py @@ -79,7 +79,7 @@ class SongImport(QtCore.QObject): self.verse_order_list_generated = [] self.verse_order_list = [] self.verses = [] - self.versecounts = {} + self.verse_counts = {} self.copyright_string = unicode(translate( 'SongsPlugin.SongImport', 'copyright')) self.copyright_symbol = unicode(translate( @@ -130,10 +130,10 @@ class SongImport(QtCore.QObject): return text def process_song_text(self, text): - versetexts = text.split(u'\n\n') - for versetext in versetexts: - if versetext.strip() != u'': - self.process_verse_text(versetext.strip()) + verse_texts = text.split(u'\n\n') + for verse_text in verse_texts: + if verse_text.strip() != u'': + self.process_verse_text(verse_text.strip()) def process_verse_text(self, text): lines = text.split(u'\n') @@ -227,10 +227,10 @@ class SongImport(QtCore.QObject): else: self.verse_counts[verse_def[0]] = 1 if len(verse_def) == 1: - verse_def += unicode(self.versecounts[verse_def[0]]) - elif int(verse_def[1:]) > self.versecounts[verse_def[0]]: - self.versecounts[verse_def[0]] = int(verse_def[1:]) - self.verses.append([verse_def, versetext.rstrip(), lang]) + verse_def += unicode(self.verse_counts[verse_def[0]]) + elif int(verse_def[1:]) > self.verse_counts[verse_def[0]]: + self.verse_counts[verse_def[0]] = int(verse_def[1:]) + self.verses.append([verse_def, verse_text.rstrip(), lang]) self.verse_order_list_generated.append(verse_def) def repeat_verse(self): @@ -278,7 +278,7 @@ class SongImport(QtCore.QObject): other_count = 1 for (verse_def, verse_text, lang) in self.verses: if verse_def[0].lower() in VerseType.Tags: - verse_def = verse_def[0].lower() + verse_tag = verse_def[0].lower() else: new_verse_def = u'%s%d' % (VerseType.Tags[VerseType.Other], other_count) From 57ffb1758b74f35e1f2714ca5077de8b58cd860c Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Fri, 18 Feb 2011 15:23:33 +0000 Subject: [PATCH 055/123] Fix mime data string --- openlp/core/lib/mediamanageritem.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openlp/core/lib/mediamanageritem.py b/openlp/core/lib/mediamanageritem.py index d4fdfff17..c2c2987c2 100644 --- a/openlp/core/lib/mediamanageritem.py +++ b/openlp/core/lib/mediamanageritem.py @@ -240,7 +240,7 @@ class MediaManagerItem(QtGui.QWidget): Creates the main widget for listing items the media item is tracking """ # Add the List widget - self.listView = ListWidgetWithDnD(self, self.title) + self.listView = ListWidgetWithDnD(self, self.plugin.name) self.listView.uniformItemSizes = True self.listView.setSpacing(1) self.listView.setSelectionMode( From 8fdfb299e04836c7cdc86944bcfd6cc7b134b837 Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Fri, 18 Feb 2011 18:23:07 +0200 Subject: [PATCH 056/123] Fixed up the documentation. --- documentation/api/source/core/lib.rst | 2 +- documentation/api/source/plugins/songs.rst | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/documentation/api/source/core/lib.rst b/documentation/api/source/core/lib.rst index fa894875d..6be95de5f 100644 --- a/documentation/api/source/core/lib.rst +++ b/documentation/api/source/core/lib.rst @@ -13,7 +13,7 @@ Object Library :members: :mod:`ListWidgetWithDnD` ----------------------- +------------------------ .. autoclass:: openlp.core.lib.listwidgetwithdnd.ListWidgetWithDnD :members: diff --git a/documentation/api/source/plugins/songs.rst b/documentation/api/source/plugins/songs.rst index 1e86ce020..a9a3a8219 100644 --- a/documentation/api/source/plugins/songs.rst +++ b/documentation/api/source/plugins/songs.rst @@ -54,9 +54,6 @@ Helper Classes & Functions .. automodule:: openlp.plugins.songs.lib.mediaitem :members: -.. autoclass:: openlp.plugins.songs.lib.mediaitem.SongListView - :members: - .. automodule:: openlp.plugins.songs.lib.songimport :members: From bcf35bf54e2cb4d9db7e2fc0a9ba7cc2d9c1521f Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Fri, 18 Feb 2011 17:34:43 +0000 Subject: [PATCH 057/123] Sort out song importer initialisation --- openlp/plugins/songs/lib/cclifileimport.py | 11 +++-------- openlp/plugins/songs/lib/easislidesimport.py | 14 ++++++-------- openlp/plugins/songs/lib/ewimport.py | 3 +-- openlp/plugins/songs/lib/olp1import.py | 3 +-- openlp/plugins/songs/lib/olpimport.py | 5 ++--- openlp/plugins/songs/lib/oooimport.py | 9 ++------- openlp/plugins/songs/lib/openlyricsexport.py | 0 openlp/plugins/songs/lib/openlyricsimport.py | 9 ++------- openlp/plugins/songs/lib/opensongimport.py | 10 ++++------ openlp/plugins/songs/lib/songbeamerimport.py | 7 +------ openlp/plugins/songs/lib/songimport.py | 12 ++++++++++-- openlp/plugins/songs/lib/songshowplusimport.py | 7 +------ openlp/plugins/songs/lib/wowimport.py | 7 +------ 13 files changed, 34 insertions(+), 63 deletions(-) mode change 100755 => 100644 openlp/plugins/songs/lib/openlyricsexport.py diff --git a/openlp/plugins/songs/lib/cclifileimport.py b/openlp/plugins/songs/lib/cclifileimport.py index 534cbeab7..ccd1dff9c 100644 --- a/openlp/plugins/songs/lib/cclifileimport.py +++ b/openlp/plugins/songs/lib/cclifileimport.py @@ -51,22 +51,17 @@ class CCLIFileImport(SongImport): ``filenames`` The files to be imported. """ - SongImport.__init__(self, manager) - if u'filenames' in kwargs: - self.filenames = kwargs[u'filenames'] - log.debug(self.filenames) - else: - raise KeyError(u'Keyword argument "filenames" not supplied.') + SongImport.__init__(self, manager, **kwargs) def do_import(self): """ Import either a .usr or a .txt SongSelect file """ log.debug(u'Starting CCLI File Import') - song_total = len(self.filenames) + song_total = len(self.import_source) self.import_wizard.progressBar.setMaximum(song_total) song_count = 1 - for filename in self.filenames: + for filename in self.import_source: self.import_wizard.incrementProgressBar(unicode(translate( 'SongsPlugin.CCLIFileImport', 'Importing song %d of %d')) % (song_count, song_total)) diff --git a/openlp/plugins/songs/lib/easislidesimport.py b/openlp/plugins/songs/lib/easislidesimport.py index df9aa98d6..bdf263a4b 100644 --- a/openlp/plugins/songs/lib/easislidesimport.py +++ b/openlp/plugins/songs/lib/easislidesimport.py @@ -46,32 +46,30 @@ class EasiSlidesImport(SongImport): """ Initialise the class. """ - SongImport.__init__(self, manager) - self.filename = kwargs[u'filename'] - self.song = None + SongImport.__init__(self, manager, **kwargs) self.commit = True def do_import(self): """ - Import either each of the files in self.filenames - each element of + Import either each of the files in self.import_sources - each element of which can be either a single opensong file, or a zipfile containing multiple opensong files. If `self.commit` is set False, the import will not be committed to the database (useful for test scripts). """ self.import_wizard.progressBar.setMaximum(1) - log.info(u'Importing EasiSlides XML file %s', self.filename) + log.info(u'Importing EasiSlides XML file %s', self.import_source) parser = etree.XMLParser(remove_blank_text=True) - file = etree.parse(self.filename, parser) + file = etree.parse(self.import_source, parser) xml = unicode(etree.tostring(file)) song_xml = objectify.fromstring(xml) self.import_wizard.incrementProgressBar( - WizardStrings.ImportingType % os.path.split(self.filename)[-1]) + WizardStrings.ImportingType % os.path.split(self.import_source)[-1]) self.import_wizard.progressBar.setMaximum(len(song_xml.Item)) for song in song_xml.Item: self.import_wizard.incrementProgressBar( unicode(translate('SongsPlugin.ImportWizardForm', u'Importing %s, song %s...')) % - (os.path.split(self.filename)[-1], song.Title1)) + (os.path.split(self.import_source)[-1], song.Title1)) success = self._parse_song(song) if not success or self.stop_import_flag: return False diff --git a/openlp/plugins/songs/lib/ewimport.py b/openlp/plugins/songs/lib/ewimport.py index df88f025b..c88238610 100644 --- a/openlp/plugins/songs/lib/ewimport.py +++ b/openlp/plugins/songs/lib/ewimport.py @@ -135,8 +135,7 @@ class EasyWorshipSongImport(SongImport): ability to import EasyWorship song files. """ def __init__(self, manager, **kwargs): - self.import_source = kwargs[u'filename'] - SongImport.__init__(self, manager) + SongImport.__init__(self, manager, **kwargs) def do_import(self): # Open the DB and MB files if they exist diff --git a/openlp/plugins/songs/lib/olp1import.py b/openlp/plugins/songs/lib/olp1import.py index a8fb29691..5e18c7ffa 100644 --- a/openlp/plugins/songs/lib/olp1import.py +++ b/openlp/plugins/songs/lib/olp1import.py @@ -55,8 +55,7 @@ class OpenLP1SongImport(SongImport): ``filename`` The database providing the data to import. """ - SongImport.__init__(self, manager) - self.import_source = kwargs[u'filename'] + SongImport.__init__(self, manager, **kwargs) def do_import(self): """ diff --git a/openlp/plugins/songs/lib/olpimport.py b/openlp/plugins/songs/lib/olpimport.py index d2a00447f..b3f03b951 100644 --- a/openlp/plugins/songs/lib/olpimport.py +++ b/openlp/plugins/songs/lib/olpimport.py @@ -86,9 +86,8 @@ class OpenLPSongImport(SongImport): ``source_db`` The database providing the data to import. """ - SongImport.__init__(self, manager) - self.import_source = u'sqlite:///%s' % kwargs[u'filename'] - log.debug(self.import_source) + SongImport.__init__(self, manager, **kwargs) + self.import_source = u'sqlite:///%s' % self.import_source self.source_session = None def do_import(self): diff --git a/openlp/plugins/songs/lib/oooimport.py b/openlp/plugins/songs/lib/oooimport.py index 32315130a..69852c922 100644 --- a/openlp/plugins/songs/lib/oooimport.py +++ b/openlp/plugins/songs/lib/oooimport.py @@ -56,20 +56,15 @@ class OooImport(SongImport): Initialise the class. Requires a songmanager class which is passed to SongImport for writing song to disk """ - SongImport.__init__(self, master_manager) - self.song = None - self.master_manager = master_manager + SongImport.__init__(self, master_manager, **kwargs) self.document = None self.process_started = False - self.filenames = kwargs[u'filenames'] - QtCore.QObject.connect(Receiver.get_receiver(), - QtCore.SIGNAL(u'openlp_stop_wizard'), self.stop_import) def do_import(self): self.stop_import_flag = False self.import_wizard.progressBar.setMaximum(0) self.start_ooo() - for filename in self.filenames: + for filename in self.import_source: if self.stop_import_flag: self.import_wizard.incrementProgressBar(u'Import cancelled', 0) return diff --git a/openlp/plugins/songs/lib/openlyricsexport.py b/openlp/plugins/songs/lib/openlyricsexport.py old mode 100755 new mode 100644 diff --git a/openlp/plugins/songs/lib/openlyricsimport.py b/openlp/plugins/songs/lib/openlyricsimport.py index f4506c2be..0396335b8 100644 --- a/openlp/plugins/songs/lib/openlyricsimport.py +++ b/openlp/plugins/songs/lib/openlyricsimport.py @@ -48,13 +48,8 @@ class OpenLyricsImport(SongImport): Initialise the import. """ log.debug(u'initialise OpenLyricsImport') - SongImport.__init__(self, master_manager) - self.master_manager = master_manager - self.openLyrics = OpenLyrics(master_manager) - if kwargs.has_key(u'filename'): - self.import_source = kwargs[u'filename'] - if kwargs.has_key(u'filenames'): - self.import_source = kwargs[u'filenames'] + SongImport.__init__(self, master_manager, **kwargs) + self.openLyrics = OpenLyrics(self.manager) def do_import(self): """ diff --git a/openlp/plugins/songs/lib/opensongimport.py b/openlp/plugins/songs/lib/opensongimport.py index cfbb31691..5214a0a24 100644 --- a/openlp/plugins/songs/lib/opensongimport.py +++ b/openlp/plugins/songs/lib/opensongimport.py @@ -105,21 +105,19 @@ class OpenSongImport(SongImport): """ Initialise the class. """ - SongImport.__init__(self, manager) - self.filenames = kwargs[u'filenames'] - self.song = None + SongImport.__init__(self, manager, **kwargs) self.commit = True def do_import(self): """ - Import either each of the files in self.filenames - each element of + Import either each of the files in self.import_source - each element of which can be either a single opensong file, or a zipfile containing multiple opensong files. If `self.commit` is set False, the import will not be committed to the database (useful for test scripts). """ success = True numfiles = 0 - for filename in self.filenames: + for filename in self.import_source: ext = os.path.splitext(filename)[1] if ext.lower() == u'.zip': z = ZipFile(filename, u'r') @@ -128,7 +126,7 @@ class OpenSongImport(SongImport): numfiles += 1 log.debug(u'Total number of files: %d', numfiles) self.import_wizard.progressBar.setMaximum(numfiles) - for filename in self.filenames: + for filename in self.import_source: if self.stop_import_flag: success = False break diff --git a/openlp/plugins/songs/lib/songbeamerimport.py b/openlp/plugins/songs/lib/songbeamerimport.py index 9b47b2c52..2adfb30b2 100644 --- a/openlp/plugins/songs/lib/songbeamerimport.py +++ b/openlp/plugins/songs/lib/songbeamerimport.py @@ -74,12 +74,7 @@ class SongBeamerImport(SongImport): ``master_manager`` The song manager for the running OpenLP installation. """ - SongImport.__init__(self, master_manager) - if kwargs.has_key(u'filename'): - self.import_source = kwargs[u'filename'] - if kwargs.has_key(u'filenames'): - self.import_source = kwargs[u'filenames'] - log.debug(self.import_source) + SongImport.__init__(self, master_manager, **kwargs) def do_import(self): """ diff --git a/openlp/plugins/songs/lib/songimport.py b/openlp/plugins/songs/lib/songimport.py index 9493dfdb2..b24b2699a 100644 --- a/openlp/plugins/songs/lib/songimport.py +++ b/openlp/plugins/songs/lib/songimport.py @@ -44,7 +44,7 @@ class SongImport(QtCore.QObject): whether the authors etc already exist and add them or refer to them as necessary """ - def __init__(self, manager): + def __init__(self, manager, **kwargs): """ Initialise and create defaults for properties @@ -54,6 +54,14 @@ class SongImport(QtCore.QObject): """ self.manager = manager + if kwargs.has_key(u'filename'): + self.import_source = kwargs[u'filename'] + elif kwargs.has_key(u'filenames'): + self.import_source = kwargs[u'filenames'] + else: + raise KeyError(u'Keyword arguments "filename[s]" not supplied.') + log.debug(self.import_source) + self.song = None self.stop_import_flag = False self.set_defaults() QtCore.QObject.connect(Receiver.get_receiver(), @@ -263,7 +271,7 @@ class SongImport(QtCore.QObject): """ if not self.authors: self.authors.append(SongStrings.AuthorUnknownUnT) - log.info(u'commiting song %s to database', self.title) + log.info(u'committing song %s to database', self.title) song = Song() song.title = self.title song.alternate_title = self.alternate_title diff --git a/openlp/plugins/songs/lib/songshowplusimport.py b/openlp/plugins/songs/lib/songshowplusimport.py index c3498b7e6..74040bcc0 100644 --- a/openlp/plugins/songs/lib/songshowplusimport.py +++ b/openlp/plugins/songs/lib/songshowplusimport.py @@ -93,12 +93,7 @@ class SongShowPlusImport(SongImport): ``master_manager`` The song manager for the running OpenLP installation. """ - SongImport.__init__(self, master_manager) - if kwargs.has_key(u'filename'): - self.import_source = kwargs[u'filename'] - if kwargs.has_key(u'filenames'): - self.import_source = kwargs[u'filenames'] - log.debug(self.import_source) + SongImport.__init__(self, master_manager, **kwargs) def do_import(self): """ diff --git a/openlp/plugins/songs/lib/wowimport.py b/openlp/plugins/songs/lib/wowimport.py index c7bd5d743..05c9704f6 100644 --- a/openlp/plugins/songs/lib/wowimport.py +++ b/openlp/plugins/songs/lib/wowimport.py @@ -99,12 +99,7 @@ class WowImport(SongImport): ``master_manager`` The song manager for the running OpenLP installation. """ - SongImport.__init__(self, master_manager) - if kwargs.has_key(u'filename'): - self.import_source = kwargs[u'filename'] - if kwargs.has_key(u'filenames'): - self.import_source = kwargs[u'filenames'] - log.debug(self.import_source) + SongImport.__init__(self, master_manager, **kwargs) def do_import(self): """ From e4876cd84cba4dc6d0b5e36203a8dff6d4d39085 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Fri, 18 Feb 2011 17:38:39 +0000 Subject: [PATCH 058/123] print changes --- openlp/core/lib/ui.py | 2 - openlp/core/ui/printserviceorderdialog.py | 18 +- openlp/core/ui/printserviceorderform.py | 27 +- resources/forms/printserviceorderdialog.ui | 396 +++++++++++---------- 4 files changed, 234 insertions(+), 209 deletions(-) diff --git a/openlp/core/lib/ui.py b/openlp/core/lib/ui.py index 27c510eb2..a98e2fb7f 100644 --- a/openlp/core/lib/ui.py +++ b/openlp/core/lib/ui.py @@ -44,8 +44,6 @@ class UiStrings(object): Advanced = translate('OpenLP.Ui', 'Advanced') AllFiles = translate('OpenLP.Ui', 'All Files') Authors = translate('OpenLP.Ui', 'Authors') - CopyToHtml = translate('OpenLP.Ui', 'Copy to HTML') - CopyToText = translate('OpenLP.Ui', 'Copy to Text') CreateService = translate('OpenLP.Ui', 'Create a new service.') Delete = translate('OpenLP.Ui', '&Delete') Edit = translate('OpenLP.Ui', '&Edit') diff --git a/openlp/core/ui/printserviceorderdialog.py b/openlp/core/ui/printserviceorderdialog.py index c464a7814..c8b47b3e3 100644 --- a/openlp/core/ui/printserviceorderdialog.py +++ b/openlp/core/ui/printserviceorderdialog.py @@ -32,6 +32,8 @@ from openlp.core.lib.ui import UiStrings class Ui_PrintServiceOrderDialog(object): def setupUi(self, printServiceOrderDialog): printServiceOrderDialog.setObjectName(u'printServiceOrderDialog') + self.verticalLayout = QtGui.QGridLayout(printServiceOrderDialog) + self.verticalLayout.setObjectName(u'verticalLayout') self.dialogLayout = QtGui.QGridLayout(printServiceOrderDialog) self.dialogLayout.setObjectName(u'dialogLayout') self.perviewLayout = QtGui.QVBoxLayout() @@ -76,9 +78,6 @@ class Ui_PrintServiceOrderDialog(object): self.printMetaDataCheckBox = QtGui.QCheckBox(printServiceOrderDialog) self.printMetaDataCheckBox.setObjectName(u'printMetaDataCheckBox') self.settingsLayout.addWidget(self.printMetaDataCheckBox) - self.copyMetaDataCheckBox = QtGui.QCheckBox(printServiceOrderDialog) - self.copyMetaDataCheckBox.setObjectName(u'copyMetaDataCheckBox') - self.settingsLayout.addWidget(self.copyMetaDataCheckBox) spacerItem = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) self.settingsLayout.addItem(spacerItem) @@ -94,6 +93,9 @@ class Ui_PrintServiceOrderDialog(object): spacerItem = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) self.buttonLayout.addItem(spacerItem) + self.copyHtmlButton = QtGui.QPushButton(printServiceOrderDialog) + self.copyHtmlButton.setObjectName(u'copyHtmlButton') + self.buttonLayout.addWidget(self.copyHtmlButton) self.copyTextButton = QtGui.QPushButton(printServiceOrderDialog) self.copyTextButton.setObjectName(u'copyTextButton') self.buttonLayout.addWidget(self.copyTextButton) @@ -103,7 +105,7 @@ class Ui_PrintServiceOrderDialog(object): self.cancelButton = QtGui.QPushButton(printServiceOrderDialog) self.cancelButton.setObjectName(u'cancelButton') self.buttonLayout.addWidget(self.cancelButton) - self.dialogLayout.addLayout(self.buttonLayout, 1, 3, 1, 1) + self.dialogLayout.addLayout(self.buttonLayout, 2, 2, 1, 1) self.zoomButtonLayout = QtGui.QHBoxLayout() self.zoomButtonLayout.setObjectName(u'zoomButtonLayout') spacerItem = QtGui.QSpacerItem(40, 20, @@ -134,14 +136,14 @@ class Ui_PrintServiceOrderDialog(object): self.printMetaDataCheckBox.setText( translate('OpenLP.PrintServiceOrderForm', 'Include play length of media items')) - self.copyMetaDataCheckBox.setText( - translate('OpenLP.PrintServiceOrderForm', - 'Copy output as HTML')) self.serviceTitleLabel.setText(translate( 'OpenLP.PrintServiceOrderForm', 'Title:')) self.serviceTitleLineEdit.setText(translate('OpenLP.ServiceManager', 'Service Order Sheet')) - self.copyTextButton.setText(UiStrings.CopyToText) + self.copyTextButton.setText(translate('OpenLP.ServiceManager', + 'Copy to Clipboard as Text')) + self.copyHtmlButton.setText(translate('OpenLP.ServiceManager', + 'Copy to Clipboard as Html')) self.printButton.setText(translate('OpenLP.ServiceManager', 'Print')) self.cancelButton.setText(translate('OpenLP.ServiceManager', 'Cancel')) self.customNotesLabel.setText( diff --git a/openlp/core/ui/printserviceorderform.py b/openlp/core/ui/printserviceorderform.py index cfd0f7a52..48cd606d0 100644 --- a/openlp/core/ui/printserviceorderform.py +++ b/openlp/core/ui/printserviceorderform.py @@ -53,10 +53,6 @@ class PrintServiceOrderForm(QtGui.QDialog, Ui_PrintServiceOrderDialog): u'print file meta data', QtCore.QVariant(False)).toBool()) self.printNotesCheckBox.setChecked(settings.value( u'print notes', QtCore.QVariant(False)).toBool()) - self.copyMetaDataCheckBox.setChecked(settings.value( - u'html copy', QtCore.QVariant(False)).toBool()) - if self.copyMetaDataCheckBox.isChecked(): - self.copyTextButton.setText(UiStrings.CopyToHtml) settings.endGroup() # Signals QtCore.QObject.connect(self.printButton, @@ -82,8 +78,8 @@ class PrintServiceOrderForm(QtGui.QDialog, Ui_PrintServiceOrderDialog): QtCore.SIGNAL(u'clicked()'), self.reject) QtCore.QObject.connect(self.copyTextButton, QtCore.SIGNAL(u'clicked()'), self.copyText) - QtCore.QObject.connect(self.copyMetaDataCheckBox, - QtCore.SIGNAL(u'stateChanged(int)'), self.updateTextFormat) + QtCore.QObject.connect(self.copyHtmlButton, + QtCore.SIGNAL(u'clicked()'), self.copyHtmlText) self.updatePreviewText() def updatePreviewText(self): @@ -150,11 +146,18 @@ class PrintServiceOrderForm(QtGui.QDialog, Ui_PrintServiceOrderDialog): self.document.print_(printer) def copyText(self): - if self.copyMetaDataCheckBox.isChecked(): - self.parent.clipboard.setText(self.document.toHtml()) - else: - self.parent.clipboard.setText(self.document.toPlainText()) - self.accept() + """ + Copies the display text to the clipboard as plain text + """ + self.parent.clipboard.setText(self.document.toPlainText()) + + + def copyHtmlText(self): + """ + Copies the display text to the clipboard as Html + """ + self.parent.clipboard.setText(self.document.toHtml()) + def printServiceOrder(self): """ @@ -200,8 +203,6 @@ class PrintServiceOrderForm(QtGui.QDialog, Ui_PrintServiceOrderDialog): QtCore.QVariant(self.printMetaDataCheckBox.isChecked())) settings.setValue(u'print notes', QtCore.QVariant(self.printNotesCheckBox.isChecked())) - settings.setValue(u'html copy', - QtCore.QVariant(self.copyMetaDataCheckBox.isChecked())) settings.endGroup() # Close the dialog. return QtGui.QDialog.accept(self) diff --git a/resources/forms/printserviceorderdialog.ui b/resources/forms/printserviceorderdialog.ui index 131979b65..f95aff17b 100644 --- a/resources/forms/printserviceorderdialog.ui +++ b/resources/forms/printserviceorderdialog.ui @@ -7,197 +7,221 @@ 0 0 494 - 426 + 434 Dialog - - - - - - - - - - - - 0 - 0 - - - - - - - - - 0 - 0 - - - - Service Title: - - - - - - - - - Include slide text if avaialbe - - - - - - - Include service item notes - - - - - - - Include play lenght of media items - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - <b>Custom Notes:</b> - - - - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Cancel - - - - - - - Print - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - ... - - - - :/general/general_zoom_out.png:/general/general_zoom_out.png - - - - - - - - :/general/general_zoom_in.png:/general/general_zoom_in.png - - - - - - - - - - - - 0 - 0 - - - - Preview: - - - - - - - true - - - - 0 - 0 - - - - - 0 - 0 - - - - - - - - - - + + + + 4 + 4 + 491 + 432 + + + + + + + + + + + + + + 0 + 0 + + + + + + + + + 0 + 0 + + + + Service Title: + + + + + + + + + Include slide text if avaialbe + + + + + + + Include service item notes + + + + + + + Include play lenght of media items + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + <b>Custom Notes:</b> + + + + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + ... + + + + :/general/general_zoom_out.png:/general/general_zoom_out.png + + + + + + + + :/general/general_zoom_in.png:/general/general_zoom_in.png + + + + + + + + + + + + 0 + 0 + + + + Preview: + + + + + + + true + + + + 0 + 0 + + + + + 0 + 0 + + + spacer_3 + + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Cancel + + + + + + + Cancel + + + + + + + Cancel + + + + + + + Print + + + + + + + From 23d57bb5baf90a5a0be1f0fd7e751b3e08222d33 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Fri, 18 Feb 2011 17:45:14 +0000 Subject: [PATCH 059/123] Import fix --- openlp/plugins/songs/lib/oooimport.py | 1 - 1 file changed, 1 deletion(-) diff --git a/openlp/plugins/songs/lib/oooimport.py b/openlp/plugins/songs/lib/oooimport.py index 69852c922..863fec2b8 100644 --- a/openlp/plugins/songs/lib/oooimport.py +++ b/openlp/plugins/songs/lib/oooimport.py @@ -28,7 +28,6 @@ import os from PyQt4 import QtCore -from openlp.core.lib import Receiver from openlp.core.utils import get_uno_command, get_uno_instance from songimport import SongImport From e192ea438b80d7262ce9c991f8f2ffbe37c3bf0c Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Fri, 18 Feb 2011 18:48:06 +0000 Subject: [PATCH 060/123] Cleanup mistakes --- openlp/plugins/songs/forms/songimportform.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/openlp/plugins/songs/forms/songimportform.py b/openlp/plugins/songs/forms/songimportform.py index eef0a7004..d7a575de4 100644 --- a/openlp/plugins/songs/forms/songimportform.py +++ b/openlp/plugins/songs/forms/songimportform.py @@ -466,7 +466,7 @@ class SongImportForm(OpenLPWizard): """ Get OpenLyrics song database files """ - self.getFileName(WizardStrings.OpenTypeFile % WizardStrings.OL, + self.getFiles(WizardStrings.OpenTypeFile % WizardStrings.OL, self.openLyricsFileListWidget) def onOpenLyricsRemoveButtonClicked(self): @@ -479,7 +479,7 @@ class SongImportForm(OpenLPWizard): """ Get OpenSong song database files """ - self.getFileName(WizardStrings.OpenTypeFile % WizardStrings.OS, + self.getFiles(WizardStrings.OpenTypeFile % WizardStrings.OS, self.openSongFileListWidget) def onOpenSongRemoveButtonClicked(self): @@ -492,7 +492,7 @@ class SongImportForm(OpenLPWizard): """ Get Words of Worship song database files """ - self.getFileName(WizardStrings.OpenTypeFile % WizardStrings.WoW, + self.getFiles(WizardStrings.OpenTypeFile % WizardStrings.WoW, self.wordsOfWorshipFileListWidget, u'%s (*.wsg *.wow-song)' % translate('SongsPlugin.ImportWizardForm', 'Words Of Worship Song Files') @@ -508,7 +508,7 @@ class SongImportForm(OpenLPWizard): """ Get CCLI song database files """ - self.getFileName(WizardStrings.OpenTypeFile % WizardStrings.CCLI, + self.getFiles(WizardStrings.OpenTypeFile % WizardStrings.CCLI, self.ccliFileListWidget) def onCCLIRemoveButtonClicked(self): @@ -521,7 +521,7 @@ class SongImportForm(OpenLPWizard): """ Get Songs of Fellowship song database files """ - self.getFileName(WizardStrings.OpenTypeFile % WizardStrings.SoF, + self.getFiles(WizardStrings.OpenTypeFile % WizardStrings.SoF, self.songsOfFellowshipFileListWidget, u'%s (*.rtf)' % translate('SongsPlugin.ImportWizardForm', 'Songs Of Fellowship Song Files') @@ -537,7 +537,7 @@ class SongImportForm(OpenLPWizard): """ Get song database files """ - self.getFileName( + self.getFiles( translate('SongsPlugin.ImportWizardForm', 'Select Document/Presentation Files'), self.genericFileListWidget @@ -564,7 +564,7 @@ class SongImportForm(OpenLPWizard): """ Get SongBeamer song database files """ - self.getFileName(WizardStrings.OpenTypeFile % WizardStrings.SB, + self.getFiles(WizardStrings.OpenTypeFile % WizardStrings.SB, self.songBeamerFileListWidget, u'%s (*.sng)' % translate('SongsPlugin.ImportWizardForm', 'SongBeamer Files') ) From 1f7d6b635d3b245b390ada8ea24ed2567d1ec206 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Fri, 18 Feb 2011 19:13:37 +0000 Subject: [PATCH 061/123] Preview Edit now works --- openlp/plugins/songs/forms/editsongform.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openlp/plugins/songs/forms/editsongform.py b/openlp/plugins/songs/forms/editsongform.py index 77caf012e..c541f5a1e 100644 --- a/openlp/plugins/songs/forms/editsongform.py +++ b/openlp/plugins/songs/forms/editsongform.py @@ -678,8 +678,8 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): A button (QPushButton). """ log.debug(u'onPreview') - if unicode(button.objectName()) == u'previewButton' and \ - self.saveSong(True): + if unicode(button.objectName()) == u'previewButton': + self.saveSong(True) Receiver.send_message(u'songs_preview') def clearCaches(self): From e75c24bdd785d060e35a6e9ddd3121ab239b70ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Armin=20K=C3=B6hler?= Date: Fri, 18 Feb 2011 21:40:07 +0100 Subject: [PATCH 062/123] Changed 18.02.2011 --- openlp/plugins/songs/forms/songimportform.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/openlp/plugins/songs/forms/songimportform.py b/openlp/plugins/songs/forms/songimportform.py index b6c7286bc..361a076da 100644 --- a/openlp/plugins/songs/forms/songimportform.py +++ b/openlp/plugins/songs/forms/songimportform.py @@ -256,7 +256,7 @@ class SongImportForm(OpenLPWizard): self.formatComboBox.setItemText(11, translate('SongsPlugin.ImportWizardForm', 'SongShow Plus')) self.formatComboBox.setItemText(12, - translate('SongsPlugin.ImportWizardForm', 'FoilPresenter')) + translate('SongsPlugin.ImportWizardForm', 'Foilpresenter')) # self.formatComboBox.setItemText(11, # translate('SongsPlugin.ImportWizardForm', 'CSV')) self.openLP2FilenameLabel.setText( @@ -711,7 +711,9 @@ class SongImportForm(OpenLPWizard): self.getFiles( translate('SongsPlugin.ImportWizardForm', 'Select FoilPresenter Files'), - self.foilPresenterFileListWidget + self.foilPresenterFileListWidget, u'%s (*.foil)' + % translate('SongsPlugin.ImportWizardForm', + 'Foilpresenter Song Files') ) def onFoilPresenterRemoveButtonClicked(self): From 31b217571cd683d5f4b9d3a769f2929ae0f1c814 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sat, 19 Feb 2011 08:36:24 +0000 Subject: [PATCH 063/123] Print Dialog updates --- openlp/core/ui/printserviceorderdialog.py | 237 +++++++++++---------- openlp/core/ui/printserviceorderform.py | 90 ++++---- resources/images/general_print.png | Bin 0 -> 880 bytes resources/images/general_zoom_in.png | Bin 716 -> 1191 bytes resources/images/general_zoom_original.png | Bin 0 -> 1182 bytes resources/images/general_zoom_out.png | Bin 662 -> 1173 bytes resources/images/openlp-2.qrc | 4 + resources/images/system_configure.png | Bin 0 -> 1101 bytes resources/images/system_edit_copy.png | Bin 0 -> 515 bytes 9 files changed, 178 insertions(+), 153 deletions(-) create mode 100644 resources/images/general_print.png create mode 100644 resources/images/general_zoom_original.png create mode 100644 resources/images/system_configure.png create mode 100644 resources/images/system_edit_copy.png diff --git a/openlp/core/ui/printserviceorderdialog.py b/openlp/core/ui/printserviceorderdialog.py index c8b47b3e3..ea3df1dba 100644 --- a/openlp/core/ui/printserviceorderdialog.py +++ b/openlp/core/ui/printserviceorderdialog.py @@ -30,121 +30,136 @@ from openlp.core.lib import build_icon, translate, SpellTextEdit from openlp.core.lib.ui import UiStrings class Ui_PrintServiceOrderDialog(object): - def setupUi(self, printServiceOrderDialog): - printServiceOrderDialog.setObjectName(u'printServiceOrderDialog') - self.verticalLayout = QtGui.QGridLayout(printServiceOrderDialog) - self.verticalLayout.setObjectName(u'verticalLayout') - self.dialogLayout = QtGui.QGridLayout(printServiceOrderDialog) - self.dialogLayout.setObjectName(u'dialogLayout') - self.perviewLayout = QtGui.QVBoxLayout() - self.perviewLayout.setObjectName(u'perviewLayout') - self.previewLabel = QtGui.QLabel(printServiceOrderDialog) - self.previewLabel.setSizePolicy( - QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Preferred) - self.previewLabel.setObjectName(u'previewLabel') - self.perviewLayout.addWidget(self.previewLabel) - self.previewWidget = QtGui.QPrintPreviewWidget( - self.printer, self, QtCore.Qt.Widget) - self.previewWidget.setEnabled(True) - self.previewWidget.setSizePolicy( - QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Expanding) - self.previewWidget.setObjectName(u'previewWidget') - # Give the previewWidget a fixed size, to prevent resizing when clicking - # the zoom buttons. - self.previewWidget.setFixedWidth(350) - self.perviewLayout.addWidget(self.previewWidget) - self.dialogLayout.addLayout(self.perviewLayout, 0, 0, 1, 1) - self.settingsLayout = QtGui.QVBoxLayout() - self.settingsLayout.setObjectName(u'settingsLayout') - self.serviceTitleLayout = QtGui.QGridLayout() - self.serviceTitleLayout.setObjectName(u'serviceTitleLayout') - self.serviceTitleLineEdit = QtGui.QLineEdit(printServiceOrderDialog) - self.serviceTitleLineEdit.setSizePolicy( - QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Preferred) - self.serviceTitleLineEdit.setObjectName(u'serviceTitleLineEdit') - self.serviceTitleLayout.addWidget(self.serviceTitleLineEdit, 1, 1, 1, 1) - self.serviceTitleLabel = QtGui.QLabel(printServiceOrderDialog) - self.serviceTitleLabel.setSizePolicy( - QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Preferred) - self.serviceTitleLabel.setObjectName(u'serviceTitleLabel') - self.serviceTitleLayout.addWidget(self.serviceTitleLabel, 1, 0, 1, 1) - self.settingsLayout.addLayout(self.serviceTitleLayout) - self.printSlideTextCheckBox = QtGui.QCheckBox(printServiceOrderDialog) - self.printSlideTextCheckBox.setObjectName(u'printSlideTextCheckBox') - self.settingsLayout.addWidget(self.printSlideTextCheckBox) - self.printNotesCheckBox = QtGui.QCheckBox(printServiceOrderDialog) - self.printNotesCheckBox.setObjectName(u'printNotesCheckBox') - self.settingsLayout.addWidget(self.printNotesCheckBox) - self.printMetaDataCheckBox = QtGui.QCheckBox(printServiceOrderDialog) - self.printMetaDataCheckBox.setObjectName(u'printMetaDataCheckBox') - self.settingsLayout.addWidget(self.printMetaDataCheckBox) - spacerItem = QtGui.QSpacerItem(20, 40, - QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) - self.settingsLayout.addItem(spacerItem) - self.customNotesLabel = QtGui.QLabel(self) - self.customNotesLabel.setObjectName(u'customNotesLabel') - self.settingsLayout.addWidget(self.customNotesLabel) - self.customNoteEdit = SpellTextEdit(self) - self.customNoteEdit.setObjectName(u'customNoteEdit') - self.settingsLayout.addWidget(self.customNoteEdit) - self.dialogLayout.addLayout(self.settingsLayout, 0, 3, 1, 1) - self.buttonLayout = QtGui.QHBoxLayout() - self.buttonLayout.setObjectName(u'buttonLayout') - spacerItem = QtGui.QSpacerItem(40, 20, - QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) - self.buttonLayout.addItem(spacerItem) - self.copyHtmlButton = QtGui.QPushButton(printServiceOrderDialog) - self.copyHtmlButton.setObjectName(u'copyHtmlButton') - self.buttonLayout.addWidget(self.copyHtmlButton) - self.copyTextButton = QtGui.QPushButton(printServiceOrderDialog) - self.copyTextButton.setObjectName(u'copyTextButton') - self.buttonLayout.addWidget(self.copyTextButton) - self.printButton = QtGui.QPushButton(printServiceOrderDialog) - self.printButton.setObjectName(u'printButton') - self.buttonLayout.addWidget(self.printButton) - self.cancelButton = QtGui.QPushButton(printServiceOrderDialog) - self.cancelButton.setObjectName(u'cancelButton') - self.buttonLayout.addWidget(self.cancelButton) - self.dialogLayout.addLayout(self.buttonLayout, 2, 2, 1, 1) - self.zoomButtonLayout = QtGui.QHBoxLayout() - self.zoomButtonLayout.setObjectName(u'zoomButtonLayout') - spacerItem = QtGui.QSpacerItem(40, 20, - QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) - self.zoomButtonLayout.addItem(spacerItem) - self.zoomOutButton = QtGui.QToolButton(printServiceOrderDialog) - self.zoomOutButton.setIcon( - build_icon(u':/general/general_zoom_out.png')) - self.zoomOutButton.setObjectName(u'zoomOutButton') - self.zoomButtonLayout.addWidget(self.zoomOutButton) - self.zoomInButton = QtGui.QToolButton(printServiceOrderDialog) - self.zoomInButton.setIcon(build_icon(u':/general/general_zoom_in.png')) + def setupUi(self, printServiceDialog): + printServiceDialog.setObjectName(u'printServiceDialog') + printServiceDialog.resize(664, 594) + self.mainLayout = QtGui.QVBoxLayout(printServiceDialog) + self.mainLayout.setSpacing(0) + self.mainLayout.setMargin(0) + self.mainLayout.setObjectName(u'mainLayout') + self.toolbar = QtGui.QToolBar(printServiceDialog) + self.toolbar.setIconSize(QtCore.QSize(22, 22)) + self.toolbar.setToolButtonStyle(QtCore.Qt.ToolButtonTextBesideIcon) + self.toolbar.addAction( + QtGui.QIcon(build_icon(u':/general/general_print.png')), 'Print') + self.optionsButton = QtGui.QToolButton(self.toolbar) + self.optionsButton.setText(u'Options') + self.optionsButton.setToolButtonStyle(QtCore.Qt.ToolButtonTextBesideIcon) + self.optionsButton.setIcon(QtGui.QIcon( + build_icon(u':/system/system_configure.png'))) + self.optionsButton.setCheckable(True) + self.toolbar.addWidget(self.optionsButton) + self.toolbar.addAction( + QtGui.QIcon(build_icon(u':/system/system_close.png')), + 'Close') + self.toolbar.addSeparator() + self.toolbar.addAction( + QtGui.QIcon(build_icon(u':/system/system_edit_copy.png')), + 'Copy') + self.toolbar.addAction( + QtGui.QIcon(build_icon(u':/system/system_edit_copy.png')), + 'Copy as HTML') + self.toolbar.addSeparator() + self.zoomInButton = QtGui.QToolButton(self.toolbar) + self.zoomInButton.setIcon(QtGui.QIcon( + build_icon(u':/general/general_zoom_in.png'))) + self.zoomInButton.setToolTip(u'Zoom In') self.zoomInButton.setObjectName(u'zoomInButton') - self.zoomButtonLayout.addWidget(self.zoomInButton) - self.dialogLayout.addLayout(self.zoomButtonLayout, 1, 0, 1, 1) - self.retranslateUi(printServiceOrderDialog) - QtCore.QMetaObject.connectSlotsByName(printServiceOrderDialog) + self.zoomInButton.setIconSize(QtCore.QSize(22, 22)) + self.toolbar.addWidget(self.zoomInButton) + self.zoomOutButton = QtGui.QToolButton(self.toolbar) + self.zoomOutButton.setIcon(QtGui.QIcon( + build_icon(u':/general/general_zoom_out.png'))) + self.zoomOutButton.setToolTip(u'Zoom Out') + self.zoomOutButton.setObjectName(u'zoomOutButton') + self.zoomOutButton.setIconSize(QtCore.QSize(22, 22)) + self.toolbar.addWidget(self.zoomOutButton) + self.zoomOriginalButton = QtGui.QToolButton(self.toolbar) + self.zoomOriginalButton.setIcon(QtGui.QIcon( + build_icon(u':/general/general_zoom_original.png'))) + self.zoomOriginalButton.setToolTip(u'Zoom Original') + self.zoomOriginalButton.setObjectName(u'zoomOriginalButton') + self.zoomOriginalButton.setIconSize(QtCore.QSize(22, 22)) + self.toolbar.addWidget(self.zoomOriginalButton) + self.zoomComboBox = QtGui.QComboBox(printServiceDialog) + self.zoomComboBox.setObjectName((u'zoomComboBox')) + self.zoomComboBox.addItem(u'Fit Page') + self.zoomComboBox.addItem(u'Fit Width') + self.zoomComboBox.addItem(u'100%') + self.zoomComboBox.addItem(u'75%') + self.zoomComboBox.addItem(u'50%') + self.zoomComboBox.addItem(u'25%') + self.toolbar.addWidget(self.zoomComboBox) + self.mainLayout.addWidget(self.toolbar) + self.scrollArea = QtGui.QScrollArea(printServiceDialog) + self.scrollArea.setWidgetResizable(True) + self.scrollArea.setObjectName(u'scrollArea') + self.scrollAreaWidgetContents = QtGui.QWidget() + self.scrollAreaWidgetContents.setGeometry(QtCore.QRect(0, 0, 227, 473)) + self.scrollAreaWidgetContents.setObjectName(u'scrollAreaWidgetContents') + self.scrollArea.setWidget(self.scrollAreaWidgetContents) + self.mainLayout.addWidget(self.scrollArea) + self.optionsWidget = QtGui.QWidget(printServiceDialog) + self.optionsWidget.hide() + self.optionsWidget.resize(400, 300) + self.optionsWidget.setAutoFillBackground(True) + self.optionsLayout = QtGui.QVBoxLayout(self.optionsWidget) + self.optionsLayout.setContentsMargins(8, 8, 8, 8) + self.titleLabel = QtGui.QLabel(self.optionsWidget) + self.titleLabel.setObjectName((u'titleLabel')) + self.titleLabel.setText(u'Title:') + self.optionsLayout.addWidget(self.titleLabel) + self.titleLineEdit = QtGui.QLineEdit(self.optionsWidget) + self.titleLineEdit.setObjectName(u'titleLineEdit') + self.optionsLayout.addWidget(self.titleLineEdit) + self.footerLabel = QtGui.QLabel(self.optionsWidget) + self.footerLabel.setObjectName(u'footerLabel') + self.footerLabel.setText(u'Custom Footer Text:') + self.optionsLayout.addWidget(self.footerLabel) + self.footerTextEdit = QtGui.QTextEdit(self.optionsWidget) + self.footerTextEdit.setObjectName(u'footerTextEdit') + self.optionsLayout.addWidget(self.footerTextEdit) + self.optionsGroupBox = QtGui.QGroupBox(u'Other Options') + self.groupLayout = QtGui.QVBoxLayout() + self.slideTextCheckBox = QtGui.QCheckBox() + self.groupLayout.addWidget(self.slideTextCheckBox) + self.notesCheckBox = QtGui.QCheckBox('Include service item notes') + self.groupLayout.addWidget(self.notesCheckBox) + self.metaDataCheckBox = QtGui.QCheckBox() + self.groupLayout.addWidget(self.metaDataCheckBox) + self.groupLayout.addStretch(1) + self.optionsGroupBox.setLayout(self.groupLayout) + self.optionsLayout.addWidget(self.optionsGroupBox) - def retranslateUi(self, printServiceOrderDialog): - printServiceOrderDialog.setWindowTitle( + self.retranslateUi(printServiceDialog) + QtCore.QMetaObject.connectSlotsByName(printServiceDialog) + QtCore.QObject.connect(self.optionsButton, + QtCore.SIGNAL(u'toggled(bool)'), self.toggleOptions) + + self.retranslateUi(printServiceDialog) + QtCore.QMetaObject.connectSlotsByName(printServiceDialog) + + def retranslateUi(self, printServiceDialog): + printServiceDialog.setWindowTitle( translate('OpenLP.PrintServiceOrderForm', 'Print Service Order')) - self.previewLabel.setText( - translate('OpenLP.PrintServiceOrderForm', 'Preview:')) - self.printSlideTextCheckBox.setText(translate( +# self.previewLabel.setText( +# translate('OpenLP.PrintServiceOrderForm', 'Preview:')) + self.slideTextCheckBox.setText(translate( 'OpenLP.PrintServiceOrderForm', 'Include slide text if available')) - self.printNotesCheckBox.setText(translate( + self.notesCheckBox.setText(translate( 'OpenLP.PrintServiceOrderForm', 'Include service item notes')) - self.printMetaDataCheckBox.setText( + self.metaDataCheckBox.setText( translate('OpenLP.PrintServiceOrderForm', 'Include play length of media items')) - self.serviceTitleLabel.setText(translate( - 'OpenLP.PrintServiceOrderForm', 'Title:')) - self.serviceTitleLineEdit.setText(translate('OpenLP.ServiceManager', - 'Service Order Sheet')) - self.copyTextButton.setText(translate('OpenLP.ServiceManager', - 'Copy to Clipboard as Text')) - self.copyHtmlButton.setText(translate('OpenLP.ServiceManager', - 'Copy to Clipboard as Html')) - self.printButton.setText(translate('OpenLP.ServiceManager', 'Print')) - self.cancelButton.setText(translate('OpenLP.ServiceManager', 'Cancel')) - self.customNotesLabel.setText( - translate('OpenLP.ServiceManager', 'Custom Service Notes:')) +# self.serviceTitleLabel.setText(translate( +# 'OpenLP.PrintServiceOrderForm', 'Title:')) +# self.serviceTitleLineEdit.setText(translate('OpenLP.ServiceManager', +# 'Service Order Sheet')) +# self.copyTextButton.setText(translate('OpenLP.ServiceManager', +# 'Copy to Clipboard as Text')) +# self.copyHtmlButton.setText(translate('OpenLP.ServiceManager', +# 'Copy to Clipboard as Html')) +# self.printButton.setText(translate('OpenLP.ServiceManager', 'Print')) +# self.cancelButton.setText(translate('OpenLP.ServiceManager', 'Cancel')) +# self.customNotesLabel.setText( +# translate('OpenLP.ServiceManager', 'Custom Service Notes:')) diff --git a/openlp/core/ui/printserviceorderform.py b/openlp/core/ui/printserviceorderform.py index 48cd606d0..2bce1e837 100644 --- a/openlp/core/ui/printserviceorderform.py +++ b/openlp/core/ui/printserviceorderform.py @@ -47,40 +47,50 @@ class PrintServiceOrderForm(QtGui.QDialog, Ui_PrintServiceOrderDialog): # Load the settings for the dialog. settings = QtCore.QSettings() settings.beginGroup(u'advanced') - self.printSlideTextCheckBox.setChecked(settings.value( + self.slideTextCheckBox.setChecked(settings.value( u'print slide text', QtCore.QVariant(False)).toBool()) - self.printMetaDataCheckBox.setChecked(settings.value( + self.metaDataCheckBox.setChecked(settings.value( u'print file meta data', QtCore.QVariant(False)).toBool()) - self.printNotesCheckBox.setChecked(settings.value( + self.notesCheckBox.setChecked(settings.value( u'print notes', QtCore.QVariant(False)).toBool()) settings.endGroup() # Signals - QtCore.QObject.connect(self.printButton, - QtCore.SIGNAL(u'clicked()'), self.printServiceOrder) - QtCore.QObject.connect(self.zoomOutButton, - QtCore.SIGNAL(u'clicked()'), self.zoomOut) - QtCore.QObject.connect(self.zoomInButton, - QtCore.SIGNAL(u'clicked()'), self.zoomIn) - QtCore.QObject.connect(self.previewWidget, - QtCore.SIGNAL(u'paintRequested(QPrinter *)'), self.paintRequested) - QtCore.QObject.connect(self.serviceTitleLineEdit, - QtCore.SIGNAL(u'textChanged(const QString)'), - self.updatePreviewText) - QtCore.QObject.connect(self.printSlideTextCheckBox, - QtCore.SIGNAL(u'stateChanged(int)'), self.updatePreviewText) - QtCore.QObject.connect(self.printNotesCheckBox, - QtCore.SIGNAL(u'stateChanged(int)'), self.updatePreviewText) - QtCore.QObject.connect(self.printMetaDataCheckBox, - QtCore.SIGNAL(u'stateChanged(int)'), self.updatePreviewText) - QtCore.QObject.connect(self.customNoteEdit, - QtCore.SIGNAL(u'textChanged()'), self.updatePreviewText) - QtCore.QObject.connect(self.cancelButton, - QtCore.SIGNAL(u'clicked()'), self.reject) - QtCore.QObject.connect(self.copyTextButton, - QtCore.SIGNAL(u'clicked()'), self.copyText) - QtCore.QObject.connect(self.copyHtmlButton, - QtCore.SIGNAL(u'clicked()'), self.copyHtmlText) - self.updatePreviewText() +# QtCore.QObject.connect(self.printButton, +# QtCore.SIGNAL(u'clicked()'), self.printServiceOrder) +# QtCore.QObject.connect(self.zoomOutButton, +# QtCore.SIGNAL(u'clicked()'), self.zoomOut) +# QtCore.QObject.connect(self.zoomInButton, +# QtCore.SIGNAL(u'clicked()'), self.zoomIn) +# QtCore.QObject.connect(self.previewWidget, +# QtCore.SIGNAL(u'paintRequested(QPrinter *)'), self.paintRequested) +# QtCore.QObject.connect(self.serviceTitleLineEdit, +# QtCore.SIGNAL(u'textChanged(const QString)'), +# self.updatePreviewText) +# QtCore.QObject.connect(self.slideTextCheckBox, +# QtCore.SIGNAL(u'stateChanged(int)'), self.updatePreviewText) +# QtCore.QObject.connect(self.notesCheckBox, +# QtCore.SIGNAL(u'stateChanged(int)'), self.updatePreviewText) +# QtCore.QObject.connect(self.metaDataCheckBox, +# QtCore.SIGNAL(u'stateChanged(int)'), self.updatePreviewText) +# QtCore.QObject.connect(self.customNoteEdit, +# QtCore.SIGNAL(u'textChanged()'), self.updatePreviewText) +# QtCore.QObject.connect(self.cancelButton, +# QtCore.SIGNAL(u'clicked()'), self.reject) +# QtCore.QObject.connect(self.copyTextButton, +# QtCore.SIGNAL(u'clicked()'), self.copyText) +# QtCore.QObject.connect(self.copyHtmlButton, +# QtCore.SIGNAL(u'clicked()'), self.copyHtmlText) +# self.updatePreviewText() + + def toggleOptions(self, checked): + self.optionsWidget.setVisible(checked) + if checked: + left = self.optionsButton.pos().x() + top = self.toolbar.height() + self.optionsWidget.move(left, top) + self.titleLineEdit.setFocus() + else: + self.saveOptions() def updatePreviewText(self): """ @@ -95,7 +105,7 @@ class PrintServiceOrderForm(QtGui.QDialog, Ui_PrintServiceOrderDialog): text += u'

      %s

      ' % (item.icon, item.get_display_title()) # Add slide text of the service item. - if self.printSlideTextCheckBox.isChecked(): + if self.slideTextCheckBox.isChecked(): if item.is_text(): # Add the text of the service item. verse = None @@ -120,13 +130,13 @@ class PrintServiceOrderForm(QtGui.QDialog, Ui_PrintServiceOrderDialog): # add footer text += u'

      %s

      ' % item.foot_text # Add service items' notes. - if self.printNotesCheckBox.isChecked(): + if self.notesCheckBox.isChecked(): if item.notes: text += u'

      %s

      %s' % (translate( 'OpenLP.ServiceManager', 'Notes:'), item.notes.replace(u'\n', u'
      ')) # Add play length of media files. - if item.is_media() and self.printMetaDataCheckBox.isChecked(): + if item.is_media() and self.metaDataCheckBox.isChecked(): text += u'

      %s %s

      ' % (translate( 'OpenLP.ServiceManager', u'Playing time:'), unicode(datetime.timedelta(seconds=item.media_length))) @@ -167,7 +177,6 @@ class PrintServiceOrderForm(QtGui.QDialog, Ui_PrintServiceOrderDialog): return # Print the document. self.document.print_(self.printer) - self.accept() def zoomIn(self): """ @@ -190,7 +199,7 @@ class PrintServiceOrderForm(QtGui.QDialog, Ui_PrintServiceOrderDialog): else: self.copyTextButton.setText(UiStrings.CopyToText) - def accept(self): + def saveOptions(self): """ Save the settings and close the dialog. """ @@ -198,17 +207,14 @@ class PrintServiceOrderForm(QtGui.QDialog, Ui_PrintServiceOrderDialog): settings = QtCore.QSettings() settings.beginGroup(u'advanced') settings.setValue(u'print slide text', - QtCore.QVariant(self.printSlideTextCheckBox.isChecked())) + QtCore.QVariant(self.slideTextCheckBox.isChecked())) settings.setValue(u'print file meta data', - QtCore.QVariant(self.printMetaDataCheckBox.isChecked())) + QtCore.QVariant(self.metaDataCheckBox.isChecked())) settings.setValue(u'print notes', - QtCore.QVariant(self.printNotesCheckBox.isChecked())) + QtCore.QVariant(self.notesCheckBox.isChecked())) settings.endGroup() + + def close(self): # Close the dialog. return QtGui.QDialog.accept(self) - def reject(self): - """ - Close the dialog, do not print the service and do not save the settings. - """ - return QtGui.QDialog.reject(self) diff --git a/resources/images/general_print.png b/resources/images/general_print.png new file mode 100644 index 0000000000000000000000000000000000000000..8eb1c6741b62ad70bdaf4fd75d2a535d93d6d03d GIT binary patch literal 880 zcmV-$1CRWPP)-)OT5&Bd)01nK7JB8bqz-B}zf9U63KHEki(1pi_*xiLTH^n0(~c)j8uv@d*IIQhv03tcxPJZvice5)F3M!lMp}vot>R17K_;3-9@2r z#EQfUKYTvR4hNV!Ij@+xoYULeYcDDbo~8&+c|4w0wWU%Cp->1jGas0E<*ZYLGi*sN z?L$XL2P>yV?9-T$8haHVdio5u_V)JB-`|giC>o8Tr>6(Dwlm-3MzF0-w(5f|ZcF^a zLo_utg}%N%*b*k2?Q??Zk@#DHEjBG24m+)&uiUb8&J_lk+SbP0o*Ffs8SD=RC==kqO})9D|Z#^GVX8l-sOBasLn7Ib$%mdjx^mgkhg z_rmtF)sNB9q_tQsm$NPtMW*{7L@J$80|SF)1t&h;b!2t*jg&qm?I@oPRS67$DId}dwiC$+izl!n*DbuVd@mGLZP?+=%wwwy}kcD4|^~n6wUOLd|yuP z_nTkNJ>PS{{{;g6hF-5nMn=ADEw8BPqe!X=K@q&b7uM2D`iECv8MwtTjQp>Ihlhu& z+uI$V$CBBzQ}@D1n9j$q2wNprH&&tc4W(f%-_}-28^jkRHUfomi42 zTCc+l8CgNheaEL9M$LB>6jm7j!g~ei2=Mwx@4uZCWIVx&n$$|N!l0!nRADmEmnpi( z>2&(17Bi(`H)2MS7ctlX2}6-W#1{nN#ULOtlm`e9C0PMtE>AgYsH#{jb{BecMS~|M zCPqpLhH+^5HZGdhv%E<1iUORj%5OS7maim4k@KR0b7@XnM#oy)P4a=6ncqHvUa9Cg zW*{1kmhSZ&9YC|l!R3sS6tpV7*4g;bWN%)jSxHCJ8KY^7KJiiw-({{c;PANRSeE@U z7!1nA3IhCo-y*Ew=4pHF^Ihe-cD=_JEd_Ld&ojbR`HI`DiUQ9LB$=jC0JYBD>FA|UDXMX zev8F&dvbDevqw|l_laxILGjy^0Byg$)sGz&X$ z&1$u}w^J!I$8i+grvC2k?npM9oyWiv5Rb<>nx?O{KwuM_U~w>;&DINFq5uY-kVGO; z2!%qUcDubstJSu8z1}|pfxsp3Utuztu=gMykH-ige*p#7_HGjoqu~Gm002ovPDHLk FV1mKNG^+pr literal 716 zcmV;-0yF)IP)Ng=!FrWDrcisge!>7saN{P=~6mrfK`jpT_3T{q8vx zw5HJFgEze8!}mQNhlub$W%zSQr_&BW5bh&l1QGoJP)5XpuIn?2M55Xc;0_aHv)OB! zrey>{d}FfM-&ti(rCHnY)^@fcOzYhMfLJsdUFr+u^LYm$WM$Cmnmnrp)&;_e@}S|$ zZcAJ3G3@SrEBjis@=(|Hk%@_kzmo6(0E(hKaJW40O>Tdq(?zFQBH^2lKRz)_B;4tu z)8q;??TRZW%kuQm1UvwMD2icbw0~j|B>5X{_%N zDW!n{?>U=nBA4QGpJUbm9!(PI-F?1#z1e2mquawTs|UudE~UZafU?2fP&Vtv&eJ=? zZ!Jcm+{>(u&crSk8wYIXN3GZ4+Kuy+(sJJwD5VA5uljXF^?R+S@3u77Y%_lEm&R|_ zdt8_44s2~-q?8u=0+mW-=0kD$g3Q%DA_uI000qB)Ha*V9f?FXa=9GF~}r@0000;TV)u>-}ij=!1Jmawsr2{K2SAHZazfV327*FsC%b9(6MIp_6UaABO*Y4Df) z^X9$zz0aHHdBFb#1b?EtyIXI!mp0I}`XE7)Whm^cSSK?LhK?tPeoGs#_9(@CviVKFFW z96oaRI7kCVQKWr?g}8EO=1NSd@P`!&FDxt=t$DNgn-~K?T$aZG=H_VSYJ?<%n*1E! zdIC=>D9WBrOaK6B0C7ZRXyUkvN)ogpL1pHy`6UebBTA48hQKBQK|)CoBrWUo8V2J@ zK}MOjVtI5tMlB(UJWoLkAcDjMH33sJ36n`G7jOvy&;*vEa7=&{E=q!kW$8%;%d)<- z;@;lgF$%EkGa78C$fYPGAxJ({gkvbA-YXU~2(Xw0uDyt+mYBb()yyzGpqUV(F)0wRKOUK@7%t;eW%V-dY!GU)WH z!^5|acXoD8rd<$ui`bc&nH%<^oC7Dya_cMrSYbjmu@P>Up4%+8r{YIm)-tvJ2P3>| z{GQ5I{G7JDyu7)jq~!j<2uflpTaB$Av>IWak$9Ptl7Lkz>*G#ZU~f@Pl%hr?KP z^`W}5vQm8@5V*atupp%or(sJjA9v)YGZaM~^?JNm#eoWERb{1(=lSbXQ&R#C{v)AK z2ux2;|6sLRm(6DLG572&{;bWmSC&_+)#`o-wt=>`wiEJ{^du4qwZq{6k|f=QV4IMe wS?hE$)NDWn- z27;nU@0I{@dVh9QG|{V}Z*H~0i~|so3_yGgpshuKq)nhDw?O&D55KS+bVoMCxneg( zdDDq803Zt>u2WXa4#to&w}XI)7>H;mgft5^f`W1iL7o!;$(oXs-NIu8sT$B}CpN0H z;3*|Ew5U)T1nA_Yb00a)glHu(*@StJs-J+Os#BXXqL()WMpF^C&rX_lB0?nX#J#<} zLlh8%=PlTNB&8?;X{i(h5>7zgWP%(;!5s|;ViEvFQ&hslak+)rI5s>oGMH8@%gNQ5 z*_oaupUEwSm-D4h9>s$Zt=pn?5l< z{-`ck@oL>6cjeTQB=I!OA&SsM6%ZRqjfruxO`M5&npvTx#F@+9>`;}buQW+Z8ZGa?y5e|wqE^ZZ?h!-0!}@M0p7z-nvj8vTBsJr;}o zFgrV|r4grRS8g2lSeE4}iaNfyu!vP1sS4IqR~IXaa&v5KOvS-}Bp#20@$vDW3knLB zT`t$_;i)P7aB*>|A+Kc^rXPYmpuN5Qw9%3tQ52a#AOJK?`w4A)+M!H6p5T&Nou2ls*m+1{3V;?A$gCqhPTp zuWeUcZyoNLdZ*c#Z8nZ0rqRCxAQ6wpcgF(da@i|M(!sRDfB&i$J{)cO^`#a%Vf9Cx z^R-wk_SYmb0C+r}hq9u+gLAQcc22%gz~&EkrX-ZeJYNTp{s&ML5}u?#gq$ryid( zwmb=_$*#8NTT4BAa&P4g06_!@0Ej@}oBcE4v^~!lt4#tbp00kKtKQbvX1_-S4uE74 z3K1XxUghLxfH77X1w;U-*XtYa_xBduLTg455F(CiL zkjZ3p##rLjvuz*g2bQ4P^=Ni;ZeHyMr`Si=i>F&5P1B||O)E)~6c`4C;a5(l(_X_c z)&blCuneFEpi-??w>jsfY&NSEi^b3ReEx=Mnm_)WiRePgeneral_new.png general_zoom_out.png general_zoom_in.png + general_zoom_original.png + general_print.png general_open.png general_save.png general_email.png @@ -114,6 +116,8 @@ system_exit.png settings_plugin_list.png system_settings.png + system_configure.png + system_edit_copy.png system_configure_shortcuts.png diff --git a/resources/images/system_configure.png b/resources/images/system_configure.png new file mode 100644 index 0000000000000000000000000000000000000000..45b8fae8b8666fbf77bb3f906a6ea7b1ddb620f9 GIT binary patch literal 1101 zcmV-T1hV^yP)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L02{9W02{9XUK)`c00007bV*G`2iXAx z12Qe)4)6T{00YfQL_t(|+MSbYOp|96$IsjLZ7HMDl|)KuRd9<5th6H|V}`kQqcbDR zT*5G0HZLI{F58gxqBdEC#2ZoEvH_ctm{K$`CIp)Z*aA^hKFon8SQ#1}pk&sr7wAft zweRKG!Gy#QGqyd+KY4P_Kfm|9=R6MusRw1XTJ$E9sWCG%vz+5OaWwk(gHR}V-r;bb zy*hd=0qH=Sn-A3bp7;_R$C5}SLT2Y?$<136r0+s6Z?S#bjvi6U)ORb5>o2(n{|N*G zB>r!lEX9^cYwJ<2tn7{ZG)@12mN!vCNR=*oDQio1woJ-#958GGD2jqXxBJZa_=FwH z0TjF96{Nrw%3qehH8V2@gb-jD23Y)nN~xU2+LIM%I$&v0QBm3S^zXp342lJoVPV_$ zZIx@+t)-tenypRQ!eps$Z>o5$s;bHs42CFah7?pP72pCPBU4(44 zyW!Bn!s6j%JEjZMs=e-;Nu0*UL7&V{qK@ z-l_I@JdmTv!8xu0WuB7n?ELw+_V)IR*x60A&Z2^-B@}}q@Vu~C&969n9Fto<{)lMS zXoya)BSxc<3=R(Pdz$w2qNNZeeBolAJ=^wLHWw5YoOO2hSQL0s(HGV>!^ht^=00000NkvXXu0mjfA3OQ4 literal 0 HcmV?d00001 diff --git a/resources/images/system_edit_copy.png b/resources/images/system_edit_copy.png new file mode 100644 index 0000000000000000000000000000000000000000..d34cdcd32f09d66b88ae0133c6379e7d7be5afcc GIT binary patch literal 515 zcmeAS@N?(olHy`uVBq!ia0vp^Vj#@H3?x5i&EW)6%*9TgAsieWw;%dH0CG7CJR*yM zqGce=SbMeU3{X(A#5JNMI6tkVJh3R1p}f3YFEcN@I61K(RWH9NefB#WDWIas0X`wF z|Ns97G9iG4g;`KgP)tlrRaFHdqNb*%p`ig}3kwVH+__`Vp52EIA3Ad6@X=#O)~#E& ze*O9l8#Zj*xN*~_O_wfRx_tTa_3PJf+_-V~-o2;Ko;`p5{N>A+@87@w^5x6duV23b z!FMqD0R}(8;1>w|{{8#UpFe;9{{8pwAJ9GFA|gP~FbJ0f`2{lwOQ@(D7@GU|rlvMe z{`B?duis_ima0JM!=5gVAr-e``y4khDe|~jujPKuwCn4?@J)AW?(W(o;_7L4S=385 zqQz#GIM23&->X;{)@;1FpK}(Y*?Z?kgH^LP7PB$2sic*7CH4JJm{z?lZFS~1?)9h2 z9=?}&a!J2a|L-BUpEp;Z)L-NBz4)VWuVU!cUXv%=pUf0XxU}biMMqYQ#@w7GcePvF z1GY>Rllx_Ecdm@{!?#yIDp@iX?wEe#=*lg9f7yJR4D!XESD&4D`2E$N;qxRaPQ1MS iDMVM4h`MnzV%zfAl3T#hTKbLh*2~7ZZD)ig{ literal 0 HcmV?d00001 From b5e369ba4dbdad7d98850bca2f98f46c8c0bcd48 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sat, 19 Feb 2011 17:33:24 +0000 Subject: [PATCH 065/123] More Print Work --- ...ceorderdialog.py => printservicedialog.py} | 72 ++++++++++--------- ...erviceorderform.py => printserviceform.py} | 72 +++++++++++++------ openlp/core/ui/servicemanager.py | 4 +- 3 files changed, 90 insertions(+), 58 deletions(-) rename openlp/core/ui/{printserviceorderdialog.py => printservicedialog.py} (81%) rename openlp/core/ui/{printserviceorderform.py => printserviceform.py} (79%) diff --git a/openlp/core/ui/printserviceorderdialog.py b/openlp/core/ui/printservicedialog.py similarity index 81% rename from openlp/core/ui/printserviceorderdialog.py rename to openlp/core/ui/printservicedialog.py index ea3df1dba..8eb1c3d45 100644 --- a/openlp/core/ui/printserviceorderdialog.py +++ b/openlp/core/ui/printservicedialog.py @@ -29,7 +29,23 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import build_icon, translate, SpellTextEdit from openlp.core.lib.ui import UiStrings -class Ui_PrintServiceOrderDialog(object): +class ZoomSize(): + """ + Type enumeration for Combo Box sizes + """ + Page = 0 + Width = 1 + OneHundred = 2 + SeventyFive = 3 + Fifty = 4 + TwentyFive = 5 + + Sizes = [ + translate('OpenLP.PrintServiceDialog', 'Fit Page'), + translate('OpenLP.PrintServiceDialog', 'Fit Width'), + u'100%', u'75%', u'50%', u'25%'] + +class Ui_PrintServiceDialog(object): def setupUi(self, printServiceDialog): printServiceDialog.setObjectName(u'printServiceDialog') printServiceDialog.resize(664, 594) @@ -40,23 +56,24 @@ class Ui_PrintServiceOrderDialog(object): self.toolbar = QtGui.QToolBar(printServiceDialog) self.toolbar.setIconSize(QtCore.QSize(22, 22)) self.toolbar.setToolButtonStyle(QtCore.Qt.ToolButtonTextBesideIcon) - self.toolbar.addAction( + self.printButton = self.toolbar.addAction( QtGui.QIcon(build_icon(u':/general/general_print.png')), 'Print') self.optionsButton = QtGui.QToolButton(self.toolbar) self.optionsButton.setText(u'Options') - self.optionsButton.setToolButtonStyle(QtCore.Qt.ToolButtonTextBesideIcon) + self.optionsButton.setToolButtonStyle( + QtCore.Qt.ToolButtonTextBesideIcon) self.optionsButton.setIcon(QtGui.QIcon( build_icon(u':/system/system_configure.png'))) self.optionsButton.setCheckable(True) self.toolbar.addWidget(self.optionsButton) - self.toolbar.addAction( + self.closeButton = self.toolbar.addAction( QtGui.QIcon(build_icon(u':/system/system_close.png')), 'Close') self.toolbar.addSeparator() - self.toolbar.addAction( + self.plainCopy = self.toolbar.addAction( QtGui.QIcon(build_icon(u':/system/system_edit_copy.png')), 'Copy') - self.toolbar.addAction( + self.htmlCopy = self.toolbar.addAction( QtGui.QIcon(build_icon(u':/system/system_edit_copy.png')), 'Copy as HTML') self.toolbar.addSeparator() @@ -83,22 +100,10 @@ class Ui_PrintServiceOrderDialog(object): self.toolbar.addWidget(self.zoomOriginalButton) self.zoomComboBox = QtGui.QComboBox(printServiceDialog) self.zoomComboBox.setObjectName((u'zoomComboBox')) - self.zoomComboBox.addItem(u'Fit Page') - self.zoomComboBox.addItem(u'Fit Width') - self.zoomComboBox.addItem(u'100%') - self.zoomComboBox.addItem(u'75%') - self.zoomComboBox.addItem(u'50%') - self.zoomComboBox.addItem(u'25%') self.toolbar.addWidget(self.zoomComboBox) self.mainLayout.addWidget(self.toolbar) - self.scrollArea = QtGui.QScrollArea(printServiceDialog) - self.scrollArea.setWidgetResizable(True) - self.scrollArea.setObjectName(u'scrollArea') - self.scrollAreaWidgetContents = QtGui.QWidget() - self.scrollAreaWidgetContents.setGeometry(QtCore.QRect(0, 0, 227, 473)) - self.scrollAreaWidgetContents.setObjectName(u'scrollAreaWidgetContents') - self.scrollArea.setWidget(self.scrollAreaWidgetContents) - self.mainLayout.addWidget(self.scrollArea) + self.previewWidget = QtGui.QPrintPreviewWidget(printServiceDialog) + self.mainLayout.addWidget(self.previewWidget) self.optionsWidget = QtGui.QWidget(printServiceDialog) self.optionsWidget.hide() self.optionsWidget.resize(400, 300) @@ -123,7 +128,7 @@ class Ui_PrintServiceOrderDialog(object): self.groupLayout = QtGui.QVBoxLayout() self.slideTextCheckBox = QtGui.QCheckBox() self.groupLayout.addWidget(self.slideTextCheckBox) - self.notesCheckBox = QtGui.QCheckBox('Include service item notes') + self.notesCheckBox = QtGui.QCheckBox() self.groupLayout.addWidget(self.notesCheckBox) self.metaDataCheckBox = QtGui.QCheckBox() self.groupLayout.addWidget(self.metaDataCheckBox) @@ -136,21 +141,22 @@ class Ui_PrintServiceOrderDialog(object): QtCore.QObject.connect(self.optionsButton, QtCore.SIGNAL(u'toggled(bool)'), self.toggleOptions) - self.retranslateUi(printServiceDialog) - QtCore.QMetaObject.connectSlotsByName(printServiceDialog) - def retranslateUi(self, printServiceDialog): printServiceDialog.setWindowTitle( - translate('OpenLP.PrintServiceOrderForm', 'Print Service Order')) -# self.previewLabel.setText( -# translate('OpenLP.PrintServiceOrderForm', 'Preview:')) - self.slideTextCheckBox.setText(translate( - 'OpenLP.PrintServiceOrderForm', 'Include slide text if available')) - self.notesCheckBox.setText(translate( - 'OpenLP.PrintServiceOrderForm', 'Include service item notes')) - self.metaDataCheckBox.setText( - translate('OpenLP.PrintServiceOrderForm', + translate('OpenLP.PrintServiceForm', 'Print Service Order')) + self.slideTextCheckBox.setText(translate('OpenLP.PrintServiceForm', + 'Include slide text if available')) + self.notesCheckBox.setText(translate('OpenLP.PrintServiceForm', + 'Include service item notes')) + self.metaDataCheckBox.setText(translate('OpenLP.PrintServiceForm', 'Include play length of media items')) + self.zoomComboBox.addItem(ZoomSize.Sizes[ZoomSize.Page]) + self.zoomComboBox.addItem(ZoomSize.Sizes[ZoomSize.Width]) + self.zoomComboBox.addItem(ZoomSize.Sizes[ZoomSize.OneHundred]) + self.zoomComboBox.addItem(ZoomSize.Sizes[ZoomSize.SeventyFive]) + self.zoomComboBox.addItem(ZoomSize.Sizes[ZoomSize.Fifty]) + self.zoomComboBox.addItem(ZoomSize.Sizes[ZoomSize.TwentyFive]) + # self.serviceTitleLabel.setText(translate( # 'OpenLP.PrintServiceOrderForm', 'Title:')) # self.serviceTitleLineEdit.setText(translate('OpenLP.ServiceManager', diff --git a/openlp/core/ui/printserviceorderform.py b/openlp/core/ui/printserviceform.py similarity index 79% rename from openlp/core/ui/printserviceorderform.py rename to openlp/core/ui/printserviceform.py index 2bce1e837..479928dfa 100644 --- a/openlp/core/ui/printserviceorderform.py +++ b/openlp/core/ui/printserviceform.py @@ -29,9 +29,9 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import translate from openlp.core.lib.ui import UiStrings -from openlp.core.ui.printserviceorderdialog import Ui_PrintServiceOrderDialog +from openlp.core.ui.printservicedialog import Ui_PrintServiceDialog, ZoomSize -class PrintServiceOrderForm(QtGui.QDialog, Ui_PrintServiceOrderDialog): +class PrintServiceForm(QtGui.QDialog, Ui_PrintServiceDialog): def __init__(self, parent, serviceManager): """ @@ -55,14 +55,20 @@ class PrintServiceOrderForm(QtGui.QDialog, Ui_PrintServiceOrderDialog): u'print notes', QtCore.QVariant(False)).toBool()) settings.endGroup() # Signals -# QtCore.QObject.connect(self.printButton, -# QtCore.SIGNAL(u'clicked()'), self.printServiceOrder) -# QtCore.QObject.connect(self.zoomOutButton, -# QtCore.SIGNAL(u'clicked()'), self.zoomOut) -# QtCore.QObject.connect(self.zoomInButton, -# QtCore.SIGNAL(u'clicked()'), self.zoomIn) -# QtCore.QObject.connect(self.previewWidget, -# QtCore.SIGNAL(u'paintRequested(QPrinter *)'), self.paintRequested) + QtCore.QObject.connect(self.printButton, + QtCore.SIGNAL(u'triggered()'), self.printServiceOrder) + QtCore.QObject.connect(self.closeButton, + QtCore.SIGNAL(u'triggered()'), self.accept) + QtCore.QObject.connect(self.zoomOutButton, + QtCore.SIGNAL(u'clicked()'), self.zoomOut) + QtCore.QObject.connect(self.zoomInButton, + QtCore.SIGNAL(u'clicked()'), self.zoomIn) + QtCore.QObject.connect(self.zoomOriginalButton, + QtCore.SIGNAL(u'clicked()'), self.zoomOriginal) + QtCore.QObject.connect(self.previewWidget, + QtCore.SIGNAL(u'paintRequested(QPrinter *)'), self.paintRequested) + QtCore.QObject.connect(self.zoomComboBox, + QtCore.SIGNAL(u'currentIndexChanged(int)'), self.displaySizeChanged) # QtCore.QObject.connect(self.serviceTitleLineEdit, # QtCore.SIGNAL(u'textChanged(const QString)'), # self.updatePreviewText) @@ -72,7 +78,7 @@ class PrintServiceOrderForm(QtGui.QDialog, Ui_PrintServiceOrderDialog): # QtCore.SIGNAL(u'stateChanged(int)'), self.updatePreviewText) # QtCore.QObject.connect(self.metaDataCheckBox, # QtCore.SIGNAL(u'stateChanged(int)'), self.updatePreviewText) -# QtCore.QObject.connect(self.customNoteEdit, +# QtCore.QObject.connect(self.footerTextEdit, # QtCore.SIGNAL(u'textChanged()'), self.updatePreviewText) # QtCore.QObject.connect(self.cancelButton, # QtCore.SIGNAL(u'clicked()'), self.reject) @@ -80,7 +86,7 @@ class PrintServiceOrderForm(QtGui.QDialog, Ui_PrintServiceOrderDialog): # QtCore.SIGNAL(u'clicked()'), self.copyText) # QtCore.QObject.connect(self.copyHtmlButton, # QtCore.SIGNAL(u'clicked()'), self.copyHtmlText) -# self.updatePreviewText() + self.updatePreviewText() def toggleOptions(self, checked): self.optionsWidget.setVisible(checked) @@ -97,8 +103,8 @@ class PrintServiceOrderForm(QtGui.QDialog, Ui_PrintServiceOrderDialog): Creates the html text and updates the html of *self.document*. """ text = u'' - if self.serviceTitleLineEdit.text(): - text += u'

      %s

      ' % unicode(self.serviceTitleLineEdit.text()) + if self.titleLineEdit.text(): + text += u'

      %s

      ' % unicode(self.titleLineEdit.text()) for item in self.serviceManager.serviceItems: item = item[u'service_item'] # Add the title of the service item. @@ -140,9 +146,9 @@ class PrintServiceOrderForm(QtGui.QDialog, Ui_PrintServiceOrderDialog): text += u'

      %s %s

      ' % (translate( 'OpenLP.ServiceManager', u'Playing time:'), unicode(datetime.timedelta(seconds=item.media_length))) - if self.customNoteEdit.toPlainText(): + if self.footerTextEdit.toPlainText(): text += u'

      %s

      %s' % (translate('OpenLP.ServiceManager', - u'Custom Service Notes:'), self.customNoteEdit.toPlainText()) + u'Custom Service Notes:'), self.footerTextEdit.toPlainText()) self.document.setHtml(text) self.previewWidget.updatePreview() @@ -155,20 +161,39 @@ class PrintServiceOrderForm(QtGui.QDialog, Ui_PrintServiceOrderDialog): """ self.document.print_(printer) + def displaySizeChanged(self, display): + """ + The Zoom Combo box has changed so set up the size. + """ + if display == ZoomSize.Page: + self.previewWidget.fitInView() + elif display == ZoomSize.Width: + self.previewWidget.fitToWidth() + elif display == ZoomSize.OneHundred: + self.previewWidget.fitToWidth() + elif display == ZoomSize.SeventyFive: + self.previewWidget.fitToWidth() + elif display == ZoomSize.Fifty: + self.previewWidget.fitToWidth() + elif display == ZoomSize.TwentyFive: + self.previewWidget.fitToWidth() + settings = QtCore.QSettings() + settings.beginGroup(u'advanced') + settings.setValue(u'display size',QtCore.QVariant(display)) + settings.endGroup() + def copyText(self): """ Copies the display text to the clipboard as plain text """ self.parent.clipboard.setText(self.document.toPlainText()) - def copyHtmlText(self): """ Copies the display text to the clipboard as Html """ self.parent.clipboard.setText(self.document.toHtml()) - def printServiceOrder(self): """ Called, when the *printButton* is clicked. Opens the *printDialog*. @@ -190,6 +215,12 @@ class PrintServiceOrderForm(QtGui.QDialog, Ui_PrintServiceOrderDialog): """ self.previewWidget.zoomOut() + def zoomOriginal(self): + """ + Called when *zoomOutButton* is clicked. + """ + self.previewWidget.fitInView() + def updateTextFormat(self, value): """ Called when html copy check box is selected. @@ -213,8 +244,3 @@ class PrintServiceOrderForm(QtGui.QDialog, Ui_PrintServiceOrderDialog): settings.setValue(u'print notes', QtCore.QVariant(self.notesCheckBox.isChecked())) settings.endGroup() - - def close(self): - # Close the dialog. - return QtGui.QDialog.accept(self) - diff --git a/openlp/core/ui/servicemanager.py b/openlp/core/ui/servicemanager.py index 623c2d641..f5faa22dd 100644 --- a/openlp/core/ui/servicemanager.py +++ b/openlp/core/ui/servicemanager.py @@ -37,7 +37,7 @@ from openlp.core.lib import OpenLPToolbar, ServiceItem, context_menu_action, \ ThemeLevel from openlp.core.lib.ui import UiStrings, critical_error_message_box from openlp.core.ui import ServiceNoteForm, ServiceItemEditForm, StartTimeForm -from openlp.core.ui.printserviceorderform import PrintServiceOrderForm +from openlp.core.ui.printserviceform import PrintServiceForm from openlp.core.utils import AppLocation, delete_file, file_is_unicode, \ split_filename @@ -1208,5 +1208,5 @@ class ServiceManager(QtGui.QWidget): """ Print a Service Order Sheet. """ - settingDialog = PrintServiceOrderForm(self.mainwindow, self) + settingDialog = PrintServiceForm(self.mainwindow, self) settingDialog.exec_() From ac8e435f93d22cab32c66fe722a68f2b15396963 Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Sat, 19 Feb 2011 19:25:14 +0100 Subject: [PATCH 066/123] --- openlp/plugins/songs/songsplugin.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openlp/plugins/songs/songsplugin.py b/openlp/plugins/songs/songsplugin.py index 3620fcf82..ef89212f1 100644 --- a/openlp/plugins/songs/songsplugin.py +++ b/openlp/plugins/songs/songsplugin.py @@ -35,6 +35,7 @@ from openlp.core.lib.ui import UiStrings from openlp.plugins.songs.lib import SongMediaItem, SongsTab, SongXML from openlp.plugins.songs.lib.db import Author, init_schema, Song from openlp.plugins.songs.lib.importer import SongFormat +from openlp.plugins.songs.lib.ui import SongStrings log = logging.getLogger(__name__) @@ -147,8 +148,7 @@ class SongsPlugin(Plugin): counter += 1 # The song does not have any author, add one. if not song.authors: - name = unicode(translate('SongsPlugin', 'Author unknown', - 'Translation must contain a blank character!')) + name = unicode(SongStrings.AuthorUnknownUnT) author = self.manager.get_object_filtered(Author, Author.display_name == name) if author is None: From 1f5d896fc1cf617f7978a5c086784e6846a7fcf7 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Sat, 19 Feb 2011 19:49:08 +0000 Subject: [PATCH 067/123] Fix CCLI author import --- openlp/plugins/songs/lib/cclifileimport.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openlp/plugins/songs/lib/cclifileimport.py b/openlp/plugins/songs/lib/cclifileimport.py index ccd1dff9c..60652ef14 100644 --- a/openlp/plugins/songs/lib/cclifileimport.py +++ b/openlp/plugins/songs/lib/cclifileimport.py @@ -200,7 +200,7 @@ class CCLIFileImport(SongImport): author_list = song_author.split(u'|') for author in author_list: seperated = author.split(u',') - self.add_author(seperated[1].strip() + u' ' + seperated[0].strip()) + self.add_author(u' '.join(seperated)) self.title = song_name self.copyright = song_copyright self.ccli_number = song_ccli From d5a82b9290c3411ffc8f8d31cfd868f7ebe8d243 Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Sat, 19 Feb 2011 22:06:15 +0200 Subject: [PATCH 068/123] Added the README.txt file for Python distribution. --- README.txt | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 README.txt diff --git a/README.txt b/README.txt new file mode 100644 index 000000000..15f58e6d0 --- /dev/null +++ b/README.txt @@ -0,0 +1,20 @@ +OpenLP 2.0 +========== + +You're probably reading this because you've just downloaded the source code for +OpenLP 2.0. If you are looking for the installer file, please go to the download +page on the web site:: + + http://openlp.org/en/download.html + +If you're looking for how to contribute to OpenLP, then please look at the +contribution page on the web site:: + + http://openlp.org/en/documentation/introduction/contributing.html + +If you've looked at that page, and are wanting to help develop, test or +translate OpenLP, have a look at the OpenLP wiki:: + + http://wiki.openlp.org/ + +Thanks for downloading OpenLP 2.0! \ No newline at end of file From 282c81326ca0d740b542b827a825cfc7b912d506 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sat, 19 Feb 2011 20:23:23 +0000 Subject: [PATCH 069/123] Print Dialog complete --- openlp/core/ui/printservicedialog.py | 42 ++++++++++++---------------- openlp/core/ui/printserviceform.py | 34 +++++++++++----------- 2 files changed, 34 insertions(+), 42 deletions(-) diff --git a/openlp/core/ui/printservicedialog.py b/openlp/core/ui/printservicedialog.py index 8eb1c3d45..aac5a3e44 100644 --- a/openlp/core/ui/printservicedialog.py +++ b/openlp/core/ui/printservicedialog.py @@ -59,7 +59,8 @@ class Ui_PrintServiceDialog(object): self.printButton = self.toolbar.addAction( QtGui.QIcon(build_icon(u':/general/general_print.png')), 'Print') self.optionsButton = QtGui.QToolButton(self.toolbar) - self.optionsButton.setText(u'Options') + self.optionsButton.setText(translate('OpenLP.PrintServiceForm', + 'Options')) self.optionsButton.setToolButtonStyle( QtCore.Qt.ToolButtonTextBesideIcon) self.optionsButton.setIcon(QtGui.QIcon( @@ -68,38 +69,41 @@ class Ui_PrintServiceDialog(object): self.toolbar.addWidget(self.optionsButton) self.closeButton = self.toolbar.addAction( QtGui.QIcon(build_icon(u':/system/system_close.png')), - 'Close') + translate('OpenLP.PrintServiceForm', 'Close')) self.toolbar.addSeparator() self.plainCopy = self.toolbar.addAction( QtGui.QIcon(build_icon(u':/system/system_edit_copy.png')), - 'Copy') + translate('OpenLP.PrintServiceForm', 'Copy')) self.htmlCopy = self.toolbar.addAction( QtGui.QIcon(build_icon(u':/system/system_edit_copy.png')), - 'Copy as HTML') + translate('OpenLP.PrintServiceForm', 'Copy as HTML')) self.toolbar.addSeparator() self.zoomInButton = QtGui.QToolButton(self.toolbar) self.zoomInButton.setIcon(QtGui.QIcon( build_icon(u':/general/general_zoom_in.png'))) - self.zoomInButton.setToolTip(u'Zoom In') + self.zoomInButton.setToolTip(translate('OpenLP.PrintServiceForm', + 'Zoom In')) self.zoomInButton.setObjectName(u'zoomInButton') self.zoomInButton.setIconSize(QtCore.QSize(22, 22)) self.toolbar.addWidget(self.zoomInButton) self.zoomOutButton = QtGui.QToolButton(self.toolbar) self.zoomOutButton.setIcon(QtGui.QIcon( build_icon(u':/general/general_zoom_out.png'))) - self.zoomOutButton.setToolTip(u'Zoom Out') + self.zoomOutButton.setToolTip(translate('OpenLP.PrintServiceForm', + 'Zoom Out')) self.zoomOutButton.setObjectName(u'zoomOutButton') self.zoomOutButton.setIconSize(QtCore.QSize(22, 22)) self.toolbar.addWidget(self.zoomOutButton) self.zoomOriginalButton = QtGui.QToolButton(self.toolbar) self.zoomOriginalButton.setIcon(QtGui.QIcon( build_icon(u':/general/general_zoom_original.png'))) - self.zoomOriginalButton.setToolTip(u'Zoom Original') + self.zoomOriginalButton.setToolTip(translate('OpenLP.PrintServiceForm', + 'Zoom Original')) self.zoomOriginalButton.setObjectName(u'zoomOriginalButton') self.zoomOriginalButton.setIconSize(QtCore.QSize(22, 22)) self.toolbar.addWidget(self.zoomOriginalButton) self.zoomComboBox = QtGui.QComboBox(printServiceDialog) - self.zoomComboBox.setObjectName((u'zoomComboBox')) + self.zoomComboBox.setObjectName(u'zoomComboBox') self.toolbar.addWidget(self.zoomComboBox) self.mainLayout.addWidget(self.toolbar) self.previewWidget = QtGui.QPrintPreviewWidget(printServiceDialog) @@ -111,7 +115,7 @@ class Ui_PrintServiceDialog(object): self.optionsLayout = QtGui.QVBoxLayout(self.optionsWidget) self.optionsLayout.setContentsMargins(8, 8, 8, 8) self.titleLabel = QtGui.QLabel(self.optionsWidget) - self.titleLabel.setObjectName((u'titleLabel')) + self.titleLabel.setObjectName(u'titleLabel') self.titleLabel.setText(u'Title:') self.optionsLayout.addWidget(self.titleLabel) self.titleLineEdit = QtGui.QLineEdit(self.optionsWidget) @@ -121,10 +125,11 @@ class Ui_PrintServiceDialog(object): self.footerLabel.setObjectName(u'footerLabel') self.footerLabel.setText(u'Custom Footer Text:') self.optionsLayout.addWidget(self.footerLabel) - self.footerTextEdit = QtGui.QTextEdit(self.optionsWidget) + self.footerTextEdit = SpellTextEdit(self.optionsWidget) self.footerTextEdit.setObjectName(u'footerTextEdit') self.optionsLayout.addWidget(self.footerTextEdit) - self.optionsGroupBox = QtGui.QGroupBox(u'Other Options') + self.optionsGroupBox = QtGui.QGroupBox( + translate('OpenLP.PrintServiceForm','Other Options')) self.groupLayout = QtGui.QVBoxLayout() self.slideTextCheckBox = QtGui.QCheckBox() self.groupLayout.addWidget(self.slideTextCheckBox) @@ -150,22 +155,11 @@ class Ui_PrintServiceDialog(object): 'Include service item notes')) self.metaDataCheckBox.setText(translate('OpenLP.PrintServiceForm', 'Include play length of media items')) + self.titleLineEdit.setText(translate('OpenLP.PrintServiceForm', + 'Service Order Sheet')) self.zoomComboBox.addItem(ZoomSize.Sizes[ZoomSize.Page]) self.zoomComboBox.addItem(ZoomSize.Sizes[ZoomSize.Width]) self.zoomComboBox.addItem(ZoomSize.Sizes[ZoomSize.OneHundred]) self.zoomComboBox.addItem(ZoomSize.Sizes[ZoomSize.SeventyFive]) self.zoomComboBox.addItem(ZoomSize.Sizes[ZoomSize.Fifty]) self.zoomComboBox.addItem(ZoomSize.Sizes[ZoomSize.TwentyFive]) - -# self.serviceTitleLabel.setText(translate( -# 'OpenLP.PrintServiceOrderForm', 'Title:')) -# self.serviceTitleLineEdit.setText(translate('OpenLP.ServiceManager', -# 'Service Order Sheet')) -# self.copyTextButton.setText(translate('OpenLP.ServiceManager', -# 'Copy to Clipboard as Text')) -# self.copyHtmlButton.setText(translate('OpenLP.ServiceManager', -# 'Copy to Clipboard as Html')) -# self.printButton.setText(translate('OpenLP.ServiceManager', 'Print')) -# self.cancelButton.setText(translate('OpenLP.ServiceManager', 'Cancel')) -# self.customNotesLabel.setText( -# translate('OpenLP.ServiceManager', 'Custom Service Notes:')) diff --git a/openlp/core/ui/printserviceform.py b/openlp/core/ui/printserviceform.py index 479928dfa..66d23f80a 100644 --- a/openlp/core/ui/printserviceform.py +++ b/openlp/core/ui/printserviceform.py @@ -43,6 +43,7 @@ class PrintServiceForm(QtGui.QDialog, Ui_PrintServiceDialog): self.printer = QtGui.QPrinter() self.printDialog = QtGui.QPrintDialog(self.printer, self) self.document = QtGui.QTextDocument() + self.zoom = 0 self.setupUi(self) # Load the settings for the dialog. settings = QtCore.QSettings() @@ -53,6 +54,8 @@ class PrintServiceForm(QtGui.QDialog, Ui_PrintServiceDialog): u'print file meta data', QtCore.QVariant(False)).toBool()) self.notesCheckBox.setChecked(settings.value( u'print notes', QtCore.QVariant(False)).toBool()) + self.zoomComboBox.setCurrentIndex(settings.value( + u'display size', QtCore.QVariant(0)).toInt()[0]) settings.endGroup() # Signals QtCore.QObject.connect(self.printButton, @@ -69,23 +72,10 @@ class PrintServiceForm(QtGui.QDialog, Ui_PrintServiceDialog): QtCore.SIGNAL(u'paintRequested(QPrinter *)'), self.paintRequested) QtCore.QObject.connect(self.zoomComboBox, QtCore.SIGNAL(u'currentIndexChanged(int)'), self.displaySizeChanged) -# QtCore.QObject.connect(self.serviceTitleLineEdit, -# QtCore.SIGNAL(u'textChanged(const QString)'), -# self.updatePreviewText) -# QtCore.QObject.connect(self.slideTextCheckBox, -# QtCore.SIGNAL(u'stateChanged(int)'), self.updatePreviewText) -# QtCore.QObject.connect(self.notesCheckBox, -# QtCore.SIGNAL(u'stateChanged(int)'), self.updatePreviewText) -# QtCore.QObject.connect(self.metaDataCheckBox, -# QtCore.SIGNAL(u'stateChanged(int)'), self.updatePreviewText) -# QtCore.QObject.connect(self.footerTextEdit, -# QtCore.SIGNAL(u'textChanged()'), self.updatePreviewText) -# QtCore.QObject.connect(self.cancelButton, -# QtCore.SIGNAL(u'clicked()'), self.reject) -# QtCore.QObject.connect(self.copyTextButton, -# QtCore.SIGNAL(u'clicked()'), self.copyText) -# QtCore.QObject.connect(self.copyHtmlButton, -# QtCore.SIGNAL(u'clicked()'), self.copyHtmlText) + QtCore.QObject.connect(self.plainCopy, + QtCore.SIGNAL(u'triggered()'), self.copyText) + QtCore.QObject.connect(self.htmlCopy, + QtCore.SIGNAL(u'triggered()'), self.copyHtmlText) self.updatePreviewText() def toggleOptions(self, checked): @@ -97,6 +87,7 @@ class PrintServiceForm(QtGui.QDialog, Ui_PrintServiceDialog): self.titleLineEdit.setFocus() else: self.saveOptions() + self.updatePreviewText() def updatePreviewText(self): """ @@ -171,12 +162,16 @@ class PrintServiceForm(QtGui.QDialog, Ui_PrintServiceDialog): self.previewWidget.fitToWidth() elif display == ZoomSize.OneHundred: self.previewWidget.fitToWidth() + self.previewWidget.zoomIn(1) elif display == ZoomSize.SeventyFive: self.previewWidget.fitToWidth() + self.previewWidget.zoomIn(0.75) elif display == ZoomSize.Fifty: self.previewWidget.fitToWidth() + self.previewWidget.zoomIn(0.5) elif display == ZoomSize.TwentyFive: self.previewWidget.fitToWidth() + self.previewWidget.zoomIn(0.25) settings = QtCore.QSettings() settings.beginGroup(u'advanced') settings.setValue(u'display size',QtCore.QVariant(display)) @@ -208,18 +203,21 @@ class PrintServiceForm(QtGui.QDialog, Ui_PrintServiceDialog): Called when *zoomInButton* is clicked. """ self.previewWidget.zoomIn() + self.zoom -= 0.1 def zoomOut(self): """ Called when *zoomOutButton* is clicked. """ self.previewWidget.zoomOut() + self.zoom += 0.1 def zoomOriginal(self): """ Called when *zoomOutButton* is clicked. """ - self.previewWidget.fitInView() + self.previewWidget.zoomIn(1 + self.zoom) + self.zoom = 0 def updateTextFormat(self, value): """ From bb39617b3b2000995d9d180c1c1ab341cbf2c65c Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Sat, 19 Feb 2011 20:31:21 +0000 Subject: [PATCH 070/123] Try again --- openlp/plugins/songs/lib/cclifileimport.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/openlp/plugins/songs/lib/cclifileimport.py b/openlp/plugins/songs/lib/cclifileimport.py index 60652ef14..3d08584d0 100644 --- a/openlp/plugins/songs/lib/cclifileimport.py +++ b/openlp/plugins/songs/lib/cclifileimport.py @@ -199,8 +199,11 @@ class CCLIFileImport(SongImport): if len(author_list) < 2: author_list = song_author.split(u'|') for author in author_list: - seperated = author.split(u',') - self.add_author(u' '.join(seperated)) + separated = author.split(u',') + if len(separated) > 1: + self.add_author(u' '.join(reversed(separated))) + else: + self.add_author(author) self.title = song_name self.copyright = song_copyright self.ccli_number = song_ccli From 6208587b939333766412500d6552f2394598ed99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Armin=20K=C3=B6hler?= Date: Sat, 19 Feb 2011 22:34:51 +0100 Subject: [PATCH 071/123] foilpresenterimport - some changes --- openlp/core/ui/wizard.py | 1 + openlp/plugins/songs/forms/songimportform.py | 12 ++----- .../plugins/songs/lib/foilpresenterimport.py | 36 +++++++++---------- 3 files changed, 20 insertions(+), 29 deletions(-) diff --git a/openlp/core/ui/wizard.py b/openlp/core/ui/wizard.py index 2960607e4..fc1edeecb 100644 --- a/openlp/core/ui/wizard.py +++ b/openlp/core/ui/wizard.py @@ -54,6 +54,7 @@ class WizardStrings(object): SoF = u'Songs of Fellowship' SSP = u'SongShow Plus' WoW = u'Words of Worship' + FP = u'Foilpresenter' # These strings should need a good reason to be retranslated elsewhere. FinishedImport = translate('OpenLP.Ui', 'Finished import.') FormatLabel = translate('OpenLP.Ui', 'Format:') diff --git a/openlp/plugins/songs/forms/songimportform.py b/openlp/plugins/songs/forms/songimportform.py index bc3e28a33..06de08a93 100644 --- a/openlp/plugins/songs/forms/songimportform.py +++ b/openlp/plugins/songs/forms/songimportform.py @@ -410,12 +410,8 @@ class SongImportForm(OpenLPWizard): return False elif source_format == SongFormat.FoilPresenter: if self.foilPresenterFileListWidget.count() == 0: - criticalErrorMessageBox( - translate('SongsPlugin.ImportWizardForm', - 'No Foilpresenter Files Selected'), - translate('SongsPlugin.ImportWizardForm', - 'You need to add at least one Foilpresenter ' - 'song file to import from.')) + critical_error_message_box(UiStrings.NFSp, + WizardStrings.YouSpecifyFile % WizardStrings.FP) self.foilPresenterAddButton.setFocus() return False return True @@ -613,9 +609,7 @@ class SongImportForm(OpenLPWizard): """ Get FoilPresenter song database files """ - self.getFiles( - translate('SongsPlugin.ImportWizardForm', - 'Select FoilPresenter Files'), + self.getFiles(WizardStrings.OpenTypeFile % WizardStrings.FP, self.foilPresenterFileListWidget, u'%s (*.foil)' % translate('SongsPlugin.ImportWizardForm', 'Foilpresenter Song Files') diff --git a/openlp/plugins/songs/lib/foilpresenterimport.py b/openlp/plugins/songs/lib/foilpresenterimport.py index 919901694..635137b00 100644 --- a/openlp/plugins/songs/lib/foilpresenterimport.py +++ b/openlp/plugins/songs/lib/foilpresenterimport.py @@ -94,6 +94,7 @@ import os from lxml import etree, objectify from openlp.core.lib import translate +from openlp.core.ui.wizard import WizardStrings from openlp.plugins.songs.lib import VerseType from openlp.plugins.songs.lib.songimport import SongImport from openlp.plugins.songs.lib.db import Author, Book, Song, Topic @@ -110,32 +111,27 @@ class FoilPresenterImport(SongImport): Initialise the import. """ log.debug(u'initialise FoilPresenterImport') - SongImport.__init__(self, master_manager) - self.master_manager = master_manager - self.FoilPresenter = FoilPresenter(master_manager) - if kwargs.has_key(u'filename'): - self.import_source = kwargs[u'filename'] - if kwargs.has_key(u'filenames'): - self.import_source = kwargs[u'filenames'] + SongImport.__init__(self, master_manager, **kwargs) + self.FoilPresenter = FoilPresenter(self.manager) def do_import(self): """ Imports the songs. """ self.import_wizard.progressBar.setMaximum(len(self.import_source)) + parser = etree.XMLParser(remove_blank_text=True) for file_path in self.import_source: if self.stop_import_flag: return False - self.import_wizard.incrementProgressBar(unicode(translate( - 'SongsPlugin.FoilPresenterImport', 'Importing %s...')) % - os.path.basename(file_path)) - parser = etree.XMLParser(remove_blank_text=True) - parsed_file = etree.parse(file_path, parser) - xml = unicode(etree.tostring(parsed_file)) - if self.FoilPresenter.xml_to_song(xml) is None: - log.debug(u'File could not be imported: %s' % file_path) - # Importing this song failed! For now we stop import. - return False + self.import_wizard.incrementProgressBar( + WizardStrings.ImportingType % os.path.basename(file_path)) + try: + parsed_file = etree.parse(file_path, parser) + xml = unicode(etree.tostring(parsed_file)) + if self.FoilPresenter.xml_to_song(xml) is None: + log.debug(u'File could not be imported: %s' % file_path) + except etree.XMLSyntaxError: + log.exception(u'XML syntax error in file %s' % file_path) return True class FoilPresenter(object): @@ -325,9 +321,9 @@ class FoilPresenter(object): for test_temp in test: author_temp.append(test_temp) for author in author_temp: - author = re.compile( - u'^[\/,;\-\s]+|[\/,;\-\s]+$|\s*[0-9]{4}\s*[\-\/]?\s*([0-9]{4})?[\/,;\-\s]*$' - ).sub(u'', author) + regex = u'^[\/,;\-\s]+|[\/,;\-\s]+$|'\ + '\s*[0-9]{4}\s*[\-\/]?\s*([0-9]{4})?[\/,;\-\s]*$' + author = re.compile(regex).sub(u'', author) author = re.compile( u'[0-9]{1,2}\.\s?J(ahr)?h\.|um\s*$|vor\s*$').sub(u'', author) From 5d947476ac9877b607238781475702c02c27045a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20P=C3=B5ldaru?= Date: Sun, 20 Feb 2011 02:05:50 +0200 Subject: [PATCH 072/123] two missing qobject init's --- openlp/core/lib/imagemanager.py | 1 + openlp/plugins/songs/lib/songimport.py | 1 + 2 files changed, 2 insertions(+) diff --git a/openlp/core/lib/imagemanager.py b/openlp/core/lib/imagemanager.py index 0a76ce834..23005e992 100644 --- a/openlp/core/lib/imagemanager.py +++ b/openlp/core/lib/imagemanager.py @@ -69,6 +69,7 @@ class ImageManager(QtCore.QObject): log.info(u'Image Manager loaded') def __init__(self): + QtCore.QObject.__init__(self) self._cache = {} self._thread_running = False self._cache_dirty = False diff --git a/openlp/plugins/songs/lib/songimport.py b/openlp/plugins/songs/lib/songimport.py index b24b2699a..40be1675e 100644 --- a/openlp/plugins/songs/lib/songimport.py +++ b/openlp/plugins/songs/lib/songimport.py @@ -54,6 +54,7 @@ class SongImport(QtCore.QObject): """ self.manager = manager + QtCore.QObject.__init__(self) if kwargs.has_key(u'filename'): self.import_source = kwargs[u'filename'] elif kwargs.has_key(u'filenames'): From de66d53e73c06b11cbf1bf41aa6f37bb7f625609 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sun, 20 Feb 2011 07:37:44 +0000 Subject: [PATCH 073/123] Review fixes --- README.txt | 3 ++- openlp/core/ui/printservicedialog.py | 11 +++++------ openlp/core/ui/printserviceform.py | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/README.txt b/README.txt index 15f58e6d0..0b26d74fc 100644 --- a/README.txt +++ b/README.txt @@ -17,4 +17,5 @@ translate OpenLP, have a look at the OpenLP wiki:: http://wiki.openlp.org/ -Thanks for downloading OpenLP 2.0! \ No newline at end of file +Thanks for downloading OpenLP 2.0! + diff --git a/openlp/core/ui/printservicedialog.py b/openlp/core/ui/printservicedialog.py index aac5a3e44..ec4e054c3 100644 --- a/openlp/core/ui/printservicedialog.py +++ b/openlp/core/ui/printservicedialog.py @@ -57,7 +57,7 @@ class Ui_PrintServiceDialog(object): self.toolbar.setIconSize(QtCore.QSize(22, 22)) self.toolbar.setToolButtonStyle(QtCore.Qt.ToolButtonTextBesideIcon) self.printButton = self.toolbar.addAction( - QtGui.QIcon(build_icon(u':/general/general_print.png')), 'Print') + build_icon(u':/general/general_print.png'), 'Print') self.optionsButton = QtGui.QToolButton(self.toolbar) self.optionsButton.setText(translate('OpenLP.PrintServiceForm', 'Options')) @@ -68,14 +68,14 @@ class Ui_PrintServiceDialog(object): self.optionsButton.setCheckable(True) self.toolbar.addWidget(self.optionsButton) self.closeButton = self.toolbar.addAction( - QtGui.QIcon(build_icon(u':/system/system_close.png')), + build_icon(u':/system/system_close.png'), translate('OpenLP.PrintServiceForm', 'Close')) self.toolbar.addSeparator() self.plainCopy = self.toolbar.addAction( - QtGui.QIcon(build_icon(u':/system/system_edit_copy.png')), + build_icon(u':/system/system_edit_copy.png'), translate('OpenLP.PrintServiceForm', 'Copy')) self.htmlCopy = self.toolbar.addAction( - QtGui.QIcon(build_icon(u':/system/system_edit_copy.png')), + build_icon(u':/system/system_edit_copy.png'), translate('OpenLP.PrintServiceForm', 'Copy as HTML')) self.toolbar.addSeparator() self.zoomInButton = QtGui.QToolButton(self.toolbar) @@ -147,8 +147,7 @@ class Ui_PrintServiceDialog(object): QtCore.SIGNAL(u'toggled(bool)'), self.toggleOptions) def retranslateUi(self, printServiceDialog): - printServiceDialog.setWindowTitle( - translate('OpenLP.PrintServiceForm', 'Print Service Order')) + printServiceDialog.setWindowTitle(UiStrings.PrintServiceOrder) self.slideTextCheckBox.setText(translate('OpenLP.PrintServiceForm', 'Include slide text if available')) self.notesCheckBox.setText(translate('OpenLP.PrintServiceForm', diff --git a/openlp/core/ui/printserviceform.py b/openlp/core/ui/printserviceform.py index 66d23f80a..882e39fca 100644 --- a/openlp/core/ui/printserviceform.py +++ b/openlp/core/ui/printserviceform.py @@ -129,12 +129,12 @@ class PrintServiceForm(QtGui.QDialog, Ui_PrintServiceDialog): # Add service items' notes. if self.notesCheckBox.isChecked(): if item.notes: - text += u'

      %s

      %s' % (translate( + text += u'

      %s

      %s' % (translate( 'OpenLP.ServiceManager', 'Notes:'), item.notes.replace(u'\n', u'
      ')) # Add play length of media files. if item.is_media() and self.metaDataCheckBox.isChecked(): - text += u'

      %s %s

      ' % (translate( + text += u'

      %s %s

      ' % (translate( 'OpenLP.ServiceManager', u'Playing time:'), unicode(datetime.timedelta(seconds=item.media_length))) if self.footerTextEdit.toPlainText(): From af6c792354e68cb4c275ced6e4bc31700dcd9a17 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Sun, 20 Feb 2011 14:25:14 +0000 Subject: [PATCH 074/123] Cleanups --- openlp/core/ui/printservicedialog.py | 3 ++- openlp/core/ui/printserviceform.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/openlp/core/ui/printservicedialog.py b/openlp/core/ui/printservicedialog.py index ec4e054c3..87a8276f4 100644 --- a/openlp/core/ui/printservicedialog.py +++ b/openlp/core/ui/printservicedialog.py @@ -29,7 +29,7 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import build_icon, translate, SpellTextEdit from openlp.core.lib.ui import UiStrings -class ZoomSize(): +class ZoomSize(object): """ Type enumeration for Combo Box sizes """ @@ -45,6 +45,7 @@ class ZoomSize(): translate('OpenLP.PrintServiceDialog', 'Fit Width'), u'100%', u'75%', u'50%', u'25%'] + class Ui_PrintServiceDialog(object): def setupUi(self, printServiceDialog): printServiceDialog.setObjectName(u'printServiceDialog') diff --git a/openlp/core/ui/printserviceform.py b/openlp/core/ui/printserviceform.py index 882e39fca..f4ad81884 100644 --- a/openlp/core/ui/printserviceform.py +++ b/openlp/core/ui/printserviceform.py @@ -174,7 +174,7 @@ class PrintServiceForm(QtGui.QDialog, Ui_PrintServiceDialog): self.previewWidget.zoomIn(0.25) settings = QtCore.QSettings() settings.beginGroup(u'advanced') - settings.setValue(u'display size',QtCore.QVariant(display)) + settings.setValue(u'display size', QtCore.QVariant(display)) settings.endGroup() def copyText(self): From 29088db51633403762ca8cd0a55387b551e25fbd Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sun, 20 Feb 2011 15:35:52 +0000 Subject: [PATCH 075/123] Start to move DisplayTag dialog --- openlp/core/ui/__init__.py | 1 + openlp/core/ui/displaytagdialog.py | 51 +++++++++++++++++++ .../{displaytagtab.py => displaytagform.py} | 7 +-- openlp/core/ui/mainwindow.py | 18 ++++++- openlp/core/ui/settingsform.py | 22 ++++---- 5 files changed, 83 insertions(+), 16 deletions(-) create mode 100644 openlp/core/ui/displaytagdialog.py rename openlp/core/ui/{displaytagtab.py => displaytagform.py} (98%) diff --git a/openlp/core/ui/__init__.py b/openlp/core/ui/__init__.py index 45218802e..5763b3470 100644 --- a/openlp/core/ui/__init__.py +++ b/openlp/core/ui/__init__.py @@ -67,6 +67,7 @@ from displaytagtab import DisplayTagTab from aboutform import AboutForm from pluginform import PluginForm from settingsform import SettingsForm +from displaytagform import DisplayTagForm from shortcutlistform import ShortcutListForm from mediadockmanager import MediaDockManager from servicemanager import ServiceManager diff --git a/openlp/core/ui/displaytagdialog.py b/openlp/core/ui/displaytagdialog.py new file mode 100644 index 000000000..f7d4b5175 --- /dev/null +++ b/openlp/core/ui/displaytagdialog.py @@ -0,0 +1,51 @@ +# -*- coding: utf-8 -*- +# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4 + +############################################################################### +# OpenLP - Open Source Lyrics Projection # +# --------------------------------------------------------------------------- # +# Copyright (c) 2008-2011 Raoul Snyman # +# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # +# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # +# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # +# Carsten Tinggaard, Frode Woldsund # +# --------------------------------------------------------------------------- # +# This program is free software; you can redistribute it and/or modify it # +# under the terms of the GNU General Public License as published by the Free # +# Software Foundation; version 2 of the License. # +# # +# This program is distributed in the hope that it will be useful, but WITHOUT # +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for # +# more details. # +# # +# You should have received a copy of the GNU General Public License along # +# with this program; if not, write to the Free Software Foundation, Inc., 59 # +# Temple Place, Suite 330, Boston, MA 02111-1307 USA # +############################################################################### + +from PyQt4 import QtCore, QtGui + +from openlp.core.lib import translate, build_icon +from openlp.core.lib.ui import create_accept_reject_button_box + +class Ui_DisplayTagDialog(object): + def setupUi(self, settingsDialog): + settingsDialog.setObjectName(u'settingsDialog') + settingsDialog.resize(700, 500) + settingsDialog.setWindowIcon( + build_icon(u':/system/system_settings.png')) + self.settingsLayout = QtGui.QVBoxLayout(settingsDialog) + self.settingsLayout.setObjectName(u'settingsLayout') + self.settingsTabWidget = QtGui.QTabWidget(settingsDialog) + self.settingsTabWidget.setObjectName(u'settingsTabWidget') + self.settingsLayout.addWidget(self.settingsTabWidget) + + self.buttonBox = create_accept_reject_button_box(settingsDialog, True) + self.settingsLayout.addWidget(self.buttonBox) + self.retranslateUi(settingsDialog) + QtCore.QMetaObject.connectSlotsByName(settingsDialog) + + def retranslateUi(self, settingsDialog): + settingsDialog.setWindowTitle(translate('OpenLP.SettingsForm', + 'Configure OpenLP')) diff --git a/openlp/core/ui/displaytagtab.py b/openlp/core/ui/displaytagform.py similarity index 98% rename from openlp/core/ui/displaytagtab.py rename to openlp/core/ui/displaytagform.py index 30c593d36..5216fcd61 100644 --- a/openlp/core/ui/displaytagtab.py +++ b/openlp/core/ui/displaytagform.py @@ -33,10 +33,11 @@ import cPickle from PyQt4 import QtCore, QtGui -from openlp.core.lib import SettingsTab, translate, DisplayTags +from openlp.core.lib import translate, DisplayTags from openlp.core.lib.ui import UiStrings, critical_error_message_box +from openlp.core.ui.displaytagdialog import Ui_DisplayTagDialog -class DisplayTagTab(SettingsTab): +class DisplayTagForm(QtGui.QDialog, Ui_DisplayTagDialog): """ The :class:`DisplayTagTab` manages the settings tab . """ @@ -44,7 +45,7 @@ class DisplayTagTab(SettingsTab): """ Initialise the settings tab """ - SettingsTab.__init__(self, u'Display Tags') + #SettingsTab.__init__(self, u'Display Tags') def resizeEvent(self, event=None): pass diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index aedd9cf4f..82d95dd40 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -34,7 +34,7 @@ from openlp.core.lib.ui import UiStrings, base_action, checkable_action, \ icon_action from openlp.core.ui import AboutForm, SettingsForm, ServiceManager, \ ThemeManager, SlideController, PluginForm, MediaDockManager, \ - ShortcutListForm + ShortcutListForm, DisplayTagForm from openlp.core.utils import AppLocation, add_actions, LanguageManager, \ ActionList @@ -242,6 +242,8 @@ class Ui_MainWindow(object): self.SettingsShortcutsItem = icon_action(mainWindow, u'SettingsShortcutsItem', u':/system/system_configure_shortcuts.png') + self.DisplayTagItem = icon_action(mainWindow, + u'DisplayTagItem', u':/system/system_settings.png') self.SettingsConfigureItem = icon_action(mainWindow, u'SettingsConfigureItem', u':/system/system_settings.png') mainWindow.actionList.add_action(self.SettingsShortcutsItem, @@ -277,7 +279,8 @@ class Ui_MainWindow(object): add_actions(self.SettingsLanguageMenu, self.LanguageGroup.actions()) add_actions(self.SettingsMenu, (self.settingsPluginListItem, self.SettingsLanguageMenu.menuAction(), None, - self.SettingsShortcutsItem, self.SettingsConfigureItem)) + self.SettingsShortcutsItem, self.DisplayTagItem, + self.SettingsConfigureItem)) add_actions(self.ToolsMenu, (self.ToolsAddToolItem, None)) add_actions(self.ToolsMenu, (self.ToolsOpenDataFolder, None)) add_actions(self.HelpMenu, (self.HelpDocumentationItem, @@ -361,6 +364,8 @@ class Ui_MainWindow(object): translate('OpenLP.MainWindow', '&Language')) self.SettingsShortcutsItem.setText( translate('OpenLP.MainWindow', 'Configure &Shortcuts...')) + self.DisplayTagItem.setText( + translate('OpenLP.MainWindow', '&Configure Display Tags')) self.SettingsConfigureItem.setText( translate('OpenLP.MainWindow', '&Configure OpenLP...')) self.ViewMediaManagerItem.setText( @@ -476,6 +481,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): self.settingsmanager = SettingsManager(screens) self.aboutForm = AboutForm(self, applicationVersion) self.settingsForm = SettingsForm(self.screens, self, self) + self.displayTagForm = DisplayTagForm() self.shortcutForm = ShortcutListForm(self) self.recentFiles = QtCore.QStringList() # Set up the path with plugins @@ -523,6 +529,8 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): QtCore.SIGNAL(u'triggered()'), self.onToolsOpenDataFolderClicked) QtCore.QObject.connect(self.settingsPluginListItem, QtCore.SIGNAL(u'triggered()'), self.onPluginItemClicked) + QtCore.QObject.connect(self.DisplayTagItem, + QtCore.SIGNAL(u'triggered()'), self.onDisplayTagItemClicked) QtCore.QObject.connect(self.SettingsConfigureItem, QtCore.SIGNAL(u'triggered()'), self.onSettingsConfigureItemClicked) QtCore.QObject.connect(self.SettingsShortcutsItem, @@ -716,6 +724,12 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): path = AppLocation.get_data_path() QtGui.QDesktopServices.openUrl(QtCore.QUrl("file:///" + path)) + def onDisplayTagItemClicked(self): + """ + Show the Settings dialog + """ + self.displayTagForm.exec_() + def onSettingsConfigureItemClicked(self): """ Show the Settings dialog diff --git a/openlp/core/ui/settingsform.py b/openlp/core/ui/settingsform.py index afea928b6..3fd640acd 100644 --- a/openlp/core/ui/settingsform.py +++ b/openlp/core/ui/settingsform.py @@ -47,17 +47,17 @@ class SettingsForm(QtGui.QDialog, Ui_SettingsDialog): QtGui.QDialog.__init__(self, parent) self.setupUi(self) # General tab - self.generalTab = GeneralTab(screens) - self.addTab(u'General', self.generalTab) + generalTab = GeneralTab(screens) + self.addTab(u'General', generalTab) # Themes tab - self.themesTab = ThemesTab(mainWindow) - self.addTab(u'Themes', self.themesTab) + themesTab = ThemesTab(mainWindow) + self.addTab(u'Themes', themesTab) # Advanced tab - self.advancedTab = AdvancedTab() - self.addTab(u'Advanced', self.advancedTab) - # Edit Display Tags tab - self.displayTagTab = DisplayTagTab() - self.addTab(u'Display Tags', self.displayTagTab) + advancedTab = AdvancedTab() + self.addTab(u'Advanced', advancedTab) + ## Edit Display Tags tab + #self.displayTagTab = DisplayTagTab() + #self.addTab(u'Display Tags', self.displayTagTab) def addTab(self, name, tab): """ @@ -71,9 +71,9 @@ class SettingsForm(QtGui.QDialog, Ui_SettingsDialog): Add a tab to the form at a specific location """ log.debug(u'Inserting %s tab' % tab.tabTitle) - # 15 : There are 4 tables currently and locations starts at -10 + # 14 : There are 3 tables currently and locations starts at -10 self.settingsTabWidget.insertTab( - location + 15, tab, tab.tabTitleVisible) + location + 14, tab, tab.tabTitleVisible) def removeTab(self, tab): """ From 264c7fb585547a2d57c0128acddc3681ce54560f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20P=C3=B5ldaru?= Date: Sun, 20 Feb 2011 18:45:58 +0200 Subject: [PATCH 076/123] Handled extensions to log. --- openlp/plugins/media/mediaplugin.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/openlp/plugins/media/mediaplugin.py b/openlp/plugins/media/mediaplugin.py index ee413aa8c..274bce2b4 100644 --- a/openlp/plugins/media/mediaplugin.py +++ b/openlp/plugins/media/mediaplugin.py @@ -62,6 +62,8 @@ class MediaPlugin(Plugin): type = mimetype.split(u'video/') self.video_list, mimetype = self._addToList(self.video_list, type, mimetype) + log.info(u'MediaPlugin handles audio extensions: %s', self.audio_list) + log.info(u'MediaPlugin handles video extensions: %s', self.video_list) def _addToList(self, list, value, mimetype): # Is it a media type From 338efdc54372f3cb803dbc8eefc8f71efa9aee5f Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sun, 20 Feb 2011 17:06:58 +0000 Subject: [PATCH 077/123] DisplayTag Updates --- openlp/core/ui/displaytagdialog.py | 245 ++++++++++++++++-- openlp/core/ui/displaytagform.py | 155 ++--------- openlp/core/ui/mainwindow.py | 2 +- ...aytabeditdialog.ui => displaytabdialog.ui} | 56 ++-- 4 files changed, 287 insertions(+), 171 deletions(-) rename resources/forms/{displaytabeditdialog.ui => displaytabdialog.ui} (86%) diff --git a/openlp/core/ui/displaytagdialog.py b/openlp/core/ui/displaytagdialog.py index f7d4b5175..3e76b39d2 100644 --- a/openlp/core/ui/displaytagdialog.py +++ b/openlp/core/ui/displaytagdialog.py @@ -27,25 +27,234 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import translate, build_icon -from openlp.core.lib.ui import create_accept_reject_button_box +from openlp.core.lib.ui import UiStrings, create_accept_reject_button_box + +try: + _fromUtf8 = QtCore.QString.fromUtf8 +except AttributeError: + _fromUtf8 = lambda s: s class Ui_DisplayTagDialog(object): - def setupUi(self, settingsDialog): - settingsDialog.setObjectName(u'settingsDialog') - settingsDialog.resize(700, 500) - settingsDialog.setWindowIcon( - build_icon(u':/system/system_settings.png')) - self.settingsLayout = QtGui.QVBoxLayout(settingsDialog) - self.settingsLayout.setObjectName(u'settingsLayout') - self.settingsTabWidget = QtGui.QTabWidget(settingsDialog) - self.settingsTabWidget.setObjectName(u'settingsTabWidget') - self.settingsLayout.addWidget(self.settingsTabWidget) - self.buttonBox = create_accept_reject_button_box(settingsDialog, True) - self.settingsLayout.addWidget(self.buttonBox) - self.retranslateUi(settingsDialog) - QtCore.QMetaObject.connectSlotsByName(settingsDialog) + def setupUi(self, displayTagDialog): +# displayTagDialog.setObjectName(u'displayTagDialog') +# displayTagDialog.resize(700, 500) +# displayTagDialog.setWindowIcon( +# build_icon(u':/system/system_settings.png')) +# self.settingsLayout = QtGui.QVBoxLayout(displayTagDialog) +# self.settingsLayout.setObjectName(u'settingsLayout') +# self.editGroupBox = QtGui.QGroupBox(displayTagDialog) +# self.editGroupBox.setGeometry(QtCore.QRect(10, 220, 650, 181)) +# self.editGroupBox.setObjectName(u'editGroupBox') +# self.updatePushButton = QtGui.QPushButton(self.editGroupBox) +# self.updatePushButton.setGeometry(QtCore.QRect(550, 140, 71, 26)) +# self.updatePushButton.setObjectName(u'updatePushButton') +# self.layoutWidget = QtGui.QWidget(self.editGroupBox) +# self.layoutWidget.setGeometry(QtCore.QRect(5, 20, 571, 114)) +# self.layoutWidget.setObjectName(u'layoutWidget') +# self.formLayout = QtGui.QFormLayout(self.layoutWidget) +# self.formLayout.setObjectName(u'formLayout') +# self.descriptionLabel = QtGui.QLabel(self.layoutWidget) +# self.descriptionLabel.setAlignment(QtCore.Qt.AlignCenter) +# self.descriptionLabel.setObjectName(u'descriptionLabel') +# self.formLayout.setWidget(0, QtGui.QFormLayout.LabelRole, +# self.descriptionLabel) +# self.descriptionLineEdit = QtGui.QLineEdit(self.layoutWidget) +# self.descriptionLineEdit.setObjectName(u'descriptionLineEdit') +# self.formLayout.setWidget(0, QtGui.QFormLayout.FieldRole, +# self.descriptionLineEdit) +# self.tagLabel = QtGui.QLabel(self.layoutWidget) +# self.tagLabel.setAlignment(QtCore.Qt.AlignCenter) +# self.tagLabel.setObjectName(u'tagLabel') +# self.formLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.tagLabel) +# self.tagLineEdit = QtGui.QLineEdit(self.layoutWidget) +# self.tagLineEdit.setMaximumSize(QtCore.QSize(50, 16777215)) +# self.tagLineEdit.setMaxLength(5) +# self.tagLineEdit.setObjectName(u'tagLineEdit') +# self.formLayout.setWidget(1, QtGui.QFormLayout.FieldRole, +# self.tagLineEdit) +# self.startTagLabel = QtGui.QLabel(self.layoutWidget) +# self.startTagLabel.setAlignment(QtCore.Qt.AlignCenter) +# self.startTagLabel.setObjectName(u'startTagLabel') +# self.formLayout.setWidget(2, QtGui.QFormLayout.LabelRole, +# self.startTagLabel) +# self.startTagLineEdit = QtGui.QLineEdit(self.layoutWidget) +# self.startTagLineEdit.setObjectName(u'startTagLineEdit') +# self.formLayout.setWidget(2, QtGui.QFormLayout.FieldRole, +# self.startTagLineEdit) +# self.endTagLabel = QtGui.QLabel(self.layoutWidget) +# self.endTagLabel.setAlignment(QtCore.Qt.AlignCenter) +# self.endTagLabel.setObjectName(u'endTagLabel') +# self.formLayout.setWidget(3, QtGui.QFormLayout.LabelRole, +# self.endTagLabel) +# self.endTagLineEdit = QtGui.QLineEdit(self.layoutWidget) +# self.endTagLineEdit.setObjectName(u'endTagLineEdit') +# self.formLayout.setWidget(3, QtGui.QFormLayout.FieldRole, +# self.endTagLineEdit) +# self.defaultPushButton = QtGui.QPushButton(displayTagDialog) +# self.defaultPushButton.setGeometry(QtCore.QRect(430, 188, 71, 26)) +# self.defaultPushButton.setObjectName(u'updatePushButton') +# self.deletePushButton = QtGui.QPushButton(displayTagDialog) +# self.deletePushButton.setGeometry(QtCore.QRect(510, 188, 71, 26)) +# self.deletePushButton.setObjectName(u'deletePushButton') +# self.newPushButton = QtGui.QPushButton(displayTagDialog) +# self.newPushButton.setGeometry(QtCore.QRect(600, 188, 71, 26)) +# self.newPushButton.setObjectName(u'newPushButton') +# self.tagTableWidget = QtGui.QTableWidget(displayTagDialog) +# self.tagTableWidget.setGeometry(QtCore.QRect(10, 10, 650, 171)) +# self.tagTableWidget.setHorizontalScrollBarPolicy( +# QtCore.Qt.ScrollBarAlwaysOff) +# self.tagTableWidget.setEditTriggers( +# QtGui.QAbstractItemView.NoEditTriggers) +# self.tagTableWidget.setAlternatingRowColors(True) +# self.tagTableWidget.setSelectionMode( +# QtGui.QAbstractItemView.SingleSelection) +# self.tagTableWidget.setSelectionBehavior( +# QtGui.QAbstractItemView.SelectRows) +# self.tagTableWidget.setCornerButtonEnabled(False) +# self.tagTableWidget.setObjectName(u'tagTableWidget') +# self.tagTableWidget.setColumnCount(4) +# self.tagTableWidget.setRowCount(0) +# item = QtGui.QTableWidgetItem() +# self.tagTableWidget.setHorizontalHeaderItem(0, item) +# item = QtGui.QTableWidgetItem() +# self.tagTableWidget.setHorizontalHeaderItem(1, item) +# item = QtGui.QTableWidgetItem() +# self.tagTableWidget.setHorizontalHeaderItem(2, item) +# item = QtGui.QTableWidgetItem() +# self.tagTableWidget.setHorizontalHeaderItem(3, item) +# +# self.buttonBox = create_accept_reject_button_box(displayTagDialog, True) +# self.settingsLayout.addWidget(self.buttonBox) +# self.retranslateUi(displayTagDialog) +# QtCore.QMetaObject.connectSlotsByName(displayTagDialog) + displayTagDialog.setObjectName(_fromUtf8("displayTagDialog")) + displayTagDialog.resize(717, 554) + self.editGroupBox = QtGui.QGroupBox(displayTagDialog) + self.editGroupBox.setGeometry(QtCore.QRect(10, 320, 691, 181)) + self.editGroupBox.setObjectName(_fromUtf8("editGroupBox")) + self.updatePushButton = QtGui.QPushButton(self.editGroupBox) + self.updatePushButton.setGeometry(QtCore.QRect(600, 140, 73, 26)) + self.updatePushButton.setObjectName(_fromUtf8("updatePushButton")) + self.layoutWidget = QtGui.QWidget(self.editGroupBox) + self.layoutWidget.setGeometry(QtCore.QRect(20, 50, 571, 114)) + self.layoutWidget.setObjectName(_fromUtf8("layoutWidget")) + self.formLayout = QtGui.QFormLayout(self.layoutWidget) + self.formLayout.setMargin(0) + self.formLayout.setObjectName(_fromUtf8("formLayout")) + self.descriptionLabel = QtGui.QLabel(self.layoutWidget) + self.descriptionLabel.setAlignment(QtCore.Qt.AlignCenter) + self.descriptionLabel.setObjectName(_fromUtf8("descriptionLabel")) + self.formLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.descriptionLabel) + self.descriptionLineEdit = QtGui.QLineEdit(self.layoutWidget) + self.descriptionLineEdit.setObjectName(_fromUtf8("descriptionLineEdit")) + self.formLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.descriptionLineEdit) + self.tagLabel = QtGui.QLabel(self.layoutWidget) + self.tagLabel.setAlignment(QtCore.Qt.AlignCenter) + self.tagLabel.setObjectName(_fromUtf8("tagLabel")) + self.formLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.tagLabel) + self.tagLineEdit = QtGui.QLineEdit(self.layoutWidget) + self.tagLineEdit.setMaximumSize(QtCore.QSize(50, 16777215)) + self.tagLineEdit.setMaxLength(5) + self.tagLineEdit.setObjectName(_fromUtf8("tagLineEdit")) + self.formLayout.setWidget(1, QtGui.QFormLayout.FieldRole, self.tagLineEdit) + self.startTagLabel = QtGui.QLabel(self.layoutWidget) + self.startTagLabel.setAlignment(QtCore.Qt.AlignCenter) + self.startTagLabel.setObjectName(_fromUtf8("startTagLabel")) + self.formLayout.setWidget(2, QtGui.QFormLayout.LabelRole, self.startTagLabel) + self.startTagLineEdit = QtGui.QLineEdit(self.layoutWidget) + self.startTagLineEdit.setObjectName(_fromUtf8("startTagLineEdit")) + self.formLayout.setWidget(2, QtGui.QFormLayout.FieldRole, self.startTagLineEdit) + self.endTagLabel = QtGui.QLabel(self.layoutWidget) + self.endTagLabel.setAlignment(QtCore.Qt.AlignCenter) + self.endTagLabel.setObjectName(_fromUtf8("endTagLabel")) + self.formLayout.setWidget(3, QtGui.QFormLayout.LabelRole, self.endTagLabel) + self.endTagLineEdit = QtGui.QLineEdit(self.layoutWidget) + self.endTagLineEdit.setObjectName(_fromUtf8("endTagLineEdit")) + self.formLayout.setWidget(3, QtGui.QFormLayout.FieldRole, self.endTagLineEdit) + self.addPushButton = QtGui.QPushButton(self.editGroupBox) + self.addPushButton.setGeometry(QtCore.QRect(600, 40, 71, 26)) + self.addPushButton.setObjectName(_fromUtf8("addPushButton")) + self.newPushButton = QtGui.QPushButton(self.editGroupBox) + self.newPushButton.setGeometry(QtCore.QRect(600, 70, 71, 26)) + self.newPushButton.setObjectName(_fromUtf8("newPushButton")) + self.buttonBox = QtGui.QDialogButtonBox(displayTagDialog) + self.buttonBox.setGeometry(QtCore.QRect(540, 510, 162, 26)) + self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Save) + self.buttonBox.setObjectName(_fromUtf8("buttonBox")) + self.deletePushButton = QtGui.QPushButton(displayTagDialog) + self.deletePushButton.setGeometry(QtCore.QRect(630, 280, 71, 26)) + self.deletePushButton.setObjectName(_fromUtf8("deletePushButton")) + self.tagTableWidget = QtGui.QTableWidget(displayTagDialog) + self.tagTableWidget.setGeometry(QtCore.QRect(10, 10, 691, 271)) + self.tagTableWidget.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff) + self.tagTableWidget.setEditTriggers(QtGui.QAbstractItemView.NoEditTriggers) + self.tagTableWidget.setAlternatingRowColors(True) + self.tagTableWidget.setSelectionMode(QtGui.QAbstractItemView.SingleSelection) + self.tagTableWidget.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows) + self.tagTableWidget.setCornerButtonEnabled(False) + self.tagTableWidget.setObjectName(_fromUtf8("tagTableWidget")) + self.tagTableWidget.setColumnCount(4) + self.tagTableWidget.setRowCount(0) + item = QtGui.QTableWidgetItem() + self.tagTableWidget.setHorizontalHeaderItem(0, item) + item = QtGui.QTableWidgetItem() + self.tagTableWidget.setHorizontalHeaderItem(1, item) + item = QtGui.QTableWidgetItem() + self.tagTableWidget.setHorizontalHeaderItem(2, item) + item = QtGui.QTableWidgetItem() + self.tagTableWidget.setHorizontalHeaderItem(3, item) + self.defaultPushButton = QtGui.QPushButton(displayTagDialog) + self.defaultPushButton.setGeometry(QtCore.QRect(550, 280, 71, 26)) + self.defaultPushButton.setObjectName(_fromUtf8("defaultPushButton")) + + self.retranslateUi(displayTagDialog) + QtCore.QMetaObject.connectSlotsByName(displayTagDialog) + + def retranslateUi(self, displayTagDialog): + displayTagDialog.setWindowTitle(translate('OpenLP.displayTagForm', + 'Configure Display Tags')) + self.editGroupBox.setTitle( + translate('OpenLP.DisplayTagTab', 'Edit Selection')) + self.updatePushButton.setText( + translate('OpenLP.DisplayTagTab', 'Update')) + self.descriptionLabel.setText( + translate('OpenLP.DisplayTagTab', 'Description')) + self.tagLabel.setText(translate('OpenLP.DisplayTagTab', 'Tag')) + self.startTagLabel.setText( + translate('OpenLP.DisplayTagTab', 'Start tag')) + self.endTagLabel.setText(translate('OpenLP.DisplayTagTab', 'End tag')) + self.deletePushButton.setText(UiStrings.Delete) + self.defaultPushButton.setText( + translate('OpenLP.DisplayTagTab', 'Default')) + self.newPushButton.setText(UiStrings.New) + self.tagTableWidget.horizontalHeaderItem(0)\ + .setText(translate('OpenLP.DisplayTagTab', 'Description')) + self.tagTableWidget.horizontalHeaderItem(1)\ + .setText(translate('OpenLP.DisplayTagTab', 'Tag id')) + self.tagTableWidget.horizontalHeaderItem(2)\ + .setText(translate('OpenLP.DisplayTagTab', 'Start Html')) + self.tagTableWidget.horizontalHeaderItem(3)\ + .setText(translate('OpenLP.DisplayTagTab', 'End Html')) + self.tagTableWidget.setColumnWidth(0, 120) + self.tagTableWidget.setColumnWidth(1, 40) + self.tagTableWidget.setColumnWidth(2, 240) + self.tagTableWidget.setColumnWidth(3, 200) + + displayTagDialog.setWindowTitle(QtGui.QApplication.translate("displayTagDialog", "Form", None, QtGui.QApplication.UnicodeUTF8)) + self.editGroupBox.setTitle(QtGui.QApplication.translate("displayTagDialog", "Edit Selection", None, QtGui.QApplication.UnicodeUTF8)) + self.updatePushButton.setText(QtGui.QApplication.translate("displayTagDialog", "Update", None, QtGui.QApplication.UnicodeUTF8)) + self.descriptionLabel.setText(QtGui.QApplication.translate("displayTagDialog", "Description", None, QtGui.QApplication.UnicodeUTF8)) + self.tagLabel.setText(QtGui.QApplication.translate("displayTagDialog", "Tag", None, QtGui.QApplication.UnicodeUTF8)) + self.startTagLabel.setText(QtGui.QApplication.translate("displayTagDialog", "Start tag", None, QtGui.QApplication.UnicodeUTF8)) + self.endTagLabel.setText(QtGui.QApplication.translate("displayTagDialog", "End tag", None, QtGui.QApplication.UnicodeUTF8)) + self.addPushButton.setText(QtGui.QApplication.translate("displayTagDialog", "Add", None, QtGui.QApplication.UnicodeUTF8)) + self.newPushButton.setText(QtGui.QApplication.translate("displayTagDialog", "New", None, QtGui.QApplication.UnicodeUTF8)) + self.deletePushButton.setText(QtGui.QApplication.translate("displayTagDialog", "Delete", None, QtGui.QApplication.UnicodeUTF8)) + self.tagTableWidget.horizontalHeaderItem(0).setText(QtGui.QApplication.translate("displayTagDialog", "Description", None, QtGui.QApplication.UnicodeUTF8)) + self.tagTableWidget.horizontalHeaderItem(1).setText(QtGui.QApplication.translate("displayTagDialog", "Key", None, QtGui.QApplication.UnicodeUTF8)) + self.tagTableWidget.horizontalHeaderItem(2).setText(QtGui.QApplication.translate("displayTagDialog", "Start Tag", None, QtGui.QApplication.UnicodeUTF8)) + self.tagTableWidget.horizontalHeaderItem(3).setText(QtGui.QApplication.translate("displayTagDialog", "End Tag", None, QtGui.QApplication.UnicodeUTF8)) + self.defaultPushButton.setText(QtGui.QApplication.translate("displayTagDialog", "Default", None, QtGui.QApplication.UnicodeUTF8)) + - def retranslateUi(self, settingsDialog): - settingsDialog.setWindowTitle(translate('OpenLP.SettingsForm', - 'Configure OpenLP')) diff --git a/openlp/core/ui/displaytagform.py b/openlp/core/ui/displaytagform.py index 5216fcd61..491c60693 100644 --- a/openlp/core/ui/displaytagform.py +++ b/openlp/core/ui/displaytagform.py @@ -41,18 +41,26 @@ class DisplayTagForm(QtGui.QDialog, Ui_DisplayTagDialog): """ The :class:`DisplayTagTab` manages the settings tab . """ - def __init__(self): + def __init__(self, parent): """ - Initialise the settings tab + Constructor """ - #SettingsTab.__init__(self, u'Display Tags') + QtGui.QDialog.__init__(self, parent) + self.setupUi(self) + QtCore.QObject.connect(self.tagTableWidget, + QtCore.SIGNAL(u'clicked(QModelIndex)'), self.onRowSelected) + QtCore.QObject.connect(self.defaultPushButton, + QtCore.SIGNAL(u'pressed()'), self.onDefaultPushed) + QtCore.QObject.connect(self.newPushButton, + QtCore.SIGNAL(u'pressed()'), self.onNewPushed) + QtCore.QObject.connect(self.updatePushButton, + QtCore.SIGNAL(u'pressed()'), self.onUpdatePushed) + QtCore.QObject.connect(self.deletePushButton, + QtCore.SIGNAL(u'pressed()'), self.onDeletePushed) - def resizeEvent(self, event=None): - pass - - def preLoad(self): + def exec_(self): """ - Initialise values before the Load takes place + Load Display and set field state. """ # Create initial copy from master DisplayTags.reset_html_tags() @@ -66,137 +74,10 @@ class DisplayTagForm(QtGui.QDialog, Ui_DisplayTagDialog): for t in user_tags: DisplayTags.add_html_tag(t) self.selected = -1 - - def setupUi(self): - """ - Configure the UI elements for the tab. - """ - self.setObjectName(u'DisplayTagTab') - self.tabTitleVisible = \ - translate(u'OpenLP.DisplayTagTab', 'Display Tags') - self.displayTagEdit = QtGui.QWidget(self) - self.editGroupBox = QtGui.QGroupBox(self.displayTagEdit) - self.editGroupBox.setGeometry(QtCore.QRect(10, 220, 650, 181)) - self.editGroupBox.setObjectName(u'editGroupBox') - self.updatePushButton = QtGui.QPushButton(self.editGroupBox) - self.updatePushButton.setGeometry(QtCore.QRect(550, 140, 71, 26)) - self.updatePushButton.setObjectName(u'updatePushButton') - self.layoutWidget = QtGui.QWidget(self.editGroupBox) - self.layoutWidget.setGeometry(QtCore.QRect(5, 20, 571, 114)) - self.layoutWidget.setObjectName(u'layoutWidget') - self.formLayout = QtGui.QFormLayout(self.layoutWidget) - self.formLayout.setObjectName(u'formLayout') - self.descriptionLabel = QtGui.QLabel(self.layoutWidget) - self.descriptionLabel.setAlignment(QtCore.Qt.AlignCenter) - self.descriptionLabel.setObjectName(u'descriptionLabel') - self.formLayout.setWidget(0, QtGui.QFormLayout.LabelRole, - self.descriptionLabel) - self.descriptionLineEdit = QtGui.QLineEdit(self.layoutWidget) - self.descriptionLineEdit.setObjectName(u'descriptionLineEdit') - self.formLayout.setWidget(0, QtGui.QFormLayout.FieldRole, - self.descriptionLineEdit) - self.tagLabel = QtGui.QLabel(self.layoutWidget) - self.tagLabel.setAlignment(QtCore.Qt.AlignCenter) - self.tagLabel.setObjectName(u'tagLabel') - self.formLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.tagLabel) - self.tagLineEdit = QtGui.QLineEdit(self.layoutWidget) - self.tagLineEdit.setMaximumSize(QtCore.QSize(50, 16777215)) - self.tagLineEdit.setMaxLength(5) - self.tagLineEdit.setObjectName(u'tagLineEdit') - self.formLayout.setWidget(1, QtGui.QFormLayout.FieldRole, - self.tagLineEdit) - self.startTagLabel = QtGui.QLabel(self.layoutWidget) - self.startTagLabel.setAlignment(QtCore.Qt.AlignCenter) - self.startTagLabel.setObjectName(u'startTagLabel') - self.formLayout.setWidget(2, QtGui.QFormLayout.LabelRole, - self.startTagLabel) - self.startTagLineEdit = QtGui.QLineEdit(self.layoutWidget) - self.startTagLineEdit.setObjectName(u'startTagLineEdit') - self.formLayout.setWidget(2, QtGui.QFormLayout.FieldRole, - self.startTagLineEdit) - self.endTagLabel = QtGui.QLabel(self.layoutWidget) - self.endTagLabel.setAlignment(QtCore.Qt.AlignCenter) - self.endTagLabel.setObjectName(u'endTagLabel') - self.formLayout.setWidget(3, QtGui.QFormLayout.LabelRole, - self.endTagLabel) - self.endTagLineEdit = QtGui.QLineEdit(self.layoutWidget) - self.endTagLineEdit.setObjectName(u'endTagLineEdit') - self.formLayout.setWidget(3, QtGui.QFormLayout.FieldRole, - self.endTagLineEdit) - self.defaultPushButton = QtGui.QPushButton(self.displayTagEdit) - self.defaultPushButton.setGeometry(QtCore.QRect(430, 188, 71, 26)) - self.defaultPushButton.setObjectName(u'updatePushButton') - self.deletePushButton = QtGui.QPushButton(self.displayTagEdit) - self.deletePushButton.setGeometry(QtCore.QRect(510, 188, 71, 26)) - self.deletePushButton.setObjectName(u'deletePushButton') - self.newPushButton = QtGui.QPushButton(self.displayTagEdit) - self.newPushButton.setGeometry(QtCore.QRect(600, 188, 71, 26)) - self.newPushButton.setObjectName(u'newPushButton') - self.tagTableWidget = QtGui.QTableWidget(self.displayTagEdit) - self.tagTableWidget.setGeometry(QtCore.QRect(10, 10, 650, 171)) - self.tagTableWidget.setHorizontalScrollBarPolicy( - QtCore.Qt.ScrollBarAlwaysOff) - self.tagTableWidget.setEditTriggers( - QtGui.QAbstractItemView.NoEditTriggers) - self.tagTableWidget.setAlternatingRowColors(True) - self.tagTableWidget.setSelectionMode( - QtGui.QAbstractItemView.SingleSelection) - self.tagTableWidget.setSelectionBehavior( - QtGui.QAbstractItemView.SelectRows) - self.tagTableWidget.setCornerButtonEnabled(False) - self.tagTableWidget.setObjectName(u'tagTableWidget') - self.tagTableWidget.setColumnCount(4) - self.tagTableWidget.setRowCount(0) - item = QtGui.QTableWidgetItem() - self.tagTableWidget.setHorizontalHeaderItem(0, item) - item = QtGui.QTableWidgetItem() - self.tagTableWidget.setHorizontalHeaderItem(1, item) - item = QtGui.QTableWidgetItem() - self.tagTableWidget.setHorizontalHeaderItem(2, item) - item = QtGui.QTableWidgetItem() - self.tagTableWidget.setHorizontalHeaderItem(3, item) - self.editGroupBox.setTitle( - translate('OpenLP.DisplayTagTab', 'Edit Selection')) - self.updatePushButton.setText( - translate('OpenLP.DisplayTagTab', 'Update')) - self.descriptionLabel.setText( - translate('OpenLP.DisplayTagTab', 'Description')) - self.tagLabel.setText(translate('OpenLP.DisplayTagTab', 'Tag')) - self.startTagLabel.setText( - translate('OpenLP.DisplayTagTab', 'Start tag')) - self.endTagLabel.setText(translate('OpenLP.DisplayTagTab', 'End tag')) - self.deletePushButton.setText(UiStrings.Delete) - self.defaultPushButton.setText( - translate('OpenLP.DisplayTagTab', 'Default')) - self.newPushButton.setText(UiStrings.New) - self.tagTableWidget.horizontalHeaderItem(0)\ - .setText(translate('OpenLP.DisplayTagTab', 'Description')) - self.tagTableWidget.horizontalHeaderItem(1)\ - .setText(translate('OpenLP.DisplayTagTab', 'Tag id')) - self.tagTableWidget.horizontalHeaderItem(2)\ - .setText(translate('OpenLP.DisplayTagTab', 'Start Html')) - self.tagTableWidget.horizontalHeaderItem(3)\ - .setText(translate('OpenLP.DisplayTagTab', 'End Html')) - QtCore.QMetaObject.connectSlotsByName(self.displayTagEdit) - self.tagTableWidget.setColumnWidth(0, 120) - self.tagTableWidget.setColumnWidth(1, 40) - self.tagTableWidget.setColumnWidth(2, 240) - self.tagTableWidget.setColumnWidth(3, 200) - QtCore.QObject.connect(self.tagTableWidget, - QtCore.SIGNAL(u'clicked(QModelIndex)'), self.onRowSelected) - QtCore.QObject.connect(self.defaultPushButton, - QtCore.SIGNAL(u'pressed()'), self.onDefaultPushed) - QtCore.QObject.connect(self.newPushButton, - QtCore.SIGNAL(u'pressed()'), self.onNewPushed) - QtCore.QObject.connect(self.updatePushButton, - QtCore.SIGNAL(u'pressed()'), self.onUpdatePushed) - QtCore.QObject.connect(self.deletePushButton, - QtCore.SIGNAL(u'pressed()'), self.onDeletePushed) + self.load() + return QtGui.QDialog.exec_(self) def load(self): - """ - Load Display and set field state. - """ self.newPushButton.setEnabled(True) self.updatePushButton.setEnabled(False) self.deletePushButton.setEnabled(False) diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index 82d95dd40..f899a23ce 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -481,7 +481,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): self.settingsmanager = SettingsManager(screens) self.aboutForm = AboutForm(self, applicationVersion) self.settingsForm = SettingsForm(self.screens, self, self) - self.displayTagForm = DisplayTagForm() + self.displayTagForm = DisplayTagForm(self) self.shortcutForm = ShortcutListForm(self) self.recentFiles = QtCore.QStringList() # Set up the path with plugins diff --git a/resources/forms/displaytabeditdialog.ui b/resources/forms/displaytabdialog.ui similarity index 86% rename from resources/forms/displaytabeditdialog.ui rename to resources/forms/displaytabdialog.ui index 3c748594f..2e9c09c01 100644 --- a/resources/forms/displaytabeditdialog.ui +++ b/resources/forms/displaytabdialog.ui @@ -112,6 +112,32 @@ + + + + 600 + 40 + 71 + 26 + + + + Add + + + + + + 600 + 70 + 71 + 26 + + + + New + + @@ -123,13 +149,13 @@ - QDialogButtonBox::Cancel|QDialogButtonBox::Ok + QDialogButtonBox::Cancel|QDialogButtonBox::Save - 530 + 630 280 71 26 @@ -139,19 +165,6 @@ Delete - - - - 610 - 280 - 71 - 26 - - - - Add - - @@ -203,6 +216,19 @@ + + + + 550 + 280 + 71 + 26 + + + + Default + + From 54f42cb52b88615379b08ae228fdbbf873f0df12 Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Sun, 20 Feb 2011 18:34:57 +0100 Subject: [PATCH 078/123] added new property, replaced try --- openlp/plugins/songs/lib/songbeamerimport.py | 2 + openlp/plugins/songs/lib/xml.py | 41 +++++++------------- 2 files changed, 15 insertions(+), 28 deletions(-) diff --git a/openlp/plugins/songs/lib/songbeamerimport.py b/openlp/plugins/songs/lib/songbeamerimport.py index 2adfb30b2..afb9f5646 100644 --- a/openlp/plugins/songs/lib/songbeamerimport.py +++ b/openlp/plugins/songs/lib/songbeamerimport.py @@ -245,6 +245,8 @@ class SongBeamerImport(SongImport): self.song_number = u'' elif tag_val[0] == u'#Speed': pass + elif tag_val[0] == u'Tempo': + pass elif tag_val[0] == u'#TextAlign': pass elif tag_val[0] == u'#Title': diff --git a/openlp/plugins/songs/lib/xml.py b/openlp/plugins/songs/lib/xml.py index 231080831..a552a42a1 100644 --- a/openlp/plugins/songs/lib/xml.py +++ b/openlp/plugins/songs/lib/xml.py @@ -299,9 +299,9 @@ class OpenLyrics(object): # Remove chords from xml. xml = re.compile(u'').sub(u'', xml) song_xml = objectify.fromstring(xml) - try: + if hasattr(song_xml, u'properties'): properties = song_xml.properties - except AttributeError: + else: return None song = Song() self._process_copyright(properties, song) @@ -369,13 +369,11 @@ class OpenLyrics(object): The song object. """ authors = [] - try: + if hasattr(properties, u'authors'): for author in properties.authors.author: display_name = self._text(author) if display_name: authors.append(display_name) - except AttributeError: - pass if not authors: authors.append(SongStrings.AuthorUnknownUnT) for display_name in authors: @@ -399,10 +397,8 @@ class OpenLyrics(object): ``song`` The song object. """ - try: + if hasattr(properties, u'ccliNo'): song.ccli_number = self._text(properties.ccliNo) - except AttributeError: - song.ccli_number = u'' def _process_comments(self, properties, song): """ @@ -414,15 +410,13 @@ class OpenLyrics(object): ``song`` The song object. """ - try: - comments_list = [] + if hasattr(properties, u'comments'): + comments_list = [] for comment in properties.comments.comment: commenttext = self._text(comment) if commenttext: comments_list.append(commenttext) song.comments = u'\n'.join(comments_list) - except AttributeError: - song.comments = u'' def _process_copyright(self, properties, song): """ @@ -434,10 +428,8 @@ class OpenLyrics(object): ``song`` The song object. """ - try: + if hasattr(properties, u'copyright'): song.copyright = self._text(properties.copyright) - except AttributeError: - song.copyright = u'' def _process_lyrics(self, properties, lyrics, song): """ @@ -478,9 +470,9 @@ class OpenLyrics(object): song.search_lyrics = search_text.lower() song.lyrics = unicode(sxml.extract_xml(), u'utf-8') # Process verse order - try: + if hasattr(properties, u'verseOrder'): song.verse_order = self._text(properties.verseOrder) - except AttributeError: + else: # We have to process the temp_verse_order, as the verseOrder # property is not present. previous_type = u'' @@ -511,7 +503,7 @@ class OpenLyrics(object): """ song.song_book_id = 0 song.song_number = u'' - try: + if hasattr(properties, u'songbooks'): for songbook in properties.songbooks.songbook: bookname = self._get(songbook, u'name') if bookname: @@ -522,15 +514,10 @@ class OpenLyrics(object): book = Book.populate(name=bookname, publisher=u'') self.manager.save_object(book) song.song_book_id = book.id - try: - if self._get(songbook, u'entry'): - song.song_number = self._get(songbook, u'entry') - except AttributeError: - pass + if hasattr(songbook, u'entry'): + song.song_number = self._get(songbook, u'entry') # We only support one song book, so take the first one. break - except AttributeError: - pass def _process_titles(self, properties, song): """ @@ -563,7 +550,7 @@ class OpenLyrics(object): ``song`` The song object. """ - try: + if hasattr(properties, u'themes'): for topictext in properties.themes.theme: topictext = self._text(topictext) if topictext: @@ -574,8 +561,6 @@ class OpenLyrics(object): topic = Topic.populate(name=topictext) self.manager.save_object(topic) song.topics.append(topic) - except AttributeError: - pass def _dump_xml(self, xml): """ From 72dd290d6b5d1f34ce50890b62be5de4bf866f9c Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Sun, 20 Feb 2011 18:52:22 +0100 Subject: [PATCH 079/123] fixed enumeration --- openlp/plugins/songs/lib/mediaitem.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openlp/plugins/songs/lib/mediaitem.py b/openlp/plugins/songs/lib/mediaitem.py index 0f3e97926..1df63d0b5 100644 --- a/openlp/plugins/songs/lib/mediaitem.py +++ b/openlp/plugins/songs/lib/mediaitem.py @@ -254,9 +254,9 @@ class SongMediaItem(MediaManagerItem): """ if self.searchAsYouType: search_length = 1 - if self.searchTextEdit.currentSearchType() == 1: + if self.searchTextEdit.currentSearchType() == SongSearch.Entire: search_length = 3 - elif self.searchTextEdit.currentSearchType() == 3: + elif self.searchTextEdit.currentSearchType() == SongSearch.Lyrics: search_length = 7 if len(text) > search_length: self.onSearchTextButtonClick() From 31247240d022933990f43b738477b23481a6d292 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20P=C3=B5ldaru?= Date: Sun, 20 Feb 2011 20:12:55 +0200 Subject: [PATCH 080/123] fix possible leaving out of extensions, hopefully neater approach --- openlp/plugins/media/lib/mediaitem.py | 5 ++-- openlp/plugins/media/mediaplugin.py | 43 ++++++++++----------------- 2 files changed, 19 insertions(+), 29 deletions(-) diff --git a/openlp/plugins/media/lib/mediaitem.py b/openlp/plugins/media/lib/mediaitem.py index fd98cdefa..9f3f98636 100644 --- a/openlp/plugins/media/lib/mediaitem.py +++ b/openlp/plugins/media/lib/mediaitem.py @@ -60,8 +60,9 @@ class MediaMediaItem(MediaManagerItem): def retranslateUi(self): self.onNewPrompt = translate('MediaPlugin.MediaItem', 'Select Media') self.onNewFileMasks = unicode(translate('MediaPlugin.MediaItem', - 'Videos (%s);;Audio (%s);;%s (*)')) % (self.parent.video_list, - self.parent.audio_list, UiStrings.AllFiles) + 'Videos (%s);;Audio (%s);;%s (*)')) % ( + u' '.join(self.parent.video_list), + u' '.join(self.parent.audio_list), UiStrings.AllFiles) self.replaceAction.setText(UiStrings.ReplaceBG) self.replaceAction.setToolTip(UiStrings.ReplaceLiveBG) self.resetAction.setText(UiStrings.ResetBG) diff --git a/openlp/plugins/media/mediaplugin.py b/openlp/plugins/media/mediaplugin.py index 274bce2b4..1f6284d61 100644 --- a/openlp/plugins/media/mediaplugin.py +++ b/openlp/plugins/media/mediaplugin.py @@ -45,38 +45,27 @@ class MediaPlugin(Plugin): self.icon = build_icon(self.icon_path) # passed with drag and drop messages self.dnd_id = u'Media' - self.audio_list = u'' - self.video_list = u'' + self.audio_list = [] + self.video_list = [] mimetypes.init() for mimetype in Phonon.BackendCapabilities.availableMimeTypes(): mimetype = unicode(mimetype) - type = mimetype.split(u'audio/x-') - self.audio_list, mimetype = self._addToList(self.audio_list, - type, mimetype) - type = mimetype.split(u'audio/') - self.audio_list, mimetype = self._addToList(self.audio_list, - type, mimetype) - type = mimetype.split(u'video/x-') - self.video_list, mimetype = self._addToList(self.video_list, - type, mimetype) - type = mimetype.split(u'video/') - self.video_list, mimetype = self._addToList(self.video_list, - type, mimetype) - log.info(u'MediaPlugin handles audio extensions: %s', self.audio_list) - log.info(u'MediaPlugin handles video extensions: %s', self.video_list) + if mimetype.startswith(u'audio/'): + self._addToList(self.audio_list, mimetype) + elif mimetype.startswith(u'video/'): + self._addToList(self.video_list, mimetype) + log.info(u'MediaPlugin handles audio extensions: %s', + u' '.join(self.audio_list)) + log.info(u'MediaPlugin handles video extensions: %s', + u' '.join(self.video_list)) - def _addToList(self, list, value, mimetype): + def _addToList(self, list, mimetype): # Is it a media type - if len(value) == 2: - extensions = mimetypes.guess_all_extensions(unicode(mimetype)) - # we have an extension - if extensions: - for extension in extensions: - if list.find(extension) == -1: - list += u'*%s ' % extension - self.serviceManager.supportedSuffixes(extension[1:]) - mimetype = u'' - return list, mimetype + extensions = mimetypes.guess_all_extensions(unicode(mimetype)) + for extension in extensions: + if extension not in list: + list.append(u'*%s' % extension) + self.serviceManager.supportedSuffixes(extension[1:]) def about(self): about_text = translate('MediaPlugin', 'Media Plugin' From 09b515350ba641b51189c527b9fe48f983ed60f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20P=C3=B5ldaru?= Date: Sun, 20 Feb 2011 20:49:59 +0200 Subject: [PATCH 081/123] oops --- openlp/plugins/media/mediaplugin.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/openlp/plugins/media/mediaplugin.py b/openlp/plugins/media/mediaplugin.py index 1f6284d61..12887a76c 100644 --- a/openlp/plugins/media/mediaplugin.py +++ b/openlp/plugins/media/mediaplugin.py @@ -63,8 +63,9 @@ class MediaPlugin(Plugin): # Is it a media type extensions = mimetypes.guess_all_extensions(unicode(mimetype)) for extension in extensions: - if extension not in list: - list.append(u'*%s' % extension) + ext = u'*%s' % extension + if ext not in list: + list.append(ext) self.serviceManager.supportedSuffixes(extension[1:]) def about(self): From 7e4b644f781612d9c21fcfdbc514ac3aab11deef Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sun, 20 Feb 2011 20:23:33 +0000 Subject: [PATCH 082/123] Finished moving Display Tags --- openlp/core/ui/displaytagdialog.py | 265 ++++++------------- openlp/core/ui/displaytagform.py | 10 +- openlp/core/ui/mainwindow.py | 2 +- resources/forms/displaytabdialog.ui | 393 +++++++++++++--------------- resources/images/openlp-2.qrc | 1 + 5 files changed, 269 insertions(+), 402 deletions(-) diff --git a/openlp/core/ui/displaytagdialog.py b/openlp/core/ui/displaytagdialog.py index 3e76b39d2..5da529302 100644 --- a/openlp/core/ui/displaytagdialog.py +++ b/openlp/core/ui/displaytagdialog.py @@ -29,171 +29,29 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import translate, build_icon from openlp.core.lib.ui import UiStrings, create_accept_reject_button_box -try: - _fromUtf8 = QtCore.QString.fromUtf8 -except AttributeError: - _fromUtf8 = lambda s: s - class Ui_DisplayTagDialog(object): def setupUi(self, displayTagDialog): -# displayTagDialog.setObjectName(u'displayTagDialog') -# displayTagDialog.resize(700, 500) -# displayTagDialog.setWindowIcon( -# build_icon(u':/system/system_settings.png')) -# self.settingsLayout = QtGui.QVBoxLayout(displayTagDialog) -# self.settingsLayout.setObjectName(u'settingsLayout') -# self.editGroupBox = QtGui.QGroupBox(displayTagDialog) -# self.editGroupBox.setGeometry(QtCore.QRect(10, 220, 650, 181)) -# self.editGroupBox.setObjectName(u'editGroupBox') -# self.updatePushButton = QtGui.QPushButton(self.editGroupBox) -# self.updatePushButton.setGeometry(QtCore.QRect(550, 140, 71, 26)) -# self.updatePushButton.setObjectName(u'updatePushButton') -# self.layoutWidget = QtGui.QWidget(self.editGroupBox) -# self.layoutWidget.setGeometry(QtCore.QRect(5, 20, 571, 114)) -# self.layoutWidget.setObjectName(u'layoutWidget') -# self.formLayout = QtGui.QFormLayout(self.layoutWidget) -# self.formLayout.setObjectName(u'formLayout') -# self.descriptionLabel = QtGui.QLabel(self.layoutWidget) -# self.descriptionLabel.setAlignment(QtCore.Qt.AlignCenter) -# self.descriptionLabel.setObjectName(u'descriptionLabel') -# self.formLayout.setWidget(0, QtGui.QFormLayout.LabelRole, -# self.descriptionLabel) -# self.descriptionLineEdit = QtGui.QLineEdit(self.layoutWidget) -# self.descriptionLineEdit.setObjectName(u'descriptionLineEdit') -# self.formLayout.setWidget(0, QtGui.QFormLayout.FieldRole, -# self.descriptionLineEdit) -# self.tagLabel = QtGui.QLabel(self.layoutWidget) -# self.tagLabel.setAlignment(QtCore.Qt.AlignCenter) -# self.tagLabel.setObjectName(u'tagLabel') -# self.formLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.tagLabel) -# self.tagLineEdit = QtGui.QLineEdit(self.layoutWidget) -# self.tagLineEdit.setMaximumSize(QtCore.QSize(50, 16777215)) -# self.tagLineEdit.setMaxLength(5) -# self.tagLineEdit.setObjectName(u'tagLineEdit') -# self.formLayout.setWidget(1, QtGui.QFormLayout.FieldRole, -# self.tagLineEdit) -# self.startTagLabel = QtGui.QLabel(self.layoutWidget) -# self.startTagLabel.setAlignment(QtCore.Qt.AlignCenter) -# self.startTagLabel.setObjectName(u'startTagLabel') -# self.formLayout.setWidget(2, QtGui.QFormLayout.LabelRole, -# self.startTagLabel) -# self.startTagLineEdit = QtGui.QLineEdit(self.layoutWidget) -# self.startTagLineEdit.setObjectName(u'startTagLineEdit') -# self.formLayout.setWidget(2, QtGui.QFormLayout.FieldRole, -# self.startTagLineEdit) -# self.endTagLabel = QtGui.QLabel(self.layoutWidget) -# self.endTagLabel.setAlignment(QtCore.Qt.AlignCenter) -# self.endTagLabel.setObjectName(u'endTagLabel') -# self.formLayout.setWidget(3, QtGui.QFormLayout.LabelRole, -# self.endTagLabel) -# self.endTagLineEdit = QtGui.QLineEdit(self.layoutWidget) -# self.endTagLineEdit.setObjectName(u'endTagLineEdit') -# self.formLayout.setWidget(3, QtGui.QFormLayout.FieldRole, -# self.endTagLineEdit) -# self.defaultPushButton = QtGui.QPushButton(displayTagDialog) -# self.defaultPushButton.setGeometry(QtCore.QRect(430, 188, 71, 26)) -# self.defaultPushButton.setObjectName(u'updatePushButton') -# self.deletePushButton = QtGui.QPushButton(displayTagDialog) -# self.deletePushButton.setGeometry(QtCore.QRect(510, 188, 71, 26)) -# self.deletePushButton.setObjectName(u'deletePushButton') -# self.newPushButton = QtGui.QPushButton(displayTagDialog) -# self.newPushButton.setGeometry(QtCore.QRect(600, 188, 71, 26)) -# self.newPushButton.setObjectName(u'newPushButton') -# self.tagTableWidget = QtGui.QTableWidget(displayTagDialog) -# self.tagTableWidget.setGeometry(QtCore.QRect(10, 10, 650, 171)) -# self.tagTableWidget.setHorizontalScrollBarPolicy( -# QtCore.Qt.ScrollBarAlwaysOff) -# self.tagTableWidget.setEditTriggers( -# QtGui.QAbstractItemView.NoEditTriggers) -# self.tagTableWidget.setAlternatingRowColors(True) -# self.tagTableWidget.setSelectionMode( -# QtGui.QAbstractItemView.SingleSelection) -# self.tagTableWidget.setSelectionBehavior( -# QtGui.QAbstractItemView.SelectRows) -# self.tagTableWidget.setCornerButtonEnabled(False) -# self.tagTableWidget.setObjectName(u'tagTableWidget') -# self.tagTableWidget.setColumnCount(4) -# self.tagTableWidget.setRowCount(0) -# item = QtGui.QTableWidgetItem() -# self.tagTableWidget.setHorizontalHeaderItem(0, item) -# item = QtGui.QTableWidgetItem() -# self.tagTableWidget.setHorizontalHeaderItem(1, item) -# item = QtGui.QTableWidgetItem() -# self.tagTableWidget.setHorizontalHeaderItem(2, item) -# item = QtGui.QTableWidgetItem() -# self.tagTableWidget.setHorizontalHeaderItem(3, item) -# -# self.buttonBox = create_accept_reject_button_box(displayTagDialog, True) -# self.settingsLayout.addWidget(self.buttonBox) -# self.retranslateUi(displayTagDialog) -# QtCore.QMetaObject.connectSlotsByName(displayTagDialog) - displayTagDialog.setObjectName(_fromUtf8("displayTagDialog")) - displayTagDialog.resize(717, 554) - self.editGroupBox = QtGui.QGroupBox(displayTagDialog) - self.editGroupBox.setGeometry(QtCore.QRect(10, 320, 691, 181)) - self.editGroupBox.setObjectName(_fromUtf8("editGroupBox")) - self.updatePushButton = QtGui.QPushButton(self.editGroupBox) - self.updatePushButton.setGeometry(QtCore.QRect(600, 140, 73, 26)) - self.updatePushButton.setObjectName(_fromUtf8("updatePushButton")) - self.layoutWidget = QtGui.QWidget(self.editGroupBox) - self.layoutWidget.setGeometry(QtCore.QRect(20, 50, 571, 114)) - self.layoutWidget.setObjectName(_fromUtf8("layoutWidget")) - self.formLayout = QtGui.QFormLayout(self.layoutWidget) - self.formLayout.setMargin(0) - self.formLayout.setObjectName(_fromUtf8("formLayout")) - self.descriptionLabel = QtGui.QLabel(self.layoutWidget) - self.descriptionLabel.setAlignment(QtCore.Qt.AlignCenter) - self.descriptionLabel.setObjectName(_fromUtf8("descriptionLabel")) - self.formLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.descriptionLabel) - self.descriptionLineEdit = QtGui.QLineEdit(self.layoutWidget) - self.descriptionLineEdit.setObjectName(_fromUtf8("descriptionLineEdit")) - self.formLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.descriptionLineEdit) - self.tagLabel = QtGui.QLabel(self.layoutWidget) - self.tagLabel.setAlignment(QtCore.Qt.AlignCenter) - self.tagLabel.setObjectName(_fromUtf8("tagLabel")) - self.formLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.tagLabel) - self.tagLineEdit = QtGui.QLineEdit(self.layoutWidget) - self.tagLineEdit.setMaximumSize(QtCore.QSize(50, 16777215)) - self.tagLineEdit.setMaxLength(5) - self.tagLineEdit.setObjectName(_fromUtf8("tagLineEdit")) - self.formLayout.setWidget(1, QtGui.QFormLayout.FieldRole, self.tagLineEdit) - self.startTagLabel = QtGui.QLabel(self.layoutWidget) - self.startTagLabel.setAlignment(QtCore.Qt.AlignCenter) - self.startTagLabel.setObjectName(_fromUtf8("startTagLabel")) - self.formLayout.setWidget(2, QtGui.QFormLayout.LabelRole, self.startTagLabel) - self.startTagLineEdit = QtGui.QLineEdit(self.layoutWidget) - self.startTagLineEdit.setObjectName(_fromUtf8("startTagLineEdit")) - self.formLayout.setWidget(2, QtGui.QFormLayout.FieldRole, self.startTagLineEdit) - self.endTagLabel = QtGui.QLabel(self.layoutWidget) - self.endTagLabel.setAlignment(QtCore.Qt.AlignCenter) - self.endTagLabel.setObjectName(_fromUtf8("endTagLabel")) - self.formLayout.setWidget(3, QtGui.QFormLayout.LabelRole, self.endTagLabel) - self.endTagLineEdit = QtGui.QLineEdit(self.layoutWidget) - self.endTagLineEdit.setObjectName(_fromUtf8("endTagLineEdit")) - self.formLayout.setWidget(3, QtGui.QFormLayout.FieldRole, self.endTagLineEdit) - self.addPushButton = QtGui.QPushButton(self.editGroupBox) - self.addPushButton.setGeometry(QtCore.QRect(600, 40, 71, 26)) - self.addPushButton.setObjectName(_fromUtf8("addPushButton")) - self.newPushButton = QtGui.QPushButton(self.editGroupBox) - self.newPushButton.setGeometry(QtCore.QRect(600, 70, 71, 26)) - self.newPushButton.setObjectName(_fromUtf8("newPushButton")) - self.buttonBox = QtGui.QDialogButtonBox(displayTagDialog) - self.buttonBox.setGeometry(QtCore.QRect(540, 510, 162, 26)) - self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Save) - self.buttonBox.setObjectName(_fromUtf8("buttonBox")) - self.deletePushButton = QtGui.QPushButton(displayTagDialog) - self.deletePushButton.setGeometry(QtCore.QRect(630, 280, 71, 26)) - self.deletePushButton.setObjectName(_fromUtf8("deletePushButton")) - self.tagTableWidget = QtGui.QTableWidget(displayTagDialog) - self.tagTableWidget.setGeometry(QtCore.QRect(10, 10, 691, 271)) - self.tagTableWidget.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff) - self.tagTableWidget.setEditTriggers(QtGui.QAbstractItemView.NoEditTriggers) + displayTagDialog.setObjectName(u'displayTagDialog') + displayTagDialog.resize(725, 548) + self.widget = QtGui.QWidget(displayTagDialog) + self.widget.setGeometry(QtCore.QRect(10, 10, 701, 521)) + self.widget.setObjectName(u'widget') + self.listdataGridLayout = QtGui.QGridLayout(self.widget) + self.listdataGridLayout.setMargin(0) + self.listdataGridLayout.setObjectName(u'listdataGridLayout') + self.tagTableWidget = QtGui.QTableWidget(self.widget) + self.tagTableWidget.setHorizontalScrollBarPolicy( + QtCore.Qt.ScrollBarAlwaysOff) + self.tagTableWidget.setEditTriggers( + QtGui.QAbstractItemView.NoEditTriggers) self.tagTableWidget.setAlternatingRowColors(True) - self.tagTableWidget.setSelectionMode(QtGui.QAbstractItemView.SingleSelection) - self.tagTableWidget.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows) + self.tagTableWidget.setSelectionMode( + QtGui.QAbstractItemView.SingleSelection) + self.tagTableWidget.setSelectionBehavior( + QtGui.QAbstractItemView.SelectRows) self.tagTableWidget.setCornerButtonEnabled(False) - self.tagTableWidget.setObjectName(_fromUtf8("tagTableWidget")) + self.tagTableWidget.setObjectName(u'tagTableWidget') self.tagTableWidget.setColumnCount(4) self.tagTableWidget.setRowCount(0) item = QtGui.QTableWidgetItem() @@ -204,9 +62,62 @@ class Ui_DisplayTagDialog(object): self.tagTableWidget.setHorizontalHeaderItem(2, item) item = QtGui.QTableWidgetItem() self.tagTableWidget.setHorizontalHeaderItem(3, item) - self.defaultPushButton = QtGui.QPushButton(displayTagDialog) - self.defaultPushButton.setGeometry(QtCore.QRect(550, 280, 71, 26)) - self.defaultPushButton.setObjectName(_fromUtf8("defaultPushButton")) + self.listdataGridLayout.addWidget(self.tagTableWidget, 0, 0, 1, 1) + self.horizontalLayout = QtGui.QHBoxLayout() + self.horizontalLayout.setObjectName(u'horizontalLayout') + spacerItem = QtGui.QSpacerItem(40, 20, + QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) + self.horizontalLayout.addItem(spacerItem) + self.defaultPushButton = QtGui.QPushButton(self.widget) + self.defaultPushButton.setObjectName(u'defaultPushButton') + self.horizontalLayout.addWidget(self.defaultPushButton) + self.deletePushButton = QtGui.QPushButton(self.widget) + self.deletePushButton.setObjectName(u'deletePushButton') + self.horizontalLayout.addWidget(self.deletePushButton) + self.listdataGridLayout.addLayout(self.horizontalLayout, 1, 0, 1, 1) + self.editGroupBox = QtGui.QGroupBox(self.widget) + self.editGroupBox.setObjectName(u'editGroupBox') + self.dataGridLayout = QtGui.QGridLayout(self.editGroupBox) + self.dataGridLayout.setObjectName(u'dataGridLayout') + self.descriptionLabel = QtGui.QLabel(self.editGroupBox) + self.descriptionLabel.setAlignment(QtCore.Qt.AlignCenter) + self.descriptionLabel.setObjectName(u'descriptionLabel') + self.dataGridLayout.addWidget(self.descriptionLabel, 0, 0, 1, 1) + self.descriptionLineEdit = QtGui.QLineEdit(self.editGroupBox) + self.descriptionLineEdit.setObjectName(u'descriptionLineEdit') + self.dataGridLayout.addWidget(self.descriptionLineEdit, 0, 1, 2, 1) + self.newPushButton = QtGui.QPushButton(self.editGroupBox) + self.newPushButton.setObjectName(u'newPushButton') + self.dataGridLayout.addWidget(self.newPushButton, 0, 2, 2, 1) + self.tagLabel = QtGui.QLabel(self.editGroupBox) + self.tagLabel.setAlignment(QtCore.Qt.AlignCenter) + self.tagLabel.setObjectName(u'tagLabel') + self.dataGridLayout.addWidget(self.tagLabel, 2, 0, 1, 1) + self.tagLineEdit = QtGui.QLineEdit(self.editGroupBox) + self.tagLineEdit.setMaximumSize(QtCore.QSize(50, 16777215)) + self.tagLineEdit.setMaxLength(5) + self.tagLineEdit.setObjectName(u'tagLineEdit') + self.dataGridLayout.addWidget(self.tagLineEdit, 2, 1, 1, 1) + self.startTagLabel = QtGui.QLabel(self.editGroupBox) + self.startTagLabel.setAlignment(QtCore.Qt.AlignCenter) + self.startTagLabel.setObjectName(u'startTagLabel') + self.dataGridLayout.addWidget(self.startTagLabel, 3, 0, 1, 1) + self.startTagLineEdit = QtGui.QLineEdit(self.editGroupBox) + self.startTagLineEdit.setObjectName(u'startTagLineEdit') + self.dataGridLayout.addWidget(self.startTagLineEdit, 3, 1, 1, 1) + self.endTagLabel = QtGui.QLabel(self.editGroupBox) + self.endTagLabel.setAlignment(QtCore.Qt.AlignCenter) + self.endTagLabel.setObjectName(u'endTagLabel') + self.dataGridLayout.addWidget(self.endTagLabel, 4, 0, 1, 1) + self.endTagLineEdit = QtGui.QLineEdit(self.editGroupBox) + self.endTagLineEdit.setObjectName(u'endTagLineEdit') + self.dataGridLayout.addWidget(self.endTagLineEdit, 4, 1, 1, 1) + self.updatePushButton = QtGui.QPushButton(self.editGroupBox) + self.updatePushButton.setObjectName(u'updatePushButton') + self.dataGridLayout.addWidget(self.updatePushButton, 4, 2, 1, 1) + self.listdataGridLayout.addWidget(self.editGroupBox, 2, 0, 1, 1) + self.buttonBox = create_accept_reject_button_box(displayTagDialog) + self.listdataGridLayout.addWidget(self.buttonBox, 3, 0, 1, 1) self.retranslateUi(displayTagDialog) QtCore.QMetaObject.connectSlotsByName(displayTagDialog) @@ -228,33 +139,15 @@ class Ui_DisplayTagDialog(object): self.defaultPushButton.setText( translate('OpenLP.DisplayTagTab', 'Default')) self.newPushButton.setText(UiStrings.New) - self.tagTableWidget.horizontalHeaderItem(0)\ + self.tagTableWidget.horizontalHeaderItem(0) \ .setText(translate('OpenLP.DisplayTagTab', 'Description')) - self.tagTableWidget.horizontalHeaderItem(1)\ + self.tagTableWidget.horizontalHeaderItem(1) \ .setText(translate('OpenLP.DisplayTagTab', 'Tag id')) - self.tagTableWidget.horizontalHeaderItem(2)\ + self.tagTableWidget.horizontalHeaderItem(2) \ .setText(translate('OpenLP.DisplayTagTab', 'Start Html')) - self.tagTableWidget.horizontalHeaderItem(3)\ + self.tagTableWidget.horizontalHeaderItem(3) \ .setText(translate('OpenLP.DisplayTagTab', 'End Html')) self.tagTableWidget.setColumnWidth(0, 120) self.tagTableWidget.setColumnWidth(1, 40) self.tagTableWidget.setColumnWidth(2, 240) - self.tagTableWidget.setColumnWidth(3, 200) - - displayTagDialog.setWindowTitle(QtGui.QApplication.translate("displayTagDialog", "Form", None, QtGui.QApplication.UnicodeUTF8)) - self.editGroupBox.setTitle(QtGui.QApplication.translate("displayTagDialog", "Edit Selection", None, QtGui.QApplication.UnicodeUTF8)) - self.updatePushButton.setText(QtGui.QApplication.translate("displayTagDialog", "Update", None, QtGui.QApplication.UnicodeUTF8)) - self.descriptionLabel.setText(QtGui.QApplication.translate("displayTagDialog", "Description", None, QtGui.QApplication.UnicodeUTF8)) - self.tagLabel.setText(QtGui.QApplication.translate("displayTagDialog", "Tag", None, QtGui.QApplication.UnicodeUTF8)) - self.startTagLabel.setText(QtGui.QApplication.translate("displayTagDialog", "Start tag", None, QtGui.QApplication.UnicodeUTF8)) - self.endTagLabel.setText(QtGui.QApplication.translate("displayTagDialog", "End tag", None, QtGui.QApplication.UnicodeUTF8)) - self.addPushButton.setText(QtGui.QApplication.translate("displayTagDialog", "Add", None, QtGui.QApplication.UnicodeUTF8)) - self.newPushButton.setText(QtGui.QApplication.translate("displayTagDialog", "New", None, QtGui.QApplication.UnicodeUTF8)) - self.deletePushButton.setText(QtGui.QApplication.translate("displayTagDialog", "Delete", None, QtGui.QApplication.UnicodeUTF8)) - self.tagTableWidget.horizontalHeaderItem(0).setText(QtGui.QApplication.translate("displayTagDialog", "Description", None, QtGui.QApplication.UnicodeUTF8)) - self.tagTableWidget.horizontalHeaderItem(1).setText(QtGui.QApplication.translate("displayTagDialog", "Key", None, QtGui.QApplication.UnicodeUTF8)) - self.tagTableWidget.horizontalHeaderItem(2).setText(QtGui.QApplication.translate("displayTagDialog", "Start Tag", None, QtGui.QApplication.UnicodeUTF8)) - self.tagTableWidget.horizontalHeaderItem(3).setText(QtGui.QApplication.translate("displayTagDialog", "End Tag", None, QtGui.QApplication.UnicodeUTF8)) - self.defaultPushButton.setText(QtGui.QApplication.translate("displayTagDialog", "Default", None, QtGui.QApplication.UnicodeUTF8)) - - + self.tagTableWidget.setColumnWidth(3, 240) diff --git a/openlp/core/ui/displaytagform.py b/openlp/core/ui/displaytagform.py index 491c60693..48924759f 100644 --- a/openlp/core/ui/displaytagform.py +++ b/openlp/core/ui/displaytagform.py @@ -63,6 +63,7 @@ class DisplayTagForm(QtGui.QDialog, Ui_DisplayTagDialog): Load Display and set field state. """ # Create initial copy from master + self._resetTable() DisplayTags.reset_html_tags() user_expands = QtCore.QSettings().value(u'displayTags/html_tags', QtCore.QVariant(u'')).toString() @@ -102,7 +103,7 @@ class DisplayTagForm(QtGui.QDialog, Ui_DisplayTagDialog): self.startTagLineEdit.setEnabled(False) self.endTagLineEdit.setEnabled(False) - def save(self): + def accept(self): """ Save Custom tags in a pickle . """ @@ -117,13 +118,14 @@ class DisplayTagForm(QtGui.QDialog, Ui_DisplayTagDialog): else: QtCore.QSettings().setValue(u'displayTags/html_tags', QtCore.QVariant(u'')) + return QtGui.QDialog.accept(self) - def cancel(self): + def reject(self): """ Reset Custom tags from Settings. """ - self.preLoad() self._resetTable() + return QtGui.QDialog.reject(self) def onRowSelected(self): """ @@ -170,6 +172,7 @@ class DisplayTagForm(QtGui.QDialog, Ui_DisplayTagDialog): self._resetTable() # Highlight new row self.tagTableWidget.selectRow(self.tagTableWidget.rowCount() - 1) + self.onRowSelected() def onDefaultPushed(self): """ @@ -217,7 +220,6 @@ class DisplayTagForm(QtGui.QDialog, Ui_DisplayTagDialog): """ self.tagTableWidget.clearContents() self.tagTableWidget.setRowCount(0) - self.load() def _strip(self, tag): """ diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index f899a23ce..9071016e8 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -243,7 +243,7 @@ class Ui_MainWindow(object): u'SettingsShortcutsItem', u':/system/system_configure_shortcuts.png') self.DisplayTagItem = icon_action(mainWindow, - u'DisplayTagItem', u':/system/system_settings.png') + u'DisplayTagItem', u':/system/tag_editor.png') self.SettingsConfigureItem = icon_action(mainWindow, u'SettingsConfigureItem', u':/system/system_settings.png') mainWindow.actionList.add_action(self.SettingsShortcutsItem, diff --git a/resources/forms/displaytabdialog.ui b/resources/forms/displaytabdialog.ui index 2e9c09c01..b181635be 100644 --- a/resources/forms/displaytabdialog.ui +++ b/resources/forms/displaytabdialog.ui @@ -6,228 +6,199 @@ 0 0 - 717 - 554 + 725 + 548 Form - - - - 10 - 320 - 691 - 181 - - - - Edit Selection - - - - - 600 - 140 - 73 - 26 - - - - Update - - - - - - 20 - 50 - 571 - 114 - - - - - - - Description - - - Qt::AlignCenter - - - - - - - - - - Tag - - - Qt::AlignCenter - - - - - - - - 50 - 16777215 - - - - 5 - - - - - - - Start tag - - - Qt::AlignCenter - - - - - - - - - - End tag - - - Qt::AlignCenter - - - - - - - - - - - - 600 - 40 - 71 - 26 - - - - Add - - - - - - 600 - 70 - 71 - 26 - - - - New - - - - - - - 540 - 510 - 162 - 26 - - - - QDialogButtonBox::Cancel|QDialogButtonBox::Save - - - - - - 630 - 280 - 71 - 26 - - - - Delete - - - + 10 10 - 691 - 271 + 701 + 521 - - Qt::ScrollBarAlwaysOff - - - QAbstractItemView::NoEditTriggers - - - true - - - QAbstractItemView::SingleSelection - - - QAbstractItemView::SelectRows - - - false - - - - Description - - - - - Key - - - AlignHCenter|AlignVCenter|AlignCenter - - - - - Start Tag - - - - - End Tag - - - - - - - 550 - 280 - 71 - 26 - - - - Default - + + + + + Qt::ScrollBarAlwaysOff + + + QAbstractItemView::NoEditTriggers + + + true + + + QAbstractItemView::SingleSelection + + + QAbstractItemView::SelectRows + + + false + + + + Description + + + + + Key + + + AlignHCenter|AlignVCenter|AlignCenter + + + + + Start Tag + + + + + End Tag + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Default + + + + + + + Delete + + + + + + + + + Edit Selection + + + + + + Description + + + Qt::AlignCenter + + + + + + + + + + Add + + + + + + + New + + + + + + + Tag + + + Qt::AlignCenter + + + + + + + + 50 + 16777215 + + + + 5 + + + + + + + Start tag + + + Qt::AlignCenter + + + + + + + + + + End tag + + + Qt::AlignCenter + + + + + + + + + + Update + + + + + + + + + + QDialogButtonBox::Cancel|QDialogButtonBox::Save + + + + diff --git a/resources/images/openlp-2.qrc b/resources/images/openlp-2.qrc index 745f20ebf..794e006d9 100644 --- a/resources/images/openlp-2.qrc +++ b/resources/images/openlp-2.qrc @@ -116,6 +116,7 @@ system_exit.png settings_plugin_list.png system_settings.png + tag_editor.png system_configure.png system_edit_copy.png system_configure_shortcuts.png From 69bfe2ab9ccb84e425d035b1b44ae40b81254461 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sun, 20 Feb 2011 20:34:33 +0000 Subject: [PATCH 083/123] Post merge request fixes --- openlp/core/ui/settingsform.py | 5 +- resources/forms/displaytabdialog.py | 125 ++++++++++++++++++++++++++++ resources/images/tag_editor.png | Bin 0 -> 1131 bytes 3 files changed, 126 insertions(+), 4 deletions(-) create mode 100644 resources/forms/displaytabdialog.py create mode 100644 resources/images/tag_editor.png diff --git a/openlp/core/ui/settingsform.py b/openlp/core/ui/settingsform.py index 3fd640acd..8ea9b0dea 100644 --- a/openlp/core/ui/settingsform.py +++ b/openlp/core/ui/settingsform.py @@ -31,7 +31,7 @@ import logging from PyQt4 import QtGui from openlp.core.lib import Receiver -from openlp.core.ui import AdvancedTab, GeneralTab, ThemesTab, DisplayTagTab +from openlp.core.ui import AdvancedTab, GeneralTab, ThemesTab from settingsdialog import Ui_SettingsDialog log = logging.getLogger(__name__) @@ -55,9 +55,6 @@ class SettingsForm(QtGui.QDialog, Ui_SettingsDialog): # Advanced tab advancedTab = AdvancedTab() self.addTab(u'Advanced', advancedTab) - ## Edit Display Tags tab - #self.displayTagTab = DisplayTagTab() - #self.addTab(u'Display Tags', self.displayTagTab) def addTab(self, name, tab): """ diff --git a/resources/forms/displaytabdialog.py b/resources/forms/displaytabdialog.py new file mode 100644 index 000000000..7e3be55cd --- /dev/null +++ b/resources/forms/displaytabdialog.py @@ -0,0 +1,125 @@ +# -*- coding: utf-8 -*- + +# Form implementation generated from reading ui file 'displaytabdialog.ui' +# +# Created: Sun Feb 20 17:37:30 2011 +# by: PyQt4 UI code generator 4.8.3 +# +# WARNING! All changes made in this file will be lost! + +from PyQt4 import QtCore, QtGui + +try: + _fromUtf8 = QtCore.QString.fromUtf8 +except AttributeError: + _fromUtf8 = lambda s: s + +class Ui_displayTagEdit(object): + def setupUi(self, displayTagEdit): + displayTagEdit.setObjectName(_fromUtf8("displayTagEdit")) + displayTagEdit.resize(725, 548) + self.widget = QtGui.QWidget(displayTagEdit) + self.widget.setGeometry(QtCore.QRect(10, 10, 701, 521)) + self.widget.setObjectName(_fromUtf8("widget")) + self.gridLayout_2 = QtGui.QGridLayout(self.widget) + self.gridLayout_2.setMargin(0) + self.gridLayout_2.setObjectName(_fromUtf8("gridLayout_2")) + self.tagTableWidget = QtGui.QTableWidget(self.widget) + self.tagTableWidget.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff) + self.tagTableWidget.setEditTriggers(QtGui.QAbstractItemView.NoEditTriggers) + self.tagTableWidget.setAlternatingRowColors(True) + self.tagTableWidget.setSelectionMode(QtGui.QAbstractItemView.SingleSelection) + self.tagTableWidget.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows) + self.tagTableWidget.setCornerButtonEnabled(False) + self.tagTableWidget.setObjectName(_fromUtf8("tagTableWidget")) + self.tagTableWidget.setColumnCount(4) + self.tagTableWidget.setRowCount(0) + item = QtGui.QTableWidgetItem() + self.tagTableWidget.setHorizontalHeaderItem(0, item) + item = QtGui.QTableWidgetItem() + self.tagTableWidget.setHorizontalHeaderItem(1, item) + item = QtGui.QTableWidgetItem() + self.tagTableWidget.setHorizontalHeaderItem(2, item) + item = QtGui.QTableWidgetItem() + self.tagTableWidget.setHorizontalHeaderItem(3, item) + self.gridLayout_2.addWidget(self.tagTableWidget, 0, 0, 1, 1) + self.horizontalLayout = QtGui.QHBoxLayout() + self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout")) + spacerItem = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) + self.horizontalLayout.addItem(spacerItem) + self.defaultPushButton = QtGui.QPushButton(self.widget) + self.defaultPushButton.setObjectName(_fromUtf8("defaultPushButton")) + self.horizontalLayout.addWidget(self.defaultPushButton) + self.deletePushButton = QtGui.QPushButton(self.widget) + self.deletePushButton.setObjectName(_fromUtf8("deletePushButton")) + self.horizontalLayout.addWidget(self.deletePushButton) + self.gridLayout_2.addLayout(self.horizontalLayout, 1, 0, 1, 1) + self.editGroupBox = QtGui.QGroupBox(self.widget) + self.editGroupBox.setObjectName(_fromUtf8("editGroupBox")) + self.gridLayout = QtGui.QGridLayout(self.editGroupBox) + self.gridLayout.setObjectName(_fromUtf8("gridLayout")) + self.descriptionLabel = QtGui.QLabel(self.editGroupBox) + self.descriptionLabel.setAlignment(QtCore.Qt.AlignCenter) + self.descriptionLabel.setObjectName(_fromUtf8("descriptionLabel")) + self.gridLayout.addWidget(self.descriptionLabel, 0, 0, 1, 1) + self.descriptionLineEdit = QtGui.QLineEdit(self.editGroupBox) + self.descriptionLineEdit.setObjectName(_fromUtf8("descriptionLineEdit")) + self.gridLayout.addWidget(self.descriptionLineEdit, 0, 1, 2, 1) + self.addPushButton = QtGui.QPushButton(self.editGroupBox) + self.addPushButton.setObjectName(_fromUtf8("addPushButton")) + self.gridLayout.addWidget(self.addPushButton, 0, 2, 1, 1) + self.newPushButton = QtGui.QPushButton(self.editGroupBox) + self.newPushButton.setObjectName(_fromUtf8("newPushButton")) + self.gridLayout.addWidget(self.newPushButton, 1, 2, 2, 1) + self.tagLabel = QtGui.QLabel(self.editGroupBox) + self.tagLabel.setAlignment(QtCore.Qt.AlignCenter) + self.tagLabel.setObjectName(_fromUtf8("tagLabel")) + self.gridLayout.addWidget(self.tagLabel, 2, 0, 1, 1) + self.tagLineEdit = QtGui.QLineEdit(self.editGroupBox) + self.tagLineEdit.setMaximumSize(QtCore.QSize(50, 16777215)) + self.tagLineEdit.setMaxLength(5) + self.tagLineEdit.setObjectName(_fromUtf8("tagLineEdit")) + self.gridLayout.addWidget(self.tagLineEdit, 2, 1, 1, 1) + self.startTagLabel = QtGui.QLabel(self.editGroupBox) + self.startTagLabel.setAlignment(QtCore.Qt.AlignCenter) + self.startTagLabel.setObjectName(_fromUtf8("startTagLabel")) + self.gridLayout.addWidget(self.startTagLabel, 3, 0, 1, 1) + self.startTagLineEdit = QtGui.QLineEdit(self.editGroupBox) + self.startTagLineEdit.setObjectName(_fromUtf8("startTagLineEdit")) + self.gridLayout.addWidget(self.startTagLineEdit, 3, 1, 1, 1) + self.endTagLabel = QtGui.QLabel(self.editGroupBox) + self.endTagLabel.setAlignment(QtCore.Qt.AlignCenter) + self.endTagLabel.setObjectName(_fromUtf8("endTagLabel")) + self.gridLayout.addWidget(self.endTagLabel, 4, 0, 1, 1) + self.endTagLineEdit = QtGui.QLineEdit(self.editGroupBox) + self.endTagLineEdit.setObjectName(_fromUtf8("endTagLineEdit")) + self.gridLayout.addWidget(self.endTagLineEdit, 4, 1, 1, 1) + self.updatePushButton = QtGui.QPushButton(self.editGroupBox) + self.updatePushButton.setObjectName(_fromUtf8("updatePushButton")) + self.gridLayout.addWidget(self.updatePushButton, 4, 2, 1, 1) + self.gridLayout_2.addWidget(self.editGroupBox, 2, 0, 1, 1) + self.buttonBox = QtGui.QDialogButtonBox(self.widget) + self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Save) + self.buttonBox.setObjectName(_fromUtf8("buttonBox")) + self.gridLayout_2.addWidget(self.buttonBox, 3, 0, 1, 1) + + self.retranslateUi(displayTagEdit) + QtCore.QMetaObject.connectSlotsByName(displayTagEdit) + + def retranslateUi(self, displayTagEdit): + displayTagEdit.setWindowTitle(QtGui.QApplication.translate("displayTagEdit", "Form", None, QtGui.QApplication.UnicodeUTF8)) + self.tagTableWidget.horizontalHeaderItem(0).setText(QtGui.QApplication.translate("displayTagEdit", "Description", None, QtGui.QApplication.UnicodeUTF8)) + self.tagTableWidget.horizontalHeaderItem(1).setText(QtGui.QApplication.translate("displayTagEdit", "Key", None, QtGui.QApplication.UnicodeUTF8)) + self.tagTableWidget.horizontalHeaderItem(2).setText(QtGui.QApplication.translate("displayTagEdit", "Start Tag", None, QtGui.QApplication.UnicodeUTF8)) + self.tagTableWidget.horizontalHeaderItem(3).setText(QtGui.QApplication.translate("displayTagEdit", "End Tag", None, QtGui.QApplication.UnicodeUTF8)) + self.defaultPushButton.setText(QtGui.QApplication.translate("displayTagEdit", "Default", None, QtGui.QApplication.UnicodeUTF8)) + self.deletePushButton.setText(QtGui.QApplication.translate("displayTagEdit", "Delete", None, QtGui.QApplication.UnicodeUTF8)) + self.editGroupBox.setTitle(QtGui.QApplication.translate("displayTagEdit", "Edit Selection", None, QtGui.QApplication.UnicodeUTF8)) + self.descriptionLabel.setText(QtGui.QApplication.translate("displayTagEdit", "Description", None, QtGui.QApplication.UnicodeUTF8)) + self.addPushButton.setText(QtGui.QApplication.translate("displayTagEdit", "Add", None, QtGui.QApplication.UnicodeUTF8)) + self.newPushButton.setText(QtGui.QApplication.translate("displayTagEdit", "New", None, QtGui.QApplication.UnicodeUTF8)) + self.tagLabel.setText(QtGui.QApplication.translate("displayTagEdit", "Tag", None, QtGui.QApplication.UnicodeUTF8)) + self.startTagLabel.setText(QtGui.QApplication.translate("displayTagEdit", "Start tag", None, QtGui.QApplication.UnicodeUTF8)) + self.endTagLabel.setText(QtGui.QApplication.translate("displayTagEdit", "End tag", None, QtGui.QApplication.UnicodeUTF8)) + self.updatePushButton.setText(QtGui.QApplication.translate("displayTagEdit", "Update", None, QtGui.QApplication.UnicodeUTF8)) + diff --git a/resources/images/tag_editor.png b/resources/images/tag_editor.png new file mode 100644 index 0000000000000000000000000000000000000000..d03963448a44afac47fb33551416dad2ba58168a GIT binary patch literal 1131 zcmV-x1eE)UP)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01ejw01ejxLMWSf00007bV*G`2iXS| z0U#KwC`vg100ZkuL_t(|+MSbsXjNqx$3O4AclUVjox`y$&8BUxbQOe^TKQ{+=&BWr z7Fn<*nL+<#2~s4Hgb-F%N~ckVsE?m17# zgV#&zI;#)7yyrdd^E`a{p6^jC2ljA@_V#x10idO&MR6J0+S&v_DMfR0bG~jFuon~n zbu@*H&=T*AXUVVftn0dj!(r6T>PlR`Fs+6 zBD%^xX4AX4S4`Jbv7%ymJ-JEM*Dsf#KMUWX{v^X&*0CZIO(vt3)&*EB38W zkur^Yf4*nm_6N5vZ5`O*Dgfs3v1(QiM?wllJrcf($#IPtv&t!nYLvt@;zdPRuFIHV zk+LmLo=BpnEp*qxD}k4WVr<-Mu;BIu?&3v@t0Uxa!SjT8sXt^=l(?p0nJxxd6d_F8 z#q|Wk&SF|w5@j*m;xLY3(K>YlQ@ov&m3wmN(9zJr0|&c9v~@_P2=3MV5$9Hk*}y!|16#kzdxy{VQ*g z>6NqO{mnPYpWi$rz+GGQ&`3V@0QVIm3oMOdw{XF&BFo%B{Wlckf`UMW< z^LGLrCVBFTZQGWKuro>VzF#g|H`e(|tL4!LX3HO6-Y4gN|1P)(?kuP{5{VR49EkPc z?#eB+_oaB_LyH@$!o2ci5#Cjg`O%w8j)ICU%aY4s99$@STC3%nnYD7;-0NlNi&_~z z`ay7Kn&y=icXxLa3Wf5%hT_z!O&I3~S^aV;G0mfGqsfmWOR(K(e0#i$#>U2p6&r>j z;~6~CBPTkGrKYAvW>(FX{qL5^;ht5JC+NGf;;yc)U?(^i5q8g!8rwiB-Nrl5jBwtW zPByfLq0f5&!Sg&C8X6dnBCmMB_Xkw4jt&3-002ovPDHLkV1m$-7>ED> literal 0 HcmV?d00001 From 265aeebf4bbca34afe5c157ba689d710a4acdb17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Armin=20K=C3=B6hler?= Date: Mon, 21 Feb 2011 14:45:14 +0100 Subject: [PATCH 084/123] sort WizardStrings in alphapetical order --- openlp/core/ui/wizard.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openlp/core/ui/wizard.py b/openlp/core/ui/wizard.py index fc1edeecb..209f3f212 100644 --- a/openlp/core/ui/wizard.py +++ b/openlp/core/ui/wizard.py @@ -47,6 +47,7 @@ class WizardStrings(object): CSV = u'CSV' EW = u'EasyWorship' ES = u'EasiSlides' + FP = u'Foilpresenter' OL = u'OpenLyrics' OS = u'OpenSong' OSIS = u'OSIS' @@ -54,7 +55,6 @@ class WizardStrings(object): SoF = u'Songs of Fellowship' SSP = u'SongShow Plus' WoW = u'Words of Worship' - FP = u'Foilpresenter' # These strings should need a good reason to be retranslated elsewhere. FinishedImport = translate('OpenLP.Ui', 'Finished import.') FormatLabel = translate('OpenLP.Ui', 'Format:') From 4aa69e53bbf0c70615bafa929a987273322799b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Armin=20K=C3=B6hler?= Date: Mon, 21 Feb 2011 15:59:01 +0100 Subject: [PATCH 085/123] removed duplicate method registerFields() and sort some lines --- openlp/plugins/songs/forms/songimportform.py | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/openlp/plugins/songs/forms/songimportform.py b/openlp/plugins/songs/forms/songimportform.py index 06de08a93..3eecac4ba 100644 --- a/openlp/plugins/songs/forms/songimportform.py +++ b/openlp/plugins/songs/forms/songimportform.py @@ -604,6 +604,12 @@ class SongImportForm(OpenLPWizard): % translate('SongsPlugin.ImportWizardForm', 'SongShow Plus Song Files') ) + + def onSongShowPlusRemoveButtonClicked(self): + """ + Remove selected SongShow Plus files from the import list + """ + self.removeSelectedItems(self.songShowPlusFileListWidget) def onFoilPresenterAddButtonClicked(self): """ @@ -621,18 +627,6 @@ class SongImportForm(OpenLPWizard): """ self.removeSelectedItems(self.foilPresenterFileListWidget) - def registerFields(self): - """ - Register song import wizard fields. - """ - pass - - def onSongShowPlusRemoveButtonClicked(self): - """ - Remove selected SongShow Plus files from the import list - """ - self.removeSelectedItems(self.songShowPlusFileListWidget) - def setDefaults(self): """ Set default form values for the song import wizard. From 7d7f9a7d98172d4cf26ecc1e5f0f9a889fb8acde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20P=C3=B5ldaru?= Date: Mon, 21 Feb 2011 17:16:56 +0200 Subject: [PATCH 086/123] fix #99 --- openlp/plugins/songs/lib/cclifileimport.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/openlp/plugins/songs/lib/cclifileimport.py b/openlp/plugins/songs/lib/cclifileimport.py index 3d08584d0..28c487a78 100644 --- a/openlp/plugins/songs/lib/cclifileimport.py +++ b/openlp/plugins/songs/lib/cclifileimport.py @@ -78,7 +78,20 @@ class CCLIFileImport(SongImport): details = chardet.detect(detect_content) detect_file.close() infile = codecs.open(filename, u'r', details['encoding']) - lines = infile.readlines() + try: + lines = infile.readlines() + infile.close() + except UnicodeDecodeError: + # First 2kB were not sufficient to detect file encoding. + # This time we read entire file. + detect_file = open(filename, u'r') + detect_content = detect_file.read() + details = chardet.detect(detect_content) + detect_file.close() + # We read the contents again. Should it be a try as well? + infile = codecs.open(filename, u'r', details['encoding']) + lines = infile.readlines() + infile.close() ext = os.path.splitext(filename)[1] if ext.lower() == u'.usr': log.info(u'SongSelect .usr format file found %s: ', From 24519832dfb8ebf8b70a88d5af494013bd9639d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20P=C3=B5ldaru?= Date: Mon, 21 Feb 2011 17:49:09 +0200 Subject: [PATCH 087/123] More informational noise to debug log, extensions by mimetype. To justify: it seems that extension list is an important thing. --- openlp/plugins/media/mediaplugin.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/openlp/plugins/media/mediaplugin.py b/openlp/plugins/media/mediaplugin.py index 12887a76c..bfe9dbff0 100644 --- a/openlp/plugins/media/mediaplugin.py +++ b/openlp/plugins/media/mediaplugin.py @@ -54,19 +54,16 @@ class MediaPlugin(Plugin): self._addToList(self.audio_list, mimetype) elif mimetype.startswith(u'video/'): self._addToList(self.video_list, mimetype) - log.info(u'MediaPlugin handles audio extensions: %s', - u' '.join(self.audio_list)) - log.info(u'MediaPlugin handles video extensions: %s', - u' '.join(self.video_list)) def _addToList(self, list, mimetype): - # Is it a media type extensions = mimetypes.guess_all_extensions(unicode(mimetype)) for extension in extensions: ext = u'*%s' % extension if ext not in list: list.append(ext) self.serviceManager.supportedSuffixes(extension[1:]) + log.info(u'MediaPlugin: %s extensions: %s' % (mimetype, + u' '.join(extensions))) def about(self): about_text = translate('MediaPlugin', 'Media Plugin' From e8b6bbe14179ff37a6da5aa3b4c4bb1ad430f939 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20P=C3=B5ldaru?= Date: Mon, 21 Feb 2011 17:56:23 +0200 Subject: [PATCH 088/123] revert a change --- openlp/plugins/songs/lib/cclifileimport.py | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/openlp/plugins/songs/lib/cclifileimport.py b/openlp/plugins/songs/lib/cclifileimport.py index 28c487a78..3d08584d0 100644 --- a/openlp/plugins/songs/lib/cclifileimport.py +++ b/openlp/plugins/songs/lib/cclifileimport.py @@ -78,20 +78,7 @@ class CCLIFileImport(SongImport): details = chardet.detect(detect_content) detect_file.close() infile = codecs.open(filename, u'r', details['encoding']) - try: - lines = infile.readlines() - infile.close() - except UnicodeDecodeError: - # First 2kB were not sufficient to detect file encoding. - # This time we read entire file. - detect_file = open(filename, u'r') - detect_content = detect_file.read() - details = chardet.detect(detect_content) - detect_file.close() - # We read the contents again. Should it be a try as well? - infile = codecs.open(filename, u'r', details['encoding']) - lines = infile.readlines() - infile.close() + lines = infile.readlines() ext = os.path.splitext(filename)[1] if ext.lower() == u'.usr': log.info(u'SongSelect .usr format file found %s: ', From 1e041d9158d72aa1f7ad177f38c756f55da07c5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Armin=20K=C3=B6hler?= Date: Mon, 21 Feb 2011 17:02:28 +0100 Subject: [PATCH 089/123] remove some whitespaces --- openlp/plugins/songs/forms/songimportform.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openlp/plugins/songs/forms/songimportform.py b/openlp/plugins/songs/forms/songimportform.py index 3eecac4ba..16c0f9edb 100644 --- a/openlp/plugins/songs/forms/songimportform.py +++ b/openlp/plugins/songs/forms/songimportform.py @@ -594,7 +594,7 @@ class SongImportForm(OpenLPWizard): Remove selected SongBeamer files from the import list """ self.removeSelectedItems(self.songBeamerFileListWidget) - + def onSongShowPlusAddButtonClicked(self): """ Get SongShow Plus song database files @@ -604,7 +604,7 @@ class SongImportForm(OpenLPWizard): % translate('SongsPlugin.ImportWizardForm', 'SongShow Plus Song Files') ) - + def onSongShowPlusRemoveButtonClicked(self): """ Remove selected SongShow Plus files from the import list From e2699eab3cadc2fd719a853a1586d69fe64618a2 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Mon, 21 Feb 2011 17:12:36 +0000 Subject: [PATCH 090/123] Review Fixes --- openlp/core/ui/displaytagdialog.py | 16 ++-- openlp/core/ui/displaytagform.py | 3 + resources/forms/displaytabdialog.py | 125 ---------------------------- 3 files changed, 11 insertions(+), 133 deletions(-) delete mode 100644 resources/forms/displaytabdialog.py diff --git a/openlp/core/ui/displaytagdialog.py b/openlp/core/ui/displaytagdialog.py index 5da529302..ab3363058 100644 --- a/openlp/core/ui/displaytagdialog.py +++ b/openlp/core/ui/displaytagdialog.py @@ -139,14 +139,14 @@ class Ui_DisplayTagDialog(object): self.defaultPushButton.setText( translate('OpenLP.DisplayTagTab', 'Default')) self.newPushButton.setText(UiStrings.New) - self.tagTableWidget.horizontalHeaderItem(0) \ - .setText(translate('OpenLP.DisplayTagTab', 'Description')) - self.tagTableWidget.horizontalHeaderItem(1) \ - .setText(translate('OpenLP.DisplayTagTab', 'Tag id')) - self.tagTableWidget.horizontalHeaderItem(2) \ - .setText(translate('OpenLP.DisplayTagTab', 'Start Html')) - self.tagTableWidget.horizontalHeaderItem(3) \ - .setText(translate('OpenLP.DisplayTagTab', 'End Html')) + self.tagTableWidget.horizontalHeaderItem(0).setText( + translate('OpenLP.DisplayTagTab', 'Description')) + self.tagTableWidget.horizontalHeaderItem(1).setText( + translate('OpenLP.DisplayTagTab', 'Tag id')) + self.tagTableWidget.horizontalHeaderItem(2).setText( + translate('OpenLP.DisplayTagTab', 'Start Html')) + self.tagTableWidget.horizontalHeaderItem(3).setText( + translate('OpenLP.DisplayTagTab', 'End Html')) self.tagTableWidget.setColumnWidth(0, 120) self.tagTableWidget.setColumnWidth(1, 40) self.tagTableWidget.setColumnWidth(2, 240) diff --git a/openlp/core/ui/displaytagform.py b/openlp/core/ui/displaytagform.py index 48924759f..f7a8e7740 100644 --- a/openlp/core/ui/displaytagform.py +++ b/openlp/core/ui/displaytagform.py @@ -79,6 +79,9 @@ class DisplayTagForm(QtGui.QDialog, Ui_DisplayTagDialog): return QtGui.QDialog.exec_(self) def load(self): + """ + Load the form with data and set the initial state of the buttons + """ self.newPushButton.setEnabled(True) self.updatePushButton.setEnabled(False) self.deletePushButton.setEnabled(False) diff --git a/resources/forms/displaytabdialog.py b/resources/forms/displaytabdialog.py deleted file mode 100644 index 7e3be55cd..000000000 --- a/resources/forms/displaytabdialog.py +++ /dev/null @@ -1,125 +0,0 @@ -# -*- coding: utf-8 -*- - -# Form implementation generated from reading ui file 'displaytabdialog.ui' -# -# Created: Sun Feb 20 17:37:30 2011 -# by: PyQt4 UI code generator 4.8.3 -# -# WARNING! All changes made in this file will be lost! - -from PyQt4 import QtCore, QtGui - -try: - _fromUtf8 = QtCore.QString.fromUtf8 -except AttributeError: - _fromUtf8 = lambda s: s - -class Ui_displayTagEdit(object): - def setupUi(self, displayTagEdit): - displayTagEdit.setObjectName(_fromUtf8("displayTagEdit")) - displayTagEdit.resize(725, 548) - self.widget = QtGui.QWidget(displayTagEdit) - self.widget.setGeometry(QtCore.QRect(10, 10, 701, 521)) - self.widget.setObjectName(_fromUtf8("widget")) - self.gridLayout_2 = QtGui.QGridLayout(self.widget) - self.gridLayout_2.setMargin(0) - self.gridLayout_2.setObjectName(_fromUtf8("gridLayout_2")) - self.tagTableWidget = QtGui.QTableWidget(self.widget) - self.tagTableWidget.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff) - self.tagTableWidget.setEditTriggers(QtGui.QAbstractItemView.NoEditTriggers) - self.tagTableWidget.setAlternatingRowColors(True) - self.tagTableWidget.setSelectionMode(QtGui.QAbstractItemView.SingleSelection) - self.tagTableWidget.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows) - self.tagTableWidget.setCornerButtonEnabled(False) - self.tagTableWidget.setObjectName(_fromUtf8("tagTableWidget")) - self.tagTableWidget.setColumnCount(4) - self.tagTableWidget.setRowCount(0) - item = QtGui.QTableWidgetItem() - self.tagTableWidget.setHorizontalHeaderItem(0, item) - item = QtGui.QTableWidgetItem() - self.tagTableWidget.setHorizontalHeaderItem(1, item) - item = QtGui.QTableWidgetItem() - self.tagTableWidget.setHorizontalHeaderItem(2, item) - item = QtGui.QTableWidgetItem() - self.tagTableWidget.setHorizontalHeaderItem(3, item) - self.gridLayout_2.addWidget(self.tagTableWidget, 0, 0, 1, 1) - self.horizontalLayout = QtGui.QHBoxLayout() - self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout")) - spacerItem = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) - self.horizontalLayout.addItem(spacerItem) - self.defaultPushButton = QtGui.QPushButton(self.widget) - self.defaultPushButton.setObjectName(_fromUtf8("defaultPushButton")) - self.horizontalLayout.addWidget(self.defaultPushButton) - self.deletePushButton = QtGui.QPushButton(self.widget) - self.deletePushButton.setObjectName(_fromUtf8("deletePushButton")) - self.horizontalLayout.addWidget(self.deletePushButton) - self.gridLayout_2.addLayout(self.horizontalLayout, 1, 0, 1, 1) - self.editGroupBox = QtGui.QGroupBox(self.widget) - self.editGroupBox.setObjectName(_fromUtf8("editGroupBox")) - self.gridLayout = QtGui.QGridLayout(self.editGroupBox) - self.gridLayout.setObjectName(_fromUtf8("gridLayout")) - self.descriptionLabel = QtGui.QLabel(self.editGroupBox) - self.descriptionLabel.setAlignment(QtCore.Qt.AlignCenter) - self.descriptionLabel.setObjectName(_fromUtf8("descriptionLabel")) - self.gridLayout.addWidget(self.descriptionLabel, 0, 0, 1, 1) - self.descriptionLineEdit = QtGui.QLineEdit(self.editGroupBox) - self.descriptionLineEdit.setObjectName(_fromUtf8("descriptionLineEdit")) - self.gridLayout.addWidget(self.descriptionLineEdit, 0, 1, 2, 1) - self.addPushButton = QtGui.QPushButton(self.editGroupBox) - self.addPushButton.setObjectName(_fromUtf8("addPushButton")) - self.gridLayout.addWidget(self.addPushButton, 0, 2, 1, 1) - self.newPushButton = QtGui.QPushButton(self.editGroupBox) - self.newPushButton.setObjectName(_fromUtf8("newPushButton")) - self.gridLayout.addWidget(self.newPushButton, 1, 2, 2, 1) - self.tagLabel = QtGui.QLabel(self.editGroupBox) - self.tagLabel.setAlignment(QtCore.Qt.AlignCenter) - self.tagLabel.setObjectName(_fromUtf8("tagLabel")) - self.gridLayout.addWidget(self.tagLabel, 2, 0, 1, 1) - self.tagLineEdit = QtGui.QLineEdit(self.editGroupBox) - self.tagLineEdit.setMaximumSize(QtCore.QSize(50, 16777215)) - self.tagLineEdit.setMaxLength(5) - self.tagLineEdit.setObjectName(_fromUtf8("tagLineEdit")) - self.gridLayout.addWidget(self.tagLineEdit, 2, 1, 1, 1) - self.startTagLabel = QtGui.QLabel(self.editGroupBox) - self.startTagLabel.setAlignment(QtCore.Qt.AlignCenter) - self.startTagLabel.setObjectName(_fromUtf8("startTagLabel")) - self.gridLayout.addWidget(self.startTagLabel, 3, 0, 1, 1) - self.startTagLineEdit = QtGui.QLineEdit(self.editGroupBox) - self.startTagLineEdit.setObjectName(_fromUtf8("startTagLineEdit")) - self.gridLayout.addWidget(self.startTagLineEdit, 3, 1, 1, 1) - self.endTagLabel = QtGui.QLabel(self.editGroupBox) - self.endTagLabel.setAlignment(QtCore.Qt.AlignCenter) - self.endTagLabel.setObjectName(_fromUtf8("endTagLabel")) - self.gridLayout.addWidget(self.endTagLabel, 4, 0, 1, 1) - self.endTagLineEdit = QtGui.QLineEdit(self.editGroupBox) - self.endTagLineEdit.setObjectName(_fromUtf8("endTagLineEdit")) - self.gridLayout.addWidget(self.endTagLineEdit, 4, 1, 1, 1) - self.updatePushButton = QtGui.QPushButton(self.editGroupBox) - self.updatePushButton.setObjectName(_fromUtf8("updatePushButton")) - self.gridLayout.addWidget(self.updatePushButton, 4, 2, 1, 1) - self.gridLayout_2.addWidget(self.editGroupBox, 2, 0, 1, 1) - self.buttonBox = QtGui.QDialogButtonBox(self.widget) - self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Save) - self.buttonBox.setObjectName(_fromUtf8("buttonBox")) - self.gridLayout_2.addWidget(self.buttonBox, 3, 0, 1, 1) - - self.retranslateUi(displayTagEdit) - QtCore.QMetaObject.connectSlotsByName(displayTagEdit) - - def retranslateUi(self, displayTagEdit): - displayTagEdit.setWindowTitle(QtGui.QApplication.translate("displayTagEdit", "Form", None, QtGui.QApplication.UnicodeUTF8)) - self.tagTableWidget.horizontalHeaderItem(0).setText(QtGui.QApplication.translate("displayTagEdit", "Description", None, QtGui.QApplication.UnicodeUTF8)) - self.tagTableWidget.horizontalHeaderItem(1).setText(QtGui.QApplication.translate("displayTagEdit", "Key", None, QtGui.QApplication.UnicodeUTF8)) - self.tagTableWidget.horizontalHeaderItem(2).setText(QtGui.QApplication.translate("displayTagEdit", "Start Tag", None, QtGui.QApplication.UnicodeUTF8)) - self.tagTableWidget.horizontalHeaderItem(3).setText(QtGui.QApplication.translate("displayTagEdit", "End Tag", None, QtGui.QApplication.UnicodeUTF8)) - self.defaultPushButton.setText(QtGui.QApplication.translate("displayTagEdit", "Default", None, QtGui.QApplication.UnicodeUTF8)) - self.deletePushButton.setText(QtGui.QApplication.translate("displayTagEdit", "Delete", None, QtGui.QApplication.UnicodeUTF8)) - self.editGroupBox.setTitle(QtGui.QApplication.translate("displayTagEdit", "Edit Selection", None, QtGui.QApplication.UnicodeUTF8)) - self.descriptionLabel.setText(QtGui.QApplication.translate("displayTagEdit", "Description", None, QtGui.QApplication.UnicodeUTF8)) - self.addPushButton.setText(QtGui.QApplication.translate("displayTagEdit", "Add", None, QtGui.QApplication.UnicodeUTF8)) - self.newPushButton.setText(QtGui.QApplication.translate("displayTagEdit", "New", None, QtGui.QApplication.UnicodeUTF8)) - self.tagLabel.setText(QtGui.QApplication.translate("displayTagEdit", "Tag", None, QtGui.QApplication.UnicodeUTF8)) - self.startTagLabel.setText(QtGui.QApplication.translate("displayTagEdit", "Start tag", None, QtGui.QApplication.UnicodeUTF8)) - self.endTagLabel.setText(QtGui.QApplication.translate("displayTagEdit", "End tag", None, QtGui.QApplication.UnicodeUTF8)) - self.updatePushButton.setText(QtGui.QApplication.translate("displayTagEdit", "Update", None, QtGui.QApplication.UnicodeUTF8)) - From eb4f7deea8620e8d880a956f9c456f165277ef6a Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Mon, 21 Feb 2011 20:30:01 +0100 Subject: [PATCH 091/123] added apocrypha --- openlp/plugins/bibles/resources/osisbooks.csv | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/openlp/plugins/bibles/resources/osisbooks.csv b/openlp/plugins/bibles/resources/osisbooks.csv index c14f76ded..372cbd92d 100644 --- a/openlp/plugins/bibles/resources/osisbooks.csv +++ b/openlp/plugins/bibles/resources/osisbooks.csv @@ -64,3 +64,13 @@ Jas,James,Jas 3John,3 John,3John Jude,Jude,Jude Rev,Revelation,Rev +Jdt,Judith,Jdt +Wis,Wisdom,Wis +Tob,Tobit,Tob +Sir,Sirach,Sir +Bar,Baruch,Bar +1Macc,1 Maccabees,1Macc +2Macc,2 Maccabees,2Macc +AddDan,Rest of Daniel,AddDan +AddEsth,Rest of Esther,AddEsth +PrMan,Prayer of Manasses,PrMan From 0935af3cfb527cf972619af8e34f7ecf7a637bb8 Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Mon, 21 Feb 2011 20:43:04 +0100 Subject: [PATCH 092/123] fix db --- openlp/plugins/bibles/lib/osis.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openlp/plugins/bibles/lib/osis.py b/openlp/plugins/bibles/lib/osis.py index d21227090..347730bf4 100644 --- a/openlp/plugins/bibles/lib/osis.py +++ b/openlp/plugins/bibles/lib/osis.py @@ -126,7 +126,7 @@ class OSISBible(BibleDB): verse_text = match.group(4) if not db_book or db_book.name != self.books[book][0]: log.debug(u'New book: "%s"', self.books[book][0]) - if book == u'Matt': + if book == u'Matt' or book == u'Jdt': testament += 1 db_book = self.create_book( unicode(self.books[book][0]), From d486547abd5cfa3e248e471fe86cf62d58eb5c2f Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Mon, 21 Feb 2011 20:06:55 +0000 Subject: [PATCH 093/123] Fixes from last merge --- openlp/core/ui/__init__.py | 1 - openlp/core/ui/displaytagdialog.py | 24 +++++------ openlp/core/ui/displaytagform.py | 66 ++++++++++++++++-------------- 3 files changed, 47 insertions(+), 44 deletions(-) diff --git a/openlp/core/ui/__init__.py b/openlp/core/ui/__init__.py index 5763b3470..0f62a6dcf 100644 --- a/openlp/core/ui/__init__.py +++ b/openlp/core/ui/__init__.py @@ -63,7 +63,6 @@ from splashscreen import SplashScreen from generaltab import GeneralTab from themestab import ThemesTab from advancedtab import AdvancedTab -from displaytagtab import DisplayTagTab from aboutform import AboutForm from pluginform import PluginForm from settingsform import SettingsForm diff --git a/openlp/core/ui/displaytagdialog.py b/openlp/core/ui/displaytagdialog.py index ab3363058..edb8567cf 100644 --- a/openlp/core/ui/displaytagdialog.py +++ b/openlp/core/ui/displaytagdialog.py @@ -123,30 +123,30 @@ class Ui_DisplayTagDialog(object): QtCore.QMetaObject.connectSlotsByName(displayTagDialog) def retranslateUi(self, displayTagDialog): - displayTagDialog.setWindowTitle(translate('OpenLP.displayTagForm', + displayTagDialog.setWindowTitle(translate('OpenLP.displayTagDialog', 'Configure Display Tags')) self.editGroupBox.setTitle( - translate('OpenLP.DisplayTagTab', 'Edit Selection')) + translate('OpenLP.DisplayTagDialog', 'Edit Selection')) self.updatePushButton.setText( - translate('OpenLP.DisplayTagTab', 'Update')) + translate('OpenLP.DisplayTagDialog', 'Update')) self.descriptionLabel.setText( - translate('OpenLP.DisplayTagTab', 'Description')) - self.tagLabel.setText(translate('OpenLP.DisplayTagTab', 'Tag')) + translate('OpenLP.DisplayTagDialog', 'Description')) + self.tagLabel.setText(translate('OpenLP.DisplayTagDialog', 'Tag')) self.startTagLabel.setText( - translate('OpenLP.DisplayTagTab', 'Start tag')) - self.endTagLabel.setText(translate('OpenLP.DisplayTagTab', 'End tag')) + translate('OpenLP.DisplayTagDialog', 'Start tag')) + self.endTagLabel.setText(translate('OpenLP.DisplayTagDialog', 'End tag')) self.deletePushButton.setText(UiStrings.Delete) self.defaultPushButton.setText( - translate('OpenLP.DisplayTagTab', 'Default')) + translate('OpenLP.DisplayTagDialog', 'Default')) self.newPushButton.setText(UiStrings.New) self.tagTableWidget.horizontalHeaderItem(0).setText( - translate('OpenLP.DisplayTagTab', 'Description')) + translate('OpenLP.DisplayTagDialog', 'Description')) self.tagTableWidget.horizontalHeaderItem(1).setText( - translate('OpenLP.DisplayTagTab', 'Tag id')) + translate('OpenLP.DisplayTagDialog', 'Tag id')) self.tagTableWidget.horizontalHeaderItem(2).setText( - translate('OpenLP.DisplayTagTab', 'Start Html')) + translate('OpenLP.DisplayTagDialog', 'Start Html')) self.tagTableWidget.horizontalHeaderItem(3).setText( - translate('OpenLP.DisplayTagTab', 'End Html')) + translate('OpenLP.DisplayTagDialog', 'End Html')) self.tagTableWidget.setColumnWidth(0, 120) self.tagTableWidget.setColumnWidth(1, 40) self.tagTableWidget.setColumnWidth(2, 240) diff --git a/openlp/core/ui/displaytagform.py b/openlp/core/ui/displaytagform.py index f7a8e7740..fa05c578a 100644 --- a/openlp/core/ui/displaytagform.py +++ b/openlp/core/ui/displaytagform.py @@ -47,6 +47,7 @@ class DisplayTagForm(QtGui.QDialog, Ui_DisplayTagDialog): """ QtGui.QDialog.__init__(self, parent) self.setupUi(self) + self.preLoad() QtCore.QObject.connect(self.tagTableWidget, QtCore.SIGNAL(u'clicked(QModelIndex)'), self.onRowSelected) QtCore.QObject.connect(self.defaultPushButton, @@ -63,7 +64,18 @@ class DisplayTagForm(QtGui.QDialog, Ui_DisplayTagDialog): Load Display and set field state. """ # Create initial copy from master + self.preLoad() self._resetTable() + self.selected = -1 + return QtGui.QDialog.exec_(self) + + def preLoad(self): + """ + Load the Tags from store so can be used in the system or used to + update the display. If Cancel was selected this is needed to reset the + dsiplay to the correct version. + """ + # Initial Load of the Tags DisplayTags.reset_html_tags() user_expands = QtCore.QSettings().value(u'displayTags/html_tags', QtCore.QVariant(u'')).toString() @@ -74,37 +86,6 @@ class DisplayTagForm(QtGui.QDialog, Ui_DisplayTagDialog): # If we have some user ones added them as well for t in user_tags: DisplayTags.add_html_tag(t) - self.selected = -1 - self.load() - return QtGui.QDialog.exec_(self) - - def load(self): - """ - Load the form with data and set the initial state of the buttons - """ - self.newPushButton.setEnabled(True) - self.updatePushButton.setEnabled(False) - self.deletePushButton.setEnabled(False) - for linenumber, html in enumerate(DisplayTags.get_html_tags()): - self.tagTableWidget.setRowCount( - self.tagTableWidget.rowCount() + 1) - self.tagTableWidget.setItem(linenumber, 0, - QtGui.QTableWidgetItem(html[u'desc'])) - self.tagTableWidget.setItem(linenumber, 1, - QtGui.QTableWidgetItem(self._strip(html[u'start tag']))) - self.tagTableWidget.setItem(linenumber, 2, - QtGui.QTableWidgetItem(html[u'start html'])) - self.tagTableWidget.setItem(linenumber, 3, - QtGui.QTableWidgetItem(html[u'end html'])) - self.tagTableWidget.resizeRowsToContents() - self.descriptionLineEdit.setText(u'') - self.tagLineEdit.setText(u'') - self.startTagLineEdit.setText(u'') - self.endTagLineEdit.setText(u'') - self.descriptionLineEdit.setEnabled(False) - self.tagLineEdit.setEnabled(False) - self.startTagLineEdit.setEnabled(False) - self.endTagLineEdit.setEnabled(False) def accept(self): """ @@ -223,6 +204,29 @@ class DisplayTagForm(QtGui.QDialog, Ui_DisplayTagDialog): """ self.tagTableWidget.clearContents() self.tagTableWidget.setRowCount(0) + self.newPushButton.setEnabled(True) + self.updatePushButton.setEnabled(False) + self.deletePushButton.setEnabled(False) + for linenumber, html in enumerate(DisplayTags.get_html_tags()): + self.tagTableWidget.setRowCount( + self.tagTableWidget.rowCount() + 1) + self.tagTableWidget.setItem(linenumber, 0, + QtGui.QTableWidgetItem(html[u'desc'])) + self.tagTableWidget.setItem(linenumber, 1, + QtGui.QTableWidgetItem(self._strip(html[u'start tag']))) + self.tagTableWidget.setItem(linenumber, 2, + QtGui.QTableWidgetItem(html[u'start html'])) + self.tagTableWidget.setItem(linenumber, 3, + QtGui.QTableWidgetItem(html[u'end html'])) + self.tagTableWidget.resizeRowsToContents() + self.descriptionLineEdit.setText(u'') + self.tagLineEdit.setText(u'') + self.startTagLineEdit.setText(u'') + self.endTagLineEdit.setText(u'') + self.descriptionLineEdit.setEnabled(False) + self.tagLineEdit.setEnabled(False) + self.startTagLineEdit.setEnabled(False) + self.endTagLineEdit.setEnabled(False) def _strip(self, tag): """ From fdb5c574683b755b99f5aaa29f192040ef381fdd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20P=C3=B5ldaru?= Date: Mon, 21 Feb 2011 22:37:18 +0200 Subject: [PATCH 094/123] Additional extensions hack. --- openlp/plugins/media/lib/mediaitem.py | 4 ++-- openlp/plugins/media/mediaplugin.py | 20 ++++++++++++++++---- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/openlp/plugins/media/lib/mediaitem.py b/openlp/plugins/media/lib/mediaitem.py index 9f3f98636..8bf201180 100644 --- a/openlp/plugins/media/lib/mediaitem.py +++ b/openlp/plugins/media/lib/mediaitem.py @@ -61,8 +61,8 @@ class MediaMediaItem(MediaManagerItem): self.onNewPrompt = translate('MediaPlugin.MediaItem', 'Select Media') self.onNewFileMasks = unicode(translate('MediaPlugin.MediaItem', 'Videos (%s);;Audio (%s);;%s (*)')) % ( - u' '.join(self.parent.video_list), - u' '.join(self.parent.audio_list), UiStrings.AllFiles) + u' '.join(self.parent.video_extensions_list), + u' '.join(self.parent.audio_extensions_list), UiStrings.AllFiles) self.replaceAction.setText(UiStrings.ReplaceBG) self.replaceAction.setToolTip(UiStrings.ReplaceLiveBG) self.resetAction.setText(UiStrings.ResetBG) diff --git a/openlp/plugins/media/mediaplugin.py b/openlp/plugins/media/mediaplugin.py index bfe9dbff0..1514b6cb2 100644 --- a/openlp/plugins/media/mediaplugin.py +++ b/openlp/plugins/media/mediaplugin.py @@ -45,15 +45,19 @@ class MediaPlugin(Plugin): self.icon = build_icon(self.icon_path) # passed with drag and drop messages self.dnd_id = u'Media' - self.audio_list = [] - self.video_list = [] + # This is yet a dummy example: + self.additional_extensions = { + 'audio/msaudio': ['.mp3', '.aac'], + 'video/msvideo': ['.wmv', '.avi']} + self.audio_extensions_list = [] + self.video_extensions_list = [] mimetypes.init() for mimetype in Phonon.BackendCapabilities.availableMimeTypes(): mimetype = unicode(mimetype) if mimetype.startswith(u'audio/'): - self._addToList(self.audio_list, mimetype) + self._addToList(self.audio_extensions_list, mimetype) elif mimetype.startswith(u'video/'): - self._addToList(self.video_list, mimetype) + self._addToList(self.video_extensions_list, mimetype) def _addToList(self, list, mimetype): extensions = mimetypes.guess_all_extensions(unicode(mimetype)) @@ -64,6 +68,14 @@ class MediaPlugin(Plugin): self.serviceManager.supportedSuffixes(extension[1:]) log.info(u'MediaPlugin: %s extensions: %s' % (mimetype, u' '.join(extensions))) + if mimetype in self.additional_extensions.keys(): + for extension in self.additional_extensions[mimetype]: + ext = u'*%s' % extensions + if ext not in list: + list.append(ext) + self.serviceManager.supportedSuffixes(extension[1:]) + log.info(u'MediaPlugin: %s additional extensions: %s' % (mimetype, + u' '.join(self.additional_extensions[mimetype]))) def about(self): about_text = translate('MediaPlugin', 'Media Plugin' From 0ecc3c2dc9e5924559ed9222f0229526163c5bb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Armin=20K=C3=B6hler?= Date: Mon, 21 Feb 2011 23:03:09 +0100 Subject: [PATCH 095/123] adapt "Author unknown" similar to xml.py correct some whitespaces and quotation marks --- .../plugins/songs/lib/foilpresenterimport.py | 85 +++++++++---------- 1 file changed, 42 insertions(+), 43 deletions(-) diff --git a/openlp/plugins/songs/lib/foilpresenterimport.py b/openlp/plugins/songs/lib/foilpresenterimport.py index 635137b00..963561cb5 100644 --- a/openlp/plugins/songs/lib/foilpresenterimport.py +++ b/openlp/plugins/songs/lib/foilpresenterimport.py @@ -99,6 +99,7 @@ from openlp.plugins.songs.lib import VerseType from openlp.plugins.songs.lib.songimport import SongImport from openlp.plugins.songs.lib.db import Author, Book, Song, Topic from openlp.plugins.songs.lib.xml import SongXML +from openlp.plugins.songs.lib.ui import SongStrings log = logging.getLogger(__name__) @@ -261,40 +262,40 @@ class FoilPresenter(object): if copyright: strings = [] author_temp = [] - if copyright.find(u"Copyright") != -1: - test = copyright.partition(u"Copyright") + if copyright.find(u'Copyright') != -1: + test = copyright.partition(u'Copyright') copyright = test[0] - elif copyright.find(u"copyright") != -1: - test = copyright.partition(u"copyright") + elif copyright.find(u'copyright') != -1: + test = copyright.partition(u'copyright') copyright = test[0] - elif copyright.find(u"©") != -1: - test = copyright.partition(u"©") + elif copyright.find(u'©') != -1: + test = copyright.partition(u'©') copyright = test[0] - elif copyright.find(u"(c)") != -1: - test = copyright.partition(u"(c)") + elif copyright.find(u'(c)') != -1: + test = copyright.partition(u'(c)') copyright = test[0] - elif copyright.find(u"(C)") != -1: - test = copyright.partition(u"(C)") + elif copyright.find(u'(C)') != -1: + test = copyright.partition(u'(C)') copyright = test[0] - elif copyright.find(u"c)") != -1: - test = copyright.partition(u"c)") + elif copyright.find(u'c)') != -1: + test = copyright.partition(u'c)') copyright = test[0] - elif copyright.find(u"C)") != -1: - test = copyright.partition(u"C)") + elif copyright.find(u'C)') != -1: + test = copyright.partition(u'C)') copyright = test[0] - elif copyright.find(u"C:") != -1: - test = copyright.partition(u"C:") + elif copyright.find(u'C:') != -1: + test = copyright.partition(u'C:') copyright = test[0] - elif copyright.find(u"C,)") != -1: - test = copyright.partition(u"C,)") + elif copyright.find(u'C,)') != -1: + test = copyright.partition(u'C,)') copyright = test[0] copyright = re.compile(u'\\n').sub(u' ', copyright) copyright = re.compile(u'\(.*\)').sub(u'', copyright) - if copyright.find(u"Rechte") != -1: - test = copyright.partition(u"Rechte") + if copyright.find(u'Rechte') != -1: + test = copyright.partition(u'Rechte') copyright = test[0] markers = [u'Text +u\.?n?d? +Melodie[a-zA-Z0-9\,\. ]*:', - u'Text +u\.?n?d? +Musik', u"T & M", u'Melodie und Satz', + u'Text +u\.?n?d? +Musik', u'T & M', u'Melodie und Satz', u'Text[a-zA-Z0-9\,\. ]*:', u'Melodie', u'Musik', u'Satz', u'Weise', u'[dD]eutsch', u'[dD]t[\.\:]', u'Englisch', u'[oO]riginal', u'Bearbeitung', u'[R|r]efrain'] @@ -304,9 +305,9 @@ class FoilPresenter(object): i = 0 x = 0 while i != 1: - if copyright.find(u"") != -1: - test = copyright.partition(u"") - if (test[0].strip() != u"") & (x > 0): + if copyright.find(u'') != -1: + test = copyright.partition(u'') + if (test[0].strip() != u'') & (x > 0): strings.append(test[0]) copyright = test[2] x += 1 @@ -316,7 +317,7 @@ class FoilPresenter(object): else: i = 1 for author in strings: - test = re.split(u",(?=\D{2})|(?<=\D),|\/(?=\D{3,})|(?<=\D);", + test = re.split(u',(?=\D{2})|(?<=\D),|\/(?=\D{3,})|(?<=\D);', author) for test_temp in test: author_temp.append(test_temp) @@ -332,16 +333,14 @@ class FoilPresenter(object): if re.search( u'\w+\.?\s+\w{3,}\s+[a|u]nd\s|\w+\.?\s+\w{3,}\s+&\s', author, re.U) != None: - temp = re.split(u'\s[a|u]nd\s|\s&\s',author) + temp = re.split(u'\s[a|u]nd\s|\s&\s', author) for temp_temp in temp: temp_temp = temp_temp.strip() authors.append(temp_temp) elif (len(author) > 2): authors.append(author) if not authors: - # Add "Author unknown" (can be translated). - authors.append((unicode(translate('SongsPlugin.XML', - 'Author unknown')))) + authors.append(SongStrings.AuthorUnknownUnT) for display_name in authors: author = self.manager.get_object_filtered(Author, Author.display_name == display_name) @@ -415,18 +414,18 @@ class FoilPresenter(object): search_text = u'' temp_verse_order = {} temp_verse_order_backup = [] - temp_verse_sort= [] + temp_verse_sort = [] temp_sortnr_backup = 1 temp_sortnr_liste = [] - versenumber = {u"V":1, u"C": 1, u"B": 1, u"E": 1, u"O": 1, u"I": 1, - u"P": 1 } + versenumber = {u'V': 1, u'C': 1, u'B': 1, u'E': 1, u'O': 1, u'I': 1, + u'P': 1 } for strophe in foilpresenterfolie.strophen.strophe: text = self._child(strophe.text_) verse_name = self._child(strophe.key) children = strophe.getchildren() sortnr = 0 for child in children: - if child.tag == "sortnr": + if child.tag == 'sortnr': verse_sortnr = self._child(strophe.sortnr) sortnr = 1 # In older Version there is no sortnr, but we need one @@ -437,26 +436,26 @@ class FoilPresenter(object): temp_sortnr_liste.append(verse_sortnr) temp_verse_name = re.compile(u'[0-9].*').sub(u'', verse_name) temp_verse_name = temp_verse_name[:3].lower() - if temp_verse_name == u"ref": + if temp_verse_name == u'ref': verse_type = u'C' - elif temp_verse_name == u"r": + elif temp_verse_name == u'r': verse_type = u'C' - elif temp_verse_name == u"": + elif temp_verse_name == u'': verse_type = u'V' - elif temp_verse_name == u"v": + elif temp_verse_name == u'v': verse_type = u'V' - elif temp_verse_name == u"bri": + elif temp_verse_name == u'bri': verse_type = u'B' - elif temp_verse_name == u"cod": + elif temp_verse_name == u'cod': verse_type = u'E' - elif temp_verse_name == u"sch": + elif temp_verse_name == u'sch': verse_type = u'E' - elif temp_verse_name == u"pre": + elif temp_verse_name == u'pre': verse_type = u'P' - elif temp_verse_name == u"int": + elif temp_verse_name == u'int': verse_type = u'I' else: - verse_type = u"O" + verse_type = u'O' verse_number = re.compile(u'[a-zA-Z.+-_ ]*').sub(u'', verse_name) verse_part = re.compile(u'[0-9]*').sub(u'', verse_name[1:]) # Foilpresenter allows e. g. "C", but we need "C1". From fb120858e01f25822fd636d5d8f2af22fc15849f Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Mon, 21 Feb 2011 22:10:08 +0000 Subject: [PATCH 096/123] Cleanups --- openlp/core/ui/displaytagdialog.py | 5 +++-- openlp/core/ui/displaytagform.py | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/openlp/core/ui/displaytagdialog.py b/openlp/core/ui/displaytagdialog.py index edb8567cf..7e3d21856 100644 --- a/openlp/core/ui/displaytagdialog.py +++ b/openlp/core/ui/displaytagdialog.py @@ -26,7 +26,7 @@ from PyQt4 import QtCore, QtGui -from openlp.core.lib import translate, build_icon +from openlp.core.lib import translate from openlp.core.lib.ui import UiStrings, create_accept_reject_button_box class Ui_DisplayTagDialog(object): @@ -134,7 +134,8 @@ class Ui_DisplayTagDialog(object): self.tagLabel.setText(translate('OpenLP.DisplayTagDialog', 'Tag')) self.startTagLabel.setText( translate('OpenLP.DisplayTagDialog', 'Start tag')) - self.endTagLabel.setText(translate('OpenLP.DisplayTagDialog', 'End tag')) + self.endTagLabel.setText( + translate('OpenLP.DisplayTagDialog', 'End tag')) self.deletePushButton.setText(UiStrings.Delete) self.defaultPushButton.setText( translate('OpenLP.DisplayTagDialog', 'Default')) diff --git a/openlp/core/ui/displaytagform.py b/openlp/core/ui/displaytagform.py index fa05c578a..82f475338 100644 --- a/openlp/core/ui/displaytagform.py +++ b/openlp/core/ui/displaytagform.py @@ -34,7 +34,7 @@ import cPickle from PyQt4 import QtCore, QtGui from openlp.core.lib import translate, DisplayTags -from openlp.core.lib.ui import UiStrings, critical_error_message_box +from openlp.core.lib.ui import critical_error_message_box from openlp.core.ui.displaytagdialog import Ui_DisplayTagDialog class DisplayTagForm(QtGui.QDialog, Ui_DisplayTagDialog): From 4d1f1e933ebe11247c478eebbccc55aff76fd75f Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Mon, 21 Feb 2011 22:27:27 +0000 Subject: [PATCH 097/123] Make importer inits consistent --- openlp/plugins/songs/lib/oooimport.py | 4 ++-- openlp/plugins/songs/lib/openlyricsimport.py | 6 +++--- openlp/plugins/songs/lib/sofimport.py | 4 ++-- openlp/plugins/songs/lib/songbeamerimport.py | 9 +++------ openlp/plugins/songs/lib/songshowplusimport.py | 9 +++------ openlp/plugins/songs/lib/wowimport.py | 9 +++------ 6 files changed, 16 insertions(+), 25 deletions(-) diff --git a/openlp/plugins/songs/lib/oooimport.py b/openlp/plugins/songs/lib/oooimport.py index 863fec2b8..29ab60a22 100644 --- a/openlp/plugins/songs/lib/oooimport.py +++ b/openlp/plugins/songs/lib/oooimport.py @@ -50,12 +50,12 @@ class OooImport(SongImport): """ Import songs from Impress/Powerpoint docs using Impress """ - def __init__(self, master_manager, **kwargs): + def __init__(self, manager, **kwargs): """ Initialise the class. Requires a songmanager class which is passed to SongImport for writing song to disk """ - SongImport.__init__(self, master_manager, **kwargs) + SongImport.__init__(self, manager, **kwargs) self.document = None self.process_started = False diff --git a/openlp/plugins/songs/lib/openlyricsimport.py b/openlp/plugins/songs/lib/openlyricsimport.py index 0396335b8..6dcb62699 100644 --- a/openlp/plugins/songs/lib/openlyricsimport.py +++ b/openlp/plugins/songs/lib/openlyricsimport.py @@ -43,12 +43,12 @@ class OpenLyricsImport(SongImport): """ This provides the Openlyrics import. """ - def __init__(self, master_manager, **kwargs): + def __init__(self, manager, **kwargs): """ - Initialise the import. + Initialise the Open Lyrics importer. """ log.debug(u'initialise OpenLyricsImport') - SongImport.__init__(self, master_manager, **kwargs) + SongImport.__init__(self, manager, **kwargs) self.openLyrics = OpenLyrics(self.manager) def do_import(self): diff --git a/openlp/plugins/songs/lib/sofimport.py b/openlp/plugins/songs/lib/sofimport.py index cfb80caa3..3f329947e 100644 --- a/openlp/plugins/songs/lib/sofimport.py +++ b/openlp/plugins/songs/lib/sofimport.py @@ -66,12 +66,12 @@ class SofImport(OooImport): It attempts to detect italiced verses, and treats these as choruses in the verse ordering. Again not perfect, but a start. """ - def __init__(self, master_manager, **kwargs): + def __init__(self, manager, **kwargs): """ Initialise the class. Requires a songmanager class which is passed to SongImport for writing song to disk """ - OooImport.__init__(self, master_manager, **kwargs) + OooImport.__init__(self, manager, **kwargs) def process_ooo_document(self): """ diff --git a/openlp/plugins/songs/lib/songbeamerimport.py b/openlp/plugins/songs/lib/songbeamerimport.py index afb9f5646..ccae6a8ea 100644 --- a/openlp/plugins/songs/lib/songbeamerimport.py +++ b/openlp/plugins/songs/lib/songbeamerimport.py @@ -67,14 +67,11 @@ class SongBeamerImport(SongImport): Song Beamer file format is text based in the beginning are one or more control tags written """ - def __init__(self, master_manager, **kwargs): + def __init__(self, manager, **kwargs): """ - Initialise the import. - - ``master_manager`` - The song manager for the running OpenLP installation. + Initialise the Song Beamer importer. """ - SongImport.__init__(self, master_manager, **kwargs) + SongImport.__init__(self, manager, **kwargs) def do_import(self): """ diff --git a/openlp/plugins/songs/lib/songshowplusimport.py b/openlp/plugins/songs/lib/songshowplusimport.py index 74040bcc0..757138966 100644 --- a/openlp/plugins/songs/lib/songshowplusimport.py +++ b/openlp/plugins/songs/lib/songshowplusimport.py @@ -86,14 +86,11 @@ class SongShowPlusImport(SongImport): otherList = {} otherCount = 0 - def __init__(self, master_manager, **kwargs): + def __init__(self, manager, **kwargs): """ - Initialise the import. - - ``master_manager`` - The song manager for the running OpenLP installation. + Initialise the SongShow Plus importer. """ - SongImport.__init__(self, master_manager, **kwargs) + SongImport.__init__(self, manager, **kwargs) def do_import(self): """ diff --git a/openlp/plugins/songs/lib/wowimport.py b/openlp/plugins/songs/lib/wowimport.py index 05c9704f6..5f5f4f289 100644 --- a/openlp/plugins/songs/lib/wowimport.py +++ b/openlp/plugins/songs/lib/wowimport.py @@ -92,14 +92,11 @@ class WowImport(SongImport): * .wow-song """ - def __init__(self, master_manager, **kwargs): + def __init__(self, manager, **kwargs): """ - Initialise the import. - - ``master_manager`` - The song manager for the running OpenLP installation. + Initialise the Words of Worship importer. """ - SongImport.__init__(self, master_manager, **kwargs) + SongImport.__init__(self, manager, **kwargs) def do_import(self): """ From 44a50b035177d10eead3132626ff279fce2d5072 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Tue, 22 Feb 2011 02:30:38 +0000 Subject: [PATCH 098/123] Naming --- openlp/plugins/bibles/lib/manager.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/openlp/plugins/bibles/lib/manager.py b/openlp/plugins/bibles/lib/manager.py index 85204ac7a..e626462e0 100644 --- a/openlp/plugins/bibles/lib/manager.py +++ b/openlp/plugins/bibles/lib/manager.py @@ -40,9 +40,9 @@ from osis import OSISBible # Imports that might fail. try: from openlp1 import OpenLP1Bible - has_openlp1 = True + HAS_OPENLP1 = True except ImportError: - has_openlp1 = False + HAS_OPENLP1 = False log = logging.getLogger(__name__) @@ -367,6 +367,6 @@ class BibleManager(object): for bible in self.db_cache: self.db_cache[bible].finalise() -BibleFormat.set_availability(BibleFormat.OpenLP1, has_openlp1) +BibleFormat.set_availability(BibleFormat.OpenLP1, HAS_OPENLP1) __all__ = [u'BibleFormat'] From a5e8833132f1893069a76cf71d76da32b0af4c2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20P=C3=B5ldaru?= Date: Tue, 22 Feb 2011 08:58:32 +0200 Subject: [PATCH 099/123] Remove bogus data. --- openlp/plugins/media/mediaplugin.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/openlp/plugins/media/mediaplugin.py b/openlp/plugins/media/mediaplugin.py index 1514b6cb2..51cf1b9ad 100644 --- a/openlp/plugins/media/mediaplugin.py +++ b/openlp/plugins/media/mediaplugin.py @@ -47,8 +47,7 @@ class MediaPlugin(Plugin): self.dnd_id = u'Media' # This is yet a dummy example: self.additional_extensions = { - 'audio/msaudio': ['.mp3', '.aac'], - 'video/msvideo': ['.wmv', '.avi']} + 'video/msvideo': ['.avi']} # only an example line, unnecessary self.audio_extensions_list = [] self.video_extensions_list = [] mimetypes.init() From 29207d8dffe07417ae968e742928092be86dcf59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20P=C3=B5ldaru?= Date: Tue, 22 Feb 2011 11:09:47 +0200 Subject: [PATCH 100/123] Added comments to code blocks. --- openlp/plugins/media/mediaplugin.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/openlp/plugins/media/mediaplugin.py b/openlp/plugins/media/mediaplugin.py index 51cf1b9ad..d76df6897 100644 --- a/openlp/plugins/media/mediaplugin.py +++ b/openlp/plugins/media/mediaplugin.py @@ -45,9 +45,8 @@ class MediaPlugin(Plugin): self.icon = build_icon(self.icon_path) # passed with drag and drop messages self.dnd_id = u'Media' - # This is yet a dummy example: - self.additional_extensions = { - 'video/msvideo': ['.avi']} # only an example line, unnecessary + self.additional_extensions = {} + #'video/msvideo': ['.avi']} This is an example line. self.audio_extensions_list = [] self.video_extensions_list = [] mimetypes.init() @@ -59,6 +58,7 @@ class MediaPlugin(Plugin): self._addToList(self.video_extensions_list, mimetype) def _addToList(self, list, mimetype): + # Add all extensions which mimetypes provides us for supported types. extensions = mimetypes.guess_all_extensions(unicode(mimetype)) for extension in extensions: ext = u'*%s' % extension @@ -67,6 +67,8 @@ class MediaPlugin(Plugin): self.serviceManager.supportedSuffixes(extension[1:]) log.info(u'MediaPlugin: %s extensions: %s' % (mimetype, u' '.join(extensions))) + # Add all extensions listed in self.additional_extensions, to hack + # away mimetypes' shortcomings. if mimetype in self.additional_extensions.keys(): for extension in self.additional_extensions[mimetype]: ext = u'*%s' % extensions From 98d8b1f5902c481656ae9e6a850ad3f799403216 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20P=C3=B5ldaru?= Date: Tue, 22 Feb 2011 17:01:07 +0200 Subject: [PATCH 101/123] More clear comment. Unfortunately there is no need to change few lines of code between these two changes, to include these into diff. That would be self-explanantory. --- openlp/plugins/media/mediaplugin.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/openlp/plugins/media/mediaplugin.py b/openlp/plugins/media/mediaplugin.py index d76df6897..a92de5314 100644 --- a/openlp/plugins/media/mediaplugin.py +++ b/openlp/plugins/media/mediaplugin.py @@ -46,7 +46,7 @@ class MediaPlugin(Plugin): # passed with drag and drop messages self.dnd_id = u'Media' self.additional_extensions = {} - #'video/msvideo': ['.avi']} This is an example line. + # 'video/msvideo': ['.avi']} This is an example line. self.audio_extensions_list = [] self.video_extensions_list = [] mimetypes.init() @@ -67,8 +67,9 @@ class MediaPlugin(Plugin): self.serviceManager.supportedSuffixes(extension[1:]) log.info(u'MediaPlugin: %s extensions: %s' % (mimetype, u' '.join(extensions))) - # Add all extensions listed in self.additional_extensions, to hack - # away mimetypes' shortcomings. + # Add all extensions listed in self.additional_extensions, which + # have this mimetype, previously claimed to be supported by Phonon, + # to hack away mimetypes' shortcomings in providing some extensions. if mimetype in self.additional_extensions.keys(): for extension in self.additional_extensions[mimetype]: ext = u'*%s' % extensions From 642934a999f7dfc8a0d0e272de3ad50782e51530 Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Tue, 22 Feb 2011 20:41:35 +0200 Subject: [PATCH 102/123] Fixed a bug where the settings for the remotes plugin were not actually used. --- openlp/plugins/remotes/lib/httpserver.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/openlp/plugins/remotes/lib/httpserver.py b/openlp/plugins/remotes/lib/httpserver.py index 6ec9476a8..7ced66103 100644 --- a/openlp/plugins/remotes/lib/httpserver.py +++ b/openlp/plugins/remotes/lib/httpserver.py @@ -68,11 +68,13 @@ class HttpServer(object): """ log.debug(u'Start TCP server') port = QtCore.QSettings().value( - self.parent.settingsSection + u'/remote port', + self.parent.settingsSection + u'/port', QtCore.QVariant(4316)).toInt()[0] + address = QtCore.QSettings().value( + self.parent.settingsSection + u'/ip address', + QtCore.QVariant(u'0.0.0.0')).toString() self.server = QtNetwork.QTcpServer() - self.server.listen(QtNetwork.QHostAddress(QtNetwork.QHostAddress.Any), - port) + self.server.listen(QtNetwork.QHostAddress(address), port) QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'slidecontroller_live_changed'), self.slide_change) @@ -347,4 +349,4 @@ class HttpConnection(object): log.debug(u'close socket') self.socket.close() self.socket = None - self.parent.close_connection(self) \ No newline at end of file + self.parent.close_connection(self) From 71068d4eb65eb8d214d0e0f8df7ec6c711fa1fef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Armin=20K=C3=B6hler?= Date: Tue, 22 Feb 2011 21:35:18 +0100 Subject: [PATCH 103/123] fix inconsistant field names, refer now to the xml file --- .../plugins/songs/lib/foilpresenterimport.py | 91 +++++++++---------- 1 file changed, 44 insertions(+), 47 deletions(-) diff --git a/openlp/plugins/songs/lib/foilpresenterimport.py b/openlp/plugins/songs/lib/foilpresenterimport.py index 963561cb5..30c94303b 100644 --- a/openlp/plugins/songs/lib/foilpresenterimport.py +++ b/openlp/plugins/songs/lib/foilpresenterimport.py @@ -105,7 +105,7 @@ log = logging.getLogger(__name__) class FoilPresenterImport(SongImport): """ - This provides the Openlyrics import. + This provides the Foilpresenter import. """ def __init__(self, master_manager, **kwargs): """ @@ -263,37 +263,37 @@ class FoilPresenter(object): strings = [] author_temp = [] if copyright.find(u'Copyright') != -1: - test = copyright.partition(u'Copyright') - copyright = test[0] + temp = copyright.partition(u'Copyright') + copyright = temp[0] elif copyright.find(u'copyright') != -1: - test = copyright.partition(u'copyright') - copyright = test[0] + temp = copyright.partition(u'copyright') + copyright = temp[0] elif copyright.find(u'©') != -1: - test = copyright.partition(u'©') - copyright = test[0] + temp = copyright.partition(u'©') + copyright = temp[0] elif copyright.find(u'(c)') != -1: - test = copyright.partition(u'(c)') - copyright = test[0] + temp = copyright.partition(u'(c)') + copyright = temp[0] elif copyright.find(u'(C)') != -1: - test = copyright.partition(u'(C)') - copyright = test[0] + temp = copyright.partition(u'(C)') + copyright = temp[0] elif copyright.find(u'c)') != -1: - test = copyright.partition(u'c)') - copyright = test[0] + temp = copyright.partition(u'c)') + copyright = temp[0] elif copyright.find(u'C)') != -1: - test = copyright.partition(u'C)') - copyright = test[0] + temp = copyright.partition(u'C)') + copyright = temp[0] elif copyright.find(u'C:') != -1: - test = copyright.partition(u'C:') - copyright = test[0] + temp = copyright.partition(u'C:') + copyright = temp[0] elif copyright.find(u'C,)') != -1: - test = copyright.partition(u'C,)') - copyright = test[0] + temp = copyright.partition(u'C,)') + copyright = temp[0] copyright = re.compile(u'\\n').sub(u' ', copyright) copyright = re.compile(u'\(.*\)').sub(u'', copyright) if copyright.find(u'Rechte') != -1: - test = copyright.partition(u'Rechte') - copyright = test[0] + temp = copyright.partition(u'Rechte') + copyright = temp[0] markers = [u'Text +u\.?n?d? +Melodie[a-zA-Z0-9\,\. ]*:', u'Text +u\.?n?d? +Musik', u'T & M', u'Melodie und Satz', u'Text[a-zA-Z0-9\,\. ]*:', u'Melodie', u'Musik', u'Satz', @@ -306,10 +306,10 @@ class FoilPresenter(object): x = 0 while i != 1: if copyright.find(u'') != -1: - test = copyright.partition(u'') - if (test[0].strip() != u'') & (x > 0): - strings.append(test[0]) - copyright = test[2] + temp = copyright.partition(u'') + if (temp[0].strip() != u'') & (x > 0): + strings.append(temp[0]) + copyright = temp[2] x += 1 elif x > 0: strings.append(copyright) @@ -317,10 +317,10 @@ class FoilPresenter(object): else: i = 1 for author in strings: - test = re.split(u',(?=\D{2})|(?<=\D),|\/(?=\D{3,})|(?<=\D);', + temp = re.split(u',(?=\D{2})|(?<=\D),|\/(?=\D{3,})|(?<=\D);', author) - for test_temp in test: - author_temp.append(test_temp) + for tempx in temp: + author_temp.append(tempx) for author in author_temp: regex = u'^[\/,;\-\s]+|[\/,;\-\s]+$|'\ '\s*[0-9]{4}\s*[\-\/]?\s*([0-9]{4})?[\/,;\-\s]*$' @@ -334,9 +334,9 @@ class FoilPresenter(object): u'\w+\.?\s+\w{3,}\s+[a|u]nd\s|\w+\.?\s+\w{3,}\s+&\s', author, re.U) != None: temp = re.split(u'\s[a|u]nd\s|\s&\s', author) - for temp_temp in temp: - temp_temp = temp_temp.strip() - authors.append(temp_temp) + for tempx in temp: + tempx = tempx.strip() + authors.append(tempx) elif (len(author) > 2): authors.append(author) if not authors: @@ -347,8 +347,8 @@ class FoilPresenter(object): if author is None: # We need to create a new author, as the author does not exist. author = Author.populate(display_name=display_name, - last_name=display_name.split(u' ')[-1], - first_name=u' '.join(display_name.split(u' ')[:-1])) + last_name = display_name.split(u' ')[-1], + first_name = u' '.join(display_name.split(u' ')[:-1])) self.manager.save_object(author) song.authors.append(author) @@ -404,9 +404,6 @@ class FoilPresenter(object): ``foilpresenterfolie`` The foilpresenterfolie object (lxml.objectify.ObjectifiedElement). - ``lyrics`` - The lyrics object (lxml.objectify.ObjectifiedElement). - ``song`` The song object. """ @@ -418,14 +415,14 @@ class FoilPresenter(object): temp_sortnr_backup = 1 temp_sortnr_liste = [] versenumber = {u'V': 1, u'C': 1, u'B': 1, u'E': 1, u'O': 1, u'I': 1, - u'P': 1 } + u'P': 1} for strophe in foilpresenterfolie.strophen.strophe: text = self._child(strophe.text_) verse_name = self._child(strophe.key) children = strophe.getchildren() sortnr = 0 for child in children: - if child.tag == 'sortnr': + if child.tag == u'sortnr': verse_sortnr = self._child(strophe.sortnr) sortnr = 1 # In older Version there is no sortnr, but we need one @@ -506,8 +503,8 @@ class FoilPresenter(object): song.song_book_id = 0 song.song_number = u'' try: - for songbook in foilpresenterfolie.buch.bucheintrag: - bookname = self._child(songbook.name) + for bucheintrag in foilpresenterfolie.buch.bucheintrag: + bookname = self._child(bucheintrag.name) if bookname: book = self.manager.get_object_filtered(Book, Book.name == bookname) @@ -517,8 +514,8 @@ class FoilPresenter(object): self.manager.save_object(book) song.song_book_id = book.id try: - if self._child(songbook.nummer): - song.song_number = self._child(songbook.nummer) + if self._child(bucheintrag.nummer): + song.song_number = self._child(bucheintrag.nummer) except AttributeError: pass # We only support one song book, so take the first one. @@ -536,13 +533,13 @@ class FoilPresenter(object): ``song`` The song object. """ - for title in foilpresenterfolie.titel.titelstring: + for titelstring in foilpresenterfolie.titel.titelstring: if not song.title: - song.title = self._child(title) + song.title = self._child(titelstring) song.search_title = unicode(song.title) song.alternate_title = u'' else: - song.alternate_title = self._child(title) + song.alternate_title = self._child(titelstring) song.search_title += u'@' + song.alternate_title song.search_title = re.sub(r'[\'"`,;:(){}?]+', u'', unicode(song.search_title)).lower() @@ -558,8 +555,8 @@ class FoilPresenter(object): The song object. """ try: - for topictext in foilpresenterfolie.kategorien.name: - topictext = self._child(topictext) + for name in foilpresenterfolie.kategorien.name: + topictext = self._child(name) if topictext: topic = self.manager.get_object_filtered(Topic, Topic.name == topictext) From 9f9720e3682fa6cdc2aa4a78dbdc6313e42e2868 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20P=C3=B5ldaru?= Date: Tue, 22 Feb 2011 23:32:07 +0200 Subject: [PATCH 104/123] Added some extensions. --- openlp/plugins/media/mediaplugin.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/openlp/plugins/media/mediaplugin.py b/openlp/plugins/media/mediaplugin.py index a92de5314..08d21e6ce 100644 --- a/openlp/plugins/media/mediaplugin.py +++ b/openlp/plugins/media/mediaplugin.py @@ -45,8 +45,16 @@ class MediaPlugin(Plugin): self.icon = build_icon(self.icon_path) # passed with drag and drop messages self.dnd_id = u'Media' - self.additional_extensions = {} - # 'video/msvideo': ['.avi']} This is an example line. + self.additional_extensions = { + u'audio/ac3': [u'.ac3'], + u'audio/qcelp': [u'.qcp'], + u'audio/riff-midi': [u'.rmi'], + u'audio/x-alaw': [u'.alaw'], + u'audio/x-m4a': [u'.m4a'], + u'audio/x-mp3': [u'.mp3'], + u'audio/x-wma': [u'.wma'], + u'video/x-wmv': [u'.wmv'], + u'video/x-xvid': [u'.xvid']} self.audio_extensions_list = [] self.video_extensions_list = [] mimetypes.init() @@ -65,7 +73,7 @@ class MediaPlugin(Plugin): if ext not in list: list.append(ext) self.serviceManager.supportedSuffixes(extension[1:]) - log.info(u'MediaPlugin: %s extensions: %s' % (mimetype, + log.info(u'MediaPlugin: %s extensions: %s' % (mimetype, u' '.join(extensions))) # Add all extensions listed in self.additional_extensions, which # have this mimetype, previously claimed to be supported by Phonon, @@ -76,7 +84,7 @@ class MediaPlugin(Plugin): if ext not in list: list.append(ext) self.serviceManager.supportedSuffixes(extension[1:]) - log.info(u'MediaPlugin: %s additional extensions: %s' % (mimetype, + log.info(u'MediaPlugin: %s additional extensions: %s' % (mimetype, u' '.join(self.additional_extensions[mimetype]))) def about(self): From 158b358bae2ae16b96782847ea0e183249ca981a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20P=C3=B5ldaru?= Date: Tue, 22 Feb 2011 23:35:25 +0200 Subject: [PATCH 105/123] Removed hack, leave only more detailed logging. --- openlp/plugins/media/mediaplugin.py | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/openlp/plugins/media/mediaplugin.py b/openlp/plugins/media/mediaplugin.py index 08d21e6ce..74a8f3f2e 100644 --- a/openlp/plugins/media/mediaplugin.py +++ b/openlp/plugins/media/mediaplugin.py @@ -45,16 +45,6 @@ class MediaPlugin(Plugin): self.icon = build_icon(self.icon_path) # passed with drag and drop messages self.dnd_id = u'Media' - self.additional_extensions = { - u'audio/ac3': [u'.ac3'], - u'audio/qcelp': [u'.qcp'], - u'audio/riff-midi': [u'.rmi'], - u'audio/x-alaw': [u'.alaw'], - u'audio/x-m4a': [u'.m4a'], - u'audio/x-mp3': [u'.mp3'], - u'audio/x-wma': [u'.wma'], - u'video/x-wmv': [u'.wmv'], - u'video/x-xvid': [u'.xvid']} self.audio_extensions_list = [] self.video_extensions_list = [] mimetypes.init() @@ -75,17 +65,6 @@ class MediaPlugin(Plugin): self.serviceManager.supportedSuffixes(extension[1:]) log.info(u'MediaPlugin: %s extensions: %s' % (mimetype, u' '.join(extensions))) - # Add all extensions listed in self.additional_extensions, which - # have this mimetype, previously claimed to be supported by Phonon, - # to hack away mimetypes' shortcomings in providing some extensions. - if mimetype in self.additional_extensions.keys(): - for extension in self.additional_extensions[mimetype]: - ext = u'*%s' % extensions - if ext not in list: - list.append(ext) - self.serviceManager.supportedSuffixes(extension[1:]) - log.info(u'MediaPlugin: %s additional extensions: %s' % (mimetype, - u' '.join(self.additional_extensions[mimetype]))) def about(self): about_text = translate('MediaPlugin', 'Media Plugin' From a5b278b87129b65d7e1ab9d671e1806ee8588c7e Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Wed, 23 Feb 2011 08:42:33 +0200 Subject: [PATCH 106/123] Added a setting in the advanced tab to give the users the option of changing the default display screen. --- openlp/core/ui/advancedtab.py | 86 +++++++++++++++++++---------------- openlp/core/ui/maindisplay.py | 12 ++++- 2 files changed, 56 insertions(+), 42 deletions(-) diff --git a/openlp/core/ui/advancedtab.py b/openlp/core/ui/advancedtab.py index 39fec1f9d..5395e59ef 100644 --- a/openlp/core/ui/advancedtab.py +++ b/openlp/core/ui/advancedtab.py @@ -41,6 +41,8 @@ class AdvancedTab(SettingsTab): Initialise the settings tab """ SettingsTab.__init__(self, u'Advanced') + self.default_image = u':/graphics/openlp-splash-screen.png' + self.default_color = u'#ffffff' def setupUi(self): """ @@ -81,33 +83,28 @@ class AdvancedTab(SettingsTab): self.hideMouseCheckBox.setObjectName(u'hideMouseCheckBox') self.hideMouseLayout.addWidget(self.hideMouseCheckBox) self.leftLayout.addWidget(self.hideMouseGroupBox) -# self.sharedDirGroupBox = QtGui.QGroupBox(self.leftColumn) -# self.sharedDirGroupBox.setObjectName(u'sharedDirGroupBox') -# self.sharedDirLayout = QtGui.QFormLayout(self.sharedDirGroupBox) -# self.sharedCheckBox = QtGui.QCheckBox(self.sharedDirGroupBox) -# self.sharedCheckBox.setObjectName(u'sharedCheckBox') -# self.sharedDirLayout.addRow(self.sharedCheckBox) -# self.sharedLabel = QtGui.QLabel(self.sharedDirGroupBox) -# self.sharedLabel.setObjectName(u'sharedLabel') -# self.sharedSubLayout = QtGui.QHBoxLayout() -# self.sharedSubLayout.setObjectName(u'sharedSubLayout') -# self.sharedLineEdit = QtGui.QLineEdit(self.sharedDirGroupBox) -# self.sharedLineEdit.setObjectName(u'sharedLineEdit') -# self.sharedSubLayout.addWidget(self.sharedLineEdit) -# self.sharedPushButton = QtGui.QPushButton(self.sharedDirGroupBox) -# self.sharedPushButton.setObjectName(u'sharedPushButton') -# self.sharedSubLayout.addWidget(self.sharedPushButton) -# self.sharedDirLayout.addRow(self.sharedLabel, self.sharedSubLayout) -# self.leftLayout.addWidget(self.sharedDirGroupBox) self.leftLayout.addStretch() -# self.databaseGroupBox = QtGui.QGroupBox(self.rightColumn) -# self.databaseGroupBox.setObjectName(u'databaseGroupBox') -# self.databaseGroupBox.setEnabled(False) -# self.databaseLayout = QtGui.QVBoxLayout(self.databaseGroupBox) -# self.rightLayout.addWidget(self.databaseGroupBox) + self.defaultImageGroupBox = QtGui.QGroupBox(self.rightColumn) + self.defaultImageGroupBox.setObjectName(u'defaultImageGroupBox') + self.defaultImageLayout = QtGui.QFormLayout(self.defaultImageGroupBox) + self.defaultImageLayout.setObjectName(u'defaultImageLayout') + self.defaultColorLabel = QtGui.QLabel(self.defaultImageGroupBox) + self.defaultColorLabel.setObjectName(u'defaultColorLabel') + self.defaultColorButton = QtGui.QPushButton(self.defaultImageGroupBox) + self.defaultColorButton.setObjectName(u'defaultColorButton') + self.defaultImageLayout.addRow(self.defaultColorLabel, + self.defaultColorButton) + self.defaultFileLabel = QtGui.QLabel(self.defaultImageGroupBox) + self.defaultFileLabel.setObjectName(u'defaultFileLabel') + self.defaultFileEdit = QtGui.QLineEdit(self.defaultImageGroupBox) + self.defaultFileEdit.setObjectName(u'defaultFileEdit') + self.defaultImageLayout.addRow(self.defaultFileLabel, + self.defaultFileEdit) + self.rightLayout.addWidget(self.defaultImageGroupBox) self.rightLayout.addStretch() -# QtCore.QObject.connect(self.sharedCheckBox, -# QtCore.SIGNAL(u'stateChanged(int)'), self.onSharedCheckBoxChanged) + + QtCore.QObject.connect(self.defaultColorButton, + QtCore.SIGNAL(u'pressed()'), self.onDefaultColorButtonPressed) def retranslateUi(self): """ @@ -129,14 +126,13 @@ class AdvancedTab(SettingsTab): self.hideMouseGroupBox.setTitle(translate('OpenLP.AdvancedTab', 'Mouse Cursor')) self.hideMouseCheckBox.setText(translate('OpenLP.AdvancedTab', - 'Hide the mouse cursor when moved over the display window')) -# self.sharedDirGroupBox.setTitle( -# translate('AdvancedTab', 'Central Data Store')) -# self.sharedCheckBox.setText( -# translate('AdvancedTab', 'Enable a shared data location')) -# self.sharedLabel.setText(translate('AdvancedTab', 'Store location:')) -# self.sharedPushButton.setText(UiStrings.Browse) -# self.databaseGroupBox.setTitle(translate('AdvancedTab', 'Databases')) + 'Hide mouse cursor when over display window')) + self.defaultImageGroupBox.setTitle(translate('OpenLP.AdvancedTab', + 'Default Image')) + self.defaultColorLabel.setText(translate('OpenLP.AdvancedTab', + 'Background color:')) + self.defaultFileLabel.setText(translate('OpenLP.AdvancedTab', + 'Image file:')) def load(self): """ @@ -165,7 +161,14 @@ class AdvancedTab(SettingsTab): QtCore.QVariant(True)).toBool()) self.hideMouseCheckBox.setChecked( settings.value(u'hide mouse', QtCore.QVariant(False)).toBool()) + self.default_color = settings.value(u'default color', + QtCore.QVariant(u'#ffffff')).toString() + self.defaultFileEdit.setText(settings.value(u'default image', + QtCore.QVariant(u':/graphics/openlp-splash-screen.png'))\ + .toString()) settings.endGroup() + self.defaultColorButton.setStyleSheet( + u'background-color: %s' % self.default_color) def save(self): """ @@ -185,12 +188,15 @@ class AdvancedTab(SettingsTab): QtCore.QVariant(self.enableAutoCloseCheckBox.isChecked())) settings.setValue(u'hide mouse', QtCore.QVariant(self.hideMouseCheckBox.isChecked())) + settings.setValue(u'default background color', self.default_color) + settings.setValue(u'default image', self.default_image) settings.endGroup() -# def onSharedCheckBoxChanged(self, checked): -# """ -# Enables the widgets to allow a shared data location -# """ -# self.sharedLabel.setEnabled(checked) -# self.sharedTextEdit.setEnabled(checked) -# self.sharedPushButton.setEnabled(checked) + def onDefaultColorButtonPressed(self): + new_color = QtGui.QColorDialog.getColor( + QtGui.QColor(self.default_color), self) + if new_color.isValid(): + self.default_color = new_color.name() + self.defaultColorButton.setStyleSheet( + u'background-color: %s' % self.default_color) + diff --git a/openlp/core/ui/maindisplay.py b/openlp/core/ui/maindisplay.py index 90042f80b..91d61f1d7 100644 --- a/openlp/core/ui/maindisplay.py +++ b/openlp/core/ui/maindisplay.py @@ -132,14 +132,22 @@ class MainDisplay(DisplayWidget): painter_image.begin(self.black) painter_image.fillRect(self.black.rect(), QtCore.Qt.black) # Build the initial frame. + 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( + u'advanced/default color', + QtCore.QVariant(u'#ffffff')).toString()) + if not background_color.isValid(): + background_color = QtCore.Qt.white + splash_image = QtGui.QImage(image_file) initialFrame = QtGui.QImage( self.screens.current[u'size'].width(), self.screens.current[u'size'].height(), QtGui.QImage.Format_ARGB32_Premultiplied) - splash_image = QtGui.QImage(u':/graphics/openlp-splash-screen.png') painter_image = QtGui.QPainter() painter_image.begin(initialFrame) - painter_image.fillRect(initialFrame.rect(), QtCore.Qt.white) + painter_image.fillRect(initialFrame.rect(), background_color) painter_image.drawImage( (self.screens.current[u'size'].width() - splash_image.width()) / 2, From 99635299ead388ddd99b3a363564e41fc1d0cc5d Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Wed, 23 Feb 2011 15:55:36 +0200 Subject: [PATCH 107/123] Updated with browse button. --- openlp/core/ui/advancedtab.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/openlp/core/ui/advancedtab.py b/openlp/core/ui/advancedtab.py index 5395e59ef..35bc167c0 100644 --- a/openlp/core/ui/advancedtab.py +++ b/openlp/core/ui/advancedtab.py @@ -98,8 +98,14 @@ class AdvancedTab(SettingsTab): self.defaultFileLabel.setObjectName(u'defaultFileLabel') self.defaultFileEdit = QtGui.QLineEdit(self.defaultImageGroupBox) self.defaultFileEdit.setObjectName(u'defaultFileEdit') + self.defaultBrowseButton = QtGui.QToolButton(self.defaultImageGroupBox) + self.defaultBrowseButton.setObjectName(u'defaultBrowseButton') + self.defaultFileLayout = QtGui.QHBoxLayout() + self.defaultFileLayout.setObjectName(u'defaultFileLayout') + self.defaultFileLayout.addWidget(self.defaultFileEdit) + self.defaultFileLayout.addWidget(self.defaultBrowseButton) self.defaultImageLayout.addRow(self.defaultFileLabel, - self.defaultFileEdit) + self.defaultFileLayout) self.rightLayout.addWidget(self.defaultImageGroupBox) self.rightLayout.addStretch() @@ -133,6 +139,7 @@ class AdvancedTab(SettingsTab): 'Background color:')) self.defaultFileLabel.setText(translate('OpenLP.AdvancedTab', 'Image file:')) + self.defaultBrowseButton.setTitle('...') def load(self): """ From de584a8945e02f73d1a52c950caa8306912b15c1 Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Wed, 23 Feb 2011 18:35:27 +0100 Subject: [PATCH 108/123] reworked author unknown --- openlp/plugins/songs/lib/songimport.py | 13 ++++++++++--- openlp/plugins/songs/lib/ui.py | 3 +-- openlp/plugins/songs/lib/xml.py | 11 ++++++++--- openlp/plugins/songs/songsplugin.py | 5 ++--- 4 files changed, 21 insertions(+), 11 deletions(-) diff --git a/openlp/plugins/songs/lib/songimport.py b/openlp/plugins/songs/lib/songimport.py index 40be1675e..a8ca5d7b3 100644 --- a/openlp/plugins/songs/lib/songimport.py +++ b/openlp/plugins/songs/lib/songimport.py @@ -270,8 +270,6 @@ class SongImport(QtCore.QObject): """ All fields have been set to this song. Write the song to disk. """ - if not self.authors: - self.authors.append(SongStrings.AuthorUnknownUnT) log.info(u'committing song %s to database', self.title) song = Song() song.title = self.title @@ -315,10 +313,19 @@ class SongImport(QtCore.QObject): author = self.manager.get_object_filtered(Author, Author.display_name == authortext) if not author: - author = Author.populate(display_name = authortext, + author = Author.populate(display_name=authortext, last_name=authortext.split(u' ')[-1], first_name=u' '.join(authortext.split(u' ')[:-1])) song.authors.append(author) + # No author, add the default author. + if not song.authors: + name = SongStrings.AuthorUnknown + author = self.manager.get_object_filtered( + Author, Author.display_name == name) + if not author: + author = Author.populate( + display_name=name, last_name=u'', first_name=u'') + song.authors.append(author) for filename in self.media_files: media_file = self.manager.get_object_filtered(MediaFile, MediaFile.file_name == filename) diff --git a/openlp/plugins/songs/lib/ui.py b/openlp/plugins/songs/lib/ui.py index 65f473e63..6415c48c9 100644 --- a/openlp/plugins/songs/lib/ui.py +++ b/openlp/plugins/songs/lib/ui.py @@ -36,8 +36,7 @@ class SongStrings(object): # These strings should need a good reason to be retranslated elsewhere. Author = translate('OpenLP.Ui', 'Author', 'Singular') Authors = translate('OpenLP.Ui', 'Authors', 'Plural') - AuthorUnknown = translate('OpenLP.Ui', 'Author Unknown') # Used in the UI. - AuthorUnknownUnT = u'Author Unknown' # Used to populate the database. + AuthorUnknown = u'Author Unknown' # Used to populate the database. CopyrightSymbol = translate('OpenLP.Ui', '\xa9', 'Copyright symbol.') SongBook = translate('OpenLP.Ui', 'Song Book', 'Singular') SongBooks = translate('OpenLP.Ui', 'Song Books', 'Plural') diff --git a/openlp/plugins/songs/lib/xml.py b/openlp/plugins/songs/lib/xml.py index a552a42a1..2aa51c99e 100644 --- a/openlp/plugins/songs/lib/xml.py +++ b/openlp/plugins/songs/lib/xml.py @@ -374,8 +374,6 @@ class OpenLyrics(object): display_name = self._text(author) if display_name: authors.append(display_name) - if not authors: - authors.append(SongStrings.AuthorUnknownUnT) for display_name in authors: author = self.manager.get_object_filtered(Author, Author.display_name == display_name) @@ -384,7 +382,14 @@ class OpenLyrics(object): author = Author.populate(display_name=display_name, last_name=display_name.split(u' ')[-1], first_name=u' '.join(display_name.split(u' ')[:-1])) - self.manager.save_object(author) + # The song does not have an author, add a default author. + if not song.authors: + name = SongStrings.AuthorUnknown + author = self.manager.get_object_filtered( + Author, Author.display_name == name) + if author is None: + author = Author.populate( + display_name=name, last_name=u'', first_name=u'') song.authors.append(author) def _process_cclinumber(self, properties, song): diff --git a/openlp/plugins/songs/songsplugin.py b/openlp/plugins/songs/songsplugin.py index 3800d00dc..1932a8384 100644 --- a/openlp/plugins/songs/songsplugin.py +++ b/openlp/plugins/songs/songsplugin.py @@ -148,13 +148,12 @@ class SongsPlugin(Plugin): counter += 1 # The song does not have any author, add one. if not song.authors: - name = unicode(SongStrings.AuthorUnknownUnT) + name = SongStrings.AuthorUnknown author = self.manager.get_object_filtered(Author, Author.display_name == name) if author is None: author = Author.populate( - first_name=u' '.join(name.split(u' ', 1)[:-1]), - last_name=name.split(u' ', 1)[-1], display_name=name) + display_name=name, last_name=u'', first_name=u'') song.authors.append(author) if song.title is None: song.title = u'' From b4b6fef70a2e107c024f360f736f429412409a1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Armin=20K=C3=B6hler?= Date: Wed, 23 Feb 2011 20:48:37 +0100 Subject: [PATCH 109/123] change value to True/False --- openlp/plugins/songs/lib/foilpresenterimport.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/openlp/plugins/songs/lib/foilpresenterimport.py b/openlp/plugins/songs/lib/foilpresenterimport.py index 30c94303b..2eded332f 100644 --- a/openlp/plugins/songs/lib/foilpresenterimport.py +++ b/openlp/plugins/songs/lib/foilpresenterimport.py @@ -420,13 +420,13 @@ class FoilPresenter(object): text = self._child(strophe.text_) verse_name = self._child(strophe.key) children = strophe.getchildren() - sortnr = 0 + sortnr = False for child in children: if child.tag == u'sortnr': verse_sortnr = self._child(strophe.sortnr) - sortnr = 1 + sortnr = True # In older Version there is no sortnr, but we need one - if sortnr == 0: + if sortnr == False: verse_sortnr = unicode(temp_sortnr_backup) temp_sortnr_backup += 1 # Foilpresenter allows e. g. "Ref" or "1", but we need "C1" or "V1". From 1eea1c97a498068933ee33aa3ea04e03db0700ea Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Wed, 23 Feb 2011 21:22:29 +0100 Subject: [PATCH 110/123] moved code --- openlp/plugins/songs/lib/__init__.py | 21 ++++++++++++++++ openlp/plugins/songs/lib/olpimport.py | 33 +++++++++++++------------- openlp/plugins/songs/lib/songimport.py | 10 ++------ openlp/plugins/songs/lib/xml.py | 11 ++------- openlp/plugins/songs/songsplugin.py | 14 ++++------- 5 files changed, 45 insertions(+), 44 deletions(-) diff --git a/openlp/plugins/songs/lib/__init__.py b/openlp/plugins/songs/lib/__init__.py index 95fae92a8..0396122f5 100644 --- a/openlp/plugins/songs/lib/__init__.py +++ b/openlp/plugins/songs/lib/__init__.py @@ -25,7 +25,10 @@ ############################################################################### from PyQt4 import QtGui + from openlp.core.lib import translate +from db import Author +from ui import SongStrings class VerseType(object): """ @@ -241,6 +244,24 @@ def retrieve_windows_encoding(recommendation=None): return None return filter(lambda item: item[1] == choice[0], encodings)[0][0] +def add_author_unknown(manager, song): + """ + Add the default author *Author Unknown* to the song. + + ``manager`` + The song's manager. + + ``song`` + The song object. + """ + name = SongStrings.AuthorUnknown + author = manager.get_object_filtered(Author, Author.display_name == name) + if author is None: + author = Author.populate( + display_name=name, last_name=u'', first_name=u'') + song.authors.append(author) + from xml import OpenLyrics, SongXML from songstab import SongsTab from mediaitem import SongMediaItem + diff --git a/openlp/plugins/songs/lib/olpimport.py b/openlp/plugins/songs/lib/olpimport.py index b3f03b951..fba518772 100644 --- a/openlp/plugins/songs/lib/olpimport.py +++ b/openlp/plugins/songs/lib/olpimport.py @@ -36,6 +36,7 @@ from sqlalchemy.orm.exc import UnmappedClassError from openlp.core.lib import translate from openlp.core.lib.db import BaseModel +from openlp.plugins.songs.lib import add_author_unknown from openlp.plugins.songs.lib.db import Author, Book, Song, Topic #, MediaFile from songimport import SongImport @@ -47,30 +48,35 @@ class OldAuthor(BaseModel): """ pass + class OldBook(BaseModel): """ Book model """ pass + class OldMediaFile(BaseModel): """ MediaFile model """ pass + class OldSong(BaseModel): """ Song model """ pass + class OldTopic(BaseModel): """ Topic model """ pass + class OpenLPSongImport(SongImport): """ The :class:`OpenLPSongImport` class provides OpenLP with the ability to @@ -170,25 +176,18 @@ class OpenLPSongImport(SongImport): new_song.comments = song.comments new_song.theme_name = song.theme_name new_song.ccli_number = song.ccli_number - if song.authors: - for author in song.authors: - existing_author = self.manager.get_object_filtered( - Author, Author.display_name == author.display_name) - if existing_author: - new_song.authors.append(existing_author) - else: - new_song.authors.append(Author.populate( - first_name=author.first_name, - last_name=author.last_name, - display_name=author.display_name)) - else: - au = self.manager.get_object_filtered(Author, - Author.display_name == u'Author Unknown') - if au: - new_song.authors.append(au) + for author in song.authors: + existing_author = self.manager.get_object_filtered( + Author, Author.display_name == author.display_name) + if existing_author: + new_song.authors.append(existing_author) else: new_song.authors.append(Author.populate( - display_name=u'Author Unknown')) + first_name=author.first_name, + last_name=author.last_name, + display_name=author.display_name)) + if not new_song.authors: + add_author_unknown(self.manager, new_song) if song.book: existing_song_book = self.manager.get_object_filtered( Book, Book.name == song.book.name) diff --git a/openlp/plugins/songs/lib/songimport.py b/openlp/plugins/songs/lib/songimport.py index a8ca5d7b3..36f2e3504 100644 --- a/openlp/plugins/songs/lib/songimport.py +++ b/openlp/plugins/songs/lib/songimport.py @@ -29,7 +29,7 @@ import re from PyQt4 import QtCore from openlp.core.lib import Receiver, translate -from openlp.plugins.songs.lib import VerseType +from openlp.plugins.songs.lib import add_author_unknown, VerseType from openlp.plugins.songs.lib.db import Song, Author, Topic, Book, MediaFile from openlp.plugins.songs.lib.ui import SongStrings from openlp.plugins.songs.lib.xml import SongXML @@ -319,13 +319,7 @@ class SongImport(QtCore.QObject): song.authors.append(author) # No author, add the default author. if not song.authors: - name = SongStrings.AuthorUnknown - author = self.manager.get_object_filtered( - Author, Author.display_name == name) - if not author: - author = Author.populate( - display_name=name, last_name=u'', first_name=u'') - song.authors.append(author) + add_author_unknown(self.manager, song) for filename in self.media_files: media_file = self.manager.get_object_filtered(MediaFile, MediaFile.file_name == filename) diff --git a/openlp/plugins/songs/lib/xml.py b/openlp/plugins/songs/lib/xml.py index 2aa51c99e..8f5c35c0a 100644 --- a/openlp/plugins/songs/lib/xml.py +++ b/openlp/plugins/songs/lib/xml.py @@ -66,7 +66,7 @@ import re from lxml import etree, objectify -from openlp.plugins.songs.lib import VerseType +from openlp.plugins.songs.lib import add_author_unknown, VerseType from openlp.plugins.songs.lib.db import Author, Book, Song, Topic from openlp.plugins.songs.lib.ui import SongStrings @@ -382,15 +382,8 @@ class OpenLyrics(object): author = Author.populate(display_name=display_name, last_name=display_name.split(u' ')[-1], first_name=u' '.join(display_name.split(u' ')[:-1])) - # The song does not have an author, add a default author. if not song.authors: - name = SongStrings.AuthorUnknown - author = self.manager.get_object_filtered( - Author, Author.display_name == name) - if author is None: - author = Author.populate( - display_name=name, last_name=u'', first_name=u'') - song.authors.append(author) + add_author_unknown(self.manager, song) def _process_cclinumber(self, properties, song): """ diff --git a/openlp/plugins/songs/songsplugin.py b/openlp/plugins/songs/songsplugin.py index 1932a8384..609c1990d 100644 --- a/openlp/plugins/songs/songsplugin.py +++ b/openlp/plugins/songs/songsplugin.py @@ -32,10 +32,10 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import Plugin, StringContent, build_icon, translate from openlp.core.lib.db import Manager from openlp.core.lib.ui import UiStrings -from openlp.plugins.songs.lib import SongMediaItem, SongsTab, SongXML -from openlp.plugins.songs.lib.db import Author, init_schema, Song +from openlp.plugins.songs.lib import add_author_unknown, SongMediaItem, \ + SongsTab, SongXML +from openlp.plugins.songs.lib.db import init_schema, Song from openlp.plugins.songs.lib.importer import SongFormat -from openlp.plugins.songs.lib.ui import SongStrings log = logging.getLogger(__name__) @@ -148,13 +148,7 @@ class SongsPlugin(Plugin): counter += 1 # The song does not have any author, add one. if not song.authors: - name = SongStrings.AuthorUnknown - author = self.manager.get_object_filtered(Author, - Author.display_name == name) - if author is None: - author = Author.populate( - display_name=name, last_name=u'', first_name=u'') - song.authors.append(author) + add_author_unknown(self.manager, song) if song.title is None: song.title = u'' if song.alternate_title is None: From 8661c6e38e5bae6db0b9d8c599c6d8a1791d520f Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Wed, 23 Feb 2011 21:28:25 +0100 Subject: [PATCH 111/123] removed line --- openlp/plugins/songs/lib/__init__.py | 1 - 1 file changed, 1 deletion(-) diff --git a/openlp/plugins/songs/lib/__init__.py b/openlp/plugins/songs/lib/__init__.py index 0396122f5..70a47a239 100644 --- a/openlp/plugins/songs/lib/__init__.py +++ b/openlp/plugins/songs/lib/__init__.py @@ -264,4 +264,3 @@ def add_author_unknown(manager, song): from xml import OpenLyrics, SongXML from songstab import SongsTab from mediaitem import SongMediaItem - From c74b2fc964fa34d9c8fe84e7db6b74d12da9452e Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Wed, 23 Feb 2011 22:55:55 +0200 Subject: [PATCH 112/123] Updated the settings tab. --- openlp/core/ui/advancedtab.py | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/openlp/core/ui/advancedtab.py b/openlp/core/ui/advancedtab.py index 35bc167c0..5cb22cb8b 100644 --- a/openlp/core/ui/advancedtab.py +++ b/openlp/core/ui/advancedtab.py @@ -28,8 +28,9 @@ The :mod:`advancedtab` provides an advanced settings facility. """ from PyQt4 import QtCore, QtGui -from openlp.core.lib import SettingsTab, translate +from openlp.core.lib import SettingsTab, translate, build_icon from openlp.core.lib.ui import UiStrings +from openlp.core.utils import get_images_filter class AdvancedTab(SettingsTab): """ @@ -100,6 +101,8 @@ class AdvancedTab(SettingsTab): self.defaultFileEdit.setObjectName(u'defaultFileEdit') self.defaultBrowseButton = QtGui.QToolButton(self.defaultImageGroupBox) self.defaultBrowseButton.setObjectName(u'defaultBrowseButton') + self.defaultBrowseButton.setIcon( + build_icon(u':/general/general_open.png')) self.defaultFileLayout = QtGui.QHBoxLayout() self.defaultFileLayout.setObjectName(u'defaultFileLayout') self.defaultFileLayout.addWidget(self.defaultFileEdit) @@ -111,6 +114,8 @@ class AdvancedTab(SettingsTab): QtCore.QObject.connect(self.defaultColorButton, QtCore.SIGNAL(u'pressed()'), self.onDefaultColorButtonPressed) + QtCore.QObject.connect(self.defaultBrowseButton, + QtCore.SIGNAL(u'pressed()'), self.onDefaultBrowseButtonPressed) def retranslateUi(self): """ @@ -139,7 +144,6 @@ class AdvancedTab(SettingsTab): 'Background color:')) self.defaultFileLabel.setText(translate('OpenLP.AdvancedTab', 'Image file:')) - self.defaultBrowseButton.setTitle('...') def load(self): """ @@ -195,8 +199,8 @@ class AdvancedTab(SettingsTab): QtCore.QVariant(self.enableAutoCloseCheckBox.isChecked())) settings.setValue(u'hide mouse', QtCore.QVariant(self.hideMouseCheckBox.isChecked())) - settings.setValue(u'default background color', self.default_color) - settings.setValue(u'default image', self.default_image) + settings.setValue(u'default color', self.default_color) + settings.setValue(u'default image', self.defaultFileEdit.text()) settings.endGroup() def onDefaultColorButtonPressed(self): @@ -207,3 +211,12 @@ class AdvancedTab(SettingsTab): self.defaultColorButton.setStyleSheet( u'background-color: %s' % self.default_color) + def onDefaultBrowseButtonPressed(self): + file_filters = u'%s;;%s (*.*) (*)' % (get_images_filter(), + UiStrings.AllFiles) + filename = QtGui.QFileDialog.getOpenFileName(self, + translate('OpenLP.AdvancedTab', 'Open File'), '', + file_filters) + if filename: + self.defaultFileEdit.setText(filename) + self.defaultFileEdit.setFocus() From cca1064e42b81bdc456a878dfa1d15d9eabd3a70 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Thu, 24 Feb 2011 00:11:58 +0000 Subject: [PATCH 113/123] Cleanups --- openlp/plugins/songs/lib/foilpresenterimport.py | 4 +--- openlp/plugins/songs/lib/xml.py | 1 - 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/openlp/plugins/songs/lib/foilpresenterimport.py b/openlp/plugins/songs/lib/foilpresenterimport.py index 2eded332f..46cf038be 100644 --- a/openlp/plugins/songs/lib/foilpresenterimport.py +++ b/openlp/plugins/songs/lib/foilpresenterimport.py @@ -93,7 +93,6 @@ import os from lxml import etree, objectify -from openlp.core.lib import translate from openlp.core.ui.wizard import WizardStrings from openlp.plugins.songs.lib import VerseType from openlp.plugins.songs.lib.songimport import SongImport @@ -411,7 +410,6 @@ class FoilPresenter(object): search_text = u'' temp_verse_order = {} temp_verse_order_backup = [] - temp_verse_sort = [] temp_sortnr_backup = 1 temp_sortnr_liste = [] versenumber = {u'V': 1, u'C': 1, u'B': 1, u'E': 1, u'O': 1, u'I': 1, @@ -454,7 +452,7 @@ class FoilPresenter(object): else: verse_type = u'O' verse_number = re.compile(u'[a-zA-Z.+-_ ]*').sub(u'', verse_name) - verse_part = re.compile(u'[0-9]*').sub(u'', verse_name[1:]) + #verse_part = re.compile(u'[0-9]*').sub(u'', verse_name[1:]) # Foilpresenter allows e. g. "C", but we need "C1". if not verse_number: verse_number = unicode(versenumber[verse_type]) diff --git a/openlp/plugins/songs/lib/xml.py b/openlp/plugins/songs/lib/xml.py index 8f5c35c0a..f2cf4ac03 100644 --- a/openlp/plugins/songs/lib/xml.py +++ b/openlp/plugins/songs/lib/xml.py @@ -68,7 +68,6 @@ from lxml import etree, objectify from openlp.plugins.songs.lib import add_author_unknown, VerseType from openlp.plugins.songs.lib.db import Author, Book, Song, Topic -from openlp.plugins.songs.lib.ui import SongStrings log = logging.getLogger(__name__) From 3b31186114ba8d2a241f16f89868342795b5e7e5 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Thu, 24 Feb 2011 00:32:27 +0000 Subject: [PATCH 114/123] Complete song import init cleanup --- openlp/plugins/songs/lib/foilpresenterimport.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openlp/plugins/songs/lib/foilpresenterimport.py b/openlp/plugins/songs/lib/foilpresenterimport.py index 46cf038be..97aac379e 100644 --- a/openlp/plugins/songs/lib/foilpresenterimport.py +++ b/openlp/plugins/songs/lib/foilpresenterimport.py @@ -106,12 +106,12 @@ class FoilPresenterImport(SongImport): """ This provides the Foilpresenter import. """ - def __init__(self, master_manager, **kwargs): + def __init__(self, manager, **kwargs): """ Initialise the import. """ log.debug(u'initialise FoilPresenterImport') - SongImport.__init__(self, master_manager, **kwargs) + SongImport.__init__(self, manager, **kwargs) self.FoilPresenter = FoilPresenter(self.manager) def do_import(self): From 5e2a7e1cde4bb76f567b920bf555d1e9b69072e5 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Thu, 24 Feb 2011 02:38:42 +0000 Subject: [PATCH 115/123] Fixes to foilpresenter author handling --- openlp/plugins/songs/lib/foilpresenterimport.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openlp/plugins/songs/lib/foilpresenterimport.py b/openlp/plugins/songs/lib/foilpresenterimport.py index 97aac379e..3a6ae1764 100644 --- a/openlp/plugins/songs/lib/foilpresenterimport.py +++ b/openlp/plugins/songs/lib/foilpresenterimport.py @@ -339,7 +339,7 @@ class FoilPresenter(object): elif (len(author) > 2): authors.append(author) if not authors: - authors.append(SongStrings.AuthorUnknownUnT) + authors.append(SongStrings.AuthorUnknown) for display_name in authors: author = self.manager.get_object_filtered(Author, Author.display_name == display_name) @@ -348,7 +348,7 @@ class FoilPresenter(object): author = Author.populate(display_name=display_name, last_name = display_name.split(u' ')[-1], first_name = u' '.join(display_name.split(u' ')[:-1])) - self.manager.save_object(author) + self.manager.save_object(author) song.authors.append(author) def _process_cclinumber(self, foilpresenterfolie, song): From 780a87e840b1a7d923b27b9aa9f8f6f6ab78b755 Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Thu, 24 Feb 2011 07:47:38 +0200 Subject: [PATCH 116/123] Updated copyright information. Removed .eric4project directory from version control. --- LICENSE | 14 ++-- copyright.txt | 6 +- openlp.pyw | 6 +- openlp/__init__.py | 8 +- openlp/core/__init__.py | 8 +- openlp/core/lib/__init__.py | 6 +- openlp/core/lib/db.py | 6 +- openlp/core/lib/displaytags.py | 6 +- openlp/core/lib/dockwidget.py | 6 +- openlp/core/lib/eventreceiver.py | 6 +- openlp/core/lib/htmlbuilder.py | 6 +- openlp/core/lib/imagemanager.py | 6 +- openlp/core/lib/listwidgetwithdnd.py | 6 +- openlp/core/lib/mediamanageritem.py | 6 +- openlp/core/lib/plugin.py | 6 +- openlp/core/lib/pluginmanager.py | 8 +- openlp/core/lib/renderer.py | 8 +- openlp/core/lib/rendermanager.py | 6 +- openlp/core/lib/searchedit.py | 6 +- openlp/core/lib/serviceitem.py | 6 +- openlp/core/lib/settingsmanager.py | 8 +- openlp/core/lib/settingstab.py | 6 +- openlp/core/lib/spelltextedit.py | 6 +- openlp/core/lib/theme.py | 6 +- openlp/core/lib/toolbar.py | 6 +- openlp/core/lib/ui.py | 6 +- openlp/core/theme/__init__.py | 8 +- openlp/core/theme/theme.py | 6 +- openlp/core/ui/__init__.py | 6 +- openlp/core/ui/aboutdialog.py | 6 +- openlp/core/ui/aboutform.py | 8 +- openlp/core/ui/advancedtab.py | 6 +- openlp/core/ui/displaytagdialog.py | 6 +- openlp/core/ui/displaytagform.py | 6 +- openlp/core/ui/exceptiondialog.py | 6 +- openlp/core/ui/exceptionform.py | 6 +- openlp/core/ui/filerenamedialog.py | 6 +- openlp/core/ui/filerenameform.py | 6 +- openlp/core/ui/generaltab.py | 6 +- openlp/core/ui/maindisplay.py | 6 +- openlp/core/ui/mainwindow.py | 6 +- openlp/core/ui/mediadockmanager.py | 8 +- openlp/core/ui/plugindialog.py | 6 +- openlp/core/ui/pluginform.py | 6 +- openlp/core/ui/printservicedialog.py | 6 +- openlp/core/ui/printserviceform.py | 6 +- openlp/core/ui/screen.py | 6 +- openlp/core/ui/serviceitemeditdialog.py | 6 +- openlp/core/ui/serviceitemeditform.py | 6 +- openlp/core/ui/servicemanager.py | 6 +- openlp/core/ui/servicenoteform.py | 8 +- openlp/core/ui/settingsdialog.py | 6 +- openlp/core/ui/settingsform.py | 6 +- openlp/core/ui/shortcutlistdialog.py | 8 +- openlp/core/ui/shortcutlistform.py | 6 +- openlp/core/ui/slidecontroller.py | 6 +- openlp/core/ui/splashscreen.py | 6 +- openlp/core/ui/starttimedialog.py | 6 +- openlp/core/ui/starttimeform.py | 6 +- openlp/core/ui/themeform.py | 6 +- openlp/core/ui/thememanager.py | 6 +- openlp/core/ui/themestab.py | 6 +- openlp/core/ui/themewizard.py | 6 +- openlp/core/ui/wizard.py | 6 +- openlp/core/utils/__init__.py | 8 +- openlp/core/utils/actions.py | 6 +- openlp/core/utils/languagemanager.py | 6 +- openlp/plugins/__init__.py | 8 +- openlp/plugins/alerts/__init__.py | 8 +- openlp/plugins/alerts/alertsplugin.py | 6 +- openlp/plugins/alerts/forms/__init__.py | 8 +- openlp/plugins/alerts/forms/alertdialog.py | 6 +- openlp/plugins/alerts/forms/alertform.py | 6 +- openlp/plugins/alerts/lib/__init__.py | 8 +- openlp/plugins/alerts/lib/alertsmanager.py | 6 +- openlp/plugins/alerts/lib/alertstab.py | 6 +- openlp/plugins/alerts/lib/db.py | 8 +- openlp/plugins/bibles/__init__.py | 8 +- openlp/plugins/bibles/bibleplugin.py | 6 +- openlp/plugins/bibles/forms/__init__.py | 8 +- .../plugins/bibles/forms/bibleimportform.py | 6 +- openlp/plugins/bibles/lib/__init__.py | 20 ++--- openlp/plugins/bibles/lib/biblestab.py | 6 +- openlp/plugins/bibles/lib/csvbible.py | 6 +- openlp/plugins/bibles/lib/db.py | 6 +- openlp/plugins/bibles/lib/http.py | 6 +- openlp/plugins/bibles/lib/manager.py | 6 +- openlp/plugins/bibles/lib/mediaitem.py | 6 +- openlp/plugins/bibles/lib/openlp1.py | 6 +- openlp/plugins/bibles/lib/opensong.py | 6 +- openlp/plugins/bibles/lib/osis.py | 6 +- openlp/plugins/custom/__init__.py | 8 +- openlp/plugins/custom/customplugin.py | 6 +- openlp/plugins/custom/forms/__init__.py | 8 +- .../plugins/custom/forms/editcustomdialog.py | 6 +- openlp/plugins/custom/forms/editcustomform.py | 6 +- .../custom/forms/editcustomslidedialog.py | 6 +- .../custom/forms/editcustomslideform.py | 6 +- openlp/plugins/custom/lib/__init__.py | 8 +- openlp/plugins/custom/lib/customtab.py | 6 +- openlp/plugins/custom/lib/customxmlhandler.py | 8 +- openlp/plugins/custom/lib/db.py | 8 +- openlp/plugins/custom/lib/mediaitem.py | 6 +- openlp/plugins/images/__init__.py | 8 +- openlp/plugins/images/imageplugin.py | 6 +- openlp/plugins/images/lib/__init__.py | 8 +- openlp/plugins/images/lib/mediaitem.py | 6 +- openlp/plugins/media/__init__.py | 8 +- openlp/plugins/media/lib/__init__.py | 8 +- openlp/plugins/media/lib/mediaitem.py | 8 +- openlp/plugins/media/lib/mediatab.py | 6 +- openlp/plugins/media/mediaplugin.py | 6 +- openlp/plugins/presentations/__init__.py | 8 +- openlp/plugins/presentations/lib/__init__.py | 8 +- .../presentations/lib/impresscontroller.py | 6 +- openlp/plugins/presentations/lib/mediaitem.py | 6 +- .../presentations/lib/messagelistener.py | 6 +- .../presentations/lib/powerpointcontroller.py | 6 +- .../presentations/lib/pptviewcontroller.py | 6 +- .../presentations/lib/pptviewlib/ppttest.py | 8 +- .../lib/presentationcontroller.py | 6 +- .../presentations/lib/presentationtab.py | 6 +- .../presentations/presentationplugin.py | 6 +- openlp/plugins/remotes/__init__.py | 8 +- openlp/plugins/remotes/lib/__init__.py | 8 +- openlp/plugins/remotes/lib/httpserver.py | 6 +- openlp/plugins/remotes/lib/remotetab.py | 6 +- openlp/plugins/remotes/remoteplugin.py | 6 +- openlp/plugins/songs/__init__.py | 8 +- openlp/plugins/songs/forms/__init__.py | 6 +- openlp/plugins/songs/forms/authorsdialog.py | 6 +- openlp/plugins/songs/forms/authorsform.py | 6 +- openlp/plugins/songs/forms/editsongdialog.py | 6 +- openlp/plugins/songs/forms/editsongform.py | 6 +- openlp/plugins/songs/forms/editversedialog.py | 6 +- openlp/plugins/songs/forms/editverseform.py | 6 +- openlp/plugins/songs/forms/songbookdialog.py | 6 +- openlp/plugins/songs/forms/songbookform.py | 6 +- openlp/plugins/songs/forms/songexportform.py | 6 +- openlp/plugins/songs/forms/songimportform.py | 6 +- .../songs/forms/songmaintenancedialog.py | 6 +- .../songs/forms/songmaintenanceform.py | 6 +- openlp/plugins/songs/forms/topicsdialog.py | 6 +- openlp/plugins/songs/forms/topicsform.py | 6 +- openlp/plugins/songs/lib/__init__.py | 6 +- openlp/plugins/songs/lib/cclifileimport.py | 6 +- openlp/plugins/songs/lib/db.py | 6 +- openlp/plugins/songs/lib/easislidesimport.py | 6 +- openlp/plugins/songs/lib/ewimport.py | 6 +- .../plugins/songs/lib/foilpresenterimport.py | 74 +++++++++---------- openlp/plugins/songs/lib/importer.py | 6 +- openlp/plugins/songs/lib/mediaitem.py | 6 +- openlp/plugins/songs/lib/olp1import.py | 6 +- openlp/plugins/songs/lib/olpimport.py | 6 +- openlp/plugins/songs/lib/oooimport.py | 6 +- openlp/plugins/songs/lib/openlyricsexport.py | 6 +- openlp/plugins/songs/lib/openlyricsimport.py | 8 +- openlp/plugins/songs/lib/opensongimport.py | 6 +- openlp/plugins/songs/lib/sofimport.py | 6 +- openlp/plugins/songs/lib/songbeamerimport.py | 6 +- openlp/plugins/songs/lib/songimport.py | 8 +- .../plugins/songs/lib/songshowplusimport.py | 6 +- openlp/plugins/songs/lib/songstab.py | 6 +- .../songs/lib/test/test_import_file.py | 10 +-- .../songs/lib/test/test_importing_lots.py | 26 +++++++ .../songs/lib/test/test_opensongimport.py | 10 +-- openlp/plugins/songs/lib/ui.py | 6 +- openlp/plugins/songs/lib/wowimport.py | 6 +- openlp/plugins/songs/lib/xml.py | 8 +- openlp/plugins/songs/songsplugin.py | 6 +- openlp/plugins/songusage/__init__.py | 8 +- openlp/plugins/songusage/forms/__init__.py | 8 +- .../songusage/forms/songusagedeletedialog.py | 6 +- .../songusage/forms/songusagedeleteform.py | 6 +- .../songusage/forms/songusagedetaildialog.py | 6 +- .../songusage/forms/songusagedetailform.py | 6 +- openlp/plugins/songusage/lib/__init__.py | 8 +- openlp/plugins/songusage/lib/db.py | 8 +- openlp/plugins/songusage/songusageplugin.py | 6 +- ...lugins.presentations.presentationplugin.py | 10 +-- resources/pyinstaller/hook-openlp.py | 10 +-- scripts/generate_resources.sh | 9 ++- scripts/openlp-remoteclient.py | 10 +-- scripts/resources.patch | 24 +++--- scripts/translation_utils.py | 10 +-- scripts/windows-builder.py | 10 +-- setup.py | 8 +- 187 files changed, 696 insertions(+), 669 deletions(-) diff --git a/LICENSE b/LICENSE index d511905c1..fd94e166f 100644 --- a/LICENSE +++ b/LICENSE @@ -1,12 +1,12 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. - Preamble + Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public @@ -56,7 +56,7 @@ patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. - GNU GENERAL PUBLIC LICENSE + GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains @@ -255,7 +255,7 @@ make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. - NO WARRANTY + NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN @@ -277,9 +277,9 @@ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - END OF TERMS AND CONDITIONS + END OF TERMS AND CONDITIONS - How to Apply These Terms to Your New Programs + How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it diff --git a/copyright.txt b/copyright.txt index 6882a7282..0e405e6e9 100644 --- a/copyright.txt +++ b/copyright.txt @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp.pyw b/openlp.pyw index d425a0b37..85ba81fba 100755 --- a/openlp.pyw +++ b/openlp.pyw @@ -7,9 +7,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/__init__.py b/openlp/__init__.py index b88547df6..9c22aab8b 100644 --- a/openlp/__init__.py +++ b/openlp/__init__.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # @@ -25,4 +25,4 @@ ############################################################################### """ The :mod:`openlp` module contains all the project produced OpenLP functionality -""" \ No newline at end of file +""" diff --git a/openlp/core/__init__.py b/openlp/core/__init__.py index 17db85184..00d8b78c0 100644 --- a/openlp/core/__init__.py +++ b/openlp/core/__init__.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # @@ -28,4 +28,4 @@ The :mod:`core` module provides all core application functions All the core functions of the OpenLP application including the GUI, settings, logging and a plugin framework are contained within the openlp.core module. -""" \ No newline at end of file +""" diff --git a/openlp/core/lib/__init__.py b/openlp/core/lib/__init__.py index ab4c8e26f..89ecaf3be 100644 --- a/openlp/core/lib/__init__.py +++ b/openlp/core/lib/__init__.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/core/lib/db.py b/openlp/core/lib/db.py index d9d094949..62150cce3 100644 --- a/openlp/core/lib/db.py +++ b/openlp/core/lib/db.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/core/lib/displaytags.py b/openlp/core/lib/displaytags.py index d414f80bb..fc36bc090 100644 --- a/openlp/core/lib/displaytags.py +++ b/openlp/core/lib/displaytags.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/core/lib/dockwidget.py b/openlp/core/lib/dockwidget.py index 32d6ce765..efc0a3066 100644 --- a/openlp/core/lib/dockwidget.py +++ b/openlp/core/lib/dockwidget.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/core/lib/eventreceiver.py b/openlp/core/lib/eventreceiver.py index 6fa8e624a..78b0c6324 100644 --- a/openlp/core/lib/eventreceiver.py +++ b/openlp/core/lib/eventreceiver.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/core/lib/htmlbuilder.py b/openlp/core/lib/htmlbuilder.py index 720b4b3f8..4faf47ddc 100644 --- a/openlp/core/lib/htmlbuilder.py +++ b/openlp/core/lib/htmlbuilder.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/core/lib/imagemanager.py b/openlp/core/lib/imagemanager.py index 23005e992..31b41dc0f 100644 --- a/openlp/core/lib/imagemanager.py +++ b/openlp/core/lib/imagemanager.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/core/lib/listwidgetwithdnd.py b/openlp/core/lib/listwidgetwithdnd.py index a1a11217b..5cd8cf9e2 100644 --- a/openlp/core/lib/listwidgetwithdnd.py +++ b/openlp/core/lib/listwidgetwithdnd.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/core/lib/mediamanageritem.py b/openlp/core/lib/mediamanageritem.py index 782e041a9..c44b89534 100644 --- a/openlp/core/lib/mediamanageritem.py +++ b/openlp/core/lib/mediamanageritem.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/core/lib/plugin.py b/openlp/core/lib/plugin.py index 39f13c37e..c1ff30281 100644 --- a/openlp/core/lib/plugin.py +++ b/openlp/core/lib/plugin.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/core/lib/pluginmanager.py b/openlp/core/lib/pluginmanager.py index 8081cbf71..d2b05ab7c 100644 --- a/openlp/core/lib/pluginmanager.py +++ b/openlp/core/lib/pluginmanager.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # @@ -221,4 +221,4 @@ class PluginManager(object): for plugin in self.plugins: if plugin.isActive(): plugin.finalise() - log.info(u'Finalisation Complete for %s ' % plugin.name) \ No newline at end of file + log.info(u'Finalisation Complete for %s ' % plugin.name) diff --git a/openlp/core/lib/renderer.py b/openlp/core/lib/renderer.py index fe118b76b..4df87a4df 100644 --- a/openlp/core/lib/renderer.py +++ b/openlp/core/lib/renderer.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # @@ -144,4 +144,4 @@ class Renderer(object): html_text = html_text[:len(html_text)-4] formatted.append(html_text) log.debug(u'format_slide - End') - return formatted \ No newline at end of file + return formatted diff --git a/openlp/core/lib/rendermanager.py b/openlp/core/lib/rendermanager.py index 7d579f7a4..b68237b4a 100644 --- a/openlp/core/lib/rendermanager.py +++ b/openlp/core/lib/rendermanager.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/core/lib/searchedit.py b/openlp/core/lib/searchedit.py index 5e12dcefd..d2424d00e 100644 --- a/openlp/core/lib/searchedit.py +++ b/openlp/core/lib/searchedit.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/core/lib/serviceitem.py b/openlp/core/lib/serviceitem.py index f5b606467..de4f2fd81 100644 --- a/openlp/core/lib/serviceitem.py +++ b/openlp/core/lib/serviceitem.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/core/lib/settingsmanager.py b/openlp/core/lib/settingsmanager.py index 89d56cea2..3d8d8059e 100644 --- a/openlp/core/lib/settingsmanager.py +++ b/openlp/core/lib/settingsmanager.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # @@ -178,4 +178,4 @@ class SettingsManager(object): if extension == os.path.splitext(filename)[1]] else: # no filtering required - return files \ No newline at end of file + return files diff --git a/openlp/core/lib/settingstab.py b/openlp/core/lib/settingstab.py index 297185127..4f3748c8d 100644 --- a/openlp/core/lib/settingstab.py +++ b/openlp/core/lib/settingstab.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/core/lib/spelltextedit.py b/openlp/core/lib/spelltextedit.py index 44180a25c..493781ccc 100644 --- a/openlp/core/lib/spelltextedit.py +++ b/openlp/core/lib/spelltextedit.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/core/lib/theme.py b/openlp/core/lib/theme.py index 67ddde72d..6f97c0608 100644 --- a/openlp/core/lib/theme.py +++ b/openlp/core/lib/theme.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/core/lib/toolbar.py b/openlp/core/lib/toolbar.py index 6ae80045e..37fb67d52 100644 --- a/openlp/core/lib/toolbar.py +++ b/openlp/core/lib/toolbar.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/core/lib/ui.py b/openlp/core/lib/ui.py index 2cdda13ac..c127d810d 100644 --- a/openlp/core/lib/ui.py +++ b/openlp/core/lib/ui.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/core/theme/__init__.py b/openlp/core/theme/__init__.py index 350b550a2..52f7120b1 100644 --- a/openlp/core/theme/__init__.py +++ b/openlp/core/theme/__init__.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # @@ -24,4 +24,4 @@ # Temple Place, Suite 330, Boston, MA 02111-1307 USA # ############################################################################### -from openlp.core.theme.theme import Theme \ No newline at end of file +from openlp.core.theme.theme import Theme diff --git a/openlp/core/theme/theme.py b/openlp/core/theme/theme.py index c5d60e299..17217113a 100644 --- a/openlp/core/theme/theme.py +++ b/openlp/core/theme/theme.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/core/ui/__init__.py b/openlp/core/ui/__init__.py index 0f62a6dcf..158f7f0cd 100644 --- a/openlp/core/ui/__init__.py +++ b/openlp/core/ui/__init__.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/core/ui/aboutdialog.py b/openlp/core/ui/aboutdialog.py index 19a61b3f8..5ba5783ea 100644 --- a/openlp/core/ui/aboutdialog.py +++ b/openlp/core/ui/aboutdialog.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/core/ui/aboutform.py b/openlp/core/ui/aboutform.py index f3fcc18a8..a6550b23c 100644 --- a/openlp/core/ui/aboutform.py +++ b/openlp/core/ui/aboutform.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # @@ -61,4 +61,4 @@ class AboutForm(QtGui.QDialog, Ui_AboutDialog): import webbrowser url = u'http://www.openlp.org/en/documentation/introduction/' \ + u'contributing.html' - webbrowser.open_new(url) \ No newline at end of file + webbrowser.open_new(url) diff --git a/openlp/core/ui/advancedtab.py b/openlp/core/ui/advancedtab.py index 5cb22cb8b..a8e8b294e 100644 --- a/openlp/core/ui/advancedtab.py +++ b/openlp/core/ui/advancedtab.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/core/ui/displaytagdialog.py b/openlp/core/ui/displaytagdialog.py index edb8567cf..32428731e 100644 --- a/openlp/core/ui/displaytagdialog.py +++ b/openlp/core/ui/displaytagdialog.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/core/ui/displaytagform.py b/openlp/core/ui/displaytagform.py index fa05c578a..b02a41e64 100644 --- a/openlp/core/ui/displaytagform.py +++ b/openlp/core/ui/displaytagform.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/core/ui/exceptiondialog.py b/openlp/core/ui/exceptiondialog.py index ba7bab496..770913b01 100644 --- a/openlp/core/ui/exceptiondialog.py +++ b/openlp/core/ui/exceptiondialog.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/core/ui/exceptionform.py b/openlp/core/ui/exceptionform.py index 023bb6b36..6fb2d3f84 100644 --- a/openlp/core/ui/exceptionform.py +++ b/openlp/core/ui/exceptionform.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/core/ui/filerenamedialog.py b/openlp/core/ui/filerenamedialog.py index 147207494..30c206d2c 100644 --- a/openlp/core/ui/filerenamedialog.py +++ b/openlp/core/ui/filerenamedialog.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/core/ui/filerenameform.py b/openlp/core/ui/filerenameform.py index 8b37cbc86..69a1c3f6a 100644 --- a/openlp/core/ui/filerenameform.py +++ b/openlp/core/ui/filerenameform.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/core/ui/generaltab.py b/openlp/core/ui/generaltab.py index 2b95088ab..f2bcbbe7e 100644 --- a/openlp/core/ui/generaltab.py +++ b/openlp/core/ui/generaltab.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/core/ui/maindisplay.py b/openlp/core/ui/maindisplay.py index 91d61f1d7..06de73309 100644 --- a/openlp/core/ui/maindisplay.py +++ b/openlp/core/ui/maindisplay.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index 9071016e8..4ec1f91cc 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/core/ui/mediadockmanager.py b/openlp/core/ui/mediadockmanager.py index ced3850ec..2d388faf4 100644 --- a/openlp/core/ui/mediadockmanager.py +++ b/openlp/core/ui/mediadockmanager.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # @@ -85,4 +85,4 @@ class MediaDockManager(object): if self.media_dock.widget(dock_index).settingsSection == \ media_item.plugin.name.lower(): self.media_dock.widget(dock_index).hide() - self.media_dock.removeItem(dock_index) \ No newline at end of file + self.media_dock.removeItem(dock_index) diff --git a/openlp/core/ui/plugindialog.py b/openlp/core/ui/plugindialog.py index 84f897a65..0f6ed9395 100644 --- a/openlp/core/ui/plugindialog.py +++ b/openlp/core/ui/plugindialog.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/core/ui/pluginform.py b/openlp/core/ui/pluginform.py index f8bfe4713..15ac62e42 100644 --- a/openlp/core/ui/pluginform.py +++ b/openlp/core/ui/pluginform.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/core/ui/printservicedialog.py b/openlp/core/ui/printservicedialog.py index ec4e054c3..8d69dc9af 100644 --- a/openlp/core/ui/printservicedialog.py +++ b/openlp/core/ui/printservicedialog.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/core/ui/printserviceform.py b/openlp/core/ui/printserviceform.py index 882e39fca..115d68858 100644 --- a/openlp/core/ui/printserviceform.py +++ b/openlp/core/ui/printserviceform.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/core/ui/screen.py b/openlp/core/ui/screen.py index 82238d738..4530cfd3c 100644 --- a/openlp/core/ui/screen.py +++ b/openlp/core/ui/screen.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/core/ui/serviceitemeditdialog.py b/openlp/core/ui/serviceitemeditdialog.py index ef7e99a5f..f2909eabb 100644 --- a/openlp/core/ui/serviceitemeditdialog.py +++ b/openlp/core/ui/serviceitemeditdialog.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/core/ui/serviceitemeditform.py b/openlp/core/ui/serviceitemeditform.py index ae09cb0b2..588bdbfd6 100644 --- a/openlp/core/ui/serviceitemeditform.py +++ b/openlp/core/ui/serviceitemeditform.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/core/ui/servicemanager.py b/openlp/core/ui/servicemanager.py index 67fbeb0ea..f5a08d8b2 100644 --- a/openlp/core/ui/servicemanager.py +++ b/openlp/core/ui/servicemanager.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/core/ui/servicenoteform.py b/openlp/core/ui/servicenoteform.py index a12b693f8..200e12818 100644 --- a/openlp/core/ui/servicenoteform.py +++ b/openlp/core/ui/servicenoteform.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # @@ -53,4 +53,4 @@ class ServiceNoteForm(QtGui.QDialog): def retranslateUi(self): self.setWindowTitle( - translate('OpenLP.ServiceNoteForm', 'Service Item Notes')) + translate('OpenLP.ServiceNoteForm', 'Service Item Notes')) diff --git a/openlp/core/ui/settingsdialog.py b/openlp/core/ui/settingsdialog.py index 41b6baccb..af8ba84ab 100644 --- a/openlp/core/ui/settingsdialog.py +++ b/openlp/core/ui/settingsdialog.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/core/ui/settingsform.py b/openlp/core/ui/settingsform.py index 8ea9b0dea..872b37586 100644 --- a/openlp/core/ui/settingsform.py +++ b/openlp/core/ui/settingsform.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/core/ui/shortcutlistdialog.py b/openlp/core/ui/shortcutlistdialog.py index 4e20671c5..b4673f410 100644 --- a/openlp/core/ui/shortcutlistdialog.py +++ b/openlp/core/ui/shortcutlistdialog.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # @@ -78,7 +78,7 @@ class Ui_ShortcutListDialog(object): translate('OpenLP.ShortcutListDialog', 'Customize Shortcuts')) self.treeWidget.setHeaderLabels([ translate('OpenLP.ShortcutListDialog', 'Action'), - translate('OpenLP.ShortcutListDialog', 'Shortcut'), + translate('OpenLP.ShortcutListDialog', 'Shortcut'), translate('OpenLP.ShortcutListDialog', 'Alternate')]) self.defaultButton.setText( translate('OpenLP.ShortcutListDialog', 'Default: %s')) diff --git a/openlp/core/ui/shortcutlistform.py b/openlp/core/ui/shortcutlistform.py index 240bbf93c..4f770045c 100644 --- a/openlp/core/ui/shortcutlistform.py +++ b/openlp/core/ui/shortcutlistform.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index 2d3a7e61d..8d612676b 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/core/ui/splashscreen.py b/openlp/core/ui/splashscreen.py index 8c2364ec2..88c6f09f9 100644 --- a/openlp/core/ui/splashscreen.py +++ b/openlp/core/ui/splashscreen.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/core/ui/starttimedialog.py b/openlp/core/ui/starttimedialog.py index d87df71c4..14ef84aac 100644 --- a/openlp/core/ui/starttimedialog.py +++ b/openlp/core/ui/starttimedialog.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/core/ui/starttimeform.py b/openlp/core/ui/starttimeform.py index 1280931d5..01800602f 100644 --- a/openlp/core/ui/starttimeform.py +++ b/openlp/core/ui/starttimeform.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/core/ui/themeform.py b/openlp/core/ui/themeform.py index 17572f530..cc490bf9b 100644 --- a/openlp/core/ui/themeform.py +++ b/openlp/core/ui/themeform.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/core/ui/thememanager.py b/openlp/core/ui/thememanager.py index 378f5b365..974f98f61 100644 --- a/openlp/core/ui/thememanager.py +++ b/openlp/core/ui/thememanager.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/core/ui/themestab.py b/openlp/core/ui/themestab.py index 6a3505e93..c7442744f 100644 --- a/openlp/core/ui/themestab.py +++ b/openlp/core/ui/themestab.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/core/ui/themewizard.py b/openlp/core/ui/themewizard.py index a482e2703..20cca69c6 100644 --- a/openlp/core/ui/themewizard.py +++ b/openlp/core/ui/themewizard.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/core/ui/wizard.py b/openlp/core/ui/wizard.py index 209f3f212..0b275733e 100644 --- a/openlp/core/ui/wizard.py +++ b/openlp/core/ui/wizard.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/core/utils/__init__.py b/openlp/core/utils/__init__.py index 3f5ee90c2..86372e080 100644 --- a/openlp/core/utils/__init__.py +++ b/openlp/core/utils/__init__.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # @@ -387,7 +387,7 @@ def get_uno_command(): if UNO_CONNECTION_TYPE == u'pipe': CONNECTION = u'"-accept=pipe,name=openlp_pipe;urp;"' else: - CONNECTION = u'"-accept=socket,host=localhost,port=2002;urp;"' + CONNECTION = u'"-accept=socket,host=localhost,port=2002;urp;"' return u'%s %s %s' % (COMMAND, OPTIONS, CONNECTION) def get_uno_instance(resolver): diff --git a/openlp/core/utils/actions.py b/openlp/core/utils/actions.py index e181dd2e1..30d1d7586 100644 --- a/openlp/core/utils/actions.py +++ b/openlp/core/utils/actions.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/core/utils/languagemanager.py b/openlp/core/utils/languagemanager.py index 454d14fa2..ced2fa843 100644 --- a/openlp/core/utils/languagemanager.py +++ b/openlp/core/utils/languagemanager.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/__init__.py b/openlp/plugins/__init__.py index 7bf441119..5fd39d572 100644 --- a/openlp/plugins/__init__.py +++ b/openlp/plugins/__init__.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # @@ -25,4 +25,4 @@ ############################################################################### """ The :mod:`plugins` module provides all the project produced plugins -""" \ No newline at end of file +""" diff --git a/openlp/plugins/alerts/__init__.py b/openlp/plugins/alerts/__init__.py index dafae0885..f3c629b25 100644 --- a/openlp/plugins/alerts/__init__.py +++ b/openlp/plugins/alerts/__init__.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # @@ -26,4 +26,4 @@ """ The :mod:`alerts` module provides the Alerts plugin for producing impromptu on-screen announcements during a service. -""" \ No newline at end of file +""" diff --git a/openlp/plugins/alerts/alertsplugin.py b/openlp/plugins/alerts/alertsplugin.py index 136d775a5..1d9bd4c61 100644 --- a/openlp/plugins/alerts/alertsplugin.py +++ b/openlp/plugins/alerts/alertsplugin.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/alerts/forms/__init__.py b/openlp/plugins/alerts/forms/__init__.py index da7ae6683..e2809ed73 100644 --- a/openlp/plugins/alerts/forms/__init__.py +++ b/openlp/plugins/alerts/forms/__init__.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # @@ -24,4 +24,4 @@ # Temple Place, Suite 330, Boston, MA 02111-1307 USA # ############################################################################### -from alertform import AlertForm \ No newline at end of file +from alertform import AlertForm diff --git a/openlp/plugins/alerts/forms/alertdialog.py b/openlp/plugins/alerts/forms/alertdialog.py index 93f7ead06..27b0b0f7d 100644 --- a/openlp/plugins/alerts/forms/alertdialog.py +++ b/openlp/plugins/alerts/forms/alertdialog.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/alerts/forms/alertform.py b/openlp/plugins/alerts/forms/alertform.py index 0639f2bb1..75475d524 100644 --- a/openlp/plugins/alerts/forms/alertform.py +++ b/openlp/plugins/alerts/forms/alertform.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/alerts/lib/__init__.py b/openlp/plugins/alerts/lib/__init__.py index f6a535b1b..3b446b67d 100644 --- a/openlp/plugins/alerts/lib/__init__.py +++ b/openlp/plugins/alerts/lib/__init__.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # @@ -25,4 +25,4 @@ ############################################################################### from alertsmanager import AlertsManager -from alertstab import AlertsTab \ No newline at end of file +from alertstab import AlertsTab diff --git a/openlp/plugins/alerts/lib/alertsmanager.py b/openlp/plugins/alerts/lib/alertsmanager.py index f69099bf1..a05a29575 100644 --- a/openlp/plugins/alerts/lib/alertsmanager.py +++ b/openlp/plugins/alerts/lib/alertsmanager.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/alerts/lib/alertstab.py b/openlp/plugins/alerts/lib/alertstab.py index ac7316df2..5b4f670a3 100644 --- a/openlp/plugins/alerts/lib/alertstab.py +++ b/openlp/plugins/alerts/lib/alertstab.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/alerts/lib/db.py b/openlp/plugins/alerts/lib/db.py index e324bc838..9cfa34846 100644 --- a/openlp/plugins/alerts/lib/db.py +++ b/openlp/plugins/alerts/lib/db.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # @@ -55,4 +55,4 @@ def init_schema(url): mapper(AlertItem, alerts_table) metadata.create_all(checkfirst=True) - return session \ No newline at end of file + return session diff --git a/openlp/plugins/bibles/__init__.py b/openlp/plugins/bibles/__init__.py index 59cd2afec..29364ab1a 100644 --- a/openlp/plugins/bibles/__init__.py +++ b/openlp/plugins/bibles/__init__.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # @@ -26,4 +26,4 @@ """ The :mod:`bibles` module provides the Bible plugin to enable OpenLP to display scripture. -""" \ No newline at end of file +""" diff --git a/openlp/plugins/bibles/bibleplugin.py b/openlp/plugins/bibles/bibleplugin.py index b992552f1..73a9b7e1d 100644 --- a/openlp/plugins/bibles/bibleplugin.py +++ b/openlp/plugins/bibles/bibleplugin.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/bibles/forms/__init__.py b/openlp/plugins/bibles/forms/__init__.py index 1365dc5e0..15f14de9e 100644 --- a/openlp/plugins/bibles/forms/__init__.py +++ b/openlp/plugins/bibles/forms/__init__.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # @@ -53,4 +53,4 @@ from the .ui files later if necessary. from bibleimportform import BibleImportForm -__all__ = ['BibleImportForm'] \ No newline at end of file +__all__ = ['BibleImportForm'] diff --git a/openlp/plugins/bibles/forms/bibleimportform.py b/openlp/plugins/bibles/forms/bibleimportform.py index 7ec8e1394..fc37fad58 100644 --- a/openlp/plugins/bibles/forms/bibleimportform.py +++ b/openlp/plugins/bibles/forms/bibleimportform.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/bibles/lib/__init__.py b/openlp/plugins/bibles/lib/__init__.py index 78cb6b645..e8634c3a3 100644 --- a/openlp/plugins/bibles/lib/__init__.py +++ b/openlp/plugins/bibles/lib/__init__.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # @@ -100,37 +100,37 @@ def parse_reference(reference): this:: (book, chapter, from_verse, to_verse) - + For example:: - + [(u'John', 3, 16, 18), (u'John', 4, 1, 1)] **Reference string details:** Each reference starts with the book name and a chapter number. These are both mandatory. - + * ``John 3`` refers to Gospel of John chapter 3 A reference range can be given after a range separator. - + * ``John 3-5`` refers to John chapters 3 to 5 Single verses can be addressed after a verse separator. - + * ``John 3:16`` refers to John chapter 3 verse 16 * ``John 3:16-4:3`` refers to John chapter 3 verse 16 to chapter 4 verse 3 After a verse reference all further single values are treat as verse in the last selected chapter. - + * ``John 3:16-18`` refers to John chapter 3 verses 16 to 18 After a list separator it is possible to refer to additional verses. They are build analog to the first ones. This way it is possible to define each number of verse references. It is not possible to refer to verses in additional books. - + * ``John 3:16,18`` refers to John chapter 3 verses 16 and 18 * ``John 3:16-18,20`` refers to John chapter 3 verses 16 to 18 and 20 * ``John 3:16-18,4:1`` refers to John chapter 3 verses 16 to 18 and diff --git a/openlp/plugins/bibles/lib/biblestab.py b/openlp/plugins/bibles/lib/biblestab.py index 09e32ad8c..74be7145b 100644 --- a/openlp/plugins/bibles/lib/biblestab.py +++ b/openlp/plugins/bibles/lib/biblestab.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/bibles/lib/csvbible.py b/openlp/plugins/bibles/lib/csvbible.py index 82872e15b..f7b4aa8f5 100644 --- a/openlp/plugins/bibles/lib/csvbible.py +++ b/openlp/plugins/bibles/lib/csvbible.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/bibles/lib/db.py b/openlp/plugins/bibles/lib/db.py index b986b0d66..7b7c140e9 100644 --- a/openlp/plugins/bibles/lib/db.py +++ b/openlp/plugins/bibles/lib/db.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/bibles/lib/http.py b/openlp/plugins/bibles/lib/http.py index 7cba6facb..064a6064d 100644 --- a/openlp/plugins/bibles/lib/http.py +++ b/openlp/plugins/bibles/lib/http.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/bibles/lib/manager.py b/openlp/plugins/bibles/lib/manager.py index 85204ac7a..501c8c902 100644 --- a/openlp/plugins/bibles/lib/manager.py +++ b/openlp/plugins/bibles/lib/manager.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/bibles/lib/mediaitem.py b/openlp/plugins/bibles/lib/mediaitem.py index deae98fcb..e7cf273c1 100644 --- a/openlp/plugins/bibles/lib/mediaitem.py +++ b/openlp/plugins/bibles/lib/mediaitem.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/bibles/lib/openlp1.py b/openlp/plugins/bibles/lib/openlp1.py index 73b7eb91a..30eb73481 100644 --- a/openlp/plugins/bibles/lib/openlp1.py +++ b/openlp/plugins/bibles/lib/openlp1.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/bibles/lib/opensong.py b/openlp/plugins/bibles/lib/opensong.py index 9a0fd110d..9c521fb3f 100644 --- a/openlp/plugins/bibles/lib/opensong.py +++ b/openlp/plugins/bibles/lib/opensong.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/bibles/lib/osis.py b/openlp/plugins/bibles/lib/osis.py index 347730bf4..11800ec13 100644 --- a/openlp/plugins/bibles/lib/osis.py +++ b/openlp/plugins/bibles/lib/osis.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/custom/__init__.py b/openlp/plugins/custom/__init__.py index fb86201a3..3a1e4461a 100644 --- a/openlp/plugins/custom/__init__.py +++ b/openlp/plugins/custom/__init__.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # @@ -27,4 +27,4 @@ The :mod:`custom` module provides the Custom plugin which allows custom, themed, text based items to be displayed without having to misuse another item type. -""" \ No newline at end of file +""" diff --git a/openlp/plugins/custom/customplugin.py b/openlp/plugins/custom/customplugin.py index 7894397db..c6c129e68 100644 --- a/openlp/plugins/custom/customplugin.py +++ b/openlp/plugins/custom/customplugin.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/custom/forms/__init__.py b/openlp/plugins/custom/forms/__init__.py index 60f1395fb..c12d29c07 100644 --- a/openlp/plugins/custom/forms/__init__.py +++ b/openlp/plugins/custom/forms/__init__.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # @@ -25,4 +25,4 @@ ############################################################################### from editcustomform import EditCustomForm -from editcustomslideform import EditCustomSlideForm \ No newline at end of file +from editcustomslideform import EditCustomSlideForm diff --git a/openlp/plugins/custom/forms/editcustomdialog.py b/openlp/plugins/custom/forms/editcustomdialog.py index 8746d5548..12ac3ed7e 100644 --- a/openlp/plugins/custom/forms/editcustomdialog.py +++ b/openlp/plugins/custom/forms/editcustomdialog.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/custom/forms/editcustomform.py b/openlp/plugins/custom/forms/editcustomform.py index a86b28489..232cb1e38 100644 --- a/openlp/plugins/custom/forms/editcustomform.py +++ b/openlp/plugins/custom/forms/editcustomform.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/custom/forms/editcustomslidedialog.py b/openlp/plugins/custom/forms/editcustomslidedialog.py index b70e2bf5e..08610954f 100644 --- a/openlp/plugins/custom/forms/editcustomslidedialog.py +++ b/openlp/plugins/custom/forms/editcustomslidedialog.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/custom/forms/editcustomslideform.py b/openlp/plugins/custom/forms/editcustomslideform.py index 80141cfb3..2aea81482 100644 --- a/openlp/plugins/custom/forms/editcustomslideform.py +++ b/openlp/plugins/custom/forms/editcustomslideform.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/custom/lib/__init__.py b/openlp/plugins/custom/lib/__init__.py index d3d8312d7..0c53505ac 100644 --- a/openlp/plugins/custom/lib/__init__.py +++ b/openlp/plugins/custom/lib/__init__.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # @@ -26,4 +26,4 @@ from customxmlhandler import CustomXMLBuilder, CustomXMLParser from mediaitem import CustomMediaItem -from customtab import CustomTab \ No newline at end of file +from customtab import CustomTab diff --git a/openlp/plugins/custom/lib/customtab.py b/openlp/plugins/custom/lib/customtab.py index 3c1b848aa..9b61f8f15 100644 --- a/openlp/plugins/custom/lib/customtab.py +++ b/openlp/plugins/custom/lib/customtab.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/custom/lib/customxmlhandler.py b/openlp/plugins/custom/lib/customxmlhandler.py index 1171ce6bd..5ea941e35 100644 --- a/openlp/plugins/custom/lib/customxmlhandler.py +++ b/openlp/plugins/custom/lib/customxmlhandler.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # @@ -153,4 +153,4 @@ class CustomXMLParser(object): """ Debugging aid to dump XML so that we can see what we have. """ - return dump(self.custom_xml) \ No newline at end of file + return dump(self.custom_xml) diff --git a/openlp/plugins/custom/lib/db.py b/openlp/plugins/custom/lib/db.py index 1fbc04980..74155ad96 100644 --- a/openlp/plugins/custom/lib/db.py +++ b/openlp/plugins/custom/lib/db.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # @@ -59,4 +59,4 @@ def init_schema(url): mapper(CustomSlide, custom_slide_table) metadata.create_all(checkfirst=True) - return session \ No newline at end of file + return session diff --git a/openlp/plugins/custom/lib/mediaitem.py b/openlp/plugins/custom/lib/mediaitem.py index 7ffdfd0b2..c0c7a7e86 100644 --- a/openlp/plugins/custom/lib/mediaitem.py +++ b/openlp/plugins/custom/lib/mediaitem.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/images/__init__.py b/openlp/plugins/images/__init__.py index 6ea473c72..13ea2592a 100644 --- a/openlp/plugins/images/__init__.py +++ b/openlp/plugins/images/__init__.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # @@ -26,4 +26,4 @@ """ The :mod:`images` module provides the Images plugin. The Images plugin provides the facility to display images from OpenLP. -""" \ No newline at end of file +""" diff --git a/openlp/plugins/images/imageplugin.py b/openlp/plugins/images/imageplugin.py index 2cc0f1d93..84d7a71cc 100644 --- a/openlp/plugins/images/imageplugin.py +++ b/openlp/plugins/images/imageplugin.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/images/lib/__init__.py b/openlp/plugins/images/lib/__init__.py index 6ff2a295b..34c9f1ca8 100644 --- a/openlp/plugins/images/lib/__init__.py +++ b/openlp/plugins/images/lib/__init__.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # @@ -24,4 +24,4 @@ # Temple Place, Suite 330, Boston, MA 02111-1307 USA # ############################################################################### -from mediaitem import ImageMediaItem \ No newline at end of file +from mediaitem import ImageMediaItem diff --git a/openlp/plugins/images/lib/mediaitem.py b/openlp/plugins/images/lib/mediaitem.py index 5aa34cc24..e6fdfe7db 100644 --- a/openlp/plugins/images/lib/mediaitem.py +++ b/openlp/plugins/images/lib/mediaitem.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/media/__init__.py b/openlp/plugins/media/__init__.py index 7be6e5ea9..c13c59ef6 100644 --- a/openlp/plugins/media/__init__.py +++ b/openlp/plugins/media/__init__.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # @@ -28,4 +28,4 @@ The :mod:`media` module provides the Media plugin which allows OpenLP to display videos. The media supported depends not only on the Python support but also extensively on the codecs installed on the underlying operating system being picked up and usable by Python. -""" \ No newline at end of file +""" diff --git a/openlp/plugins/media/lib/__init__.py b/openlp/plugins/media/lib/__init__.py index 59d7642df..cb4806631 100644 --- a/openlp/plugins/media/lib/__init__.py +++ b/openlp/plugins/media/lib/__init__.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # @@ -27,4 +27,4 @@ from mediaitem import MediaMediaItem from mediatab import MediaTab -__all__ = ['MediaMediaItem'] \ No newline at end of file +__all__ = ['MediaMediaItem'] diff --git a/openlp/plugins/media/lib/mediaitem.py b/openlp/plugins/media/lib/mediaitem.py index 8bf201180..40ea7abb1 100644 --- a/openlp/plugins/media/lib/mediaitem.py +++ b/openlp/plugins/media/lib/mediaitem.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # @@ -61,7 +61,7 @@ class MediaMediaItem(MediaManagerItem): self.onNewPrompt = translate('MediaPlugin.MediaItem', 'Select Media') self.onNewFileMasks = unicode(translate('MediaPlugin.MediaItem', 'Videos (%s);;Audio (%s);;%s (*)')) % ( - u' '.join(self.parent.video_extensions_list), + u' '.join(self.parent.video_extensions_list), u' '.join(self.parent.audio_extensions_list), UiStrings.AllFiles) self.replaceAction.setText(UiStrings.ReplaceBG) self.replaceAction.setToolTip(UiStrings.ReplaceLiveBG) diff --git a/openlp/plugins/media/lib/mediatab.py b/openlp/plugins/media/lib/mediatab.py index c51b53a9a..995816860 100644 --- a/openlp/plugins/media/lib/mediatab.py +++ b/openlp/plugins/media/lib/mediatab.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/media/mediaplugin.py b/openlp/plugins/media/mediaplugin.py index 74a8f3f2e..ac3a2636b 100644 --- a/openlp/plugins/media/mediaplugin.py +++ b/openlp/plugins/media/mediaplugin.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/presentations/__init__.py b/openlp/plugins/presentations/__init__.py index 317281c23..628816bcf 100644 --- a/openlp/plugins/presentations/__init__.py +++ b/openlp/plugins/presentations/__init__.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # @@ -26,4 +26,4 @@ """ The :mod:`presentations` module provides the Presentations plugin which allows OpenLP to show presentations from most popular presentation packages. -""" \ No newline at end of file +""" diff --git a/openlp/plugins/presentations/lib/__init__.py b/openlp/plugins/presentations/lib/__init__.py index 2e46cf486..b5575268a 100644 --- a/openlp/plugins/presentations/lib/__init__.py +++ b/openlp/plugins/presentations/lib/__init__.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # @@ -27,4 +27,4 @@ from presentationcontroller import PresentationController from messagelistener import MessageListener from mediaitem import PresentationMediaItem -from presentationtab import PresentationTab \ No newline at end of file +from presentationtab import PresentationTab diff --git a/openlp/plugins/presentations/lib/impresscontroller.py b/openlp/plugins/presentations/lib/impresscontroller.py index ad5faa2dd..2880bd27a 100644 --- a/openlp/plugins/presentations/lib/impresscontroller.py +++ b/openlp/plugins/presentations/lib/impresscontroller.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/presentations/lib/mediaitem.py b/openlp/plugins/presentations/lib/mediaitem.py index 35db047e2..2a552a480 100644 --- a/openlp/plugins/presentations/lib/mediaitem.py +++ b/openlp/plugins/presentations/lib/mediaitem.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/presentations/lib/messagelistener.py b/openlp/plugins/presentations/lib/messagelistener.py index b7c64ccee..cf43566ae 100644 --- a/openlp/plugins/presentations/lib/messagelistener.py +++ b/openlp/plugins/presentations/lib/messagelistener.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/presentations/lib/powerpointcontroller.py b/openlp/plugins/presentations/lib/powerpointcontroller.py index eb00da255..4dc9e8f3a 100644 --- a/openlp/plugins/presentations/lib/powerpointcontroller.py +++ b/openlp/plugins/presentations/lib/powerpointcontroller.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/presentations/lib/pptviewcontroller.py b/openlp/plugins/presentations/lib/pptviewcontroller.py index fc839195c..0900d1d9d 100644 --- a/openlp/plugins/presentations/lib/pptviewcontroller.py +++ b/openlp/plugins/presentations/lib/pptviewcontroller.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/presentations/lib/pptviewlib/ppttest.py b/openlp/plugins/presentations/lib/pptviewlib/ppttest.py index de0be3e73..1e10def7d 100644 --- a/openlp/plugins/presentations/lib/pptviewlib/ppttest.py +++ b/openlp/plugins/presentations/lib/pptviewlib/ppttest.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # @@ -169,4 +169,4 @@ if __name__ == '__main__': app = QtGui.QApplication(sys.argv) qb = PPTViewer() qb.show() - sys.exit(app.exec_()) \ No newline at end of file + sys.exit(app.exec_()) diff --git a/openlp/plugins/presentations/lib/presentationcontroller.py b/openlp/plugins/presentations/lib/presentationcontroller.py index 8b282e0f4..d995baa8c 100644 --- a/openlp/plugins/presentations/lib/presentationcontroller.py +++ b/openlp/plugins/presentations/lib/presentationcontroller.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/presentations/lib/presentationtab.py b/openlp/plugins/presentations/lib/presentationtab.py index 8bcb7474a..7b85eebb4 100644 --- a/openlp/plugins/presentations/lib/presentationtab.py +++ b/openlp/plugins/presentations/lib/presentationtab.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/presentations/presentationplugin.py b/openlp/plugins/presentations/presentationplugin.py index ece25e363..eb7e714f0 100644 --- a/openlp/plugins/presentations/presentationplugin.py +++ b/openlp/plugins/presentations/presentationplugin.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/remotes/__init__.py b/openlp/plugins/remotes/__init__.py index 4e619fb67..b5077f435 100644 --- a/openlp/plugins/remotes/__init__.py +++ b/openlp/plugins/remotes/__init__.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # @@ -26,4 +26,4 @@ """ The :mod:`remotes` plugin allows OpenLP to be controlled from another machine over a network connection. -""" \ No newline at end of file +""" diff --git a/openlp/plugins/remotes/lib/__init__.py b/openlp/plugins/remotes/lib/__init__.py index b6f952242..8e4f1b210 100644 --- a/openlp/plugins/remotes/lib/__init__.py +++ b/openlp/plugins/remotes/lib/__init__.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # @@ -25,4 +25,4 @@ ############################################################################### from remotetab import RemoteTab -from httpserver import HttpServer \ No newline at end of file +from httpserver import HttpServer diff --git a/openlp/plugins/remotes/lib/httpserver.py b/openlp/plugins/remotes/lib/httpserver.py index 7ced66103..173c89e13 100644 --- a/openlp/plugins/remotes/lib/httpserver.py +++ b/openlp/plugins/remotes/lib/httpserver.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/remotes/lib/remotetab.py b/openlp/plugins/remotes/lib/remotetab.py index d06e69164..2dfee06ce 100644 --- a/openlp/plugins/remotes/lib/remotetab.py +++ b/openlp/plugins/remotes/lib/remotetab.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/remotes/remoteplugin.py b/openlp/plugins/remotes/remoteplugin.py index b513d4ff7..7236d7546 100644 --- a/openlp/plugins/remotes/remoteplugin.py +++ b/openlp/plugins/remotes/remoteplugin.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/songs/__init__.py b/openlp/plugins/songs/__init__.py index c95d29c46..8332f7233 100644 --- a/openlp/plugins/songs/__init__.py +++ b/openlp/plugins/songs/__init__.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # @@ -26,4 +26,4 @@ """ The :mod:`songs` module provides the Songs plugin. The Songs plugin provides the main lyric projection function of OpenLP. -""" \ No newline at end of file +""" diff --git a/openlp/plugins/songs/forms/__init__.py b/openlp/plugins/songs/forms/__init__.py index e75f9fe04..356817ef9 100644 --- a/openlp/plugins/songs/forms/__init__.py +++ b/openlp/plugins/songs/forms/__init__.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/songs/forms/authorsdialog.py b/openlp/plugins/songs/forms/authorsdialog.py index 09c723364..ed2f87e2e 100644 --- a/openlp/plugins/songs/forms/authorsdialog.py +++ b/openlp/plugins/songs/forms/authorsdialog.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/songs/forms/authorsform.py b/openlp/plugins/songs/forms/authorsform.py index 3a37cf290..ad4cea3de 100644 --- a/openlp/plugins/songs/forms/authorsform.py +++ b/openlp/plugins/songs/forms/authorsform.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/songs/forms/editsongdialog.py b/openlp/plugins/songs/forms/editsongdialog.py index bcc075574..c9dfb1e13 100644 --- a/openlp/plugins/songs/forms/editsongdialog.py +++ b/openlp/plugins/songs/forms/editsongdialog.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/songs/forms/editsongform.py b/openlp/plugins/songs/forms/editsongform.py index 68147cf6c..ef47e5694 100644 --- a/openlp/plugins/songs/forms/editsongform.py +++ b/openlp/plugins/songs/forms/editsongform.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/songs/forms/editversedialog.py b/openlp/plugins/songs/forms/editversedialog.py index 64da3e89e..391d9be65 100644 --- a/openlp/plugins/songs/forms/editversedialog.py +++ b/openlp/plugins/songs/forms/editversedialog.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/songs/forms/editverseform.py b/openlp/plugins/songs/forms/editverseform.py index 6156e6821..8a52c1859 100644 --- a/openlp/plugins/songs/forms/editverseform.py +++ b/openlp/plugins/songs/forms/editverseform.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/songs/forms/songbookdialog.py b/openlp/plugins/songs/forms/songbookdialog.py index f6dd3930c..337210b38 100644 --- a/openlp/plugins/songs/forms/songbookdialog.py +++ b/openlp/plugins/songs/forms/songbookdialog.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/songs/forms/songbookform.py b/openlp/plugins/songs/forms/songbookform.py index 3f054fe8d..23886750b 100644 --- a/openlp/plugins/songs/forms/songbookform.py +++ b/openlp/plugins/songs/forms/songbookform.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/songs/forms/songexportform.py b/openlp/plugins/songs/forms/songexportform.py index bcf6a8873..231d8fd43 100644 --- a/openlp/plugins/songs/forms/songexportform.py +++ b/openlp/plugins/songs/forms/songexportform.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/songs/forms/songimportform.py b/openlp/plugins/songs/forms/songimportform.py index 16c0f9edb..10422aadd 100644 --- a/openlp/plugins/songs/forms/songimportform.py +++ b/openlp/plugins/songs/forms/songimportform.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/songs/forms/songmaintenancedialog.py b/openlp/plugins/songs/forms/songmaintenancedialog.py index 0316ab42b..42ec16352 100644 --- a/openlp/plugins/songs/forms/songmaintenancedialog.py +++ b/openlp/plugins/songs/forms/songmaintenancedialog.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/songs/forms/songmaintenanceform.py b/openlp/plugins/songs/forms/songmaintenanceform.py index 7f9b8bec5..d5f432c2b 100644 --- a/openlp/plugins/songs/forms/songmaintenanceform.py +++ b/openlp/plugins/songs/forms/songmaintenanceform.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/songs/forms/topicsdialog.py b/openlp/plugins/songs/forms/topicsdialog.py index 1e7bdb6a0..ee6fc88e7 100644 --- a/openlp/plugins/songs/forms/topicsdialog.py +++ b/openlp/plugins/songs/forms/topicsdialog.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/songs/forms/topicsform.py b/openlp/plugins/songs/forms/topicsform.py index 792570c93..a191d8156 100644 --- a/openlp/plugins/songs/forms/topicsform.py +++ b/openlp/plugins/songs/forms/topicsform.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/songs/lib/__init__.py b/openlp/plugins/songs/lib/__init__.py index 70a47a239..507fd02d4 100644 --- a/openlp/plugins/songs/lib/__init__.py +++ b/openlp/plugins/songs/lib/__init__.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/songs/lib/cclifileimport.py b/openlp/plugins/songs/lib/cclifileimport.py index 3d08584d0..b9236919a 100644 --- a/openlp/plugins/songs/lib/cclifileimport.py +++ b/openlp/plugins/songs/lib/cclifileimport.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund, Derek Scotney # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/songs/lib/db.py b/openlp/plugins/songs/lib/db.py index d9a3202b5..a6255476a 100644 --- a/openlp/plugins/songs/lib/db.py +++ b/openlp/plugins/songs/lib/db.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/songs/lib/easislidesimport.py b/openlp/plugins/songs/lib/easislidesimport.py index bdf263a4b..67f889898 100644 --- a/openlp/plugins/songs/lib/easislidesimport.py +++ b/openlp/plugins/songs/lib/easislidesimport.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/songs/lib/ewimport.py b/openlp/plugins/songs/lib/ewimport.py index c88238610..2119cc245 100644 --- a/openlp/plugins/songs/lib/ewimport.py +++ b/openlp/plugins/songs/lib/ewimport.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund, Jeffrey Smith # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/songs/lib/foilpresenterimport.py b/openlp/plugins/songs/lib/foilpresenterimport.py index 2eded332f..e4101f42a 100644 --- a/openlp/plugins/songs/lib/foilpresenterimport.py +++ b/openlp/plugins/songs/lib/foilpresenterimport.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # @@ -139,48 +139,48 @@ class FoilPresenter(object): """ This class represents the converter for Foilpresenter XML from a song. - As Foilpresenter has a rich set of different features, we cannot support + As Foilpresenter has a rich set of different features, we cannot support them all. The following features are supported by the :class:`Foilpresenter` - OpenPL does not support styletype and font attributes like "align, font, - textsize, bold, italic, underline" - + OpenPL does not support styletype and font attributes like "align, font, + textsize, bold, italic, underline" + ** - This property is currently not supported. - - ** - As OpenLP does only support one title, the first titlestring becomes + This property is currently not supported. + + *<title>* + As OpenLP does only support one title, the first titlestring becomes title, all other titlestrings will be alternate titles *<sprache>* This property is not supported. - *<ccliid>* + *<ccliid>* The *<ccliid>* property is fully supported. - *<tonart>* + *<tonart>* This property is currently not supported. *<valign>* This property is not supported. - - *<notiz>* + + *<notiz>* The *<notiz>* property is fully supported. *<versionsinfo>* - This property is not supported. + This property is not supported. *<farben>* - This property is not supported. - + This property is not supported. + *<reihenfolge>* = verseOrder - OpenLP supports this property. + OpenLP supports this property. *<strophen>* Only the attributes *key* and *text* are supported. *<verkn>* - This property is not supported. + This property is not supported. *<verkn>* This property is not supported. @@ -195,8 +195,8 @@ class FoilPresenter(object): *<kategorien>* This property is not supported. - The tag *<author>* is not support by foilpresenter, mostly the author is - named in the <copyright> tag. We try to extract the authors from the + The tag *<author>* is not support by foilpresenter, mostly the author is + named in the <copyright> tag. We try to extract the authors from the <copyright> tag. """ @@ -205,7 +205,7 @@ class FoilPresenter(object): def xml_to_song(self, xml): """ - Create and save a song from Foilpresenter format xml to the database. + Create and save a song from Foilpresenter format xml to the database. ``xml`` The XML to parse (unicode). @@ -294,11 +294,11 @@ class FoilPresenter(object): if copyright.find(u'Rechte') != -1: temp = copyright.partition(u'Rechte') copyright = temp[0] - markers = [u'Text +u\.?n?d? +Melodie[a-zA-Z0-9\,\. ]*:', - u'Text +u\.?n?d? +Musik', u'T & M', u'Melodie und Satz', - u'Text[a-zA-Z0-9\,\. ]*:', u'Melodie', u'Musik', u'Satz', - u'Weise', u'[dD]eutsch', u'[dD]t[\.\:]', u'Englisch', - u'[oO]riginal', u'Bearbeitung', u'[R|r]efrain'] + markers = [u'Text +u\.?n?d? +Melodie[a-zA-Z0-9\,\. ]*:', + u'Text +u\.?n?d? +Musik', u'T & M', u'Melodie und Satz', + u'Text[a-zA-Z0-9\,\. ]*:', u'Melodie', u'Musik', u'Satz', + u'Weise', u'[dD]eutsch', u'[dD]t[\.\:]', u'Englisch', + u'[oO]riginal', u'Bearbeitung', u'[R|r]efrain'] for marker in markers: copyright = re.compile(marker).sub(u'<marker>', copyright) copyright = re.compile(u'(?<=<marker>) *:').sub(u'', copyright) @@ -314,11 +314,11 @@ class FoilPresenter(object): elif x > 0: strings.append(copyright) i = 1 - else: + else: i = 1 for author in strings: - temp = re.split(u',(?=\D{2})|(?<=\D),|\/(?=\D{3,})|(?<=\D);', - author) + temp = re.split(u',(?=\D{2})|(?<=\D),|\/(?=\D{3,})|(?<=\D);', + author) for tempx in temp: author_temp.append(tempx) for author in author_temp: @@ -326,12 +326,12 @@ class FoilPresenter(object): '\s*[0-9]{4}\s*[\-\/]?\s*([0-9]{4})?[\/,;\-\s]*$' author = re.compile(regex).sub(u'', author) author = re.compile( - u'[0-9]{1,2}\.\s?J(ahr)?h\.|um\s*$|vor\s*$').sub(u'', + u'[0-9]{1,2}\.\s?J(ahr)?h\.|um\s*$|vor\s*$').sub(u'', author) author = re.compile(u'[N|n]ach.*$').sub(u'', author) author = author.strip() if re.search( - u'\w+\.?\s+\w{3,}\s+[a|u]nd\s|\w+\.?\s+\w{3,}\s+&\s', + u'\w+\.?\s+\w{3,}\s+[a|u]nd\s|\w+\.?\s+\w{3,}\s+&\s', author, re.U) != None: temp = re.split(u'\s[a|u]nd\s|\s&\s', author) for tempx in temp: @@ -414,13 +414,13 @@ class FoilPresenter(object): temp_verse_sort = [] temp_sortnr_backup = 1 temp_sortnr_liste = [] - versenumber = {u'V': 1, u'C': 1, u'B': 1, u'E': 1, u'O': 1, u'I': 1, + versenumber = {u'V': 1, u'C': 1, u'B': 1, u'E': 1, u'O': 1, u'I': 1, u'P': 1} for strophe in foilpresenterfolie.strophen.strophe: text = self._child(strophe.text_) verse_name = self._child(strophe.key) children = strophe.getchildren() - sortnr = False + sortnr = False for child in children: if child.tag == u'sortnr': verse_sortnr = self._child(strophe.sortnr) @@ -467,9 +467,9 @@ class FoilPresenter(object): verse_number = unicode(int(verse_number) + 1) verse_type_index = VerseType.from_tag(verse_type[0]) verse_type = VerseType.Names[verse_type_index] - temp_verse_order[verse_sortnr] = (u''.join((verse_type[0], + temp_verse_order[verse_sortnr] = (u''.join((verse_type[0], verse_number))) - temp_verse_order_backup.append(u''.join((verse_type[0], + temp_verse_order_backup.append(u''.join((verse_type[0], verse_number))) sxml.add_verse_to_lyrics(verse_type, verse_number, text) search_text = search_text + text diff --git a/openlp/plugins/songs/lib/importer.py b/openlp/plugins/songs/lib/importer.py index f3a64a998..773be2fd7 100644 --- a/openlp/plugins/songs/lib/importer.py +++ b/openlp/plugins/songs/lib/importer.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/songs/lib/mediaitem.py b/openlp/plugins/songs/lib/mediaitem.py index 1df63d0b5..1bf00b403 100644 --- a/openlp/plugins/songs/lib/mediaitem.py +++ b/openlp/plugins/songs/lib/mediaitem.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/songs/lib/olp1import.py b/openlp/plugins/songs/lib/olp1import.py index 5e18c7ffa..989b7df8a 100644 --- a/openlp/plugins/songs/lib/olp1import.py +++ b/openlp/plugins/songs/lib/olp1import.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/songs/lib/olpimport.py b/openlp/plugins/songs/lib/olpimport.py index fba518772..fe010b501 100644 --- a/openlp/plugins/songs/lib/olpimport.py +++ b/openlp/plugins/songs/lib/olpimport.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/songs/lib/oooimport.py b/openlp/plugins/songs/lib/oooimport.py index 863fec2b8..d2e5870a5 100644 --- a/openlp/plugins/songs/lib/oooimport.py +++ b/openlp/plugins/songs/lib/oooimport.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/songs/lib/openlyricsexport.py b/openlp/plugins/songs/lib/openlyricsexport.py index ffb1a2d6f..c2b58980b 100644 --- a/openlp/plugins/songs/lib/openlyricsexport.py +++ b/openlp/plugins/songs/lib/openlyricsexport.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/songs/lib/openlyricsimport.py b/openlp/plugins/songs/lib/openlyricsimport.py index 0396335b8..306e31619 100644 --- a/openlp/plugins/songs/lib/openlyricsimport.py +++ b/openlp/plugins/songs/lib/openlyricsimport.py @@ -5,10 +5,10 @@ # OpenLP - Open Source Lyrics Projection # # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # -# Portions copyright (c) 2008-2010 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/songs/lib/opensongimport.py b/openlp/plugins/songs/lib/opensongimport.py index 5214a0a24..8fddf5e4f 100644 --- a/openlp/plugins/songs/lib/opensongimport.py +++ b/openlp/plugins/songs/lib/opensongimport.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/songs/lib/sofimport.py b/openlp/plugins/songs/lib/sofimport.py index cfb80caa3..7fdf3c45b 100644 --- a/openlp/plugins/songs/lib/sofimport.py +++ b/openlp/plugins/songs/lib/sofimport.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/songs/lib/songbeamerimport.py b/openlp/plugins/songs/lib/songbeamerimport.py index afb9f5646..78a0a81c7 100644 --- a/openlp/plugins/songs/lib/songbeamerimport.py +++ b/openlp/plugins/songs/lib/songbeamerimport.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/songs/lib/songimport.py b/openlp/plugins/songs/lib/songimport.py index 36f2e3504..0212184f8 100644 --- a/openlp/plugins/songs/lib/songimport.py +++ b/openlp/plugins/songs/lib/songimport.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # @@ -299,7 +299,7 @@ class SongImport(QtCore.QObject): song.lyrics = unicode(sxml.extract_xml(), u'utf-8') if not len(self.verse_order_list) and \ self.verse_order_list_generated_useful: - self.verse_order_list = self.verse_order_list_generated + self.verse_order_list = self.verse_order_list_generated for i, current_verse_def in enumerate(self.verse_order_list): if verses_changed_to_other.has_key(current_verse_def): self.verse_order_list[i] = \ diff --git a/openlp/plugins/songs/lib/songshowplusimport.py b/openlp/plugins/songs/lib/songshowplusimport.py index 74040bcc0..230c5c73d 100644 --- a/openlp/plugins/songs/lib/songshowplusimport.py +++ b/openlp/plugins/songs/lib/songshowplusimport.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/songs/lib/songstab.py b/openlp/plugins/songs/lib/songstab.py index 9ed8ace94..2848208d2 100644 --- a/openlp/plugins/songs/lib/songstab.py +++ b/openlp/plugins/songs/lib/songstab.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/songs/lib/test/test_import_file.py b/openlp/plugins/songs/lib/test/test_import_file.py index 0a0228317..4c3460426 100644 --- a/openlp/plugins/songs/lib/test/test_import_file.py +++ b/openlp/plugins/songs/lib/test/test_import_file.py @@ -4,11 +4,11 @@ ############################################################################### # OpenLP - Open Source Lyrics Projection # # --------------------------------------------------------------------------- # -# Copyright (c) 2008-2010 Raoul Snyman # -# Portions copyright (c) 2008-2010 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Copyright (c) 2008-2011 Raoul Snyman # +# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/songs/lib/test/test_importing_lots.py b/openlp/plugins/songs/lib/test/test_importing_lots.py index 75982da92..4fa5dc7c1 100644 --- a/openlp/plugins/songs/lib/test/test_importing_lots.py +++ b/openlp/plugins/songs/lib/test/test_importing_lots.py @@ -1,3 +1,29 @@ +# -*- coding: utf-8 -*- +# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4 + +############################################################################### +# OpenLP - Open Source Lyrics Projection # +# --------------------------------------------------------------------------- # +# Copyright (c) 2008-2011 Raoul Snyman # +# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # +# --------------------------------------------------------------------------- # +# This program is free software; you can redistribute it and/or modify it # +# under the terms of the GNU General Public License as published by the Free # +# Software Foundation; version 2 of the License. # +# # +# This program is distributed in the hope that it will be useful, but WITHOUT # +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for # +# more details. # +# # +# You should have received a copy of the GNU General Public License along # +# with this program; if not, write to the Free Software Foundation, Inc., 59 # +# Temple Place, Suite 330, Boston, MA 02111-1307 USA # +############################################################################### + from openlp.plugins.songs.lib.opensongimport import OpenSongImport from openlp.plugins.songs.lib.db import init_schema from openlp.core.lib.db import Manager diff --git a/openlp/plugins/songs/lib/test/test_opensongimport.py b/openlp/plugins/songs/lib/test/test_opensongimport.py index fd1d37e3e..cd85cad3b 100644 --- a/openlp/plugins/songs/lib/test/test_opensongimport.py +++ b/openlp/plugins/songs/lib/test/test_opensongimport.py @@ -4,11 +4,11 @@ ############################################################################### # OpenLP - Open Source Lyrics Projection # # --------------------------------------------------------------------------- # -# Copyright (c) 2008-2010 Raoul Snyman # -# Portions copyright (c) 2008-2010 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Copyright (c) 2008-2011 Raoul Snyman # +# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/songs/lib/ui.py b/openlp/plugins/songs/lib/ui.py index 6415c48c9..fe4aab988 100644 --- a/openlp/plugins/songs/lib/ui.py +++ b/openlp/plugins/songs/lib/ui.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/songs/lib/wowimport.py b/openlp/plugins/songs/lib/wowimport.py index 05c9704f6..67e1782eb 100644 --- a/openlp/plugins/songs/lib/wowimport.py +++ b/openlp/plugins/songs/lib/wowimport.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/songs/lib/xml.py b/openlp/plugins/songs/lib/xml.py index 8f5c35c0a..16da0a444 100644 --- a/openlp/plugins/songs/lib/xml.py +++ b/openlp/plugins/songs/lib/xml.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # @@ -409,7 +409,7 @@ class OpenLyrics(object): The song object. """ if hasattr(properties, u'comments'): - comments_list = [] + comments_list = [] for comment in properties.comments.comment: commenttext = self._text(comment) if commenttext: diff --git a/openlp/plugins/songs/songsplugin.py b/openlp/plugins/songs/songsplugin.py index 609c1990d..0335b3a6e 100644 --- a/openlp/plugins/songs/songsplugin.py +++ b/openlp/plugins/songs/songsplugin.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/songusage/__init__.py b/openlp/plugins/songusage/__init__.py index 7f532aada..5a58a5a81 100644 --- a/openlp/plugins/songusage/__init__.py +++ b/openlp/plugins/songusage/__init__.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # @@ -27,4 +27,4 @@ The :mod:`songusage` module contains the Song Usage plugin. The Song Usage plugin provides auditing capabilities for reporting the songs you are using to copyright license organisations. -""" \ No newline at end of file +""" diff --git a/openlp/plugins/songusage/forms/__init__.py b/openlp/plugins/songusage/forms/__init__.py index ef99bce89..c95384e5e 100644 --- a/openlp/plugins/songusage/forms/__init__.py +++ b/openlp/plugins/songusage/forms/__init__.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # @@ -25,4 +25,4 @@ ############################################################################### from songusagedeleteform import SongUsageDeleteForm -from songusagedetailform import SongUsageDetailForm \ No newline at end of file +from songusagedetailform import SongUsageDetailForm diff --git a/openlp/plugins/songusage/forms/songusagedeletedialog.py b/openlp/plugins/songusage/forms/songusagedeletedialog.py index 9dc4219fc..879056e16 100644 --- a/openlp/plugins/songusage/forms/songusagedeletedialog.py +++ b/openlp/plugins/songusage/forms/songusagedeletedialog.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/songusage/forms/songusagedeleteform.py b/openlp/plugins/songusage/forms/songusagedeleteform.py index c03fe15a3..a96aacccd 100644 --- a/openlp/plugins/songusage/forms/songusagedeleteform.py +++ b/openlp/plugins/songusage/forms/songusagedeleteform.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/songusage/forms/songusagedetaildialog.py b/openlp/plugins/songusage/forms/songusagedetaildialog.py index 322e3eb4b..7c812efeb 100644 --- a/openlp/plugins/songusage/forms/songusagedetaildialog.py +++ b/openlp/plugins/songusage/forms/songusagedetaildialog.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/songusage/forms/songusagedetailform.py b/openlp/plugins/songusage/forms/songusagedetailform.py index ff8ec4858..ee37b2a9c 100644 --- a/openlp/plugins/songusage/forms/songusagedetailform.py +++ b/openlp/plugins/songusage/forms/songusagedetailform.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/songusage/lib/__init__.py b/openlp/plugins/songusage/lib/__init__.py index c981e023b..860b25463 100644 --- a/openlp/plugins/songusage/lib/__init__.py +++ b/openlp/plugins/songusage/lib/__init__.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # @@ -25,4 +25,4 @@ ############################################################################### """ The :mod:`lib` module contains the library functions for the songusage plugin. -""" \ No newline at end of file +""" diff --git a/openlp/plugins/songusage/lib/db.py b/openlp/plugins/songusage/lib/db.py index 80079bf85..2508ddc14 100644 --- a/openlp/plugins/songusage/lib/db.py +++ b/openlp/plugins/songusage/lib/db.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # @@ -61,4 +61,4 @@ def init_schema(url): mapper(SongUsageItem, songusage_table) metadata.create_all(checkfirst=True) - return session \ No newline at end of file + return session diff --git a/openlp/plugins/songusage/songusageplugin.py b/openlp/plugins/songusage/songusageplugin.py index ec37dc65e..e1dc0f1a8 100644 --- a/openlp/plugins/songusage/songusageplugin.py +++ b/openlp/plugins/songusage/songusageplugin.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/resources/pyinstaller/hook-openlp.plugins.presentations.presentationplugin.py b/resources/pyinstaller/hook-openlp.plugins.presentations.presentationplugin.py index f99d4feac..2f00db438 100644 --- a/resources/pyinstaller/hook-openlp.plugins.presentations.presentationplugin.py +++ b/resources/pyinstaller/hook-openlp.plugins.presentations.presentationplugin.py @@ -4,11 +4,11 @@ ############################################################################### # OpenLP - Open Source Lyrics Projection # # --------------------------------------------------------------------------- # -# Copyright (c) 2008-2010 Raoul Snyman # -# Portions copyright (c) 2008-2010 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Copyright (c) 2008-2011 Raoul Snyman # +# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/resources/pyinstaller/hook-openlp.py b/resources/pyinstaller/hook-openlp.py index 489c633f6..7e954551f 100644 --- a/resources/pyinstaller/hook-openlp.py +++ b/resources/pyinstaller/hook-openlp.py @@ -4,11 +4,11 @@ ############################################################################### # OpenLP - Open Source Lyrics Projection # # --------------------------------------------------------------------------- # -# Copyright (c) 2008-2010 Raoul Snyman # -# Portions copyright (c) 2008-2010 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Copyright (c) 2008-2011 Raoul Snyman # +# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/scripts/generate_resources.sh b/scripts/generate_resources.sh index c2039a5b6..b363e58b6 100755 --- a/scripts/generate_resources.sh +++ b/scripts/generate_resources.sh @@ -4,10 +4,11 @@ ############################################################################### # OpenLP - Open Source Lyrics Projection # # --------------------------------------------------------------------------- # -# Copyright (c) 2008-2010 Raoul Snyman # -# Portions copyright (c) 2008-2010 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Christian Richter, Maikel Stuivenberg, Martin # -# Thompson, Jon Tibble, Carsten Tinggaard # +# Copyright (c) 2008-2011 Raoul Snyman # +# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/scripts/openlp-remoteclient.py b/scripts/openlp-remoteclient.py index 34fef44a8..11868e292 100644 --- a/scripts/openlp-remoteclient.py +++ b/scripts/openlp-remoteclient.py @@ -5,11 +5,11 @@ ############################################################################### # OpenLP - Open Source Lyrics Projection # # --------------------------------------------------------------------------- # -# Copyright (c) 2008-2010 Raoul Snyman # -# Portions copyright (c) 2008-2010 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Copyright (c) 2008-2011 Raoul Snyman # +# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/scripts/resources.patch b/scripts/resources.patch index cfcf4e37e..f80d31d73 100644 --- a/scripts/resources.patch +++ b/scripts/resources.patch @@ -1,9 +1,9 @@ ---- openlp/core/resources.py.old Mon Jun 21 23:16:19 2010 -+++ openlp/core/resources.py Mon Jun 21 23:27:48 2010 +--- openlp/core/resources.py.old Mon Jun 21 23:16:19 2010 ++++ openlp/core/resources.py Mon Jun 21 23:27:48 2010 @@ -1,10 +1,32 @@ # -*- coding: utf-8 -*- +# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4 - + -# Resource object code -# -# @@ -12,11 +12,11 @@ +############################################################################### +# OpenLP - Open Source Lyrics Projection # +# --------------------------------------------------------------------------- # -+# Copyright (c) 2008-2010 Raoul Snyman # -+# Portions copyright (c) 2008-2010 Tim Bentley, Jonathan Corwin, Michael # -+# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -+# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -+# Carsten Tinggaard, Frode Woldsund # ++# Copyright (c) 2008-2011 Raoul Snyman # ++# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # ++# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # ++# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # ++# Tibble, Carsten Tinggaard, Frode Woldsund # +# --------------------------------------------------------------------------- # +# This program is free software; you can redistribute it and/or modify it # +# under the terms of the GNU General Public License as published by the Free # @@ -36,11 +36,11 @@ +store for use by OpenLP. +""" from PyQt4 import QtCore - + qt_resource_data = "\ @@ -48643,9 +48664,16 @@ " - + def qInitResources(): - QtCore.qRegisterResourceData(0x01, qt_resource_struct, qt_resource_name, qt_resource_data) + """ @@ -48,7 +48,7 @@ + """ + QtCore.qRegisterResourceData(0x01, qt_resource_struct, qt_resource_name, + qt_resource_data) - + def qCleanupResources(): - QtCore.qUnregisterResourceData(0x01, qt_resource_struct, qt_resource_name, qt_resource_data) + """ @@ -56,5 +56,5 @@ + """ + QtCore.qUnregisterResourceData(0x01, qt_resource_struct, qt_resource_name, + qt_resource_data) - + -qInitResources() diff --git a/scripts/translation_utils.py b/scripts/translation_utils.py index 495732085..df8d5dc5e 100755 --- a/scripts/translation_utils.py +++ b/scripts/translation_utils.py @@ -5,11 +5,11 @@ ############################################################################### # OpenLP - Open Source Lyrics Projection # # --------------------------------------------------------------------------- # -# Copyright (c) 2008-2010 Raoul Snyman # -# Portions copyright (c) 2008-2010 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Copyright (c) 2008-2011 Raoul Snyman # +# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/scripts/windows-builder.py b/scripts/windows-builder.py index 1af85853d..b4085712f 100644 --- a/scripts/windows-builder.py +++ b/scripts/windows-builder.py @@ -4,11 +4,11 @@ ############################################################################### # OpenLP - Open Source Lyrics Projection # # --------------------------------------------------------------------------- # -# Copyright (c) 2008-2010 Raoul Snyman # -# Portions copyright (c) 2008-2010 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Copyright (c) 2008-2011 Raoul Snyman # +# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/setup.py b/setup.py index 205688f1e..98e9d40fd 100755 --- a/setup.py +++ b/setup.py @@ -7,9 +7,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # @@ -78,4 +78,4 @@ OpenLP (previously openlp.org) is free church presentation software, or lyrics p entry_points=""" # -*- Entry points: -*- """ -) \ No newline at end of file +) From 2c9d52de8ccf2f9d49815b7577955f8a230b4548 Mon Sep 17 00:00:00 2001 From: Andreas Preikschat <googol@lavabit.com> Date: Thu, 24 Feb 2011 15:20:35 +0100 Subject: [PATCH 117/123] --- openlp/plugins/bibles/lib/csvbible.py | 2 -- openlp/plugins/bibles/lib/db.py | 4 +++- openlp/plugins/bibles/lib/openlp1.py | 2 -- openlp/plugins/bibles/lib/opensong.py | 2 -- openlp/plugins/bibles/lib/osis.py | 9 ++++----- 5 files changed, 7 insertions(+), 12 deletions(-) diff --git a/openlp/plugins/bibles/lib/csvbible.py b/openlp/plugins/bibles/lib/csvbible.py index 82872e15b..0b7f69c8f 100644 --- a/openlp/plugins/bibles/lib/csvbible.py +++ b/openlp/plugins/bibles/lib/csvbible.py @@ -94,8 +94,6 @@ class CSVBible(BibleDB): self.testamentsfile = None self.booksfile = kwargs[u'booksfile'] self.versesfile = kwargs[u'versefile'] - QtCore.QObject.connect(Receiver.get_receiver(), - QtCore.SIGNAL(u'openlp_stop_wizard'), self.stop_import) def setup_testaments(self): """ diff --git a/openlp/plugins/bibles/lib/db.py b/openlp/plugins/bibles/lib/db.py index b986b0d66..11a5eafc3 100644 --- a/openlp/plugins/bibles/lib/db.py +++ b/openlp/plugins/bibles/lib/db.py @@ -33,7 +33,7 @@ from sqlalchemy import Column, ForeignKey, or_, Table, types from sqlalchemy.orm import class_mapper, mapper, relation from sqlalchemy.orm.exc import UnmappedClassError -from openlp.core.lib import translate +from openlp.core.lib import Receiver, translate from openlp.core.lib.db import BaseModel, init_db, Manager from openlp.core.lib.ui import critical_error_message_box @@ -162,6 +162,8 @@ class BibleDB(QtCore.QObject, Manager): if u'file' in kwargs: self.get_name() self.wizard = None + QtCore.QObject.connect(Receiver.get_receiver(), + QtCore.SIGNAL(u'openlp_stop_wizard'), self.stop_import) def stop_import(self): """ diff --git a/openlp/plugins/bibles/lib/openlp1.py b/openlp/plugins/bibles/lib/openlp1.py index 73b7eb91a..438a4eb67 100644 --- a/openlp/plugins/bibles/lib/openlp1.py +++ b/openlp/plugins/bibles/lib/openlp1.py @@ -46,8 +46,6 @@ class OpenLP1Bible(BibleDB): log.debug(self.__class__.__name__) BibleDB.__init__(self, parent, **kwargs) self.filename = kwargs[u'filename'] - QtCore.QObject.connect(Receiver.get_receiver(), - QtCore.SIGNAL(u'openlp_stop_wizard'), self.stop_import) def do_import(self): """ diff --git a/openlp/plugins/bibles/lib/opensong.py b/openlp/plugins/bibles/lib/opensong.py index 9a0fd110d..4924b1259 100644 --- a/openlp/plugins/bibles/lib/opensong.py +++ b/openlp/plugins/bibles/lib/opensong.py @@ -46,8 +46,6 @@ class OpenSongBible(BibleDB): log.debug(self.__class__.__name__) BibleDB.__init__(self, parent, **kwargs) self.filename = kwargs['filename'] - QtCore.QObject.connect(Receiver.get_receiver(), - QtCore.SIGNAL(u'openlp_stop_wizard'), self.stop_import) def do_import(self): """ diff --git a/openlp/plugins/bibles/lib/osis.py b/openlp/plugins/bibles/lib/osis.py index 347730bf4..2900e2c32 100644 --- a/openlp/plugins/bibles/lib/osis.py +++ b/openlp/plugins/bibles/lib/osis.py @@ -41,14 +41,15 @@ log = logging.getLogger(__name__) class OSISBible(BibleDB): """ - OSIS Bible format importer class. + Bible importer class for the `OSIS <http://www.bibletechnologies.net/>`_ + format. For the xml specifications see the `Zefania XML Bible Markup + <http://bgfdb.de/zefaniaxml/bml/>`_ documentation. """ log.info(u'BibleOSISImpl loaded') def __init__(self, parent, **kwargs): """ - Constructor to create and set up an instance of the OpenSongBible - class. This class is used to import Bibles from OpenSong's XML format. + This class is used to import Bibles from the OSIS XML format. """ log.debug(self.__class__.__name__) BibleDB.__init__(self, parent, **kwargs) @@ -86,8 +87,6 @@ class OSISBible(BibleDB): finally: if fbibles: fbibles.close() - QtCore.QObject.connect(Receiver.get_receiver(), - QtCore.SIGNAL(u'openlp_stop_wizard'), self.stop_import) def do_import(self): """ From a2e0ecf314bf03d1f162154e9d136ee108779128 Mon Sep 17 00:00:00 2001 From: Jon Tibble <meths@btinternet.com> Date: Thu, 24 Feb 2011 19:13:51 +0000 Subject: [PATCH 118/123] Fix acknowledged missing verses --- openlp/plugins/bibles/lib/http.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/openlp/plugins/bibles/lib/http.py b/openlp/plugins/bibles/lib/http.py index 064a6064d..60b515f88 100644 --- a/openlp/plugins/bibles/lib/http.py +++ b/openlp/plugins/bibles/lib/http.py @@ -236,8 +236,20 @@ class BGExtract(object): while found_count < verse_count: content = content.findNext(u'sup', u'versenum') raw_verse_num = content.next - raw_verse_text = raw_verse_num.next - verse_list[int(str(raw_verse_num))] = unicode(raw_verse_text) + clean_verse_num = 0 + # Not all verses exist in all translations and may or may not be + # represented by a verse number. If they are not fine, if they are + # it will probably be in a format that breaks int(). We will then + # have no idea what garbage may be sucked in to the verse text so + # if we do not get a clean int() then ignore the verse completely. + try: + clean_verse_num = int(str(raw_verse_num)) + except ValueError: + log.exception(u'Illegal verse number in %s %s %s:%s', + version, bookname, chapter, unicode(raw_verse_num)) + if clean_verse_num: + raw_verse_text = raw_verse_num.next + verse_list[clean_verse_num] = unicode(raw_verse_text) found_count += 1 return SearchResults(bookname, chapter, verse_list) From ff0e1266a7cc33056a207b2ff92608ebddf5962b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Armin=20K=C3=B6hler?= <orangeshirt@web.de> Date: Thu, 24 Feb 2011 21:56:31 +0100 Subject: [PATCH 119/123] changed the handling of author unknown --- openlp/plugins/songs/lib/foilpresenterimport.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/openlp/plugins/songs/lib/foilpresenterimport.py b/openlp/plugins/songs/lib/foilpresenterimport.py index 25d5ae69c..7b555ac23 100644 --- a/openlp/plugins/songs/lib/foilpresenterimport.py +++ b/openlp/plugins/songs/lib/foilpresenterimport.py @@ -94,11 +94,10 @@ import os from lxml import etree, objectify from openlp.core.ui.wizard import WizardStrings -from openlp.plugins.songs.lib import VerseType +from openlp.plugins.songs.lib import add_author_unknown, VerseType from openlp.plugins.songs.lib.songimport import SongImport from openlp.plugins.songs.lib.db import Author, Book, Song, Topic from openlp.plugins.songs.lib.xml import SongXML -from openlp.plugins.songs.lib.ui import SongStrings log = logging.getLogger(__name__) @@ -293,13 +292,13 @@ class FoilPresenter(object): if copyright.find(u'Rechte') != -1: temp = copyright.partition(u'Rechte') copyright = temp[0] - markers = [u'Text +u\.?n?d? +Melodie[a-zA-Z0-9\,\. ]*:', + markers = [u'Text +u\.?n?d? +Melodie[\w\,\. ]*:', u'Text +u\.?n?d? +Musik', u'T & M', u'Melodie und Satz', - u'Text[a-zA-Z0-9\,\. ]*:', u'Melodie', u'Musik', u'Satz', + u'Text[\w\,\. ]*:', u'Melodie', u'Musik', u'Satz', u'Weise', u'[dD]eutsch', u'[dD]t[\.\:]', u'Englisch', u'[oO]riginal', u'Bearbeitung', u'[R|r]efrain'] for marker in markers: - copyright = re.compile(marker).sub(u'<marker>', copyright) + copyright = re.compile(marker).sub(u'<marker>', copyright, re.U) copyright = re.compile(u'(?<=<marker>) *:').sub(u'', copyright) i = 0 x = 0 @@ -338,8 +337,6 @@ class FoilPresenter(object): authors.append(tempx) elif (len(author) > 2): authors.append(author) - if not authors: - authors.append(SongStrings.AuthorUnknown) for display_name in authors: author = self.manager.get_object_filtered(Author, Author.display_name == display_name) @@ -350,6 +347,8 @@ class FoilPresenter(object): first_name = u' '.join(display_name.split(u' ')[:-1])) self.manager.save_object(author) song.authors.append(author) + if not song.authors: + add_author_unknown(self.manager, song) def _process_cclinumber(self, foilpresenterfolie, song): """ From f91713b2ef7dec0ace759802966f4617a1dcf8cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Armin=20K=C3=B6hler?= <orangeshirt@web.de> Date: Thu, 24 Feb 2011 22:27:14 +0100 Subject: [PATCH 120/123] removed double space and control line length --- openlp/plugins/songs/lib/foilpresenterimport.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openlp/plugins/songs/lib/foilpresenterimport.py b/openlp/plugins/songs/lib/foilpresenterimport.py index 7b555ac23..1a2aaa18d 100644 --- a/openlp/plugins/songs/lib/foilpresenterimport.py +++ b/openlp/plugins/songs/lib/foilpresenterimport.py @@ -298,7 +298,7 @@ class FoilPresenter(object): u'Weise', u'[dD]eutsch', u'[dD]t[\.\:]', u'Englisch', u'[oO]riginal', u'Bearbeitung', u'[R|r]efrain'] for marker in markers: - copyright = re.compile(marker).sub(u'<marker>', copyright, re.U) + copyright = re.compile(marker).sub(u'<marker>', copyright, re.U) copyright = re.compile(u'(?<=<marker>) *:').sub(u'', copyright) i = 0 x = 0 From 83fba055d5e712b6c9ca3d3b0db9841e3d0685aa Mon Sep 17 00:00:00 2001 From: Jon Tibble <meths@btinternet.com> Date: Fri, 25 Feb 2011 01:03:25 +0000 Subject: [PATCH 121/123] Fix non-saving OpenLyrics authors --- openlp/plugins/songs/lib/xml.py | 1 + 1 file changed, 1 insertion(+) diff --git a/openlp/plugins/songs/lib/xml.py b/openlp/plugins/songs/lib/xml.py index 91111e40a..a2a73ec97 100644 --- a/openlp/plugins/songs/lib/xml.py +++ b/openlp/plugins/songs/lib/xml.py @@ -381,6 +381,7 @@ class OpenLyrics(object): author = Author.populate(display_name=display_name, last_name=display_name.split(u' ')[-1], first_name=u' '.join(display_name.split(u' ')[:-1])) + song.authors.append(author) if not song.authors: add_author_unknown(self.manager, song) From 6bcbd3526e87a7926daca66923d72196dd9a8b4f Mon Sep 17 00:00:00 2001 From: Raoul Snyman <raoul.snyman@saturnlaboratories.co.za> Date: Fri, 25 Feb 2011 08:16:32 +0200 Subject: [PATCH 122/123] Fixed bug #700859: Bible importers do not clean up properly after a failed import. --- openlp/plugins/bibles/forms/bibleimportform.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/openlp/plugins/bibles/forms/bibleimportform.py b/openlp/plugins/bibles/forms/bibleimportform.py index fc37fad58..aea7c62e0 100644 --- a/openlp/plugins/bibles/forms/bibleimportform.py +++ b/openlp/plugins/bibles/forms/bibleimportform.py @@ -739,6 +739,7 @@ class BibleImportForm(OpenLPWizard): name=license_version, filename=unicode(self.field(u'openlp1_location').toString()) ) + bible_name = importer.name if importer.do_import(): self.manager.save_meta_data(license_version, license_version, license_copyright, license_permissions) @@ -754,3 +755,4 @@ class BibleImportForm(OpenLPWizard): self.progressLabel.setText(translate( 'BiblesPlugin.ImportWizardForm', 'Your Bible import failed.')) delete_database(self.plugin.settingsSection, importer.file) + del self.manager.db_cache[bible_name] From 5f48a38769e7c44755478fee3868645954427846 Mon Sep 17 00:00:00 2001 From: Raoul Snyman <raoul.snyman@saturnlaboratories.co.za> Date: Fri, 25 Feb 2011 08:24:35 +0200 Subject: [PATCH 123/123] Removed the need for the extra variable. --- openlp/plugins/bibles/forms/bibleimportform.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/openlp/plugins/bibles/forms/bibleimportform.py b/openlp/plugins/bibles/forms/bibleimportform.py index aea7c62e0..67996e158 100644 --- a/openlp/plugins/bibles/forms/bibleimportform.py +++ b/openlp/plugins/bibles/forms/bibleimportform.py @@ -739,7 +739,6 @@ class BibleImportForm(OpenLPWizard): name=license_version, filename=unicode(self.field(u'openlp1_location').toString()) ) - bible_name = importer.name if importer.do_import(): self.manager.save_meta_data(license_version, license_version, license_copyright, license_permissions) @@ -754,5 +753,5 @@ class BibleImportForm(OpenLPWizard): else: self.progressLabel.setText(translate( 'BiblesPlugin.ImportWizardForm', 'Your Bible import failed.')) + del self.manager.db_cache[importer.name] delete_database(self.plugin.settingsSection, importer.file) - del self.manager.db_cache[bible_name]