From e662b785db077d31ff13ae33cb55b9b5e2067b75 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Thu, 29 Oct 2009 23:27:45 +0000 Subject: [PATCH 01/15] Fix font names in theme editing --- openlp/core/ui/amendthemeform.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/openlp/core/ui/amendthemeform.py b/openlp/core/ui/amendthemeform.py index b95a88ca2..e71a4ada9 100644 --- a/openlp/core/ui/amendthemeform.py +++ b/openlp/core/ui/amendthemeform.py @@ -481,25 +481,26 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog): def paintUi(self, theme): self.stateChanging(theme) self.ThemeNameEdit.setText(self.theme.theme_name) + # Background Tab if self.theme.background_mode == u'opaque': self.BackgroundComboBox.setCurrentIndex(0) else: self.BackgroundComboBox.setCurrentIndex(1) - if theme.background_type == u'solid': self.BackgroundTypeComboBox.setCurrentIndex(0) elif theme.background_type == u'gradient': self.BackgroundTypeComboBox.setCurrentIndex(1) else: self.BackgroundTypeComboBox.setCurrentIndex(2) - if self.theme.background_direction == u'horizontal': self.GradientComboBox.setCurrentIndex(0) elif self.theme.background_direction == u'vertical': self.GradientComboBox.setCurrentIndex(1) else: self.GradientComboBox.setCurrentIndex(2) - + # Font Main Tab + self.FontMainComboBox.setCurrentFont( + QtGui.QFont(self.theme.font_main_name)) self.FontMainSizeSpinBox.setValue(int(self.theme.font_main_proportion)) if not self.theme.font_main_italics and \ self.theme.font_main_weight == u'Normal': @@ -517,6 +518,9 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog): self.FontMainYSpinBox.setValue(int(self.theme.font_main_y)) self.FontMainWidthSpinBox.setValue(int(self.theme.font_main_width)) self.FontMainHeightSpinBox.setValue(int(self.theme.font_main_height)) + # Font Footer Tab + self.FontFooterComboBox.setCurrentFont( + QtGui.QFont(self.theme.font_footer_name)) self.FontFooterSizeSpinBox.setValue( int(self.theme.font_footer_proportion)) if not self.theme.font_footer_italics and \ From fe9728f1877386df09bec872ad20cf061ee948bc Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Fri, 30 Oct 2009 01:26:45 +0000 Subject: [PATCH 02/15] Finish the copyright updating --- openlp/plugins/bibles/lib/models.py | 38 ++++++++++--------- .../presentations/lib/impresscontroller.py | 35 +++++++++-------- .../presentations/lib/messagelistener.py | 35 +++++++++-------- .../lib/presentationcontroller.py | 36 ++++++++++-------- openlp/plugins/remotes/lib/__init__.py | 36 ++++++++++-------- openlp/plugins/remotes/lib/remotetab.py | 36 ++++++++++-------- openlp/plugins/remotes/remoteclient-cli.py | 35 +++++++++-------- openlp/plugins/remotes/remoteplugin.py | 35 +++++++++-------- 8 files changed, 160 insertions(+), 126 deletions(-) diff --git a/openlp/plugins/bibles/lib/models.py b/openlp/plugins/bibles/lib/models.py index a6d5624b1..459dbf212 100644 --- a/openlp/plugins/bibles/lib/models.py +++ b/openlp/plugins/bibles/lib/models.py @@ -1,24 +1,26 @@ # -*- coding: utf-8 -*- # vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4 -""" -OpenLP - Open Source Lyrics Projection -Copyright (c) 2008 Raoul Snyman - -Portions copyright (c) 2008 - 2009 Martin Thompson, Tim Bentley - -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 -""" +############################################################################### +# OpenLP - Open Source Lyrics Projection # +# --------------------------------------------------------------------------- # +# Copyright (c) 2008-2009 Raoul Snyman # +# Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley, Carsten # +# Tinggaard, Jon Tibble, Jonathan Corwin, Maikel Stuivenberg, Scott Guerrieri # +# --------------------------------------------------------------------------- # +# 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 sqlalchemy import Column, Table, MetaData, ForeignKey, types, \ create_engine diff --git a/openlp/plugins/presentations/lib/impresscontroller.py b/openlp/plugins/presentations/lib/impresscontroller.py index a971f8342..0d1daef9c 100644 --- a/openlp/plugins/presentations/lib/impresscontroller.py +++ b/openlp/plugins/presentations/lib/impresscontroller.py @@ -1,22 +1,27 @@ # -*- coding: utf-8 -*- # vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4 -""" -OpenLP - Open Source Lyrics Projection -Copyright (c) 2008 Raoul Snyman -Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley -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. +############################################################################### +# OpenLP - Open Source Lyrics Projection # +# --------------------------------------------------------------------------- # +# Copyright (c) 2008-2009 Raoul Snyman # +# Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley, Carsten # +# Tinggaard, Jon Tibble, Jonathan Corwin, Maikel Stuivenberg, Scott Guerrieri # +# --------------------------------------------------------------------------- # +# 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 # +############################################################################### -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 -""" # OOo API documentation: # http://api.openoffice.org/docs/common/ref/com/sun/star/presentation/XSlideShowController.html # http://docs.go-oo.org/sd/html/classsd_1_1SlideShow.html diff --git a/openlp/plugins/presentations/lib/messagelistener.py b/openlp/plugins/presentations/lib/messagelistener.py index ca30b5564..feb3d33a4 100644 --- a/openlp/plugins/presentations/lib/messagelistener.py +++ b/openlp/plugins/presentations/lib/messagelistener.py @@ -1,22 +1,27 @@ # -*- coding: utf-8 -*- # vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4 -""" -OpenLP - Open Source Lyrics Projection -Copyright (c) 2008 Raoul Snyman -Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley -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. +############################################################################### +# OpenLP - Open Source Lyrics Projection # +# --------------------------------------------------------------------------- # +# Copyright (c) 2008-2009 Raoul Snyman # +# Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley, Carsten # +# Tinggaard, Jon Tibble, Jonathan Corwin, Maikel Stuivenberg, Scott Guerrieri # +# --------------------------------------------------------------------------- # +# 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 # +############################################################################### -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 -""" import logging import os diff --git a/openlp/plugins/presentations/lib/presentationcontroller.py b/openlp/plugins/presentations/lib/presentationcontroller.py index bb26da442..00f6f8495 100644 --- a/openlp/plugins/presentations/lib/presentationcontroller.py +++ b/openlp/plugins/presentations/lib/presentationcontroller.py @@ -1,22 +1,26 @@ # -*- coding: utf-8 -*- # vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4 -""" -OpenLP - Open Source Lyrics Projection -Copyright (c) 2008 Raoul Snyman -Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley -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 -""" +############################################################################### +# OpenLP - Open Source Lyrics Projection # +# --------------------------------------------------------------------------- # +# Copyright (c) 2008-2009 Raoul Snyman # +# Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley, Carsten # +# Tinggaard, Jon Tibble, Jonathan Corwin, Maikel Stuivenberg, Scott Guerrieri # +# --------------------------------------------------------------------------- # +# 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 # +############################################################################### import logging import os diff --git a/openlp/plugins/remotes/lib/__init__.py b/openlp/plugins/remotes/lib/__init__.py index a35185ad9..ec5598600 100644 --- a/openlp/plugins/remotes/lib/__init__.py +++ b/openlp/plugins/remotes/lib/__init__.py @@ -1,21 +1,25 @@ # -*- coding: utf-8 -*- # vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4 -""" -OpenLP - Open Source Lyrics Projection -Copyright (c) 2008 Raoul Snyman -Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley -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 -""" +############################################################################### +# OpenLP - Open Source Lyrics Projection # +# --------------------------------------------------------------------------- # +# Copyright (c) 2008-2009 Raoul Snyman # +# Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley, Carsten # +# Tinggaard, Jon Tibble, Jonathan Corwin, Maikel Stuivenberg, Scott Guerrieri # +# --------------------------------------------------------------------------- # +# 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 remotetab import RemoteTab diff --git a/openlp/plugins/remotes/lib/remotetab.py b/openlp/plugins/remotes/lib/remotetab.py index 26b5eea30..9ae5df862 100644 --- a/openlp/plugins/remotes/lib/remotetab.py +++ b/openlp/plugins/remotes/lib/remotetab.py @@ -1,22 +1,26 @@ # -*- coding: utf-8 -*- # vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4 -""" -OpenLP - Open Source Lyrics Projection -Copyright (c) 2008 Raoul Snyman -Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley, -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 -""" +############################################################################### +# OpenLP - Open Source Lyrics Projection # +# --------------------------------------------------------------------------- # +# Copyright (c) 2008-2009 Raoul Snyman # +# Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley, Carsten # +# Tinggaard, Jon Tibble, Jonathan Corwin, Maikel Stuivenberg, Scott Guerrieri # +# --------------------------------------------------------------------------- # +# 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 QtGui diff --git a/openlp/plugins/remotes/remoteclient-cli.py b/openlp/plugins/remotes/remoteclient-cli.py index 8432edd70..2bffa1136 100755 --- a/openlp/plugins/remotes/remoteclient-cli.py +++ b/openlp/plugins/remotes/remoteclient-cli.py @@ -1,23 +1,28 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4 -""" -OpenLP - Open Source Lyrics Projection -Copyright (c) 2008 Raoul Snyman -Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley, -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. +############################################################################### +# OpenLP - Open Source Lyrics Projection # +# --------------------------------------------------------------------------- # +# Copyright (c) 2008-2009 Raoul Snyman # +# Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley, Carsten # +# Tinggaard, Jon Tibble, Jonathan Corwin, Maikel Stuivenberg, Scott Guerrieri # +# --------------------------------------------------------------------------- # +# 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 # +############################################################################### -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 -""" import socket import sys from optparse import OptionParser diff --git a/openlp/plugins/remotes/remoteplugin.py b/openlp/plugins/remotes/remoteplugin.py index 2cd95a877..eca2ef18e 100644 --- a/openlp/plugins/remotes/remoteplugin.py +++ b/openlp/plugins/remotes/remoteplugin.py @@ -1,22 +1,27 @@ # -*- coding: utf-8 -*- # vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4 -""" -OpenLP - Open Source Lyrics Projection -Copyright (c) 2008 Raoul Snyman -Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley, -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. +############################################################################### +# OpenLP - Open Source Lyrics Projection # +# --------------------------------------------------------------------------- # +# Copyright (c) 2008-2009 Raoul Snyman # +# Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley, Carsten # +# Tinggaard, Jon Tibble, Jonathan Corwin, Maikel Stuivenberg, Scott Guerrieri # +# --------------------------------------------------------------------------- # +# 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 # +############################################################################### -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 -""" import logging from PyQt4 import QtNetwork, QtCore From fb1da41f3478ae61f8ae0a6b5b341267d5eb20ef Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Fri, 30 Oct 2009 01:27:30 +0000 Subject: [PATCH 03/15] Fix song icon in services --- openlp/plugins/songs/lib/mediaitem.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openlp/plugins/songs/lib/mediaitem.py b/openlp/plugins/songs/lib/mediaitem.py index 11ccb0763..f7d6c5a54 100644 --- a/openlp/plugins/songs/lib/mediaitem.py +++ b/openlp/plugins/songs/lib/mediaitem.py @@ -49,7 +49,7 @@ class SongMediaItem(MediaManagerItem): self.ConfigSection = u'songs' self.IconPath = u'songs/song' self.ListViewWithDnD_class = SongListView - self.ServiceItemIconName = u':/media/song_image.png' + self.ServiceItemIconName = u':/media/media_song.png' self.servicePath = None MediaManagerItem.__init__(self, parent, icon, title) self.edit_song_form = EditSongForm(self.parent.songmanager, self) From 0d959fbfb1fa14fbcbc15cf1f5c49e3b2bfdc8ca Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Fri, 30 Oct 2009 06:43:28 +0000 Subject: [PATCH 04/15] Song Edit Preview button only active from Preview, Reset Theme Editor image text Edit --- openlp/core/ui/amendthemeform.py | 4 +- openlp/core/ui/servicemanager.py | 2 + openlp/plugins/songs/forms/editsongform.py | 66 ++++++++++++---------- openlp/plugins/songs/lib/mediaitem.py | 8 ++- 4 files changed, 48 insertions(+), 32 deletions(-) diff --git a/openlp/core/ui/amendthemeform.py b/openlp/core/ui/amendthemeform.py index b95a88ca2..11daa12c7 100644 --- a/openlp/core/ui/amendthemeform.py +++ b/openlp/core/ui/amendthemeform.py @@ -408,6 +408,7 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog): self.theme.background_endColor = u'#ff0000' else: self.theme.background_type = u'image' + a=c self.stateChanging(self.theme) self.previewTheme(self.theme) @@ -431,7 +432,6 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog): QtGui.QColor(self.theme.background_endColor), self).name() self.Color2PushButton.setStyleSheet( u'background-color: %s' % unicode(self.theme.background_endColor)) - self.previewTheme(self.theme) # #Other Tab @@ -486,12 +486,14 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog): else: self.BackgroundComboBox.setCurrentIndex(1) + self.ImageLineEdit.setText(u'') if theme.background_type == u'solid': self.BackgroundTypeComboBox.setCurrentIndex(0) elif theme.background_type == u'gradient': self.BackgroundTypeComboBox.setCurrentIndex(1) else: self.BackgroundTypeComboBox.setCurrentIndex(2) + self.ImageLineEdit.setText(self.theme.background_filename) if self.theme.background_direction == u'horizontal': self.GradientComboBox.setCurrentIndex(0) diff --git a/openlp/core/ui/servicemanager.py b/openlp/core/ui/servicemanager.py index ebd758bbc..2d0e43c30 100644 --- a/openlp/core/ui/servicemanager.py +++ b/openlp/core/ui/servicemanager.py @@ -129,6 +129,8 @@ class ServiceManager(QtGui.QWidget): self.serviceItems = [] self.serviceName = u'' self.isNew = True + #Indicates if remoteTriggering is active. If it is the next addServiceItem call + #will replace the currently selected one. self.remoteEditTriggered = False self.Layout = QtGui.QVBoxLayout(self) self.Layout.setSpacing(0) diff --git a/openlp/plugins/songs/forms/editsongform.py b/openlp/plugins/songs/forms/editsongform.py index 97b9eacb3..38a2117b2 100644 --- a/openlp/plugins/songs/forms/editsongform.py +++ b/openlp/plugins/songs/forms/editsongform.py @@ -95,9 +95,10 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): QtCore.SIGNAL(u'lostFocus()'), self.onCommentsEditLostFocus) QtCore.QObject.connect(self.VerseOrderEdit, QtCore.SIGNAL(u'lostFocus()'), self.onVerseOrderEditLostFocus) - previewButton = QtGui.QPushButton() - previewButton.setText(self.trUtf8(u'Save && Preview')) - self.ButtonBox.addButton(previewButton, QtGui.QDialogButtonBox.ActionRole) + self.previewButton = QtGui.QPushButton() + self.previewButton.setText(self.trUtf8(u'Save && Preview')) + self.ButtonBox.addButton( + self.previewButton, QtGui.QDialogButtonBox.ActionRole) QtCore.QObject.connect(self.ButtonBox, QtCore.SIGNAL(u'clicked(QAbstractButton*)'), self.onPreview) # Create other objects and forms @@ -167,7 +168,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): self.loadTopics() self.loadBooks() - def loadSong(self, id): + def loadSong(self, id, preview): log.debug(u'Load Song') self.SongTabWidget.setCurrentIndex(0) self.loadAuthors() @@ -236,6 +237,10 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): self._validate_song() self.title_change = False self.TitleEditItem.setFocus(QtCore.Qt.OtherFocusReason) + #if not preview hide the preview button + self.previewButton.setVisible(False) + if preview: + self.previewButton.setVisible(True) def onAuthorAddButtonClicked(self): item = int(self.AuthorsSelectionComboItem.currentIndex()) @@ -434,31 +439,34 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): def processLyrics(self): log.debug(u'processLyrics') - sxml = SongXMLBuilder() - sxml.new_document() - sxml.add_lyrics_to_song() - count = 1 - text = u' ' - verse_order = u'' - for i in range (0, self.VerseListWidget.count()): - sxml.add_verse_to_lyrics(u'Verse', unicode(count), - unicode(self.VerseListWidget.item(i).text())) - text = text + unicode(self.VerseListWidget.item(i).text()) + u' ' - verse_order = verse_order + unicode(count) + u' ' - count += 1 - if self.song.verse_order is None: - self.song.verse_order = verse_order - text = text.replace(u'\'', u'') - text = text.replace(u',', u'') - text = text.replace(u';', u'') - text = text.replace(u':', u'') - text = text.replace(u'(', u'') - text = text.replace(u')', u'') - text = text.replace(u'{', u'') - text = text.replace(u'}', u'') - text = text.replace(u'?', u'') - self.song.search_lyrics = unicode(text) - self.song.lyrics = unicode(sxml.extract_xml()) + try: + sxml = SongXMLBuilder() + sxml.new_document() + sxml.add_lyrics_to_song() + count = 1 + text = u' ' + verse_order = u'' + for i in range (0, self.VerseListWidget.count()): + sxml.add_verse_to_lyrics(u'Verse', unicode(count), + unicode(self.VerseListWidget.item(i).text())) + text = text + unicode(self.VerseListWidget.item(i).text()) + u' ' + verse_order = verse_order + unicode(count) + u' ' + count += 1 + if self.song.verse_order is None: + self.song.verse_order = verse_order + text = text.replace(u'\'', u'') + text = text.replace(u',', u'') + text = text.replace(u';', u'') + text = text.replace(u':', u'') + text = text.replace(u'(', u'') + text = text.replace(u')', u'') + text = text.replace(u'{', u'') + text = text.replace(u'}', u'') + text = text.replace(u'?', u'') + self.song.search_lyrics = unicode(text) + self.song.lyrics = unicode(sxml.extract_xml()) + except: + log.exception(u'Problem processing song Lyrics') def processTitle(self): log.debug(u'processTitle') diff --git a/openlp/plugins/songs/lib/mediaitem.py b/openlp/plugins/songs/lib/mediaitem.py index 11ccb0763..0ca0756a6 100644 --- a/openlp/plugins/songs/lib/mediaitem.py +++ b/openlp/plugins/songs/lib/mediaitem.py @@ -55,7 +55,11 @@ class SongMediaItem(MediaManagerItem): self.edit_song_form = EditSongForm(self.parent.songmanager, self) self.song_maintenance_form = SongMaintenanceForm( self.parent.songmanager, self) + #fromPreview holds the id of the item if the song editor needs to trigger a preview + #without closing. It is set to -1 if this function is inactive self.fromPreview = -1 + #fromServiceManager holds the id of the item if the song editor needs to trigger posting + #to the servicemanager without closing. It is set to -1 if this function is inactive self.fromServiceManager = -1 def initPluginNameVisible(self): @@ -244,7 +248,7 @@ class SongMediaItem(MediaManagerItem): valid = self.parent.songmanager.get_song(songid) if valid is not None: self.fromServiceManager = songid - self.edit_song_form.loadSong(songid) + self.edit_song_form.loadSong(songid, False) self.edit_song_form.exec_() def onEditClick(self, preview=False): @@ -254,7 +258,7 @@ class SongMediaItem(MediaManagerItem): self.fromPreview = -1 if preview: self.fromPreview = item_id - self.edit_song_form.loadSong(item_id) + self.edit_song_form.loadSong(item_id, preview) self.edit_song_form.exec_() def onEventEditSong (self): From 7eb86b15806f7bb5acfa80ca037535960df7de93 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Fri, 30 Oct 2009 17:44:16 +0000 Subject: [PATCH 05/15] Plugin cleanups and more i18n --- openlp/core/lib/mediamanageritem.py | 19 +++++----- openlp/core/lib/plugin.py | 13 ++++--- openlp/core/lib/pluginmanager.py | 1 - openlp/core/lib/settingstab.py | 2 +- openlp/core/ui/alertstab.py | 2 +- openlp/core/ui/generaltab.py | 2 +- openlp/core/ui/mediadockmanager.py | 3 +- openlp/core/ui/themestab.py | 2 +- openlp/plugins/bibles/bibleplugin.py | 14 +++----- openlp/plugins/bibles/lib/biblestab.py | 4 +-- openlp/plugins/bibles/lib/manager.py | 2 +- openlp/plugins/bibles/lib/mediaitem.py | 36 +++++++++++-------- openlp/plugins/custom/customplugin.py | 11 +++--- openlp/plugins/custom/lib/mediaitem.py | 7 ++-- openlp/plugins/images/imageplugin.py | 16 +++++---- openlp/plugins/images/lib/imagetab.py | 6 ++-- openlp/plugins/images/lib/mediaitem.py | 6 ++-- openlp/plugins/media/lib/mediaitem.py | 13 +++---- openlp/plugins/media/lib/mediatab.py | 4 +-- openlp/plugins/media/mediaplugin.py | 11 +++--- openlp/plugins/presentations/lib/mediaitem.py | 11 +++--- .../presentations/lib/presentationtab.py | 4 +-- .../presentations/presentationplugin.py | 21 +++++------ openlp/plugins/remotes/lib/remotetab.py | 4 +-- openlp/plugins/remotes/remoteplugin.py | 14 ++++---- openlp/plugins/songs/lib/mediaitem.py | 10 +++--- openlp/plugins/songs/lib/songstab.py | 10 +++--- openlp/plugins/songs/songsplugin.py | 11 +++--- openlp/plugins/songusage/songusageplugin.py | 19 +++++----- 29 files changed, 136 insertions(+), 142 deletions(-) diff --git a/openlp/core/lib/mediamanageritem.py b/openlp/core/lib/mediamanageritem.py index 651029e5a..e94aaad48 100644 --- a/openlp/core/lib/mediamanageritem.py +++ b/openlp/core/lib/mediamanageritem.py @@ -58,18 +58,13 @@ class MediaManagerItem(QtGui.QWidget): When creating a descendant class from this class for your plugin, the following member variables should be set. - ``self.TranslationContext`` - This sets the translation context of all the text in the - Media Manager item. - ``self.PluginNameShort`` The shortened (usually singular) name for the plugin e.g. *'Song'* for the Songs plugin. ``self.PluginNameVisible`` The user visible name for a plugin which should use a suitable - translation function. This should normally be - ``self.trUtf8(self.PluginNameShort)``. + translation function. ``self.ConfigSection`` The section in the configuration where the items in the media @@ -117,6 +112,7 @@ class MediaManagerItem(QtGui.QWidget): if title is not None: self.title = title self.Toolbar = None + self.ServiceItemIconName = None self.PageLayout = QtGui.QVBoxLayout(self) self.PageLayout.setSpacing(0) self.PageLayout.setContentsMargins(4, 0, 4, 0) @@ -228,7 +224,8 @@ class MediaManagerItem(QtGui.QWidget): if self.hasEditIcon: self.addToolbarButton( u'Edit %s' % self.PluginNameShort, - u'%s %s' % (self.trUtf8(u'Edit the selected'), self.PluginNameVisible), + u'%s %s' % (self.trUtf8(u'Edit the selected'), + self.PluginNameVisible), u':%s_edit.png' % self.IconPath, self.onEditClick, u'%sEditItem' % self.PluginNameShort) ## Delete Button ## @@ -320,7 +317,7 @@ class MediaManagerItem(QtGui.QWidget): def onFileClick(self): files = QtGui.QFileDialog.getOpenFileNames( - self, self.trUtf8(self.OnNewPrompt), + self, self.OnNewPrompt, self.parent.config.get_last_dir(), self.OnNewFileMasks) log.info(u'New files(s)%s', unicode(files)) if len(files) > 0: @@ -382,8 +379,10 @@ class MediaManagerItem(QtGui.QWidget): Common method for generating a service item """ service_item = ServiceItem(self.parent) - service_item.addIcon( - u':/media/media_' + self.PluginNameShort.lower() + u'.png') + if self.ServiceItemIconName is not None: + service_item.addIcon(self.ServiceItemIconName) + else: + service_item.addIcon(self.icon) if self.generateSlideData(service_item): self.ListView.clearSelection() return service_item diff --git a/openlp/core/lib/plugin.py b/openlp/core/lib/plugin.py index 0dd8b5230..69eaa8ef9 100644 --- a/openlp/core/lib/plugin.py +++ b/openlp/core/lib/plugin.py @@ -35,7 +35,7 @@ class PluginStatus(object): Inactive = 1 Disabled = 2 -class Plugin(object): +class Plugin(QtCore.QObject): """ Base class for openlp plugins to inherit from. @@ -91,7 +91,7 @@ class Plugin(object): log = logging.getLogger(u'Plugin') log.info(u'loaded') - def __init__(self, name=None, version=None, plugin_helpers=None): + def __init__(self, name, version=None, plugin_helpers=None): """ This is the constructor for the plugin object. This provides an easy way for descendent plugins to populate common data. This method *must* @@ -110,10 +110,8 @@ class Plugin(object): ``plugin_helpers`` Defaults to *None*. A list of helper objects. """ - if name is not None: - self.name = name - else: - self.name = u'Plugin' + QtCore.QObject.__init__(self) + self.name = name if version is not None: self.version = version self.icon = None @@ -129,7 +127,7 @@ class Plugin(object): self.settings = plugin_helpers[u'settings'] self.mediadock = plugin_helpers[u'toolbox'] QtCore.QObject.connect(Receiver.get_receiver(), - QtCore.SIGNAL(u'%s_add_service_item'% self.name), + QtCore.SIGNAL(u'%s_add_service_item' % self.name), self.process_add_service_event) def check_pre_conditions(self): @@ -258,6 +256,7 @@ class Plugin(object): """ Called by plugin to replace toolbar """ + # Not sure self.media_item is being set properly if self.media_item is not None: self.mediadock.insert_dock(self.media_item, self.icon, self.weight) if self.settings_tab is not None: diff --git a/openlp/core/lib/pluginmanager.py b/openlp/core/lib/pluginmanager.py index b06ca2330..2d7eead5e 100644 --- a/openlp/core/lib/pluginmanager.py +++ b/openlp/core/lib/pluginmanager.py @@ -93,7 +93,6 @@ class PluginManager(object): log.exception(u'Failed to import module %s on path %s for reason %s', modulename, path, e.args[0]) plugin_classes = Plugin.__subclasses__() - self.plugins = [] plugin_objects = [] for p in plugin_classes: try: diff --git a/openlp/core/lib/settingstab.py b/openlp/core/lib/settingstab.py index f9eb60964..aa278600a 100644 --- a/openlp/core/lib/settingstab.py +++ b/openlp/core/lib/settingstab.py @@ -31,7 +31,7 @@ class SettingsTab(QtGui.QWidget): SettingsTab is a helper widget for plugins to define Tabs for the settings dialog. """ - def __init__(self, title=None, section=None): + def __init__(self, title, section=None): """ Constructor to create the Settings tab item. diff --git a/openlp/core/ui/alertstab.py b/openlp/core/ui/alertstab.py index e2b8892fa..6123ff3c5 100644 --- a/openlp/core/ui/alertstab.py +++ b/openlp/core/ui/alertstab.py @@ -31,7 +31,7 @@ class AlertsTab(SettingsTab): AlertsTab is the alerts settings tab in the settings dialog. """ def __init__(self): - SettingsTab.__init__(self, u'Alerts', u'Alerts') + SettingsTab.__init__(self, u'Alerts') self.font_color = '#ffffff' self.bg_color = '#660000' diff --git a/openlp/core/ui/generaltab.py b/openlp/core/ui/generaltab.py index 54031ec1a..aa4dd6575 100644 --- a/openlp/core/ui/generaltab.py +++ b/openlp/core/ui/generaltab.py @@ -32,7 +32,7 @@ class GeneralTab(SettingsTab): """ def __init__(self, screen_list): self.screen_list = screen_list - SettingsTab.__init__(self, u'General', u'General') + SettingsTab.__init__(self, u'General') def setupUi(self): self.setObjectName(u'GeneralTab') diff --git a/openlp/core/ui/mediadockmanager.py b/openlp/core/ui/mediadockmanager.py index 4b1d64178..795a7f845 100644 --- a/openlp/core/ui/mediadockmanager.py +++ b/openlp/core/ui/mediadockmanager.py @@ -33,8 +33,7 @@ class MediaDockManager(object): def add_dock(self, media_item, icon, weight): log.info(u'Adding %s dock' % media_item.title) - id = self.media_dock.addItem( - media_item, icon, media_item.title) + self.media_dock.addItem(media_item, icon, media_item.title) def insert_dock(self, media_item, icon, weight): """ diff --git a/openlp/core/ui/themestab.py b/openlp/core/ui/themestab.py index d53ebb7d9..2afbf297c 100644 --- a/openlp/core/ui/themestab.py +++ b/openlp/core/ui/themestab.py @@ -32,7 +32,7 @@ class ThemesTab(SettingsTab): """ def __init__(self, parent): self.parent = parent - SettingsTab.__init__(self, u'Themes', u'Themes') + SettingsTab.__init__(self, u'Themes') def setupUi(self): self.setObjectName(u'ThemesTab') diff --git a/openlp/plugins/bibles/bibleplugin.py b/openlp/plugins/bibles/bibleplugin.py index eb1018bf2..24a7cafc7 100644 --- a/openlp/plugins/bibles/bibleplugin.py +++ b/openlp/plugins/bibles/bibleplugin.py @@ -35,10 +35,8 @@ class BiblePlugin(Plugin): log.info(u'Bible Plugin loaded') def __init__(self, plugin_helpers): - # Call the parent constructor Plugin.__init__(self, u'Bibles', u'1.9.0', plugin_helpers) self.weight = -9 - # Create the plugin icon self.icon = buildIcon(u':/media/media_bible.png') #Register the bible Manager self.biblemanager = None @@ -51,7 +49,6 @@ class BiblePlugin(Plugin): if self.biblemanager is None: self.biblemanager = BibleManager(self.config) Plugin.initialise(self) - self.insert_toolbox_item() self.ImportBibleItem.setVisible(True) self.ExportBibleItem.setVisible(True) @@ -63,11 +60,11 @@ class BiblePlugin(Plugin): self.ExportBibleItem.setVisible(False) def get_settings_tab(self): - return BiblesTab() + return BiblesTab(self.name) def get_media_manager_item(self): # Create the BibleManagerItem object - return BibleMediaItem(self, self.icon, u'Bibles') + return BibleMediaItem(self, self.icon, self.name) def add_import_menu_item(self, import_menu): self.ImportBibleItem = QtGui.QAction(import_menu) @@ -91,8 +88,7 @@ class BiblePlugin(Plugin): self.media_item.onNewClick() def about(self): - about_text = u'Bible Plugin
This plugin allows '\ - u'bible verse from different sources to be displayed on the '\ - u'screen during the service.

This is a core '\ - u'plugin and cannot be made inactive' + about_text = self.trUtf8(u'Bible Plugin
This ' + u'plugin allows bible verses from different sources to be ' + u'displayed on the screen during the service.') return about_text diff --git a/openlp/plugins/bibles/lib/biblestab.py b/openlp/plugins/bibles/lib/biblestab.py index 91e051169..0e9d9fb0b 100644 --- a/openlp/plugins/bibles/lib/biblestab.py +++ b/openlp/plugins/bibles/lib/biblestab.py @@ -37,11 +37,11 @@ class BiblesTab(SettingsTab): log = logging.getLogger(u'BibleTab') log.info(u'Bible Tab loaded') - def __init__(self): + def __init__(self, title, section=None): self.paragraph_style = True self.show_new_chapters = False self.display_style = 0 - SettingsTab.__init__(self, u'Bibles', u'Bibles') + SettingsTab.__init__(self, title, section) def setupUi(self): self.setObjectName(u'BiblesTab') diff --git a/openlp/plugins/bibles/lib/manager.py b/openlp/plugins/bibles/lib/manager.py index eaaf147b6..f5653c115 100644 --- a/openlp/plugins/bibles/lib/manager.py +++ b/openlp/plugins/bibles/lib/manager.py @@ -283,7 +283,7 @@ class BibleManager(object): count = self.bible_db_cache[bible].get_max_bible_book_verses( book, chapter) if count == 0: - text = self.get_verse_text(bible, book, chapter, chapter, 1, 1) + #text = self.get_verse_text(bible, book, chapter, chapter, 1, 1) count = self.bible_db_cache[bible].get_max_bible_book_verses( book, chapter) return count diff --git a/openlp/plugins/bibles/lib/mediaitem.py b/openlp/plugins/bibles/lib/mediaitem.py index a305400a5..d44f18a6f 100644 --- a/openlp/plugins/bibles/lib/mediaitem.py +++ b/openlp/plugins/bibles/lib/mediaitem.py @@ -46,12 +46,10 @@ class BibleMediaItem(MediaManagerItem): log.info(u'Bible Media Item loaded') def __init__(self, parent, icon, title): - self.TranslationContext = u'BiblePlugin' self.PluginNameShort = u'Bible' - self.ConfigSection = u'bibles' + self.ConfigSection = title self.IconPath = u'songs/song' self.ListViewWithDnD_class = BibleListView - self.ServiceItemIconName = u':/media/bible_image.png' self.servicePath = None MediaManagerItem.__init__(self, parent, icon, title) # place to store the search results @@ -60,7 +58,7 @@ class BibleMediaItem(MediaManagerItem): QtCore.SIGNAL(u'openlpreloadbibles'), self.reloadBibles) def initPluginNameVisible(self): - self.PluginNameVisible = self.trUtf8(self.PluginNameShort) + self.PluginNameVisible = self.trUtf8(u'Bible') def requiredIcons(self): MediaManagerItem.requiredIcons(self) @@ -89,14 +87,16 @@ class BibleMediaItem(MediaManagerItem): self.QuickVersionLabel.setObjectName(u'QuickVersionLabel') self.QuickLayout.addWidget(self.QuickVersionLabel, 0, 0, 1, 1) self.QuickVersionComboBox = QtGui.QComboBox(self.QuickTab) - self.QuickVersionComboBox.setSizeAdjustPolicy(QtGui.QComboBox.AdjustToMinimumContentsLength) + self.QuickVersionComboBox.setSizeAdjustPolicy( + QtGui.QComboBox.AdjustToMinimumContentsLength) self.QuickVersionComboBox.setObjectName(u'VersionComboBox') self.QuickLayout.addWidget(self.QuickVersionComboBox, 0, 1, 1, 2) self.QuickSecondVersionLabel = QtGui.QLabel(self.QuickTab) self.QuickSecondVersionLabel.setObjectName(u'QuickSecondVersionLabel') self.QuickLayout.addWidget(self.QuickSecondVersionLabel, 1, 0, 1, 1) self.QuickSecondBibleComboBox = QtGui.QComboBox(self.QuickTab) - self.QuickSecondBibleComboBox.setSizeAdjustPolicy(QtGui.QComboBox.AdjustToMinimumContentsLength) + self.QuickSecondBibleComboBox.setSizeAdjustPolicy( + QtGui.QComboBox.AdjustToMinimumContentsLength) self.QuickSecondBibleComboBox.setObjectName(u'SecondBible') self.QuickLayout.addWidget(self.QuickSecondBibleComboBox, 1, 1, 1, 2) self.QuickSearchLabel = QtGui.QLabel(self.QuickTab) @@ -147,16 +147,20 @@ class BibleMediaItem(MediaManagerItem): self.AdvancedVersionLabel.setObjectName(u'AdvancedVersionLabel') self.AdvancedLayout.addWidget(self.AdvancedVersionLabel, 0, 0, 1, 1) self.AdvancedVersionComboBox = QtGui.QComboBox(self.AdvancedTab) - self.AdvancedVersionComboBox.setSizeAdjustPolicy(QtGui.QComboBox.AdjustToMinimumContentsLength) + self.AdvancedVersionComboBox.setSizeAdjustPolicy( + QtGui.QComboBox.AdjustToMinimumContentsLength) self.AdvancedVersionComboBox.setObjectName(u'AdvancedVersionComboBox') self.AdvancedLayout.addWidget(self.AdvancedVersionComboBox, 0, 1, 1, 2) self.AdvancedSecondBibleLabel = QtGui.QLabel(self.AdvancedTab) self.AdvancedSecondBibleLabel.setObjectName(u'AdvancedSecondBibleLabel') self.AdvancedLayout.addWidget(self.AdvancedSecondBibleLabel, 1, 0, 1, 1) self.AdvancedSecondBibleComboBox = QtGui.QComboBox(self.AdvancedTab) - self.AdvancedSecondBibleComboBox.setSizeAdjustPolicy(QtGui.QComboBox.AdjustToMinimumContentsLength) - self.AdvancedSecondBibleComboBox.setObjectName(u'AdvancedSecondBibleComboBox') - self.AdvancedLayout.addWidget(self.AdvancedSecondBibleComboBox, 1, 1, 1, 2) + self.AdvancedSecondBibleComboBox.setSizeAdjustPolicy( + QtGui.QComboBox.AdjustToMinimumContentsLength) + self.AdvancedSecondBibleComboBox.setObjectName( + u'AdvancedSecondBibleComboBox') + self.AdvancedLayout.addWidget( + self.AdvancedSecondBibleComboBox, 1, 1, 1, 2) self.AdvancedBookLabel = QtGui.QLabel(self.AdvancedTab) self.AdvancedBookLabel.setObjectName(u'AdvancedBookLabel') self.AdvancedLayout.addWidget(self.AdvancedBookLabel, 2, 0, 1, 1) @@ -198,14 +202,16 @@ class BibleMediaItem(MediaManagerItem): self.AdvancedSearchButtonLayout = QtGui.QHBoxLayout() self.AdvancedSearchButtonLayout.setMargin(0) self.AdvancedSearchButtonLayout.setSpacing(0) - self.AdvancedSearchButtonLayout.setObjectName(u'AdvancedSearchButtonLayout') + self.AdvancedSearchButtonLayout.setObjectName( + u'AdvancedSearchButtonLayout') self.AdvancedSearchButtonSpacer = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) self.AdvancedSearchButtonLayout.addItem(self.AdvancedSearchButtonSpacer) self.AdvancedSearchButton = QtGui.QPushButton(self.AdvancedTab) self.AdvancedSearchButton.setObjectName(u'AdvancedSearchButton') self.AdvancedSearchButtonLayout.addWidget(self.AdvancedSearchButton) - self.AdvancedLayout.addLayout(self.AdvancedSearchButtonLayout, 7, 0, 1, 3) + self.AdvancedLayout.addLayout( + self.AdvancedSearchButtonLayout, 7, 0, 1, 3) self.AdvancedMessage = QtGui.QLabel(self.AdvancedTab) self.AdvancedMessage.setObjectName(u'AdvancedMessage') self.AdvancedLayout.addWidget(self.AdvancedMessage, 8, 0, 1, 3) @@ -475,10 +481,12 @@ class BibleMediaItem(MediaManagerItem): for book in book_data: row = self.AdvancedBookComboBox.count() self.AdvancedBookComboBox.addItem(book[u'book']) - self.AdvancedBookComboBox.setItemData(row, QtCore.QVariant(book[u'total'])) + self.AdvancedBookComboBox.setItemData( + row, QtCore.QVariant(book[u'total'])) if first: first = False - self.initialiseChapterVerse(bible, book[u'book'], book[u'total']) + self.initialiseChapterVerse( + bible, book[u'book'], book[u'total']) def initialiseChapterVerse(self, bible, book, chapters): log.debug(u'initialiseChapterVerse %s, %s', bible, book) diff --git a/openlp/plugins/custom/customplugin.py b/openlp/plugins/custom/customplugin.py index 9d209d1ec..b72f3dd54 100644 --- a/openlp/plugins/custom/customplugin.py +++ b/openlp/plugins/custom/customplugin.py @@ -44,17 +44,15 @@ class CustomPlugin(Plugin): log.info(u'Custom Plugin loaded') def __init__(self, plugin_helpers): - # Call the parent constructor Plugin.__init__(self, u'Custom', u'1.9.0', plugin_helpers) self.weight = -5 self.custommanager = CustomManager(self.config) self.edit_custom_form = EditCustomForm(self.custommanager) - # Create the plugin icon self.icon = buildIcon(u':/media/media_custom.png') def get_media_manager_item(self): # Create the CustomManagerItem object - return CustomMediaItem(self, self.icon, u'Custom') + return CustomMediaItem(self, self.icon, self.name) def can_be_disabled(self): return True @@ -62,11 +60,14 @@ class CustomPlugin(Plugin): def initialise(self): log.info(u'Plugin Initialising') Plugin.initialise(self) - self.insert_toolbox_item() def finalise(self): log.info(u'Plugin Finalise') self.remove_toolbox_item() def about(self): - return u'Custom Plugin
This plugin allows slides to be displayed on the screen in the same way songs are. The difference between this plugin and songs is this plugin provides greater freedom.
' + about_text = self.trUtf8(u'Custom Plugin
This plugin ' + u'allows slides to be displayed on the screen in the same way ' + u'songs are. This plugin provides greater freedom over the ' + u'songs plugin.
') + return about_text diff --git a/openlp/plugins/custom/lib/mediaitem.py b/openlp/plugins/custom/lib/mediaitem.py index d5859cc92..93f1bfb95 100644 --- a/openlp/plugins/custom/lib/mediaitem.py +++ b/openlp/plugins/custom/lib/mediaitem.py @@ -42,17 +42,14 @@ class CustomMediaItem(MediaManagerItem): log.info(u'Custom Media Item loaded') def __init__(self, parent, icon, title): - self.TranslationContext = u'CustomPlugin' self.PluginNameShort = u'Custom' - self.ConfigSection = u'custom' + self.ConfigSection = title self.IconPath = u'custom/custom' # this next is a class, not an instance of a class - it will # be instanced by the base MediaManagerItem self.ListViewWithDnD_class = CustomListView - self.ServiceItemIconName = u':/custom/custom_image.png' self.servicePath = None MediaManagerItem.__init__(self, parent, icon, title) - self.parent = parent self.fromServiceManager = -1 def addEndHeaderBar(self): @@ -64,7 +61,7 @@ class CustomMediaItem(MediaManagerItem): QtCore.SIGNAL(u'load_custom_list'), self.initialise) def initPluginNameVisible(self): - self.PluginNameVisible = self.trUtf8(self.PluginNameShort) + self.PluginNameVisible = self.trUtf8(u'Custom') def requiredIcons(self): MediaManagerItem.requiredIcons(self) diff --git a/openlp/plugins/images/imageplugin.py b/openlp/plugins/images/imageplugin.py index e7c665aa6..94f464874 100644 --- a/openlp/plugins/images/imageplugin.py +++ b/openlp/plugins/images/imageplugin.py @@ -33,10 +33,8 @@ class ImagePlugin(Plugin): log.info(u'Image Plugin loaded') def __init__(self, plugin_helpers): - # Call the parent constructor Plugin.__init__(self, u'Images', u'1.9.0', plugin_helpers) self.weight = -7 - # Create the plugin icon self.icon = buildIcon(u':/media/media_image.png') def can_be_disabled(self): @@ -45,18 +43,24 @@ class ImagePlugin(Plugin): def initialise(self): log.info(u'Plugin Initialising') Plugin.initialise(self) - self.insert_toolbox_item() def finalise(self): log.info(u'Plugin Finalise') self.remove_toolbox_item() def get_settings_tab(self): - return ImageTab() + return ImageTab(self.name) def get_media_manager_item(self): # Create the MediaManagerItem object - return ImageMediaItem(self, self.icon, u'Images') + return ImageMediaItem(self, self.icon, self.name) def about(self): - return u'Image Plugin
Allows images of all types to be displayed. If a number of images are selected together and presented on the live controller it is possible to turn them into a timed loop.
From the plugin if the Override background is chosen and an image is selected any somgs which are rendered will use the selected image from the background instead of the one provied by the theme.
' + about_text = self.trUtf8(u'Image Plugin
Allows images of ' + u'all types to be displayed. If a number of images are selected ' + u'together and presented on the live controller it is possible ' + u'to turn them into a timed loop.
From the plugin if the ' + u'Override background is chosen and an image is selected ' + u'any somgs which are rendered will use the selected image from ' + u'the background instead of the one provied by the theme.
') + return about_text diff --git a/openlp/plugins/images/lib/imagetab.py b/openlp/plugins/images/lib/imagetab.py index 893d156a5..84da616d0 100644 --- a/openlp/plugins/images/lib/imagetab.py +++ b/openlp/plugins/images/lib/imagetab.py @@ -30,8 +30,8 @@ class ImageTab(SettingsTab): """ ImageTab is the Image settings tab in the settings dialog. """ - def __init__(self): - SettingsTab.__init__(self, u'Images', u'Images') + def __init__(self, title, section=None): + SettingsTab.__init__(self, title, section) def setupUi(self): self.setObjectName(u'ImageTab') @@ -42,7 +42,7 @@ class ImageTab(SettingsTab): self.ImageSettingsGroupBox.setObjectName(u'ImageSettingsGroupBox') self.TimeoutLayout = QtGui.QHBoxLayout(self.ImageSettingsGroupBox) self.TimeoutLayout.setSpacing(8) - self.TimeoutLayout.setMargin(0) + self.TimeoutLayout.setMargin(8) self.TimeoutLayout.setObjectName(u'TimeoutLayout') self.TimeoutLabel = QtGui.QLabel(self.ImageSettingsGroupBox) self.TimeoutLabel.setObjectName(u'TimeoutLabel') diff --git a/openlp/plugins/images/lib/mediaitem.py b/openlp/plugins/images/lib/mediaitem.py index afd3606c8..7cfe2eec0 100644 --- a/openlp/plugins/images/lib/mediaitem.py +++ b/openlp/plugins/images/lib/mediaitem.py @@ -44,20 +44,18 @@ class ImageMediaItem(MediaManagerItem): log.info(u'Image Media Item loaded') def __init__(self, parent, icon, title): - self.TranslationContext = u'ImagePlugin' self.PluginNameShort = u'Image' - self.ConfigSection = u'images' + self.ConfigSection = title self.IconPath = u'images/image' # this next is a class, not an instance of a class - it will # be instanced by the base MediaManagerItem self.ListViewWithDnD_class = ImageListView - self.ServiceItemIconName = u':/media/media_image.png' self.servicePath = None MediaManagerItem.__init__(self, parent, icon, title) self.overrideActive = False def initPluginNameVisible(self): - self.PluginNameVisible = self.trUtf8(self.PluginNameShort) + self.PluginNameVisible = self.trUtf8(u'Image') def retranslateUi(self): self.OnNewPrompt = self.trUtf8(u'Select Image(s)') diff --git a/openlp/plugins/media/lib/mediaitem.py b/openlp/plugins/media/lib/mediaitem.py index 5ce1669a0..c2bfe468f 100644 --- a/openlp/plugins/media/lib/mediaitem.py +++ b/openlp/plugins/media/lib/mediaitem.py @@ -43,22 +43,20 @@ class MediaMediaItem(MediaManagerItem): log.info(u'Media Media Item loaded') def __init__(self, parent, icon, title): - self.TranslationContext = u'MediaPlugin' self.PluginNameShort = u'Media' self.IconPath = u'images/image' - self.ConfigSection = u'media' - self.OnNewPrompt = u'Select Media(s)' + self.ConfigSection = title + self.OnNewPrompt = self.trUtf8(u'Select Media') self.OnNewFileMasks = \ u'Videos (*.avi *.mpeg *.mpg *.mp4);;Audio (*.ogg *.mp3 *.wma);;All files (*)' # this next is a class, not an instance of a class - it will # be instanced by the base MediaManagerItem self.ListViewWithDnD_class = MediaListView - #self.ServiceItemIconName = u':/media/media_image.png' self.PreviewFunction = self.video_get_preview MediaManagerItem.__init__(self, parent, icon, title) def initPluginNameVisible(self): - self.PluginNameVisible = self.trUtf8(self.PluginNameShort) + self.PluginNameVisible = self.trUtf8(u'Media') def requiredIcons(self): MediaManagerItem.requiredIcons(self) @@ -67,13 +65,10 @@ class MediaMediaItem(MediaManagerItem): self.hasEditIcon = False def video_get_preview(self, filename): - # # For now cross platform is an icon. Phonon does not support # individual frame access (yet?) and GStreamer is not available # on Windows - # - image = QtGui.QPixmap(u':/media/media_video.png').toImage() - return image + return QtGui.QPixmap(u':/media/media_video.png').toImage() def generateSlideData(self, service_item): indexes = self.ListView.selectedIndexes() diff --git a/openlp/plugins/media/lib/mediatab.py b/openlp/plugins/media/lib/mediatab.py index 398aa7ca6..2937f0133 100644 --- a/openlp/plugins/media/lib/mediatab.py +++ b/openlp/plugins/media/lib/mediatab.py @@ -30,8 +30,8 @@ class MediaTab(SettingsTab): """ mediaTab is the media settings tab in the settings dialog. """ - def __init__(self): - SettingsTab.__init__(self, u'Media', u'Media') + def __init__(self, title, section=None): + SettingsTab.__init__(self, title, section) def setupUi(self): self.setObjectName(u'MediaTab') diff --git a/openlp/plugins/media/mediaplugin.py b/openlp/plugins/media/mediaplugin.py index ae757cc36..5ba8b5d2a 100644 --- a/openlp/plugins/media/mediaplugin.py +++ b/openlp/plugins/media/mediaplugin.py @@ -33,16 +33,14 @@ class MediaPlugin(Plugin): log.info(u'Media Plugin loaded') def __init__(self, plugin_helpers): - # Call the parent constructor Plugin.__init__(self, u'Media', u'1.9.0', plugin_helpers) self.weight = -6 - # Create the plugin icon self.icon = buildIcon(u':/media/media_video.png') # passed with drag and drop messages self.dnd_id = u'Media' def get_settings_tab(self): - return MediaTab() + return MediaTab(self.name) def can_be_disabled(self): return True @@ -50,7 +48,6 @@ class MediaPlugin(Plugin): def initialise(self): log.info(u'Plugin Initialising') Plugin.initialise(self) - self.insert_toolbox_item() def finalise(self): log.info(u'Plugin Finalise') @@ -58,7 +55,9 @@ class MediaPlugin(Plugin): def get_media_manager_item(self): # Create the MediaManagerItem object - return MediaMediaItem(self, self.icon, u'Media') + return MediaMediaItem(self, self.icon, self.name) def about(self): - return u'Media Plugin
One day this may provide access to video and audio clips' + about_text = self.trUtf8(u'Media Plugin
This plugin ' + u'allows the playing of audio and video media') + return about_text diff --git a/openlp/plugins/presentations/lib/mediaitem.py b/openlp/plugins/presentations/lib/mediaitem.py index f6b19a579..2fb064257 100644 --- a/openlp/plugins/presentations/lib/mediaitem.py +++ b/openlp/plugins/presentations/lib/mediaitem.py @@ -48,11 +48,10 @@ class PresentationMediaItem(MediaManagerItem): def __init__(self, parent, icon, title, controllers): self.controllers = controllers - self.TranslationContext = u'PresentationPlugin' self.PluginNameShort = u'Presentation' - self.ConfigSection = u'presentations' + self.ConfigSection = title self.IconPath = u'presentations/presentation' - self.OnNewPrompt = u'Select Presentation(s)' + self.OnNewPrompt = self.trUtf8(u'Select Presentation(s)') self.OnNewFileMasks = u'Presentations (*.ppt *.pps *.odp)' # this next is a class, not an instance of a class - it will # be instanced by the base MediaManagerItem @@ -61,7 +60,7 @@ class PresentationMediaItem(MediaManagerItem): self.message_listener = MessageListener(controllers) def initPluginNameVisible(self): - self.PluginNameVisible = self.trUtf8(self.PluginNameShort) + self.PluginNameVisible = self.trUtf8(u'Presentation') def requiredIcons(self): MediaManagerItem.requiredIcons(self) @@ -110,8 +109,8 @@ class PresentationMediaItem(MediaManagerItem): (path, filename) = os.path.split(unicode(file)) if titles.count(filename) > 0: QtGui.QMessageBox.critical( - self, self.trUtf8(u'File exists'), - self.trUtf8(u'A presentation with that filename already exists.'), + self, self.trUtf8(u'File exists'), self.trUtf8( + u'A presentation with that filename already exists.'), QtGui.QMessageBox.Ok) else: item_name = QtGui.QListWidgetItem(filename) diff --git a/openlp/plugins/presentations/lib/presentationtab.py b/openlp/plugins/presentations/lib/presentationtab.py index 83921f234..f5da1c5bd 100644 --- a/openlp/plugins/presentations/lib/presentationtab.py +++ b/openlp/plugins/presentations/lib/presentationtab.py @@ -30,9 +30,9 @@ class PresentationTab(SettingsTab): """ PresentationsTab is the Presentations settings tab in the settings dialog. """ - def __init__(self, controllers): + def __init__(self, title, controllers, section=None): self.controllers = controllers - SettingsTab.__init__(self, u'Presentations', u'Presentations') + SettingsTab.__init__(self, title, section) def setupUi(self): self.setObjectName(u'PresentationTab') diff --git a/openlp/plugins/presentations/presentationplugin.py b/openlp/plugins/presentations/presentationplugin.py index 0fcfa1e20..8452c3410 100644 --- a/openlp/plugins/presentations/presentationplugin.py +++ b/openlp/plugins/presentations/presentationplugin.py @@ -25,9 +25,7 @@ import os import logging -from PyQt4 import QtGui - -from openlp.core.lib import Plugin +from openlp.core.lib import Plugin, buildIcon from openlp.plugins.presentations.lib import * class PresentationPlugin(Plugin): @@ -36,21 +34,17 @@ class PresentationPlugin(Plugin): log = logging.getLogger(u'PresentationPlugin') def __init__(self, plugin_helpers): - # Call the parent constructor log.debug(u'Initialised') self.controllers = {} Plugin.__init__(self, u'Presentations', u'1.9.0', plugin_helpers) self.weight = -8 - # Create the plugin icon - self.icon = QtGui.QIcon() - self.icon.addPixmap(QtGui.QPixmap(u':/media/media_presentation.png'), - QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.icon = buildIcon(u':/media/media_presentation.png') def get_settings_tab(self): """ Create the settings Tab """ - return PresentationTab(self.controllers) + return PresentationTab(self.name, self.controllers) def can_be_disabled(self): return True @@ -58,7 +52,6 @@ class PresentationPlugin(Plugin): def initialise(self): log.info(u'Presentations Initialising') Plugin.initialise(self) - self.insert_toolbox_item() def finalise(self): log.info(u'Plugin Finalise') @@ -74,7 +67,7 @@ class PresentationPlugin(Plugin): Create the Media Manager List """ return PresentationMediaItem( - self, self.icon, u'Presentations', self.controllers) + self, self.icon, self.name, self.controllers) def registerControllers(self, controller): self.controllers[controller.name] = controller @@ -110,4 +103,8 @@ class PresentationPlugin(Plugin): return False def about(self): - return u'Presentation Plugin
Delivers the ability to show presentations using a number of different programs. The choice of available presentaion programs is available in a drop down.' + about_text = self.trUtf8(u'Presentation Plugin
Delivers ' + u'the ability to show presentations using a number of different ' + u'programs. The choice of available presentation programs is ' + u'available to the user in a drop down box.') + return about_text diff --git a/openlp/plugins/remotes/lib/remotetab.py b/openlp/plugins/remotes/lib/remotetab.py index 9ae5df862..5c39ab0ad 100644 --- a/openlp/plugins/remotes/lib/remotetab.py +++ b/openlp/plugins/remotes/lib/remotetab.py @@ -30,8 +30,8 @@ class RemoteTab(SettingsTab): """ RemoteTab is the Remotes settings tab in the settings dialog. """ - def __init__(self): - SettingsTab.__init__(self, u'Remotes', u'Remotes') + def __init__(self, title, section=None): + SettingsTab.__init__(self, title, section) def setupUi(self): self.setObjectName(u'RemoteTab') diff --git a/openlp/plugins/remotes/remoteplugin.py b/openlp/plugins/remotes/remoteplugin.py index eca2ef18e..9bf2feffb 100644 --- a/openlp/plugins/remotes/remoteplugin.py +++ b/openlp/plugins/remotes/remoteplugin.py @@ -36,7 +36,6 @@ class RemotesPlugin(Plugin): log.info(u'Remote Plugin loaded') def __init__(self, plugin_helpers): - # Call the parent constructor Plugin.__init__(self, u'Remotes', u'1.9.0', plugin_helpers) self.weight = -1 self.server = None @@ -47,7 +46,6 @@ class RemotesPlugin(Plugin): def initialise(self): log.debug(u'initialise') Plugin.initialise(self) - self.insert_toolbox_item() self.server = QtNetwork.QUdpSocket() self.server.bind(int(self.config.get_config(u'remote port', 4316))) QtCore.QObject.connect(self.server, @@ -59,14 +57,11 @@ class RemotesPlugin(Plugin): if self.server is not None: self.server.close() - def about(self): - return u'Remote Plugin
This plugin provides the ability to send messages to a running version of openlp on a different computer.
The Primary use for this would be to send alerts from a creche' - def get_settings_tab(self): """ Create the settings Tab """ - return RemoteTab() + return RemoteTab(self.name) def readData(self): log.info(u'Remoted data has arrived') @@ -83,3 +78,10 @@ class RemotesPlugin(Plugin): Receiver().send_message(u'alert_text', unicode(datagram[pos + 1:])) if event == u'next_slide': Receiver().send_message(u'live_slide_next') + + def about(self): + about_text = self.trUtf8(u'Remote Plugin
This plugin ' + u'provides the ability to send messages to a running version of ' + u'openlp on a different computer.
The Primary use for this ' + u'would be to send alerts from a creche') + return about_text diff --git a/openlp/plugins/songs/lib/mediaitem.py b/openlp/plugins/songs/lib/mediaitem.py index f7d6c5a54..7d68be1af 100644 --- a/openlp/plugins/songs/lib/mediaitem.py +++ b/openlp/plugins/songs/lib/mediaitem.py @@ -44,12 +44,10 @@ class SongMediaItem(MediaManagerItem): log.info(u'Song Media Item loaded') def __init__(self, parent, icon, title): - self.TranslationContext = u'SongPlugin' self.PluginNameShort = u'Song' - self.ConfigSection = u'songs' + self.ConfigSection = title self.IconPath = u'songs/song' self.ListViewWithDnD_class = SongListView - self.ServiceItemIconName = u':/media/media_song.png' self.servicePath = None MediaManagerItem.__init__(self, parent, icon, title) self.edit_song_form = EditSongForm(self.parent.songmanager, self) @@ -59,7 +57,7 @@ class SongMediaItem(MediaManagerItem): self.fromServiceManager = -1 def initPluginNameVisible(self): - self.PluginNameVisible = self.trUtf8(self.PluginNameShort) + self.PluginNameVisible = self.trUtf8(u'Song') def requiredIcons(self): MediaManagerItem.requiredIcons(self) @@ -314,5 +312,7 @@ class SongMediaItem(MediaManagerItem): raw_footer.append(unicode( self.trUtf8(u'CCL Licence: ') + ccl)) service_item.raw_footer = raw_footer - service_item.audit = [song.title, author_audit, song.copyright, song.ccli_number] + service_item.audit = [ + song.title, author_audit, song.copyright, song.ccli_number + ] return True diff --git a/openlp/plugins/songs/lib/songstab.py b/openlp/plugins/songs/lib/songstab.py index d347c74a6..1f8aeb01b 100644 --- a/openlp/plugins/songs/lib/songstab.py +++ b/openlp/plugins/songs/lib/songstab.py @@ -30,8 +30,8 @@ class SongsTab(SettingsTab): """ SongsTab is the Songs settings tab in the settings dialog. """ - def __init__(self): - SettingsTab.__init__(self, u'Songs', u'Songs') + def __init__(self, title, section=None): + SettingsTab.__init__(self, title, section) def setupUi(self): self.setObjectName(u'SongsTab') @@ -61,8 +61,10 @@ class SongsTab(SettingsTab): def retranslateUi(self): self.SongsModeGroupBox.setTitle(self.trUtf8(u'Songs Mode')) - self.SearchAsTypeCheckBox.setText(self.trUtf8(u'Enable search as you type:')) - self.SongBarActiveCheckBox.setText(self.trUtf8(u'Display Verses on Live Tool bar:')) + self.SearchAsTypeCheckBox.setText( + self.trUtf8(u'Enable search as you type:')) + self.SongBarActiveCheckBox.setText( + self.trUtf8(u'Display Verses on Live Tool bar:')) def onSearchAsTypeCheckBoxChanged(self, check_state): self.song_search = False diff --git a/openlp/plugins/songs/songsplugin.py b/openlp/plugins/songs/songsplugin.py index ad64aebca..21c5b7992 100644 --- a/openlp/plugins/songs/songsplugin.py +++ b/openlp/plugins/songs/songsplugin.py @@ -48,7 +48,6 @@ class SongsPlugin(Plugin): """ Create and set up the Songs plugin. """ - # Call the parent constructor Plugin.__init__(self, u'Songs', u'1.9.0', plugin_helpers) self.weight = -10 self.songmanager = SongManager(self.config) @@ -56,21 +55,19 @@ class SongsPlugin(Plugin): self.opensong_import_form = OpenSongImportForm() self.openlp_export_form = OpenLPExportForm() self.opensong_export_form = OpenSongExportForm() - # Create the plugin icon self.icon = buildIcon(u':/media/media_song.png') def can_be_disabled(self): return True def get_settings_tab(self): - return SongsTab() + return SongsTab(self.name) def initialise(self): log.info(u'Songs Initialising') #if self.songmanager is None: # self.songmanager = SongManager(self.config) Plugin.initialise(self) - self.insert_toolbox_item() self.ImportSongMenu.menuAction().setVisible(True) self.ExportSongMenu.menuAction().setVisible(True) self.media_item.displayResultsSong(self.songmanager.get_songs()) @@ -87,7 +84,7 @@ class SongsPlugin(Plugin): Create the MediaManagerItem object, which is displaed in the Media Manager. """ - return SongMediaItem(self, self.icon, 'Songs') + return SongMediaItem(self, self.icon, self.name) def add_import_menu_item(self, import_menu): """ @@ -180,4 +177,6 @@ class SongsPlugin(Plugin): self.opensong_export_form.show() def about(self): - return u'Song Plugin
This plugin allows Songs to be managed and displayed.
' + about_text = self.trUtf8(u'Song Plugin
This plugin allows ' + u'Songs to be managed and displayed.
') + return about_text diff --git a/openlp/plugins/songusage/songusageplugin.py b/openlp/plugins/songusage/songusageplugin.py index a0f7e2f35..2e7282a98 100644 --- a/openlp/plugins/songusage/songusageplugin.py +++ b/openlp/plugins/songusage/songusageplugin.py @@ -38,10 +38,8 @@ class SongUsagePlugin(Plugin): log.info(u'SongUsage Plugin loaded') def __init__(self, plugin_helpers): - # Call the parent constructor Plugin.__init__(self, u'SongUsage', u'1.9.0', plugin_helpers) self.weight = -4 - # Create the plugin icon self.icon = buildIcon(u':/media/media_image.png') self.songusagemanager = None self.songusageActive = False @@ -63,17 +61,19 @@ class SongUsagePlugin(Plugin): self.SongUsageMenu = QtGui.QMenu(tools_menu) self.SongUsageMenu.setObjectName(u'SongUsageMenu') self.SongUsageMenu.setTitle(tools_menu.trUtf8(u'&Song Usage')) - #SongUsage Delete + #SongUsage Delete self.SongUsageDelete = QtGui.QAction(tools_menu) - self.SongUsageDelete.setText(tools_menu.trUtf8(u'&Delete recorded data')) + self.SongUsageDelete.setText( + tools_menu.trUtf8(u'&Delete recorded data')) self.SongUsageDelete.setStatusTip( - tools_menu.trUtf8(u'Delete sing usage to sepecified date')) + tools_menu.trUtf8(u'Delete song usage to specified date')) self.SongUsageDelete.setObjectName(u'SongUsageDelete') #SongUsage Report self.SongUsageReport = QtGui.QAction(tools_menu) - self.SongUsageReport.setText(tools_menu.trUtf8(u'&Extract recoreded data')) + self.SongUsageReport.setText( + tools_menu.trUtf8(u'&Extract recorded data')) self.SongUsageReport.setStatusTip( - tools_menu.trUtf8(u'Generate Extracts on Song Usage')) + tools_menu.trUtf8(u'Generate report on Song Usage')) self.SongUsageReport.setObjectName(u'SongUsageReport') #SongUsage activation SongUsageIcon = buildIcon(u':/tools/tools_alert.png') @@ -153,6 +153,7 @@ class SongUsagePlugin(Plugin): self.SongUsagedetailform.exec_() def about(self): - about_text = u'SongUsage Plugin
This plugin records the use '\ - u'of songs and when they have been used during a live service' + about_text = self.trUtf8(u'SongUsage Plugin
This plugin ' + u'records the use of songs and when they have been used during ' + u'a live service') return about_text From ae67228139df01537b7eaa27ad9e116a35d14714 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Fri, 30 Oct 2009 19:15:25 +0000 Subject: [PATCH 06/15] Fix OnNewPrompt i18n --- openlp/plugins/media/lib/mediaitem.py | 4 +++- openlp/plugins/presentations/lib/mediaitem.py | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/openlp/plugins/media/lib/mediaitem.py b/openlp/plugins/media/lib/mediaitem.py index c2bfe468f..536c7294a 100644 --- a/openlp/plugins/media/lib/mediaitem.py +++ b/openlp/plugins/media/lib/mediaitem.py @@ -46,7 +46,6 @@ class MediaMediaItem(MediaManagerItem): self.PluginNameShort = u'Media' self.IconPath = u'images/image' self.ConfigSection = title - self.OnNewPrompt = self.trUtf8(u'Select Media') self.OnNewFileMasks = \ u'Videos (*.avi *.mpeg *.mpg *.mp4);;Audio (*.ogg *.mp3 *.wma);;All files (*)' # this next is a class, not an instance of a class - it will @@ -58,6 +57,9 @@ class MediaMediaItem(MediaManagerItem): def initPluginNameVisible(self): self.PluginNameVisible = self.trUtf8(u'Media') + def reTranslateUi(self): + self.OnNewPrompt = self.trUtf8(u'Select Media') + def requiredIcons(self): MediaManagerItem.requiredIcons(self) self.hasFileIcon = True diff --git a/openlp/plugins/presentations/lib/mediaitem.py b/openlp/plugins/presentations/lib/mediaitem.py index 2fb064257..be9b1089b 100644 --- a/openlp/plugins/presentations/lib/mediaitem.py +++ b/openlp/plugins/presentations/lib/mediaitem.py @@ -51,7 +51,6 @@ class PresentationMediaItem(MediaManagerItem): self.PluginNameShort = u'Presentation' self.ConfigSection = title self.IconPath = u'presentations/presentation' - self.OnNewPrompt = self.trUtf8(u'Select Presentation(s)') self.OnNewFileMasks = u'Presentations (*.ppt *.pps *.odp)' # this next is a class, not an instance of a class - it will # be instanced by the base MediaManagerItem @@ -62,6 +61,9 @@ class PresentationMediaItem(MediaManagerItem): def initPluginNameVisible(self): self.PluginNameVisible = self.trUtf8(u'Presentation') + def reTranslateUi(self): + self.OnNewPrompt = self.trUtf8(u'Select Presentation(s)') + def requiredIcons(self): MediaManagerItem.requiredIcons(self) self.hasFileIcon = True From 68a7fbcf56b844e83e64534aeca76b8c49cf4d92 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Fri, 30 Oct 2009 19:29:02 +0000 Subject: [PATCH 07/15] Fix bible function call --- openlp/plugins/bibles/lib/manager.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openlp/plugins/bibles/lib/manager.py b/openlp/plugins/bibles/lib/manager.py index f5653c115..b18c8b4d8 100644 --- a/openlp/plugins/bibles/lib/manager.py +++ b/openlp/plugins/bibles/lib/manager.py @@ -283,7 +283,8 @@ class BibleManager(object): count = self.bible_db_cache[bible].get_max_bible_book_verses( book, chapter) if count == 0: - #text = self.get_verse_text(bible, book, chapter, chapter, 1, 1) + # Make sure the first chapter has been downloaded + self.get_verse_text(bible, book, chapter, chapter, 1, 1) count = self.bible_db_cache[bible].get_max_bible_book_verses( book, chapter) return count From 48e750ded268581f64a0191fa1b926a2e5c07369 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Fri, 30 Oct 2009 20:14:55 +0000 Subject: [PATCH 08/15] Add Save service on New code, and configuration to turn it off. --- openlp/core/ui/amendthemeform.py | 1 - openlp/core/ui/generaltab.py | 22 ++++++++++++++++++++++ openlp/core/ui/servicemanager.py | 17 ++++++++++++++++- openlp/plugins/songs/forms/editsongform.py | 2 +- 4 files changed, 39 insertions(+), 3 deletions(-) diff --git a/openlp/core/ui/amendthemeform.py b/openlp/core/ui/amendthemeform.py index 11daa12c7..c3ec9bb36 100644 --- a/openlp/core/ui/amendthemeform.py +++ b/openlp/core/ui/amendthemeform.py @@ -408,7 +408,6 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog): self.theme.background_endColor = u'#ff0000' else: self.theme.background_type = u'image' - a=c self.stateChanging(self.theme) self.previewTheme(self.theme) diff --git a/openlp/core/ui/generaltab.py b/openlp/core/ui/generaltab.py index 54031ec1a..5a69e372d 100644 --- a/openlp/core/ui/generaltab.py +++ b/openlp/core/ui/generaltab.py @@ -76,6 +76,18 @@ class GeneralTab(SettingsTab): self.ShowSplashCheckBox.setObjectName(u'ShowSplashCheckBox') self.StartupLayout.addWidget(self.ShowSplashCheckBox) self.GeneralLeftLayout.addWidget(self.StartupGroupBox) + + self.SettingsGroupBox = QtGui.QGroupBox(self.GeneralLeftWidget) + self.SettingsGroupBox.setObjectName(u'SettingsGroupBox') + self.SettingsLayout = QtGui.QVBoxLayout(self.SettingsGroupBox) + self.SettingsLayout.setSpacing(8) + self.SettingsLayout.setMargin(8) + self.SettingsLayout.setObjectName(u'SettingsLayout') + self.SaveCheckOOSCheckBox = QtGui.QCheckBox(self.SettingsGroupBox) + self.SaveCheckOOSCheckBox.setObjectName(u'SaveCheckOOSCheckBox') + self.SettingsLayout.addWidget(self.SaveCheckOOSCheckBox) + self.GeneralLeftLayout.addWidget(self.SettingsGroupBox) + self.GeneralLeftSpacer = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) self.GeneralLeftLayout.addItem(self.GeneralLeftSpacer) @@ -124,6 +136,8 @@ class GeneralTab(SettingsTab): QtCore.SIGNAL(u'stateChanged(int)'), self.onAutoOpenCheckBoxChanged) QtCore.QObject.connect(self.ShowSplashCheckBox, QtCore.SIGNAL(u'stateChanged(int)'), self.onShowSplashCheckBoxChanged) + QtCore.QObject.connect(self.SaveCheckOOSCheckBox, + QtCore.SIGNAL(u'stateChanged(int)'), self.onSaveCheckOOSCheckBox) QtCore.QObject.connect(self.NumberEdit, QtCore.SIGNAL(u'editingFinished()'), self.onNumberEditLostFocus) QtCore.QObject.connect(self.UsernameEdit, @@ -138,6 +152,8 @@ class GeneralTab(SettingsTab): self.WarningCheckBox.setText(self.trUtf8(u'Show blank screen warning')) self.AutoOpenCheckBox.setText(self.trUtf8(u'Automatically open the last service')) self.ShowSplashCheckBox.setText(self.trUtf8(u'Show the splash screen')) + self.SettingsGroupBox.setTitle(self.trUtf8(u'Application Settings')) + self.SaveCheckOOSCheckBox.setText(self.trUtf8(u'Prompt to save Sevice before starting New')) self.CCLIGroupBox.setTitle(self.trUtf8(u'CCLI Details')) self.NumberLabel.setText(self.trUtf8(u'CCLI Number:')) self.UsernameLabel.setText(self.trUtf8(u'SongSelect Username:')) @@ -155,6 +171,9 @@ class GeneralTab(SettingsTab): def onWarningCheckBoxChanged(self, value): self.Warning = (value == QtCore.Qt.Checked) + def onSaveCheckOOSCheckBox(self, value): + self.PromptSaveOOS = (value == QtCore.Qt.Checked) + def onNumberEditLostFocus(self): self.CCLNumber = self.NumberEdit.displayText() @@ -175,9 +194,11 @@ class GeneralTab(SettingsTab): self.Warning = str_to_bool(self.config.get_config(u'Blank Warning', u'False')) self.AutoOpen = str_to_bool(self.config.get_config(u'Auto Open', u'False')) self.ShowSplash = str_to_bool(self.config.get_config(u'show splash', u'True')) + self.PromptSaveOOS = str_to_bool(self.config.get_config(u'prompt save oos', u'False')) self.CCLNumber = unicode(self.config.get_config(u'CCL Number', u'XXX')) self.Username = unicode(self.config.get_config(u'User Name', u'')) self.Password = unicode(self.config.get_config(u'Password', u'')) + self.SaveCheckOOSCheckBox.setChecked(self.PromptSaveOOS) # Set a few things up self.MonitorComboBox.setCurrentIndex(self.MonitorNumber) self.WarningCheckBox.setChecked(self.Warning) @@ -192,6 +213,7 @@ class GeneralTab(SettingsTab): self.config.set_config(u'Blank Warning', self.Warning) self.config.set_config(u'Auto Open', self.AutoOpen) self.config.set_config(u'show splash', self.ShowSplash) + self.config.set_config(u'prompt save oos', self.PromptSaveOOS) self.config.set_config(u'CCL Number', self.CCLNumber) self.config.set_config(u'User Name', self.Username) self.config.set_config(u'Password', self.Password) diff --git a/openlp/core/ui/servicemanager.py b/openlp/core/ui/servicemanager.py index 2d0e43c30..ba0f2cd8d 100644 --- a/openlp/core/ui/servicemanager.py +++ b/openlp/core/ui/servicemanager.py @@ -30,7 +30,8 @@ import zipfile from PyQt4 import QtCore, QtGui from openlp.core.lib import PluginConfig, OpenLPToolbar, ServiceItem, \ - ServiceType, contextMenuAction, contextMenuSeparator, Receiver, contextMenu + ServiceType, contextMenuAction, contextMenuSeparator, Receiver, \ + contextMenu, str_to_bool class ServiceManagerList(QtGui.QTreeWidget): @@ -128,10 +129,12 @@ class ServiceManager(QtGui.QWidget): self.parent = parent self.serviceItems = [] self.serviceName = u'' + #is a new service and has not been saved self.isNew = True #Indicates if remoteTriggering is active. If it is the next addServiceItem call #will replace the currently selected one. self.remoteEditTriggered = False + #start with the layout self.Layout = QtGui.QVBoxLayout(self) self.Layout.setSpacing(0) self.Layout.setMargin(0) @@ -356,6 +359,18 @@ class ServiceManager(QtGui.QWidget): """ Clear the list to create a new service """ + if self.parent.serviceNotSaved and \ + str_to_bool(PluginConfig(u'General').get_config(u'prompt save oos', u'False')): + ret = QtGui.QMessageBox.question(None, + self.trUtf8(u'Save Changes to Service?'), + self.trUtf8(u'Your service is unsaved, do you want to save those ' + u'changes before creating a new one ?'), + QtGui.QMessageBox.StandardButtons( + QtGui.QMessageBox.Cancel | + QtGui.QMessageBox.Save), + QtGui.QMessageBox.Save) + if ret == QtGui.QMessageBox.Save: + self.onSaveService() self.ServiceManagerList.clear() self.serviceItems = [] self.serviceName = u'' diff --git a/openlp/plugins/songs/forms/editsongform.py b/openlp/plugins/songs/forms/editsongform.py index 38a2117b2..7fa0f9a52 100644 --- a/openlp/plugins/songs/forms/editsongform.py +++ b/openlp/plugins/songs/forms/editsongform.py @@ -466,7 +466,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): self.song.search_lyrics = unicode(text) self.song.lyrics = unicode(sxml.extract_xml()) except: - log.exception(u'Problem processing song Lyrics') + log.exception(u'Problem processing song Lyrics \n%s', sxml.dump_xml()) def processTitle(self): log.debug(u'processTitle') From 2f12c075c2b682653a304333d59ba5711ced6c9a Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Fri, 30 Oct 2009 20:21:36 +0000 Subject: [PATCH 09/15] Fix theme editing where previous image is cached on change of image --- openlp/core/lib/renderer.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/openlp/core/lib/renderer.py b/openlp/core/lib/renderer.py index 79c58f6af..dc4a3c44b 100644 --- a/openlp/core/lib/renderer.py +++ b/openlp/core/lib/renderer.py @@ -72,9 +72,11 @@ class Renderer(object): self._theme = theme self.bg_frame = None self.bg_image = None + self._bg_image_filename = None self.theme_name = theme.theme_name self._set_theme_font() if theme.background_type == u'image': + print theme.background_filename if theme.background_filename is not None: self.set_bg_image(theme.background_filename) @@ -110,8 +112,8 @@ class Renderer(object): painter.begin(self.bg_image) self.background_offsetx = (width - realwidth) / 2 self.background_offsety = (height - realheight) / 2 - painter.drawImage(self.background_offsetx, self.background_offsety, - preview) + painter.drawImage(self.background_offsetx, + self.background_offsety, preview) painter.end() def set_frame_dest(self, frame_width, frame_height, preview=False): From 28a223bc06d251e0be0eaad1130a3e61bda48071 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Fri, 30 Oct 2009 20:34:11 +0000 Subject: [PATCH 10/15] Fix double loading --- openlp/core/lib/plugin.py | 1 - openlp/core/lib/pluginmanager.py | 4 ---- openlp/core/ui/mediadockmanager.py | 2 +- openlp/core/ui/pluginform.py | 6 +++++- openlp/plugins/bibles/bibleplugin.py | 1 + openlp/plugins/custom/customplugin.py | 1 + openlp/plugins/images/imageplugin.py | 1 + openlp/plugins/media/mediaplugin.py | 1 + openlp/plugins/presentations/presentationplugin.py | 1 + openlp/plugins/remotes/remoteplugin.py | 1 + openlp/plugins/songs/songsplugin.py | 1 + 11 files changed, 13 insertions(+), 7 deletions(-) diff --git a/openlp/core/lib/plugin.py b/openlp/core/lib/plugin.py index 69eaa8ef9..f7aba44b9 100644 --- a/openlp/core/lib/plugin.py +++ b/openlp/core/lib/plugin.py @@ -256,7 +256,6 @@ class Plugin(QtCore.QObject): """ Called by plugin to replace toolbar """ - # Not sure self.media_item is being set properly if self.media_item is not None: self.mediadock.insert_dock(self.media_item, self.icon, self.weight) if self.settings_tab is not None: diff --git a/openlp/core/lib/pluginmanager.py b/openlp/core/lib/pluginmanager.py index 2d7eead5e..8a9fb216a 100644 --- a/openlp/core/lib/pluginmanager.py +++ b/openlp/core/lib/pluginmanager.py @@ -136,10 +136,6 @@ class PluginManager(object): for plugin in self.plugins: if plugin.status is not PluginStatus.Disabled: plugin.media_item = plugin.get_media_manager_item() - if plugin.media_item is not None: - log.debug(u'Inserting media manager item from %s' % \ - plugin.name) - mediadock.add_dock(plugin.media_item, plugin.icon, plugin.weight) def hook_settings_tabs(self, settingsform=None): """ diff --git a/openlp/core/ui/mediadockmanager.py b/openlp/core/ui/mediadockmanager.py index 795a7f845..abb534435 100644 --- a/openlp/core/ui/mediadockmanager.py +++ b/openlp/core/ui/mediadockmanager.py @@ -55,6 +55,6 @@ class MediaDockManager(object): log.debug(u'remove %s dock' % name) for dock_index in range(0, self.media_dock.count()): if self.media_dock.widget(dock_index) is not None: - if self.media_dock.widget(dock_index).ConfigSection == name.lower(): + if self.media_dock.widget(dock_index).ConfigSection == name: self.media_dock.widget(dock_index).hide() self.media_dock.removeItem(dock_index) diff --git a/openlp/core/ui/pluginform.py b/openlp/core/ui/pluginform.py index a02e02966..b41565691 100644 --- a/openlp/core/ui/pluginform.py +++ b/openlp/core/ui/pluginform.py @@ -37,6 +37,7 @@ class PluginForm(QtGui.QDialog, Ui_PluginViewDialog): QtGui.QDialog.__init__(self, parent) self.parent = parent self.activePlugin = None + self.programaticChange = False self.setupUi(self) self.load() self._clearDetails() @@ -84,6 +85,7 @@ class PluginForm(QtGui.QDialog, Ui_PluginViewDialog): self.VersionNumberLabel.setText(self.activePlugin.version) self.AboutTextBrowser.setHtml(self.activePlugin.about()) if self.activePlugin.can_be_disabled(): + self.programaticChange = True self.StatusComboBox.setCurrentIndex(int(self.activePlugin.status)) self.StatusComboBox.setEnabled(True) else: @@ -105,6 +107,9 @@ class PluginForm(QtGui.QDialog, Ui_PluginViewDialog): self._clearDetails() def onStatusComboBoxChanged(self, status): + if self.programaticChange is True: + self.programaticChange = False + return self.activePlugin.toggle_status(status) if status == PluginStatus.Active: self.activePlugin.initialise() @@ -119,4 +124,3 @@ class PluginForm(QtGui.QDialog, Ui_PluginViewDialog): status_text = 'Disabled' self.PluginListWidget.currentItem().setText( u'%s (%s)' % (self.activePlugin.name, status_text)) - diff --git a/openlp/plugins/bibles/bibleplugin.py b/openlp/plugins/bibles/bibleplugin.py index 24a7cafc7..d797b44cc 100644 --- a/openlp/plugins/bibles/bibleplugin.py +++ b/openlp/plugins/bibles/bibleplugin.py @@ -49,6 +49,7 @@ class BiblePlugin(Plugin): if self.biblemanager is None: self.biblemanager = BibleManager(self.config) Plugin.initialise(self) + self.insert_toolbox_item() self.ImportBibleItem.setVisible(True) self.ExportBibleItem.setVisible(True) diff --git a/openlp/plugins/custom/customplugin.py b/openlp/plugins/custom/customplugin.py index b72f3dd54..bcd61f5bc 100644 --- a/openlp/plugins/custom/customplugin.py +++ b/openlp/plugins/custom/customplugin.py @@ -60,6 +60,7 @@ class CustomPlugin(Plugin): def initialise(self): log.info(u'Plugin Initialising') Plugin.initialise(self) + self.insert_toolbox_item() def finalise(self): log.info(u'Plugin Finalise') diff --git a/openlp/plugins/images/imageplugin.py b/openlp/plugins/images/imageplugin.py index 94f464874..229b57f95 100644 --- a/openlp/plugins/images/imageplugin.py +++ b/openlp/plugins/images/imageplugin.py @@ -43,6 +43,7 @@ class ImagePlugin(Plugin): def initialise(self): log.info(u'Plugin Initialising') Plugin.initialise(self) + self.insert_toolbox_item() def finalise(self): log.info(u'Plugin Finalise') diff --git a/openlp/plugins/media/mediaplugin.py b/openlp/plugins/media/mediaplugin.py index 5ba8b5d2a..acfd170d6 100644 --- a/openlp/plugins/media/mediaplugin.py +++ b/openlp/plugins/media/mediaplugin.py @@ -48,6 +48,7 @@ class MediaPlugin(Plugin): def initialise(self): log.info(u'Plugin Initialising') Plugin.initialise(self) + self.insert_toolbox_item() def finalise(self): log.info(u'Plugin Finalise') diff --git a/openlp/plugins/presentations/presentationplugin.py b/openlp/plugins/presentations/presentationplugin.py index 8452c3410..e54220e08 100644 --- a/openlp/plugins/presentations/presentationplugin.py +++ b/openlp/plugins/presentations/presentationplugin.py @@ -52,6 +52,7 @@ class PresentationPlugin(Plugin): def initialise(self): log.info(u'Presentations Initialising') Plugin.initialise(self) + self.insert_toolbox_item() def finalise(self): log.info(u'Plugin Finalise') diff --git a/openlp/plugins/remotes/remoteplugin.py b/openlp/plugins/remotes/remoteplugin.py index 9bf2feffb..9fa37b46e 100644 --- a/openlp/plugins/remotes/remoteplugin.py +++ b/openlp/plugins/remotes/remoteplugin.py @@ -46,6 +46,7 @@ class RemotesPlugin(Plugin): def initialise(self): log.debug(u'initialise') Plugin.initialise(self) + self.insert_toolbox_item() self.server = QtNetwork.QUdpSocket() self.server.bind(int(self.config.get_config(u'remote port', 4316))) QtCore.QObject.connect(self.server, diff --git a/openlp/plugins/songs/songsplugin.py b/openlp/plugins/songs/songsplugin.py index 21c5b7992..a76642024 100644 --- a/openlp/plugins/songs/songsplugin.py +++ b/openlp/plugins/songs/songsplugin.py @@ -68,6 +68,7 @@ class SongsPlugin(Plugin): #if self.songmanager is None: # self.songmanager = SongManager(self.config) Plugin.initialise(self) + self.insert_toolbox_item() self.ImportSongMenu.menuAction().setVisible(True) self.ExportSongMenu.menuAction().setVisible(True) self.media_item.displayResultsSong(self.songmanager.get_songs()) From 7b1de0f995dac241d551a09de4a939e9617eb54b Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Fri, 30 Oct 2009 21:45:38 +0000 Subject: [PATCH 11/15] Move version check --- openlp.pyw | 1 + openlp/core/ui/mainwindow.py | 1 - openlp/plugins/songs/lib/mediaitem.py | 1 + 3 files changed, 2 insertions(+), 1 deletion(-) diff --git a/openlp.pyw b/openlp.pyw index ebd449bf8..4c0eb9b14 100755 --- a/openlp.pyw +++ b/openlp.pyw @@ -105,6 +105,7 @@ class OpenLP(QtGui.QApplication): if show_splash: # now kill the splashscreen self.splash.finish(self.mainWindow) + self.mainWindow.versionCheck() return self.exec_() def main(): diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index 4a79f6cae..d98a94d09 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -562,7 +562,6 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): screen_number = self.getMonitorNumber() self.mainDisplay.setup(screen_number) self.setFocus() - self.versionCheck() if str_to_bool(self.generalConfig.get_config(u'Auto Open', False)): self.ServiceManagerContents.onLoadService(True) if str_to_bool(self.generalConfig.get_config(u'Screen Blank', False)) \ diff --git a/openlp/plugins/songs/lib/mediaitem.py b/openlp/plugins/songs/lib/mediaitem.py index 0ca0756a6..fa236f96f 100644 --- a/openlp/plugins/songs/lib/mediaitem.py +++ b/openlp/plugins/songs/lib/mediaitem.py @@ -292,6 +292,7 @@ class SongMediaItem(MediaManagerItem): service_item.theme = song.theme_name service_item.editEnabled = True service_item.editId = item_id + service_item.verse_order = song.verse_order if song.lyrics.startswith(u' Date: Fri, 30 Oct 2009 22:03:09 +0000 Subject: [PATCH 12/15] Fix names before Raoul sees them --- openlp/core/ui/generaltab.py | 24 +++++++++++------------- openlp/core/ui/servicemanager.py | 3 ++- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/openlp/core/ui/generaltab.py b/openlp/core/ui/generaltab.py index be8f0bee3..4af3faeb7 100644 --- a/openlp/core/ui/generaltab.py +++ b/openlp/core/ui/generaltab.py @@ -76,18 +76,16 @@ class GeneralTab(SettingsTab): self.ShowSplashCheckBox.setObjectName(u'ShowSplashCheckBox') self.StartupLayout.addWidget(self.ShowSplashCheckBox) self.GeneralLeftLayout.addWidget(self.StartupGroupBox) - self.SettingsGroupBox = QtGui.QGroupBox(self.GeneralLeftWidget) self.SettingsGroupBox.setObjectName(u'SettingsGroupBox') self.SettingsLayout = QtGui.QVBoxLayout(self.SettingsGroupBox) self.SettingsLayout.setSpacing(8) self.SettingsLayout.setMargin(8) self.SettingsLayout.setObjectName(u'SettingsLayout') - self.SaveCheckOOSCheckBox = QtGui.QCheckBox(self.SettingsGroupBox) - self.SaveCheckOOSCheckBox.setObjectName(u'SaveCheckOOSCheckBox') - self.SettingsLayout.addWidget(self.SaveCheckOOSCheckBox) + self.SaveCheckServiceCheckBox = QtGui.QCheckBox(self.SettingsGroupBox) + self.SaveCheckServiceCheckBox.setObjectName(u'SaveCheckServiceCheckBox') + self.SettingsLayout.addWidget(self.SaveCheckServiceCheckBox) self.GeneralLeftLayout.addWidget(self.SettingsGroupBox) - self.GeneralLeftSpacer = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) self.GeneralLeftLayout.addItem(self.GeneralLeftSpacer) @@ -136,8 +134,8 @@ class GeneralTab(SettingsTab): QtCore.SIGNAL(u'stateChanged(int)'), self.onAutoOpenCheckBoxChanged) QtCore.QObject.connect(self.ShowSplashCheckBox, QtCore.SIGNAL(u'stateChanged(int)'), self.onShowSplashCheckBoxChanged) - QtCore.QObject.connect(self.SaveCheckOOSCheckBox, - QtCore.SIGNAL(u'stateChanged(int)'), self.onSaveCheckOOSCheckBox) + QtCore.QObject.connect(self.SaveCheckServiceCheckBox, + QtCore.SIGNAL(u'stateChanged(int)'), self.onSaveCheckServiceCheckBox) QtCore.QObject.connect(self.NumberEdit, QtCore.SIGNAL(u'editingFinished()'), self.onNumberEditLostFocus) QtCore.QObject.connect(self.UsernameEdit, @@ -153,7 +151,7 @@ class GeneralTab(SettingsTab): self.AutoOpenCheckBox.setText(self.trUtf8(u'Automatically open the last service')) self.ShowSplashCheckBox.setText(self.trUtf8(u'Show the splash screen')) self.SettingsGroupBox.setTitle(self.trUtf8(u'Application Settings')) - self.SaveCheckOOSCheckBox.setText(self.trUtf8(u'Prompt to save Sevice before starting New')) + self.SaveCheckServiceCheckBox.setText(self.trUtf8(u'Prompt to save Sevice before starting New')) self.CCLIGroupBox.setTitle(self.trUtf8(u'CCLI Details')) self.NumberLabel.setText(self.trUtf8(u'CCLI Number:')) self.UsernameLabel.setText(self.trUtf8(u'SongSelect Username:')) @@ -171,8 +169,8 @@ class GeneralTab(SettingsTab): def onWarningCheckBoxChanged(self, value): self.Warning = (value == QtCore.Qt.Checked) - def onSaveCheckOOSCheckBox(self, value): - self.PromptSaveOOS = (value == QtCore.Qt.Checked) + def onSaveCheckServiceCheckBox(self, value): + self.PromptSaveService = (value == QtCore.Qt.Checked) def onNumberEditLostFocus(self): self.CCLNumber = self.NumberEdit.displayText() @@ -194,11 +192,11 @@ class GeneralTab(SettingsTab): self.Warning = str_to_bool(self.config.get_config(u'Blank Warning', u'False')) self.AutoOpen = str_to_bool(self.config.get_config(u'Auto Open', u'False')) self.ShowSplash = str_to_bool(self.config.get_config(u'show splash', u'True')) - self.PromptSaveOOS = str_to_bool(self.config.get_config(u'prompt save oos', u'False')) + self.PromptSaveService = str_to_bool(self.config.get_config(u'prompt save service', u'False')) self.CCLNumber = unicode(self.config.get_config(u'CCL Number', u'XXX')) self.Username = unicode(self.config.get_config(u'User Name', u'')) self.Password = unicode(self.config.get_config(u'Password', u'')) - self.SaveCheckOOSCheckBox.setChecked(self.PromptSaveOOS) + self.SaveCheckServiceCheckBox.setChecked(self.PromptSaveService) # Set a few things up self.MonitorComboBox.setCurrentIndex(self.MonitorNumber) self.WarningCheckBox.setChecked(self.Warning) @@ -213,7 +211,7 @@ class GeneralTab(SettingsTab): self.config.set_config(u'Blank Warning', self.Warning) self.config.set_config(u'Auto Open', self.AutoOpen) self.config.set_config(u'show splash', self.ShowSplash) - self.config.set_config(u'prompt save oos', self.PromptSaveOOS) + self.config.set_config(u'prompt save service', self.PromptSaveService) self.config.set_config(u'CCL Number', self.CCLNumber) self.config.set_config(u'User Name', self.Username) self.config.set_config(u'Password', self.Password) diff --git a/openlp/core/ui/servicemanager.py b/openlp/core/ui/servicemanager.py index ba0f2cd8d..9a331fccb 100644 --- a/openlp/core/ui/servicemanager.py +++ b/openlp/core/ui/servicemanager.py @@ -360,7 +360,8 @@ class ServiceManager(QtGui.QWidget): Clear the list to create a new service """ if self.parent.serviceNotSaved and \ - str_to_bool(PluginConfig(u'General').get_config(u'prompt save oos', u'False')): + str_to_bool(PluginConfig(u'General'). + get_config(u'prompt save service', u'False')): ret = QtGui.QMessageBox.question(None, self.trUtf8(u'Save Changes to Service?'), self.trUtf8(u'Your service is unsaved, do you want to save those ' From 4eaa7a1535ddaed9f1d262b4c2b4b18478fb6ab9 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sat, 31 Oct 2009 08:45:24 +0000 Subject: [PATCH 13/15] Finish remote editing of ServiceManager by updating live --- openlp/core/ui/mainwindow.py | 2 +- openlp/core/ui/servicemanager.py | 10 ++++++++-- openlp/core/ui/slidecontroller.py | 8 ++++++++ openlp/plugins/songs/forms/editsongform.py | 5 +---- openlp/plugins/songs/lib/manager.py | 1 + 5 files changed, 19 insertions(+), 7 deletions(-) diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index ec3fec0d5..51789e225 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -525,7 +525,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): self.settingsForm.postSetUp() def versionCheck(self): - applicationVersion = self.generalConfig.get_config(u'Application version', u'1.9.0-595') + applicationVersion = self.generalConfig.get_config(u'Application version', u'1.9.0-640') version = check_latest_version(self.generalConfig, applicationVersion) if applicationVersion != version: version_text = unicode(self.trUtf8(u'OpenLP version %s has been updated ' diff --git a/openlp/core/ui/servicemanager.py b/openlp/core/ui/servicemanager.py index 9a331fccb..50b8137f3 100644 --- a/openlp/core/ui/servicemanager.py +++ b/openlp/core/ui/servicemanager.py @@ -27,6 +27,7 @@ import string import logging import cPickle import zipfile +import uuid from PyQt4 import QtCore, QtGui from openlp.core.lib import PluginConfig, OpenLPToolbar, ServiceItem, \ @@ -556,17 +557,22 @@ class ServiceManager(QtGui.QWidget): sitem, count = self.findServiceItem() item.render() if self.remoteEditTriggered: + item.uuid = self.serviceItems[sitem][u'data'].uuid self.serviceItems[sitem][u'data'] = item self.remoteEditTriggered = False self.repaintServiceList(sitem + 1, 0) + self.parent.LiveController.replaceServiceManagerItem(item) else: + item.uuid = unicode(uuid.uuid1()) if sitem == -1: self.serviceItems.append({u'data': item, - u'order': len(self.serviceItems) + 1, u'expanded':True}) + u'order': len(self.serviceItems) + 1, + u'expanded':True}) self.repaintServiceList(len(self.serviceItems) + 1, 0) else: self.serviceItems.insert(sitem + 1, {u'data': item, - u'order': len(self.serviceItems)+1, u'expanded':True}) + u'order': len(self.serviceItems)+1, + u'expanded':True}) self.repaintServiceList(sitem + 1, 0) self.parent.serviceChanged(False, self.serviceName) diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index 0715cda5d..8a7f2ce9b 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -282,6 +282,7 @@ class SlideController(QtGui.QWidget): self.Toolbar.makeWidgetsInvisible(self.image_list) if item.name == u'Songs' and \ str_to_bool(self.songsconfig.get_config(u'display songbar', True)): + print item.verse_order self.Songbar.setVisible(True) elif item.service_item_type == ServiceType.Image: #Not sensible to allow loops with 1 frame @@ -323,6 +324,13 @@ class SlideController(QtGui.QWidget): self.songEdit = False self.displayServiceManagerItems(item, slideno) + def replaceServiceManagerItem(self, item): + """ + Replacement item following a remote edit + """ + if self.commandItem is not None and \ + item.uuid == self.commandItem.uuid: + self.addServiceManagerItem(item, self.PreviewListWidget.currentRow()) def addServiceManagerItem(self, item, slideno): """ diff --git a/openlp/plugins/songs/forms/editsongform.py b/openlp/plugins/songs/forms/editsongform.py index 7fa0f9a52..434e9902e 100644 --- a/openlp/plugins/songs/forms/editsongform.py +++ b/openlp/plugins/songs/forms/editsongform.py @@ -115,7 +115,6 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): self.VerseDeleteButton.setEnabled(False) self.AuthorRemoveButton.setEnabled(False) self.TopicRemoveButton.setEnabled(False) - self.title_change = False def loadAuthors(self): authors = self.songmanager.get_authors() @@ -162,7 +161,6 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): self.VerseListWidget.clear() self.AuthorsListView.clear() self.TopicsListView.clear() - self.title_change = False self.TitleEditItem.setFocus(QtCore.Qt.OtherFocusReason) self.loadAuthors() self.loadTopics() @@ -235,7 +233,6 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): topic_name.setData(QtCore.Qt.UserRole, QtCore.QVariant(topic.id)) self.TopicsListView.addItem(topic_name) self._validate_song() - self.title_change = False self.TitleEditItem.setFocus(QtCore.Qt.OtherFocusReason) #if not preview hide the preview button self.previewButton.setVisible(False) @@ -378,7 +375,6 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): def onTitleEditItemLostFocus(self): self.song.title = self.TitleEditItem.text() - self.title_change = True def onVerseOrderEditLostFocus(self): self.song.verse_order = self.VerseOrderEdit.text() @@ -431,6 +427,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): self.song.search_title = unicode(self.TitleEditItem.displayText()) + \ u'@'+ unicode(self.AlternativeEdit.displayText()) self.song.comments = unicode(self.CommentsEdit.toPlainText()) + self.song.verse_order = unicode(self.VerseOrderEdit.text()) self.song.ccli_number = unicode(self.CCLNumberEdit.displayText()) self.processLyrics() self.processTitle() diff --git a/openlp/plugins/songs/lib/manager.py b/openlp/plugins/songs/lib/manager.py index d793785ac..9fe28198b 100644 --- a/openlp/plugins/songs/lib/manager.py +++ b/openlp/plugins/songs/lib/manager.py @@ -106,6 +106,7 @@ class SongManager(): self.session.commit() return True except: + log.exception(u'Could not save song to song database') self.session.rollback() log.exception(u'Could not save song to song database') return False From 258bf403c8d105bd0b553550b828fa8381a53ed0 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sat, 31 Oct 2009 09:03:54 +0000 Subject: [PATCH 14/15] Sort out number of buttons on SlideController to match song and make more KITT like --- openlp/core/ui/slidecontroller.py | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index 8a7f2ce9b..ace128e4f 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -176,16 +176,16 @@ class SlideController(QtGui.QWidget): if isLive: self.Songbar = OpenLPToolbar(self) self.Songbar.addToolbarButton( - u'Bridge', u':/media/media_time.png', + u'Bridge', u':/slides/slide_close.png', self.trUtf8(u'Bridge'), self.onSongBarHandler) self.Songbar.addToolbarButton( - u'Chorus', u':/media/media_time.png', + u'Chorus', u':/slides/slide_close.png', self.trUtf8(u'Chorus'), self.onSongBarHandler) - for verse in range(1, 9): + for verse in range(1, 20): self.Songbar.addToolbarButton( - unicode(verse), u':/media/media_time.png', + unicode(verse), u':/slides/slide_close.png', unicode(self.trUtf8(u'Verse %s'))%verse, self.onSongBarHandler) self.ControllerLayout.addWidget(self.Songbar) @@ -282,7 +282,15 @@ class SlideController(QtGui.QWidget): self.Toolbar.makeWidgetsInvisible(self.image_list) if item.name == u'Songs' and \ str_to_bool(self.songsconfig.get_config(u'display songbar', True)): - print item.verse_order + for action in self.Songbar.actions: + self.Songbar.actions[action].setVisible(False) + verses = item.verse_order.split(u' ') + for verse in verses: + try: + self.Songbar.actions[verse].setVisible(True) + except: + #More than 20 verses hard luck + pass self.Songbar.setVisible(True) elif item.service_item_type == ServiceType.Image: #Not sensible to allow loops with 1 frame From 2d464e0d15f8e97c991a3450f2dcea2f52695cd6 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Sat, 31 Oct 2009 16:17:26 +0000 Subject: [PATCH 15/15] Fix typos --- openlp/plugins/media/lib/mediaitem.py | 2 +- openlp/plugins/presentations/lib/mediaitem.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/openlp/plugins/media/lib/mediaitem.py b/openlp/plugins/media/lib/mediaitem.py index 536c7294a..544e5d767 100644 --- a/openlp/plugins/media/lib/mediaitem.py +++ b/openlp/plugins/media/lib/mediaitem.py @@ -57,7 +57,7 @@ class MediaMediaItem(MediaManagerItem): def initPluginNameVisible(self): self.PluginNameVisible = self.trUtf8(u'Media') - def reTranslateUi(self): + def retranslateUi(self): self.OnNewPrompt = self.trUtf8(u'Select Media') def requiredIcons(self): diff --git a/openlp/plugins/presentations/lib/mediaitem.py b/openlp/plugins/presentations/lib/mediaitem.py index be9b1089b..550c15b60 100644 --- a/openlp/plugins/presentations/lib/mediaitem.py +++ b/openlp/plugins/presentations/lib/mediaitem.py @@ -61,7 +61,7 @@ class PresentationMediaItem(MediaManagerItem): def initPluginNameVisible(self): self.PluginNameVisible = self.trUtf8(u'Presentation') - def reTranslateUi(self): + def retranslateUi(self): self.OnNewPrompt = self.trUtf8(u'Select Presentation(s)') def requiredIcons(self):