From a091c8f3b665a313ea6128ab2d9401366a7901cb Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Wed, 24 Mar 2010 19:15:25 +0000 Subject: [PATCH 1/7] Fix Quick bible enter --- openlp/plugins/bibles/lib/mediaitem.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/openlp/plugins/bibles/lib/mediaitem.py b/openlp/plugins/bibles/lib/mediaitem.py index 9b286eb1a..3bcc0b426 100644 --- a/openlp/plugins/bibles/lib/mediaitem.py +++ b/openlp/plugins/bibles/lib/mediaitem.py @@ -253,6 +253,8 @@ class BibleMediaItem(MediaManagerItem): QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'config_updated'), self.configUpdated) # Other stuff + QtCore.QObject.connect(self.QuickSearchEdit, + QtCore.SIGNAL(u'returnPressed()'), self.onQuickSearchButton) QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'bible_showprogress'), self.onSearchProgressShow) QtCore.QObject.connect(Receiver.get_receiver(), From 2eaadffea0034fc4bba0e81e3c481b4a2f335653 Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Wed, 24 Mar 2010 23:00:43 +0200 Subject: [PATCH 2/7] Fixed two bugs in the web downloads import dealing with non-latin characters. --- .../plugins/bibles/forms/importwizardform.py | 36 +++++++++++-------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/openlp/plugins/bibles/forms/importwizardform.py b/openlp/plugins/bibles/forms/importwizardform.py index 2efbcdf1e..22fea28f4 100644 --- a/openlp/plugins/bibles/forms/importwizardform.py +++ b/openlp/plugins/bibles/forms/importwizardform.py @@ -37,7 +37,7 @@ from openlp.plugins.bibles.lib.manager import BibleFormat log = logging.getLogger(__name__) -class DownloadLocation(object): +class WebDownload(object): Unknown = -1 Crosswalk = 0 BibleGateway = 1 @@ -282,7 +282,7 @@ class ImportWizardForm(QtGui.QWizard, Ui_BibleImportWizard): self.setField(u'csv_booksfile', QtCore.QVariant('')) self.setField(u'csv_versefile', QtCore.QVariant('')) self.setField(u'opensong_file', QtCore.QVariant('')) - self.setField(u'web_location', QtCore.QVariant(DownloadLocation.Crosswalk)) + self.setField(u'web_location', QtCore.QVariant(WebDownload.Crosswalk)) self.setField(u'web_biblename', QtCore.QVariant(self.BibleComboBox)) self.setField(u'proxy_server', QtCore.QVariant(self.config.get_config(u'proxy address', ''))) @@ -293,7 +293,7 @@ class ImportWizardForm(QtGui.QWizard, Ui_BibleImportWizard): self.setField(u'license_version', QtCore.QVariant(self.VersionNameEdit)) self.setField(u'license_copyright', QtCore.QVariant(self.CopyrightEdit)) self.setField(u'license_permission', QtCore.QVariant(self.PermissionEdit)) - self.onLocationComboBoxChanged(DownloadLocation.Crosswalk) + self.onLocationComboBoxChanged(WebDownload.Crosswalk) def loadWebBibles(self): """ @@ -304,13 +304,13 @@ class ImportWizardForm(QtGui.QWizard, Ui_BibleImportWizard): filepath = os.path.join(filepath, u'bibles', u'resources') fbibles = None try: - self.web_bible_list[DownloadLocation.Crosswalk] = {} + self.web_bible_list[WebDownload.Crosswalk] = {} books_file = open(os.path.join(filepath, u'crosswalkbooks.csv'), 'r') dialect = csv.Sniffer().sniff(books_file.read(1024)) books_file.seek(0) books_reader = csv.reader(books_file, dialect) for line in books_reader: - self.web_bible_list[DownloadLocation.Crosswalk][line[0]] = \ + self.web_bible_list[WebDownload.Crosswalk][line[0]] = \ unicode(line[1], u'utf8').strip() except: log.exception(u'Crosswalk resources missing') @@ -319,14 +319,19 @@ class ImportWizardForm(QtGui.QWizard, Ui_BibleImportWizard): books_file.close() #Load and store BibleGateway Bibles try: - self.web_bible_list[DownloadLocation.BibleGateway] = {} + self.web_bible_list[WebDownload.BibleGateway] = {} books_file = open(os.path.join(filepath, u'biblegateway.csv'), 'r') dialect = csv.Sniffer().sniff(books_file.read(1024)) books_file.seek(0) books_reader = csv.reader(books_file, dialect) for line in books_reader: - self.web_bible_list[DownloadLocation.BibleGateway][line[0]] = \ - unicode(line[1], u'utf-8').strip() + ver = line[0] + name = line[1] + if not isinstance(ver, unicode): + ver = unicode(ver, u'utf8') + if not isinstance(name, unicode): + name = unicode(name, u'utf8') + self.web_bible_list[WebDownload.BibleGateway][ver] = name.strip() except: log.exception(u'Biblegateway resources missing') finally: @@ -383,16 +388,17 @@ class ImportWizardForm(QtGui.QWizard, Ui_BibleImportWizard): # Import a bible from the web self.ImportProgressBar.setMaximum(1) download_location = self.field(u'web_location').toInt()[0] - if download_location == DownloadLocation.Crosswalk: - bible = self.web_bible_list[DownloadLocation.Crosswalk][ - unicode(self.BibleComboBox.currentText(), u'utf8')] - elif download_location == DownloadLocation.BibleGateway: - bible = self.web_bible_list[DownloadLocation.BibleGateway][ - unicode(self.BibleComboBox.currentText(), u'utf8')] + bible_version = self.BibleComboBox.currentText() + if not isinstance(bible_version, unicode): + bible_version = unicode(bible_version, u'utf8') + if download_location == WebDownload.Crosswalk: + bible = self.web_bible_list[WebDownload.Crosswalk][bible_version] + elif download_location == WebDownload.BibleGateway: + bible = self.web_bible_list[WebDownload.BibleGateway][bible_version] importer = self.manager.import_bible( BibleFormat.WebDownload, name=license_version, - download_source=DownloadLocation.get_name(download_location), + download_source=WebDownload.get_name(download_location), download_name=bible, proxy_server=variant_to_unicode(self.field(u'proxy_server')), proxy_username=variant_to_unicode(self.field(u'proxy_username')), From 0b596dab473b72914753ed4ef2c9788115531121 Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Wed, 24 Mar 2010 23:18:36 +0200 Subject: [PATCH 3/7] Fixed another possible bug. --- openlp/plugins/bibles/forms/importwizardform.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/openlp/plugins/bibles/forms/importwizardform.py b/openlp/plugins/bibles/forms/importwizardform.py index 22fea28f4..a717a4f44 100644 --- a/openlp/plugins/bibles/forms/importwizardform.py +++ b/openlp/plugins/bibles/forms/importwizardform.py @@ -310,8 +310,13 @@ class ImportWizardForm(QtGui.QWizard, Ui_BibleImportWizard): books_file.seek(0) books_reader = csv.reader(books_file, dialect) for line in books_reader: - self.web_bible_list[WebDownload.Crosswalk][line[0]] = \ - unicode(line[1], u'utf8').strip() + ver = line[0] + name = line[1] + if not isinstance(ver, unicode): + ver = unicode(ver, u'utf8') + if not isinstance(name, unicode): + name = unicode(name, u'utf8') + self.web_bible_list[WebDownload.Crosswalk][ver] = name.strip() except: log.exception(u'Crosswalk resources missing') finally: From b490e74012d652bb5aabaf3a8764fd2df8ad4f00 Mon Sep 17 00:00:00 2001 From: Jonathan Corwin Date: Wed, 24 Mar 2010 22:59:05 +0000 Subject: [PATCH 4/7] Start presentation apps in right place --- openlp/plugins/presentations/presentationplugin.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openlp/plugins/presentations/presentationplugin.py b/openlp/plugins/presentations/presentationplugin.py index 5968f1ad9..00a83fe4b 100644 --- a/openlp/plugins/presentations/presentationplugin.py +++ b/openlp/plugins/presentations/presentationplugin.py @@ -57,6 +57,8 @@ class PresentationPlugin(Plugin): for controller in self.controllers: if self.controllers[controller].enabled: presentation_types.append({u'%s' % controller : self.controllers[controller].supports}) + self.controllers[controller].start_process() + Receiver.send_message( u'presentation types', presentation_types) @@ -104,8 +106,6 @@ class PresentationPlugin(Plugin): for controller_class in controller_classes: controller = controller_class(self) self.registerControllers(controller) - if controller.enabled: - controller.start_process() if self.controllers: return True else: From 51d6d2410ba47a160267c4b2bb588bdcf00ff227 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Thu, 25 Mar 2010 19:27:46 +0000 Subject: [PATCH 5/7] Fix QT4.4 bug in service manager --- openlp/core/ui/servicemanager.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openlp/core/ui/servicemanager.py b/openlp/core/ui/servicemanager.py index 89166316e..28bf29e06 100644 --- a/openlp/core/ui/servicemanager.py +++ b/openlp/core/ui/servicemanager.py @@ -148,7 +148,8 @@ class ServiceManager(QtGui.QWidget): self.ServiceManagerList.setHeaderHidden(True) self.ServiceManagerList.setExpandsOnDoubleClick(False) self.ServiceManagerList.setContextMenuPolicy(QtCore.Qt.CustomContextMenu) - self.ServiceManagerList.customContextMenuRequested.connect(self.contextMenu) + QtCore.QObject.connect(self.ServiceManagerList, + QtCore.SIGNAL('customContextMenuRequested(QPoint)'), self.contextMenu) self.ServiceManagerList.setObjectName(u'ServiceManagerList') # enable drop self.ServiceManagerList.__class__.dragEnterEvent = self.dragEnterEvent From 44f3e02a5c8a4bbca12ce930ca08d078f119e955 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Fri, 26 Mar 2010 08:49:26 +0000 Subject: [PATCH 6/7] Fix outline rendering bug --- openlp/core/lib/renderer.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/openlp/core/lib/renderer.py b/openlp/core/lib/renderer.py index 41b25df0a..39fcf9aa7 100644 --- a/openlp/core/lib/renderer.py +++ b/openlp/core/lib/renderer.py @@ -505,7 +505,7 @@ class Renderer(object): self.mainFont.setPixelSize(self._theme.font_main_proportion) def _get_extent_and_render(self, line, footer, tlcorner=(0, 0), draw=False, - color=None, outline_size=None, outline_color=None): + color=None, outline_size=0, outline_color=None): """ Find bounding box of text - as render_single_line. If draw is set, actually draw the text to the current DC as well return width and @@ -544,21 +544,23 @@ class Renderer(object): else: pen = QtGui.QColor(color) x, y = tlcorner - if outline_size: + if self._theme.display_outline: path = QtGui.QPainterPath() path.addText(QtCore.QPointF(x, y + metrics.ascent()), font, line) self.painter.setBrush(self.painter.pen().brush()) - self.painter.setPen(QtGui.QPen(QtGui.QColor(outline_color), outline_size)) + self.painter.setPen(QtGui.QPen( + QtGui.QColor(self._theme.display_outline_color), outline_size)) self.painter.drawPath(path) self.painter.setPen(pen) self.painter.drawText(x, y + metrics.ascent(), line) if self._theme.display_slideTransition: # Print 2nd image with 70% weight - if outline_size: + if self._theme.display_outline: path = QtGui.QPainterPath() path.addText(QtCore.QPointF(x, y + metrics.ascent()), font, line) self.painter2.setBrush(self.painter2.pen().brush()) - self.painter2.setPen(QtGui.QPen(QtGui.QColor(outline_color), outline_size)) + self.painter2.setPen(QtGui.QPen( + QtGui.QColor(self._theme.display_outline_color), outline_size)) self.painter2.drawPath(path) self.painter2.setFont(font) self.painter2.setPen(pen) From d4717c4809e72aff174d3f9ed65c8b276b274b22 Mon Sep 17 00:00:00 2001 From: Michael Gorven Date: Fri, 26 Mar 2010 17:14:52 +0200 Subject: [PATCH 7/7] Correct .desktop file syntax so that rpmbuild doesn't fail. --- resources/openlp.desktop | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/openlp.desktop b/resources/openlp.desktop index 8791c2d8f..0c843bd69 100644 --- a/resources/openlp.desktop +++ b/resources/openlp.desktop @@ -5,6 +5,6 @@ GenericName=Church lyrics projection Exec=openlp Icon=openlp StartupNotify=true -Terminal=False +Terminal=false Type=Application -Categories=AudioVideo +Categories=AudioVideo;