From 7dcd7f3011bb6c0a4d3844af33f038005d0a6a05 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Wed, 27 Oct 2010 20:40:38 +0100 Subject: [PATCH 1/5] Fix Media icon - it went AWOL --- openlp/plugins/media/lib/mediaitem.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openlp/plugins/media/lib/mediaitem.py b/openlp/plugins/media/lib/mediaitem.py index 61309c174..6e3695149 100644 --- a/openlp/plugins/media/lib/mediaitem.py +++ b/openlp/plugins/media/lib/mediaitem.py @@ -56,7 +56,7 @@ class MediaMediaItem(MediaManagerItem): u':/media/media_video.png').toImage() MediaManagerItem.__init__(self, parent, self, icon) self.singleServiceItem = False - self.serviceItemIconName = u':/media/media_video.png' + self.serviceItemIconName = u':/media/image_clapperboard.png' def retranslateUi(self): self.OnNewPrompt = translate('MediaPlugin.MediaItem', 'Select Media') From 5d9ef61e2c9cef827a7a013e370ee9badc0aec0b Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Thu, 28 Oct 2010 18:02:28 +0100 Subject: [PATCH 2/5] Only Vacuum changed databases --- openlp/core/lib/db.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/openlp/core/lib/db.py b/openlp/core/lib/db.py index 7c4536ccf..e59a9737b 100644 --- a/openlp/core/lib/db.py +++ b/openlp/core/lib/db.py @@ -117,6 +117,7 @@ class Manager(object): settings = QtCore.QSettings() settings.beginGroup(plugin_name) self.db_url = u'' + self.is_dirty = False db_type = unicode( settings.value(u'db type', QtCore.QVariant(u'sqlite')).toString()) if db_type == u'sqlite': @@ -150,6 +151,7 @@ class Manager(object): self.session.add(object_instance) if commit: self.session.commit() + self.is_dirty = True return True except InvalidRequestError: self.session.rollback() @@ -220,6 +222,7 @@ class Manager(object): try: self.session.delete(object_instance) self.session.commit() + self.is_dirty = True return True except InvalidRequestError: self.session.rollback() @@ -241,6 +244,7 @@ class Manager(object): query = query.filter(filter_clause) query.delete(synchronize_session=False) self.session.commit() + self.is_dirty = True return True except InvalidRequestError: self.session.rollback() @@ -251,5 +255,6 @@ class Manager(object): """ VACUUM the database on exit. """ - engine = create_engine(self.db_url) - engine.execute("vacuum") + if self.is_dirty: + engine = create_engine(self.db_url) + engine.execute("vacuum") From fff4cf1e1c910fd1776b14a146f646176be4a31e Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Thu, 28 Oct 2010 18:23:17 +0100 Subject: [PATCH 3/5] Revert 1102 Fixes: https://launchpad.net/bugs/667837 --- openlp/core/lib/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openlp/core/lib/__init__.py b/openlp/core/lib/__init__.py index 1ad17a039..c8551299b 100644 --- a/openlp/core/lib/__init__.py +++ b/openlp/core/lib/__init__.py @@ -263,8 +263,9 @@ def resize_image(image, width, height, background=QtCore.Qt.black): # and move it to the centre of the preview space new_image = QtGui.QImage(width, height, QtGui.QImage.Format_ARGB32_Premultiplied) + new_image.fill(background) painter = QtGui.QPainter(new_image) - painter.fillRect(new_image.rect(), background) + #painter.fillRect(new_image.rect(), background) painter.drawImage((width - realw) / 2, (height - realh) / 2, preview) return new_image From 9ed0ff2ea26a554d4d971ab53bc2ef1472f79db6 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Fri, 29 Oct 2010 07:36:17 +0100 Subject: [PATCH 4/5] Proper fix for 1102 --- openlp/core/lib/__init__.py | 3 +-- openlp/core/lib/theme.py | 3 +++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/openlp/core/lib/__init__.py b/openlp/core/lib/__init__.py index c8551299b..1ad17a039 100644 --- a/openlp/core/lib/__init__.py +++ b/openlp/core/lib/__init__.py @@ -263,9 +263,8 @@ def resize_image(image, width, height, background=QtCore.Qt.black): # and move it to the centre of the preview space new_image = QtGui.QImage(width, height, QtGui.QImage.Format_ARGB32_Premultiplied) - new_image.fill(background) painter = QtGui.QPainter(new_image) - #painter.fillRect(new_image.rect(), background) + painter.fillRect(new_image.rect(), background) painter.drawImage((width - realw) / 2, (height - realh) / 2, preview) return new_image diff --git a/openlp/core/lib/theme.py b/openlp/core/lib/theme.py index ad6ca0f5b..b7ed711f9 100644 --- a/openlp/core/lib/theme.py +++ b/openlp/core/lib/theme.py @@ -408,6 +408,9 @@ class ThemeXML(object): elif field in integer_list: setattr(self, master + field, int(value)) else: + # None means an empty sting so lets have one. + if value == u'None': + value = u'' setattr(self, master + field, unicode(value)) def __str__(self): From e6506e74333f4a8f01479ec6eb6a635f4ef342ac Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Fri, 29 Oct 2010 07:44:38 +0100 Subject: [PATCH 5/5] Spelling --- openlp/core/lib/theme.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openlp/core/lib/theme.py b/openlp/core/lib/theme.py index b7ed711f9..cf1859d0b 100644 --- a/openlp/core/lib/theme.py +++ b/openlp/core/lib/theme.py @@ -408,7 +408,7 @@ class ThemeXML(object): elif field in integer_list: setattr(self, master + field, int(value)) else: - # None means an empty sting so lets have one. + # None means an empty string so lets have one. if value == u'None': value = u'' setattr(self, master + field, unicode(value))