From f2836baae4b107e1460efbd7e9acf0ce6f83385d Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Sat, 19 Jun 2010 18:31:42 +0100 Subject: [PATCH 01/12] More docstrings --- openlp/core/lib/baselistwithdnd.py | 10 +++++--- openlp/core/lib/dockwidget.py | 5 +++- openlp/core/lib/eventreceiver.py | 10 ++++++-- openlp/core/lib/mediamanageritem.py | 40 +++++++++++++++++++++++++++-- openlp/core/lib/plugin.py | 4 ++- openlp/core/lib/settingsmanager.py | 10 +++++++- openlp/core/lib/themexmlhandler.py | 4 ++- openlp/core/lib/toolbar.py | 4 ++- 8 files changed, 75 insertions(+), 12 deletions(-) diff --git a/openlp/core/lib/baselistwithdnd.py b/openlp/core/lib/baselistwithdnd.py index d34eada98..7802d7073 100644 --- a/openlp/core/lib/baselistwithdnd.py +++ b/openlp/core/lib/baselistwithdnd.py @@ -22,15 +22,19 @@ # with this program; if not, write to the Free Software Foundation, Inc., 59 # # Temple Place, Suite 330, Boston, MA 02111-1307 USA # ############################################################################### - +""" +Extend QListWidget to handle drag and drop functionality +""" from PyQt4 import QtCore, QtGui class BaseListWithDnD(QtGui.QListWidget): """ - Please put a short description of what this class does in here. + Provide a list widget to store objects and handle drag and drop events """ - def __init__(self, parent=None): + """ + Initialise the list widget + """ QtGui.QListWidget.__init__(self, parent) self.parent = parent # this must be set by the class which is inheriting diff --git a/openlp/core/lib/dockwidget.py b/openlp/core/lib/dockwidget.py index 083c99184..729e29d33 100644 --- a/openlp/core/lib/dockwidget.py +++ b/openlp/core/lib/dockwidget.py @@ -22,7 +22,10 @@ # with this program; if not, write to the Free Software Foundation, Inc., 59 # # Temple Place, Suite 330, Boston, MA 02111-1307 USA # ############################################################################### - +""" +Provide additional functionality required by OpenLP from the inherited +QDockWidget. +""" import logging from PyQt4 import QtGui diff --git a/openlp/core/lib/eventreceiver.py b/openlp/core/lib/eventreceiver.py index 76b19957c..e942fcfe6 100644 --- a/openlp/core/lib/eventreceiver.py +++ b/openlp/core/lib/eventreceiver.py @@ -22,7 +22,9 @@ # with this program; if not, write to the Free Software Foundation, Inc., 59 # # Temple Place, Suite 330, Boston, MA 02111-1307 USA # ############################################################################### - +""" +Provide event handling code for OpenLP +""" import logging from PyQt4 import QtCore @@ -241,7 +243,11 @@ class Receiver(object): ``Receiver.send_message(u'<>', data)`` To receive a Message - ``QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'<>'), <>)`` + ``QtCore.QObject.connect( + Receiver.get_receiver(), + QtCore.SIGNAL(u'<>'), + <> + )`` """ eventreceiver = EventReceiver() diff --git a/openlp/core/lib/mediamanageritem.py b/openlp/core/lib/mediamanageritem.py index c0f016f94..94594c4f1 100644 --- a/openlp/core/lib/mediamanageritem.py +++ b/openlp/core/lib/mediamanageritem.py @@ -22,7 +22,9 @@ # with this program; if not, write to the Free Software Foundation, Inc., 59 # # Temple Place, Suite 330, Boston, MA 02111-1307 USA # ############################################################################### - +""" +Provides the generic functions for interfacing plugins with the Media Manager. +""" import logging import os @@ -204,7 +206,9 @@ class MediaManagerItem(QtGui.QWidget): self.addListViewToToolBar() def addMiddleHeaderBar(self): - # Create buttons for the toolbar + """ + Create buttons for the media item toolbar + """ ## Import Button ## if self.hasImportIcon: self.addToolbarButton( @@ -267,6 +271,9 @@ class MediaManagerItem(QtGui.QWidget): u':/general/general_add.png', self.onAddClick) def addListViewToToolBar(self): + """ + Creates the main widget for listing items the media item is tracking + """ #Add the List widget self.ListView = self.ListViewWithDnD_class(self) self.ListView.uniformItemSizes = True @@ -357,6 +364,9 @@ class MediaManagerItem(QtGui.QWidget): return True def onFileClick(self): + """ + Add a file to the list widget to make it available for showing + """ files = QtGui.QFileDialog.getOpenFileNames( self, self.OnNewPrompt, SettingsManager.get_last_dir(self.settingsSection), @@ -370,6 +380,9 @@ class MediaManagerItem(QtGui.QWidget): self.settingsSection, self.getFileList()) def getFileList(self): + """ + Return the current list of files + """ count = 0 filelist = [] while count < self.ListView.count(): @@ -393,6 +406,15 @@ class MediaManagerItem(QtGui.QWidget): return False def IconFromFile(self, file, thumb): + """ + Create a thumbnail icon from a given file + + ``file`` + The file to create the icon from + + ``thumb`` + The filename to save the thumbnail to + """ icon = build_icon(unicode(file)) pixmap = icon.pixmap(QtCore.QSize(88, 50)) ext = os.path.splitext(thumb)[1].lower() @@ -420,6 +442,10 @@ class MediaManagerItem(QtGui.QWidget): u'to be defined by the plugin') def onPreviewClick(self): + """ + Preview an item by building a service item then adding that service + item to the preview slide controller. + """ if not self.ListView.selectedIndexes() and not self.remoteTriggered: QtGui.QMessageBox.information(self, translate('MediaManagerItem', 'No Items Selected'), @@ -433,6 +459,10 @@ class MediaManagerItem(QtGui.QWidget): self.parent.preview_controller.addServiceItem(service_item) def onLiveClick(self): + """ + Send an item live by building a service item then adding that service + item to the live slide controller. + """ if not self.ListView.selectedIndexes(): QtGui.QMessageBox.information(self, translate('MediaManagerItem', 'No Items Selected'), @@ -446,6 +476,9 @@ class MediaManagerItem(QtGui.QWidget): self.parent.live_controller.addServiceItem(service_item) def onAddClick(self): + """ + Add a selected item to the current service + """ if not self.ListView.selectedIndexes() and not self.remoteTriggered: QtGui.QMessageBox.information(self, translate('MediaManagerItem', 'No Items Selected'), @@ -470,6 +503,9 @@ class MediaManagerItem(QtGui.QWidget): self.parent.service_manager.addServiceItem(service_item) def onAddEditClick(self): + """ + Add a selected item to an existing item in the current service. + """ if not self.ListView.selectedIndexes() and not self.remoteTriggered: QtGui.QMessageBox.information(self, translate('MediaManagerItem', 'No items selected'), diff --git a/openlp/core/lib/plugin.py b/openlp/core/lib/plugin.py index 0c22723a4..a5d712dfb 100644 --- a/openlp/core/lib/plugin.py +++ b/openlp/core/lib/plugin.py @@ -22,7 +22,9 @@ # with this program; if not, write to the Free Software Foundation, Inc., 59 # # Temple Place, Suite 330, Boston, MA 02111-1307 USA # ############################################################################### - +""" +Provide the generic plugin functionality for OpenLP plugins. +""" import logging from PyQt4 import QtCore diff --git a/openlp/core/lib/settingsmanager.py b/openlp/core/lib/settingsmanager.py index b3d16595e..74a5d4866 100644 --- a/openlp/core/lib/settingsmanager.py +++ b/openlp/core/lib/settingsmanager.py @@ -22,7 +22,12 @@ # with this program; if not, write to the Free Software Foundation, Inc., 59 # # Temple Place, Suite 330, Boston, MA 02111-1307 USA # ############################################################################### - +""" +Provide handling for persisting OpenLP settings. OpenLP uses QSettings to +manage settings persistence. QSettings provides a single API for saving and +retrieving settings from the application but writes to disk in an OS dependant +format. +""" import os from PyQt4 import QtCore @@ -56,6 +61,9 @@ class SettingsManager(object): u'user interface/preview panel', QtCore.QVariant(True)).toBool() def togglePreviewPanel(self, isVisible): + """ + Toggle the preview panel visibility. + """ QtCore.QSettings().setValue(u'user interface/preview panel', QtCore.QVariant(isVisible)) diff --git a/openlp/core/lib/themexmlhandler.py b/openlp/core/lib/themexmlhandler.py index b2850d6ec..55ddc2838 100644 --- a/openlp/core/lib/themexmlhandler.py +++ b/openlp/core/lib/themexmlhandler.py @@ -22,7 +22,9 @@ # with this program; if not, write to the Free Software Foundation, Inc., 59 # # Temple Place, Suite 330, Boston, MA 02111-1307 USA # ############################################################################### - +""" +Provide the theme XML and handling functions for OpenLP v2 themes. +""" import os from xml.dom.minidom import Document diff --git a/openlp/core/lib/toolbar.py b/openlp/core/lib/toolbar.py index b2b05b8c0..a2979746e 100644 --- a/openlp/core/lib/toolbar.py +++ b/openlp/core/lib/toolbar.py @@ -22,7 +22,9 @@ # with this program; if not, write to the Free Software Foundation, Inc., 59 # # Temple Place, Suite 330, Boston, MA 02111-1307 USA # ############################################################################### - +""" +Provide common toolbar handling for OpenLP +""" import logging from PyQt4 import QtCore, QtGui From 683a53c594706e98a85dcf31e8558e3966b80200 Mon Sep 17 00:00:00 2001 From: Frode Woldsund Date: Tue, 22 Jun 2010 23:53:18 +0200 Subject: [PATCH 02/12] Fixed 2 translate() functions in songplugin --- openlp/plugins/songs/lib/songimport.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openlp/plugins/songs/lib/songimport.py b/openlp/plugins/songs/lib/songimport.py index 454d7e3aa..85dbe6710 100644 --- a/openlp/plugins/songs/lib/songimport.py +++ b/openlp/plugins/songs/lib/songimport.py @@ -63,9 +63,9 @@ class SongImport(object): self.verses = [] self.versecount = 0 self.choruscount = 0 - self.copyright_string = unicode(QtGui.QApplication.translate( + self.copyright_string = unicode(translate( u'SongsPlugin.SongImport', u'copyright')) - self.copyright_symbol = unicode(QtGui.QApplication.translate( + self.copyright_symbol = unicode(translate( u'SongsPlugin.SongImport', u'\xa9')) @staticmethod From b95b5983407872b8a82e066b9e28d216e44ac9b2 Mon Sep 17 00:00:00 2001 From: Frode Woldsund Date: Wed, 23 Jun 2010 08:54:11 +0200 Subject: [PATCH 03/12] Forgot to import translate from openlp.core.lib :( --- openlp/plugins/songs/lib/songimport.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openlp/plugins/songs/lib/songimport.py b/openlp/plugins/songs/lib/songimport.py index 85dbe6710..3ecb7a542 100644 --- a/openlp/plugins/songs/lib/songimport.py +++ b/openlp/plugins/songs/lib/songimport.py @@ -27,7 +27,7 @@ import re from PyQt4 import QtGui -from openlp.core.lib import SongXMLBuilder +from openlp.core.lib import SongXMLBuilder, translate from openlp.plugins.songs.lib import VerseType from openlp.plugins.songs.lib.models import Song, Author, Topic, Book From 482640853677dbf18e448da7474c020e72f5c454 Mon Sep 17 00:00:00 2001 From: Frode Woldsund Date: Wed, 23 Jun 2010 09:05:43 +0200 Subject: [PATCH 04/12] stupid whitespace ... --- openlp/plugins/songs/lib/songimport.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openlp/plugins/songs/lib/songimport.py b/openlp/plugins/songs/lib/songimport.py index 3ecb7a542..cc7b16b66 100644 --- a/openlp/plugins/songs/lib/songimport.py +++ b/openlp/plugins/songs/lib/songimport.py @@ -27,7 +27,7 @@ import re from PyQt4 import QtGui -from openlp.core.lib import SongXMLBuilder, translate +from openlp.core.lib import SongXMLBuilder, translate from openlp.plugins.songs.lib import VerseType from openlp.plugins.songs.lib.models import Song, Author, Topic, Book From 07db3c4c21f545127ecf274ae7ad9346e18b28a6 Mon Sep 17 00:00:00 2001 From: Frode Woldsund Date: Wed, 23 Jun 2010 09:22:05 +0200 Subject: [PATCH 05/12] removed u' --- openlp/plugins/songs/lib/songimport.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openlp/plugins/songs/lib/songimport.py b/openlp/plugins/songs/lib/songimport.py index cc7b16b66..ede946dc7 100644 --- a/openlp/plugins/songs/lib/songimport.py +++ b/openlp/plugins/songs/lib/songimport.py @@ -64,9 +64,9 @@ class SongImport(object): self.versecount = 0 self.choruscount = 0 self.copyright_string = unicode(translate( - u'SongsPlugin.SongImport', u'copyright')) + 'SongsPlugin.SongImport', 'copyright')) self.copyright_symbol = unicode(translate( - u'SongsPlugin.SongImport', u'\xa9')) + 'SongsPlugin.SongImport', '\xa9')) @staticmethod def process_songs_text(manager, text): From 56f87c3a350d3c7160b53970e9dda01f27bacc17 Mon Sep 17 00:00:00 2001 From: Frode Woldsund Date: Wed, 23 Jun 2010 15:39:36 +0200 Subject: [PATCH 06/12] Fixed (c) symbol --- openlp/core/ui/aboutdialog.py | 5 +++-- openlp/plugins/songs/forms/editsongdialog.py | 2 +- openlp/plugins/songs/forms/editsongform.py | 2 +- openlp/plugins/songs/lib/songimport.py | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/openlp/core/ui/aboutdialog.py b/openlp/core/ui/aboutdialog.py index c6866c8d7..da818d658 100644 --- a/openlp/core/ui/aboutdialog.py +++ b/openlp/core/ui/aboutdialog.py @@ -169,8 +169,9 @@ class Ui_AboutDialog(object): self.AboutNotebook.indexOf(self.CreditsTab), translate('AboutForm', 'Credits')) self.LicenseTextEdit.setPlainText(translate('AboutForm', - 'Copyright \xa9 2004-2010 Raoul Snyman\n' - 'Portions copyright \xa9 2004-2010 ' + 'Copyright ' + u'\u00a9'.encode('utf8') + + ' 2004-2010 Raoul Snyman\n' + 'Portions copyright ' + u'\u00a9'.encode('utf8') + '2004-2010 ' 'Tim Bentley, Jonathan Corwin, Michael Gorven, Scott Guerrieri, ' 'Christian Richter, Maikel Stuivenberg, Martin Thompson, Jon ' 'Tibble, Carsten Tinggaard\n' diff --git a/openlp/plugins/songs/forms/editsongdialog.py b/openlp/plugins/songs/forms/editsongdialog.py index 34e15ce59..3087334d0 100644 --- a/openlp/plugins/songs/forms/editsongdialog.py +++ b/openlp/plugins/songs/forms/editsongdialog.py @@ -482,7 +482,7 @@ class Ui_EditSongDialog(object): self.CopyrightGroupBox.setTitle( translate('SongsPlugin.EditSongForm', 'Copyright Information')) self.CopyrightInsertButton.setText( - translate('SongsPlugin.EditSongForm', '\xa9')) + translate('SongsPlugin.EditSongForm', u'\u00a9'.encode('utf8'))) self.CCLILabel.setText( translate('SongsPlugin.EditSongForm', 'CCLI Number:')) self.CommentsGroupBox.setTitle( diff --git a/openlp/plugins/songs/forms/editsongform.py b/openlp/plugins/songs/forms/editsongform.py index fd731b821..95125fabf 100644 --- a/openlp/plugins/songs/forms/editsongform.py +++ b/openlp/plugins/songs/forms/editsongform.py @@ -589,7 +589,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): def onCopyrightInsertButtonTriggered(self): text = self.CopyrightEditItem.text() pos = self.CopyrightEditItem.cursorPosition() - text = text[:pos] + u'\xa9' + text[pos:] + text = text[:pos] + u'\u00a9'.encode('utf8') + text[pos:] self.CopyrightEditItem.setText(text) self.CopyrightEditItem.setFocus() self.CopyrightEditItem.setCursorPosition(pos + 1) diff --git a/openlp/plugins/songs/lib/songimport.py b/openlp/plugins/songs/lib/songimport.py index ede946dc7..6dd9572ee 100644 --- a/openlp/plugins/songs/lib/songimport.py +++ b/openlp/plugins/songs/lib/songimport.py @@ -66,7 +66,7 @@ class SongImport(object): self.copyright_string = unicode(translate( 'SongsPlugin.SongImport', 'copyright')) self.copyright_symbol = unicode(translate( - 'SongsPlugin.SongImport', '\xa9')) + 'SongsPlugin.SongImport', u'\u00a9'.encode('utf8'))) @staticmethod def process_songs_text(manager, text): From 9dc12ac52234ac314e44016c7e20b5c1c3dd800f Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Thu, 24 Jun 2010 21:40:41 +0200 Subject: [PATCH 07/12] Try to fix the song plugin's dependence on OOo. --- openlp/plugins/songs/songsplugin.py | 85 ++++++++++++++++------------- 1 file changed, 46 insertions(+), 39 deletions(-) diff --git a/openlp/plugins/songs/songsplugin.py b/openlp/plugins/songs/songsplugin.py index 57c0ee844..0d629fe42 100644 --- a/openlp/plugins/songs/songsplugin.py +++ b/openlp/plugins/songs/songsplugin.py @@ -29,8 +29,13 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import Plugin, build_icon, PluginStatus, Receiver, \ translate -from openlp.plugins.songs.lib import SongManager, SongMediaItem, SongsTab, \ - SofImport, OooImport +from openlp.plugins.songs.lib import SongManager, SongMediaItem, SongsTab + +try: + from openlp.plugins.songs.lib import SofImport, OooImport + OOo_available = True +except ImportError: + OOo_available = False log = logging.getLogger(__name__) @@ -95,46 +100,48 @@ class SongsPlugin(Plugin): self.SongImportItem.setToolTip(translate('SongsPlugin', 'Import songs using the import wizard.')) import_menu.addAction(self.SongImportItem) - # Songs of Fellowship import menu item - will be removed and the - # functionality will be contained within the import wizard - self.ImportSofItem = QtGui.QAction(import_menu) - self.ImportSofItem.setObjectName(u'ImportSofItem') - self.ImportSofItem.setText( - translate('SongsPlugin', - 'Songs of Fellowship (temp menu item)')) - self.ImportSofItem.setToolTip( - translate('SongsPlugin', - 'Import songs from the VOLS1_2.RTF, sof3words' \ - + '.rtf and sof4words.rtf supplied with the music books')) - self.ImportSofItem.setStatusTip( - translate('SongsPlugin', - 'Import songs from the VOLS1_2.RTF, sof3words' \ - + '.rtf and sof4words.rtf supplied with the music books')) - import_menu.addAction(self.ImportSofItem) - # OpenOffice.org import menu item - will be removed and the - # functionality will be contained within the import wizard - self.ImportOooItem = QtGui.QAction(import_menu) - self.ImportOooItem.setObjectName(u'ImportOooItem') - self.ImportOooItem.setText( - translate('SongsPlugin', - 'Generic Document/Presentation Import ' - '(temp menu item)')) - self.ImportOooItem.setToolTip( - translate('SongsPlugin', - 'Import songs from ' - 'Word/Writer/Powerpoint/Impress')) - self.ImportOooItem.setStatusTip( - translate('SongsPlugin', - 'Import songs from ' - 'Word/Writer/Powerpoint/Impress')) - import_menu.addAction(self.ImportOooItem) # Signals and slots QtCore.QObject.connect(self.SongImportItem, QtCore.SIGNAL(u'triggered()'), self.onSongImportItemClicked) - QtCore.QObject.connect(self.ImportSofItem, - QtCore.SIGNAL(u'triggered()'), self.onImportSofItemClick) - QtCore.QObject.connect(self.ImportOooItem, - QtCore.SIGNAL(u'triggered()'), self.onImportOooItemClick) + if OOo_available: + # Songs of Fellowship import menu item - will be removed and the + # functionality will be contained within the import wizard + self.ImportSofItem = QtGui.QAction(import_menu) + self.ImportSofItem.setObjectName(u'ImportSofItem') + self.ImportSofItem.setText( + translate('SongsPlugin', + 'Songs of Fellowship (temp menu item)')) + self.ImportSofItem.setToolTip( + translate('SongsPlugin', + 'Import songs from the VOLS1_2.RTF, sof3words' \ + + '.rtf and sof4words.rtf supplied with the music books')) + self.ImportSofItem.setStatusTip( + translate('SongsPlugin', + 'Import songs from the VOLS1_2.RTF, sof3words' \ + + '.rtf and sof4words.rtf supplied with the music books')) + import_menu.addAction(self.ImportSofItem) + # OpenOffice.org import menu item - will be removed and the + # functionality will be contained within the import wizard + self.ImportOooItem = QtGui.QAction(import_menu) + self.ImportOooItem.setObjectName(u'ImportOooItem') + self.ImportOooItem.setText( + translate('SongsPlugin', + 'Generic Document/Presentation Import ' + '(temp menu item)')) + self.ImportOooItem.setToolTip( + translate('SongsPlugin', + 'Import songs from ' + 'Word/Writer/Powerpoint/Impress')) + self.ImportOooItem.setStatusTip( + translate('SongsPlugin', + 'Import songs from ' + 'Word/Writer/Powerpoint/Impress')) + import_menu.addAction(self.ImportOooItem) + # Signals and slots + QtCore.QObject.connect(self.ImportSofItem, + QtCore.SIGNAL(u'triggered()'), self.onImportSofItemClick) + QtCore.QObject.connect(self.ImportOooItem, + QtCore.SIGNAL(u'triggered()'), self.onImportOooItemClick) def add_export_menu_item(self, export_menu): """ From ae17e3b6b3b26469df83967a371bb7dd72537d0f Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Thu, 24 Jun 2010 22:48:38 +0200 Subject: [PATCH 08/12] Some more OOo related fixes. --- openlp/plugins/songs/lib/__init__.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/openlp/plugins/songs/lib/__init__.py b/openlp/plugins/songs/lib/__init__.py index 15303ccf7..dddb23b4e 100644 --- a/openlp/plugins/songs/lib/__init__.py +++ b/openlp/plugins/songs/lib/__init__.py @@ -94,6 +94,10 @@ class VerseType(object): from manager import SongManager from songstab import SongsTab from mediaitem import SongMediaItem -from sofimport import SofImport -from oooimport import OooImport -from songimport import SongImport \ No newline at end of file +from songimport import SongImport +try: + from sofimport import SofImport + from oooimport import OooImport +except ImportError: + pass + From 3cee3f0f8eb5ec6f9812bbc2ff86720ea00d744d Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Fri, 25 Jun 2010 01:25:21 +0100 Subject: [PATCH 09/12] Fix grammo --- openlp/core/lib/serviceitem.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openlp/core/lib/serviceitem.py b/openlp/core/lib/serviceitem.py index d9c434987..dfcad984a 100644 --- a/openlp/core/lib/serviceitem.py +++ b/openlp/core/lib/serviceitem.py @@ -304,7 +304,7 @@ class ServiceItem(object): def merge(self, other): """ Updates the _uuid with the value from the original one - The _uuid is unique for a give service item but this allows one to + The _uuid is unique for a given service item but this allows one to replace an original version. """ self._uuid = other._uuid From 7c873ada587f42225ab913ed97dd6ba38f08aecb Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Fri, 25 Jun 2010 17:50:35 +0100 Subject: [PATCH 10/12] Fix bug #598415 --- openlp/core/ui/serviceitemeditform.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/openlp/core/ui/serviceitemeditform.py b/openlp/core/ui/serviceitemeditform.py index 1ea829f81..d667507af 100644 --- a/openlp/core/ui/serviceitemeditform.py +++ b/openlp/core/ui/serviceitemeditform.py @@ -73,6 +73,10 @@ class ServiceItemEditForm(QtGui.QDialog, Ui_ServiceItemEditDialog): for frame in self.itemList: item_name = QtGui.QListWidgetItem(frame[u'title']) self.listWidget.addItem(item_name) + if self.listWidget.count() == 1: + self.deleteButton.setEnabled(False) + else: + self.deleteButton.setEnabled(True) def onItemDelete(self): """ From 1800ae4ddbe7f4eda60964b14b8329781d42b62e Mon Sep 17 00:00:00 2001 From: andreas Date: Fri, 25 Jun 2010 20:18:52 +0200 Subject: [PATCH 11/12] improvement in regard to bug #598415 --- openlp/core/ui/serviceitemeditform.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/openlp/core/ui/serviceitemeditform.py b/openlp/core/ui/serviceitemeditform.py index d667507af..4355ab797 100644 --- a/openlp/core/ui/serviceitemeditform.py +++ b/openlp/core/ui/serviceitemeditform.py @@ -74,8 +74,12 @@ class ServiceItemEditForm(QtGui.QDialog, Ui_ServiceItemEditDialog): item_name = QtGui.QListWidgetItem(frame[u'title']) self.listWidget.addItem(item_name) if self.listWidget.count() == 1: + self.downButton.setEnabled(False) + self.upButton.setEnabled(False) self.deleteButton.setEnabled(False) else: + self.downButton.setEnabled(True) + self.upButton.setEnabled(True) self.deleteButton.setEnabled(True) def onItemDelete(self): From 4d1a7e8b4181e83052039572e52e675c1b992ca5 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Fri, 25 Jun 2010 20:01:03 +0100 Subject: [PATCH 12/12] Cleanup last few commits --- openlp/plugins/bibles/lib/osis.py | 3 ++- openlp/plugins/songs/lib/songimport.py | 2 -- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/openlp/plugins/bibles/lib/osis.py b/openlp/plugins/bibles/lib/osis.py index 5b3324e00..844d31052 100644 --- a/openlp/plugins/bibles/lib/osis.py +++ b/openlp/plugins/bibles/lib/osis.py @@ -68,7 +68,8 @@ class OSISBible(BibleDB): self.q1_regex = re.compile(r'') self.q2_regex = re.compile(r'') self.trans_regex = re.compile(r'(.*?)') - self.divineName_regex = re.compile(r'(.*?)') + self.divineName_regex = re.compile( + r'(.*?)') self.spaces_regex = re.compile(r'([ ]{2,})') self.books = {} filepath = os.path.join( diff --git a/openlp/plugins/songs/lib/songimport.py b/openlp/plugins/songs/lib/songimport.py index ede946dc7..654c9c4e7 100644 --- a/openlp/plugins/songs/lib/songimport.py +++ b/openlp/plugins/songs/lib/songimport.py @@ -25,8 +25,6 @@ import re -from PyQt4 import QtGui - from openlp.core.lib import SongXMLBuilder, translate from openlp.plugins.songs.lib import VerseType from openlp.plugins.songs.lib.models import Song, Author, Topic, Book