From 94fc7fba2b4e527c746dbdfdaa70cb5cc5c8a514 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Thu, 22 Oct 2009 15:04:11 +0100 Subject: [PATCH 01/17] Unused imports --- openlpcnv.pyw | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/openlpcnv.pyw b/openlpcnv.pyw index 76a7139dc..5dfe87061 100755 --- a/openlpcnv.pyw +++ b/openlpcnv.pyw @@ -28,8 +28,7 @@ import logging import time import subprocess import codecs -import sys -from datetime import date + if os.name == u'nt': import win32api import win32con From 6c5ccc101b3c8e66040b3569df73a223faa1e42d Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Fri, 23 Oct 2009 17:10:09 +0100 Subject: [PATCH 02/17] Font Siziing and rendering improvements --- openlp/core/lib/renderer.py | 12 ++++++++---- openlp/core/lib/themexmlhandler.py | 4 ++-- openlp/core/ui/amendthemeform.py | 3 +++ 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/openlp/core/lib/renderer.py b/openlp/core/lib/renderer.py index 2e3180860..4f6aa9235 100644 --- a/openlp/core/lib/renderer.py +++ b/openlp/core/lib/renderer.py @@ -169,6 +169,8 @@ class Renderer(object): page_length = int(self._rect.height() / metrics.height() - 2 ) - 1 ave_line_width = line_width / metrics.averageCharWidth() ave_line_width = int(ave_line_width + (ave_line_width * 1)) + log.debug(u'Page Length area height %s , metrics %s , lines %s' % + (int(self._rect.height()), metrics.height(), page_length )) split_pages = [] page = [] split_lines = [] @@ -195,15 +197,17 @@ class Renderer(object): else: split_text = line[:pos] split_lines.append(split_text) - line = line[pos:] + line = line[pos:].lstrip() #if we have more text add up to 10 spaces on the front. - if len(line) > 0 : + if len(line) > 0 and self._theme.font_main_indentation > 0: line = u'%s%s' % \ (u' '[:self._theme.font_main_indentation], line) #Text fits in a line now - for line in split_lines: + for count, line in enumerate(split_lines): page.append(line) - if len(page) == page_length: + #last but one line and only 2 lines to go or end of page + if (len(page) == page_length - 1 and len(split_lines) - 3 == count) or \ + len(page) == page_length: split_pages.append(page) page = [] if len(page) > 0 and page != u' ': diff --git a/openlp/core/lib/themexmlhandler.py b/openlp/core/lib/themexmlhandler.py index 908ea7ebf..7aab3bf7a 100644 --- a/openlp/core/lib/themexmlhandler.py +++ b/openlp/core/lib/themexmlhandler.py @@ -52,7 +52,7 @@ blankthemexml=\ Normal False 0 - + Arial @@ -61,7 +61,7 @@ blankthemexml=\ Normal False 0 - + True diff --git a/openlp/core/ui/amendthemeform.py b/openlp/core/ui/amendthemeform.py index af039852e..d2afd2fcb 100644 --- a/openlp/core/ui/amendthemeform.py +++ b/openlp/core/ui/amendthemeform.py @@ -674,8 +674,11 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog): int(self.theme.font_main_proportion), # size int(main_weight), # weight self.theme.font_main_italics)# italic + mainFont.setPixelSize(int(self.theme.font_main_proportion)) metrics = QtGui.QFontMetrics(mainFont) page_length = (int(self.FontMainHeightSpinBox.value()) / metrics.height() - 2 ) - 1 + log.debug(u'Page Length area height %s , metrics %s , lines %s' % + (int(self.FontMainHeightSpinBox.value()), metrics.height(), page_length )) self.FontMainLinesPageLabel.setText( translate(u'ThemeManager', u'Slide Height is %s rows' % page_length )) frame = self.thememanager.generateImage(theme) From 4c35fc81a59c4adc6abdfec7770075e7218f5e2c Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Fri, 23 Oct 2009 18:09:09 +0100 Subject: [PATCH 03/17] Fix rendering bug --- openlp/core/lib/renderer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openlp/core/lib/renderer.py b/openlp/core/lib/renderer.py index 4f6aa9235..79c58f6af 100644 --- a/openlp/core/lib/renderer.py +++ b/openlp/core/lib/renderer.py @@ -201,7 +201,7 @@ class Renderer(object): #if we have more text add up to 10 spaces on the front. if len(line) > 0 and self._theme.font_main_indentation > 0: line = u'%s%s' % \ - (u' '[:self._theme.font_main_indentation], line) + (u' '[:int(self._theme.font_main_indentation)], line) #Text fits in a line now for count, line in enumerate(split_lines): page.append(line) From b8810abd4b251f2d3da73ce4fa4a79fe5949b11a Mon Sep 17 00:00:00 2001 From: Jonathan Corwin Date: Fri, 23 Oct 2009 21:22:16 +0100 Subject: [PATCH 04/17] Impress fixes --- .../presentations/lib/impresscontroller.py | 44 +++++++++++++------ 1 file changed, 30 insertions(+), 14 deletions(-) diff --git a/openlp/plugins/presentations/lib/impresscontroller.py b/openlp/plugins/presentations/lib/impresscontroller.py index 219e8cec1..a971f8342 100644 --- a/openlp/plugins/presentations/lib/impresscontroller.py +++ b/openlp/plugins/presentations/lib/impresscontroller.py @@ -28,6 +28,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA import logging import os +import time if os.name == u'nt': from win32com.client import Dispatch @@ -85,7 +86,7 @@ class ImpressController(PresentationController): self.manager._FlagAsMethod(u'Bridge_GetValueObject') else: # -headless - cmd = u'openoffice.org -nologo -norestore -minimized -invisible ' + u'"' + u'-accept=socket,host=localhost,port=2002;urp;'+ u'"' + cmd = u'openoffice.org -nologo -norestore -minimized -invisible -nofirststartwizard -accept="socket,host=localhost,port=2002;urp;"' self.process = QtCore.QProcess() self.process.startDetached(cmd) self.process.waitForStarted() @@ -96,6 +97,12 @@ class ImpressController(PresentationController): """ log.debug(u'Kill') self.close_presentation() + if os.name != u'nt': + desktop = self.get_uno_desktop() + try: + desktop.terminate() + except: + pass def load_presentation(self, presentation): """ @@ -121,18 +128,19 @@ class ImpressController(PresentationController): url = uno.systemPathToFileUrl(presentation) if desktop is None: return + self.desktop = desktop + properties = [] + properties.append(self.create_property(u'Minimized', True)) + properties = tuple(properties) try: - self.desktop = desktop - properties = [] - properties = tuple(properties) self.document = desktop.loadComponentFromURL(url, u'_blank', 0, properties) - self.presentation = self.document.getPresentation() - self.presentation.Display = self.plugin.render_manager.current_display + 1 - self.controller = None except: log.exception(u'Failed to load presentation') return + self.presentation = self.document.getPresentation() + self.presentation.Display = self.plugin.render_manager.current_display + 1 + self.controller = None self.create_thumbnails() def create_thumbnails(self): @@ -148,13 +156,7 @@ class ImpressController(PresentationController): else: thumbdir = uno.systemPathToFileUrl(self.thumbnailpath) props = [] - if os.name == u'nt': - prop = self.manager.Bridge_GetStruct(u'com.sun.star.beans.PropertyValue') - else: - prop = PropertyValue() - prop.Name = u'FilterName' - prop.Value = u'impress_png_Export' - props.append(prop) + props.append(self.create_property(u'FilterName', u'impress_png_Export')) props = tuple(props) doc = self.document pages = doc.getDrawPages() @@ -164,6 +166,15 @@ class ImpressController(PresentationController): doc.storeToURL(thumbdir + u'/' + self.thumbnailprefix + unicode(idx+1) + u'.png', props) + def create_property(self, name, value): + if os.name == u'nt': + prop = self.manager.Bridge_GetStruct(u'com.sun.star.beans.PropertyValue') + else: + prop = PropertyValue() + prop.Name = name + prop.Value = value + return prop + def get_uno_desktop(self): log.debug(u'getUNODesktop') ctx = None @@ -245,6 +256,11 @@ class ImpressController(PresentationController): def start_presentation(self): if self.controller is None or not self.controller.isRunning(): self.presentation.start() + # start() returns before the getCurrentComponent is ready. Try for 5 seconds + i = 1 + while self.desktop.getCurrentComponent() is None and i < 50: + time.sleep(0.1) + i = i + 1 self.controller = self.desktop.getCurrentComponent().Presentation.getController() else: self.controller.activate() From ee076e306e8fb6c0ecfc3cde6fbaddac247111a7 Mon Sep 17 00:00:00 2001 From: Jonathan Corwin Date: Fri, 23 Oct 2009 23:47:22 +0100 Subject: [PATCH 05/17] First stab at showing ppt output in mini-live-display --- openlp/core/ui/slidecontroller.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index 4f7163ba0..484243856 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -353,6 +353,7 @@ class SlideController(QtGui.QWidget): if self.commandItem is not None and \ self.commandItem.service_item_type == ServiceType.Command: Receiver().send_message(u'%s_first'% self.commandItem.name.lower()) + QtCore.QTimer.singleShot(0.5, self.grabMainDisplay) else: self.PreviewListWidget.selectRow(0) self.onSlideSelected() @@ -379,6 +380,7 @@ class SlideController(QtGui.QWidget): if row > -1 and row < self.PreviewListWidget.rowCount(): if self.commandItem.service_item_type == ServiceType.Command: Receiver().send_message(u'%s_slide'% self.commandItem.name.lower(), [row]) + QtCore.QTimer.singleShot(0.5, self.grabMainDisplay) else: #label = self.PreviewListWidget.cellWidget(row, 0) frame = self.serviceitem.frames[row][u'image'] @@ -389,6 +391,13 @@ class SlideController(QtGui.QWidget): log.info(u'Slide Rendering took %4s' % (time.time() - before)) if self.isLive: self.parent.mainDisplay.frameView(frame) + + def grabMainDisplay(self): + winid = QtGui.QApplication.desktop().winId() + rm = self.parent.RenderManager + rect = rm.screen_list[rm.current_display][u'size'] + winimg = QtGui.QPixmap.grabWindow(winid, rect.x(), rect.y(), rect.width(), rect.height()) + self.SlidePreview.setPixmap(winimg) def onSlideSelectedNext(self): """ @@ -397,6 +406,7 @@ class SlideController(QtGui.QWidget): if self.commandItem is not None and \ self.commandItem.service_item_type == ServiceType.Command: Receiver().send_message(u'%s_next'% self.commandItem.name.lower()) + QtCore.QTimer.singleShot(0.5, self.grabMainDisplay) else: row = self.PreviewListWidget.currentRow() + 1 if row == self.PreviewListWidget.rowCount(): @@ -412,6 +422,7 @@ class SlideController(QtGui.QWidget): self.commandItem.service_item_type == ServiceType.Command: Receiver().send_message( u'%s_previous'% self.commandItem.name.lower()) + QtCore.QTimer.singleShot(0.5, self.grabMainDisplay) else: row = self.PreviewListWidget.currentRow() - 1 if row == -1: @@ -426,6 +437,7 @@ class SlideController(QtGui.QWidget): if self.commandItem is not None and \ self.commandItem.service_item_type == ServiceType.Command: Receiver().send_message(u'%s_last'% self.commandItem.name.lower()) + QtCore.QTimer.singleShot(0.5, self.grabMainDisplay) else: self.PreviewListWidget.selectRow(self.PreviewListWidget.rowCount() - 1) self.onSlideSelected() From 21882cd15dbecbb6ced565c969a5a858ab132bc2 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Sat, 24 Oct 2009 00:42:53 +0100 Subject: [PATCH 06/17] Stray config item under image instead of images --- openlp/plugins/images/lib/imagetab.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openlp/plugins/images/lib/imagetab.py b/openlp/plugins/images/lib/imagetab.py index 5c00d826d..706a521c3 100644 --- a/openlp/plugins/images/lib/imagetab.py +++ b/openlp/plugins/images/lib/imagetab.py @@ -31,7 +31,7 @@ class ImageTab(SettingsTab): ImageTab is the Image settings tab in the settings dialog. """ def __init__(self): - SettingsTab.__init__(self, translate(u'ImageTab', u'Images'), u'Image') + SettingsTab.__init__(self, translate(u'ImageTab', u'Images'), u'Images') def setupUi(self): self.setObjectName(u'ImageTab') From cdf4e46b07f719af49190c5c3a6e3f297590a3da Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sat, 24 Oct 2009 06:58:49 +0100 Subject: [PATCH 07/17] Fix abbriviations for searchs --- openlp/plugins/bibles/lib/bibleDBimpl.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/openlp/plugins/bibles/lib/bibleDBimpl.py b/openlp/plugins/bibles/lib/bibleDBimpl.py index eac7ccd79..756828197 100644 --- a/openlp/plugins/bibles/lib/bibleDBimpl.py +++ b/openlp/plugins/bibles/lib/bibleDBimpl.py @@ -158,6 +158,11 @@ class BibleDBImpl(BibleCommon): def get_bible_text(self, bookname, chapter, sverse, everse): log.debug(u'get_bible_text %s, %s, %s, %s', bookname, chapter, sverse, everse) + #Look up book name or abbreviation + book = self.get_bible_book(bookname) + if book is not None: + bookname = book.name + log.debug(u'bookname corrected to %s' % bookname) verses = self.session.query(Verse).join(Book).filter( Book.name == bookname).filter(Verse.chapter == chapter).filter( Verse.verse>=sverse).filter(Verse.verse<=everse).order_by( From 2c1c202e5bfc94fa068510a10e494381f341bf38 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sat, 24 Oct 2009 08:22:44 +0100 Subject: [PATCH 08/17] Fixed edit theme to preview render bug --- openlp/core/lib/rendermanager.py | 3 ++- openlp/core/ui/thememanager.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/openlp/core/lib/rendermanager.py b/openlp/core/lib/rendermanager.py index ce43ad9c9..50abcfd07 100644 --- a/openlp/core/lib/rendermanager.py +++ b/openlp/core/lib/rendermanager.py @@ -65,6 +65,7 @@ class RenderManager(object): self.service_theme = u'' self.global_style = u'' self.override_background = None + self.themedata = None self.save_bg_frame = None self.override_background_changed = False @@ -130,7 +131,7 @@ class RenderManager(object): self.theme = self.service_theme else: self.theme = self.global_theme - if self.theme != self.renderer.theme_name: + if self.theme != self.renderer.theme_name or self.themedata is None: log.debug(u'theme is now %s', self.theme) self.themedata = self.theme_manager.getThemeData(self.theme) self.calculate_default( diff --git a/openlp/core/ui/thememanager.py b/openlp/core/ui/thememanager.py index 84f88c726..14da059e0 100644 --- a/openlp/core/ui/thememanager.py +++ b/openlp/core/ui/thememanager.py @@ -386,7 +386,7 @@ class ThemeManager(QtGui.QWidget): newtheme.add_font(unicode(theme.FontName), unicode(theme.FontColor.name()), - unicode(theme.FontProportion * 2), u'False') + unicode(theme.FontProportion * 3), u'False') newtheme.add_font(unicode(theme.FontName), unicode(theme.FontColor.name()), unicode(12), u'False', u'footer') From 4f211d24e0d1507d2413de7fb046accd5b14393b Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sat, 24 Oct 2009 11:04:35 +0100 Subject: [PATCH 09/17] Fix theme editor --- openlp/core/ui/amendthemeform.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openlp/core/ui/amendthemeform.py b/openlp/core/ui/amendthemeform.py index 5b5e67225..c3ec0f850 100644 --- a/openlp/core/ui/amendthemeform.py +++ b/openlp/core/ui/amendthemeform.py @@ -678,6 +678,6 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog): log.debug(u'Page Length area height %s , metrics %s , lines %s' % (int(self.FontMainHeightSpinBox.value()), metrics.height(), page_length )) self.FontMainLinesPageLabel.setText( - self.trUtf8(u'Slide Height is %s rows') % page_length) + self.trUtf8((u'Slide Height is %s rows') % page_length)) frame = self.thememanager.generateImage(theme) self.ThemePreview.setPixmap(QtGui.QPixmap.fromImage(frame)) From 23fd584f6351b42605723a323a7136fbd2047024 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sat, 24 Oct 2009 14:07:41 +0100 Subject: [PATCH 10/17] Add Preview Song Editing --- openlp/core/lib/mediamanageritem.py | 1 - openlp/core/ui/slidecontroller.py | 23 ++++++++++++++++++---- openlp/plugins/songs/forms/editsongform.py | 1 + openlp/plugins/songs/lib/mediaitem.py | 16 ++++++++++++++- 4 files changed, 35 insertions(+), 6 deletions(-) diff --git a/openlp/core/lib/mediamanageritem.py b/openlp/core/lib/mediamanageritem.py index 81d526d33..755f3581c 100644 --- a/openlp/core/lib/mediamanageritem.py +++ b/openlp/core/lib/mediamanageritem.py @@ -118,7 +118,6 @@ class MediaManagerItem(QtGui.QWidget): self.requiredIcons() self.setupUi() self.retranslateUi() - #self.initialise() def requiredIcons(self): """ diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index 0c3d737ad..d3e55d36d 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -89,9 +89,12 @@ class SlideController(QtGui.QWidget): self.image_list = [ self.trUtf8(u'Start Loop'), self.trUtf8(u'Stop Loop'), - #self.trUtf8(u'Loop Separator'), + u'Loop Separator', self.trUtf8(u'Image SpinBox') ] + self.song_list = [ + self.trUtf8(u'Edit Song'), + ] self.timer_id = 0 self.commandItem = None self.Panel = QtGui.QWidget(parent.ControlSplitter) @@ -161,6 +164,10 @@ class SlideController(QtGui.QWidget): self.Toolbar.addToolbarButton( self.trUtf8(u'Go Live'), u':/system/system_live.png', self.trUtf8(u'Move to live'), self.onGoLive) + self.Toolbar.addToolbarSeparator(u'Close Separator') + self.Toolbar.addToolbarButton( + self.trUtf8(u'Edit Song'), u':songs/song_edit.png', + self.trUtf8(u'Edit and re-preview Song'), self.onEditSong) if isLive: self.Toolbar.addToolbarSeparator(u'Loop Separator') self.Toolbar.addToolbarButton( @@ -216,6 +223,8 @@ class SlideController(QtGui.QWidget): Receiver().send_message(u'request_spin_delay') if isLive: self.Toolbar.makeWidgetsInvisible(self.image_list) + else: + self.Toolbar.makeWidgetsInvisible(self.song_list) QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'slidecontroller_first'), self.onSlideSelectedFirst) QtCore.QObject.connect(Receiver.get_receiver(), @@ -255,7 +264,10 @@ class SlideController(QtGui.QWidget): """ Allows the Preview toolbar to be customised """ - pass + if item.name == u'Songs': + self.Toolbar.makeWidgetsVisible(self.song_list) + else: + self.Toolbar.makeWidgetsInvisible(self.song_list) def addServiceItem(self, item): """ @@ -389,13 +401,13 @@ class SlideController(QtGui.QWidget): log.info(u'Slide Rendering took %4s' % (time.time() - before)) if self.isLive: self.parent.mainDisplay.frameView(frame) - + def grabMainDisplay(self): winid = QtGui.QApplication.desktop().winId() rm = self.parent.RenderManager rect = rm.screen_list[rm.current_display][u'size'] winimg = QtGui.QPixmap.grabWindow(winid, rect.x(), rect.y(), rect.width(), rect.height()) - self.SlidePreview.setPixmap(winimg) + self.SlidePreview.setPixmap(winimg) def onSlideSelectedNext(self): """ @@ -461,6 +473,9 @@ class SlideController(QtGui.QWidget): if event.timerId() == self.timer_id: self.onSlideSelectedNext() + def onEditSong(self): + Receiver().send_message(u'edit_song') + def onGoLive(self): """ If preview copy slide item to live diff --git a/openlp/plugins/songs/forms/editsongform.py b/openlp/plugins/songs/forms/editsongform.py index c1f675f56..e46d2dfa2 100644 --- a/openlp/plugins/songs/forms/editsongform.py +++ b/openlp/plugins/songs/forms/editsongform.py @@ -410,6 +410,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): self.songmanager.save_song(self.song) if self.title_change: Receiver().send_message(u'load_song_list') + Receiver().send_message(u'preview_song') self.close() def processLyrics(self): diff --git a/openlp/plugins/songs/lib/mediaitem.py b/openlp/plugins/songs/lib/mediaitem.py index 6718ef581..23f0ca752 100644 --- a/openlp/plugins/songs/lib/mediaitem.py +++ b/openlp/plugins/songs/lib/mediaitem.py @@ -55,6 +55,7 @@ class SongMediaItem(MediaManagerItem): self.edit_song_form = EditSongForm(self.parent.songmanager, self) self.song_maintenance_form = SongMaintenanceForm( self.parent.songmanager, self) + self.fromPreview = None def requiredIcons(self): MediaManagerItem.requiredIcons(self) @@ -121,6 +122,10 @@ class SongMediaItem(MediaManagerItem): QtCore.SIGNAL(u'load_song_list'), self.onSearchTextButtonClick) QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'config_updated'), self.configUpdated) + QtCore.QObject.connect(Receiver.get_receiver(), + QtCore.SIGNAL(u'edit_song'), self.onEventEditSong) + QtCore.QObject.connect(Receiver.get_receiver(), + QtCore.SIGNAL(u'proview_song'), self.onPreviewClick) def configUpdated(self): self.searchAsYouType = str_to_bool( @@ -173,6 +178,10 @@ class SongMediaItem(MediaManagerItem): song_name = QtGui.QListWidgetItem(song_detail) song_name.setData(QtCore.Qt.UserRole, QtCore.QVariant(song.id)) self.ListView.addItem(song_name) + if song.id == self.fromPreview: + self.fromPreview = 0 + self.ListView.setCurrentItem(song_name) + self.onPreviewClick() def displayResultsAuthor(self, searchresults): log.debug(u'display results Author') @@ -218,13 +227,18 @@ class SongMediaItem(MediaManagerItem): def onSongMaintenanceClick(self): self.song_maintenance_form.exec_() - def onEditClick(self): + def onEditClick(self, preview=False): item = self.ListView.currentItem() if item is not None: item_id = (item.data(QtCore.Qt.UserRole)).toInt()[0] + if preview: + self.fromPreview = item_id self.edit_song_form.loadSong(item_id) self.edit_song_form.exec_() + def onEventEditSong (self): + self.onEditClick(True) + def onDeleteClick(self): item = self.ListView.currentItem() if item is not None: From 6d5505dbc6c88e13f327e54aa67976c0e7539c07 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sat, 24 Oct 2009 16:54:07 +0100 Subject: [PATCH 11/17] Fix Song editing --- openlp/plugins/songs/lib/mediaitem.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/openlp/plugins/songs/lib/mediaitem.py b/openlp/plugins/songs/lib/mediaitem.py index 23f0ca752..7a72be2a1 100644 --- a/openlp/plugins/songs/lib/mediaitem.py +++ b/openlp/plugins/songs/lib/mediaitem.py @@ -173,8 +173,8 @@ class SongMediaItem(MediaManagerItem): if author_list != u'': author_list = author_list + u', ' author_list = author_list + author.display_name - song_detail = unicode(u'%s (%s)' % \ - (unicode(song.title), unicode(author_list))) + song_detail = unicode(self.trUtf8(u'%s (%s)' % \ + (unicode(song.title), unicode(author_list)))) song_name = QtGui.QListWidgetItem(song_detail) song_name.setData(QtCore.Qt.UserRole, QtCore.QVariant(song.id)) self.ListView.addItem(song_name) @@ -188,8 +188,8 @@ class SongMediaItem(MediaManagerItem): self.ListView.clear() for author in searchresults: for song in author.songs: - song_detail = unicode(u'%s (%s)' % \ - (unicode(author.display_name), unicode(song.title))) + song_detail = unicode(self.trUtf8(u'%s (%s)' % \ + (unicode(author.display_name), unicode(song.title)))) song_name = QtGui.QListWidgetItem(song_detail) song_name.setData(QtCore.Qt.UserRole, QtCore.QVariant(song.id)) self.ListView.addItem(song_name) @@ -231,6 +231,7 @@ class SongMediaItem(MediaManagerItem): item = self.ListView.currentItem() if item is not None: item_id = (item.data(QtCore.Qt.UserRole)).toInt()[0] + self.fromPreview = 0 if preview: self.fromPreview = item_id self.edit_song_form.loadSong(item_id) From abd66af1c4bc0c3e930267dbf8d073c95096d6bd Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sat, 24 Oct 2009 17:00:43 +0100 Subject: [PATCH 12/17] Fix extra utf8 strings --- openlp/core/ui/slidecontroller.py | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index d3e55d36d..913d60bfe 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -87,13 +87,13 @@ class SlideController(QtGui.QWidget): self.isLive = isLive self.parent = parent self.image_list = [ - self.trUtf8(u'Start Loop'), - self.trUtf8(u'Stop Loop'), + u'Start Loop', + u'Stop Loop', u'Loop Separator', - self.trUtf8(u'Image SpinBox') + u'Image SpinBox' ] self.song_list = [ - self.trUtf8(u'Edit Song'), + u'Edit Song', ] self.timer_id = 0 self.commandItem = None @@ -143,17 +143,17 @@ class SlideController(QtGui.QWidget): self.Toolbar.setSizePolicy(sizeToolbarPolicy) if self.isLive: self.Toolbar.addToolbarButton( - self.trUtf8(u'First Slide'), u':/slides/slide_first.png', + u'First Slide', u':/slides/slide_first.png', self.trUtf8(u'Move to first'), self.onSlideSelectedFirst) self.Toolbar.addToolbarButton( - self.trUtf8(u'Previous Slide'), u':/slides/slide_previous.png', + u'Previous Slide', u':/slides/slide_previous.png', self.trUtf8(u'Move to previous'), self.onSlideSelectedPrevious) self.Toolbar.addToolbarButton( - self.trUtf8(u'Next Slide'), u':/slides/slide_next.png', + u'Next Slide', u':/slides/slide_next.png', self.trUtf8(u'Move to next'), self.onSlideSelectedNext) if self.isLive: self.Toolbar.addToolbarButton( - self.trUtf8(u'Last Slide'), u':/slides/slide_last.png', + u'Last Slide', u':/slides/slide_last.png', self.trUtf8(u'Move to last'), self.onSlideSelectedLast) if self.isLive: self.Toolbar.addToolbarSeparator(u'Close Separator') @@ -162,23 +162,23 @@ class SlideController(QtGui.QWidget): if not self.isLive: self.Toolbar.addToolbarSeparator(u'Close Separator') self.Toolbar.addToolbarButton( - self.trUtf8(u'Go Live'), u':/system/system_live.png', + u'Go Live', u':/system/system_live.png', self.trUtf8(u'Move to live'), self.onGoLive) self.Toolbar.addToolbarSeparator(u'Close Separator') self.Toolbar.addToolbarButton( - self.trUtf8(u'Edit Song'), u':songs/song_edit.png', + u'Edit Song', u':songs/song_edit.png', self.trUtf8(u'Edit and re-preview Song'), self.onEditSong) if isLive: self.Toolbar.addToolbarSeparator(u'Loop Separator') self.Toolbar.addToolbarButton( - self.trUtf8(u'Start Loop'), u':/media/media_time.png', + u'Start Loop', u':/media/media_time.png', self.trUtf8(u'Start continuous loop'), self.onStartLoop) self.Toolbar.addToolbarButton( - self.trUtf8(u'Stop Loop'), u':/media/media_stop.png', + u'Stop Loop', u':/media/media_stop.png', self.trUtf8(u'Stop continuous loop'), self.onStopLoop) self.DelaySpinBox = QtGui.QSpinBox() self.Toolbar.addToolbarWidget( - self.trUtf8(u'Image SpinBox'), self.DelaySpinBox) + u'Image SpinBox', self.DelaySpinBox) self.DelaySpinBox.setSuffix(self.trUtf8(u's')) self.ControllerLayout.addWidget(self.Toolbar) From aeb75d2056f1c4a5ffc96a03587a34fb9ad0cc2a Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Sat, 24 Oct 2009 17:40:36 +0100 Subject: [PATCH 13/17] Fix imports and typo --- openlp-get-strings.py | 1 - openlp/core/lib/mediamanageritem.py | 4 ++-- openlp/core/ui/about.py | 2 +- openlp/core/ui/alertform.py | 2 +- openlp/core/ui/alertstab.py | 2 +- openlp/core/ui/amendthemedialog.py | 2 +- openlp/core/ui/amendthemeform.py | 2 +- openlp/core/ui/generaltab.py | 2 +- openlp/core/ui/mainwindow.py | 5 ++--- openlp/core/ui/plugindialog.py | 1 - openlp/core/ui/servicemanager.py | 2 +- openlp/core/ui/settingsdialog.py | 1 - openlp/core/ui/slidecontroller.py | 2 +- openlp/core/ui/splashscreen.py | 2 +- openlp/core/ui/thememanager.py | 2 +- openlp/core/ui/themestab.py | 2 +- openlp/plugins/audit/auditplugin.py | 2 +- openlp/plugins/audit/forms/auditdeleteform.py | 2 -- openlp/plugins/bibles/bibleplugin.py | 2 +- openlp/plugins/bibles/forms/bibleimportform.py | 3 +-- openlp/plugins/bibles/lib/bibleOSISimpl.py | 2 +- openlp/plugins/bibles/lib/biblestab.py | 2 +- openlp/plugins/bibles/lib/manager.py | 2 -- openlp/plugins/bibles/lib/mediaitem.py | 4 ++-- openlp/plugins/custom/forms/editcustomdialog.py | 2 +- openlp/plugins/custom/forms/editcustomform.py | 2 +- openlp/plugins/images/lib/imagetab.py | 2 +- openlp/plugins/images/lib/mediaitem.py | 2 +- openlp/plugins/media/lib/mediatab.py | 2 +- openlp/plugins/presentations/lib/mediaitem.py | 2 +- openlp/plugins/presentations/lib/presentationtab.py | 2 +- openlp/plugins/remotes/lib/remotetab.py | 2 +- openlp/plugins/songs/forms/authorsdialog.py | 1 - openlp/plugins/songs/forms/authorsform.py | 2 +- openlp/plugins/songs/forms/editsongdialog.py | 2 +- openlp/plugins/songs/forms/editsongform.py | 2 +- openlp/plugins/songs/forms/editversedialog.py | 1 - openlp/plugins/songs/forms/openlpexportform.py | 3 ++- openlp/plugins/songs/forms/openlpimportform.py | 3 +-- openlp/plugins/songs/forms/opensongexportform.py | 2 +- openlp/plugins/songs/forms/opensongimportform.py | 2 +- openlp/plugins/songs/forms/songbookdialog.py | 1 - openlp/plugins/songs/forms/songbookform.py | 1 - openlp/plugins/songs/forms/songmaintenancedialog.py | 2 +- openlp/plugins/songs/forms/songmaintenanceform.py | 2 +- openlp/plugins/songs/forms/topicsdialog.py | 1 - openlp/plugins/songs/forms/topicsform.py | 1 - openlp/plugins/songs/lib/mediaitem.py | 2 +- openlp/plugins/songs/lib/songstab.py | 2 +- openlp/plugins/songs/songsplugin.py | 2 +- 50 files changed, 43 insertions(+), 58 deletions(-) diff --git a/openlp-get-strings.py b/openlp-get-strings.py index 0d4e3200a..2af5e476b 100644 --- a/openlp-get-strings.py +++ b/openlp-get-strings.py @@ -24,7 +24,6 @@ ############################################################################### import os -import sys import re ts_file = u""" diff --git a/openlp/core/lib/mediamanageritem.py b/openlp/core/lib/mediamanageritem.py index 755f3581c..016bb5259 100644 --- a/openlp/core/lib/mediamanageritem.py +++ b/openlp/core/lib/mediamanageritem.py @@ -28,7 +28,7 @@ import os from PyQt4 import QtCore, QtGui from openlp.core.lib.toolbar import * -from openlp.core.lib import translate, contextMenuAction, contextMenuSeparator +from openlp.core.lib import contextMenuAction, contextMenuSeparator from serviceitem import ServiceItem class MediaManagerItem(QtGui.QWidget): @@ -36,7 +36,7 @@ class MediaManagerItem(QtGui.QWidget): MediaManagerItem is a helper widget for plugins. None of the following *need* to be used, feel free to override - them cmopletely in your plugin's implementation. Alternatively, + them completely in your plugin's implementation. Alternatively, call them from your plugin before or after you've done extra things that you need to. diff --git a/openlp/core/ui/about.py b/openlp/core/ui/about.py index 1ab2dc430..c1c9006c2 100644 --- a/openlp/core/ui/about.py +++ b/openlp/core/ui/about.py @@ -24,7 +24,7 @@ from PyQt4 import QtCore, QtGui -from openlp.core.lib import translate, buildIcon +from openlp.core.lib import buildIcon class AboutForm(QtGui.QDialog): """ diff --git a/openlp/core/ui/alertform.py b/openlp/core/ui/alertform.py index e6c2cacbc..9c069bd1c 100644 --- a/openlp/core/ui/alertform.py +++ b/openlp/core/ui/alertform.py @@ -24,7 +24,7 @@ import logging from PyQt4 import QtCore, QtGui -from openlp.core.lib import translate, buildIcon +from openlp.core.lib import buildIcon class AlertForm(QtGui.QDialog): global log diff --git a/openlp/core/ui/alertstab.py b/openlp/core/ui/alertstab.py index 206826a09..e7ce0a013 100644 --- a/openlp/core/ui/alertstab.py +++ b/openlp/core/ui/alertstab.py @@ -24,7 +24,7 @@ from PyQt4 import QtCore, QtGui -from openlp.core.lib import SettingsTab, translate +from openlp.core.lib import SettingsTab class AlertsTab(SettingsTab): """ diff --git a/openlp/core/ui/amendthemedialog.py b/openlp/core/ui/amendthemedialog.py index d5b0d0661..1a59e4fc3 100644 --- a/openlp/core/ui/amendthemedialog.py +++ b/openlp/core/ui/amendthemedialog.py @@ -23,7 +23,7 @@ ############################################################################### from PyQt4 import QtCore, QtGui -from openlp.core.lib import translate, buildIcon +from openlp.core.lib import buildIcon class Ui_AmendThemeDialog(object): def setupUi(self, AmendThemeDialog): diff --git a/openlp/core/ui/amendthemeform.py b/openlp/core/ui/amendthemeform.py index c3ec0f850..3a30a0d18 100644 --- a/openlp/core/ui/amendthemeform.py +++ b/openlp/core/ui/amendthemeform.py @@ -28,7 +28,7 @@ import os.path from PyQt4 import QtCore, QtGui -from openlp.core.lib import ThemeXML, file_to_xml, translate +from openlp.core.lib import ThemeXML, file_to_xml from amendthemedialog import Ui_AmendThemeDialog log = logging.getLogger(u'AmendThemeForm') diff --git a/openlp/core/ui/generaltab.py b/openlp/core/ui/generaltab.py index 6cc5feed7..98479af3e 100644 --- a/openlp/core/ui/generaltab.py +++ b/openlp/core/ui/generaltab.py @@ -24,7 +24,7 @@ from PyQt4 import QtCore, QtGui -from openlp.core.lib import SettingsTab, translate, str_to_bool +from openlp.core.lib import SettingsTab, str_to_bool class GeneralTab(SettingsTab): """ diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index c768210a0..2f58ee3c1 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -30,9 +30,8 @@ from PyQt4 import QtCore, QtGui from openlp.core.ui import AboutForm, SettingsForm, AlertForm, \ ServiceManager, ThemeManager, MainDisplay, SlideController, \ PluginForm, MediaDockManager -from openlp.core.lib import translate, RenderManager, PluginConfig, \ - OpenLPDockWidget, SettingsManager, PluginManager, Receiver, \ - buildIcon, str_to_bool +from openlp.core.lib import RenderManager, PluginConfig, buildIcon, \ + OpenLPDockWidget, SettingsManager, PluginManager, Receiver, str_to_bool from openlp.core.utils import check_latest_version media_manager_style = """ diff --git a/openlp/core/ui/plugindialog.py b/openlp/core/ui/plugindialog.py index 5d9ca5ef2..f733b8e2f 100644 --- a/openlp/core/ui/plugindialog.py +++ b/openlp/core/ui/plugindialog.py @@ -23,7 +23,6 @@ ############################################################################### from PyQt4 import QtCore, QtGui -from openlp.core.lib import translate class Ui_PluginViewDialog(object): def setupUi(self, PluginViewDialog): diff --git a/openlp/core/ui/servicemanager.py b/openlp/core/ui/servicemanager.py index 4355667af..3964b9c60 100644 --- a/openlp/core/ui/servicemanager.py +++ b/openlp/core/ui/servicemanager.py @@ -30,7 +30,7 @@ import zipfile from PyQt4 import QtCore, QtGui from openlp.core.lib import PluginConfig, OpenLPToolbar, ServiceItem, \ - translate, ServiceType, contextMenuAction, contextMenuSeparator, Receiver + ServiceType, contextMenuAction, contextMenuSeparator, Receiver class ServiceManagerList(QtGui.QTreeWidget): diff --git a/openlp/core/ui/settingsdialog.py b/openlp/core/ui/settingsdialog.py index a11c87fee..a936f9f2f 100644 --- a/openlp/core/ui/settingsdialog.py +++ b/openlp/core/ui/settingsdialog.py @@ -23,7 +23,6 @@ ############################################################################### from PyQt4 import QtCore, QtGui -from openlp.core.lib import translate class Ui_SettingsDialog(object): def setupUi(self, SettingsDialog): diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index 913d60bfe..02e0dc80d 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -26,7 +26,7 @@ import logging import time from PyQt4 import QtCore, QtGui -from openlp.core.lib import OpenLPToolbar, translate, Receiver, ServiceType +from openlp.core.lib import OpenLPToolbar, Receiver, ServiceType label_stylesheet = u""" QTableWidget::item:selected diff --git a/openlp/core/ui/splashscreen.py b/openlp/core/ui/splashscreen.py index 2624f66c4..3990a8f5c 100644 --- a/openlp/core/ui/splashscreen.py +++ b/openlp/core/ui/splashscreen.py @@ -23,7 +23,7 @@ ############################################################################### from PyQt4 import QtCore, QtGui -from openlp.core.lib import translate, buildIcon +from openlp.core.lib import buildIcon class SplashScreen(object): def __init__(self, version): diff --git a/openlp/core/ui/thememanager.py b/openlp/core/ui/thememanager.py index c4d829a73..7b34874b3 100644 --- a/openlp/core/ui/thememanager.py +++ b/openlp/core/ui/thememanager.py @@ -32,7 +32,7 @@ from PyQt4 import QtCore, QtGui from openlp.core.ui import AmendThemeForm from openlp.core.theme import Theme -from openlp.core.lib import PluginConfig, OpenLPToolbar, ThemeXML, translate, \ +from openlp.core.lib import PluginConfig, OpenLPToolbar, ThemeXML, \ str_to_bool, file_to_xml, buildIcon, Receiver, contextMenuAction, \ contextMenuSeparator from openlp.core.utils import ConfigHelper diff --git a/openlp/core/ui/themestab.py b/openlp/core/ui/themestab.py index 644238351..f50e6d227 100644 --- a/openlp/core/ui/themestab.py +++ b/openlp/core/ui/themestab.py @@ -24,7 +24,7 @@ from PyQt4 import QtCore, QtGui -from openlp.core.lib import SettingsTab, translate, Receiver +from openlp.core.lib import SettingsTab, Receiver class ThemesTab(SettingsTab): """ diff --git a/openlp/plugins/audit/auditplugin.py b/openlp/plugins/audit/auditplugin.py index f4392649b..e2c3230ec 100644 --- a/openlp/plugins/audit/auditplugin.py +++ b/openlp/plugins/audit/auditplugin.py @@ -27,7 +27,7 @@ import logging from PyQt4 import QtCore, QtGui -from openlp.core.lib import Plugin, Receiver, translate, str_to_bool, buildIcon +from openlp.core.lib import Plugin, Receiver, str_to_bool, buildIcon from openlp.plugins.audit.lib import AuditManager from openlp.plugins.audit.forms import AuditDetailForm, AuditDeleteForm from openlp.plugins.audit.lib.models import AuditItem diff --git a/openlp/plugins/audit/forms/auditdeleteform.py b/openlp/plugins/audit/forms/auditdeleteform.py index bd1dbd4a6..d2e647a44 100644 --- a/openlp/plugins/audit/forms/auditdeleteform.py +++ b/openlp/plugins/audit/forms/auditdeleteform.py @@ -27,8 +27,6 @@ from datetime import date from PyQt4 import QtGui from auditdeletedialog import Ui_AuditDeleteDialog -from openlp.core.lib import translate -#from openlp.plugins.audit.lib import AuditManager class AuditDeleteForm(QtGui.QDialog, Ui_AuditDeleteDialog): """ diff --git a/openlp/plugins/bibles/bibleplugin.py b/openlp/plugins/bibles/bibleplugin.py index 5ebebe027..eb1018bf2 100644 --- a/openlp/plugins/bibles/bibleplugin.py +++ b/openlp/plugins/bibles/bibleplugin.py @@ -26,7 +26,7 @@ import logging from PyQt4 import QtCore, QtGui -from openlp.core.lib import Plugin, translate, buildIcon +from openlp.core.lib import Plugin, buildIcon from openlp.plugins.bibles.lib import BibleManager, BiblesTab, BibleMediaItem class BiblePlugin(Plugin): diff --git a/openlp/plugins/bibles/forms/bibleimportform.py b/openlp/plugins/bibles/forms/bibleimportform.py index fa4cdcd42..9a871ec88 100644 --- a/openlp/plugins/bibles/forms/bibleimportform.py +++ b/openlp/plugins/bibles/forms/bibleimportform.py @@ -29,8 +29,7 @@ import os.path from PyQt4 import QtCore, QtGui from bibleimportdialog import Ui_BibleImportDialog -from openlp.core.lib import Receiver, translate - +from openlp.core.lib import Receiver class BibleImportForm(QtGui.QDialog, Ui_BibleImportDialog): global log diff --git a/openlp/plugins/bibles/lib/bibleOSISimpl.py b/openlp/plugins/bibles/lib/bibleOSISimpl.py index 09ada1fa4..cdcea869b 100644 --- a/openlp/plugins/bibles/lib/bibleOSISimpl.py +++ b/openlp/plugins/bibles/lib/bibleOSISimpl.py @@ -30,7 +30,7 @@ import codecs from PyQt4 import QtCore -from openlp.core.lib import translate, Receiver +from openlp.core.lib import Receiver class BibleOSISImpl(): """ diff --git a/openlp/plugins/bibles/lib/biblestab.py b/openlp/plugins/bibles/lib/biblestab.py index 31d3135cb..bf08acbec 100644 --- a/openlp/plugins/bibles/lib/biblestab.py +++ b/openlp/plugins/bibles/lib/biblestab.py @@ -26,7 +26,7 @@ import logging from PyQt4 import QtCore, QtGui -from openlp.core.lib import translate, str_to_bool, Receiver +from openlp.core.lib import str_to_bool, Receiver from openlp.core.lib import SettingsTab class BiblesTab(SettingsTab): diff --git a/openlp/plugins/bibles/lib/manager.py b/openlp/plugins/bibles/lib/manager.py index 7a8b7eb38..a259af0c2 100644 --- a/openlp/plugins/bibles/lib/manager.py +++ b/openlp/plugins/bibles/lib/manager.py @@ -25,8 +25,6 @@ import logging import os -from openlp.core.lib import translate - from bibleOSISimpl import BibleOSISImpl from bibleCSVimpl import BibleCSVImpl from bibleDBimpl import BibleDBImpl diff --git a/openlp/plugins/bibles/lib/mediaitem.py b/openlp/plugins/bibles/lib/mediaitem.py index 3d024a90b..f78c20ca5 100644 --- a/openlp/plugins/bibles/lib/mediaitem.py +++ b/openlp/plugins/bibles/lib/mediaitem.py @@ -27,8 +27,8 @@ import time from PyQt4 import QtCore, QtGui -from openlp.core.lib import translate, MediaManagerItem, Receiver, \ - BaseListWithDnD, str_to_bool +from openlp.core.lib import MediaManagerItem, Receiver, str_to_bool, \ + BaseListWithDnD from openlp.plugins.bibles.forms import BibleImportForm from openlp.plugins.bibles.lib.manager import BibleMode diff --git a/openlp/plugins/custom/forms/editcustomdialog.py b/openlp/plugins/custom/forms/editcustomdialog.py index 6d4464525..528f2d154 100644 --- a/openlp/plugins/custom/forms/editcustomdialog.py +++ b/openlp/plugins/custom/forms/editcustomdialog.py @@ -22,7 +22,7 @@ ############################################################################### from PyQt4 import QtCore, QtGui -from openlp.core.lib import translate, buildIcon +from openlp.core.lib import buildIcon class Ui_customEditDialog(object): def setupUi(self, customEditDialog): diff --git a/openlp/plugins/custom/forms/editcustomform.py b/openlp/plugins/custom/forms/editcustomform.py index 90868d928..01afe1b48 100644 --- a/openlp/plugins/custom/forms/editcustomform.py +++ b/openlp/plugins/custom/forms/editcustomform.py @@ -25,7 +25,7 @@ from PyQt4 import QtCore, QtGui from editcustomdialog import Ui_customEditDialog -from openlp.core.lib import SongXMLBuilder, SongXMLParser, Receiver, translate +from openlp.core.lib import SongXMLBuilder, SongXMLParser, Receiver from openlp.plugins.custom.lib.models import CustomSlide class EditCustomForm(QtGui.QDialog, Ui_customEditDialog): diff --git a/openlp/plugins/images/lib/imagetab.py b/openlp/plugins/images/lib/imagetab.py index 937242b72..f5472b02c 100644 --- a/openlp/plugins/images/lib/imagetab.py +++ b/openlp/plugins/images/lib/imagetab.py @@ -24,7 +24,7 @@ from PyQt4 import QtCore, QtGui -from openlp.core.lib import SettingsTab, translate, Receiver +from openlp.core.lib import SettingsTab, Receiver class ImageTab(SettingsTab): """ diff --git a/openlp/plugins/images/lib/mediaitem.py b/openlp/plugins/images/lib/mediaitem.py index 5720a5209..fb947cc0d 100644 --- a/openlp/plugins/images/lib/mediaitem.py +++ b/openlp/plugins/images/lib/mediaitem.py @@ -26,7 +26,7 @@ import logging import os from PyQt4 import QtCore, QtGui -from openlp.core.lib import MediaManagerItem, BaseListWithDnD, buildIcon, translate +from openlp.core.lib import MediaManagerItem, BaseListWithDnD, buildIcon # We have to explicitly create separate classes for each plugin # in order for DnD to the Service manager to work correctly. diff --git a/openlp/plugins/media/lib/mediatab.py b/openlp/plugins/media/lib/mediatab.py index 0c13c4593..69440faa8 100644 --- a/openlp/plugins/media/lib/mediatab.py +++ b/openlp/plugins/media/lib/mediatab.py @@ -24,7 +24,7 @@ from PyQt4 import QtCore, QtGui -from openlp.core.lib import SettingsTab, str_to_bool, translate +from openlp.core.lib import SettingsTab, str_to_bool class MediaTab(SettingsTab): """ diff --git a/openlp/plugins/presentations/lib/mediaitem.py b/openlp/plugins/presentations/lib/mediaitem.py index f5150827a..abbf83ac2 100644 --- a/openlp/plugins/presentations/lib/mediaitem.py +++ b/openlp/plugins/presentations/lib/mediaitem.py @@ -27,7 +27,7 @@ import os from PyQt4 import QtCore, QtGui -from openlp.core.lib import MediaManagerItem, translate, BaseListWithDnD +from openlp.core.lib import MediaManagerItem, BaseListWithDnD from openlp.plugins.presentations.lib import MessageListener # We have to explicitly create separate classes for each plugin diff --git a/openlp/plugins/presentations/lib/presentationtab.py b/openlp/plugins/presentations/lib/presentationtab.py index 33eb78eb9..410e3cde9 100644 --- a/openlp/plugins/presentations/lib/presentationtab.py +++ b/openlp/plugins/presentations/lib/presentationtab.py @@ -24,7 +24,7 @@ from PyQt4 import QtGui -from openlp.core.lib import SettingsTab, translate +from openlp.core.lib import SettingsTab class PresentationTab(SettingsTab): """ diff --git a/openlp/plugins/remotes/lib/remotetab.py b/openlp/plugins/remotes/lib/remotetab.py index aee3c57a2..a1f473c7c 100644 --- a/openlp/plugins/remotes/lib/remotetab.py +++ b/openlp/plugins/remotes/lib/remotetab.py @@ -20,7 +20,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA from PyQt4 import QtGui -from openlp.core.lib import SettingsTab, translate +from openlp.core.lib import SettingsTab class RemoteTab(SettingsTab): """ diff --git a/openlp/plugins/songs/forms/authorsdialog.py b/openlp/plugins/songs/forms/authorsdialog.py index d9bfde967..f42de7b1b 100644 --- a/openlp/plugins/songs/forms/authorsdialog.py +++ b/openlp/plugins/songs/forms/authorsdialog.py @@ -23,7 +23,6 @@ ############################################################################### from PyQt4 import QtCore, QtGui -from openlp.core.lib import translate class Ui_AuthorsDialog(object): def setupUi(self, AuthorsDialog): diff --git a/openlp/plugins/songs/forms/authorsform.py b/openlp/plugins/songs/forms/authorsform.py index 967a8de50..be5999f7b 100644 --- a/openlp/plugins/songs/forms/authorsform.py +++ b/openlp/plugins/songs/forms/authorsform.py @@ -23,7 +23,7 @@ ############################################################################### from PyQt4 import QtGui, QtCore -from openlp.core.lib import translate + from openlp.plugins.songs.forms.authorsdialog import Ui_AuthorsDialog class AuthorsForm(QtGui.QDialog, Ui_AuthorsDialog): diff --git a/openlp/plugins/songs/forms/editsongdialog.py b/openlp/plugins/songs/forms/editsongdialog.py index 855566ed4..9d4ad6fcc 100644 --- a/openlp/plugins/songs/forms/editsongdialog.py +++ b/openlp/plugins/songs/forms/editsongdialog.py @@ -24,7 +24,7 @@ from PyQt4 import QtCore, QtGui -from openlp.core.lib import translate, buildIcon +from openlp.core.lib import buildIcon class Ui_EditSongDialog(object): def setupUi(self, EditSongDialog): diff --git a/openlp/plugins/songs/forms/editsongform.py b/openlp/plugins/songs/forms/editsongform.py index e46d2dfa2..c501403c4 100644 --- a/openlp/plugins/songs/forms/editsongform.py +++ b/openlp/plugins/songs/forms/editsongform.py @@ -26,7 +26,7 @@ import logging from PyQt4 import QtCore, QtGui -from openlp.core.lib import SongXMLBuilder, SongXMLParser, Receiver, translate +from openlp.core.lib import SongXMLBuilder, SongXMLParser, Receiver from openlp.plugins.songs.forms import EditVerseForm from openlp.plugins.songs.lib.models import Song from editsongdialog import Ui_EditSongDialog diff --git a/openlp/plugins/songs/forms/editversedialog.py b/openlp/plugins/songs/forms/editversedialog.py index b0889515d..f69a2fe6f 100644 --- a/openlp/plugins/songs/forms/editversedialog.py +++ b/openlp/plugins/songs/forms/editversedialog.py @@ -23,7 +23,6 @@ ############################################################################### from PyQt4 import QtCore, QtGui -from openlp.core.lib import translate class Ui_EditVerseDialog(object): def setupUi(self, EditVerseDialog): diff --git a/openlp/plugins/songs/forms/openlpexportform.py b/openlp/plugins/songs/forms/openlpexportform.py index 48a1303f4..a4bcffe2a 100644 --- a/openlp/plugins/songs/forms/openlpexportform.py +++ b/openlp/plugins/songs/forms/openlpexportform.py @@ -22,7 +22,8 @@ # Temple Place, Suite 330, Boston, MA 02111-1307 USA # ############################################################################### -from PyQt4 import QtCore, QtGui +from PyQt4 import QtGui + from openlp.plugins.songs.forms.openlpexportdialog import Ui_OpenLPExportDialog class OpenLPExportForm(QtGui.QDialog, Ui_OpenLPExportDialog): diff --git a/openlp/plugins/songs/forms/openlpimportform.py b/openlp/plugins/songs/forms/openlpimportform.py index 6254226eb..e8cc92818 100644 --- a/openlp/plugins/songs/forms/openlpimportform.py +++ b/openlp/plugins/songs/forms/openlpimportform.py @@ -22,7 +22,7 @@ # Temple Place, Suite 330, Boston, MA 02111-1307 USA # ############################################################################### -from PyQt4 import QtCore, QtGui +from PyQt4 import QtGui from openlp.plugins.songs.forms.openlpimportdialog import Ui_OpenLPImportDialog class OpenLPImportForm(QtGui.QDialog, Ui_OpenLPImportDialog): @@ -30,4 +30,3 @@ class OpenLPImportForm(QtGui.QDialog, Ui_OpenLPImportDialog): def __init__(self, parent=None): QtGui.QDialog.__init__(self, parent) self.setupUi(self) - diff --git a/openlp/plugins/songs/forms/opensongexportform.py b/openlp/plugins/songs/forms/opensongexportform.py index 4f6fddcf1..b5246cf74 100644 --- a/openlp/plugins/songs/forms/opensongexportform.py +++ b/openlp/plugins/songs/forms/opensongexportform.py @@ -22,7 +22,7 @@ # Temple Place, Suite 330, Boston, MA 02111-1307 USA # ############################################################################### -from PyQt4 import QtCore, QtGui +from PyQt4 import QtGui from openlp.plugins.songs.forms.opensongexportdialog import Ui_OpenSongExportDialog class OpenSongExportForm(QtGui.QDialog, Ui_OpenSongExportDialog): diff --git a/openlp/plugins/songs/forms/opensongimportform.py b/openlp/plugins/songs/forms/opensongimportform.py index 80418f961..ed617626a 100644 --- a/openlp/plugins/songs/forms/opensongimportform.py +++ b/openlp/plugins/songs/forms/opensongimportform.py @@ -22,7 +22,7 @@ # Temple Place, Suite 330, Boston, MA 02111-1307 USA # ############################################################################### -from PyQt4 import QtCore, QtGui +from PyQt4 import QtGui from openlp.plugins.songs.forms.opensongimportdialog import Ui_OpenSongImportDialog class OpenSongImportForm(QtGui.QDialog, Ui_OpenSongImportDialog): diff --git a/openlp/plugins/songs/forms/songbookdialog.py b/openlp/plugins/songs/forms/songbookdialog.py index 10f560a58..786a019b9 100644 --- a/openlp/plugins/songs/forms/songbookdialog.py +++ b/openlp/plugins/songs/forms/songbookdialog.py @@ -23,7 +23,6 @@ ############################################################################### from PyQt4 import QtCore, QtGui -from openlp.core.lib import translate class Ui_SongBookDialog(object): def setupUi(self, SongBookDialog): diff --git a/openlp/plugins/songs/forms/songbookform.py b/openlp/plugins/songs/forms/songbookform.py index a662749df..4482e6d3a 100644 --- a/openlp/plugins/songs/forms/songbookform.py +++ b/openlp/plugins/songs/forms/songbookform.py @@ -24,7 +24,6 @@ from PyQt4 import QtGui -from openlp.core.lib import translate from openlp.plugins.songs.forms.songbookdialog import Ui_SongBookDialog class SongBookForm(QtGui.QDialog, Ui_SongBookDialog): diff --git a/openlp/plugins/songs/forms/songmaintenancedialog.py b/openlp/plugins/songs/forms/songmaintenancedialog.py index 7de15fb4f..f3ba1fce0 100644 --- a/openlp/plugins/songs/forms/songmaintenancedialog.py +++ b/openlp/plugins/songs/forms/songmaintenancedialog.py @@ -24,7 +24,7 @@ from PyQt4 import QtCore, QtGui -from openlp.core.lib import translate, buildIcon +from openlp.core.lib import buildIcon class Ui_SongMaintenanceDialog(object): def setupUi(self, SongMaintenanceDialog): diff --git a/openlp/plugins/songs/forms/songmaintenanceform.py b/openlp/plugins/songs/forms/songmaintenanceform.py index c73452282..4c83b41e5 100644 --- a/openlp/plugins/songs/forms/songmaintenanceform.py +++ b/openlp/plugins/songs/forms/songmaintenanceform.py @@ -18,7 +18,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA """ from PyQt4 import QtGui, QtCore -from openlp.core.lib import translate + from openlp.plugins.songs.lib.classes import Author, Book, Topic from songmaintenancedialog import Ui_SongMaintenanceDialog from authorsform import AuthorsForm diff --git a/openlp/plugins/songs/forms/topicsdialog.py b/openlp/plugins/songs/forms/topicsdialog.py index f66b1c222..9f4546b04 100644 --- a/openlp/plugins/songs/forms/topicsdialog.py +++ b/openlp/plugins/songs/forms/topicsdialog.py @@ -23,7 +23,6 @@ ############################################################################### from PyQt4 import QtCore, QtGui -from openlp.core.lib import translate class Ui_TopicsDialog(object): def setupUi(self, TopicsDialog): diff --git a/openlp/plugins/songs/forms/topicsform.py b/openlp/plugins/songs/forms/topicsform.py index f7b8fc56a..afa67c2db 100644 --- a/openlp/plugins/songs/forms/topicsform.py +++ b/openlp/plugins/songs/forms/topicsform.py @@ -24,7 +24,6 @@ from PyQt4 import QtGui -from openlp.core.lib import translate from openlp.plugins.songs.forms.topicsdialog import Ui_TopicsDialog class TopicsForm(QtGui.QDialog, Ui_TopicsDialog): diff --git a/openlp/plugins/songs/lib/mediaitem.py b/openlp/plugins/songs/lib/mediaitem.py index 7a72be2a1..9f3bc5638 100644 --- a/openlp/plugins/songs/lib/mediaitem.py +++ b/openlp/plugins/songs/lib/mediaitem.py @@ -26,7 +26,7 @@ import logging from PyQt4 import QtCore, QtGui -from openlp.core.lib import MediaManagerItem, translate, SongXMLParser, \ +from openlp.core.lib import MediaManagerItem, SongXMLParser, \ BaseListWithDnD, Receiver, str_to_bool from openlp.plugins.songs.forms import EditSongForm, SongMaintenanceForm diff --git a/openlp/plugins/songs/lib/songstab.py b/openlp/plugins/songs/lib/songstab.py index 864e97e59..d221e987d 100644 --- a/openlp/plugins/songs/lib/songstab.py +++ b/openlp/plugins/songs/lib/songstab.py @@ -24,7 +24,7 @@ from PyQt4 import QtCore, QtGui -from openlp.core.lib import SettingsTab, str_to_bool, translate +from openlp.core.lib import SettingsTab, str_to_bool class SongsTab(SettingsTab): """ diff --git a/openlp/plugins/songs/songsplugin.py b/openlp/plugins/songs/songsplugin.py index 21eb832d1..6b19b0276 100644 --- a/openlp/plugins/songs/songsplugin.py +++ b/openlp/plugins/songs/songsplugin.py @@ -26,7 +26,7 @@ import logging from PyQt4 import QtCore, QtGui -from openlp.core.lib import Plugin, translate, buildIcon +from openlp.core.lib import Plugin, buildIcon from openlp.plugins.songs.lib import SongManager, SongMediaItem, SongsTab from openlp.plugins.songs.forms import OpenLPImportForm, OpenSongExportForm, \ OpenSongImportForm, OpenLPExportForm From 7b54d89039c81c9f8bd2cc7e525cd890bcbb9fc8 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sat, 24 Oct 2009 19:11:02 +0100 Subject: [PATCH 14/17] Preserve selected slide on editing --- openlp/core/ui/slidecontroller.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index 913d60bfe..7e7375709 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -97,6 +97,8 @@ class SlideController(QtGui.QWidget): ] self.timer_id = 0 self.commandItem = None + self.songEdit = False + self.row = 0 self.Panel = QtGui.QWidget(parent.ControlSplitter) # Layout for holding panel self.PanelLayout = QtGui.QVBoxLayout(self.Panel) @@ -180,6 +182,7 @@ class SlideController(QtGui.QWidget): self.Toolbar.addToolbarWidget( u'Image SpinBox', self.DelaySpinBox) self.DelaySpinBox.setSuffix(self.trUtf8(u's')) + self.DelaySpinBox.setToolTip(self.trUtf8(u'Delay between slides in seconds')) self.ControllerLayout.addWidget(self.Toolbar) # Screen preview area @@ -289,7 +292,12 @@ class SlideController(QtGui.QWidget): Receiver().send_message(u'%s_start' % item.name.lower(), \ [item.shortname, item.service_item_path, item.service_frames[0][u'title']]) - self.displayServiceManagerItems(item, 0) + slideno = 0 + if self.songEdit: + slideno = self.row + self.songEdit = False + self.displayServiceManagerItems(item, slideno) + def addServiceManagerItem(self, item, slideno): """ @@ -387,6 +395,7 @@ class SlideController(QtGui.QWidget): if this is the Live Controller also display on the screen """ row = self.PreviewListWidget.currentRow() + self.row = 0 if row > -1 and row < self.PreviewListWidget.rowCount(): if self.commandItem.service_item_type == ServiceType.Command: Receiver().send_message(u'%s_slide'% self.commandItem.name.lower(), [row]) @@ -401,6 +410,7 @@ class SlideController(QtGui.QWidget): log.info(u'Slide Rendering took %4s' % (time.time() - before)) if self.isLive: self.parent.mainDisplay.frameView(frame) + self.row = row def grabMainDisplay(self): winid = QtGui.QApplication.desktop().winId() @@ -474,6 +484,7 @@ class SlideController(QtGui.QWidget): self.onSlideSelectedNext() def onEditSong(self): + self.songEdit = True Receiver().send_message(u'edit_song') def onGoLive(self): From e0f9f3f09ed7a0565913c6a19551fa561ca8ce6f Mon Sep 17 00:00:00 2001 From: Jonathan Corwin Date: Sat, 24 Oct 2009 20:22:00 +0100 Subject: [PATCH 15/17] Keep item in slidecontroller in sync with presentation, and detect external slide changes. --- openlp/core/lib/eventreceiver.py | 3 +++ openlp/core/ui/slidecontroller.py | 27 ++++++++++++++----- .../presentations/lib/messagelistener.py | 12 +++++---- .../lib/presentationcontroller.py | 18 +++++++++++++ 4 files changed, 48 insertions(+), 12 deletions(-) diff --git a/openlp/core/lib/eventreceiver.py b/openlp/core/lib/eventreceiver.py index 923e228de..e61e0d655 100644 --- a/openlp/core/lib/eventreceiver.py +++ b/openlp/core/lib/eventreceiver.py @@ -86,6 +86,9 @@ class EventReceiver(QtCore.QObject): ``config_updated`` Informs components the config has changed + + ``slidecontroller_change`` + Informs the slidecontroller that a slide change has occurred """ global log log = logging.getLogger(u'EventReceiver') diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index 0c3d737ad..c9c411583 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -224,6 +224,8 @@ class SlideController(QtGui.QWidget): QtCore.SIGNAL(u'slidecontroller_previous'), self.onSlideSelectedPrevious) QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'slidecontroller_last'), self.onSlideSelectedLast) + QtCore.QObject.connect(Receiver.get_receiver(), + QtCore.SIGNAL(u'slidecontroller_change'), self.onSlideChange) def receiveSpinDelay(self, value): self.DelaySpinBox.setValue(int(value)) @@ -389,14 +391,25 @@ class SlideController(QtGui.QWidget): log.info(u'Slide Rendering took %4s' % (time.time() - before)) if self.isLive: self.parent.mainDisplay.frameView(frame) - - def grabMainDisplay(self): - winid = QtGui.QApplication.desktop().winId() - rm = self.parent.RenderManager - rect = rm.screen_list[rm.current_display][u'size'] - winimg = QtGui.QPixmap.grabWindow(winid, rect.x(), rect.y(), rect.width(), rect.height()) - self.SlidePreview.setPixmap(winimg) + def onSlideChange(self, row): + """ + The slide has been changed. Update the slidecontroller accordingly + """ + self.PreviewListWidget.selectRow(row) + QtCore.QTimer.singleShot(0.5, self.grabMainDisplay) + + def grabMainDisplay(self): + rm = self.parent.RenderManager + if not rm.screen_list[rm.current_display][u'primary']: + winid = QtGui.QApplication.desktop().winId() + rect = rm.screen_list[rm.current_display][u'size'] + winimg = QtGui.QPixmap.grabWindow(winid, rect.x(), rect.y(), rect.width(), rect.height()) + self.SlidePreview.setPixmap(winimg) + else: + label = self.PreviewListWidget.cellWidget(self.PreviewListWidget.currentRow(), 0) + self.SlidePreview.setPixmap(label.pixmap()) + def onSlideSelectedNext(self): """ Go to the next slide. diff --git a/openlp/plugins/presentations/lib/messagelistener.py b/openlp/plugins/presentations/lib/messagelistener.py index 6a1c611f5..ca30b5564 100644 --- a/openlp/plugins/presentations/lib/messagelistener.py +++ b/openlp/plugins/presentations/lib/messagelistener.py @@ -68,6 +68,7 @@ class MessageListener(object): self.controller.load_presentation(file) self.controller.start_presentation() self.controller.slidenumber = 0 + self.controller.timer.start() def activate(self): if self.controller.is_active(): @@ -82,7 +83,7 @@ class MessageListener(object): self.activate() if message is not None: self.controller.goto_slide(message[0]+1) - self.controller.slidenumber = self.controller.get_slide_number() + self.controller.poll_slidenumber() def first(self, message): """ @@ -90,7 +91,7 @@ class MessageListener(object): """ self.activate() self.controller.start_presentation() - self.controller.slidenumber = self.controller.get_slide_number() + self.controller.poll_slidenumber() def last(self, message): """ @@ -98,7 +99,7 @@ class MessageListener(object): """ self.activate() self.controller.goto_slide(self.controller.get_slide_count()) - self.controller.slidenumber = self.controller.get_slide_number() + self.controller.poll_slidenumber() def next(self, message): """ @@ -106,7 +107,7 @@ class MessageListener(object): """ self.activate() self.controller.next_step() - self.controller.slidenumber = self.controller.get_slide_number() + self.controller.poll_slidenumber() def previous(self, message): """ @@ -114,7 +115,7 @@ class MessageListener(object): """ self.activate() self.controller.previous_step() - self.controller.slidenumber = self.controller.get_slide_number() + self.controller.poll_slidenumber() def shutdown(self, message): """ @@ -122,6 +123,7 @@ class MessageListener(object): """ self.controller.close_presentation() self.controller.slidenumber = 0 + self.controller.timer.shutdown() def blank(self): if not self.controller.is_loaded(): diff --git a/openlp/plugins/presentations/lib/presentationcontroller.py b/openlp/plugins/presentations/lib/presentationcontroller.py index 53c6e84d0..bb26da442 100644 --- a/openlp/plugins/presentations/lib/presentationcontroller.py +++ b/openlp/plugins/presentations/lib/presentationcontroller.py @@ -24,6 +24,8 @@ import shutil from PyQt4 import QtCore +from openlp.core.lib import Receiver + class PresentationController(object): """ Base class for presentation controllers to inherit from @@ -143,6 +145,9 @@ class PresentationController(object): self.thumbnailprefix = u'slide' if not os.path.isdir(self.thumbnailroot): os.makedirs(self.thumbnailroot) + self.timer = QtCore.QTimer() + self.timer.setInterval(500) + QtCore.QObject.connect(self.timer, QtCore.SIGNAL("timeout()"), self.poll_slidenumber) def check_available(self): """ @@ -291,3 +296,16 @@ class PresentationController(object): The slide an image is required for, starting at 1 """ return None + + def poll_slidenumber(self): + """ + Check the current slide number + """ + if not self.is_active(): + return + current = self.get_slide_number() + if current == self.slidenumber: + return + self.slidenumber = current + Receiver().send_message(u'slidecontroller_change', self.slidenumber - 1) + \ No newline at end of file From 7b85b9c7af640a448673b0aac1831b65cd34b013 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sat, 24 Oct 2009 20:43:16 +0100 Subject: [PATCH 16/17] More Song editing fixes --- openlp-1to2-converter.py | 8 +++++++- openlp/core/lib/eventreceiver.py | 7 +++++++ openlp/plugins/songs/lib/mediaitem.py | 2 +- 3 files changed, 15 insertions(+), 2 deletions(-) mode change 100644 => 100755 openlp-1to2-converter.py diff --git a/openlp-1to2-converter.py b/openlp-1to2-converter.py old mode 100644 new mode 100755 index bccb44d31..8e73b1d3d --- a/openlp-1to2-converter.py +++ b/openlp-1to2-converter.py @@ -25,7 +25,13 @@ import sys import os -import sqlite +try: + import sqlite +except: + try: + import pysqlite2 + except: + print 'No Sqlite2 package available' import sqlite3 import re from optparse import OptionParser diff --git a/openlp/core/lib/eventreceiver.py b/openlp/core/lib/eventreceiver.py index 923e228de..5ff4860ce 100644 --- a/openlp/core/lib/eventreceiver.py +++ b/openlp/core/lib/eventreceiver.py @@ -86,6 +86,13 @@ class EventReceiver(QtCore.QObject): ``config_updated`` Informs components the config has changed + + ``edit_song`` + Requests the current song on the preview display be loaded for edit + + ``preview_song`` + Tells the song plugin the edit has finished and the song can be previewed + Only available if the edit was triggered by the Preview button. """ global log log = logging.getLogger(u'EventReceiver') diff --git a/openlp/plugins/songs/lib/mediaitem.py b/openlp/plugins/songs/lib/mediaitem.py index 9f3bc5638..84fe3a506 100644 --- a/openlp/plugins/songs/lib/mediaitem.py +++ b/openlp/plugins/songs/lib/mediaitem.py @@ -125,7 +125,7 @@ class SongMediaItem(MediaManagerItem): QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'edit_song'), self.onEventEditSong) QtCore.QObject.connect(Receiver.get_receiver(), - QtCore.SIGNAL(u'proview_song'), self.onPreviewClick) + QtCore.SIGNAL(u'preview_song'), self.onPreviewClick) def configUpdated(self): self.searchAsYouType = str_to_bool( From bad24ee614fd8fc0f280c7f02df9eececa795c14 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sun, 25 Oct 2009 08:09:41 +0000 Subject: [PATCH 17/17] Finally fix redisplaying of correct slide --- openlp/core/ui/slidecontroller.py | 6 +++--- openlp/plugins/songs/lib/mediaitem.py | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index 2ad539f51..770a6db59 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -305,7 +305,7 @@ class SlideController(QtGui.QWidget): request the correct the toolbar of the plugin Called by ServiceManager """ - log.debug(u'addServiceItem') + log.debug(u'addServiceManagerItem') #If old item was a command tell it to stop if self.commandItem is not None and \ self.commandItem.service_item_type == ServiceType.Command: @@ -399,9 +399,9 @@ class SlideController(QtGui.QWidget): if row > -1 and row < self.PreviewListWidget.rowCount(): if self.commandItem.service_item_type == ServiceType.Command: Receiver().send_message(u'%s_slide'% self.commandItem.name.lower(), [row]) - QtCore.QTimer.singleShot(0.5, self.grabMainDisplay) + if isLive: + QtCore.QTimer.singleShot(0.5, self.grabMainDisplay) else: - #label = self.PreviewListWidget.cellWidget(row, 0) frame = self.serviceitem.frames[row][u'image'] before = time.time() if frame is None: diff --git a/openlp/plugins/songs/lib/mediaitem.py b/openlp/plugins/songs/lib/mediaitem.py index 84fe3a506..575968f31 100644 --- a/openlp/plugins/songs/lib/mediaitem.py +++ b/openlp/plugins/songs/lib/mediaitem.py @@ -181,7 +181,6 @@ class SongMediaItem(MediaManagerItem): if song.id == self.fromPreview: self.fromPreview = 0 self.ListView.setCurrentItem(song_name) - self.onPreviewClick() def displayResultsAuthor(self, searchresults): log.debug(u'display results Author')