From f4d373e7a5a77ca505ade5e847a08af76a35089a Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Wed, 4 Nov 2009 18:53:05 +0000 Subject: [PATCH 01/66] Song editing utf8 fixes part 1 --- openlp/plugins/songs/forms/editsongform.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/openlp/plugins/songs/forms/editsongform.py b/openlp/plugins/songs/forms/editsongform.py index 7522477b2..eece9c29b 100644 --- a/openlp/plugins/songs/forms/editsongform.py +++ b/openlp/plugins/songs/forms/editsongform.py @@ -461,6 +461,8 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): text = text.replace(u'}', u'') text = text.replace(u'?', u'') self.song.search_lyrics = unicode(text) + print type(sxml.extract_xml()) + print type(unicode(sxml.extract_xml())) self.song.lyrics = unicode(sxml.extract_xml()) except: log.exception(u'Problem processing song Lyrics \n%s', sxml.dump_xml()) From 03607395eb3f645f6698f11d6ec1e770d633fa45 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Wed, 4 Nov 2009 19:13:49 +0000 Subject: [PATCH 02/66] Song editing utf8 fixes part 2 --- openlp/plugins/songs/forms/editsongform.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/openlp/plugins/songs/forms/editsongform.py b/openlp/plugins/songs/forms/editsongform.py index b0a4feb43..26d5bbc1e 100644 --- a/openlp/plugins/songs/forms/editsongform.py +++ b/openlp/plugins/songs/forms/editsongform.py @@ -462,9 +462,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): text = text.replace(u'}', u'') text = text.replace(u'?', u'') self.song.search_lyrics = unicode(text) - print type(sxml.extract_xml()) - print type(unicode(sxml.extract_xml())) - self.song.lyrics = unicode(sxml.extract_xml()) + self.song.lyrics = unicode(sxml.extract_xml(), u'utf-8') except: log.exception(u'Problem processing song Lyrics \n%s', sxml.dump_xml()) From 08786fdcec59e744a6687cd7f7b9d26f84dde42a Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Wed, 4 Nov 2009 22:06:46 +0200 Subject: [PATCH 03/66] Fixed incorrect showing of image based on splash screen configuration. Fixed a bug where the display screen's image would not resize when the display screen was set to another desktop. --- openlp/core/ui/maindisplay.py | 28 ++++++++++++++-------------- openlp/core/ui/mainwindow.py | 6 ++++-- 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/openlp/core/ui/maindisplay.py b/openlp/core/ui/maindisplay.py index 77b34c255..125cf99be 100644 --- a/openlp/core/ui/maindisplay.py +++ b/openlp/core/ui/maindisplay.py @@ -136,7 +136,8 @@ class MainDisplay(DisplayLabel): Sets up the screen on a particular screen. @param (integer) screen This is the screen number. """ - log.debug(u'Setup %s for %s ' %(self.screens, screenNumber) ) + log.debug(u'Setup %s for %s ' %(self.screens, screenNumber)) + self.setVisible(False) screen = self.screens[screenNumber] if screen[u'number'] != screenNumber: # We will most probably never actually hit this bit, but just in @@ -154,19 +155,18 @@ class MainDisplay(DisplayLabel): self.setVisible(False) self.primary = True #Build a custom splash screen - if str_to_bool(self.parent.generalConfig.get_config(u'show splash', u'True')): - self.InitialFrame = QtGui.QImage( - screen[u'size'].width(), screen[u'size'].height(), - QtGui.QImage.Format_ARGB32_Premultiplied) - splash_image = QtGui.QImage(u':/graphics/openlp-splash-screen.png') - painter_image = QtGui.QPainter() - painter_image.begin(self.InitialFrame) - painter_image.fillRect(self.InitialFrame.rect(), QtCore.Qt.white) - painter_image.drawImage( - (screen[u'size'].width() - splash_image.width()) / 2, - (screen[u'size'].height() - splash_image.height()) / 2, - splash_image) - self.frameView(self.InitialFrame) + self.InitialFrame = QtGui.QImage( + screen[u'size'].width(), screen[u'size'].height(), + QtGui.QImage.Format_ARGB32_Premultiplied) + splash_image = QtGui.QImage(u':/graphics/openlp-splash-screen.png') + painter_image = QtGui.QPainter() + painter_image.begin(self.InitialFrame) + painter_image.fillRect(self.InitialFrame.rect(), QtCore.Qt.white) + painter_image.drawImage( + (screen[u'size'].width() - splash_image.width()) / 2, + (screen[u'size'].height() - splash_image.height()) / 2, + splash_image) + self.frameView(self.InitialFrame) #Build a Black screen painter = QtGui.QPainter() self.blankFrame = QtGui.QImage( diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index a2c6c6070..3179ad438 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -544,7 +544,6 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): monitor number does not exist. """ screen_number = int(self.generalConfig.get_config(u'Monitor', 0)) - monitor_exists = False for screen in self.screenList: if screen[u'number'] == screen_number: @@ -560,7 +559,9 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): self.showMaximized() screen_number = self.getMonitorNumber() self.mainDisplay.setup(screen_number) - self.setFocus() + if self.mainDisplay.isVisible(): + self.mainDisplay.setFocus() + self.activateWindow() if str_to_bool(self.generalConfig.get_config(u'Auto Open', False)): self.ServiceManagerContents.onLoadService(True) if str_to_bool(self.generalConfig.get_config(u'Screen Blank', False)) \ @@ -601,6 +602,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): if updated_display != self.RenderManager.current_display: self.RenderManager.update_display(updated_display) self.mainDisplay.setup(updated_display) + self.activateWindow() def closeEvent(self, event): """ From 7a359c047aef857231b3e540a88104052af179b4 Mon Sep 17 00:00:00 2001 From: Raoul snyman Date: Thu, 5 Nov 2009 08:06:43 +0200 Subject: [PATCH 04/66] Renamed DisplayLabel to DisplayWidget Fixed typo in DisplayWidget.__init__ Changed MainDisplay.__init__ to call DisplayWidget.__init__ not QtGui.QWidget.__init__ Fixed issue where the display window was showing up on the primary display. --- openlp/core/ui/maindisplay.py | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/openlp/core/ui/maindisplay.py b/openlp/core/ui/maindisplay.py index 125cf99be..ba15a01dc 100644 --- a/openlp/core/ui/maindisplay.py +++ b/openlp/core/ui/maindisplay.py @@ -30,7 +30,7 @@ from PyQt4.phonon import Phonon from openlp.core.lib import Receiver, str_to_bool -class DisplayLabel(QtGui.QWidget): +class DisplayWidget(QtGui.QWidget): """ Customised version of QTableWidget which can respond to keyboard events. @@ -40,7 +40,7 @@ class DisplayLabel(QtGui.QWidget): log.info(u'MainDisplay loaded') def __init__(self, parent=None, name=None): - QQtGui.QWidget.__init__(self, parent) + QtGui.QWidget.__init__(self, parent) self.parent = parent def keyPressEvent(self, event): @@ -65,7 +65,7 @@ class DisplayLabel(QtGui.QWidget): else: event.ignore() -class MainDisplay(DisplayLabel): +class MainDisplay(DisplayWidget): """ This is the form that is used to display things on the projector. """ @@ -84,7 +84,7 @@ class MainDisplay(DisplayLabel): The list of screens. """ log.debug(u'Initilisation started') - QtGui.QWidget.__init__(self, None) + DisplayWidget.__init__(self, None) self.parent = parent self.setWindowTitle(u'OpenLP Display') self.screens = screens @@ -148,12 +148,6 @@ class MainDisplay(DisplayLabel): screen = scrn break self.setGeometry(screen[u'size']) - if not screen[u'primary']: - self.showFullScreen() - self.primary = False - else: - self.setVisible(False) - self.primary = True #Build a custom splash screen self.InitialFrame = QtGui.QImage( screen[u'size'].width(), screen[u'size'].height(), @@ -174,6 +168,13 @@ class MainDisplay(DisplayLabel): QtGui.QImage.Format_ARGB32_Premultiplied) painter.begin(self.blankFrame) painter.fillRect(self.blankFrame.rect(), QtCore.Qt.black) + # To display or not to display? + if not screen[u'primary']: + self.showFullScreen() + self.primary = False + else: + self.setVisible(False) + self.primary = True def resetDisplay(self): if self.primary: From 831281e293c243ab524b6a41440e99431dd07271 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Thu, 5 Nov 2009 17:03:37 +0000 Subject: [PATCH 05/66] More remote editing cleanups --- openlp/core/lib/serviceitem.py | 23 +++++++++++++++++++++++ openlp/core/ui/servicemanager.py | 2 +- openlp/core/ui/slidecontroller.py | 3 +-- 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/openlp/core/lib/serviceitem.py b/openlp/core/lib/serviceitem.py index db147b786..fe50c220d 100644 --- a/openlp/core/lib/serviceitem.py +++ b/openlp/core/lib/serviceitem.py @@ -256,3 +256,26 @@ class ServiceItem(object): self.add_from_command(path, text_image) elif self.service_item_type == ServiceItemType.Video: pass + + 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 + replace an original version. + """ + self.uuid = other.uuid + + def __eq__(self, other): + """ + Confirms the service items are for the same instance + """ + if not other: + return False + return self.uuid == other.uuid + + def __ne__(self, other): + """ + Confirms the service items are not for the same instance + """ + return self.uuid != other.uuid + diff --git a/openlp/core/ui/servicemanager.py b/openlp/core/ui/servicemanager.py index b6b6a8575..e8abed32c 100644 --- a/openlp/core/ui/servicemanager.py +++ b/openlp/core/ui/servicemanager.py @@ -544,7 +544,7 @@ class ServiceManager(QtGui.QWidget): sitem, count = self.findServiceItem() item.render() if self.remoteEditTriggered: - item.uuid = self.serviceItems[sitem][u'data'].uuid + item.merge(self.serviceItems[sitem][u'data']) self.serviceItems[sitem][u'data'] = item self.remoteEditTriggered = False self.repaintServiceList(sitem + 1, 0) diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index efd523c82..029a4b1f9 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -361,8 +361,7 @@ class SlideController(QtGui.QWidget): """ Replacement item following a remote edit """ - if self.commandItem and \ - item.uuid == self.commandItem.uuid: + if item.__eq__(self.commandItem): self.addServiceManagerItem(item, self.PreviewListWidget.currentRow()) def addServiceManagerItem(self, item, slideno): From e931fa023a5144b6be5790db0a61cca91ac5da80 Mon Sep 17 00:00:00 2001 From: Jonathan Corwin Date: Thu, 5 Nov 2009 23:21:23 +0000 Subject: [PATCH 06/66] Address some issues with preview slide controller and presentations --- openlp/core/ui/maindisplay.py | 12 ++--- openlp/core/ui/slidecontroller.py | 18 +++++--- .../presentations/lib/messagelistener.py | 45 ++++++++++++++----- .../lib/presentationcontroller.py | 22 ++++----- 4 files changed, 64 insertions(+), 33 deletions(-) diff --git a/openlp/core/ui/maindisplay.py b/openlp/core/ui/maindisplay.py index afd599775..3195f8de9 100644 --- a/openlp/core/ui/maindisplay.py +++ b/openlp/core/ui/maindisplay.py @@ -47,16 +47,16 @@ class DisplayWidget(QtGui.QWidget): if type(event) == QtGui.QKeyEvent: #here accept the event and do something if event.key() == QtCore.Qt.Key_Up: - Receiver().send_message(u'slidecontroller_previous') + Receiver().send_message(u'live_slidecontroller_previous') event.accept() elif event.key() == QtCore.Qt.Key_Down: - Receiver().send_message(u'slidecontroller_next') + Receiver().send_message(u'live_slidecontroller_next') event.accept() elif event.key() == QtCore.Qt.Key_PageUp: - Receiver().send_message(u'slidecontroller_first') + Receiver().send_message(u'live_slidecontroller_first') event.accept() elif event.key() == QtCore.Qt.Key_PageDown: - Receiver().send_message(u'slidecontroller_last') + Receiver().send_message(u'live_slidecontroller_last') event.accept() elif event.key() == QtCore.Qt.Key_Escape: self.resetDisplay() @@ -116,9 +116,9 @@ class MainDisplay(DisplayWidget): QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'alert_text'), self.displayAlert) QtCore.QObject.connect(Receiver.get_receiver(), - QtCore.SIGNAL(u'presentations_start'), self.hideDisplay) + QtCore.SIGNAL(u'live_slide_hide'), self.hideDisplay) QtCore.QObject.connect(Receiver.get_receiver(), - QtCore.SIGNAL(u'presentations_stop'), self.showDisplay) + QtCore.SIGNAL(u'live_slide_show'), self.showDisplay) QtCore.QObject.connect(self.mediaObject, QtCore.SIGNAL(u'finished()'), self.onMediaFinish) QtCore.QObject.connect(Receiver.get_receiver(), diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index efd523c82..4e33085a3 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -253,16 +253,20 @@ class SlideController(QtGui.QWidget): self.Toolbar.makeWidgetsInvisible(self.media_list) else: self.Toolbar.makeWidgetsInvisible(self.song_list) + if isLive: + prefix = u'live_slidecontroller' + else: + prefix = u'preview_slidecontroller' QtCore.QObject.connect(Receiver.get_receiver(), - QtCore.SIGNAL(u'slidecontroller_first'), self.onSlideSelectedFirst) + QtCore.SIGNAL(u'%s_first' % prefix), self.onSlideSelectedFirst) QtCore.QObject.connect(Receiver.get_receiver(), - QtCore.SIGNAL(u'slidecontroller_next'), self.onSlideSelectedNext) + QtCore.SIGNAL(u'%s_next' % prefix), self.onSlideSelectedNext) QtCore.QObject.connect(Receiver.get_receiver(), - QtCore.SIGNAL(u'slidecontroller_previous'), self.onSlideSelectedPrevious) + QtCore.SIGNAL(u'%s_previous' % prefix), self.onSlideSelectedPrevious) QtCore.QObject.connect(Receiver.get_receiver(), - QtCore.SIGNAL(u'slidecontroller_last'), self.onSlideSelectedLast) + QtCore.SIGNAL(u'%s_last' % prefix), self.onSlideSelectedLast) QtCore.QObject.connect(Receiver.get_receiver(), - QtCore.SIGNAL(u'slidecontroller_change'), self.onSlideChange) + QtCore.SIGNAL(u'%s_change' % prefix), self.onSlideChange) def onSongBarHandler(self): request = self.sender().text() @@ -350,7 +354,7 @@ class SlideController(QtGui.QWidget): if item.service_item_type == ServiceItemType.Command: Receiver().send_message(u'%s_start' % item.name.lower(), \ [item.shortname, item.service_item_path, - item.service_frames[0][u'title']]) + item.service_frames[0][u'title'], self.isLive]) slideno = 0 if self.songEdit: slideno = self.row @@ -381,7 +385,7 @@ class SlideController(QtGui.QWidget): if item.service_item_type == ServiceItemType.Command: Receiver().send_message(u'%s_start' % item.name.lower(), \ [item.shortname, item.service_item_path, - item.service_frames[0][u'title'], slideno]) + item.service_frames[0][u'title'], slideno, self.isLive]) self.displayServiceManagerItems(item, slideno) def displayServiceManagerItems(self, serviceitem, slideno): diff --git a/openlp/plugins/presentations/lib/messagelistener.py b/openlp/plugins/presentations/lib/messagelistener.py index 5008c1e17..ba971ffc1 100644 --- a/openlp/plugins/presentations/lib/messagelistener.py +++ b/openlp/plugins/presentations/lib/messagelistener.py @@ -41,6 +41,7 @@ class MessageListener(object): def __init__(self, controllers): self.controllers = controllers self.handler = None + self.is_live = None # messages are sent from core.ui.slidecontroller QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'presentations_start'), self.startup) @@ -60,20 +61,25 @@ class MessageListener(object): QtCore.SIGNAL(u'presentations_blank'), self.blank) QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'presentations_unblank'), self.unblank) + self.timer = QtCore.QTimer() + self.timer.setInterval(500) + QtCore.QObject.connect(self.timer, QtCore.SIGNAL("timeout()"), self.timeout) def startup(self, message): """ Start of new presentation Save the handler as any new presentations start here """ - self.handler, file = self.decodeMessage(message) + self.handler, file, self.is_live = self.decodeMessage(message) self.controller = self.controllers[self.handler] if self.controller.is_loaded(): self.shutdown(None) self.controller.load_presentation(file) - self.controller.start_presentation() + if self.is_live: + self.controller.start_presentation() + Receiver().send_message(u'live_slide_hide') self.controller.slidenumber = 0 - self.controller.timer.start() + self.timer.start() def activate(self): if self.controller.is_active(): @@ -85,52 +91,66 @@ class MessageListener(object): self.controller.goto_slide(self.controller.slidenumber) def slide(self, message): + if not self.is_live: + return self.activate() if message: self.controller.goto_slide(message[0]+1) - self.controller.poll_slidenumber() + self.controller.poll_slidenumber(self.is_live) def first(self, message): """ Based on the handler passed at startup triggers the first slide """ + if not self.is_live: + return self.activate() self.controller.start_presentation() - self.controller.poll_slidenumber() + self.controller.poll_slidenumber(self.is_live) def last(self, message): """ Based on the handler passed at startup triggers the first slide """ + if not self.is_live: + return self.activate() self.controller.goto_slide(self.controller.get_slide_count()) - self.controller.poll_slidenumber() + self.controller.poll_slidenumber(self.is_live) def next(self, message): """ Based on the handler passed at startup triggers the next slide event """ + if not self.is_live: + return self.activate() self.controller.next_step() - self.controller.poll_slidenumber() + self.controller.poll_slidenumber(self.is_live) def previous(self, message): """ Based on the handler passed at startup triggers the previous slide event """ + if not self.is_live: + return self.activate() self.controller.previous_step() - self.controller.poll_slidenumber() + self.controller.poll_slidenumber(self.is_live) def shutdown(self, message): """ Based on the handler passed at startup triggers slide show to shut down """ + if not self.is_live: + Receiver().send_message(u'live_slide_show') self.controller.close_presentation() self.controller.slidenumber = 0 - self.controller.timer.shutdown() + self.timer.stop() def blank(self): + if not self.is_live: + return if not self.controller.is_loaded(): return if not self.controller.is_active(): @@ -138,6 +158,8 @@ class MessageListener(object): self.controller.blank_screen() def unblank(self): + if not self.is_live: + return self.activate() self.controller.unblank_screen() @@ -149,4 +171,7 @@ class MessageListener(object): Message containing Presentaion handler name and file to be presented. """ file = os.path.join(message[1], message[2]) - return message[0], file + return message[0], file, message[3] + + def timeout(self): + self.controller.poll_slidenumber(self.is_live) diff --git a/openlp/plugins/presentations/lib/presentationcontroller.py b/openlp/plugins/presentations/lib/presentationcontroller.py index 00f6f8495..02730cda7 100644 --- a/openlp/plugins/presentations/lib/presentationcontroller.py +++ b/openlp/plugins/presentations/lib/presentationcontroller.py @@ -149,9 +149,6 @@ 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): """ @@ -181,13 +178,16 @@ class PresentationController(object): log.debug(u'Kill') self.close_presentation() - def load_presentation(self, presentation): + def load_presentation(self, presentation, is_live): """ Called when a presentation is added to the SlideController. Loads the presentation and starts it ``presentation`` The file name of the presentations to the run. + + ``is_live`` + True if Live controller is opening the presentation """ pass @@ -207,9 +207,7 @@ class PresentationController(object): recent than the powerpoint """ lastimage = self.get_slide_preview_file(self.get_slide_count()) - if lastimage is None: - return False - if not os.path.isfile(lastimage): + if not (lastimage and os.path.isfile(lastimage)): return False imgdate = os.stat(lastimage).st_mtime pptdate = os.stat(self.filepath).st_mtime @@ -301,7 +299,7 @@ class PresentationController(object): """ return None - def poll_slidenumber(self): + def poll_slidenumber(self, is_live): """ Check the current slide number """ @@ -311,5 +309,9 @@ class PresentationController(object): if current == self.slidenumber: return self.slidenumber = current - Receiver().send_message(u'slidecontroller_change', self.slidenumber - 1) - \ No newline at end of file + if is_live: + prefix = u'live' + else: + prefix = u'preview' + Receiver().send_message(u'%s_slidecontroller_change' % prefix, + self.slidenumber - 1) From 74b08cb9c4514d07dde42fc39f77291dbee2d12b Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Fri, 6 Nov 2009 02:12:56 +0000 Subject: [PATCH 07/66] Clean theme loading --- openlp/core/ui/amendthemeform.py | 11 ++--------- openlp/core/ui/thememanager.py | 24 ++++++++++++------------ 2 files changed, 14 insertions(+), 21 deletions(-) diff --git a/openlp/core/ui/amendthemeform.py b/openlp/core/ui/amendthemeform.py index 2723c17d8..c66eb5199 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 +from openlp.core.lib import ThemeXML from amendthemedialog import Ui_AmendThemeDialog log = logging.getLogger(u'AmendThemeForm') @@ -184,14 +184,7 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog): def loadTheme(self, theme): log.debug(u'LoadTheme %s', theme) - if theme is None: - self.theme.parse(self.thememanager.baseTheme()) - else: - xml_file = os.path.join(self.path, theme, theme + u'.xml') - xml = file_to_xml(xml_file) - self.theme.parse(xml) - self.theme.extend_image_filename(self.path) - self.thememanager.cleanTheme(self.theme) + self.theme = self.thememanager.getThemeData(theme) # Stop the initial screen setup generating 1 preview per field! self.allowPreview = False self.paintUi(self.theme) diff --git a/openlp/core/ui/thememanager.py b/openlp/core/ui/thememanager.py index 44ac83043..50b40f11f 100644 --- a/openlp/core/ui/thememanager.py +++ b/openlp/core/ui/thememanager.py @@ -269,18 +269,14 @@ class ThemeManager(QtGui.QWidget): return self.themelist def getThemeData(self, themename): + assert(themename) log.debug(u'getthemedata for theme %s', themename) xml_file = os.path.join(self.path, unicode(themename), unicode(themename) + u'.xml') - try: - xml = file_to_xml(xml_file) - except: + xml = file_to_xml(xml_file) + if not xml: xml = self.baseTheme() - theme = ThemeXML() - theme.parse(xml) - self.cleanTheme(theme) - theme.extend_image_filename(self.path) - return theme + return createThemeFromXml(xml, self.path) def checkThemesExists(self, dir): log.debug(u'check themes') @@ -428,10 +424,7 @@ class ThemeManager(QtGui.QWidget): def generateAndSaveImage(self, dir, name, theme_xml): log.debug(u'generateAndSaveImage %s %s %s', dir, name, theme_xml) - theme = ThemeXML() - theme.parse(theme_xml) - self.cleanTheme(theme) - theme.extend_image_filename(dir) + theme = self.createThemeFromXml(theme_xml, dir) frame = self.generateImage(theme) samplepathname = os.path.join(self.path, name + u'.png') if os.path.exists(samplepathname): @@ -465,6 +458,13 @@ class ThemeManager(QtGui.QWidget): unicode(u'#FFFFFF'), unicode(0), unicode(0), unicode(0)) return newtheme.extract_xml() + def createThemeFromXml(self, theme_xml, path): + theme = ThemeXML() + theme.parse(theme_xml) + self.cleanTheme(theme) + theme.extend_image_filename(path) + return theme + def cleanTheme(self, theme): theme.background_color = theme.background_color.strip() theme.background_direction = theme.background_direction.strip() From b9b97174e240d2fb47151cf4720e22f067c6717d Mon Sep 17 00:00:00 2001 From: Michael Gorven Date: Fri, 6 Nov 2009 11:29:38 +0200 Subject: [PATCH 08/66] Improve transaltion string regex. --- openlp-get-strings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100644 => 100755 openlp-get-strings.py diff --git a/openlp-get-strings.py b/openlp-get-strings.py old mode 100644 new mode 100755 index e53924b02..dc101e945 --- a/openlp-get-strings.py +++ b/openlp-get-strings.py @@ -42,7 +42,7 @@ ts_message = u""" """ -find_trUtf8 = re.compile(r"trUtf8\(u'([\.:;\\&\w]+)'\)", re.UNICODE) +find_trUtf8 = re.compile(r"trUtf8\(u['\"]([^)]+)['\"]\)", re.UNICODE) strings = {} def parse_file(filename): From a9a53d9c947851e166beba80ae5613a8e3d54364 Mon Sep 17 00:00:00 2001 From: Michael Gorven Date: Fri, 6 Nov 2009 11:40:31 +0200 Subject: [PATCH 09/66] Use string quotes to detect end. --- openlp-get-strings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openlp-get-strings.py b/openlp-get-strings.py index dc101e945..adb2f8821 100755 --- a/openlp-get-strings.py +++ b/openlp-get-strings.py @@ -42,7 +42,7 @@ ts_message = u""" """ -find_trUtf8 = re.compile(r"trUtf8\(u['\"]([^)]+)['\"]\)", re.UNICODE) +find_trUtf8 = re.compile(r"trUtf8\(u?(['\"])([^\1]+)\1\)", re.UNICODE) strings = {} def parse_file(filename): From 4ee481ca6e43aa06ad83412a7cc3e0ab91bb8666 Mon Sep 17 00:00:00 2001 From: Michael Gorven Date: Fri, 6 Nov 2009 11:52:04 +0200 Subject: [PATCH 10/66] Change to Unicode string. --- 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 652b26284..b3a1d49e7 100644 --- a/openlp/core/ui/amendthemeform.py +++ b/openlp/core/ui/amendthemeform.py @@ -193,7 +193,7 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog): def onImageToolButtonClicked(self): filename = QtGui.QFileDialog.getOpenFileName( - self, self.trUtf8('Open file')) + self, self.trUtf8(u'Open file')) if filename: self.ImageLineEdit.setText(filename) self.theme.background_filename = filename From 4f495da73583350d0288b5ff33a2e2df5133b7b3 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Fri, 6 Nov 2009 17:36:18 +0000 Subject: [PATCH 11/66] Remote Edit for Custom --- openlp/plugins/custom/forms/editcustomform.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/openlp/plugins/custom/forms/editcustomform.py b/openlp/plugins/custom/forms/editcustomform.py index a4fc7a44a..0973e2b5a 100644 --- a/openlp/plugins/custom/forms/editcustomform.py +++ b/openlp/plugins/custom/forms/editcustomform.py @@ -21,6 +21,7 @@ # with this program; if not, write to the Free Software Foundation, Inc., 59 # # Temple Place, Suite 330, Boston, MA 02111-1307 USA # ############################################################################### +import logging from PyQt4 import QtCore, QtGui @@ -32,6 +33,9 @@ class EditCustomForm(QtGui.QDialog, Ui_customEditDialog): """ Class documentation goes here. """ + global log + log = logging.getLogger(u'EditCustomForm') + log.info(u'Custom Editor loaded') def __init__(self, custommanager, parent = None): """ Constructor @@ -40,6 +44,12 @@ class EditCustomForm(QtGui.QDialog, Ui_customEditDialog): #self.parent = parent self.setupUi(self) # Connecting signals and slots + self.previewButton = QtGui.QPushButton() + self.previewButton.setText(self.trUtf8(u'Save && Preview')) + self.buttonBox.addButton( + self.previewButton, QtGui.QDialogButtonBox.ActionRole) + QtCore.QObject.connect(self.buttonBox, + QtCore.SIGNAL(u'clicked(QAbstractButton*)'), self.onPreview) QtCore.QObject.connect(self.AddButton, QtCore.SIGNAL(u'pressed()'), self.onAddButtonPressed) QtCore.QObject.connect(self.EditButton, @@ -68,6 +78,12 @@ class EditCustomForm(QtGui.QDialog, Ui_customEditDialog): self.custommanager = custommanager self.initialise() + def onPreview(self, button): + log.debug(u'onPreview') + if button.text() == unicode(self.trUtf8(u'Save && Preview')) \ + and self.saveSong(): + Receiver().send_message(u'preview_custom') + def initialise(self): self.editAll = False self.DeleteButton.setEnabled(False) From 38e3ca66cbdb4ee0a98a11771acd2fdbb80b92f7 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Fri, 6 Nov 2009 18:50:46 +0000 Subject: [PATCH 12/66] Fix error in previous merge for ThemeManager Get Custom Working with remote editing --- openlp/core/ui/thememanager.py | 2 +- openlp/plugins/custom/forms/editcustomform.py | 19 +++++-- openlp/plugins/custom/lib/mediaitem.py | 51 ++++++++++++------- 3 files changed, 49 insertions(+), 23 deletions(-) diff --git a/openlp/core/ui/thememanager.py b/openlp/core/ui/thememanager.py index 50b40f11f..3c9d930ce 100644 --- a/openlp/core/ui/thememanager.py +++ b/openlp/core/ui/thememanager.py @@ -276,7 +276,7 @@ class ThemeManager(QtGui.QWidget): xml = file_to_xml(xml_file) if not xml: xml = self.baseTheme() - return createThemeFromXml(xml, self.path) + return self.createThemeFromXml(xml, self.path) def checkThemesExists(self, dir): log.debug(u'check themes') diff --git a/openlp/plugins/custom/forms/editcustomform.py b/openlp/plugins/custom/forms/editcustomform.py index 0973e2b5a..35d1e9ab0 100644 --- a/openlp/plugins/custom/forms/editcustomform.py +++ b/openlp/plugins/custom/forms/editcustomform.py @@ -81,7 +81,7 @@ class EditCustomForm(QtGui.QDialog, Ui_customEditDialog): def onPreview(self, button): log.debug(u'onPreview') if button.text() == unicode(self.trUtf8(u'Save && Preview')) \ - and self.saveSong(): + and self.saveCustom(): Receiver().send_message(u'preview_custom') def initialise(self): @@ -105,7 +105,7 @@ class EditCustomForm(QtGui.QDialog, Ui_customEditDialog): for themename in themelist: self.ThemeComboBox.addItem(themename) - def loadCustom(self, id): + def loadCustom(self, id, preview): self.customSlide = CustomSlide() self.initialise() if id != 0: @@ -124,17 +124,27 @@ class EditCustomForm(QtGui.QDialog, Ui_customEditDialog): self.ThemeComboBox.setCurrentIndex(id) else: self.ThemeComboBox.setCurrentIndex(0) + #if not preview hide the preview button + self.previewButton.setVisible(False) + if preview: + self.previewButton.setVisible(True) def closePressed(self): Receiver().send_message(u'remote_edit_clear') self.close() def accept(self): + log.debug(u'accept') + if self.saveCustom(): + Receiver().send_message(u'load_custom_list') + self.close() + + def saveCustom(self): valid, message = self._validate() if not valid: QtGui.QMessageBox.critical(self, self.trUtf8(u'Error'), message, QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok)) - return + return False sxml = SongXMLBuilder() sxml.new_document() sxml.add_lyrics_to_song() @@ -148,8 +158,7 @@ class EditCustomForm(QtGui.QDialog, Ui_customEditDialog): self.customSlide.credits = unicode(self.CreditEdit.displayText()) self.customSlide.theme_name = unicode(self.ThemeComboBox.currentText()) self.custommanager.save_slide(self.customSlide) - Receiver().send_message(u'load_custom_list') - self.close() + return True def onUpButtonPressed(self): selectedRow = self.VerseListView.currentRow() diff --git a/openlp/plugins/custom/lib/mediaitem.py b/openlp/plugins/custom/lib/mediaitem.py index 2f64ac0a7..8b86ab290 100644 --- a/openlp/plugins/custom/lib/mediaitem.py +++ b/openlp/plugins/custom/lib/mediaitem.py @@ -50,7 +50,9 @@ class CustomMediaItem(MediaManagerItem): self.ListViewWithDnD_class = CustomListView self.servicePath = None MediaManagerItem.__init__(self, parent, icon, title) - self.fromServiceManager = -1 + # Holds information about whether the edit is remotly triggered and + # which Custom is required. + self.remoteCustom = -1 def addEndHeaderBar(self): QtCore.QObject.connect(Receiver.get_receiver(), @@ -59,6 +61,8 @@ class CustomMediaItem(MediaManagerItem): QtCore.SIGNAL(u'remote_edit_clear' ), self.onRemoteEditClear) QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'load_custom_list'), self.initialise) + QtCore.QObject.connect(Receiver.get_receiver(), + QtCore.SIGNAL(u'preview_custom'), self.onPreviewClick) def initPluginNameVisible(self): self.PluginNameVisible = self.trUtf8(u'Custom') @@ -69,6 +73,14 @@ class CustomMediaItem(MediaManagerItem): def initialise(self): self.loadCustomListView(self.parent.custommanager.get_all_slides()) + #Called to redisplay the song list screen edith from a search + #or from the exit of the Song edit dialog. If remote editing is active + #Trigger it and clean up so it will not update again. + if self.remoteTriggered == u'L': + self.onAddClick() + if self.remoteTriggered == u'P': + self.onPreviewClick() + self.onRemoteEditClear() def loadCustomListView(self, list): self.ListView.clear() @@ -77,8 +89,6 @@ class CustomMediaItem(MediaManagerItem): custom_name.setData( QtCore.Qt.UserRole, QtCore.QVariant(CustomSlide.id)) self.ListView.addItem(custom_name) - if CustomSlide.id == self.fromServiceManager: - self.onAddClick() def onNewClick(self): self.parent.edit_custom_form.loadCustom(0) @@ -86,20 +96,29 @@ class CustomMediaItem(MediaManagerItem): self.initialise() def onRemoteEditClear(self): - self.fromServiceManager = -1 + self.remoteTriggered = None + self.remoteCustom = -1 - def onRemoteEdit(self, item_id): - valid = self.parent.custommanager.get_custom(item_id) + def onRemoteEdit(self, customid): + """ + Called by ServiceManager or SlideController by event passing + the Song Id in the payload along with an indicator to say which + type of display is required. + """ + fields = customid.split(u':') + valid = self.parent.custommanager.get_custom(fields[1]) if valid: - self.fromServiceManager = item_id - self.parent.edit_custom_form.loadCustom(item_id) + self.remoteCustom = fields[1] + self.remoteTriggered = fields[0] + self.parent.edit_custom_form.loadCustom(fields[1], + (fields[0] == u'P')) self.parent.edit_custom_form.exec_() def onEditClick(self): item = self.ListView.currentItem() if item: item_id = (item.data(QtCore.Qt.UserRole)).toInt()[0] - self.parent.edit_custom_form.loadCustom(item_id) + self.parent.edit_custom_form.loadCustom(item_id, False) self.parent.edit_custom_form.exec_() self.initialise() @@ -116,14 +135,13 @@ class CustomMediaItem(MediaManagerItem): raw_footer = [] slide = None theme = None - if self.fromServiceManager == -1: + if self.remoteTriggered is None: item = self.ListView.currentItem() if item is None: return False item_id = (item.data(QtCore.Qt.UserRole)).toInt()[0] else: - item_id = self.fromServiceManager - self.fromServiceManager = -1 + item_id = self.remoteCustom customSlide = self.parent.custommanager.get_custom(item_id) title = customSlide.title credit = customSlide.credits @@ -137,9 +155,8 @@ class CustomMediaItem(MediaManagerItem): for verse in verseList: raw_slides.append(verse[1]) raw_footer.append(title + u' '+ credit) - if theme: - service_item.title = title - for slide in raw_slides: - service_item.add_from_text(slide[:30], slide) - service_item.raw_footer = raw_footer + service_item.title = title + for slide in raw_slides: + service_item.add_from_text(slide[:30], slide) + service_item.raw_footer = raw_footer return True From 65736ef8d17b7f41720241d996c226a37f0140c5 Mon Sep 17 00:00:00 2001 From: Jonathan Corwin Date: Fri, 6 Nov 2009 19:23:58 +0000 Subject: [PATCH 13/66] Fix a couple of issues with last commit --- openlp/plugins/presentations/lib/messagelistener.py | 2 +- openlp/plugins/presentations/lib/presentationcontroller.py | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/openlp/plugins/presentations/lib/messagelistener.py b/openlp/plugins/presentations/lib/messagelistener.py index ba971ffc1..12e1b6570 100644 --- a/openlp/plugins/presentations/lib/messagelistener.py +++ b/openlp/plugins/presentations/lib/messagelistener.py @@ -142,7 +142,7 @@ class MessageListener(object): """ Based on the handler passed at startup triggers slide show to shut down """ - if not self.is_live: + if self.is_live: Receiver().send_message(u'live_slide_show') self.controller.close_presentation() self.controller.slidenumber = 0 diff --git a/openlp/plugins/presentations/lib/presentationcontroller.py b/openlp/plugins/presentations/lib/presentationcontroller.py index 02730cda7..caa6fcd3f 100644 --- a/openlp/plugins/presentations/lib/presentationcontroller.py +++ b/openlp/plugins/presentations/lib/presentationcontroller.py @@ -178,7 +178,7 @@ class PresentationController(object): log.debug(u'Kill') self.close_presentation() - def load_presentation(self, presentation, is_live): + def load_presentation(self, presentation): """ Called when a presentation is added to the SlideController. Loads the presentation and starts it @@ -186,8 +186,6 @@ class PresentationController(object): ``presentation`` The file name of the presentations to the run. - ``is_live`` - True if Live controller is opening the presentation """ pass From ecb0e3db8b0a22aaa82eef44f8814e77a0ce37b1 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Sat, 7 Nov 2009 00:00:36 +0000 Subject: [PATCH 14/66] Truth and file handling fixes --- openlp.pyw | 4 + openlp/core/lib/settingsmanager.py | 2 +- openlp/core/ui/amendthemeform.py | 2 +- openlp/core/ui/servicemanager.py | 52 +++-- openlp/core/ui/slidecontroller.py | 2 +- openlp/core/ui/thememanager.py | 110 ++++++----- openlp/core/utils/registry.py | 10 +- .../plugins/bibles/forms/bibleimportform.py | 13 +- openlp/plugins/bibles/lib/bibleCSVimpl.py | 97 +++++---- openlp/plugins/bibles/lib/bibleOSISimpl.py | 186 ++++++++++-------- openlp/plugins/bibles/lib/common.py | 4 +- openlp/plugins/bibles/lib/manager.py | 21 +- openlp/plugins/songs/lib/songxml.py | 73 +++---- .../songusage/forms/songusagedetailform.py | 20 +- 14 files changed, 349 insertions(+), 247 deletions(-) diff --git a/openlp.pyw b/openlp.pyw index fffed8726..4eaf8ee22 100755 --- a/openlp.pyw +++ b/openlp.pyw @@ -74,6 +74,7 @@ class OpenLP(QtGui.QApplication): #Load and store current Application Version filepath = os.path.split(os.path.abspath(__file__))[0] filepath = os.path.abspath(os.path.join(filepath, u'version.txt')) + fversion = None try: fversion = open(filepath, 'r') for line in fversion: @@ -83,6 +84,9 @@ class OpenLP(QtGui.QApplication): except: applicationVersion = {u'Full':u'1.9.0-000', u'version':u'1.9.0', u'build':u'000'} + finally: + if fversion: + fversion.close() #set the default string encoding try: sys.setappdefaultencoding(u'utf-8') diff --git a/openlp/core/lib/settingsmanager.py b/openlp/core/lib/settingsmanager.py index 43f148ffd..148fbd40b 100644 --- a/openlp/core/lib/settingsmanager.py +++ b/openlp/core/lib/settingsmanager.py @@ -60,7 +60,7 @@ class SettingsManager(object): u'user interface', u'display previewpanel', True)) def setUIItemVisibility(self, item=u'', isVisible=True): - if item != u'': + if item: if item == u'ThemeManagerDock': ConfigHelper.set_config(u'user interface', u'display thememanager', isVisible) diff --git a/openlp/core/ui/amendthemeform.py b/openlp/core/ui/amendthemeform.py index c66eb5199..27197c5af 100644 --- a/openlp/core/ui/amendthemeform.py +++ b/openlp/core/ui/amendthemeform.py @@ -194,7 +194,7 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog): def onImageToolButtonClicked(self): filename = QtGui.QFileDialog.getOpenFileName( self, self.trUtf8('Open file')) - if filename != u'': + if filename: self.ImageLineEdit.setText(filename) self.theme.background_filename = filename self.previewTheme(self.theme) diff --git a/openlp/core/ui/servicemanager.py b/openlp/core/ui/servicemanager.py index b6b6a8575..56e468123 100644 --- a/openlp/core/ui/servicemanager.py +++ b/openlp/core/ui/servicemanager.py @@ -35,7 +35,7 @@ from openlp.core.lib import PluginConfig, OpenLPToolbar, ServiceItem, \ class ServiceManagerList(QtGui.QTreeWidget): - def __init__(self,parent=None,name=None): + def __init__(self, parent=None, name=None): QtGui.QTreeWidget.__init__(self,parent) self.parent = parent @@ -418,7 +418,7 @@ class ServiceManager(QtGui.QWidget): u'Save Service', self.config.get_last_dir()) else: filename = self.config.get_last_dir() - if filename != u'': + if filename: splittedFile = filename.split(u'.') if splittedFile[-1] != u'osz': filename = filename + u'.osz' @@ -427,21 +427,30 @@ class ServiceManager(QtGui.QWidget): self.config.set_last_dir(filename) service = [] servicefile = filename + u'.osd' - zip = zipfile.ZipFile(unicode(filename), 'w') - for item in self.serviceItems: - service.append( - {u'serviceitem':item[u'data'].get_service_repr()}) - if item[u'data'].service_item_type == ServiceItemType.Image or \ - item[u'data'].service_item_type == ServiceItemType.Command: - for frame in item[u'data'].frames: - path_from = unicode(os.path.join( - item[u'data'].service_item_path, frame[u'title'])) - zip.write(path_from) - file = open(servicefile, u'wb') - cPickle.dump(service, file) - file.close() - zip.write(servicefile) - zip.close() + zip = None + file = None + try: + zip = zipfile.ZipFile(unicode(filename), 'w') + for item in self.serviceItems: + service.append( + {u'serviceitem':item[u'data'].get_service_repr()}) + if item[u'data'].service_item_type == ServiceItemType.Image or \ + item[u'data'].service_item_type == ServiceItemType.Command: + for frame in item[u'data'].frames: + path_from = unicode(os.path.join( + item[u'data'].service_item_path, frame[u'title'])) + zip.write(path_from) + file = open(servicefile, u'wb') + cPickle.dump(service, file) + file.close() + zip.write(servicefile) + except: + log.exception(u'Failed to save service to disk') + finally: + if file: + file.close() + if zip: + zip.close() try: os.remove(servicefile) except: @@ -467,8 +476,10 @@ class ServiceManager(QtGui.QWidget): self.config.get_last_dir(), u'Services (*.osz)') filename = unicode(filename) name = filename.split(os.path.sep) - if filename != u'': + if filename: self.config.set_last_dir(filename) + zip = None + f = None try: zip = zipfile.ZipFile(unicode(filename)) for file in zip.namelist(): @@ -501,6 +512,11 @@ class ServiceManager(QtGui.QWidget): log.exception(u'Failed to remove osd file') except: log.exception(u'Problem loading a service file') + finally: + if f: + f.close() + if zip: + zip.close() self.isNew = False self.serviceName = name[len(name) - 1] self.parent.serviceChanged(True, self.serviceName) diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index efd523c82..eeb977ac7 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -427,7 +427,7 @@ class SlideController(QtGui.QWidget): self.onSlideSelected() self.PreviewListWidget.setFocus() log.info(u'Display Rendering took %4s' % (time.time() - before)) - if self.serviceitem.audit != u'' and self.isLive: + if self.serviceitem.audit and self.isLive: Receiver().send_message(u'songusage_live', self.serviceitem.audit) log.debug(u'displayServiceManagerItems End') diff --git a/openlp/core/ui/thememanager.py b/openlp/core/ui/thememanager.py index 50b40f11f..055cc899b 100644 --- a/openlp/core/ui/thememanager.py +++ b/openlp/core/ui/thememanager.py @@ -182,10 +182,6 @@ class ThemeManager(QtGui.QWidget): self.ThemeListWidget.takeItem(row) try: os.remove(os.path.join(self.path, th)) - except: - #if not present do not worry - pass - try: shutil.rmtree(os.path.join(self.path, theme)) except: #if not present do not worry @@ -210,16 +206,22 @@ class ThemeManager(QtGui.QWidget): unicode(self.trUtf8(u'Save Theme - (%s)')) % theme, self.config.get_last_dir(1) ) path = unicode(path) - if path != u'': + if path: self.config.set_last_dir(path, 1) themePath = os.path.join(path, theme + u'.theme') - zip = zipfile.ZipFile(themePath, u'w') - source = os.path.join(self.path, theme) - for root, dirs, files in os.walk(source): - for name in files: - zip.write( - os.path.join(source, name), os.path.join(theme, name)) - zip.close() + zip = None + try: + zip = zipfile.ZipFile(themePath, u'w') + source = os.path.join(self.path, theme) + for root, dirs, files in os.walk(source): + for name in files: + zip.write( + os.path.join(source, name), os.path.join(theme, name)) + except: + log.exception(u'Export Theme Failed') + finally: + if zip: + zip.close() def onImportTheme(self): files = QtGui.QFileDialog.getOpenFileNames( @@ -291,44 +293,49 @@ class ThemeManager(QtGui.QWidget): """ log.debug(u'Unzipping theme %s', filename) filename = unicode(filename) + zip = None + outfile = None try: zip = zipfile.ZipFile(filename) + filexml = None + themename = None + for file in zip.namelist(): + if file.endswith(os.path.sep): + theme_dir = os.path.join(dir, file) + if not os.path.exists(theme_dir): + os.mkdir(os.path.join(dir, file)) + else: + fullpath = os.path.join(dir, file) + names = file.split(os.path.sep) + if len(names) > 1: + # not preview file + if themename is None: + themename = names[0] + xml_data = zip.read(file) + if os.path.splitext(file)[1].lower() in [u'.xml']: + if self.checkVersion1(xml_data): + # upgrade theme xml + filexml = self.migrateVersion122(filename, + fullpath, xml_data) + else: + filexml = xml_data + outfile = open(fullpath, u'w') + outfile.write(filexml) + else: + outfile = open(fullpath, u'w') + outfile.write(zip.read(file)) + self.generateAndSaveImage(dir, themename, filexml) except: QtGui.QMessageBox.critical( self, self.trUtf8(u'Error'), self.trUtf8(u'File is not a valid theme!'), QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok)) - return - filexml = None - themename = None - for file in zip.namelist(): - if file.endswith(os.path.sep): - theme_dir = os.path.join(dir, file) - if not os.path.exists(theme_dir): - os.mkdir(os.path.join(dir, file)) - else: - fullpath = os.path.join(dir, file) - names = file.split(os.path.sep) - if len(names) > 1: - # not preview file - if themename is None: - themename = names[0] - xml_data = zip.read(file) - if os.path.splitext(file)[1].lower() in [u'.xml']: - if self.checkVersion1(xml_data): - # upgrade theme xml - filexml = self.migrateVersion122(filename, - fullpath, xml_data) - else: - filexml = xml_data - outfile = open(fullpath, u'w') - outfile.write(filexml) - outfile.close() - else: - outfile = open(fullpath, u'w') - outfile.write(zip.read(file)) - outfile.close() - self.generateAndSaveImage(dir, themename, filexml) + log.exception(u'Importing theme from zip file failed') + finally: + if zip: + zip.close() + if outfile: + outfile.close() def checkVersion1(self, xmlfile): """ @@ -408,13 +415,22 @@ class ThemeManager(QtGui.QWidget): result == QtGui.QMessageBox.Yes if result == QtGui.QMessageBox.Yes: # Save the theme, overwriting the existing theme if necessary. - outfile = open(theme_file, u'w') - outfile.write(theme_pretty_xml) - outfile.close() + outfile = None + try: + outfile = open(theme_file, u'w') + outfile.write(theme_pretty_xml) + except: + log.exception(u'Saving theme to file failed') + finally: + if outfile: + outfile.close() if image_from and image_from != image_to: print "if", image_from print "it", image_to - shutil.copyfile(image_from, image_to) + try: + shutil.copyfile(image_from, image_to) + except: + log.exception(u'Failed to save theme image') self.generateAndSaveImage(self.path, name, theme_xml) self.loadThemes() else: diff --git a/openlp/core/utils/registry.py b/openlp/core/utils/registry.py index 3a1ceb520..8fa0bb6a8 100644 --- a/openlp/core/utils/registry.py +++ b/openlp/core/utils/registry.py @@ -101,23 +101,29 @@ class Registry(object): return False def _load(self): + file_handle = None try: if not os.path.isfile(self.file_name): return False file_handle = open(self.file_name, u'r') self.config.readfp(file_handle) - file_handle.close() return True except: return False + finally: + if file_handle: + file_handle.close() def _save(self): + file_handle = None try: if not os.path.exists(os.path.dirname(self.file_name)): os.makedirs(os.path.dirname(self.file_name)) file_handle = open(self.file_name, u'w') self.config.write(file_handle) - file_handle.close() return self._load() except: return False + finally: + if file_handle: + file_handle.close() diff --git a/openlp/plugins/bibles/forms/bibleimportform.py b/openlp/plugins/bibles/forms/bibleimportform.py index de7397355..62210d44f 100644 --- a/openlp/plugins/bibles/forms/bibleimportform.py +++ b/openlp/plugins/bibles/forms/bibleimportform.py @@ -59,6 +59,7 @@ class BibleImportForm(QtGui.QDialog, Ui_BibleImportDialog): filepath = os.path.split(os.path.abspath(__file__))[0] filepath = os.path.abspath(os.path.join(filepath, u'..', u'resources', u'crosswalkbooks.csv')) + fbibles = None try: fbibles = open(filepath, 'r') for line in fbibles: @@ -66,6 +67,9 @@ class BibleImportForm(QtGui.QDialog, Ui_BibleImportDialog): self.cwBibleVersions[p[0]] = p[1].replace(u'\n', u'') except: log.exception(u'Crosswalk resources missing') + finally: + if fbibles: + fbibles.close() #Load and store BibleGateway Bibles filepath = os.path.split(os.path.abspath(__file__))[0] filepath = os.path.abspath(os.path.join(filepath, u'..', @@ -77,6 +81,9 @@ class BibleImportForm(QtGui.QDialog, Ui_BibleImportDialog): self.bgBibleVersions[p[0]] = p[1].replace(u'\n', u'') except: log.exception(u'Biblegateway resources missing') + finally: + if fbibles: + fbibles.close() self.loadBibleCombo(self.cwBibleVersions) self.cwActive = True @@ -125,7 +132,7 @@ class BibleImportForm(QtGui.QDialog, Ui_BibleImportDialog): filename = QtGui.QFileDialog.getOpenFileName( self, self.trUtf8(u'Open Bible Verses file'), self.config.get_last_dir(1)) - if filename != u'': + if filename: self.VerseLocationEdit.setText(filename) self.config.set_last_dir(filename, 1) self.setCsv() @@ -134,7 +141,7 @@ class BibleImportForm(QtGui.QDialog, Ui_BibleImportDialog): filename = QtGui.QFileDialog.getOpenFileName( self, self.trUtf8(u'Open Bible Books file'), self.config.get_last_dir(2)) - if filename != u'': + if filename: self.BooksLocationEdit.setText(filename) self.config.set_last_dir(filename, 2) self.setCsv() @@ -143,7 +150,7 @@ class BibleImportForm(QtGui.QDialog, Ui_BibleImportDialog): filename = QtGui.QFileDialog.getOpenFileName( self, self.trUtf8(u'Open OSIS import file'), self.config.get_last_dir(3)) - if filename != u'': + if filename: self.OSISLocationEdit.setText(filename) self.config.set_last_dir(filename, 3) self.setOsis() diff --git a/openlp/plugins/bibles/lib/bibleCSVimpl.py b/openlp/plugins/bibles/lib/bibleCSVimpl.py index a2fed1ce5..15a29f900 100644 --- a/openlp/plugins/bibles/lib/bibleCSVimpl.py +++ b/openlp/plugins/bibles/lib/bibleCSVimpl.py @@ -48,46 +48,59 @@ class BibleCSVImpl(BibleCommon): def load_data(self, booksfile, versesfile, dialogobject): #Populate the Tables - fbooks = open(booksfile, 'r') - fverse = open(versesfile, 'r') + fbooks = None + try: + fbooks = open(booksfile, 'r') + count = 0 + for line in fbooks: + # cancel pressed + if not self.loadbible: + break + details = chardet.detect(line) + line = unicode(line, details['encoding']) + p = line.split(u',') + p1 = p[1].replace(u'"', u'') + p2 = p[2].replace(u'"', u'') + p3 = p[3].replace(u'"', u'') + self.bibledb.create_book(p2, p3, int(p1)) + count += 1 + #Flush the screen events + if count % 3 == 0: + Receiver().send_message(u'process_events') + count = 0 + except: + log.exception(u'Loading books from file failed') + finally: + if fbooks: + fbooks.close() - count = 0 - for line in fbooks: - # cancel pressed - if not self.loadbible: - break - details = chardet.detect(line) - line = unicode(line, details['encoding']) - p = line.split(u',') - p1 = p[1].replace(u'"', u'') - p2 = p[2].replace(u'"', u'') - p3 = p[3].replace(u'"', u'') - self.bibledb.create_book(p2, p3, int(p1)) - count += 1 - #Flush the screen events - if count % 3 == 0: - Receiver().send_message(u'process_events') - count = 0 - - count = 0 - book_ptr = None - for line in fverse: - if not self.loadbible: # cancel pressed - break - details = chardet.detect(line) - line = unicode(line, details['encoding']) - # split into 3 units and leave the rest as a single field - p = line.split(u',', 3) - p0 = p[0].replace(u'"', u'') - p3 = p[3].replace(u'"',u'') - if book_ptr is not p0: - book = self.bibledb.get_bible_book(p0) - book_ptr = book.name - # increament the progress bar - dialogobject.incrementProgressBar(book.name) - self.bibledb.add_verse(book.id, p[1], p[2], p3) - count += 1 - #Every x verses repaint the screen - if count % 3 == 0: - Receiver().send_message(u'process_events') - count = 0 + fverse = None + try: + fverse = open(versesfile, 'r') + count = 0 + book_ptr = None + for line in fverse: + if not self.loadbible: # cancel pressed + break + details = chardet.detect(line) + line = unicode(line, details['encoding']) + # split into 3 units and leave the rest as a single field + p = line.split(u',', 3) + p0 = p[0].replace(u'"', u'') + p3 = p[3].replace(u'"',u'') + if book_ptr is not p0: + book = self.bibledb.get_bible_book(p0) + book_ptr = book.name + # increament the progress bar + dialogobject.incrementProgressBar(book.name) + self.bibledb.add_verse(book.id, p[1], p[2], p3) + count += 1 + #Every x verses repaint the screen + if count % 3 == 0: + Receiver().send_message(u'process_events') + count = 0 + except: + log.exception(u'Loading verses from file failed') + finally: + if fverse: + fverse.close() diff --git a/openlp/plugins/bibles/lib/bibleOSISimpl.py b/openlp/plugins/bibles/lib/bibleOSISimpl.py index 04609e262..d4f94d6c3 100644 --- a/openlp/plugins/bibles/lib/bibleOSISimpl.py +++ b/openlp/plugins/bibles/lib/bibleOSISimpl.py @@ -60,12 +60,20 @@ class BibleOSISImpl(): filepath = os.path.split(os.path.abspath(__file__))[0] filepath = os.path.abspath(os.path.join( filepath, u'..', u'resources',u'osisbooks.csv')) - fbibles = open(filepath, u'r') - for line in fbibles: - p = line.split(u',') - self.booksOfBible[p[0]] = p[1].replace(u'\n', u'') - self.abbrevOfBible[p[0]] = p[2].replace(u'\n', u'') - self.loadbible = True + fbibles = None + try: + fbibles = open(filepath, u'r') + for line in fbibles: + p = line.split(u',') + self.booksOfBible[p[0]] = p[1].replace(u'\n', u'') + self.abbrevOfBible[p[0]] = p[2].replace(u'\n', u'') + self.loadbible = True + except: + log.exception(u'OSIS bible import failed') + finally: + self.loadbible = False + if fbibles: + fbibles.close() QtCore.QObject.connect(Receiver().get_receiver(), QtCore.SIGNAL(u'openlpstopimport'), self.stop_import) @@ -86,82 +94,98 @@ class BibleOSISImpl(): The Import dialog, so that we can increase the counter on the progress bar. """ - detect_file = open(osisfile_record, u'r') - details = chardet.detect(detect_file.read(2048)) - detect_file.close() - osis = codecs.open(osisfile_record, u'r', details['encoding']) - book_ptr = None - count = 0 - verseText = u'', pos) - # Book Reference - ref = file_record[pos+15:epos-1] - #lets find the bible text only - # find start of text - pos = epos + 1 - # end of text - epos = file_record.find(u'', pos) - text = file_record[pos : epos] - #remove tags of extra information - text = self.remove_block(u'', text) - text = self.remove_block(u'', text) - text = self.remove_block(u'', text) - text = self.remove_tag(u'') - while pos > -1: - epos = text.find(u'', pos) - if epos == -1: # TODO - pos = -1 - else: - text = text[:pos] + text[epos + 4: ] - pos = text.find(u'') - pos = text.find(u'') - while pos > -1: - epos = text.find(u'', pos) - text = text[:pos] + text[epos + 4: ] - pos = text.find(u'') - # split up the reference - p = ref.split(u'.', 3) - if book_ptr != p[0]: - # first time through - if book_ptr is None: - # set the max book size depending on the first book read - if p[0] == u'Gen': - dialogobject.setMax(65) + detect_file = None + try: + detect_file = open(osisfile_record, u'r') + details = chardet.detect(detect_file.read(2048)) + except: + log.exception(u'Failed to detect OSIS file encoding') + return + finally: + if detect_file: + detect_file.close() + osis = None + try: + osis = codecs.open(osisfile_record, u'r', details['encoding']) + book_ptr = None + count = 0 + verseText = u'', pos) + # Book Reference + ref = file_record[pos+15:epos-1] + #lets find the bible text only + # find start of text + pos = epos + 1 + # end of text + epos = file_record.find(u'', pos) + text = file_record[pos : epos] + #remove tags of extra information + text = self.remove_block(u'', text) + text = self.remove_block(u'', text) + text = self.remove_block( + u'', text) + text = self.remove_tag(u'') + while pos > -1: + epos = text.find(u'', pos) + if epos == -1: # TODO + pos = -1 else: - dialogobject.setMax(27) - # First book of NT - if p[0] == u'Matt': - testament += 1 - book_ptr = p[0] - book = self.bibledb.create_book( - unicode(self.booksOfBible[p[0]]), - unicode(self.abbrevOfBible[p[0]]), - testament) - dialogobject.incrementProgressBar( - self.booksOfBible[p[0]]) - Receiver().send_message(u'process_events') - count = 0 - self.bibledb.add_verse(book.id, p[1], p[2], text) - count += 1 - #Every 3 verses repaint the screen - if count % 3 == 0: - Receiver().send_message(u'process_events') - count = 0 + text = text[:pos] + text[epos + 4: ] + pos = text.find(u'') + pos = text.find(u'') + while pos > -1: + epos = text.find(u'', pos) + text = text[:pos] + text[epos + 4: ] + pos = text.find(u'') + # split up the reference + p = ref.split(u'.', 3) + if book_ptr != p[0]: + # first time through + if book_ptr is None: + # set the max book size depending + # on the first book read + if p[0] == u'Gen': + dialogobject.setMax(65) + else: + dialogobject.setMax(27) + # First book of NT + if p[0] == u'Matt': + testament += 1 + book_ptr = p[0] + book = self.bibledb.create_book( + unicode(self.booksOfBible[p[0]]), + unicode(self.abbrevOfBible[p[0]]), + testament) + dialogobject.incrementProgressBar( + self.booksOfBible[p[0]]) + Receiver().send_message(u'process_events') + count = 0 + self.bibledb.add_verse(book.id, p[1], p[2], text) + count += 1 + #Every 3 verses repaint the screen + if count % 3 == 0: + Receiver().send_message(u'process_events') + count = 0 + except: + log.exception(u'Loading bible from OSIS file failed') + finally: + if osis: + osis.close() def remove_block(self, start_tag, end_tag, text): """ diff --git a/openlp/plugins/bibles/lib/common.py b/openlp/plugins/bibles/lib/common.py index 8cc4e461e..5ef9f5126 100644 --- a/openlp/plugins/bibles/lib/common.py +++ b/openlp/plugins/bibles/lib/common.py @@ -105,7 +105,8 @@ class BibleCommon(object): xml_string = u'' req = urllib2.Request(urlstring) #Make us look like an IE Browser on XP to stop blocking by web site - req.add_header(u'User-Agent', u'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)') + req.add_header(u'User-Agent', + u'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)') try: handle = urllib2.urlopen(req) html = handle.read() @@ -164,4 +165,3 @@ class BibleCommon(object): start_tag = text.find(u'<') text = text.replace(u'>', u'') return text.rstrip().lstrip() - diff --git a/openlp/plugins/bibles/lib/manager.py b/openlp/plugins/bibles/lib/manager.py index 1b308571e..c540ae60d 100644 --- a/openlp/plugins/bibles/lib/manager.py +++ b/openlp/plugins/bibles/lib/manager.py @@ -71,7 +71,7 @@ class BibleManager(object): def reload_bibles(self): log.debug(u'Reload bibles') files = self.config.get_files(self.bibleSuffix) - log.debug(u'Bible Files %s', files ) + log.debug(u'Bible Files %s', files) self.bible_db_cache = {} self.bible_http_cache = {} # books of the bible with testaments @@ -116,12 +116,19 @@ class BibleManager(object): filepath = os.path.split(os.path.abspath(__file__))[0] filepath = os.path.abspath(os.path.join( filepath, u'..', u'resources',u'httpbooks.csv')) - fbibles = open(filepath, u'r') - for line in fbibles: - p = line.split(u',') - self.book_abbreviations[p[0]] = p[1].replace(u'\n', '') - self.book_testaments[p[0]] = p[2].replace(u'\n', '') - self.book_chapters.append({u'book':p[0], u'total':p[3].replace(u'\n', '')}) + fbibles = None + try: + fbibles = open(filepath, u'r') + for line in fbibles: + p = line.split(u',') + self.book_abbreviations[p[0]] = p[1].replace(u'\n', '') + self.book_testaments[p[0]] = p[2].replace(u'\n', '') + self.book_chapters.append({u'book':p[0], u'total':p[3].replace(u'\n', '')}) + except: + log.exception(u'Failed to load bible') + finally: + if fbibles: + fbibles.close() log.debug(u'Bible Initialised') def process_dialog(self, dialogobject): diff --git a/openlp/plugins/songs/lib/songxml.py b/openlp/plugins/songs/lib/songxml.py index 705a223f6..267528cab 100644 --- a/openlp/plugins/songs/lib/songxml.py +++ b/openlp/plugins/songs/lib/songxml.py @@ -94,13 +94,10 @@ class _OpenSong(XmlRootClass): in OpenSong an author list may be separated by '/' return as a string """ - res = [] if self.author: - lst = self.author.split(u' and ') - for l in lst: - res.append(l.strip()) - s = u', '.join(res) - return s + list = self.author.split(u' and ') + res = [item.strip() for item in list] + return u', '.join(res) def get_category_array(self): """Convert theme and alttheme into category_array @@ -116,8 +113,8 @@ class _OpenSong(XmlRootClass): return s def _reorder_verse(self, tag, tmpVerse): - """Reorder the verse in case of first char is a number - + """ + Reorder the verse in case of first char is a number tag -- the tag of this verse / verse group tmpVerse -- list of strings """ @@ -147,8 +144,8 @@ class _OpenSong(XmlRootClass): return res def get_lyrics(self): - """Convert the lyrics to openlp lyrics format - + """ + Convert the lyrics to openlp lyrics format return as list of strings """ lyrics = self.lyrics.split(u'\n') @@ -277,17 +274,22 @@ class Song(object): self.set_lyrics(opensong.get_lyrics()) def from_opensong_file(self, xmlfilename): - """Initialize from file containing xml - + """ + Initialize from file containing xml xmlfilename -- path to xml file """ - lst = [] - f = open(xmlfilename, 'r') - for line in f: - lst.append(line) - f.close() - xml = "".join(lst) - self.from_opensong_buffer(xml) + osfile = None + try: + osfile = open(xmlfilename, 'r') + list = [line for line in osfile] + osfile.close() + xml = "".join(list) + self.from_opensong_buffer(xml) + except: + log.exception(u'Failed to load opensong xml file') + finally: + if osfile: + osfile.close() def _remove_punctuation(self, title): """Remove the puntuation chars from title @@ -380,16 +382,20 @@ class Song(object): self.set_lyrics(lyrics) def from_ccli_text_file(self, textFileName): - """Create song from a list of texts read from given file - + """ + Create song from a list of texts read from given file textFileName -- path to text file """ - lines = [] - f = open(textFileName, 'r') - for orgline in f: - lines.append(orgline.rstrip()) - f.close() - self.from_ccli_text_buffer(lines) + ccli_file = None + try: + ccli_file = open(textFileName, 'r') + lines = [orgline.rstrip() for orgline in ccli_file] + self.from_ccli_text_buffer(lines) + except: + log.exception(u'Failed to load CCLI text file') + finally: + if ccli_file: + ccli_file.close() def _assure_string(self, string_in): """Force a string is returned""" @@ -401,13 +407,10 @@ class Song(object): def _split_to_list(self, aString): """Split a string into a list - comma separated""" - res = [] if aString: - lst = aString.split(u',') - for l in lst: - # remove whitespace - res.append(l.strip()) - return res + list = aString.split(u',') + res = [item.strip() for item in list] + return res def _list_to_string(self, strOrList): """Force a possibly list into a string""" @@ -419,8 +422,8 @@ class Song(object): lst = [] else: raise SongTypeError(u'Variable not String or List') - s = u', '.join(lst) - return s + string = u', '.join(lst) + return string def get_copyright(self): """Return copyright info string""" diff --git a/openlp/plugins/songusage/forms/songusagedetailform.py b/openlp/plugins/songusage/forms/songusagedetailform.py index a55f10a17..3c09203b0 100644 --- a/openlp/plugins/songusage/forms/songusagedetailform.py +++ b/openlp/plugins/songusage/forms/songusagedetailform.py @@ -111,13 +111,19 @@ class SongUsageDetailForm(QtGui.QDialog, Ui_SongUsageDetailDialog): self.ToDateEdit.date().toString(u'ddMMyyyy')) audits = self.parent.auditmanager.get_all_audits() outname = os.path.join(unicode(self.FileLineEdit.text()), filename) - file = open(outname, u'w') - for audit in audits: - record = u'\"%s\",\"%s\",\"%s\",\"%s\",\"%s\",\"%s\"\n' % \ - (audit.auditdate,audit.audittime, audit.title, - audit.copyright, audit.ccl_number , audit.authors) - file.write(record) - file.close() + file = None + try: + file = open(outname, u'w') + for audit in audits: + record = u'\"%s\",\"%s\",\"%s\",\"%s\",\"%s\",\"%s\"\n' % \ + (audit.auditdate,audit.audittime, audit.title, + audit.copyright, audit.ccl_number , audit.authors) + file.write(record) + except: + log.exception(u'Failed to write out audit records') + finally: + if file: + file.close() def summaryReport(self): print "summary" From 2e02f1c94f9a8428651eb89228fe91736f12a95e Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sat, 7 Nov 2009 07:42:18 +0000 Subject: [PATCH 15/66] Remove "Can_be_disabled" as no longer require Sort out status handling in plugin form. --- openlp/core/lib/plugin.py | 8 -------- openlp/core/lib/pluginmanager.py | 5 +---- openlp/core/ui/pluginform.py | 14 +++++--------- openlp/plugins/bibles/bibleplugin.py | 3 --- openlp/plugins/custom/customplugin.py | 3 --- openlp/plugins/images/imageplugin.py | 5 +---- openlp/plugins/media/mediaplugin.py | 3 --- openlp/plugins/presentations/presentationplugin.py | 3 --- openlp/plugins/remotes/remoteplugin.py | 3 --- openlp/plugins/songs/songsplugin.py | 3 --- openlp/plugins/songusage/songusageplugin.py | 3 --- 11 files changed, 7 insertions(+), 46 deletions(-) diff --git a/openlp/core/lib/plugin.py b/openlp/core/lib/plugin.py index dba8666e3..38302cea1 100644 --- a/openlp/core/lib/plugin.py +++ b/openlp/core/lib/plugin.py @@ -139,14 +139,6 @@ class Plugin(QtCore.QObject): """ return True - def can_be_disabled(self): - """ - Indicates whether the plugin can be disabled by the plugin list. - - Returns True or False. - """ - return False - def set_status(self): """ Sets the status of the plugin diff --git a/openlp/core/lib/pluginmanager.py b/openlp/core/lib/pluginmanager.py index 4ac23e6a2..60643a588 100644 --- a/openlp/core/lib/pluginmanager.py +++ b/openlp/core/lib/pluginmanager.py @@ -105,10 +105,7 @@ class PluginManager(object): for plugin in plugins_list: if plugin.check_pre_conditions(): log.debug(u'Plugin %s active', unicode(plugin.name)) - if plugin.can_be_disabled(): - plugin.set_status() - else: - plugin.status = PluginStatus.Active + plugin.set_status() else: plugin.status = PluginStatus.Disabled self.plugins.append(plugin) diff --git a/openlp/core/ui/pluginform.py b/openlp/core/ui/pluginform.py index 2cbb4fef5..98a7b7d33 100644 --- a/openlp/core/ui/pluginform.py +++ b/openlp/core/ui/pluginform.py @@ -79,17 +79,16 @@ class PluginForm(QtGui.QDialog, Ui_PluginViewDialog): self.StatusComboBox.setCurrentIndex(-1) self.VersionNumberLabel.setText(u'') self.AboutTextBrowser.setHtml(u'') + self.StatusComboBox.setEnabled(False) def _setDetails(self): log.debug('PluginStatus: %s', str(self.activePlugin.status)) self.VersionNumberLabel.setText(self.activePlugin.version) self.AboutTextBrowser.setHtml(self.activePlugin.about()) - if self.activePlugin.can_be_disabled(): - self.programaticChange = True - self.StatusComboBox.setCurrentIndex(int(self.activePlugin.status)) - self.StatusComboBox.setEnabled(True) - else: - self.StatusComboBox.setEnabled(False) + self.programaticChange = True + self.StatusComboBox.setCurrentIndex(int(self.activePlugin.status)) + self.StatusComboBox.setEnabled(True) + self.programaticChange = False def onPluginListWidgetSelectionChanged(self): if self.PluginListWidget.currentItem() is None: @@ -107,9 +106,6 @@ class PluginForm(QtGui.QDialog, Ui_PluginViewDialog): self._clearDetails() def onStatusComboBoxChanged(self, status): - if self.programaticChange: - self.programaticChange = False - return self.activePlugin.toggle_status(status) if status == PluginStatus.Active: self.activePlugin.initialise() diff --git a/openlp/plugins/bibles/bibleplugin.py b/openlp/plugins/bibles/bibleplugin.py index ef0308925..dfc3595f7 100644 --- a/openlp/plugins/bibles/bibleplugin.py +++ b/openlp/plugins/bibles/bibleplugin.py @@ -41,9 +41,6 @@ class BiblePlugin(Plugin): #Register the bible Manager self.biblemanager = None - def can_be_disabled(self): - return True - def initialise(self): log.info(u'bibles Initialising') if self.biblemanager is None: diff --git a/openlp/plugins/custom/customplugin.py b/openlp/plugins/custom/customplugin.py index bcd61f5bc..3ae693e1e 100644 --- a/openlp/plugins/custom/customplugin.py +++ b/openlp/plugins/custom/customplugin.py @@ -54,9 +54,6 @@ class CustomPlugin(Plugin): # Create the CustomManagerItem object return CustomMediaItem(self, self.icon, self.name) - def can_be_disabled(self): - return True - def initialise(self): log.info(u'Plugin Initialising') Plugin.initialise(self) diff --git a/openlp/plugins/images/imageplugin.py b/openlp/plugins/images/imageplugin.py index 229b57f95..aba19f47f 100644 --- a/openlp/plugins/images/imageplugin.py +++ b/openlp/plugins/images/imageplugin.py @@ -37,9 +37,6 @@ class ImagePlugin(Plugin): self.weight = -7 self.icon = buildIcon(u':/media/media_image.png') - def can_be_disabled(self): - return True - def initialise(self): log.info(u'Plugin Initialising') Plugin.initialise(self) @@ -60,7 +57,7 @@ class ImagePlugin(Plugin): about_text = self.trUtf8(u'Image Plugin
Allows images of ' u'all types to be displayed. If a number of images are selected ' u'together and presented on the live controller it is possible ' - u'to turn them into a timed loop.
From the plugin if the ' + u'to turn them into a timed loop.From the plugin if the ' u'Override background is chosen and an image is selected ' u'any somgs which are rendered will use the selected image from ' u'the background instead of the one provied by the theme.
') diff --git a/openlp/plugins/media/mediaplugin.py b/openlp/plugins/media/mediaplugin.py index acfd170d6..3295dabc2 100644 --- a/openlp/plugins/media/mediaplugin.py +++ b/openlp/plugins/media/mediaplugin.py @@ -42,9 +42,6 @@ class MediaPlugin(Plugin): def get_settings_tab(self): return MediaTab(self.name) - def can_be_disabled(self): - return True - def initialise(self): log.info(u'Plugin Initialising') Plugin.initialise(self) diff --git a/openlp/plugins/presentations/presentationplugin.py b/openlp/plugins/presentations/presentationplugin.py index e54220e08..11d582925 100644 --- a/openlp/plugins/presentations/presentationplugin.py +++ b/openlp/plugins/presentations/presentationplugin.py @@ -46,9 +46,6 @@ class PresentationPlugin(Plugin): """ return PresentationTab(self.name, self.controllers) - def can_be_disabled(self): - return True - def initialise(self): log.info(u'Presentations Initialising') Plugin.initialise(self) diff --git a/openlp/plugins/remotes/remoteplugin.py b/openlp/plugins/remotes/remoteplugin.py index 3a350cd0c..451887751 100644 --- a/openlp/plugins/remotes/remoteplugin.py +++ b/openlp/plugins/remotes/remoteplugin.py @@ -40,9 +40,6 @@ class RemotesPlugin(Plugin): self.weight = -1 self.server = None - def can_be_disabled(self): - return True - def initialise(self): log.debug(u'initialise') Plugin.initialise(self) diff --git a/openlp/plugins/songs/songsplugin.py b/openlp/plugins/songs/songsplugin.py index a76642024..6c7b24d77 100644 --- a/openlp/plugins/songs/songsplugin.py +++ b/openlp/plugins/songs/songsplugin.py @@ -57,9 +57,6 @@ class SongsPlugin(Plugin): self.opensong_export_form = OpenSongExportForm() self.icon = buildIcon(u':/media/media_song.png') - def can_be_disabled(self): - return True - def get_settings_tab(self): return SongsTab(self.name) diff --git a/openlp/plugins/songusage/songusageplugin.py b/openlp/plugins/songusage/songusageplugin.py index 2e7282a98..7cb555647 100644 --- a/openlp/plugins/songusage/songusageplugin.py +++ b/openlp/plugins/songusage/songusageplugin.py @@ -44,9 +44,6 @@ class SongUsagePlugin(Plugin): self.songusagemanager = None self.songusageActive = False - def can_be_disabled(self): - return True - def add_tools_menu_item(self, tools_menu): """ Give the SongUsage plugin the opportunity to add items to the From 381e91294fed2938d731123a816b63b4655ff2aa Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sat, 7 Nov 2009 14:58:24 +0000 Subject: [PATCH 16/66] Fix blocking for Active/Inactive --- openlp/core/ui/pluginform.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/openlp/core/ui/pluginform.py b/openlp/core/ui/pluginform.py index 98a7b7d33..a6b57e7c5 100644 --- a/openlp/core/ui/pluginform.py +++ b/openlp/core/ui/pluginform.py @@ -106,6 +106,8 @@ class PluginForm(QtGui.QDialog, Ui_PluginViewDialog): self._clearDetails() def onStatusComboBoxChanged(self, status): + if self.programaticChange: + return self.activePlugin.toggle_status(status) if status == PluginStatus.Active: self.activePlugin.initialise() From 337df8da9f8b75e425601170b34bc8fdfe38ba6c Mon Sep 17 00:00:00 2001 From: Jonathan Corwin Date: Sat, 7 Nov 2009 16:45:49 +0000 Subject: [PATCH 17/66] Fix Impress off-by-one and slow slide update problems Meths found --- openlp/core/ui/slidecontroller.py | 28 +++++++++++-------- .../presentations/lib/impresscontroller.py | 2 +- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index 4e33085a3..3c1a681ab 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -443,7 +443,7 @@ class SlideController(QtGui.QWidget): if self.commandItem and \ self.commandItem.service_item_type == ServiceItemType.Command: Receiver().send_message(u'%s_first'% self.commandItem.name.lower()) - QtCore.QTimer.singleShot(0.5, self.grabMainDisplay) + self.updatePreview() else: self.PreviewListWidget.selectRow(0) self.onSlideSelected() @@ -472,7 +472,7 @@ class SlideController(QtGui.QWidget): if self.commandItem.service_item_type == ServiceItemType.Command: Receiver().send_message(u'%s_slide'% self.commandItem.name.lower(), [row]) if self.isLive: - QtCore.QTimer.singleShot(0.5, self.grabMainDisplay) + self.updatePreview() else: frame = self.serviceitem.frames[row][u'image'] before = time.time() @@ -489,18 +489,24 @@ class SlideController(QtGui.QWidget): The slide has been changed. Update the slidecontroller accordingly """ self.PreviewListWidget.selectRow(row) - QtCore.QTimer.singleShot(0.5, self.grabMainDisplay) + self.updatePreview() - def grabMainDisplay(self): + def updatePreview(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) + # Grab now, but try again in a couple of seconds if slide change is slow + QtCore.QTimer.singleShot(0.5, self.grabMainDisplay) + QtCore.QTimer.singleShot(2.5, self.grabMainDisplay) else: label = self.PreviewListWidget.cellWidget(self.PreviewListWidget.currentRow(), 0) self.SlidePreview.setPixmap(label.pixmap()) + + def grabMainDisplay(self): + rm = self.parent.RenderManager + 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) def onSlideSelectedNext(self): """ @@ -509,7 +515,7 @@ class SlideController(QtGui.QWidget): if self.commandItem and \ self.commandItem.service_item_type == ServiceItemType.Command: Receiver().send_message(u'%s_next'% self.commandItem.name.lower()) - QtCore.QTimer.singleShot(0.5, self.grabMainDisplay) + self.updatePreview() else: row = self.PreviewListWidget.currentRow() + 1 if row == self.PreviewListWidget.rowCount(): @@ -525,7 +531,7 @@ class SlideController(QtGui.QWidget): self.commandItem.service_item_type == ServiceItemType.Command: Receiver().send_message( u'%s_previous'% self.commandItem.name.lower()) - QtCore.QTimer.singleShot(0.5, self.grabMainDisplay) + self.updatePreview() else: row = self.PreviewListWidget.currentRow() - 1 if row == -1: @@ -540,7 +546,7 @@ class SlideController(QtGui.QWidget): if self.commandItem and \ self.commandItem.service_item_type == ServiceItemType.Command: Receiver().send_message(u'%s_last'% self.commandItem.name.lower()) - QtCore.QTimer.singleShot(0.5, self.grabMainDisplay) + self.updatePreview() else: self.PreviewListWidget.selectRow(self.PreviewListWidget.rowCount() - 1) self.onSlideSelected() diff --git a/openlp/plugins/presentations/lib/impresscontroller.py b/openlp/plugins/presentations/lib/impresscontroller.py index 992b4c1ad..a1db9358a 100644 --- a/openlp/plugins/presentations/lib/impresscontroller.py +++ b/openlp/plugins/presentations/lib/impresscontroller.py @@ -272,7 +272,7 @@ class ImpressController(PresentationController): self.goto_slide(1) def get_slide_number(self): - return self.controller.getCurrentSlideIndex() + return self.controller.getCurrentSlideIndex() + 1 def get_slide_count(self): return self.document.getDrawPages().getCount() From 66a6dfd42aae0baa353846747d3a549ab43d82e0 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sun, 8 Nov 2009 08:58:31 +0000 Subject: [PATCH 18/66] Add icon to slidecontroller/nAdd inital icons /nFix ToolBar for Media" --- bible.cgi?word=Exodus+2 | 845 ++++++++++++++++++++++++++++ bible.html | 429 ++++++++++++++ index.php?search=Ruth+1 | 461 +++++++++++++++ openlp/core/ui/slidecontroller.py | 28 +- page-simple.png | Bin 0 -> 357 bytes resources/forms/amendthemedialog.py | 597 ++++++++++++++++++++ resources/images/openlp-2.qrc | 16 + 7 files changed, 2367 insertions(+), 9 deletions(-) create mode 100644 bible.cgi?word=Exodus+2 create mode 100644 bible.html create mode 100644 index.php?search=Ruth+1 create mode 100644 page-simple.png create mode 100644 resources/forms/amendthemedialog.py diff --git a/bible.cgi?word=Exodus+2 b/bible.cgi?word=Exodus+2 new file mode 100644 index 000000000..9bf8f4da0 --- /dev/null +++ b/bible.cgi?word=Exodus+2 @@ -0,0 +1,845 @@ + + + + + + + Exodus 2 - New International Version - NIV - Study Bible Online + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+ +
+ + +
+
+ + + +
+
+
+
+
+ + + + +
+
+ + + Search The Bible +    + + + + + + + + + + + +
+ +
+
+
+ + +
+
Featured Sponsors
+
+
+ + + + + + + +
+
+ + + + + + +
+
+ + + + + + + +
+ + + +
+
+ +
+ +
+
+
+ +
+ + +
+ Online Bible Study Tools +
+
+ + + + +
+ + + +
+
+ +
+ + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +   +
+ +
+ +
+ + +
+ +
+ + + + + + + + + + + + + + + + + +
Online Study Bible
+
  
+
Search forin:
+ + + + + +
+ using: + + +
New Search  |  Include Study Tools | Online Study Tools Help
of 40
 
 
New International Version   
Exodus 2 - Study This Chapter
 

1 Now a man of the house of Levi married a Levite woman, 2 and she became pregnant and gave birth to a son. When she saw that he was a fine child, she hid him for three months. 3 But when she could hide him no longer, she got a papyrus basket for him and coated it with tar and pitch. Then she placed the child in it and put it among the reeds along the bank of the Nile. 4 His sister stood at a distance to see what would happen to him.

5 Then Pharaoh's daughter went down to the Nile to bathe, and her attendants were walking along the river bank. She saw the basket among the reeds and sent her slave girl to get it. 6 She opened it and saw the baby. He was crying, and she felt sorry for him. "This is one of the Hebrew babies," she said. 7 Then his sister asked Pharaoh's daughter, "Shall I go and get one of the Hebrew women to nurse the baby for you?" 8 "Yes, go," she answered. And the girl went and got the baby's mother. 9 Pharaoh's daughter said to her, "Take this baby and nurse him for me, and I will pay you." So the woman took the baby and nursed him. 10 When the child grew older, she took him to Pharaoh's daughter and he became her son. She named him Moses, saying, "I drew him out of the water."

11 One day, after Moses had grown up, he went out to where his own people were and watched them at their hard labor. He saw an Egyptian beating a Hebrew, one of his own people. 12 Glancing this way and that and seeing no one, he killed the Egyptian and hid him in the sand. 13 The next day he went out and saw two Hebrews fighting. He asked the one in the wrong, "Why are you hitting your fellow Hebrew?" 14 The man said, "Who made you ruler and judge over us? Are you thinking of killing me as you killed the Egyptian?" Then Moses was afraid and thought, "What I did must have become known." 15 When Pharaoh heard of this, he tried to kill Moses, but Moses fled from Pharaoh and went to live in Midian, where he sat down by a well.

16 Now a priest of Midian had seven daughters, and they came to draw water and fill the troughs to water their father's flock. 17 Some shepherds came along and drove them away, but Moses got up and came to their rescue and watered their flock. 18 When the girls returned to Reuel their father, he asked them, "Why have you returned so early today?" 19 They answered, "An Egyptian rescued us from the shepherds. He even drew water for us and watered the flock." 20 "And where is he?" he asked his daughters. "Why did you leave him? Invite him to have something to eat." 21 Moses agreed to stay with the man, who gave his daughter Zipporah to Moses in marriage. 22 Zipporah gave birth to a son, and Moses named him Gershom, saying, "I have become an alien in a foreign land."

23 During that long period, the king of Egypt died. The Israelites groaned in their slavery and cried out, and their cry for help because of their slavery went up to God. 24 God heard their groaning and he remembered his covenant with Abraham, with Isaac and with Jacob. 25 So God looked on the Israelites and was concerned about them.

New International Version

 
+ +
+ +
+ +
+ + +
+ +
+ + +
+ +
+ +
+
+ + + + +
+
+
+
E-MAIL NEWSLETTERS
+ +
+ + +
+ + +
+ + + +
+ + +
+ + +
+ + + + + + + + +
+
+
+
+ There was an error processing this request. We cannot subscribe you to newsletters at this time. + Please contact technical support with details. +
+ +
+
+
+ + + +
+ +
+
+ + +
+
+
+ +
+ + + + + + + + + diff --git a/bible.html b/bible.html new file mode 100644 index 000000000..1b55693b5 --- /dev/null +++ b/bible.html @@ -0,0 +1,429 @@ + + + +Ruth 1 - Passage Lookup - 1940 Bulgarian Bible - BibleGateway.com + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ +BibleGateway.com + +
+ + + + + + + + + + + +
+
+ + + +
+
+A +A +A +A +A + +
+ +en + + +
+
+ + + + + + + + +
+ +
Passage results: 

Рут 1 (1940 Bulgarian Bible)

+
+
 
+

Рут 1 (1940 Bulgarian Bible)

+
+

Рут 1

 1 Ð’ дните когато Ñъдиите Ñъдеха, наÑтана глад в земÑта. И един човек от Витлеем Юдов отиде да преÑтои в МоавÑката земÑ, той, и жена му, и двамата му Ñина.

 2 Името на човека беше Елимелех, а името на жена му Ðоемин, а имената на двамата му Ñина Маалон и Хелеон; те бÑха ефратци от Витлеем Юдов. И дойдоха в МоавÑката Ð·ÐµÐ¼Ñ Ð¸ там оÑтанаха.

 3 И Елимелех, мъжът на Ðоемин, умрÑ; и Ñ‚Ñ Ð¾Ñтана Ñ Ð´Ð²Ð°Ð¼Ð°Ñ‚Ð° Ñи Ñина.

 4 И те Ñи взеха жени моавки, <на които> името на едната беше Орфа, а името на другата Рут; и живÑха там около деÑет години.

 5 Тогава умрÑха Маалон и Хелеон, и двамата, тъй че жената Ñе лиши от двамата Ñи Ñина и от мъжа Ñи.

 6 След това Ñ‚Ñ Ñтана ÑÑŠÑ Ñнахите Ñи да Ñе върне от МоавÑката земÑ, защото беше чула в МоавÑката земÑ, че ГоÑпод поÑетил людете Си и им дал хлÑб.

 7 И тъй, Ñ‚Ñ Ð¸Ð·Ð»ÐµÐ·Ðµ от мÑÑтото, гдето беше, и двете й Ñнахи Ñ Ð½ÐµÑ, и вървÑха по Ð¿ÑŠÑ‚Ñ Ð´Ð° Ñе върнат в Юдовата земÑ.

 8 Сетне Ðоемин каза на двете Ñи Ñнахи: Идете, върнете Ñе вÑÑка в дома на майка Ñи. ГоÑпод да поÑтъпва Ñ Ð±Ð»Ð°Ð³Ð¾ÑÑ‚ към ваÑ, както вие поÑтъпвахте към умрелите и към мене.

 9 ГоÑпод да ви даде да намерите ÑпокойÑтвие, вÑÑка в дома на мъжа Ñи. Тогава ги целуна; а те плакаха Ñ Ð²Ð¸Ñок глаÑ.

 10 И рекоха й: Ðе, но Ñ Ñ‚ÐµÐ±Ðµ ще Ñе върнем при твоите люде.

 11 Ðо Ðоемин каза: Върнете Ñе, дъщери мои, защо да дойдете Ñ Ð¼ÐµÐ½Ðµ? Имам ли още Ñинове в утробата Ñи, за да ви Ñтанат мъже?

 12 Върнете Ñе, дъщери мои, идете защото оÑтарÑÑ… и не Ñъм вече за мъж. Ðко бих и рекла: Имам надежда; даже ако Ñе омъжех Ñ‚Ð°Ñ Ð½Ð¾Ñ‰, па и родÑÑ… Ñинове,

 13 вие бихте ли ги чакали догде пораÑтат? Бихте ли Ñе въздържали заради Ñ‚ÑÑ… да Ñе не омъжите? Ðе, дъщери мои; <върнете Ñе>, понеже Ñъм много огорчена заради ваÑ, гдето ГоÑподната ръка Ñе е проÑтирала против мене.

 14 Ркато плакаха пак Ñ Ð²Ð¸Ñок глаÑ, Орфа целуна Ñвекърва Ñи, а Рут Ñе привърза при неÑ.

 15 Тогава рече Ðоемин: Ето, етърва ти Ñе върна при людете Ñи и при боговете Ñи; върни Ñе и ти подир етърва Ñи.

 16 РРут каза: Ðе ме умолÑвай да те оÑÑ‚Ð°Ð²Ñ Ð¸ да не дойда подире ти; защото, гдето идеш ти, и аз ще ида, и гдето оÑтанеш, и аз ще оÑтана; твоите люде ще бъдат мои люде, и твоÑÑ‚ Бог мой Бог;

 17 гдето умреш ти, и аз ще умра, и там ще Ñе погреба; така да ми направи ГоÑпод, да! и повече да притури, ако друго, оÑвен Ñмъртта, ме разлъчи от тебе.

 18 И <Ðоемин>, като видÑ, че Ñ‚Ñ Ð½Ð°ÑтоÑваше да иде Ñ Ð½ÐµÑ, преÑтана да й говори.

 19 И тъй, двете вървÑха докато дойдоха във Витлеем. И когато Ñтигнаха във Витлеем, целиÑÑ‚ град Ñе раздвижи поради Ñ‚ÑÑ…; и жените думаха: Това ли е Ðоемин?

 20 Ð Ñ‚Ñ Ð¸Ð¼ каза: Ðе ме наричайте Ðоемин {Т.е., БлагоугодноÑÑ‚.} наричайте ме Мара {Т.е., ГореÑÑ‚.} защото Ð’ÑеÑилниÑÑ‚ ме твърде огорчи.

 21 Пълна излÑзох; а ГоÑпод ме доведе празна. Защо ме наричате Ðоемин, тъй като ГоÑпод е заÑвил против мене, и Ð’ÑеÑилниÑÑ‚ ме е оÑкърбил?

 22 Така Ñе върна Ðоемин, и Ñ Ð½ÐµÑ Ñнаха й Рут, моавката, коÑто дойде от МоавÑката земÑ. Те Ñтигнаха във Витлеем в началото на ечемичната жетва.

+
+1940 Bulgarian Bible (BG1940)

© 1995-2005 by Bibliata.com

+
 
+
+ + + + + +
+
+
+ +
+
+
+ +
+ + + + + + + + + + + + + + + diff --git a/index.php?search=Ruth+1 b/index.php?search=Ruth+1 new file mode 100644 index 000000000..1f67d32b1 --- /dev/null +++ b/index.php?search=Ruth+1 @@ -0,0 +1,461 @@ + + + +Ruth 1 - Passage Lookup - New International Version - BibleGateway.com + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ +BibleGateway.com + +
+ + + + + + + + + + + +
+
+ + + +
+
+A +A +A +A +A + +
+ +en + + +
+
+ + + + + + + + +
+ +
Passage results: 

Ruth 1 (New International Version)

+
+
 
+
+

Ruth 1 (New International Version)

+
+

Ruth 1

Naomi and Ruth
 1 In the days when the judges ruled, [a] there was a famine in the land, and a man from Bethlehem in Judah, together with his wife and two sons, went to live for a while in the country of Moab. 2 The man's name was Elimelech, his wife's name Naomi, and the names of his two sons were Mahlon and Kilion. They were Ephrathites from Bethlehem, Judah. And they went to Moab and lived there.

 3 Now Elimelech, Naomi's husband, died, and she was left with her two sons. 4 They married Moabite women, one named Orpah and the other Ruth. After they had lived there about ten years, 5 both Mahlon and Kilion also died, and Naomi was left without her two sons and her husband.

 6 When she heard in Moab that the LORD had come to the aid of his people by providing food for them, Naomi and her daughters-in-law prepared to return home from there. 7 With her two daughters-in-law she left the place where she had been living and set out on the road that would take them back to the land of Judah.

 8 Then Naomi said to her two daughters-in-law, "Go back, each of you, to your mother's home. May the LORD show kindness to you, as you have shown to your dead and to me. 9 May the LORD grant that each of you will find rest in the home of another husband."
      Then she kissed them and they wept aloud 10 and said to her, "We will go back with you to your people."

 11 But Naomi said, "Return home, my daughters. Why would you come with me? Am I going to have any more sons, who could become your husbands? 12 Return home, my daughters; I am too old to have another husband. Even if I thought there was still hope for me—even if I had a husband tonight and then gave birth to sons- 13 would you wait until they grew up? Would you remain unmarried for them? No, my daughters. It is more bitter for me than for you, because the LORD's hand has gone out against me!"

 14 At this they wept again. Then Orpah kissed her mother-in-law good-by, but Ruth clung to her.

 15 "Look," said Naomi, "your sister-in-law is going back to her people and her gods. Go back with her."

 16 But Ruth replied, "Don't urge me to leave you or to turn back from you. Where you go I will go, and where you stay I will stay. Your people will be my people and your God my God. 17 Where you die I will die, and there I will be buried. May the LORD deal with me, be it ever so severely, if anything but death separates you and me." 18 When Naomi realized that Ruth was determined to go with her, she stopped urging her.

 19 So the two women went on until they came to Bethlehem. When they arrived in Bethlehem, the whole town was stirred because of them, and the women exclaimed, "Can this be Naomi?"

 20 "Don't call me Naomi, [b] " she told them. "Call me Mara, [c] because the Almighty [d] has made my life very bitter. 21 I went away full, but the LORD has brought me back empty. Why call me Naomi? The LORD has afflicted [e] me; the Almighty has brought misfortune upon me."

 22 So Naomi returned from Moab accompanied by Ruth the Moabitess, her daughter-in-law, arriving in Bethlehem as the barley harvest was beginning.

Footnotes:
  1. Ruth 1:1 Traditionally judged
  2. + +
  3. Ruth 1:20 Naomi means pleasant ; also in verse 21.
  4. + +
  5. Ruth 1:20 Mara means bitter .
  6. + +
  7. Ruth 1:20 Hebrew Shaddai ; also in verse 21
  8. + +
  9. Ruth 1:21 Or has testified against
  10. + +
+
+
+New International Version (NIV)

Copyright © 1973, 1978, 1984 by Biblica

+
 
+
+ + + + + +
+
+
+ +
+
+
+ +
+ + + + + + + + + + + + + + + diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index 18cf1fb9a..fc23e8b68 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -85,9 +85,15 @@ class SlideController(QtGui.QWidget): u'Media Stop', u'Media Pause' ] - self.song_list = [ + self.song_edit_list = [ u'Edit Song', ] + self.song_list = [ + u'First Slide', + u'Previous Slide', + u'Next Slide', + u'Last Slide', + ] self.timer_id = 0 self.commandItem = None self.songEdit = False @@ -195,16 +201,16 @@ class SlideController(QtGui.QWidget): if isLive: self.Songbar = OpenLPToolbar(self) self.Songbar.addToolbarButton( - u'Bridge', u':/slides/slide_close.png', + u'Bridge', u':/pages/page_bridge.png', self.trUtf8(u'Bridge'), self.onSongBarHandler) self.Songbar.addToolbarButton( - u'Chorus', u':/slides/slide_close.png', + u'Chorus', u':/pages/page_chorus.png', self.trUtf8(u'Chorus'), self.onSongBarHandler) - for verse in range(1, 20): + for verse in range(1, 12): self.Songbar.addToolbarButton( - unicode(verse), u':/slides/slide_close.png', + unicode(verse), u':/pages/page_%s.png' % verse, unicode(self.trUtf8(u'Verse %s'))%verse, self.onSongBarHandler) self.ControllerLayout.addWidget(self.Songbar) @@ -252,7 +258,7 @@ class SlideController(QtGui.QWidget): self.Toolbar.makeWidgetsInvisible(self.image_list) self.Toolbar.makeWidgetsInvisible(self.media_list) else: - self.Toolbar.makeWidgetsInvisible(self.song_list) + self.Toolbar.makeWidgetsInvisible(self.song_edit_list) if isLive: prefix = u'live_slidecontroller' else: @@ -303,6 +309,7 @@ class SlideController(QtGui.QWidget): self.Songbar.setVisible(False) self.Toolbar.makeWidgetsInvisible(self.image_list) self.Toolbar.makeWidgetsInvisible(self.media_list) + self.Toolbar.makeWidgetsVisible(self.song_list) if item.service_item_type == ServiceItemType.Text: self.Toolbar.makeWidgetsInvisible(self.image_list) if item.name == u'Songs' and \ @@ -324,6 +331,7 @@ class SlideController(QtGui.QWidget): self.Toolbar.makeWidgetsVisible(self.image_list) elif item.service_item_type == ServiceItemType.Command and \ item.name == u'Media': + self.Toolbar.makeWidgetsInvisible(self.song_list) self.Toolbar.makeWidgetsVisible(self.media_list) def enablePreviewToolBar(self, item): @@ -331,9 +339,9 @@ class SlideController(QtGui.QWidget): Allows the Preview toolbar to be customised """ if (item.name == u'Songs' or item.name == u'Custom') and item.fromPlugin: - self.Toolbar.makeWidgetsVisible(self.song_list) + self.Toolbar.makeWidgetsVisible(self.song_edit_list) else: - self.Toolbar.makeWidgetsInvisible(self.song_list) + self.Toolbar.makeWidgetsInvisible(self.song_edit_list) def addServiceItem(self, item): """ @@ -393,6 +401,8 @@ class SlideController(QtGui.QWidget): Display the slide number passed """ log.debug(u'displayServiceManagerItems Start') + #Set pointing cursor when we have somthing to point at + self.PreviewListWidget.setCursor(QtCore.Qt.PointingHandCursor) before = time.time() self.serviceitem = serviceitem self.PreviewListWidget.clear() @@ -499,7 +509,7 @@ class SlideController(QtGui.QWidget): else: label = self.PreviewListWidget.cellWidget(self.PreviewListWidget.currentRow(), 0) self.SlidePreview.setPixmap(label.pixmap()) - + def grabMainDisplay(self): rm = self.parent.RenderManager winid = QtGui.QApplication.desktop().winId() diff --git a/page-simple.png b/page-simple.png new file mode 100644 index 0000000000000000000000000000000000000000..a4b2f7491a6f9df0cfb8fd9c178eea67df938afe GIT binary patch literal 357 zcmeAS@N?(olHy`uVBq!ia0vp^Vj#@H1|*Mc$*~4fjKx9jP7LeL$-D$|*pj^6T^Rm@ z;DWu&Cj&(|3p^r=85md&fiUBq^AjY1g6t)pzOL*y**JLA#CjRON&;}dR!5?U!&f@c)}4A-*fAE z4K_>3C~`h|)1-P(=h_1nO@~j17}HkTbqO#%yUE`Ep+F>lL-{fOhf{<+oF)}(cNF=C z7xa9TYulc;cYoV;uJFUVTiq`4PH$WtGy9rW^;W;|vjsPQhZ~q5SaUW)I&IB=R{Q+B yVfG&P-xpZyF}tf!yZ`sk4;3}HYi2$>rf$R#%egY(^KGDq89ZJ6T-G@yGywn!|B%f9 literal 0 HcmV?d00001 diff --git a/resources/forms/amendthemedialog.py b/resources/forms/amendthemedialog.py new file mode 100644 index 000000000..490c92b58 --- /dev/null +++ b/resources/forms/amendthemedialog.py @@ -0,0 +1,597 @@ +# -*- coding: utf-8 -*- + +# Form implementation generated from reading ui file 'amendthemedialog.ui' +# +# Created: Thu Oct 22 17:14:44 2009 +# by: PyQt4 UI code generator 4.5.4 +# +# WARNING! All changes made in this file will be lost! + +from PyQt4 import QtCore, QtGui + +class Ui_AmendThemeDialog(object): + def setupUi(self, AmendThemeDialog): + AmendThemeDialog.setObjectName("AmendThemeDialog") + AmendThemeDialog.setWindowModality(QtCore.Qt.ApplicationModal) + AmendThemeDialog.resize(586, 651) + icon = QtGui.QIcon() + icon.addPixmap(QtGui.QPixmap(":/icon/openlp.org-icon-32.bmp"), QtGui.QIcon.Normal, QtGui.QIcon.Off) + AmendThemeDialog.setWindowIcon(icon) + AmendThemeDialog.setModal(True) + self.AmendThemeLayout = QtGui.QVBoxLayout(AmendThemeDialog) + self.AmendThemeLayout.setSpacing(8) + self.AmendThemeLayout.setMargin(8) + self.AmendThemeLayout.setObjectName("AmendThemeLayout") + self.ThemeNameWidget = QtGui.QWidget(AmendThemeDialog) + self.ThemeNameWidget.setObjectName("ThemeNameWidget") + self.ThemeNameLayout = QtGui.QHBoxLayout(self.ThemeNameWidget) + self.ThemeNameLayout.setSpacing(8) + self.ThemeNameLayout.setMargin(0) + self.ThemeNameLayout.setObjectName("ThemeNameLayout") + self.ThemeNameLabel = QtGui.QLabel(self.ThemeNameWidget) + self.ThemeNameLabel.setObjectName("ThemeNameLabel") + self.ThemeNameLayout.addWidget(self.ThemeNameLabel) + self.ThemeNameEdit = QtGui.QLineEdit(self.ThemeNameWidget) + self.ThemeNameEdit.setObjectName("ThemeNameEdit") + self.ThemeNameLayout.addWidget(self.ThemeNameEdit) + self.AmendThemeLayout.addWidget(self.ThemeNameWidget) + self.ContentWidget = QtGui.QWidget(AmendThemeDialog) + self.ContentWidget.setObjectName("ContentWidget") + self.ContentLayout = QtGui.QHBoxLayout(self.ContentWidget) + self.ContentLayout.setSpacing(8) + self.ContentLayout.setMargin(0) + self.ContentLayout.setObjectName("ContentLayout") + self.ThemeTabWidget = QtGui.QTabWidget(self.ContentWidget) + self.ThemeTabWidget.setObjectName("ThemeTabWidget") + self.BackgroundTab = QtGui.QWidget() + self.BackgroundTab.setObjectName("BackgroundTab") + self.BackgroundLayout = QtGui.QFormLayout(self.BackgroundTab) + self.BackgroundLayout.setMargin(8) + self.BackgroundLayout.setSpacing(8) + self.BackgroundLayout.setObjectName("BackgroundLayout") + self.BackgroundLabel = QtGui.QLabel(self.BackgroundTab) + self.BackgroundLabel.setObjectName("BackgroundLabel") + self.BackgroundLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.BackgroundLabel) + self.BackgroundComboBox = QtGui.QComboBox(self.BackgroundTab) + self.BackgroundComboBox.setObjectName("BackgroundComboBox") + self.BackgroundComboBox.addItem(QtCore.QString()) + self.BackgroundComboBox.addItem(QtCore.QString()) + self.BackgroundLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.BackgroundComboBox) + self.BackgroundTypeLabel = QtGui.QLabel(self.BackgroundTab) + self.BackgroundTypeLabel.setObjectName("BackgroundTypeLabel") + self.BackgroundLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.BackgroundTypeLabel) + self.BackgroundTypeComboBox = QtGui.QComboBox(self.BackgroundTab) + self.BackgroundTypeComboBox.setObjectName("BackgroundTypeComboBox") + self.BackgroundTypeComboBox.addItem(QtCore.QString()) + self.BackgroundTypeComboBox.addItem(QtCore.QString()) + self.BackgroundTypeComboBox.addItem(QtCore.QString()) + self.BackgroundLayout.setWidget(1, QtGui.QFormLayout.FieldRole, self.BackgroundTypeComboBox) + self.Color1Label = QtGui.QLabel(self.BackgroundTab) + self.Color1Label.setObjectName("Color1Label") + self.BackgroundLayout.setWidget(2, QtGui.QFormLayout.LabelRole, self.Color1Label) + self.Color1PushButton = QtGui.QPushButton(self.BackgroundTab) + self.Color1PushButton.setObjectName("Color1PushButton") + self.BackgroundLayout.setWidget(2, QtGui.QFormLayout.FieldRole, self.Color1PushButton) + self.Color2Label = QtGui.QLabel(self.BackgroundTab) + self.Color2Label.setObjectName("Color2Label") + self.BackgroundLayout.setWidget(3, QtGui.QFormLayout.LabelRole, self.Color2Label) + self.Color2PushButton = QtGui.QPushButton(self.BackgroundTab) + self.Color2PushButton.setObjectName("Color2PushButton") + self.BackgroundLayout.setWidget(3, QtGui.QFormLayout.FieldRole, self.Color2PushButton) + self.ImageLabel = QtGui.QLabel(self.BackgroundTab) + self.ImageLabel.setObjectName("ImageLabel") + self.BackgroundLayout.setWidget(4, QtGui.QFormLayout.LabelRole, self.ImageLabel) + self.GradientLabel = QtGui.QLabel(self.BackgroundTab) + self.GradientLabel.setObjectName("GradientLabel") + self.BackgroundLayout.setWidget(6, QtGui.QFormLayout.LabelRole, self.GradientLabel) + self.GradientComboBox = QtGui.QComboBox(self.BackgroundTab) + self.GradientComboBox.setObjectName("GradientComboBox") + self.GradientComboBox.addItem(QtCore.QString()) + self.GradientComboBox.addItem(QtCore.QString()) + self.GradientComboBox.addItem(QtCore.QString()) + self.BackgroundLayout.setWidget(6, QtGui.QFormLayout.FieldRole, self.GradientComboBox) + self.ImageFilenameWidget = QtGui.QWidget(self.BackgroundTab) + self.ImageFilenameWidget.setObjectName("ImageFilenameWidget") + self.horizontalLayout_2 = QtGui.QHBoxLayout(self.ImageFilenameWidget) + self.horizontalLayout_2.setSpacing(0) + self.horizontalLayout_2.setMargin(0) + self.horizontalLayout_2.setObjectName("horizontalLayout_2") + self.ImageLineEdit = QtGui.QLineEdit(self.ImageFilenameWidget) + self.ImageLineEdit.setObjectName("ImageLineEdit") + self.horizontalLayout_2.addWidget(self.ImageLineEdit) + self.ImageToolButton = QtGui.QToolButton(self.ImageFilenameWidget) + icon1 = QtGui.QIcon() + icon1.addPixmap(QtGui.QPixmap(":/images/image_load.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.ImageToolButton.setIcon(icon1) + self.ImageToolButton.setObjectName("ImageToolButton") + self.horizontalLayout_2.addWidget(self.ImageToolButton) + self.BackgroundLayout.setWidget(4, QtGui.QFormLayout.FieldRole, self.ImageFilenameWidget) + spacerItem = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) + self.BackgroundLayout.setItem(7, QtGui.QFormLayout.FieldRole, spacerItem) + self.ThemeTabWidget.addTab(self.BackgroundTab, "") + self.FontMainTab = QtGui.QWidget() + self.FontMainTab.setObjectName("FontMainTab") + self.FontMainLayout = QtGui.QHBoxLayout(self.FontMainTab) + self.FontMainLayout.setSpacing(8) + self.FontMainLayout.setMargin(8) + self.FontMainLayout.setObjectName("FontMainLayout") + self.MainLeftWidget = QtGui.QWidget(self.FontMainTab) + self.MainLeftWidget.setObjectName("MainLeftWidget") + self.MainLeftLayout = QtGui.QVBoxLayout(self.MainLeftWidget) + self.MainLeftLayout.setSpacing(8) + self.MainLeftLayout.setMargin(0) + self.MainLeftLayout.setObjectName("MainLeftLayout") + self.FontMainGroupBox = QtGui.QGroupBox(self.MainLeftWidget) + self.FontMainGroupBox.setObjectName("FontMainGroupBox") + self.MainFontLayout = QtGui.QFormLayout(self.FontMainGroupBox) + self.MainFontLayout.setFormAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter) + self.MainFontLayout.setMargin(8) + self.MainFontLayout.setSpacing(8) + self.MainFontLayout.setObjectName("MainFontLayout") + self.FontMainlabel = QtGui.QLabel(self.FontMainGroupBox) + self.FontMainlabel.setObjectName("FontMainlabel") + self.MainFontLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.FontMainlabel) + self.FontMainComboBox = QtGui.QFontComboBox(self.FontMainGroupBox) + self.FontMainComboBox.setObjectName("FontMainComboBox") + self.MainFontLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.FontMainComboBox) + self.FontMainColorLabel = QtGui.QLabel(self.FontMainGroupBox) + self.FontMainColorLabel.setObjectName("FontMainColorLabel") + self.MainFontLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.FontMainColorLabel) + self.FontMainColorPushButton = QtGui.QPushButton(self.FontMainGroupBox) + self.FontMainColorPushButton.setObjectName("FontMainColorPushButton") + self.MainFontLayout.setWidget(1, QtGui.QFormLayout.FieldRole, self.FontMainColorPushButton) + self.FontMainSize = QtGui.QLabel(self.FontMainGroupBox) + self.FontMainSize.setObjectName("FontMainSize") + self.MainFontLayout.setWidget(2, QtGui.QFormLayout.LabelRole, self.FontMainSize) + self.FontMainSizeSpinBox = QtGui.QSpinBox(self.FontMainGroupBox) + sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.FontMainSizeSpinBox.sizePolicy().hasHeightForWidth()) + self.FontMainSizeSpinBox.setSizePolicy(sizePolicy) + self.FontMainSizeSpinBox.setMinimumSize(QtCore.QSize(70, 0)) + self.FontMainSizeSpinBox.setMaximum(999) + self.FontMainSizeSpinBox.setProperty("value", QtCore.QVariant(16)) + self.FontMainSizeSpinBox.setObjectName("FontMainSizeSpinBox") + self.MainFontLayout.setWidget(2, QtGui.QFormLayout.FieldRole, self.FontMainSizeSpinBox) + self.FontMainWrapIndentationLabel = QtGui.QLabel(self.FontMainGroupBox) + self.FontMainWrapIndentationLabel.setObjectName("FontMainWrapIndentationLabel") + self.MainFontLayout.setWidget(3, QtGui.QFormLayout.LabelRole, self.FontMainWrapIndentationLabel) + self.FontMainLineSpacingSpinBox = QtGui.QSpinBox(self.FontMainGroupBox) + self.FontMainLineSpacingSpinBox.setObjectName("FontMainLineSpacingSpinBox") + self.MainFontLayout.setWidget(3, QtGui.QFormLayout.FieldRole, self.FontMainLineSpacingSpinBox) + self.FontMainLinesPageLabel = QtGui.QLabel(self.FontMainGroupBox) + self.FontMainLinesPageLabel.setObjectName("FontMainLinesPageLabel") + self.MainFontLayout.setWidget(4, QtGui.QFormLayout.LabelRole, self.FontMainLinesPageLabel) + self.MainLeftLayout.addWidget(self.FontMainGroupBox) + spacerItem1 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) + self.MainLeftLayout.addItem(spacerItem1) + self.FontMainLayout.addWidget(self.MainLeftWidget) + self.MainRightWidget = QtGui.QWidget(self.FontMainTab) + self.MainRightWidget.setObjectName("MainRightWidget") + self.MainRightLayout = QtGui.QVBoxLayout(self.MainRightWidget) + self.MainRightLayout.setSpacing(8) + self.MainRightLayout.setMargin(0) + self.MainRightLayout.setObjectName("MainRightLayout") + self.MainLocationGroupBox = QtGui.QGroupBox(self.MainRightWidget) + self.MainLocationGroupBox.setObjectName("MainLocationGroupBox") + self.MainLocationLayout = QtGui.QFormLayout(self.MainLocationGroupBox) + self.MainLocationLayout.setMargin(8) + self.MainLocationLayout.setSpacing(8) + self.MainLocationLayout.setObjectName("MainLocationLayout") + self.DefaultLocationLabel = QtGui.QLabel(self.MainLocationGroupBox) + self.DefaultLocationLabel.setObjectName("DefaultLocationLabel") + self.MainLocationLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.DefaultLocationLabel) + self.FontMainDefaultCheckBox = QtGui.QCheckBox(self.MainLocationGroupBox) + self.FontMainDefaultCheckBox.setTristate(False) + self.FontMainDefaultCheckBox.setObjectName("FontMainDefaultCheckBox") + self.MainLocationLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.FontMainDefaultCheckBox) + self.FontMainXLabel = QtGui.QLabel(self.MainLocationGroupBox) + self.FontMainXLabel.setObjectName("FontMainXLabel") + self.MainLocationLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.FontMainXLabel) + self.FontMainYLabel = QtGui.QLabel(self.MainLocationGroupBox) + self.FontMainYLabel.setObjectName("FontMainYLabel") + self.MainLocationLayout.setWidget(2, QtGui.QFormLayout.LabelRole, self.FontMainYLabel) + self.FontMainWidthLabel = QtGui.QLabel(self.MainLocationGroupBox) + self.FontMainWidthLabel.setObjectName("FontMainWidthLabel") + self.MainLocationLayout.setWidget(3, QtGui.QFormLayout.LabelRole, self.FontMainWidthLabel) + self.FontMainHeightLabel = QtGui.QLabel(self.MainLocationGroupBox) + self.FontMainHeightLabel.setObjectName("FontMainHeightLabel") + self.MainLocationLayout.setWidget(4, QtGui.QFormLayout.LabelRole, self.FontMainHeightLabel) + self.FontMainXSpinBox = QtGui.QSpinBox(self.MainLocationGroupBox) + sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.FontMainXSpinBox.sizePolicy().hasHeightForWidth()) + self.FontMainXSpinBox.setSizePolicy(sizePolicy) + self.FontMainXSpinBox.setMinimumSize(QtCore.QSize(78, 0)) + self.FontMainXSpinBox.setMaximum(9999) + self.FontMainXSpinBox.setProperty("value", QtCore.QVariant(0)) + self.FontMainXSpinBox.setObjectName("FontMainXSpinBox") + self.MainLocationLayout.setWidget(1, QtGui.QFormLayout.FieldRole, self.FontMainXSpinBox) + self.FontMainYSpinBox = QtGui.QSpinBox(self.MainLocationGroupBox) + sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.FontMainYSpinBox.sizePolicy().hasHeightForWidth()) + self.FontMainYSpinBox.setSizePolicy(sizePolicy) + self.FontMainYSpinBox.setMinimumSize(QtCore.QSize(78, 0)) + self.FontMainYSpinBox.setMaximum(9999) + self.FontMainYSpinBox.setObjectName("FontMainYSpinBox") + self.MainLocationLayout.setWidget(2, QtGui.QFormLayout.FieldRole, self.FontMainYSpinBox) + self.FontMainWidthSpinBox = QtGui.QSpinBox(self.MainLocationGroupBox) + sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.FontMainWidthSpinBox.sizePolicy().hasHeightForWidth()) + self.FontMainWidthSpinBox.setSizePolicy(sizePolicy) + self.FontMainWidthSpinBox.setMinimumSize(QtCore.QSize(78, 0)) + self.FontMainWidthSpinBox.setMaximum(9999) + self.FontMainWidthSpinBox.setObjectName("FontMainWidthSpinBox") + self.MainLocationLayout.setWidget(3, QtGui.QFormLayout.FieldRole, self.FontMainWidthSpinBox) + self.FontMainHeightSpinBox = QtGui.QSpinBox(self.MainLocationGroupBox) + sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.FontMainHeightSpinBox.sizePolicy().hasHeightForWidth()) + self.FontMainHeightSpinBox.setSizePolicy(sizePolicy) + self.FontMainHeightSpinBox.setMinimumSize(QtCore.QSize(78, 0)) + self.FontMainHeightSpinBox.setMaximum(9999) + self.FontMainHeightSpinBox.setObjectName("FontMainHeightSpinBox") + self.MainLocationLayout.setWidget(4, QtGui.QFormLayout.FieldRole, self.FontMainHeightSpinBox) + self.MainRightLayout.addWidget(self.MainLocationGroupBox) + spacerItem2 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) + self.MainRightLayout.addItem(spacerItem2) + self.FontMainLayout.addWidget(self.MainRightWidget) + self.ThemeTabWidget.addTab(self.FontMainTab, "") + self.FontFooterTab = QtGui.QWidget() + self.FontFooterTab.setObjectName("FontFooterTab") + self.FontFooterLayout = QtGui.QHBoxLayout(self.FontFooterTab) + self.FontFooterLayout.setSpacing(8) + self.FontFooterLayout.setMargin(8) + self.FontFooterLayout.setObjectName("FontFooterLayout") + self.FooterLeftWidget = QtGui.QWidget(self.FontFooterTab) + self.FooterLeftWidget.setObjectName("FooterLeftWidget") + self.FooterLeftLayout = QtGui.QVBoxLayout(self.FooterLeftWidget) + self.FooterLeftLayout.setSpacing(8) + self.FooterLeftLayout.setMargin(0) + self.FooterLeftLayout.setObjectName("FooterLeftLayout") + self.FooterFontGroupBox = QtGui.QGroupBox(self.FooterLeftWidget) + self.FooterFontGroupBox.setObjectName("FooterFontGroupBox") + self.FooterFontLayout = QtGui.QFormLayout(self.FooterFontGroupBox) + self.FooterFontLayout.setFieldGrowthPolicy(QtGui.QFormLayout.ExpandingFieldsGrow) + self.FooterFontLayout.setFormAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter) + self.FooterFontLayout.setMargin(8) + self.FooterFontLayout.setSpacing(8) + self.FooterFontLayout.setObjectName("FooterFontLayout") + self.FontFooterLabel = QtGui.QLabel(self.FooterFontGroupBox) + self.FontFooterLabel.setObjectName("FontFooterLabel") + self.FooterFontLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.FontFooterLabel) + self.FontFooterComboBox = QtGui.QFontComboBox(self.FooterFontGroupBox) + self.FontFooterComboBox.setObjectName("FontFooterComboBox") + self.FooterFontLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.FontFooterComboBox) + self.FontFooterColorLabel = QtGui.QLabel(self.FooterFontGroupBox) + self.FontFooterColorLabel.setObjectName("FontFooterColorLabel") + self.FooterFontLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.FontFooterColorLabel) + self.FontFooterColorPushButton = QtGui.QPushButton(self.FooterFontGroupBox) + self.FontFooterColorPushButton.setObjectName("FontFooterColorPushButton") + self.FooterFontLayout.setWidget(1, QtGui.QFormLayout.FieldRole, self.FontFooterColorPushButton) + self.FontFooterSizeLabel = QtGui.QLabel(self.FooterFontGroupBox) + self.FontFooterSizeLabel.setObjectName("FontFooterSizeLabel") + self.FooterFontLayout.setWidget(2, QtGui.QFormLayout.LabelRole, self.FontFooterSizeLabel) + self.FontFooterSizeSpinBox = QtGui.QSpinBox(self.FooterFontGroupBox) + sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.FontFooterSizeSpinBox.sizePolicy().hasHeightForWidth()) + self.FontFooterSizeSpinBox.setSizePolicy(sizePolicy) + self.FontFooterSizeSpinBox.setMinimumSize(QtCore.QSize(70, 0)) + self.FontFooterSizeSpinBox.setMaximum(999) + self.FontFooterSizeSpinBox.setProperty("value", QtCore.QVariant(10)) + self.FontFooterSizeSpinBox.setObjectName("FontFooterSizeSpinBox") + self.FooterFontLayout.setWidget(2, QtGui.QFormLayout.FieldRole, self.FontFooterSizeSpinBox) + self.FooterLeftLayout.addWidget(self.FooterFontGroupBox) + spacerItem3 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) + self.FooterLeftLayout.addItem(spacerItem3) + self.FontFooterLayout.addWidget(self.FooterLeftWidget) + self.FooterRightWidget = QtGui.QWidget(self.FontFooterTab) + self.FooterRightWidget.setObjectName("FooterRightWidget") + self.FooterRightLayout = QtGui.QVBoxLayout(self.FooterRightWidget) + self.FooterRightLayout.setSpacing(8) + self.FooterRightLayout.setMargin(0) + self.FooterRightLayout.setObjectName("FooterRightLayout") + self.LocationFooterGroupBox = QtGui.QGroupBox(self.FooterRightWidget) + self.LocationFooterGroupBox.setObjectName("LocationFooterGroupBox") + self.LocationFooterLayout = QtGui.QFormLayout(self.LocationFooterGroupBox) + self.LocationFooterLayout.setFieldGrowthPolicy(QtGui.QFormLayout.ExpandingFieldsGrow) + self.LocationFooterLayout.setFormAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter) + self.LocationFooterLayout.setMargin(8) + self.LocationFooterLayout.setSpacing(8) + self.LocationFooterLayout.setObjectName("LocationFooterLayout") + self.FontFooterDefaultLabel = QtGui.QLabel(self.LocationFooterGroupBox) + self.FontFooterDefaultLabel.setObjectName("FontFooterDefaultLabel") + self.LocationFooterLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.FontFooterDefaultLabel) + self.FontFooterDefaultCheckBox = QtGui.QCheckBox(self.LocationFooterGroupBox) + self.FontFooterDefaultCheckBox.setTristate(False) + self.FontFooterDefaultCheckBox.setObjectName("FontFooterDefaultCheckBox") + self.LocationFooterLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.FontFooterDefaultCheckBox) + self.FontFooterXLabel = QtGui.QLabel(self.LocationFooterGroupBox) + self.FontFooterXLabel.setObjectName("FontFooterXLabel") + self.LocationFooterLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.FontFooterXLabel) + self.FontFooterYLabel = QtGui.QLabel(self.LocationFooterGroupBox) + self.FontFooterYLabel.setObjectName("FontFooterYLabel") + self.LocationFooterLayout.setWidget(2, QtGui.QFormLayout.LabelRole, self.FontFooterYLabel) + self.FontFooterWidthLabel = QtGui.QLabel(self.LocationFooterGroupBox) + self.FontFooterWidthLabel.setObjectName("FontFooterWidthLabel") + self.LocationFooterLayout.setWidget(3, QtGui.QFormLayout.LabelRole, self.FontFooterWidthLabel) + self.FontFooterHeightLabel = QtGui.QLabel(self.LocationFooterGroupBox) + self.FontFooterHeightLabel.setObjectName("FontFooterHeightLabel") + self.LocationFooterLayout.setWidget(4, QtGui.QFormLayout.LabelRole, self.FontFooterHeightLabel) + self.FontFooterXSpinBox = QtGui.QSpinBox(self.LocationFooterGroupBox) + sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.FontFooterXSpinBox.sizePolicy().hasHeightForWidth()) + self.FontFooterXSpinBox.setSizePolicy(sizePolicy) + self.FontFooterXSpinBox.setMinimumSize(QtCore.QSize(78, 0)) + self.FontFooterXSpinBox.setMaximum(9999) + self.FontFooterXSpinBox.setProperty("value", QtCore.QVariant(0)) + self.FontFooterXSpinBox.setObjectName("FontFooterXSpinBox") + self.LocationFooterLayout.setWidget(1, QtGui.QFormLayout.FieldRole, self.FontFooterXSpinBox) + self.FontFooterYSpinBox = QtGui.QSpinBox(self.LocationFooterGroupBox) + sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.FontFooterYSpinBox.sizePolicy().hasHeightForWidth()) + self.FontFooterYSpinBox.setSizePolicy(sizePolicy) + self.FontFooterYSpinBox.setMinimumSize(QtCore.QSize(78, 0)) + self.FontFooterYSpinBox.setMaximum(9999) + self.FontFooterYSpinBox.setProperty("value", QtCore.QVariant(0)) + self.FontFooterYSpinBox.setObjectName("FontFooterYSpinBox") + self.LocationFooterLayout.setWidget(2, QtGui.QFormLayout.FieldRole, self.FontFooterYSpinBox) + self.FontFooterWidthSpinBox = QtGui.QSpinBox(self.LocationFooterGroupBox) + self.FontFooterWidthSpinBox.setMinimumSize(QtCore.QSize(78, 0)) + self.FontFooterWidthSpinBox.setMaximum(9999) + self.FontFooterWidthSpinBox.setObjectName("FontFooterWidthSpinBox") + self.LocationFooterLayout.setWidget(3, QtGui.QFormLayout.FieldRole, self.FontFooterWidthSpinBox) + self.FontFooterHeightSpinBox = QtGui.QSpinBox(self.LocationFooterGroupBox) + self.FontFooterHeightSpinBox.setMinimumSize(QtCore.QSize(78, 0)) + self.FontFooterHeightSpinBox.setMaximum(9999) + self.FontFooterHeightSpinBox.setObjectName("FontFooterHeightSpinBox") + self.LocationFooterLayout.setWidget(4, QtGui.QFormLayout.FieldRole, self.FontFooterHeightSpinBox) + self.FooterRightLayout.addWidget(self.LocationFooterGroupBox) + spacerItem4 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) + self.FooterRightLayout.addItem(spacerItem4) + self.FontFooterLayout.addWidget(self.FooterRightWidget) + self.ThemeTabWidget.addTab(self.FontFooterTab, "") + self.OtherOptionsTab = QtGui.QWidget() + self.OtherOptionsTab.setObjectName("OtherOptionsTab") + self.OtherOptionsLayout = QtGui.QHBoxLayout(self.OtherOptionsTab) + self.OtherOptionsLayout.setSpacing(8) + self.OtherOptionsLayout.setMargin(8) + self.OtherOptionsLayout.setObjectName("OtherOptionsLayout") + self.OptionsLeftWidget = QtGui.QWidget(self.OtherOptionsTab) + self.OptionsLeftWidget.setObjectName("OptionsLeftWidget") + self.OptionsLeftLayout = QtGui.QVBoxLayout(self.OptionsLeftWidget) + self.OptionsLeftLayout.setSpacing(8) + self.OptionsLeftLayout.setMargin(0) + self.OptionsLeftLayout.setObjectName("OptionsLeftLayout") + self.ShadowGroupBox = QtGui.QGroupBox(self.OptionsLeftWidget) + self.ShadowGroupBox.setObjectName("ShadowGroupBox") + self.verticalLayout = QtGui.QVBoxLayout(self.ShadowGroupBox) + self.verticalLayout.setSpacing(8) + self.verticalLayout.setMargin(8) + self.verticalLayout.setObjectName("verticalLayout") + self.OutlineWidget = QtGui.QWidget(self.ShadowGroupBox) + self.OutlineWidget.setObjectName("OutlineWidget") + self.OutlineLayout = QtGui.QFormLayout(self.OutlineWidget) + self.OutlineLayout.setMargin(0) + self.OutlineLayout.setSpacing(8) + self.OutlineLayout.setObjectName("OutlineLayout") + self.OutlineCheckBox = QtGui.QCheckBox(self.OutlineWidget) + self.OutlineCheckBox.setObjectName("OutlineCheckBox") + self.OutlineLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.OutlineCheckBox) + self.OutlineColorLabel = QtGui.QLabel(self.OutlineWidget) + self.OutlineColorLabel.setObjectName("OutlineColorLabel") + self.OutlineLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.OutlineColorLabel) + self.OutlineColorPushButton = QtGui.QPushButton(self.OutlineWidget) + self.OutlineColorPushButton.setObjectName("OutlineColorPushButton") + self.OutlineLayout.setWidget(1, QtGui.QFormLayout.FieldRole, self.OutlineColorPushButton) + self.OutlineEnabledLabel = QtGui.QLabel(self.OutlineWidget) + self.OutlineEnabledLabel.setObjectName("OutlineEnabledLabel") + self.OutlineLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.OutlineEnabledLabel) + self.verticalLayout.addWidget(self.OutlineWidget) + self.ShadowWidget = QtGui.QWidget(self.ShadowGroupBox) + self.ShadowWidget.setObjectName("ShadowWidget") + self.ShadowLayout = QtGui.QFormLayout(self.ShadowWidget) + self.ShadowLayout.setMargin(0) + self.ShadowLayout.setSpacing(8) + self.ShadowLayout.setObjectName("ShadowLayout") + self.ShadowCheckBox = QtGui.QCheckBox(self.ShadowWidget) + self.ShadowCheckBox.setObjectName("ShadowCheckBox") + self.ShadowLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.ShadowCheckBox) + self.ShadowColorLabel = QtGui.QLabel(self.ShadowWidget) + self.ShadowColorLabel.setObjectName("ShadowColorLabel") + self.ShadowLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.ShadowColorLabel) + self.ShadowColorPushButton = QtGui.QPushButton(self.ShadowWidget) + self.ShadowColorPushButton.setObjectName("ShadowColorPushButton") + self.ShadowLayout.setWidget(1, QtGui.QFormLayout.FieldRole, self.ShadowColorPushButton) + self.ShadowEnabledLabel = QtGui.QLabel(self.ShadowWidget) + self.ShadowEnabledLabel.setObjectName("ShadowEnabledLabel") + self.ShadowLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.ShadowEnabledLabel) + self.verticalLayout.addWidget(self.ShadowWidget) + self.OptionsLeftLayout.addWidget(self.ShadowGroupBox) + spacerItem5 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) + self.OptionsLeftLayout.addItem(spacerItem5) + self.OtherOptionsLayout.addWidget(self.OptionsLeftWidget) + self.OptionsRightWidget = QtGui.QWidget(self.OtherOptionsTab) + self.OptionsRightWidget.setObjectName("OptionsRightWidget") + self.OptionsRightLayout = QtGui.QVBoxLayout(self.OptionsRightWidget) + self.OptionsRightLayout.setSpacing(8) + self.OptionsRightLayout.setMargin(0) + self.OptionsRightLayout.setObjectName("OptionsRightLayout") + self.AlignmentGroupBox = QtGui.QGroupBox(self.OptionsRightWidget) + self.AlignmentGroupBox.setObjectName("AlignmentGroupBox") + self.gridLayout_4 = QtGui.QGridLayout(self.AlignmentGroupBox) + self.gridLayout_4.setObjectName("gridLayout_4") + self.HorizontalLabel = QtGui.QLabel(self.AlignmentGroupBox) + self.HorizontalLabel.setObjectName("HorizontalLabel") + self.gridLayout_4.addWidget(self.HorizontalLabel, 0, 0, 1, 1) + self.HorizontalComboBox = QtGui.QComboBox(self.AlignmentGroupBox) + self.HorizontalComboBox.setObjectName("HorizontalComboBox") + self.HorizontalComboBox.addItem(QtCore.QString()) + self.HorizontalComboBox.addItem(QtCore.QString()) + self.HorizontalComboBox.addItem(QtCore.QString()) + self.gridLayout_4.addWidget(self.HorizontalComboBox, 0, 1, 1, 1) + self.VerticalLabel = QtGui.QLabel(self.AlignmentGroupBox) + self.VerticalLabel.setObjectName("VerticalLabel") + self.gridLayout_4.addWidget(self.VerticalLabel, 1, 0, 1, 1) + self.VerticalComboBox = QtGui.QComboBox(self.AlignmentGroupBox) + self.VerticalComboBox.setObjectName("VerticalComboBox") + self.VerticalComboBox.addItem(QtCore.QString()) + self.VerticalComboBox.addItem(QtCore.QString()) + self.VerticalComboBox.addItem(QtCore.QString()) + self.gridLayout_4.addWidget(self.VerticalComboBox, 1, 1, 1, 1) + self.OptionsRightLayout.addWidget(self.AlignmentGroupBox) + spacerItem6 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) + self.OptionsRightLayout.addItem(spacerItem6) + self.OtherOptionsLayout.addWidget(self.OptionsRightWidget) + self.ThemeTabWidget.addTab(self.OtherOptionsTab, "") + self.ContentLayout.addWidget(self.ThemeTabWidget) + self.AmendThemeLayout.addWidget(self.ContentWidget) + self.PreviewGroupBox = QtGui.QGroupBox(AmendThemeDialog) + self.PreviewGroupBox.setObjectName("PreviewGroupBox") + self.ThemePreviewLayout = QtGui.QHBoxLayout(self.PreviewGroupBox) + self.ThemePreviewLayout.setSpacing(8) + self.ThemePreviewLayout.setMargin(8) + self.ThemePreviewLayout.setObjectName("ThemePreviewLayout") + spacerItem7 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) + self.ThemePreviewLayout.addItem(spacerItem7) + self.ThemePreview = QtGui.QLabel(self.PreviewGroupBox) + sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.ThemePreview.sizePolicy().hasHeightForWidth()) + self.ThemePreview.setSizePolicy(sizePolicy) + self.ThemePreview.setMinimumSize(QtCore.QSize(300, 225)) + self.ThemePreview.setFrameShape(QtGui.QFrame.WinPanel) + self.ThemePreview.setFrameShadow(QtGui.QFrame.Sunken) + self.ThemePreview.setLineWidth(1) + self.ThemePreview.setScaledContents(True) + self.ThemePreview.setObjectName("ThemePreview") + self.ThemePreviewLayout.addWidget(self.ThemePreview) + spacerItem8 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) + self.ThemePreviewLayout.addItem(spacerItem8) + self.AmendThemeLayout.addWidget(self.PreviewGroupBox) + self.ThemeButtonBox = QtGui.QDialogButtonBox(AmendThemeDialog) + self.ThemeButtonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok) + self.ThemeButtonBox.setObjectName("ThemeButtonBox") + self.AmendThemeLayout.addWidget(self.ThemeButtonBox) + + self.retranslateUi(AmendThemeDialog) + self.ThemeTabWidget.setCurrentIndex(2) + QtCore.QObject.connect(self.ThemeButtonBox, QtCore.SIGNAL("accepted()"), AmendThemeDialog.accept) + QtCore.QObject.connect(self.ThemeButtonBox, QtCore.SIGNAL("rejected()"), AmendThemeDialog.reject) + QtCore.QMetaObject.connectSlotsByName(AmendThemeDialog) + AmendThemeDialog.setTabOrder(self.ThemeButtonBox, self.ThemeNameEdit) + AmendThemeDialog.setTabOrder(self.ThemeNameEdit, self.ThemeTabWidget) + AmendThemeDialog.setTabOrder(self.ThemeTabWidget, self.BackgroundComboBox) + AmendThemeDialog.setTabOrder(self.BackgroundComboBox, self.BackgroundTypeComboBox) + AmendThemeDialog.setTabOrder(self.BackgroundTypeComboBox, self.Color1PushButton) + AmendThemeDialog.setTabOrder(self.Color1PushButton, self.Color2PushButton) + AmendThemeDialog.setTabOrder(self.Color2PushButton, self.ImageLineEdit) + AmendThemeDialog.setTabOrder(self.ImageLineEdit, self.ImageToolButton) + AmendThemeDialog.setTabOrder(self.ImageToolButton, self.GradientComboBox) + AmendThemeDialog.setTabOrder(self.GradientComboBox, self.FontMainComboBox) + AmendThemeDialog.setTabOrder(self.FontMainComboBox, self.FontMainColorPushButton) + AmendThemeDialog.setTabOrder(self.FontMainColorPushButton, self.FontMainSizeSpinBox) + AmendThemeDialog.setTabOrder(self.FontMainSizeSpinBox, self.FontMainDefaultCheckBox) + AmendThemeDialog.setTabOrder(self.FontMainDefaultCheckBox, self.FontMainXSpinBox) + AmendThemeDialog.setTabOrder(self.FontMainXSpinBox, self.FontMainYSpinBox) + AmendThemeDialog.setTabOrder(self.FontMainYSpinBox, self.FontMainWidthSpinBox) + AmendThemeDialog.setTabOrder(self.FontMainWidthSpinBox, self.FontMainHeightSpinBox) + AmendThemeDialog.setTabOrder(self.FontMainHeightSpinBox, self.FontFooterComboBox) + AmendThemeDialog.setTabOrder(self.FontFooterComboBox, self.FontFooterColorPushButton) + AmendThemeDialog.setTabOrder(self.FontFooterColorPushButton, self.FontFooterSizeSpinBox) + AmendThemeDialog.setTabOrder(self.FontFooterSizeSpinBox, self.FontFooterDefaultCheckBox) + AmendThemeDialog.setTabOrder(self.FontFooterDefaultCheckBox, self.FontFooterXSpinBox) + AmendThemeDialog.setTabOrder(self.FontFooterXSpinBox, self.FontFooterYSpinBox) + AmendThemeDialog.setTabOrder(self.FontFooterYSpinBox, self.FontFooterWidthSpinBox) + AmendThemeDialog.setTabOrder(self.FontFooterWidthSpinBox, self.FontFooterHeightSpinBox) + AmendThemeDialog.setTabOrder(self.FontFooterHeightSpinBox, self.OutlineCheckBox) + AmendThemeDialog.setTabOrder(self.OutlineCheckBox, self.OutlineColorPushButton) + AmendThemeDialog.setTabOrder(self.OutlineColorPushButton, self.ShadowCheckBox) + AmendThemeDialog.setTabOrder(self.ShadowCheckBox, self.ShadowColorPushButton) + AmendThemeDialog.setTabOrder(self.ShadowColorPushButton, self.HorizontalComboBox) + AmendThemeDialog.setTabOrder(self.HorizontalComboBox, self.VerticalComboBox) + + def retranslateUi(self, AmendThemeDialog): + AmendThemeDialog.setWindowTitle(QtGui.QApplication.translate("AmendThemeDialog", "Theme Maintance", None, QtGui.QApplication.UnicodeUTF8)) + self.ThemeNameLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Theme Name:", None, QtGui.QApplication.UnicodeUTF8)) + self.BackgroundLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Background:", None, QtGui.QApplication.UnicodeUTF8)) + self.BackgroundComboBox.setItemText(0, QtGui.QApplication.translate("AmendThemeDialog", "Opaque", None, QtGui.QApplication.UnicodeUTF8)) + self.BackgroundComboBox.setItemText(1, QtGui.QApplication.translate("AmendThemeDialog", "Transparent", None, QtGui.QApplication.UnicodeUTF8)) + self.BackgroundTypeLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Background Type:", None, QtGui.QApplication.UnicodeUTF8)) + self.BackgroundTypeComboBox.setItemText(0, QtGui.QApplication.translate("AmendThemeDialog", "Solid Color", None, QtGui.QApplication.UnicodeUTF8)) + self.BackgroundTypeComboBox.setItemText(1, QtGui.QApplication.translate("AmendThemeDialog", "Gradient", None, QtGui.QApplication.UnicodeUTF8)) + self.BackgroundTypeComboBox.setItemText(2, QtGui.QApplication.translate("AmendThemeDialog", "Image", None, QtGui.QApplication.UnicodeUTF8)) + self.Color1Label.setText(QtGui.QApplication.translate("AmendThemeDialog", "", None, QtGui.QApplication.UnicodeUTF8)) + self.Color2Label.setText(QtGui.QApplication.translate("AmendThemeDialog", "", None, QtGui.QApplication.UnicodeUTF8)) + self.ImageLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Image:", None, QtGui.QApplication.UnicodeUTF8)) + self.GradientLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Gradient :", None, QtGui.QApplication.UnicodeUTF8)) + self.GradientComboBox.setItemText(0, QtGui.QApplication.translate("AmendThemeDialog", "Horizontal", None, QtGui.QApplication.UnicodeUTF8)) + self.GradientComboBox.setItemText(1, QtGui.QApplication.translate("AmendThemeDialog", "Vertical", None, QtGui.QApplication.UnicodeUTF8)) + self.GradientComboBox.setItemText(2, QtGui.QApplication.translate("AmendThemeDialog", "Circular", None, QtGui.QApplication.UnicodeUTF8)) + self.ThemeTabWidget.setTabText(self.ThemeTabWidget.indexOf(self.BackgroundTab), QtGui.QApplication.translate("AmendThemeDialog", "Background", None, QtGui.QApplication.UnicodeUTF8)) + self.FontMainGroupBox.setTitle(QtGui.QApplication.translate("AmendThemeDialog", "Main Font", None, QtGui.QApplication.UnicodeUTF8)) + self.FontMainlabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Font:", None, QtGui.QApplication.UnicodeUTF8)) + self.FontMainColorLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Font Color:", None, QtGui.QApplication.UnicodeUTF8)) + self.FontMainSize.setText(QtGui.QApplication.translate("AmendThemeDialog", "Size:", None, QtGui.QApplication.UnicodeUTF8)) + self.FontMainSizeSpinBox.setSuffix(QtGui.QApplication.translate("AmendThemeDialog", "pt", None, QtGui.QApplication.UnicodeUTF8)) + self.FontMainWrapIndentationLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Wrap Indentation", None, QtGui.QApplication.UnicodeUTF8)) + self.FontMainLinesPageLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "TextLabel", None, QtGui.QApplication.UnicodeUTF8)) + self.MainLocationGroupBox.setTitle(QtGui.QApplication.translate("AmendThemeDialog", "Display Location", None, QtGui.QApplication.UnicodeUTF8)) + self.DefaultLocationLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Use Default Location:", None, QtGui.QApplication.UnicodeUTF8)) + self.FontMainXLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "X Position:", None, QtGui.QApplication.UnicodeUTF8)) + self.FontMainYLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Y Position:", None, QtGui.QApplication.UnicodeUTF8)) + self.FontMainWidthLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Width:", None, QtGui.QApplication.UnicodeUTF8)) + self.FontMainHeightLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Height:", None, QtGui.QApplication.UnicodeUTF8)) + self.FontMainXSpinBox.setSuffix(QtGui.QApplication.translate("AmendThemeDialog", "px", None, QtGui.QApplication.UnicodeUTF8)) + self.FontMainYSpinBox.setSuffix(QtGui.QApplication.translate("AmendThemeDialog", "px", None, QtGui.QApplication.UnicodeUTF8)) + self.FontMainWidthSpinBox.setSuffix(QtGui.QApplication.translate("AmendThemeDialog", "px", None, QtGui.QApplication.UnicodeUTF8)) + self.FontMainHeightSpinBox.setSuffix(QtGui.QApplication.translate("AmendThemeDialog", "px", None, QtGui.QApplication.UnicodeUTF8)) + self.ThemeTabWidget.setTabText(self.ThemeTabWidget.indexOf(self.FontMainTab), QtGui.QApplication.translate("AmendThemeDialog", "Font Main", None, QtGui.QApplication.UnicodeUTF8)) + self.FooterFontGroupBox.setTitle(QtGui.QApplication.translate("AmendThemeDialog", "Footer Font", None, QtGui.QApplication.UnicodeUTF8)) + self.FontFooterLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Font:", None, QtGui.QApplication.UnicodeUTF8)) + self.FontFooterColorLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Font Color:", None, QtGui.QApplication.UnicodeUTF8)) + self.FontFooterSizeLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Size:", None, QtGui.QApplication.UnicodeUTF8)) + self.FontFooterSizeSpinBox.setSuffix(QtGui.QApplication.translate("AmendThemeDialog", "pt", None, QtGui.QApplication.UnicodeUTF8)) + self.LocationFooterGroupBox.setTitle(QtGui.QApplication.translate("AmendThemeDialog", "Display Location", None, QtGui.QApplication.UnicodeUTF8)) + self.FontFooterDefaultLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Use Default Location:", None, QtGui.QApplication.UnicodeUTF8)) + self.FontFooterXLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "X Position:", None, QtGui.QApplication.UnicodeUTF8)) + self.FontFooterYLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Y Position:", None, QtGui.QApplication.UnicodeUTF8)) + self.FontFooterWidthLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Width:", None, QtGui.QApplication.UnicodeUTF8)) + self.FontFooterHeightLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Height:", None, QtGui.QApplication.UnicodeUTF8)) + self.FontFooterXSpinBox.setSuffix(QtGui.QApplication.translate("AmendThemeDialog", "px", None, QtGui.QApplication.UnicodeUTF8)) + self.FontFooterYSpinBox.setSuffix(QtGui.QApplication.translate("AmendThemeDialog", "px", None, QtGui.QApplication.UnicodeUTF8)) + self.FontFooterWidthSpinBox.setSuffix(QtGui.QApplication.translate("AmendThemeDialog", "px", None, QtGui.QApplication.UnicodeUTF8)) + self.FontFooterHeightSpinBox.setSuffix(QtGui.QApplication.translate("AmendThemeDialog", "px", None, QtGui.QApplication.UnicodeUTF8)) + self.ThemeTabWidget.setTabText(self.ThemeTabWidget.indexOf(self.FontFooterTab), QtGui.QApplication.translate("AmendThemeDialog", "Font Footer", None, QtGui.QApplication.UnicodeUTF8)) + self.ShadowGroupBox.setTitle(QtGui.QApplication.translate("AmendThemeDialog", "Shadow && Outline", None, QtGui.QApplication.UnicodeUTF8)) + self.OutlineColorLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Outline Color:", None, QtGui.QApplication.UnicodeUTF8)) + self.OutlineEnabledLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Show Outline:", None, QtGui.QApplication.UnicodeUTF8)) + self.ShadowColorLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Shadow Color:", None, QtGui.QApplication.UnicodeUTF8)) + self.ShadowEnabledLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Show Shadow:", None, QtGui.QApplication.UnicodeUTF8)) + self.AlignmentGroupBox.setTitle(QtGui.QApplication.translate("AmendThemeDialog", "Alignment", None, QtGui.QApplication.UnicodeUTF8)) + self.HorizontalLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Horizontal Align:", None, QtGui.QApplication.UnicodeUTF8)) + self.HorizontalComboBox.setItemText(0, QtGui.QApplication.translate("AmendThemeDialog", "Left", None, QtGui.QApplication.UnicodeUTF8)) + self.HorizontalComboBox.setItemText(1, QtGui.QApplication.translate("AmendThemeDialog", "Right", None, QtGui.QApplication.UnicodeUTF8)) + self.HorizontalComboBox.setItemText(2, QtGui.QApplication.translate("AmendThemeDialog", "Center", None, QtGui.QApplication.UnicodeUTF8)) + self.VerticalLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Vertical Align:", None, QtGui.QApplication.UnicodeUTF8)) + self.VerticalComboBox.setItemText(0, QtGui.QApplication.translate("AmendThemeDialog", "Top", None, QtGui.QApplication.UnicodeUTF8)) + self.VerticalComboBox.setItemText(1, QtGui.QApplication.translate("AmendThemeDialog", "Middle", None, QtGui.QApplication.UnicodeUTF8)) + self.VerticalComboBox.setItemText(2, QtGui.QApplication.translate("AmendThemeDialog", "Bottom", None, QtGui.QApplication.UnicodeUTF8)) + self.ThemeTabWidget.setTabText(self.ThemeTabWidget.indexOf(self.OtherOptionsTab), QtGui.QApplication.translate("AmendThemeDialog", "Other Options", None, QtGui.QApplication.UnicodeUTF8)) + self.PreviewGroupBox.setTitle(QtGui.QApplication.translate("AmendThemeDialog", "Preview", None, QtGui.QApplication.UnicodeUTF8)) + +import openlp-2_rc diff --git a/resources/images/openlp-2.qrc b/resources/images/openlp-2.qrc index f7e6f095f..dba2fcd54 100644 --- a/resources/images/openlp-2.qrc +++ b/resources/images/openlp-2.qrc @@ -126,4 +126,20 @@ theme_export.png theme_import.png + + page_chorus.png + page_bridge.png + page_1.png + page_2.png + page_3.png + page_4.png + page_5.png + page_6.png + page_7.png + page_8.png + page_9.png + page_10.png + page_11.png + page_12.png + From 4118951d8b305e60a9ecdd42669e97a889c5760d Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sun, 8 Nov 2009 09:03:00 +0000 Subject: [PATCH 19/66] Fix strange commit --- bible.cgi?word=Exodus+2 | 845 ---------------------------- bible.html | 429 -------------- index.php?search=Ruth+1 | 461 --------------- page-simple.png | Bin 357 -> 0 bytes resources/forms/amendthemedialog.py | 597 -------------------- 5 files changed, 2332 deletions(-) delete mode 100644 bible.cgi?word=Exodus+2 delete mode 100644 bible.html delete mode 100644 index.php?search=Ruth+1 delete mode 100644 page-simple.png delete mode 100644 resources/forms/amendthemedialog.py diff --git a/bible.cgi?word=Exodus+2 b/bible.cgi?word=Exodus+2 deleted file mode 100644 index 9bf8f4da0..000000000 --- a/bible.cgi?word=Exodus+2 +++ /dev/null @@ -1,845 +0,0 @@ - - - - - - - Exodus 2 - New International Version - NIV - Study Bible Online - - - - - - - - - - - - - - - - - - - - - - - -
-
- -
- -
- - -
-
- - - -
-
-
-
-
- - - - -
-
- - - Search The Bible -    - - - - - - - - - - - -
- -
-
-
- - -
-
Featured Sponsors
-
-
- - - - - - - -
-
- - - - - - -
-
- - - - - - - -
- - - -
-
- -
- -
-
-
- -
- - -
- Online Bible Study Tools -
-
- - - - -
- - - -
-
- -
- - - - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   -
- -
- -
- - -
- -
- - - - - - - - - - - - - - - - - -
Online Study Bible
-
  
-
Search forin:
- - - - - -
- using: - - -
New Search  |  Include Study Tools | Online Study Tools Help
of 40
 
 
New International Version   
Exodus 2 - Study This Chapter
 

1 Now a man of the house of Levi married a Levite woman, 2 and she became pregnant and gave birth to a son. When she saw that he was a fine child, she hid him for three months. 3 But when she could hide him no longer, she got a papyrus basket for him and coated it with tar and pitch. Then she placed the child in it and put it among the reeds along the bank of the Nile. 4 His sister stood at a distance to see what would happen to him.

5 Then Pharaoh's daughter went down to the Nile to bathe, and her attendants were walking along the river bank. She saw the basket among the reeds and sent her slave girl to get it. 6 She opened it and saw the baby. He was crying, and she felt sorry for him. "This is one of the Hebrew babies," she said. 7 Then his sister asked Pharaoh's daughter, "Shall I go and get one of the Hebrew women to nurse the baby for you?" 8 "Yes, go," she answered. And the girl went and got the baby's mother. 9 Pharaoh's daughter said to her, "Take this baby and nurse him for me, and I will pay you." So the woman took the baby and nursed him. 10 When the child grew older, she took him to Pharaoh's daughter and he became her son. She named him Moses, saying, "I drew him out of the water."

11 One day, after Moses had grown up, he went out to where his own people were and watched them at their hard labor. He saw an Egyptian beating a Hebrew, one of his own people. 12 Glancing this way and that and seeing no one, he killed the Egyptian and hid him in the sand. 13 The next day he went out and saw two Hebrews fighting. He asked the one in the wrong, "Why are you hitting your fellow Hebrew?" 14 The man said, "Who made you ruler and judge over us? Are you thinking of killing me as you killed the Egyptian?" Then Moses was afraid and thought, "What I did must have become known." 15 When Pharaoh heard of this, he tried to kill Moses, but Moses fled from Pharaoh and went to live in Midian, where he sat down by a well.

16 Now a priest of Midian had seven daughters, and they came to draw water and fill the troughs to water their father's flock. 17 Some shepherds came along and drove them away, but Moses got up and came to their rescue and watered their flock. 18 When the girls returned to Reuel their father, he asked them, "Why have you returned so early today?" 19 They answered, "An Egyptian rescued us from the shepherds. He even drew water for us and watered the flock." 20 "And where is he?" he asked his daughters. "Why did you leave him? Invite him to have something to eat." 21 Moses agreed to stay with the man, who gave his daughter Zipporah to Moses in marriage. 22 Zipporah gave birth to a son, and Moses named him Gershom, saying, "I have become an alien in a foreign land."

23 During that long period, the king of Egypt died. The Israelites groaned in their slavery and cried out, and their cry for help because of their slavery went up to God. 24 God heard their groaning and he remembered his covenant with Abraham, with Isaac and with Jacob. 25 So God looked on the Israelites and was concerned about them.

New International Version

 
- -
- -
- -
- - -
- -
- - -
- -
- -
-
- - - - -
-
-
-
E-MAIL NEWSLETTERS
- -
- - -
- - -
- - - -
- - -
- - -
- - - - - - - - -
-
-
-
- There was an error processing this request. We cannot subscribe you to newsletters at this time. - Please contact technical support with details. -
- -
-
-
- - - -
- -
-
- - -
-
-
- -
- - - - - - - - - diff --git a/bible.html b/bible.html deleted file mode 100644 index 1b55693b5..000000000 --- a/bible.html +++ /dev/null @@ -1,429 +0,0 @@ - - - -Ruth 1 - Passage Lookup - 1940 Bulgarian Bible - BibleGateway.com - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
- -BibleGateway.com - -
- - - - - - - - - - - -
-
- - - -
-
-A -A -A -A -A - -
- -en - - -
-
- - - - - - - - -
- -
Passage results: 

Рут 1 (1940 Bulgarian Bible)

-
-
 
-

Рут 1 (1940 Bulgarian Bible)

-
-

Рут 1

 1 Ð’ дните когато Ñъдиите Ñъдеха, наÑтана глад в земÑта. И един човек от Витлеем Юдов отиде да преÑтои в МоавÑката земÑ, той, и жена му, и двамата му Ñина.

 2 Името на човека беше Елимелех, а името на жена му Ðоемин, а имената на двамата му Ñина Маалон и Хелеон; те бÑха ефратци от Витлеем Юдов. И дойдоха в МоавÑката Ð·ÐµÐ¼Ñ Ð¸ там оÑтанаха.

 3 И Елимелех, мъжът на Ðоемин, умрÑ; и Ñ‚Ñ Ð¾Ñтана Ñ Ð´Ð²Ð°Ð¼Ð°Ñ‚Ð° Ñи Ñина.

 4 И те Ñи взеха жени моавки, <на които> името на едната беше Орфа, а името на другата Рут; и живÑха там около деÑет години.

 5 Тогава умрÑха Маалон и Хелеон, и двамата, тъй че жената Ñе лиши от двамата Ñи Ñина и от мъжа Ñи.

 6 След това Ñ‚Ñ Ñтана ÑÑŠÑ Ñнахите Ñи да Ñе върне от МоавÑката земÑ, защото беше чула в МоавÑката земÑ, че ГоÑпод поÑетил людете Си и им дал хлÑб.

 7 И тъй, Ñ‚Ñ Ð¸Ð·Ð»ÐµÐ·Ðµ от мÑÑтото, гдето беше, и двете й Ñнахи Ñ Ð½ÐµÑ, и вървÑха по Ð¿ÑŠÑ‚Ñ Ð´Ð° Ñе върнат в Юдовата земÑ.

 8 Сетне Ðоемин каза на двете Ñи Ñнахи: Идете, върнете Ñе вÑÑка в дома на майка Ñи. ГоÑпод да поÑтъпва Ñ Ð±Ð»Ð°Ð³Ð¾ÑÑ‚ към ваÑ, както вие поÑтъпвахте към умрелите и към мене.

 9 ГоÑпод да ви даде да намерите ÑпокойÑтвие, вÑÑка в дома на мъжа Ñи. Тогава ги целуна; а те плакаха Ñ Ð²Ð¸Ñок глаÑ.

 10 И рекоха й: Ðе, но Ñ Ñ‚ÐµÐ±Ðµ ще Ñе върнем при твоите люде.

 11 Ðо Ðоемин каза: Върнете Ñе, дъщери мои, защо да дойдете Ñ Ð¼ÐµÐ½Ðµ? Имам ли още Ñинове в утробата Ñи, за да ви Ñтанат мъже?

 12 Върнете Ñе, дъщери мои, идете защото оÑтарÑÑ… и не Ñъм вече за мъж. Ðко бих и рекла: Имам надежда; даже ако Ñе омъжех Ñ‚Ð°Ñ Ð½Ð¾Ñ‰, па и родÑÑ… Ñинове,

 13 вие бихте ли ги чакали догде пораÑтат? Бихте ли Ñе въздържали заради Ñ‚ÑÑ… да Ñе не омъжите? Ðе, дъщери мои; <върнете Ñе>, понеже Ñъм много огорчена заради ваÑ, гдето ГоÑподната ръка Ñе е проÑтирала против мене.

 14 Ркато плакаха пак Ñ Ð²Ð¸Ñок глаÑ, Орфа целуна Ñвекърва Ñи, а Рут Ñе привърза при неÑ.

 15 Тогава рече Ðоемин: Ето, етърва ти Ñе върна при людете Ñи и при боговете Ñи; върни Ñе и ти подир етърва Ñи.

 16 РРут каза: Ðе ме умолÑвай да те оÑÑ‚Ð°Ð²Ñ Ð¸ да не дойда подире ти; защото, гдето идеш ти, и аз ще ида, и гдето оÑтанеш, и аз ще оÑтана; твоите люде ще бъдат мои люде, и твоÑÑ‚ Бог мой Бог;

 17 гдето умреш ти, и аз ще умра, и там ще Ñе погреба; така да ми направи ГоÑпод, да! и повече да притури, ако друго, оÑвен Ñмъртта, ме разлъчи от тебе.

 18 И <Ðоемин>, като видÑ, че Ñ‚Ñ Ð½Ð°ÑтоÑваше да иде Ñ Ð½ÐµÑ, преÑтана да й говори.

 19 И тъй, двете вървÑха докато дойдоха във Витлеем. И когато Ñтигнаха във Витлеем, целиÑÑ‚ град Ñе раздвижи поради Ñ‚ÑÑ…; и жените думаха: Това ли е Ðоемин?

 20 Ð Ñ‚Ñ Ð¸Ð¼ каза: Ðе ме наричайте Ðоемин {Т.е., БлагоугодноÑÑ‚.} наричайте ме Мара {Т.е., ГореÑÑ‚.} защото Ð’ÑеÑилниÑÑ‚ ме твърде огорчи.

 21 Пълна излÑзох; а ГоÑпод ме доведе празна. Защо ме наричате Ðоемин, тъй като ГоÑпод е заÑвил против мене, и Ð’ÑеÑилниÑÑ‚ ме е оÑкърбил?

 22 Така Ñе върна Ðоемин, и Ñ Ð½ÐµÑ Ñнаха й Рут, моавката, коÑто дойде от МоавÑката земÑ. Те Ñтигнаха във Витлеем в началото на ечемичната жетва.

-
-1940 Bulgarian Bible (BG1940)

© 1995-2005 by Bibliata.com

-
 
-
- - - - - -
-
-
- -
-
-
- -
- - - - - - - - - - - - - - - diff --git a/index.php?search=Ruth+1 b/index.php?search=Ruth+1 deleted file mode 100644 index 1f67d32b1..000000000 --- a/index.php?search=Ruth+1 +++ /dev/null @@ -1,461 +0,0 @@ - - - -Ruth 1 - Passage Lookup - New International Version - BibleGateway.com - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
- -BibleGateway.com - -
- - - - - - - - - - - -
-
- - - -
-
-A -A -A -A -A - -
- -en - - -
-
- - - - - - - - -
- -
Passage results: 

Ruth 1 (New International Version)

-
-
 
-
-

Ruth 1 (New International Version)

-
-

Ruth 1

Naomi and Ruth
 1 In the days when the judges ruled, [a] there was a famine in the land, and a man from Bethlehem in Judah, together with his wife and two sons, went to live for a while in the country of Moab. 2 The man's name was Elimelech, his wife's name Naomi, and the names of his two sons were Mahlon and Kilion. They were Ephrathites from Bethlehem, Judah. And they went to Moab and lived there.

 3 Now Elimelech, Naomi's husband, died, and she was left with her two sons. 4 They married Moabite women, one named Orpah and the other Ruth. After they had lived there about ten years, 5 both Mahlon and Kilion also died, and Naomi was left without her two sons and her husband.

 6 When she heard in Moab that the LORD had come to the aid of his people by providing food for them, Naomi and her daughters-in-law prepared to return home from there. 7 With her two daughters-in-law she left the place where she had been living and set out on the road that would take them back to the land of Judah.

 8 Then Naomi said to her two daughters-in-law, "Go back, each of you, to your mother's home. May the LORD show kindness to you, as you have shown to your dead and to me. 9 May the LORD grant that each of you will find rest in the home of another husband."
      Then she kissed them and they wept aloud 10 and said to her, "We will go back with you to your people."

 11 But Naomi said, "Return home, my daughters. Why would you come with me? Am I going to have any more sons, who could become your husbands? 12 Return home, my daughters; I am too old to have another husband. Even if I thought there was still hope for me—even if I had a husband tonight and then gave birth to sons- 13 would you wait until they grew up? Would you remain unmarried for them? No, my daughters. It is more bitter for me than for you, because the LORD's hand has gone out against me!"

 14 At this they wept again. Then Orpah kissed her mother-in-law good-by, but Ruth clung to her.

 15 "Look," said Naomi, "your sister-in-law is going back to her people and her gods. Go back with her."

 16 But Ruth replied, "Don't urge me to leave you or to turn back from you. Where you go I will go, and where you stay I will stay. Your people will be my people and your God my God. 17 Where you die I will die, and there I will be buried. May the LORD deal with me, be it ever so severely, if anything but death separates you and me." 18 When Naomi realized that Ruth was determined to go with her, she stopped urging her.

 19 So the two women went on until they came to Bethlehem. When they arrived in Bethlehem, the whole town was stirred because of them, and the women exclaimed, "Can this be Naomi?"

 20 "Don't call me Naomi, [b] " she told them. "Call me Mara, [c] because the Almighty [d] has made my life very bitter. 21 I went away full, but the LORD has brought me back empty. Why call me Naomi? The LORD has afflicted [e] me; the Almighty has brought misfortune upon me."

 22 So Naomi returned from Moab accompanied by Ruth the Moabitess, her daughter-in-law, arriving in Bethlehem as the barley harvest was beginning.

Footnotes:
  1. Ruth 1:1 Traditionally judged
  2. - -
  3. Ruth 1:20 Naomi means pleasant ; also in verse 21.
  4. - -
  5. Ruth 1:20 Mara means bitter .
  6. - -
  7. Ruth 1:20 Hebrew Shaddai ; also in verse 21
  8. - -
  9. Ruth 1:21 Or has testified against
  10. - -
-
-
-New International Version (NIV)

Copyright © 1973, 1978, 1984 by Biblica

-
 
-
- - - - - -
-
-
- -
-
-
- -
- - - - - - - - - - - - - - - diff --git a/page-simple.png b/page-simple.png deleted file mode 100644 index a4b2f7491a6f9df0cfb8fd9c178eea67df938afe..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 357 zcmeAS@N?(olHy`uVBq!ia0vp^Vj#@H1|*Mc$*~4fjKx9jP7LeL$-D$|*pj^6T^Rm@ z;DWu&Cj&(|3p^r=85md&fiUBq^AjY1g6t)pzOL*y**JLA#CjRON&;}dR!5?U!&f@c)}4A-*fAE z4K_>3C~`h|)1-P(=h_1nO@~j17}HkTbqO#%yUE`Ep+F>lL-{fOhf{<+oF)}(cNF=C z7xa9TYulc;cYoV;uJFUVTiq`4PH$WtGy9rW^;W;|vjsPQhZ~q5SaUW)I&IB=R{Q+B yVfG&P-xpZyF}tf!yZ`sk4;3}HYi2$>rf$R#%egY(^KGDq89ZJ6T-G@yGywn!|B%f9 diff --git a/resources/forms/amendthemedialog.py b/resources/forms/amendthemedialog.py deleted file mode 100644 index 490c92b58..000000000 --- a/resources/forms/amendthemedialog.py +++ /dev/null @@ -1,597 +0,0 @@ -# -*- coding: utf-8 -*- - -# Form implementation generated from reading ui file 'amendthemedialog.ui' -# -# Created: Thu Oct 22 17:14:44 2009 -# by: PyQt4 UI code generator 4.5.4 -# -# WARNING! All changes made in this file will be lost! - -from PyQt4 import QtCore, QtGui - -class Ui_AmendThemeDialog(object): - def setupUi(self, AmendThemeDialog): - AmendThemeDialog.setObjectName("AmendThemeDialog") - AmendThemeDialog.setWindowModality(QtCore.Qt.ApplicationModal) - AmendThemeDialog.resize(586, 651) - icon = QtGui.QIcon() - icon.addPixmap(QtGui.QPixmap(":/icon/openlp.org-icon-32.bmp"), QtGui.QIcon.Normal, QtGui.QIcon.Off) - AmendThemeDialog.setWindowIcon(icon) - AmendThemeDialog.setModal(True) - self.AmendThemeLayout = QtGui.QVBoxLayout(AmendThemeDialog) - self.AmendThemeLayout.setSpacing(8) - self.AmendThemeLayout.setMargin(8) - self.AmendThemeLayout.setObjectName("AmendThemeLayout") - self.ThemeNameWidget = QtGui.QWidget(AmendThemeDialog) - self.ThemeNameWidget.setObjectName("ThemeNameWidget") - self.ThemeNameLayout = QtGui.QHBoxLayout(self.ThemeNameWidget) - self.ThemeNameLayout.setSpacing(8) - self.ThemeNameLayout.setMargin(0) - self.ThemeNameLayout.setObjectName("ThemeNameLayout") - self.ThemeNameLabel = QtGui.QLabel(self.ThemeNameWidget) - self.ThemeNameLabel.setObjectName("ThemeNameLabel") - self.ThemeNameLayout.addWidget(self.ThemeNameLabel) - self.ThemeNameEdit = QtGui.QLineEdit(self.ThemeNameWidget) - self.ThemeNameEdit.setObjectName("ThemeNameEdit") - self.ThemeNameLayout.addWidget(self.ThemeNameEdit) - self.AmendThemeLayout.addWidget(self.ThemeNameWidget) - self.ContentWidget = QtGui.QWidget(AmendThemeDialog) - self.ContentWidget.setObjectName("ContentWidget") - self.ContentLayout = QtGui.QHBoxLayout(self.ContentWidget) - self.ContentLayout.setSpacing(8) - self.ContentLayout.setMargin(0) - self.ContentLayout.setObjectName("ContentLayout") - self.ThemeTabWidget = QtGui.QTabWidget(self.ContentWidget) - self.ThemeTabWidget.setObjectName("ThemeTabWidget") - self.BackgroundTab = QtGui.QWidget() - self.BackgroundTab.setObjectName("BackgroundTab") - self.BackgroundLayout = QtGui.QFormLayout(self.BackgroundTab) - self.BackgroundLayout.setMargin(8) - self.BackgroundLayout.setSpacing(8) - self.BackgroundLayout.setObjectName("BackgroundLayout") - self.BackgroundLabel = QtGui.QLabel(self.BackgroundTab) - self.BackgroundLabel.setObjectName("BackgroundLabel") - self.BackgroundLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.BackgroundLabel) - self.BackgroundComboBox = QtGui.QComboBox(self.BackgroundTab) - self.BackgroundComboBox.setObjectName("BackgroundComboBox") - self.BackgroundComboBox.addItem(QtCore.QString()) - self.BackgroundComboBox.addItem(QtCore.QString()) - self.BackgroundLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.BackgroundComboBox) - self.BackgroundTypeLabel = QtGui.QLabel(self.BackgroundTab) - self.BackgroundTypeLabel.setObjectName("BackgroundTypeLabel") - self.BackgroundLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.BackgroundTypeLabel) - self.BackgroundTypeComboBox = QtGui.QComboBox(self.BackgroundTab) - self.BackgroundTypeComboBox.setObjectName("BackgroundTypeComboBox") - self.BackgroundTypeComboBox.addItem(QtCore.QString()) - self.BackgroundTypeComboBox.addItem(QtCore.QString()) - self.BackgroundTypeComboBox.addItem(QtCore.QString()) - self.BackgroundLayout.setWidget(1, QtGui.QFormLayout.FieldRole, self.BackgroundTypeComboBox) - self.Color1Label = QtGui.QLabel(self.BackgroundTab) - self.Color1Label.setObjectName("Color1Label") - self.BackgroundLayout.setWidget(2, QtGui.QFormLayout.LabelRole, self.Color1Label) - self.Color1PushButton = QtGui.QPushButton(self.BackgroundTab) - self.Color1PushButton.setObjectName("Color1PushButton") - self.BackgroundLayout.setWidget(2, QtGui.QFormLayout.FieldRole, self.Color1PushButton) - self.Color2Label = QtGui.QLabel(self.BackgroundTab) - self.Color2Label.setObjectName("Color2Label") - self.BackgroundLayout.setWidget(3, QtGui.QFormLayout.LabelRole, self.Color2Label) - self.Color2PushButton = QtGui.QPushButton(self.BackgroundTab) - self.Color2PushButton.setObjectName("Color2PushButton") - self.BackgroundLayout.setWidget(3, QtGui.QFormLayout.FieldRole, self.Color2PushButton) - self.ImageLabel = QtGui.QLabel(self.BackgroundTab) - self.ImageLabel.setObjectName("ImageLabel") - self.BackgroundLayout.setWidget(4, QtGui.QFormLayout.LabelRole, self.ImageLabel) - self.GradientLabel = QtGui.QLabel(self.BackgroundTab) - self.GradientLabel.setObjectName("GradientLabel") - self.BackgroundLayout.setWidget(6, QtGui.QFormLayout.LabelRole, self.GradientLabel) - self.GradientComboBox = QtGui.QComboBox(self.BackgroundTab) - self.GradientComboBox.setObjectName("GradientComboBox") - self.GradientComboBox.addItem(QtCore.QString()) - self.GradientComboBox.addItem(QtCore.QString()) - self.GradientComboBox.addItem(QtCore.QString()) - self.BackgroundLayout.setWidget(6, QtGui.QFormLayout.FieldRole, self.GradientComboBox) - self.ImageFilenameWidget = QtGui.QWidget(self.BackgroundTab) - self.ImageFilenameWidget.setObjectName("ImageFilenameWidget") - self.horizontalLayout_2 = QtGui.QHBoxLayout(self.ImageFilenameWidget) - self.horizontalLayout_2.setSpacing(0) - self.horizontalLayout_2.setMargin(0) - self.horizontalLayout_2.setObjectName("horizontalLayout_2") - self.ImageLineEdit = QtGui.QLineEdit(self.ImageFilenameWidget) - self.ImageLineEdit.setObjectName("ImageLineEdit") - self.horizontalLayout_2.addWidget(self.ImageLineEdit) - self.ImageToolButton = QtGui.QToolButton(self.ImageFilenameWidget) - icon1 = QtGui.QIcon() - icon1.addPixmap(QtGui.QPixmap(":/images/image_load.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.ImageToolButton.setIcon(icon1) - self.ImageToolButton.setObjectName("ImageToolButton") - self.horizontalLayout_2.addWidget(self.ImageToolButton) - self.BackgroundLayout.setWidget(4, QtGui.QFormLayout.FieldRole, self.ImageFilenameWidget) - spacerItem = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) - self.BackgroundLayout.setItem(7, QtGui.QFormLayout.FieldRole, spacerItem) - self.ThemeTabWidget.addTab(self.BackgroundTab, "") - self.FontMainTab = QtGui.QWidget() - self.FontMainTab.setObjectName("FontMainTab") - self.FontMainLayout = QtGui.QHBoxLayout(self.FontMainTab) - self.FontMainLayout.setSpacing(8) - self.FontMainLayout.setMargin(8) - self.FontMainLayout.setObjectName("FontMainLayout") - self.MainLeftWidget = QtGui.QWidget(self.FontMainTab) - self.MainLeftWidget.setObjectName("MainLeftWidget") - self.MainLeftLayout = QtGui.QVBoxLayout(self.MainLeftWidget) - self.MainLeftLayout.setSpacing(8) - self.MainLeftLayout.setMargin(0) - self.MainLeftLayout.setObjectName("MainLeftLayout") - self.FontMainGroupBox = QtGui.QGroupBox(self.MainLeftWidget) - self.FontMainGroupBox.setObjectName("FontMainGroupBox") - self.MainFontLayout = QtGui.QFormLayout(self.FontMainGroupBox) - self.MainFontLayout.setFormAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter) - self.MainFontLayout.setMargin(8) - self.MainFontLayout.setSpacing(8) - self.MainFontLayout.setObjectName("MainFontLayout") - self.FontMainlabel = QtGui.QLabel(self.FontMainGroupBox) - self.FontMainlabel.setObjectName("FontMainlabel") - self.MainFontLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.FontMainlabel) - self.FontMainComboBox = QtGui.QFontComboBox(self.FontMainGroupBox) - self.FontMainComboBox.setObjectName("FontMainComboBox") - self.MainFontLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.FontMainComboBox) - self.FontMainColorLabel = QtGui.QLabel(self.FontMainGroupBox) - self.FontMainColorLabel.setObjectName("FontMainColorLabel") - self.MainFontLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.FontMainColorLabel) - self.FontMainColorPushButton = QtGui.QPushButton(self.FontMainGroupBox) - self.FontMainColorPushButton.setObjectName("FontMainColorPushButton") - self.MainFontLayout.setWidget(1, QtGui.QFormLayout.FieldRole, self.FontMainColorPushButton) - self.FontMainSize = QtGui.QLabel(self.FontMainGroupBox) - self.FontMainSize.setObjectName("FontMainSize") - self.MainFontLayout.setWidget(2, QtGui.QFormLayout.LabelRole, self.FontMainSize) - self.FontMainSizeSpinBox = QtGui.QSpinBox(self.FontMainGroupBox) - sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed) - sizePolicy.setHorizontalStretch(0) - sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.FontMainSizeSpinBox.sizePolicy().hasHeightForWidth()) - self.FontMainSizeSpinBox.setSizePolicy(sizePolicy) - self.FontMainSizeSpinBox.setMinimumSize(QtCore.QSize(70, 0)) - self.FontMainSizeSpinBox.setMaximum(999) - self.FontMainSizeSpinBox.setProperty("value", QtCore.QVariant(16)) - self.FontMainSizeSpinBox.setObjectName("FontMainSizeSpinBox") - self.MainFontLayout.setWidget(2, QtGui.QFormLayout.FieldRole, self.FontMainSizeSpinBox) - self.FontMainWrapIndentationLabel = QtGui.QLabel(self.FontMainGroupBox) - self.FontMainWrapIndentationLabel.setObjectName("FontMainWrapIndentationLabel") - self.MainFontLayout.setWidget(3, QtGui.QFormLayout.LabelRole, self.FontMainWrapIndentationLabel) - self.FontMainLineSpacingSpinBox = QtGui.QSpinBox(self.FontMainGroupBox) - self.FontMainLineSpacingSpinBox.setObjectName("FontMainLineSpacingSpinBox") - self.MainFontLayout.setWidget(3, QtGui.QFormLayout.FieldRole, self.FontMainLineSpacingSpinBox) - self.FontMainLinesPageLabel = QtGui.QLabel(self.FontMainGroupBox) - self.FontMainLinesPageLabel.setObjectName("FontMainLinesPageLabel") - self.MainFontLayout.setWidget(4, QtGui.QFormLayout.LabelRole, self.FontMainLinesPageLabel) - self.MainLeftLayout.addWidget(self.FontMainGroupBox) - spacerItem1 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) - self.MainLeftLayout.addItem(spacerItem1) - self.FontMainLayout.addWidget(self.MainLeftWidget) - self.MainRightWidget = QtGui.QWidget(self.FontMainTab) - self.MainRightWidget.setObjectName("MainRightWidget") - self.MainRightLayout = QtGui.QVBoxLayout(self.MainRightWidget) - self.MainRightLayout.setSpacing(8) - self.MainRightLayout.setMargin(0) - self.MainRightLayout.setObjectName("MainRightLayout") - self.MainLocationGroupBox = QtGui.QGroupBox(self.MainRightWidget) - self.MainLocationGroupBox.setObjectName("MainLocationGroupBox") - self.MainLocationLayout = QtGui.QFormLayout(self.MainLocationGroupBox) - self.MainLocationLayout.setMargin(8) - self.MainLocationLayout.setSpacing(8) - self.MainLocationLayout.setObjectName("MainLocationLayout") - self.DefaultLocationLabel = QtGui.QLabel(self.MainLocationGroupBox) - self.DefaultLocationLabel.setObjectName("DefaultLocationLabel") - self.MainLocationLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.DefaultLocationLabel) - self.FontMainDefaultCheckBox = QtGui.QCheckBox(self.MainLocationGroupBox) - self.FontMainDefaultCheckBox.setTristate(False) - self.FontMainDefaultCheckBox.setObjectName("FontMainDefaultCheckBox") - self.MainLocationLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.FontMainDefaultCheckBox) - self.FontMainXLabel = QtGui.QLabel(self.MainLocationGroupBox) - self.FontMainXLabel.setObjectName("FontMainXLabel") - self.MainLocationLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.FontMainXLabel) - self.FontMainYLabel = QtGui.QLabel(self.MainLocationGroupBox) - self.FontMainYLabel.setObjectName("FontMainYLabel") - self.MainLocationLayout.setWidget(2, QtGui.QFormLayout.LabelRole, self.FontMainYLabel) - self.FontMainWidthLabel = QtGui.QLabel(self.MainLocationGroupBox) - self.FontMainWidthLabel.setObjectName("FontMainWidthLabel") - self.MainLocationLayout.setWidget(3, QtGui.QFormLayout.LabelRole, self.FontMainWidthLabel) - self.FontMainHeightLabel = QtGui.QLabel(self.MainLocationGroupBox) - self.FontMainHeightLabel.setObjectName("FontMainHeightLabel") - self.MainLocationLayout.setWidget(4, QtGui.QFormLayout.LabelRole, self.FontMainHeightLabel) - self.FontMainXSpinBox = QtGui.QSpinBox(self.MainLocationGroupBox) - sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed) - sizePolicy.setHorizontalStretch(0) - sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.FontMainXSpinBox.sizePolicy().hasHeightForWidth()) - self.FontMainXSpinBox.setSizePolicy(sizePolicy) - self.FontMainXSpinBox.setMinimumSize(QtCore.QSize(78, 0)) - self.FontMainXSpinBox.setMaximum(9999) - self.FontMainXSpinBox.setProperty("value", QtCore.QVariant(0)) - self.FontMainXSpinBox.setObjectName("FontMainXSpinBox") - self.MainLocationLayout.setWidget(1, QtGui.QFormLayout.FieldRole, self.FontMainXSpinBox) - self.FontMainYSpinBox = QtGui.QSpinBox(self.MainLocationGroupBox) - sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed) - sizePolicy.setHorizontalStretch(0) - sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.FontMainYSpinBox.sizePolicy().hasHeightForWidth()) - self.FontMainYSpinBox.setSizePolicy(sizePolicy) - self.FontMainYSpinBox.setMinimumSize(QtCore.QSize(78, 0)) - self.FontMainYSpinBox.setMaximum(9999) - self.FontMainYSpinBox.setObjectName("FontMainYSpinBox") - self.MainLocationLayout.setWidget(2, QtGui.QFormLayout.FieldRole, self.FontMainYSpinBox) - self.FontMainWidthSpinBox = QtGui.QSpinBox(self.MainLocationGroupBox) - sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed) - sizePolicy.setHorizontalStretch(0) - sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.FontMainWidthSpinBox.sizePolicy().hasHeightForWidth()) - self.FontMainWidthSpinBox.setSizePolicy(sizePolicy) - self.FontMainWidthSpinBox.setMinimumSize(QtCore.QSize(78, 0)) - self.FontMainWidthSpinBox.setMaximum(9999) - self.FontMainWidthSpinBox.setObjectName("FontMainWidthSpinBox") - self.MainLocationLayout.setWidget(3, QtGui.QFormLayout.FieldRole, self.FontMainWidthSpinBox) - self.FontMainHeightSpinBox = QtGui.QSpinBox(self.MainLocationGroupBox) - sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed) - sizePolicy.setHorizontalStretch(0) - sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.FontMainHeightSpinBox.sizePolicy().hasHeightForWidth()) - self.FontMainHeightSpinBox.setSizePolicy(sizePolicy) - self.FontMainHeightSpinBox.setMinimumSize(QtCore.QSize(78, 0)) - self.FontMainHeightSpinBox.setMaximum(9999) - self.FontMainHeightSpinBox.setObjectName("FontMainHeightSpinBox") - self.MainLocationLayout.setWidget(4, QtGui.QFormLayout.FieldRole, self.FontMainHeightSpinBox) - self.MainRightLayout.addWidget(self.MainLocationGroupBox) - spacerItem2 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) - self.MainRightLayout.addItem(spacerItem2) - self.FontMainLayout.addWidget(self.MainRightWidget) - self.ThemeTabWidget.addTab(self.FontMainTab, "") - self.FontFooterTab = QtGui.QWidget() - self.FontFooterTab.setObjectName("FontFooterTab") - self.FontFooterLayout = QtGui.QHBoxLayout(self.FontFooterTab) - self.FontFooterLayout.setSpacing(8) - self.FontFooterLayout.setMargin(8) - self.FontFooterLayout.setObjectName("FontFooterLayout") - self.FooterLeftWidget = QtGui.QWidget(self.FontFooterTab) - self.FooterLeftWidget.setObjectName("FooterLeftWidget") - self.FooterLeftLayout = QtGui.QVBoxLayout(self.FooterLeftWidget) - self.FooterLeftLayout.setSpacing(8) - self.FooterLeftLayout.setMargin(0) - self.FooterLeftLayout.setObjectName("FooterLeftLayout") - self.FooterFontGroupBox = QtGui.QGroupBox(self.FooterLeftWidget) - self.FooterFontGroupBox.setObjectName("FooterFontGroupBox") - self.FooterFontLayout = QtGui.QFormLayout(self.FooterFontGroupBox) - self.FooterFontLayout.setFieldGrowthPolicy(QtGui.QFormLayout.ExpandingFieldsGrow) - self.FooterFontLayout.setFormAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter) - self.FooterFontLayout.setMargin(8) - self.FooterFontLayout.setSpacing(8) - self.FooterFontLayout.setObjectName("FooterFontLayout") - self.FontFooterLabel = QtGui.QLabel(self.FooterFontGroupBox) - self.FontFooterLabel.setObjectName("FontFooterLabel") - self.FooterFontLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.FontFooterLabel) - self.FontFooterComboBox = QtGui.QFontComboBox(self.FooterFontGroupBox) - self.FontFooterComboBox.setObjectName("FontFooterComboBox") - self.FooterFontLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.FontFooterComboBox) - self.FontFooterColorLabel = QtGui.QLabel(self.FooterFontGroupBox) - self.FontFooterColorLabel.setObjectName("FontFooterColorLabel") - self.FooterFontLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.FontFooterColorLabel) - self.FontFooterColorPushButton = QtGui.QPushButton(self.FooterFontGroupBox) - self.FontFooterColorPushButton.setObjectName("FontFooterColorPushButton") - self.FooterFontLayout.setWidget(1, QtGui.QFormLayout.FieldRole, self.FontFooterColorPushButton) - self.FontFooterSizeLabel = QtGui.QLabel(self.FooterFontGroupBox) - self.FontFooterSizeLabel.setObjectName("FontFooterSizeLabel") - self.FooterFontLayout.setWidget(2, QtGui.QFormLayout.LabelRole, self.FontFooterSizeLabel) - self.FontFooterSizeSpinBox = QtGui.QSpinBox(self.FooterFontGroupBox) - sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed) - sizePolicy.setHorizontalStretch(0) - sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.FontFooterSizeSpinBox.sizePolicy().hasHeightForWidth()) - self.FontFooterSizeSpinBox.setSizePolicy(sizePolicy) - self.FontFooterSizeSpinBox.setMinimumSize(QtCore.QSize(70, 0)) - self.FontFooterSizeSpinBox.setMaximum(999) - self.FontFooterSizeSpinBox.setProperty("value", QtCore.QVariant(10)) - self.FontFooterSizeSpinBox.setObjectName("FontFooterSizeSpinBox") - self.FooterFontLayout.setWidget(2, QtGui.QFormLayout.FieldRole, self.FontFooterSizeSpinBox) - self.FooterLeftLayout.addWidget(self.FooterFontGroupBox) - spacerItem3 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) - self.FooterLeftLayout.addItem(spacerItem3) - self.FontFooterLayout.addWidget(self.FooterLeftWidget) - self.FooterRightWidget = QtGui.QWidget(self.FontFooterTab) - self.FooterRightWidget.setObjectName("FooterRightWidget") - self.FooterRightLayout = QtGui.QVBoxLayout(self.FooterRightWidget) - self.FooterRightLayout.setSpacing(8) - self.FooterRightLayout.setMargin(0) - self.FooterRightLayout.setObjectName("FooterRightLayout") - self.LocationFooterGroupBox = QtGui.QGroupBox(self.FooterRightWidget) - self.LocationFooterGroupBox.setObjectName("LocationFooterGroupBox") - self.LocationFooterLayout = QtGui.QFormLayout(self.LocationFooterGroupBox) - self.LocationFooterLayout.setFieldGrowthPolicy(QtGui.QFormLayout.ExpandingFieldsGrow) - self.LocationFooterLayout.setFormAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter) - self.LocationFooterLayout.setMargin(8) - self.LocationFooterLayout.setSpacing(8) - self.LocationFooterLayout.setObjectName("LocationFooterLayout") - self.FontFooterDefaultLabel = QtGui.QLabel(self.LocationFooterGroupBox) - self.FontFooterDefaultLabel.setObjectName("FontFooterDefaultLabel") - self.LocationFooterLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.FontFooterDefaultLabel) - self.FontFooterDefaultCheckBox = QtGui.QCheckBox(self.LocationFooterGroupBox) - self.FontFooterDefaultCheckBox.setTristate(False) - self.FontFooterDefaultCheckBox.setObjectName("FontFooterDefaultCheckBox") - self.LocationFooterLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.FontFooterDefaultCheckBox) - self.FontFooterXLabel = QtGui.QLabel(self.LocationFooterGroupBox) - self.FontFooterXLabel.setObjectName("FontFooterXLabel") - self.LocationFooterLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.FontFooterXLabel) - self.FontFooterYLabel = QtGui.QLabel(self.LocationFooterGroupBox) - self.FontFooterYLabel.setObjectName("FontFooterYLabel") - self.LocationFooterLayout.setWidget(2, QtGui.QFormLayout.LabelRole, self.FontFooterYLabel) - self.FontFooterWidthLabel = QtGui.QLabel(self.LocationFooterGroupBox) - self.FontFooterWidthLabel.setObjectName("FontFooterWidthLabel") - self.LocationFooterLayout.setWidget(3, QtGui.QFormLayout.LabelRole, self.FontFooterWidthLabel) - self.FontFooterHeightLabel = QtGui.QLabel(self.LocationFooterGroupBox) - self.FontFooterHeightLabel.setObjectName("FontFooterHeightLabel") - self.LocationFooterLayout.setWidget(4, QtGui.QFormLayout.LabelRole, self.FontFooterHeightLabel) - self.FontFooterXSpinBox = QtGui.QSpinBox(self.LocationFooterGroupBox) - sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed) - sizePolicy.setHorizontalStretch(0) - sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.FontFooterXSpinBox.sizePolicy().hasHeightForWidth()) - self.FontFooterXSpinBox.setSizePolicy(sizePolicy) - self.FontFooterXSpinBox.setMinimumSize(QtCore.QSize(78, 0)) - self.FontFooterXSpinBox.setMaximum(9999) - self.FontFooterXSpinBox.setProperty("value", QtCore.QVariant(0)) - self.FontFooterXSpinBox.setObjectName("FontFooterXSpinBox") - self.LocationFooterLayout.setWidget(1, QtGui.QFormLayout.FieldRole, self.FontFooterXSpinBox) - self.FontFooterYSpinBox = QtGui.QSpinBox(self.LocationFooterGroupBox) - sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed) - sizePolicy.setHorizontalStretch(0) - sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.FontFooterYSpinBox.sizePolicy().hasHeightForWidth()) - self.FontFooterYSpinBox.setSizePolicy(sizePolicy) - self.FontFooterYSpinBox.setMinimumSize(QtCore.QSize(78, 0)) - self.FontFooterYSpinBox.setMaximum(9999) - self.FontFooterYSpinBox.setProperty("value", QtCore.QVariant(0)) - self.FontFooterYSpinBox.setObjectName("FontFooterYSpinBox") - self.LocationFooterLayout.setWidget(2, QtGui.QFormLayout.FieldRole, self.FontFooterYSpinBox) - self.FontFooterWidthSpinBox = QtGui.QSpinBox(self.LocationFooterGroupBox) - self.FontFooterWidthSpinBox.setMinimumSize(QtCore.QSize(78, 0)) - self.FontFooterWidthSpinBox.setMaximum(9999) - self.FontFooterWidthSpinBox.setObjectName("FontFooterWidthSpinBox") - self.LocationFooterLayout.setWidget(3, QtGui.QFormLayout.FieldRole, self.FontFooterWidthSpinBox) - self.FontFooterHeightSpinBox = QtGui.QSpinBox(self.LocationFooterGroupBox) - self.FontFooterHeightSpinBox.setMinimumSize(QtCore.QSize(78, 0)) - self.FontFooterHeightSpinBox.setMaximum(9999) - self.FontFooterHeightSpinBox.setObjectName("FontFooterHeightSpinBox") - self.LocationFooterLayout.setWidget(4, QtGui.QFormLayout.FieldRole, self.FontFooterHeightSpinBox) - self.FooterRightLayout.addWidget(self.LocationFooterGroupBox) - spacerItem4 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) - self.FooterRightLayout.addItem(spacerItem4) - self.FontFooterLayout.addWidget(self.FooterRightWidget) - self.ThemeTabWidget.addTab(self.FontFooterTab, "") - self.OtherOptionsTab = QtGui.QWidget() - self.OtherOptionsTab.setObjectName("OtherOptionsTab") - self.OtherOptionsLayout = QtGui.QHBoxLayout(self.OtherOptionsTab) - self.OtherOptionsLayout.setSpacing(8) - self.OtherOptionsLayout.setMargin(8) - self.OtherOptionsLayout.setObjectName("OtherOptionsLayout") - self.OptionsLeftWidget = QtGui.QWidget(self.OtherOptionsTab) - self.OptionsLeftWidget.setObjectName("OptionsLeftWidget") - self.OptionsLeftLayout = QtGui.QVBoxLayout(self.OptionsLeftWidget) - self.OptionsLeftLayout.setSpacing(8) - self.OptionsLeftLayout.setMargin(0) - self.OptionsLeftLayout.setObjectName("OptionsLeftLayout") - self.ShadowGroupBox = QtGui.QGroupBox(self.OptionsLeftWidget) - self.ShadowGroupBox.setObjectName("ShadowGroupBox") - self.verticalLayout = QtGui.QVBoxLayout(self.ShadowGroupBox) - self.verticalLayout.setSpacing(8) - self.verticalLayout.setMargin(8) - self.verticalLayout.setObjectName("verticalLayout") - self.OutlineWidget = QtGui.QWidget(self.ShadowGroupBox) - self.OutlineWidget.setObjectName("OutlineWidget") - self.OutlineLayout = QtGui.QFormLayout(self.OutlineWidget) - self.OutlineLayout.setMargin(0) - self.OutlineLayout.setSpacing(8) - self.OutlineLayout.setObjectName("OutlineLayout") - self.OutlineCheckBox = QtGui.QCheckBox(self.OutlineWidget) - self.OutlineCheckBox.setObjectName("OutlineCheckBox") - self.OutlineLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.OutlineCheckBox) - self.OutlineColorLabel = QtGui.QLabel(self.OutlineWidget) - self.OutlineColorLabel.setObjectName("OutlineColorLabel") - self.OutlineLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.OutlineColorLabel) - self.OutlineColorPushButton = QtGui.QPushButton(self.OutlineWidget) - self.OutlineColorPushButton.setObjectName("OutlineColorPushButton") - self.OutlineLayout.setWidget(1, QtGui.QFormLayout.FieldRole, self.OutlineColorPushButton) - self.OutlineEnabledLabel = QtGui.QLabel(self.OutlineWidget) - self.OutlineEnabledLabel.setObjectName("OutlineEnabledLabel") - self.OutlineLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.OutlineEnabledLabel) - self.verticalLayout.addWidget(self.OutlineWidget) - self.ShadowWidget = QtGui.QWidget(self.ShadowGroupBox) - self.ShadowWidget.setObjectName("ShadowWidget") - self.ShadowLayout = QtGui.QFormLayout(self.ShadowWidget) - self.ShadowLayout.setMargin(0) - self.ShadowLayout.setSpacing(8) - self.ShadowLayout.setObjectName("ShadowLayout") - self.ShadowCheckBox = QtGui.QCheckBox(self.ShadowWidget) - self.ShadowCheckBox.setObjectName("ShadowCheckBox") - self.ShadowLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.ShadowCheckBox) - self.ShadowColorLabel = QtGui.QLabel(self.ShadowWidget) - self.ShadowColorLabel.setObjectName("ShadowColorLabel") - self.ShadowLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.ShadowColorLabel) - self.ShadowColorPushButton = QtGui.QPushButton(self.ShadowWidget) - self.ShadowColorPushButton.setObjectName("ShadowColorPushButton") - self.ShadowLayout.setWidget(1, QtGui.QFormLayout.FieldRole, self.ShadowColorPushButton) - self.ShadowEnabledLabel = QtGui.QLabel(self.ShadowWidget) - self.ShadowEnabledLabel.setObjectName("ShadowEnabledLabel") - self.ShadowLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.ShadowEnabledLabel) - self.verticalLayout.addWidget(self.ShadowWidget) - self.OptionsLeftLayout.addWidget(self.ShadowGroupBox) - spacerItem5 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) - self.OptionsLeftLayout.addItem(spacerItem5) - self.OtherOptionsLayout.addWidget(self.OptionsLeftWidget) - self.OptionsRightWidget = QtGui.QWidget(self.OtherOptionsTab) - self.OptionsRightWidget.setObjectName("OptionsRightWidget") - self.OptionsRightLayout = QtGui.QVBoxLayout(self.OptionsRightWidget) - self.OptionsRightLayout.setSpacing(8) - self.OptionsRightLayout.setMargin(0) - self.OptionsRightLayout.setObjectName("OptionsRightLayout") - self.AlignmentGroupBox = QtGui.QGroupBox(self.OptionsRightWidget) - self.AlignmentGroupBox.setObjectName("AlignmentGroupBox") - self.gridLayout_4 = QtGui.QGridLayout(self.AlignmentGroupBox) - self.gridLayout_4.setObjectName("gridLayout_4") - self.HorizontalLabel = QtGui.QLabel(self.AlignmentGroupBox) - self.HorizontalLabel.setObjectName("HorizontalLabel") - self.gridLayout_4.addWidget(self.HorizontalLabel, 0, 0, 1, 1) - self.HorizontalComboBox = QtGui.QComboBox(self.AlignmentGroupBox) - self.HorizontalComboBox.setObjectName("HorizontalComboBox") - self.HorizontalComboBox.addItem(QtCore.QString()) - self.HorizontalComboBox.addItem(QtCore.QString()) - self.HorizontalComboBox.addItem(QtCore.QString()) - self.gridLayout_4.addWidget(self.HorizontalComboBox, 0, 1, 1, 1) - self.VerticalLabel = QtGui.QLabel(self.AlignmentGroupBox) - self.VerticalLabel.setObjectName("VerticalLabel") - self.gridLayout_4.addWidget(self.VerticalLabel, 1, 0, 1, 1) - self.VerticalComboBox = QtGui.QComboBox(self.AlignmentGroupBox) - self.VerticalComboBox.setObjectName("VerticalComboBox") - self.VerticalComboBox.addItem(QtCore.QString()) - self.VerticalComboBox.addItem(QtCore.QString()) - self.VerticalComboBox.addItem(QtCore.QString()) - self.gridLayout_4.addWidget(self.VerticalComboBox, 1, 1, 1, 1) - self.OptionsRightLayout.addWidget(self.AlignmentGroupBox) - spacerItem6 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) - self.OptionsRightLayout.addItem(spacerItem6) - self.OtherOptionsLayout.addWidget(self.OptionsRightWidget) - self.ThemeTabWidget.addTab(self.OtherOptionsTab, "") - self.ContentLayout.addWidget(self.ThemeTabWidget) - self.AmendThemeLayout.addWidget(self.ContentWidget) - self.PreviewGroupBox = QtGui.QGroupBox(AmendThemeDialog) - self.PreviewGroupBox.setObjectName("PreviewGroupBox") - self.ThemePreviewLayout = QtGui.QHBoxLayout(self.PreviewGroupBox) - self.ThemePreviewLayout.setSpacing(8) - self.ThemePreviewLayout.setMargin(8) - self.ThemePreviewLayout.setObjectName("ThemePreviewLayout") - spacerItem7 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) - self.ThemePreviewLayout.addItem(spacerItem7) - self.ThemePreview = QtGui.QLabel(self.PreviewGroupBox) - sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed) - sizePolicy.setHorizontalStretch(0) - sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.ThemePreview.sizePolicy().hasHeightForWidth()) - self.ThemePreview.setSizePolicy(sizePolicy) - self.ThemePreview.setMinimumSize(QtCore.QSize(300, 225)) - self.ThemePreview.setFrameShape(QtGui.QFrame.WinPanel) - self.ThemePreview.setFrameShadow(QtGui.QFrame.Sunken) - self.ThemePreview.setLineWidth(1) - self.ThemePreview.setScaledContents(True) - self.ThemePreview.setObjectName("ThemePreview") - self.ThemePreviewLayout.addWidget(self.ThemePreview) - spacerItem8 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) - self.ThemePreviewLayout.addItem(spacerItem8) - self.AmendThemeLayout.addWidget(self.PreviewGroupBox) - self.ThemeButtonBox = QtGui.QDialogButtonBox(AmendThemeDialog) - self.ThemeButtonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok) - self.ThemeButtonBox.setObjectName("ThemeButtonBox") - self.AmendThemeLayout.addWidget(self.ThemeButtonBox) - - self.retranslateUi(AmendThemeDialog) - self.ThemeTabWidget.setCurrentIndex(2) - QtCore.QObject.connect(self.ThemeButtonBox, QtCore.SIGNAL("accepted()"), AmendThemeDialog.accept) - QtCore.QObject.connect(self.ThemeButtonBox, QtCore.SIGNAL("rejected()"), AmendThemeDialog.reject) - QtCore.QMetaObject.connectSlotsByName(AmendThemeDialog) - AmendThemeDialog.setTabOrder(self.ThemeButtonBox, self.ThemeNameEdit) - AmendThemeDialog.setTabOrder(self.ThemeNameEdit, self.ThemeTabWidget) - AmendThemeDialog.setTabOrder(self.ThemeTabWidget, self.BackgroundComboBox) - AmendThemeDialog.setTabOrder(self.BackgroundComboBox, self.BackgroundTypeComboBox) - AmendThemeDialog.setTabOrder(self.BackgroundTypeComboBox, self.Color1PushButton) - AmendThemeDialog.setTabOrder(self.Color1PushButton, self.Color2PushButton) - AmendThemeDialog.setTabOrder(self.Color2PushButton, self.ImageLineEdit) - AmendThemeDialog.setTabOrder(self.ImageLineEdit, self.ImageToolButton) - AmendThemeDialog.setTabOrder(self.ImageToolButton, self.GradientComboBox) - AmendThemeDialog.setTabOrder(self.GradientComboBox, self.FontMainComboBox) - AmendThemeDialog.setTabOrder(self.FontMainComboBox, self.FontMainColorPushButton) - AmendThemeDialog.setTabOrder(self.FontMainColorPushButton, self.FontMainSizeSpinBox) - AmendThemeDialog.setTabOrder(self.FontMainSizeSpinBox, self.FontMainDefaultCheckBox) - AmendThemeDialog.setTabOrder(self.FontMainDefaultCheckBox, self.FontMainXSpinBox) - AmendThemeDialog.setTabOrder(self.FontMainXSpinBox, self.FontMainYSpinBox) - AmendThemeDialog.setTabOrder(self.FontMainYSpinBox, self.FontMainWidthSpinBox) - AmendThemeDialog.setTabOrder(self.FontMainWidthSpinBox, self.FontMainHeightSpinBox) - AmendThemeDialog.setTabOrder(self.FontMainHeightSpinBox, self.FontFooterComboBox) - AmendThemeDialog.setTabOrder(self.FontFooterComboBox, self.FontFooterColorPushButton) - AmendThemeDialog.setTabOrder(self.FontFooterColorPushButton, self.FontFooterSizeSpinBox) - AmendThemeDialog.setTabOrder(self.FontFooterSizeSpinBox, self.FontFooterDefaultCheckBox) - AmendThemeDialog.setTabOrder(self.FontFooterDefaultCheckBox, self.FontFooterXSpinBox) - AmendThemeDialog.setTabOrder(self.FontFooterXSpinBox, self.FontFooterYSpinBox) - AmendThemeDialog.setTabOrder(self.FontFooterYSpinBox, self.FontFooterWidthSpinBox) - AmendThemeDialog.setTabOrder(self.FontFooterWidthSpinBox, self.FontFooterHeightSpinBox) - AmendThemeDialog.setTabOrder(self.FontFooterHeightSpinBox, self.OutlineCheckBox) - AmendThemeDialog.setTabOrder(self.OutlineCheckBox, self.OutlineColorPushButton) - AmendThemeDialog.setTabOrder(self.OutlineColorPushButton, self.ShadowCheckBox) - AmendThemeDialog.setTabOrder(self.ShadowCheckBox, self.ShadowColorPushButton) - AmendThemeDialog.setTabOrder(self.ShadowColorPushButton, self.HorizontalComboBox) - AmendThemeDialog.setTabOrder(self.HorizontalComboBox, self.VerticalComboBox) - - def retranslateUi(self, AmendThemeDialog): - AmendThemeDialog.setWindowTitle(QtGui.QApplication.translate("AmendThemeDialog", "Theme Maintance", None, QtGui.QApplication.UnicodeUTF8)) - self.ThemeNameLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Theme Name:", None, QtGui.QApplication.UnicodeUTF8)) - self.BackgroundLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Background:", None, QtGui.QApplication.UnicodeUTF8)) - self.BackgroundComboBox.setItemText(0, QtGui.QApplication.translate("AmendThemeDialog", "Opaque", None, QtGui.QApplication.UnicodeUTF8)) - self.BackgroundComboBox.setItemText(1, QtGui.QApplication.translate("AmendThemeDialog", "Transparent", None, QtGui.QApplication.UnicodeUTF8)) - self.BackgroundTypeLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Background Type:", None, QtGui.QApplication.UnicodeUTF8)) - self.BackgroundTypeComboBox.setItemText(0, QtGui.QApplication.translate("AmendThemeDialog", "Solid Color", None, QtGui.QApplication.UnicodeUTF8)) - self.BackgroundTypeComboBox.setItemText(1, QtGui.QApplication.translate("AmendThemeDialog", "Gradient", None, QtGui.QApplication.UnicodeUTF8)) - self.BackgroundTypeComboBox.setItemText(2, QtGui.QApplication.translate("AmendThemeDialog", "Image", None, QtGui.QApplication.UnicodeUTF8)) - self.Color1Label.setText(QtGui.QApplication.translate("AmendThemeDialog", "", None, QtGui.QApplication.UnicodeUTF8)) - self.Color2Label.setText(QtGui.QApplication.translate("AmendThemeDialog", "", None, QtGui.QApplication.UnicodeUTF8)) - self.ImageLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Image:", None, QtGui.QApplication.UnicodeUTF8)) - self.GradientLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Gradient :", None, QtGui.QApplication.UnicodeUTF8)) - self.GradientComboBox.setItemText(0, QtGui.QApplication.translate("AmendThemeDialog", "Horizontal", None, QtGui.QApplication.UnicodeUTF8)) - self.GradientComboBox.setItemText(1, QtGui.QApplication.translate("AmendThemeDialog", "Vertical", None, QtGui.QApplication.UnicodeUTF8)) - self.GradientComboBox.setItemText(2, QtGui.QApplication.translate("AmendThemeDialog", "Circular", None, QtGui.QApplication.UnicodeUTF8)) - self.ThemeTabWidget.setTabText(self.ThemeTabWidget.indexOf(self.BackgroundTab), QtGui.QApplication.translate("AmendThemeDialog", "Background", None, QtGui.QApplication.UnicodeUTF8)) - self.FontMainGroupBox.setTitle(QtGui.QApplication.translate("AmendThemeDialog", "Main Font", None, QtGui.QApplication.UnicodeUTF8)) - self.FontMainlabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Font:", None, QtGui.QApplication.UnicodeUTF8)) - self.FontMainColorLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Font Color:", None, QtGui.QApplication.UnicodeUTF8)) - self.FontMainSize.setText(QtGui.QApplication.translate("AmendThemeDialog", "Size:", None, QtGui.QApplication.UnicodeUTF8)) - self.FontMainSizeSpinBox.setSuffix(QtGui.QApplication.translate("AmendThemeDialog", "pt", None, QtGui.QApplication.UnicodeUTF8)) - self.FontMainWrapIndentationLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Wrap Indentation", None, QtGui.QApplication.UnicodeUTF8)) - self.FontMainLinesPageLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "TextLabel", None, QtGui.QApplication.UnicodeUTF8)) - self.MainLocationGroupBox.setTitle(QtGui.QApplication.translate("AmendThemeDialog", "Display Location", None, QtGui.QApplication.UnicodeUTF8)) - self.DefaultLocationLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Use Default Location:", None, QtGui.QApplication.UnicodeUTF8)) - self.FontMainXLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "X Position:", None, QtGui.QApplication.UnicodeUTF8)) - self.FontMainYLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Y Position:", None, QtGui.QApplication.UnicodeUTF8)) - self.FontMainWidthLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Width:", None, QtGui.QApplication.UnicodeUTF8)) - self.FontMainHeightLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Height:", None, QtGui.QApplication.UnicodeUTF8)) - self.FontMainXSpinBox.setSuffix(QtGui.QApplication.translate("AmendThemeDialog", "px", None, QtGui.QApplication.UnicodeUTF8)) - self.FontMainYSpinBox.setSuffix(QtGui.QApplication.translate("AmendThemeDialog", "px", None, QtGui.QApplication.UnicodeUTF8)) - self.FontMainWidthSpinBox.setSuffix(QtGui.QApplication.translate("AmendThemeDialog", "px", None, QtGui.QApplication.UnicodeUTF8)) - self.FontMainHeightSpinBox.setSuffix(QtGui.QApplication.translate("AmendThemeDialog", "px", None, QtGui.QApplication.UnicodeUTF8)) - self.ThemeTabWidget.setTabText(self.ThemeTabWidget.indexOf(self.FontMainTab), QtGui.QApplication.translate("AmendThemeDialog", "Font Main", None, QtGui.QApplication.UnicodeUTF8)) - self.FooterFontGroupBox.setTitle(QtGui.QApplication.translate("AmendThemeDialog", "Footer Font", None, QtGui.QApplication.UnicodeUTF8)) - self.FontFooterLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Font:", None, QtGui.QApplication.UnicodeUTF8)) - self.FontFooterColorLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Font Color:", None, QtGui.QApplication.UnicodeUTF8)) - self.FontFooterSizeLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Size:", None, QtGui.QApplication.UnicodeUTF8)) - self.FontFooterSizeSpinBox.setSuffix(QtGui.QApplication.translate("AmendThemeDialog", "pt", None, QtGui.QApplication.UnicodeUTF8)) - self.LocationFooterGroupBox.setTitle(QtGui.QApplication.translate("AmendThemeDialog", "Display Location", None, QtGui.QApplication.UnicodeUTF8)) - self.FontFooterDefaultLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Use Default Location:", None, QtGui.QApplication.UnicodeUTF8)) - self.FontFooterXLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "X Position:", None, QtGui.QApplication.UnicodeUTF8)) - self.FontFooterYLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Y Position:", None, QtGui.QApplication.UnicodeUTF8)) - self.FontFooterWidthLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Width:", None, QtGui.QApplication.UnicodeUTF8)) - self.FontFooterHeightLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Height:", None, QtGui.QApplication.UnicodeUTF8)) - self.FontFooterXSpinBox.setSuffix(QtGui.QApplication.translate("AmendThemeDialog", "px", None, QtGui.QApplication.UnicodeUTF8)) - self.FontFooterYSpinBox.setSuffix(QtGui.QApplication.translate("AmendThemeDialog", "px", None, QtGui.QApplication.UnicodeUTF8)) - self.FontFooterWidthSpinBox.setSuffix(QtGui.QApplication.translate("AmendThemeDialog", "px", None, QtGui.QApplication.UnicodeUTF8)) - self.FontFooterHeightSpinBox.setSuffix(QtGui.QApplication.translate("AmendThemeDialog", "px", None, QtGui.QApplication.UnicodeUTF8)) - self.ThemeTabWidget.setTabText(self.ThemeTabWidget.indexOf(self.FontFooterTab), QtGui.QApplication.translate("AmendThemeDialog", "Font Footer", None, QtGui.QApplication.UnicodeUTF8)) - self.ShadowGroupBox.setTitle(QtGui.QApplication.translate("AmendThemeDialog", "Shadow && Outline", None, QtGui.QApplication.UnicodeUTF8)) - self.OutlineColorLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Outline Color:", None, QtGui.QApplication.UnicodeUTF8)) - self.OutlineEnabledLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Show Outline:", None, QtGui.QApplication.UnicodeUTF8)) - self.ShadowColorLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Shadow Color:", None, QtGui.QApplication.UnicodeUTF8)) - self.ShadowEnabledLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Show Shadow:", None, QtGui.QApplication.UnicodeUTF8)) - self.AlignmentGroupBox.setTitle(QtGui.QApplication.translate("AmendThemeDialog", "Alignment", None, QtGui.QApplication.UnicodeUTF8)) - self.HorizontalLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Horizontal Align:", None, QtGui.QApplication.UnicodeUTF8)) - self.HorizontalComboBox.setItemText(0, QtGui.QApplication.translate("AmendThemeDialog", "Left", None, QtGui.QApplication.UnicodeUTF8)) - self.HorizontalComboBox.setItemText(1, QtGui.QApplication.translate("AmendThemeDialog", "Right", None, QtGui.QApplication.UnicodeUTF8)) - self.HorizontalComboBox.setItemText(2, QtGui.QApplication.translate("AmendThemeDialog", "Center", None, QtGui.QApplication.UnicodeUTF8)) - self.VerticalLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Vertical Align:", None, QtGui.QApplication.UnicodeUTF8)) - self.VerticalComboBox.setItemText(0, QtGui.QApplication.translate("AmendThemeDialog", "Top", None, QtGui.QApplication.UnicodeUTF8)) - self.VerticalComboBox.setItemText(1, QtGui.QApplication.translate("AmendThemeDialog", "Middle", None, QtGui.QApplication.UnicodeUTF8)) - self.VerticalComboBox.setItemText(2, QtGui.QApplication.translate("AmendThemeDialog", "Bottom", None, QtGui.QApplication.UnicodeUTF8)) - self.ThemeTabWidget.setTabText(self.ThemeTabWidget.indexOf(self.OtherOptionsTab), QtGui.QApplication.translate("AmendThemeDialog", "Other Options", None, QtGui.QApplication.UnicodeUTF8)) - self.PreviewGroupBox.setTitle(QtGui.QApplication.translate("AmendThemeDialog", "Preview", None, QtGui.QApplication.UnicodeUTF8)) - -import openlp-2_rc From f0609740548395bc947206754f1abe13e0d21c7e Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sun, 8 Nov 2009 09:05:41 +0000 Subject: [PATCH 20/66] Add Icon files --- resources/images/page_1.png | Bin 0 -> 409 bytes resources/images/page_10.png | Bin 0 -> 357 bytes resources/images/page_11.png | Bin 0 -> 357 bytes resources/images/page_12.png | Bin 0 -> 357 bytes resources/images/page_2.png | Bin 0 -> 396 bytes resources/images/page_3.png | Bin 0 -> 388 bytes resources/images/page_4.png | Bin 0 -> 390 bytes resources/images/page_5.png | Bin 0 -> 400 bytes resources/images/page_6.png | Bin 0 -> 357 bytes resources/images/page_7.png | Bin 0 -> 357 bytes resources/images/page_8.png | Bin 0 -> 357 bytes resources/images/page_9.png | Bin 0 -> 357 bytes resources/images/page_bridge.png | Bin 0 -> 406 bytes resources/images/page_chorus.png | Bin 0 -> 402 bytes 14 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 resources/images/page_1.png create mode 100644 resources/images/page_10.png create mode 100644 resources/images/page_11.png create mode 100644 resources/images/page_12.png create mode 100644 resources/images/page_2.png create mode 100644 resources/images/page_3.png create mode 100644 resources/images/page_4.png create mode 100644 resources/images/page_5.png create mode 100644 resources/images/page_6.png create mode 100644 resources/images/page_7.png create mode 100644 resources/images/page_8.png create mode 100644 resources/images/page_9.png create mode 100644 resources/images/page_bridge.png create mode 100644 resources/images/page_chorus.png diff --git a/resources/images/page_1.png b/resources/images/page_1.png new file mode 100644 index 0000000000000000000000000000000000000000..091ab47f0cbe0dd6547842ea615d7063b91a0d86 GIT binary patch literal 409 zcmV;K0cQS*P)jl|gQUFc3xmjER&WBu>&*7P)nlsE3H6id9bnLP>>f z+(ihCjb%!z_OFbG|2&>C1{id?eBif|43dHCwQ|Oom!Mge;c(cGyi5k~_b=@CZ*XoM zlnAJ*Pk$l#ptS}O!CH&5EEj=wT@TqRXsuJ=4$KUqex4Elxs|4AK*KyUL+dUDHegm@ z7GRp%(6%iApePD3^El6}ptawdSt*oK==KiGT02cThuxT& z%yJqpf{igCqKApRlb8e(5yE5YfxE7oOwPet3nk*4%_a(#-YEFlfTu~;QOY?t11FpJ zY#K$%AQg*`4Ikt!%N)<}CknkDSSf#dYZQ9_3!JWP8ti+68o!=#=>0QrmI}_kKKUG6 z+6&;|xUIPHL$3$U^DU0Y(@TGlJm1EH=kxnI+5+Pn3&43lk)U3&00000NkvXXu0mjf Dzy`Af literal 0 HcmV?d00001 diff --git a/resources/images/page_10.png b/resources/images/page_10.png new file mode 100644 index 0000000000000000000000000000000000000000..a4b2f7491a6f9df0cfb8fd9c178eea67df938afe GIT binary patch literal 357 zcmeAS@N?(olHy`uVBq!ia0vp^Vj#@H1|*Mc$*~4fjKx9jP7LeL$-D$|*pj^6T^Rm@ z;DWu&Cj&(|3p^r=85md&fiUBq^AjY1g6t)pzOL*y**JLA#CjRON&;}dR!5?U!&f@c)}4A-*fAE z4K_>3C~`h|)1-P(=h_1nO@~j17}HkTbqO#%yUE`Ep+F>lL-{fOhf{<+oF)}(cNF=C z7xa9TYulc;cYoV;uJFUVTiq`4PH$WtGy9rW^;W;|vjsPQhZ~q5SaUW)I&IB=R{Q+B yVfG&P-xpZyF}tf!yZ`sk4;3}HYi2$>rf$R#%egY(^KGDq89ZJ6T-G@yGywn!|B%f9 literal 0 HcmV?d00001 diff --git a/resources/images/page_11.png b/resources/images/page_11.png new file mode 100644 index 0000000000000000000000000000000000000000..a4b2f7491a6f9df0cfb8fd9c178eea67df938afe GIT binary patch literal 357 zcmeAS@N?(olHy`uVBq!ia0vp^Vj#@H1|*Mc$*~4fjKx9jP7LeL$-D$|*pj^6T^Rm@ z;DWu&Cj&(|3p^r=85md&fiUBq^AjY1g6t)pzOL*y**JLA#CjRON&;}dR!5?U!&f@c)}4A-*fAE z4K_>3C~`h|)1-P(=h_1nO@~j17}HkTbqO#%yUE`Ep+F>lL-{fOhf{<+oF)}(cNF=C z7xa9TYulc;cYoV;uJFUVTiq`4PH$WtGy9rW^;W;|vjsPQhZ~q5SaUW)I&IB=R{Q+B yVfG&P-xpZyF}tf!yZ`sk4;3}HYi2$>rf$R#%egY(^KGDq89ZJ6T-G@yGywn!|B%f9 literal 0 HcmV?d00001 diff --git a/resources/images/page_12.png b/resources/images/page_12.png new file mode 100644 index 0000000000000000000000000000000000000000..a4b2f7491a6f9df0cfb8fd9c178eea67df938afe GIT binary patch literal 357 zcmeAS@N?(olHy`uVBq!ia0vp^Vj#@H1|*Mc$*~4fjKx9jP7LeL$-D$|*pj^6T^Rm@ z;DWu&Cj&(|3p^r=85md&fiUBq^AjY1g6t)pzOL*y**JLA#CjRON&;}dR!5?U!&f@c)}4A-*fAE z4K_>3C~`h|)1-P(=h_1nO@~j17}HkTbqO#%yUE`Ep+F>lL-{fOhf{<+oF)}(cNF=C z7xa9TYulc;cYoV;uJFUVTiq`4PH$WtGy9rW^;W;|vjsPQhZ~q5SaUW)I&IB=R{Q+B yVfG&P-xpZyF}tf!yZ`sk4;3}HYi2$>rf$R#%egY(^KGDq89ZJ6T-G@yGywn!|B%f9 literal 0 HcmV?d00001 diff --git a/resources/images/page_2.png b/resources/images/page_2.png new file mode 100644 index 0000000000000000000000000000000000000000..c4661947f3994cc4e832d88badb0f853385f9c06 GIT binary patch literal 396 zcmV;70dxL|P)jmCJ5}Fc3xW%or*5hA-)gMgBT!)Q^awidDY^vT%iY zbP-;50EblVtPG=jn8yWxJ}#F}{5IwcnkTN;ysPW_C8$yg$743~)I4eJH?r&vUAGTP z1myXb|DgGWa}Gp=rfHC-X%tu#MPIGJIkyF_z|0_OqtLP}L3Hn&nc-Zu1+Kv?VD7=> zt-uSu-KH}Oobz|{FbWYt+xFmo*w$KTtzoSN0BB<%BBM?uItmA+6qNFALu);@JXJZJ zqu`j;*1$ycp!L92bzeZ!G+wJiBuTOeo@*Du!vaE4topfj5j-qyu+f$)D9DWqUjj2f zw*TyF7;3$KMB*b@i%|Pt;Psit!M@f5KjVhA2(^C(R$EB`>y``L5&;Kx+wsK@wI0}* q15T&+m;NBe9F~*k^T$3~gz*DcH*+)BCo!G?0000jl}m1eFc60S85<>H!%4bgky}TNdWa~hSoI`ylY%j1 zQ63&+$u&jq3gP*pjvC3PUXzguJeBXLRr3G81_Ml zfU5eC2e}(#42THUS`~!QpTiqg*0Rf>Wa=(_hv^ zw9*Q2+kQ8|S}RhWEX%SW*wqHXQv-ZaDtcEN1W!#Pf6M}7=fC4OT!5L^=>u4gUEm;J zEAmk)U4oeT+W!K_KjAc3Y6bWw(-1RX`)6Ri<=nd6c7nZe+i~OjS^>`UBhKg7r~V*$ iehfP=m$!Yi1mgh+RBSS*!=_aL0000jl}m1eKn#X|d!|anhLd!~BDanj^$<~1vFb@+lY)74 z!9(L=U;>qD3CV-?fB2;V80~)l!e7m0kQ;bB^1f-BLr`liE|+ZPSvUB6{vgZV(f9kH zL_nT@>kqjH5djgQZCj*i8U+?bF=lHZB3s}Z%nYI~3N6bLL__7w43T;Z+<@7Dc?1(- ztuM^%_y!_+Hj7pmW6*W+jEynMkF-Kyt%bGf^=wsD;dDAJG7f>+J;YXR=%vj5^bpZP zt5U1$VE}F0s!{;}M0j)h?Plz1gWzcZzGyA`kTwXOhBmFylxfH(Z(ICbl}&DgFc5{`%s5iQCMW4Ci`+VD)I&s3#i}PE3#c&0 zSr8-JF}9%UNEU|Y_xWcA0A6vsedDj;GsqY2_u3A_unDS^!ufofdCC{N?iZ)i2drHO zB?9XDC!EN?(OQFuV2r`>cq{^&rg^Papta6{doVMI#v=6bcz|fyIWt4+KF~P?4`3EB zdyk2djhVeB(0a&$HADm=5)A6v7O)mw+s=JA&b7i(XegziRPY#w!(ra?ydtk(1eZ!} z2~0$9-T>V9Qv!@J5RvKX>AT%73HH57uuFh5#b@opTKfi$lNW%;aVj%cMoW>>oi_<) zPOlKDiK5pt_6A^)aC<4h(nPVBbK;sPfb(aY2Z!DO9A|n>#NK}ctDKmuhHc=e+*W+? uv*lJ*dt5G`oBkkGwNH!J>(@G3f$;?ReRwgT@Ldi70000;}dR!5?U!&f@c)}4A-*fAE z4K_>3C~`h|)1-P(=h_1nO@~j17}HkTbqO#%yUE`Ep+F>lL-{fOhf{<+oF)}(cNF=C z7xa9TYulc;cYoV;uJFUVTiq`4PH$WtGy9rW^;W;|vjsPQhZ~q5SaUW)I&IB=R{Q+B yVfG&P-xpZyF}tf!yZ`sk4;3}HYi2$>rf$R#%egY(^KGDq89ZJ6T-G@yGywn!|B%f9 literal 0 HcmV?d00001 diff --git a/resources/images/page_7.png b/resources/images/page_7.png new file mode 100644 index 0000000000000000000000000000000000000000..a4b2f7491a6f9df0cfb8fd9c178eea67df938afe GIT binary patch literal 357 zcmeAS@N?(olHy`uVBq!ia0vp^Vj#@H1|*Mc$*~4fjKx9jP7LeL$-D$|*pj^6T^Rm@ z;DWu&Cj&(|3p^r=85md&fiUBq^AjY1g6t)pzOL*y**JLA#CjRON&;}dR!5?U!&f@c)}4A-*fAE z4K_>3C~`h|)1-P(=h_1nO@~j17}HkTbqO#%yUE`Ep+F>lL-{fOhf{<+oF)}(cNF=C z7xa9TYulc;cYoV;uJFUVTiq`4PH$WtGy9rW^;W;|vjsPQhZ~q5SaUW)I&IB=R{Q+B yVfG&P-xpZyF}tf!yZ`sk4;3}HYi2$>rf$R#%egY(^KGDq89ZJ6T-G@yGywn!|B%f9 literal 0 HcmV?d00001 diff --git a/resources/images/page_8.png b/resources/images/page_8.png new file mode 100644 index 0000000000000000000000000000000000000000..a4b2f7491a6f9df0cfb8fd9c178eea67df938afe GIT binary patch literal 357 zcmeAS@N?(olHy`uVBq!ia0vp^Vj#@H1|*Mc$*~4fjKx9jP7LeL$-D$|*pj^6T^Rm@ z;DWu&Cj&(|3p^r=85md&fiUBq^AjY1g6t)pzOL*y**JLA#CjRON&;}dR!5?U!&f@c)}4A-*fAE z4K_>3C~`h|)1-P(=h_1nO@~j17}HkTbqO#%yUE`Ep+F>lL-{fOhf{<+oF)}(cNF=C z7xa9TYulc;cYoV;uJFUVTiq`4PH$WtGy9rW^;W;|vjsPQhZ~q5SaUW)I&IB=R{Q+B yVfG&P-xpZyF}tf!yZ`sk4;3}HYi2$>rf$R#%egY(^KGDq89ZJ6T-G@yGywn!|B%f9 literal 0 HcmV?d00001 diff --git a/resources/images/page_9.png b/resources/images/page_9.png new file mode 100644 index 0000000000000000000000000000000000000000..a4b2f7491a6f9df0cfb8fd9c178eea67df938afe GIT binary patch literal 357 zcmeAS@N?(olHy`uVBq!ia0vp^Vj#@H1|*Mc$*~4fjKx9jP7LeL$-D$|*pj^6T^Rm@ z;DWu&Cj&(|3p^r=85md&fiUBq^AjY1g6t)pzOL*y**JLA#CjRON&;}dR!5?U!&f@c)}4A-*fAE z4K_>3C~`h|)1-P(=h_1nO@~j17}HkTbqO#%yUE`Ep+F>lL-{fOhf{<+oF)}(cNF=C z7xa9TYulc;cYoV;uJFUVTiq`4PH$WtGy9rW^;W;|vjsPQhZ~q5SaUW)I&IB=R{Q+B yVfG&P-xpZyF}tf!yZ`sk4;3}HYi2$>rf$R#%egY(^KGDq89ZJ6T-G@yGywn!|B%f9 literal 0 HcmV?d00001 diff --git a/resources/images/page_bridge.png b/resources/images/page_bridge.png new file mode 100644 index 0000000000000000000000000000000000000000..7d81a4a711b9d1d735167921f7086fa5ca604bdd GIT binary patch literal 406 zcmV;H0crk;P)bmCtI!Fbu{&Nj{WZ))(0+hrV@L*+Y~va@vbDCD0Mu z@eY|Y+j0Jm2@FX-^ph;f4)9~w>j(a7A%jBUcB`B*W*1Z`h101Vcq$a1&o7kaE1cT~ zB?7AIGY%BKXstm+u-4+`c$|gR_j{17Kx-Z89D`dhGl=>fJ?a{8Zdi}H?!N&bqG2&J zv~K4zHeePocYRc5G)?oH1@pwSKO{$Yd!(O=Mh(EZAB*$||)`TLc?p zhMH{w6A{uejlgZ&Mou}fD3#T`Zx-wu5Q2%QAJo8H*C7o#+dSViKW^l+N={51CicyO znUg8-z$D|`(M)}#9f?ddD>x+CKpEe4;Du~gfOFMbXQ^)lo}1exOMU+htmedAlXilG zk=c0Lr{flZi{gOu`EA!9q$mz~@p5_JMq6Nf13+to!pMG#@&Et;07*qoM6N<$f~cgd A#Q*>R literal 0 HcmV?d00001 diff --git a/resources/images/page_chorus.png b/resources/images/page_chorus.png new file mode 100644 index 0000000000000000000000000000000000000000..80c3a6d53633b9d437eed59c5e46e115180714f9 GIT binary patch literal 402 zcmV;D0d4+?P)jl}&EKFc5{`%w&PG$w|6m!L3nI4}nm{suv*$kt%jF zEU3ZbBu+!6J}Ju2)B8M{u^iw>`~4^Ws+d8saX1{+d;b!&C<<&g>j$rh&8GRrdi@5~ zWl$pEc>J;p#V^h|5D~hrLseDx#Dwb8DXLcBoHIUKa0_Mz5m~4zpo(){<6PH(Dv0QD zF*BTNa}|3q3z&NYy<9H$D)?E4eHJ)pXESJph@kK9;O2S-ng${=Xhr-@WY~&PaMyK% zs#3+?EZBSh=-Co55h2~C2Hdu-35EMuE7C Date: Sun, 8 Nov 2009 09:09:23 +0000 Subject: [PATCH 21/66] Add test to stop icons going over the limit --- openlp/core/ui/slidecontroller.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index fc23e8b68..f591591f3 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -319,6 +319,8 @@ class SlideController(QtGui.QWidget): if item.verse_order: verses = item.verse_order.split(u' ') for verse in verses: + if int(verse) > 12: + break try: self.Songbar.actions[verse].setVisible(True) except: From 5b154b5941a8e2a65256b6df9f6200ce1e5f5a1b Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sun, 8 Nov 2009 13:56:25 +0000 Subject: [PATCH 22/66] Fix bugs in previous merges with icons and themes --- openlp/core/lib/__init__.py | 2 +- openlp/core/lib/rendermanager.py | 2 +- openlp/core/ui/slidecontroller.py | 4 ++-- openlp/core/ui/thememanager.py | 1 - 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/openlp/core/lib/__init__.py b/openlp/core/lib/__init__.py index a7223e938..f2547d966 100644 --- a/openlp/core/lib/__init__.py +++ b/openlp/core/lib/__init__.py @@ -60,7 +60,7 @@ def file_to_xml(xmlfile): file = open(xmlfile, u'r') xml = file.read() except IOError: - log.exception(u'Failed to open XML file') + print(u'Failed to open XML file') finally: if file: file.close() diff --git a/openlp/core/lib/rendermanager.py b/openlp/core/lib/rendermanager.py index d4463ea21..d35495dbc 100644 --- a/openlp/core/lib/rendermanager.py +++ b/openlp/core/lib/rendermanager.py @@ -253,7 +253,7 @@ class RenderManager(object): newImage = QtGui.QImage(w, h, QtGui.QImage.Format_ARGB32_Premultiplied) newImage.fill(QtCore.Qt.black) painter = QtGui.QPainter(newImage) - painter.drawImage((w-realw) / 2, (h-realh) / 2, preview) + painter.drawImage((w - realw) / 2, (h - realh) / 2, preview) return newImage def calculate_default(self, screen): diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index f591591f3..bccc85587 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -219,7 +219,7 @@ class SlideController(QtGui.QWidget): self.PreviewFrame = QtGui.QFrame(self.Splitter) self.PreviewFrame.setGeometry(QtCore.QRect(0, 0, 300, 225)) self.PreviewFrame.setSizePolicy(QtGui.QSizePolicy( - QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Minimum)) + QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Label)) self.PreviewFrame.setFrameShape(QtGui.QFrame.StyledPanel) self.PreviewFrame.setFrameShadow(QtGui.QFrame.Sunken) self.PreviewFrame.setObjectName(u'PreviewFrame') @@ -319,7 +319,7 @@ class SlideController(QtGui.QWidget): if item.verse_order: verses = item.verse_order.split(u' ') for verse in verses: - if int(verse) > 12: + if not verse or int(verse) > 12: break try: self.Songbar.actions[verse].setVisible(True) diff --git a/openlp/core/ui/thememanager.py b/openlp/core/ui/thememanager.py index 8850d880a..51f1f2425 100644 --- a/openlp/core/ui/thememanager.py +++ b/openlp/core/ui/thememanager.py @@ -271,7 +271,6 @@ class ThemeManager(QtGui.QWidget): return self.themelist def getThemeData(self, themename): - assert(themename) log.debug(u'getthemedata for theme %s', themename) xml_file = os.path.join(self.path, unicode(themename), unicode(themename) + u'.xml') From f18ba14fc9f78377ce7b6dc69e30ecb118f2e482 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sun, 8 Nov 2009 14:16:02 +0000 Subject: [PATCH 23/66] remove print for log --- openlp/core/lib/__init__.py | 8 ++++++-- openlp/core/ui/mainwindow.py | 6 ++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/openlp/core/lib/__init__.py b/openlp/core/lib/__init__.py index f2547d966..e3618c7a1 100644 --- a/openlp/core/lib/__init__.py +++ b/openlp/core/lib/__init__.py @@ -26,11 +26,13 @@ The :mod:`lib` module contains most of the components and libraries that make OpenLP work. """ - +import logging import types from PyQt4 import QtCore, QtGui +log = logging.getLogger(__name__) + def translate(context, text): """ A special shortcut method to wrap around the Qt4 translation functions. @@ -60,7 +62,9 @@ def file_to_xml(xmlfile): file = open(xmlfile, u'r') xml = file.read() except IOError: - print(u'Failed to open XML file') + #This may not be an error as this is also used to check + #that a file exist + log.error(u'Failed to open XML file %s' % xmlfile) finally: if file: file.close() diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index 6e24cbdb9..81ac48fe3 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -300,8 +300,14 @@ class Ui_MainWindow(object): # Connect up some signals and slots QtCore.QObject.connect(self.FileExitItem, QtCore.SIGNAL(u'triggered()'), MainWindow.close) + QtCore.QObject.connect(self.ControlSplitter, + QtCore.SIGNAL(u'splitterMoved(int, int)'), self.trackSplitter) QtCore.QMetaObject.connectSlotsByName(MainWindow) + def trackSplitter(self, tab, pos): + #print tab, pos + pass + def retranslateUi(self, MainWindow): """ Set up the translation system From ebce104f303f733ef48427fde3d7dd56463cb8f7 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sun, 8 Nov 2009 17:02:46 +0000 Subject: [PATCH 24/66] Clean up slide sizes part 1 --- openlp/core/lib/settingsmanager.py | 1 - openlp/core/ui/mainwindow.py | 3 +++ openlp/core/ui/slidecontroller.py | 29 ++++++++++++++++++++++++----- 3 files changed, 27 insertions(+), 6 deletions(-) diff --git a/openlp/core/lib/settingsmanager.py b/openlp/core/lib/settingsmanager.py index 148fbd40b..944f4161c 100644 --- a/openlp/core/lib/settingsmanager.py +++ b/openlp/core/lib/settingsmanager.py @@ -45,7 +45,6 @@ class SettingsManager(object): else: self.mainwindow_left = mainwindow_docbars self.mainwindow_right = mainwindow_docbars - self.slidecontroller = (self.width - ( self.mainwindow_left + self.mainwindow_right) - 100 ) / 2 self.slidecontroller_image = self.slidecontroller - 50 diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index 81ac48fe3..bddbf7b42 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -305,6 +305,9 @@ class Ui_MainWindow(object): QtCore.QMetaObject.connectSlotsByName(MainWindow) def trackSplitter(self, tab, pos): + """ + Splitter between the Preview and Live Controllers. + """ #print tab, pos pass diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index bccc85587..dc63330a8 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -108,14 +108,17 @@ class SlideController(QtGui.QWidget): if self.isLive: self.TypeLabel.setText(u'%s' % self.trUtf8(u'Live')) + self.split = 1 else: self.TypeLabel.setText(u'%s' % self.trUtf8(u'Preview')) + self.split = 0 self.TypeLabel.setAlignment(QtCore.Qt.AlignCenter) self.PanelLayout.addWidget(self.TypeLabel) # Splitter self.Splitter = QtGui.QSplitter(self.Panel) self.Splitter.setOrientation(QtCore.Qt.Vertical) + self.Splitter.setOpaqueResize(False) self.PanelLayout.addWidget(self.Splitter) # Actual controller section self.Controller = QtGui.QWidget(self.Splitter) @@ -195,7 +198,6 @@ class SlideController(QtGui.QWidget): self.Toolbar.addToolbarButton( u'Media Stop', u':/slides/media_playback_stop.png', self.trUtf8(u'Start playing media'), self.onMediaStop) - self.ControllerLayout.addWidget(self.Toolbar) # Build the Song Toolbar if isLive: @@ -273,6 +275,19 @@ class SlideController(QtGui.QWidget): QtCore.SIGNAL(u'%s_last' % prefix), self.onSlideSelectedLast) QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'%s_change' % prefix), self.onSlideChange) + QtCore.QObject.connect(self.Splitter, + QtCore.SIGNAL(u'splitterMoved(int, int)'), self.trackSplitter) + + + def trackSplitter(self, tab, pos): + """ + Splitter between the slide list and the preview panel + """ + print tab, pos + print self.Controller.height() + print self.PreviewFrame.height() + print self.Splitter.sizes() + pass def onSongBarHandler(self): request = self.sender().text() @@ -403,14 +418,16 @@ class SlideController(QtGui.QWidget): Display the slide number passed """ log.debug(u'displayServiceManagerItems Start') + print "display self", self.Splitter.sizes() + print "display parent", self.parent.ControlSplitter.sizes() + width = self.parent.ControlSplitter.sizes()[self.split] #Set pointing cursor when we have somthing to point at self.PreviewListWidget.setCursor(QtCore.Qt.PointingHandCursor) before = time.time() self.serviceitem = serviceitem self.PreviewListWidget.clear() self.PreviewListWidget.setRowCount(0) - self.PreviewListWidget.setColumnWidth( - 0, self.settingsmanager.slidecontroller_image) + self.PreviewListWidget.setColumnWidth(0, width) for framenumber, frame in enumerate(self.serviceitem.frames): self.PreviewListWidget.setRowCount( self.PreviewListWidget.rowCount() + 1) @@ -420,15 +437,17 @@ class SlideController(QtGui.QWidget): if frame[u'text'] is None: label = QtGui.QLabel() label.setMargin(4) + pixmap = self.parent.RenderManager.resize_image(frame[u'image']) + print self.isLive, label.width(), pixmap.width() label.setScaledContents(True) label.setPixmap(QtGui.QPixmap.fromImage(pixmap)) self.PreviewListWidget.setCellWidget(framenumber, 0, label) - slide_height = self.settingsmanager.slidecontroller_image * \ - self.parent.RenderManager.screen_ratio + slide_height = width * self.parent.RenderManager.screen_ratio else: item.setText(frame[u'text']) self.PreviewListWidget.setItem(framenumber, 0, item) + print slide_height if slide_height != 0: self.PreviewListWidget.setRowHeight(framenumber, slide_height) if self.serviceitem.frames[0][u'text']: From bc28e3e78f67b192d33b8e86710f50f8f5942358 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sun, 8 Nov 2009 17:40:43 +0000 Subject: [PATCH 25/66] Clean up slide sizes part 2 --- openlp/core/ui/mainwindow.py | 5 +++-- openlp/core/ui/slidecontroller.py | 25 ++++++++++++++++--------- 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index bddbf7b42..c725948a7 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -84,6 +84,7 @@ class Ui_MainWindow(object): MainWindow.setCentralWidget(self.MainContent) self.ControlSplitter = QtGui.QSplitter(self.MainContent) self.ControlSplitter.setOrientation(QtCore.Qt.Horizontal) + self.ControlSplitter.setOpaqueResize(False) self.ControlSplitter.setObjectName(u'ControlSplitter') self.MainContentLayout.addWidget(self.ControlSplitter) # Create slide controllers @@ -308,8 +309,8 @@ class Ui_MainWindow(object): """ Splitter between the Preview and Live Controllers. """ - #print tab, pos - pass + self.LiveController.widthChanged() + self.PreviewController.widthChanged() def retranslateUi(self, MainWindow): """ diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index dc63330a8..4ec414a80 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -139,6 +139,7 @@ class SlideController(QtGui.QWidget): self.PreviewListWidget.setObjectName(u'PreviewListWidget') self.PreviewListWidget.setEditTriggers( QtGui.QAbstractItemView.NoEditTriggers) + self.PreviewListWidget.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff) self.ControllerLayout.addWidget(self.PreviewListWidget) # Build the full toolbar self.Toolbar = OpenLPToolbar(self) @@ -278,15 +279,26 @@ class SlideController(QtGui.QWidget): QtCore.QObject.connect(self.Splitter, QtCore.SIGNAL(u'splitterMoved(int, int)'), self.trackSplitter) + def widthChanged(self): + """ + Handle changes of width from the splitter between the live and preview + controller. Event only issues when changes have finished + """ + if not self.commandItem: + return + width = self.parent.ControlSplitter.sizes()[self.split] + height = width * self.parent.RenderManager.screen_ratio + self.PreviewListWidget.setColumnWidth(0, width) + for framenumber, frame in enumerate(self.commandItem.frames): + if frame[u'text']: + break + self.PreviewListWidget.setRowHeight(framenumber, height) + def trackSplitter(self, tab, pos): """ Splitter between the slide list and the preview panel """ - print tab, pos - print self.Controller.height() - print self.PreviewFrame.height() - print self.Splitter.sizes() pass def onSongBarHandler(self): @@ -418,8 +430,6 @@ class SlideController(QtGui.QWidget): Display the slide number passed """ log.debug(u'displayServiceManagerItems Start') - print "display self", self.Splitter.sizes() - print "display parent", self.parent.ControlSplitter.sizes() width = self.parent.ControlSplitter.sizes()[self.split] #Set pointing cursor when we have somthing to point at self.PreviewListWidget.setCursor(QtCore.Qt.PointingHandCursor) @@ -437,9 +447,7 @@ class SlideController(QtGui.QWidget): if frame[u'text'] is None: label = QtGui.QLabel() label.setMargin(4) - pixmap = self.parent.RenderManager.resize_image(frame[u'image']) - print self.isLive, label.width(), pixmap.width() label.setScaledContents(True) label.setPixmap(QtGui.QPixmap.fromImage(pixmap)) self.PreviewListWidget.setCellWidget(framenumber, 0, label) @@ -447,7 +455,6 @@ class SlideController(QtGui.QWidget): else: item.setText(frame[u'text']) self.PreviewListWidget.setItem(framenumber, 0, item) - print slide_height if slide_height != 0: self.PreviewListWidget.setRowHeight(framenumber, slide_height) if self.serviceitem.frames[0][u'text']: From 95acdbfde0d0f4343c13df7db26aec8cf523ad26 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Mon, 9 Nov 2009 00:11:01 +0000 Subject: [PATCH 26/66] Fix import --- openlp/core/ui/maindisplay.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openlp/core/ui/maindisplay.py b/openlp/core/ui/maindisplay.py index 3195f8de9..9a001b0f2 100644 --- a/openlp/core/ui/maindisplay.py +++ b/openlp/core/ui/maindisplay.py @@ -28,7 +28,7 @@ import os from PyQt4 import QtCore, QtGui from PyQt4.phonon import Phonon -from openlp.core.lib import Receiver, str_to_bool +from openlp.core.lib import Receiver class DisplayWidget(QtGui.QWidget): """ From bf63b2ae2f1ef65735236e6ff73d918409ecb978 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Mon, 9 Nov 2009 05:58:45 +0000 Subject: [PATCH 27/66] Fix up toolbar handing to stop toolbar going off screen Added Media Toolbar for the media items Added it to Preview Added and wired in a volume control --- openlp/core/ui/maindisplay.py | 8 ++-- openlp/core/ui/mainwindow.py | 3 ++ openlp/core/ui/slidecontroller.py | 71 ++++++++++++++++--------------- 3 files changed, 44 insertions(+), 38 deletions(-) diff --git a/openlp/core/ui/maindisplay.py b/openlp/core/ui/maindisplay.py index 3195f8de9..f79bb0b61 100644 --- a/openlp/core/ui/maindisplay.py +++ b/openlp/core/ui/maindisplay.py @@ -264,18 +264,18 @@ class MainDisplay(DisplayWidget): self.firstTime = False else: self.mediaObject.enqueue(Phonon.MediaSource(file)) - self.onMediaPlay() + self.onMediaPlay(message[3]) - def onMediaPlay(self): + def onMediaPlay(self, live=True): log.debug(u'Play the new media') - if not self.mediaLoaded and not self.displayBlank: + if not self.mediaLoaded and not self.displayBlank and live: self.blankDisplay() self.firstTime = True self.mediaLoaded = True self.display.hide() self.video.setFullScreen(True) self.mediaObject.play() - if self.primary: + if self.primary and not live: self.setVisible(True) def onMediaPaws(self): diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index c725948a7..5ca29c874 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -536,6 +536,9 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): self.settingsForm.postSetUp() def versionCheck(self): + """ + Checks the version of the Application called from openlp.pyw + """ applicationVersion = self.applicationVersion[u'Full'] version = check_latest_version(self.generalConfig, applicationVersion) if applicationVersion != version: diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index 4ec414a80..fea8f9378 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -26,6 +26,8 @@ import logging import time from PyQt4 import QtCore, QtGui +from PyQt4.phonon import Phonon + from openlp.core.lib import OpenLPToolbar, Receiver, ServiceItemType, \ str_to_bool, PluginConfig @@ -80,20 +82,9 @@ class SlideController(QtGui.QWidget): u'Loop Separator', u'Image SpinBox' ] - self.media_list = [ - u'Media Start', - u'Media Stop', - u'Media Pause' - ] self.song_edit_list = [ u'Edit Song', ] - self.song_list = [ - u'First Slide', - u'Previous Slide', - u'Next Slide', - u'Last Slide', - ] self.timer_id = 0 self.commandItem = None self.songEdit = False @@ -109,10 +100,12 @@ class SlideController(QtGui.QWidget): self.TypeLabel.setText(u'%s' % self.trUtf8(u'Live')) self.split = 1 + prefix = u'live_slidecontroller' else: self.TypeLabel.setText(u'%s' % self.trUtf8(u'Preview')) self.split = 0 + prefix = u'preview_slidecontroller' self.TypeLabel.setAlignment(QtCore.Qt.AlignCenter) self.PanelLayout.addWidget(self.TypeLabel) # Splitter @@ -190,16 +183,24 @@ class SlideController(QtGui.QWidget): u'Image SpinBox', self.DelaySpinBox) self.DelaySpinBox.setSuffix(self.trUtf8(u's')) self.DelaySpinBox.setToolTip(self.trUtf8(u'Delay between slides in seconds')) - self.Toolbar.addToolbarButton( - u'Media Start', u':/slides/media_playback_start.png', - self.trUtf8(u'Start playing media'), self.onMediaPlay) - self.Toolbar.addToolbarButton( - u'Media Pause', u':/slides/media_playback_pause.png', - self.trUtf8(u'Start playing media'), self.onMediaPause) - self.Toolbar.addToolbarButton( - u'Media Stop', u':/slides/media_playback_stop.png', - self.trUtf8(u'Start playing media'), self.onMediaStop) self.ControllerLayout.addWidget(self.Toolbar) + #Build a Media ToolBar + self.Mediabar = OpenLPToolbar(self) + self.Mediabar.addToolbarButton( + u'Media Start', u':/slides/media_playback_start.png', + self.trUtf8(u'Start playing media'), self.onMediaPlay) + self.Mediabar.addToolbarButton( + u'Media Pause', u':/slides/media_playback_pause.png', + self.trUtf8(u'Start playing media'), self.onMediaPause) + self.Mediabar.addToolbarButton( + u'Media Stop', u':/slides/media_playback_stop.png', + self.trUtf8(u'Start playing media'), self.onMediaStop) + self.volumeSlider = Phonon.VolumeSlider() + self.volumeSlider.setGeometry(QtCore.QRect(90, 260, 221, 24)) + self.volumeSlider.setObjectName("volumeSlider") + self.Mediabar.addToolbarWidget( + u'Audio Volume', self.volumeSlider) + self.ControllerLayout.addWidget(self.Mediabar) # Build the Song Toolbar if isLive: self.Songbar = OpenLPToolbar(self) @@ -259,13 +260,9 @@ class SlideController(QtGui.QWidget): Receiver().send_message(u'request_spin_delay') if isLive: self.Toolbar.makeWidgetsInvisible(self.image_list) - self.Toolbar.makeWidgetsInvisible(self.media_list) else: self.Toolbar.makeWidgetsInvisible(self.song_edit_list) - if isLive: - prefix = u'live_slidecontroller' - else: - prefix = u'preview_slidecontroller' + self.Mediabar.setVisible(False) QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'%s_first' % prefix), self.onSlideSelectedFirst) QtCore.QObject.connect(Receiver.get_receiver(), @@ -291,10 +288,9 @@ class SlideController(QtGui.QWidget): self.PreviewListWidget.setColumnWidth(0, width) for framenumber, frame in enumerate(self.commandItem.frames): if frame[u'text']: - break + return self.PreviewListWidget.setRowHeight(framenumber, height) - def trackSplitter(self, tab, pos): """ Splitter between the slide list and the preview panel @@ -333,10 +329,10 @@ class SlideController(QtGui.QWidget): """ Allows the live toolbar to be customised """ + self.Toolbar.setVisible(True) self.Songbar.setVisible(False) + self.Mediabar.setVisible(False) self.Toolbar.makeWidgetsInvisible(self.image_list) - self.Toolbar.makeWidgetsInvisible(self.media_list) - self.Toolbar.makeWidgetsVisible(self.song_list) if item.service_item_type == ServiceItemType.Text: self.Toolbar.makeWidgetsInvisible(self.image_list) if item.name == u'Songs' and \ @@ -360,17 +356,24 @@ class SlideController(QtGui.QWidget): self.Toolbar.makeWidgetsVisible(self.image_list) elif item.service_item_type == ServiceItemType.Command and \ item.name == u'Media': - self.Toolbar.makeWidgetsInvisible(self.song_list) - self.Toolbar.makeWidgetsVisible(self.media_list) + self.Toolbar.setVisible(False) + self.Mediabar.setVisible(True) + self.volumeSlider.setAudioOutput(self.parent.mainDisplay.audio) def enablePreviewToolBar(self, item): """ Allows the Preview toolbar to be customised """ + self.Toolbar.setVisible(True) + self.Mediabar.setVisible(False) + self.Toolbar.makeWidgetsInvisible(self.song_edit_list) if (item.name == u'Songs' or item.name == u'Custom') and item.fromPlugin: self.Toolbar.makeWidgetsVisible(self.song_edit_list) - else: - self.Toolbar.makeWidgetsInvisible(self.song_edit_list) + elif item.service_item_type == ServiceItemType.Command and \ + item.name == u'Media': + self.Toolbar.setVisible(False) + self.Mediabar.setVisible(True) + self.volumeSlider.setAudioOutput(self.parent.mainDisplay.audio) def addServiceItem(self, item): """ @@ -627,7 +630,7 @@ class SlideController(QtGui.QWidget): Receiver().send_message(u'%s_pause'% self.commandItem.name.lower()) def onMediaPlay(self): - Receiver().send_message(u'%s_play'% self.commandItem.name.lower()) + Receiver().send_message(u'%s_play'% self.commandItem.name.lower(), self.isLive) def onMediaStop(self): Receiver().send_message(u'%s_stop'% self.commandItem.name.lower()) From 9eb88a4300e2402af34a8ad5bdb9f273fdb5e7d0 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Mon, 9 Nov 2009 06:11:26 +0000 Subject: [PATCH 28/66] Try to hide display screens for previews --- openlp/core/ui/maindisplay.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/openlp/core/ui/maindisplay.py b/openlp/core/ui/maindisplay.py index f79bb0b61..cada31aad 100644 --- a/openlp/core/ui/maindisplay.py +++ b/openlp/core/ui/maindisplay.py @@ -130,7 +130,6 @@ class MainDisplay(DisplayWidget): QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'media_stop'), self.onMediaStop) - def setup(self, screenNumber): """ Sets up the screen on a particular screen. @@ -267,13 +266,14 @@ class MainDisplay(DisplayWidget): self.onMediaPlay(message[3]) def onMediaPlay(self, live=True): - log.debug(u'Play the new media') + log.debug(u'Play the new media, Live %s', live) if not self.mediaLoaded and not self.displayBlank and live: self.blankDisplay() self.firstTime = True self.mediaLoaded = True - self.display.hide() - self.video.setFullScreen(True) + if live: + self.display.hide() + self.video.setFullScreen(True) self.mediaObject.play() if self.primary and not live: self.setVisible(True) From b6332e7ff5a0faa215e694c8d136e03a3e0ad2cb Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Mon, 9 Nov 2009 16:37:37 +0000 Subject: [PATCH 29/66] Fix media previews ti work and not display the extra screens --- openlp/core/ui/maindisplay.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openlp/core/ui/maindisplay.py b/openlp/core/ui/maindisplay.py index cada31aad..ddffeb6d4 100644 --- a/openlp/core/ui/maindisplay.py +++ b/openlp/core/ui/maindisplay.py @@ -275,7 +275,7 @@ class MainDisplay(DisplayWidget): self.display.hide() self.video.setFullScreen(True) self.mediaObject.play() - if self.primary and not live: + if self.primary and live: self.setVisible(True) def onMediaPaws(self): From dfced32cf298d19d2d6e01ee977dbd3f74f5713f Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Mon, 9 Nov 2009 21:10:28 +0200 Subject: [PATCH 30/66] Expanded commandline options to include a specific logging level, a Qt4 style, and whether or not OpenLP should be run in portable mode. --- openlp.pyw | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/openlp.pyw b/openlp.pyw index 4eaf8ee22..12e90a975 100755 --- a/openlp.pyw +++ b/openlp.pyw @@ -131,8 +131,16 @@ def main(): # Set up command line options. usage = u'Usage: %prog [options] [qt-options]' parser = OptionParser(usage=usage) - parser.add_option("-d", "--debug", dest="debug", - action="store_true", help="set logging to DEBUG level") + parser.add_option("-l", "--log-level", dest="loglevel", + default="info", metavar="LEVEL", + help="Set logging to LEVEL level. Valid values are " + "\"debug\", \"info\", \"warning\".") + parser.add_option("-p", "--portable", dest="portable", + action="store_true", + help="Specify if this should be run as a portable app, " + "off a USB flash drive.") + parser.add_option("-s", "--style", dest="style", + help="Set the Qt4 style (passed directly to Qt4).") # Set up logging filename = u'openlp.log' logfile = RotatingFileHandler(filename, maxBytes=200000, backupCount=5) @@ -141,14 +149,21 @@ def main(): log.addHandler(logfile) # Parse command line options and deal with them. (options, args) = parser.parse_args() - if options.debug: + qt_args = [] + if options.loglevel.lower() in ['d', 'debug']: log.setLevel(logging.DEBUG) + elif options.loglevel.lower() in ['w', 'warning']: + log.setLevel(logging.WARNING) else: log.setLevel(logging.INFO) + if options.style: + qt_args.extend(['-style', options.style]) + # Throw the rest of the arguments at Qt, just in case. + qt_args.extend(args) # Initialise the resources qInitResources() # Now create and actually run the application. - app = OpenLP(sys.argv) + app = OpenLP(qt_args) sys.exit(app.run()) if __name__ == u'__main__': From 1c3c672e9b9544462531f7788f13a1a07fd8c0aa Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Mon, 9 Nov 2009 20:27:25 +0000 Subject: [PATCH 31/66] Add Media Preview to slideController --- openlp/core/ui/maindisplay.py | 1 - openlp/core/ui/slidecontroller.py | 75 ++++++++++++++++++++++++------- 2 files changed, 60 insertions(+), 16 deletions(-) diff --git a/openlp/core/ui/maindisplay.py b/openlp/core/ui/maindisplay.py index ddffeb6d4..1abc33ad6 100644 --- a/openlp/core/ui/maindisplay.py +++ b/openlp/core/ui/maindisplay.py @@ -107,7 +107,6 @@ class MainDisplay(DisplayWidget): self.blankFrame = None self.frame = None self.alertactive = False - self.alertTab = None self.timer_id = 0 self.firstTime = True self.mediaLoaded = False diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index fea8f9378..550574d3a 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- # vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4 - ############################################################################### # OpenLP - Open Source Lyrics Projection # # --------------------------------------------------------------------------- # @@ -24,6 +23,7 @@ import logging import time +import os from PyQt4 import QtCore, QtGui from PyQt4.phonon import Phonon @@ -230,8 +230,21 @@ class SlideController(QtGui.QWidget): self.grid = QtGui.QGridLayout(self.PreviewFrame) self.grid.setMargin(8) self.grid.setObjectName(u'grid') + + self.SlideLayout = QtGui.QVBoxLayout() + self.SlideLayout.setSpacing(0) + self.SlideLayout.setMargin(0) + self.SlideLayout.setObjectName(u'SlideLayout') + self.mediaObject = Phonon.MediaObject(self) + self.video = Phonon.VideoWidget() + self.video.setVisible(False) + self.audio = Phonon.AudioOutput(Phonon.VideoCategory, self.mediaObject) + Phonon.createPath(self.mediaObject, self.video) + Phonon.createPath(self.mediaObject, self.audio) + self.SlideLayout.insertWidget(0, self.video) + # Actual preview screen - self.SlidePreview = QtGui.QLabel(self.parent) + self.SlidePreview = QtGui.QLabel(self) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) @@ -246,7 +259,11 @@ class SlideController(QtGui.QWidget): self.SlidePreview.setLineWidth(1) self.SlidePreview.setScaledContents(True) self.SlidePreview.setObjectName(u'SlidePreview') - self.grid.addWidget(self.SlidePreview, 0, 0, 1, 1) + self.SlideLayout.insertWidget(0, self.SlidePreview) + + + + self.grid.addLayout(self.SlideLayout, 0, 0, 1, 1) # Signals QtCore.QObject.connect(self.PreviewListWidget, QtCore.SIGNAL(u'clicked(QModelIndex)'), self.onSlideSelected) @@ -373,7 +390,7 @@ class SlideController(QtGui.QWidget): item.name == u'Media': self.Toolbar.setVisible(False) self.Mediabar.setVisible(True) - self.volumeSlider.setAudioOutput(self.parent.mainDisplay.audio) + self.volumeSlider.setAudioOutput(self.audio) def addServiceItem(self, item): """ @@ -385,16 +402,20 @@ class SlideController(QtGui.QWidget): #If old item was a command tell it to stop if self.commandItem and \ self.commandItem.service_item_type == ServiceItemType.Command: - Receiver().send_message(u'%s_stop'% self.commandItem.name.lower()) + self.onMediaStop() self.commandItem = item before = time.time() item.render() log.info(u'Rendering took %4s' % (time.time() - before)) self.enableToolBar(item) if item.service_item_type == ServiceItemType.Command: - Receiver().send_message(u'%s_start' % item.name.lower(), \ - [item.shortname, item.service_item_path, - item.service_frames[0][u'title'], self.isLive]) + if self.isLive: + Receiver().send_message(u'%s_start' % item.name.lower(), \ + [item.shortname, item.service_item_path, + item.service_frames[0][u'title'], self.isLive]) + else: + if item.name == u'Media': + self.onMediaStart(item) slideno = 0 if self.songEdit: slideno = self.row @@ -418,13 +439,17 @@ class SlideController(QtGui.QWidget): #If old item was a command tell it to stop if self.commandItem and \ self.commandItem.service_item_type == ServiceItemType.Command: - Receiver().send_message(u'%s_stop'% self.commandItem.name.lower()) + self.onMediaStop() self.commandItem = item self.enableToolBar(item) if item.service_item_type == ServiceItemType.Command: - Receiver().send_message(u'%s_start' % item.name.lower(), \ - [item.shortname, item.service_item_path, - item.service_frames[0][u'title'], slideno, self.isLive]) + if self.isLive: + Receiver().send_message(u'%s_start' % item.name.lower(), \ + [item.shortname, item.service_item_path, + item.service_frames[0][u'title'], slideno, self.isLive]) + else: + if item.name == u'Media': + self.onMediaStart(item) self.displayServiceManagerItems(item, slideno) def displayServiceManagerItems(self, serviceitem, slideno): @@ -626,11 +651,31 @@ class SlideController(QtGui.QWidget): self.parent.LiveController.addServiceManagerItem( self.commandItem, row) + def onMediaStart(self, item): + self.mediaObject.stop() + self.mediaObject.clearQueue() + file = os.path.join(item.service_item_path, item.service_frames[0][u'title']) + self.mediaObject.setCurrentSource(Phonon.MediaSource(file)) + self.onMediaPlay() + def onMediaPause(self): - Receiver().send_message(u'%s_pause'% self.commandItem.name.lower()) + if self.isLive: + Receiver().send_message(u'%s_pause'% self.commandItem.name.lower()) + else: + self.mediaObject.pause() def onMediaPlay(self): - Receiver().send_message(u'%s_play'% self.commandItem.name.lower(), self.isLive) + if self.isLive: + Receiver().send_message(u'%s_play'% self.commandItem.name.lower(), self.isLive) + else: + self.SlidePreview.hide() + self.video.show() + self.mediaObject.play() def onMediaStop(self): - Receiver().send_message(u'%s_stop'% self.commandItem.name.lower()) + if self.isLive: + Receiver().send_message(u'%s_stop'% self.commandItem.name.lower()) + else: + self.mediaObject.stop() + self.video.hide() + self.SlidePreview.show() From d4d1b69d8e496a9ee132ed3998048c69a9706d74 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Tue, 10 Nov 2009 20:12:51 +0000 Subject: [PATCH 32/66] Change version number bzr-revno: 667 --- version.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.txt b/version.txt index e8a209645..8f651f547 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -1.9.0-666 +1.9.0-667 From ab12f73a21e374969bfe1827a23140a4e5aa2293 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Tue, 10 Nov 2009 20:44:02 +0000 Subject: [PATCH 33/66] spacing cleanups --- openlp/core/ui/maindisplay.py | 11 +++++------ openlp/core/ui/slidecontroller.py | 5 ----- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/openlp/core/ui/maindisplay.py b/openlp/core/ui/maindisplay.py index ebd810c5c..0a442e6bb 100644 --- a/openlp/core/ui/maindisplay.py +++ b/openlp/core/ui/maindisplay.py @@ -262,17 +262,16 @@ class MainDisplay(DisplayWidget): self.firstTime = False else: self.mediaObject.enqueue(Phonon.MediaSource(file)) - self.onMediaPlay(message[3]) + self.onMediaPlay() - def onMediaPlay(self, live=True): - log.debug(u'Play the new media, Live %s', live) + def onMediaPlay(self): + log.debug(u'Play the new media, Live ') if not self.mediaLoaded and not self.displayBlank: self.blankDisplay() self.firstTime = True self.mediaLoaded = True - if live: - self.display.hide() - self.video.setFullScreen(True) + self.display.hide() + self.video.setFullScreen(True) self.mediaObject.play() if self.primary: self.setVisible(True) diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index 331597c61..d73637ade 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -230,7 +230,6 @@ class SlideController(QtGui.QWidget): self.grid = QtGui.QGridLayout(self.PreviewFrame) self.grid.setMargin(8) self.grid.setObjectName(u'grid') - self.SlideLayout = QtGui.QVBoxLayout() self.SlideLayout.setSpacing(0) self.SlideLayout.setMargin(0) @@ -242,7 +241,6 @@ class SlideController(QtGui.QWidget): Phonon.createPath(self.mediaObject, self.video) Phonon.createPath(self.mediaObject, self.audio) self.SlideLayout.insertWidget(0, self.video) - # Actual preview screen self.SlidePreview = QtGui.QLabel(self) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, @@ -260,9 +258,6 @@ class SlideController(QtGui.QWidget): self.SlidePreview.setScaledContents(True) self.SlidePreview.setObjectName(u'SlidePreview') self.SlideLayout.insertWidget(0, self.SlidePreview) - - - self.grid.addLayout(self.SlideLayout, 0, 0, 1, 1) # Signals QtCore.QObject.connect(self.PreviewListWidget, From 1eb41aab78a8e0de849803c4af1df416d20d64a0 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Wed, 11 Nov 2009 19:10:38 +0000 Subject: [PATCH 34/66] SlideController cleanups --- openlp.pyw | 3 +++ openlp/core/lib/serviceitem.py | 7 +++++++ openlp/core/ui/maindisplay.py | 6 ++++++ openlp/core/ui/servicemanager.py | 2 -- openlp/core/ui/slidecontroller.py | 16 +++++++--------- 5 files changed, 23 insertions(+), 11 deletions(-) diff --git a/openlp.pyw b/openlp.pyw index 4eaf8ee22..7d123a9de 100755 --- a/openlp.pyw +++ b/openlp.pyw @@ -81,6 +81,8 @@ class OpenLP(QtGui.QApplication): bits = unicode(line).split(u'-') applicationVersion = {u'Full':unicode(line).rstrip(), u'version':bits[0], u'build':bits[1]} + log.info(u'Openlp version %s build %s' % + (applicationVersion[u'version'],applicationVersion[u'build'] )) except: applicationVersion = {u'Full':u'1.9.0-000', u'version':u'1.9.0', u'build':u'000'} @@ -139,6 +141,7 @@ def main(): logfile.setFormatter(logging.Formatter( u'%(asctime)s %(name)-15s %(levelname)-8s %(message)s')) log.addHandler(logfile) + logging.addLevelName(15, u'Timer') # Parse command line options and deal with them. (options, args) = parser.parse_args() if options.debug: diff --git a/openlp/core/lib/serviceitem.py b/openlp/core/lib/serviceitem.py index fe50c220d..e217781c8 100644 --- a/openlp/core/lib/serviceitem.py +++ b/openlp/core/lib/serviceitem.py @@ -279,3 +279,10 @@ class ServiceItem(object): """ return self.uuid != other.uuid + def isSong(self): + return self.name == u'Songs' + + def isMedia(self): + return self.name == u'Media' + + diff --git a/openlp/core/ui/maindisplay.py b/openlp/core/ui/maindisplay.py index 0a442e6bb..249cd3827 100644 --- a/openlp/core/ui/maindisplay.py +++ b/openlp/core/ui/maindisplay.py @@ -24,6 +24,7 @@ import logging import os +import time from PyQt4 import QtCore, QtGui from PyQt4.phonon import Phonon @@ -196,11 +197,16 @@ class MainDisplay(DisplayWidget): if self.timer_id != 0 : self.displayAlert() elif not self.displayBlank: + #self.setWindowOpacity(0.5) self.display.setPixmap(QtGui.QPixmap.fromImage(frame)) + #QtCore.QTimer.singleShot(500, self.aa ) if not self.isVisible(): self.setVisible(True) self.showFullScreen() +# def aa(self): +# self.setWindowOpacity(1) + def blankDisplay(self): if not self.displayBlank: self.displayBlank = True diff --git a/openlp/core/ui/servicemanager.py b/openlp/core/ui/servicemanager.py index 245140e31..bb39b573e 100644 --- a/openlp/core/ui/servicemanager.py +++ b/openlp/core/ui/servicemanager.py @@ -56,7 +56,6 @@ class ServiceManagerList(QtGui.QTreeWidget): # else: # event.ignore() - def keyPressEvent(self, event): if type(event) == QtGui.QKeyEvent: #here accept the event and do something @@ -99,7 +98,6 @@ class ServiceManagerList(QtGui.QTreeWidget): mimeData.setText(u'ServiceManager') dropAction = drag.start(QtCore.Qt.CopyAction) - class ServiceManager(QtGui.QWidget): """ Manages the services. This involves taking text strings from plugins and diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index d73637ade..b90038a0d 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -347,7 +347,7 @@ class SlideController(QtGui.QWidget): self.Toolbar.makeWidgetsInvisible(self.image_list) if item.service_item_type == ServiceItemType.Text: self.Toolbar.makeWidgetsInvisible(self.image_list) - if item.name == u'Songs' and \ + if item.isSong() and \ str_to_bool(self.songsconfig.get_config(u'display songbar', True)): for action in self.Songbar.actions: self.Songbar.actions[action].setVisible(False) @@ -366,8 +366,7 @@ class SlideController(QtGui.QWidget): #Not sensible to allow loops with 1 frame if len(item.frames) > 1: self.Toolbar.makeWidgetsVisible(self.image_list) - elif item.service_item_type == ServiceItemType.Command and \ - item.name == u'Media': + elif item.isMedia(): self.Toolbar.setVisible(False) self.Mediabar.setVisible(True) self.volumeSlider.setAudioOutput(self.parent.mainDisplay.audio) @@ -379,10 +378,9 @@ class SlideController(QtGui.QWidget): self.Toolbar.setVisible(True) self.Mediabar.setVisible(False) self.Toolbar.makeWidgetsInvisible(self.song_edit_list) - if (item.name == u'Songs' or item.name == u'Custom') and item.fromPlugin: + if item.editEnabled and item.fromPlugin: self.Toolbar.makeWidgetsVisible(self.song_edit_list) - elif item.service_item_type == ServiceItemType.Command and \ - item.name == u'Media': + elif item.isMedia(): self.Toolbar.setVisible(False) self.Mediabar.setVisible(True) self.volumeSlider.setAudioOutput(self.audio) @@ -401,7 +399,7 @@ class SlideController(QtGui.QWidget): self.commandItem = item before = time.time() item.render() - log.info(u'Rendering took %4s' % (time.time() - before)) + log.log(15, u'Rendering took %4s' % (time.time() - before)) self.enableToolBar(item) if item.service_item_type == ServiceItemType.Command: if self.isLive: @@ -490,7 +488,7 @@ class SlideController(QtGui.QWidget): self.PreviewListWidget.selectRow(slideno) self.onSlideSelected() self.PreviewListWidget.setFocus() - log.info(u'Display Rendering took %4s' % (time.time() - before)) + log.log(15, u'Display Rendering took %4s' % (time.time() - before)) if self.serviceitem.audit and self.isLive: Receiver().send_message(u'songusage_live', self.serviceitem.audit) log.debug(u'displayServiceManagerItems End') @@ -539,7 +537,7 @@ class SlideController(QtGui.QWidget): if frame is None: frame = self.serviceitem.render_individual(row) self.SlidePreview.setPixmap(QtGui.QPixmap.fromImage(frame)) - log.info(u'Slide Rendering took %4s' % (time.time() - before)) + log.log(15, u'Slide Rendering took %4s' % (time.time() - before)) if self.isLive: self.parent.mainDisplay.frameView(frame) self.row = row From b100731dc4b2ff86c07932806d217c5143823fd0 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Thu, 12 Nov 2009 00:44:26 +0000 Subject: [PATCH 35/66] A unicode fix for songs --- openlp/core/lib/songxmlhandler.py | 6 ++++-- openlp/plugins/songs/lib/mediaitem.py | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/openlp/core/lib/songxmlhandler.py b/openlp/core/lib/songxmlhandler.py index 4543464bb..37bbe25e4 100644 --- a/openlp/core/lib/songxmlhandler.py +++ b/openlp/core/lib/songxmlhandler.py @@ -134,7 +134,8 @@ class SongXMLParser(object): The XML of the song to be parsed. """ try: - self.song_xml = ElementTree(element=XML(xml)) + self.song_xml = ElementTree( + element=XML(unicode(xml).encode('unicode-escape'))) except: log.exception(u'Invalid xml %s', xml) @@ -147,7 +148,8 @@ class SongXMLParser(object): verse_list = [] for element in iter: if element.tag == u'verse': - verse_list.append([element.attrib, element.text]) + verse_list.append([element.attrib, + unicode(element.text).decode('unicode-escape')]) return verse_list def dump_xml(self): diff --git a/openlp/plugins/songs/lib/mediaitem.py b/openlp/plugins/songs/lib/mediaitem.py index 33ee028e2..f69faed8b 100644 --- a/openlp/plugins/songs/lib/mediaitem.py +++ b/openlp/plugins/songs/lib/mediaitem.py @@ -291,7 +291,7 @@ class SongMediaItem(MediaManagerItem): service_item.editId = item_id service_item.verse_order = song.verse_order if song.lyrics.startswith(u' Date: Thu, 12 Nov 2009 00:49:55 +0000 Subject: [PATCH 36/66] A unicode fix for themes --- openlp/core/lib/themexmlhandler.py | 3 ++- openlp/core/ui/amendthemeform.py | 4 ++-- openlp/core/ui/mainwindow.py | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/openlp/core/lib/themexmlhandler.py b/openlp/core/lib/themexmlhandler.py index 0501fb06f..1ffece78b 100644 --- a/openlp/core/lib/themexmlhandler.py +++ b/openlp/core/lib/themexmlhandler.py @@ -30,7 +30,7 @@ from xml.etree.ElementTree import ElementTree, XML from openlp.core.lib import str_to_bool blankthemexml=\ -''' +''' BlankStyle @@ -348,6 +348,7 @@ class ThemeXML(object): iter = theme_xml.getiterator() master = u'' for element in iter: + element.text = unicode(element.text).decode('unicode-escape') if len(element.getchildren()) > 0: master = element.tag + u'_' else: diff --git a/openlp/core/ui/amendthemeform.py b/openlp/core/ui/amendthemeform.py index 27197c5af..4e5b9cd9d 100644 --- a/openlp/core/ui/amendthemeform.py +++ b/openlp/core/ui/amendthemeform.py @@ -126,7 +126,7 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog): def accept(self): new_theme = ThemeXML() theme_name = unicode(self.ThemeNameEdit.displayText()) - new_theme.new_document(theme_name) + new_theme.new_document(theme_name.encode('unicode-escape')) save_from = None save_to = None if self.theme.background_mode == u'transparent': @@ -144,7 +144,7 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog): (path, filename) = \ os.path.split(unicode(self.theme.background_filename)) new_theme.add_background_image(filename) - save_to= os.path.join(self.path, theme_name, filename ) + save_to = os.path.join(self.path, theme_name, filename) save_from = self.theme.background_filename new_theme.add_font(unicode(self.theme.font_main_name), diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index c725948a7..22e2087bc 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -676,7 +676,8 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): self.setWindowTitle(title) def defaultThemeChanged(self, theme): - self.DefaultThemeLabel.setText(self.defaultThemeText + theme) + self.DefaultThemeLabel.setText( + u'%s %s' % (self.defaultThemeText, theme)) def toggleMediaManager(self, visible): if self.MediaManagerDock.isVisible() != visible: From e62c482a2e56edfa4c9676c002511333c3601652 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Thu, 12 Nov 2009 17:21:15 +0000 Subject: [PATCH 37/66] Slide Controller and Transition changes --- openlp/core/lib/serviceitem.py | 7 ++++++ openlp/core/ui/maindisplay.py | 8 +++--- openlp/core/ui/slidecontroller.py | 41 ++++++++++++++----------------- 3 files changed, 29 insertions(+), 27 deletions(-) diff --git a/openlp/core/lib/serviceitem.py b/openlp/core/lib/serviceitem.py index e217781c8..19f5f4bda 100644 --- a/openlp/core/lib/serviceitem.py +++ b/openlp/core/lib/serviceitem.py @@ -285,4 +285,11 @@ class ServiceItem(object): def isMedia(self): return self.name == u'Media' + def isCommand(self): + return self.service_item_type == ServiceItemType.Command + def isImage(self): + return self.service_item_type == ServiceItemType.Image + + def isText(self): + return self.service_item_type == ServiceItemType.Text diff --git a/openlp/core/ui/maindisplay.py b/openlp/core/ui/maindisplay.py index 249cd3827..50781ad8d 100644 --- a/openlp/core/ui/maindisplay.py +++ b/openlp/core/ui/maindisplay.py @@ -197,15 +197,15 @@ class MainDisplay(DisplayWidget): if self.timer_id != 0 : self.displayAlert() elif not self.displayBlank: - #self.setWindowOpacity(0.5) + self.setWindowOpacity(0.5) self.display.setPixmap(QtGui.QPixmap.fromImage(frame)) - #QtCore.QTimer.singleShot(500, self.aa ) + QtCore.QTimer.singleShot(250, self.aa ) if not self.isVisible(): self.setVisible(True) self.showFullScreen() -# def aa(self): -# self.setWindowOpacity(1) + def aa(self): + self.setWindowOpacity(1) def blankDisplay(self): if not self.displayBlank: diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index b90038a0d..88e81bfae 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -345,7 +345,7 @@ class SlideController(QtGui.QWidget): self.Songbar.setVisible(False) self.Mediabar.setVisible(False) self.Toolbar.makeWidgetsInvisible(self.image_list) - if item.service_item_type == ServiceItemType.Text: + if item.isText(): self.Toolbar.makeWidgetsInvisible(self.image_list) if item.isSong() and \ str_to_bool(self.songsconfig.get_config(u'display songbar', True)): @@ -362,7 +362,7 @@ class SlideController(QtGui.QWidget): #More than 20 verses hard luck pass self.Songbar.setVisible(True) - elif item.service_item_type == ServiceItemType.Image: + elif item.isImage(): #Not sensible to allow loops with 1 frame if len(item.frames) > 1: self.Toolbar.makeWidgetsVisible(self.image_list) @@ -393,21 +393,20 @@ class SlideController(QtGui.QWidget): """ log.debug(u'addServiceItem') #If old item was a command tell it to stop - if self.commandItem and \ - self.commandItem.service_item_type == ServiceItemType.Command: + if self.commandItem and self.commandItem.isCommand(): self.onMediaStop() self.commandItem = item before = time.time() item.render() log.log(15, u'Rendering took %4s' % (time.time() - before)) self.enableToolBar(item) - if item.service_item_type == ServiceItemType.Command: + if item.isCommand(): if self.isLive: Receiver().send_message(u'%s_start' % item.name.lower(), \ [item.shortname, item.service_item_path, item.service_frames[0][u'title'], self.isLive]) else: - if item.name == u'Media': + if item.isMedia(): self.onMediaStart(item) slideno = 0 if self.songEdit: @@ -430,18 +429,17 @@ class SlideController(QtGui.QWidget): """ log.debug(u'addServiceManagerItem') #If old item was a command tell it to stop - if self.commandItem and \ - self.commandItem.service_item_type == ServiceItemType.Command: + if self.commandItem and self.commandItem.isCommand(): self.onMediaStop() self.commandItem = item self.enableToolBar(item) - if item.service_item_type == ServiceItemType.Command: + if item.isCommand(): if self.isLive: Receiver().send_message(u'%s_start' % item.name.lower(), \ [item.shortname, item.service_item_path, item.service_frames[0][u'title'], slideno, self.isLive]) else: - if item.name == u'Media': + if item.isMedia(): self.onMediaStart(item) self.displayServiceManagerItems(item, slideno) @@ -498,8 +496,7 @@ class SlideController(QtGui.QWidget): """ Go to the first slide. """ - if self.commandItem and \ - self.commandItem.service_item_type == ServiceItemType.Command: + if self.commandItem and self.commandItem.isCommand(): Receiver().send_message(u'%s_first'% self.commandItem.name.lower()) self.updatePreview() else: @@ -510,8 +507,7 @@ class SlideController(QtGui.QWidget): """ Blank the screen. """ - if self.commandItem and \ - self.commandItem.service_item_type == ServiceItemType.Command: + if self.commandItem and self.commandItem.isCommand(): if blanked: Receiver().send_message(u'%s_blank'% self.commandItem.name.lower()) else: @@ -527,7 +523,7 @@ class SlideController(QtGui.QWidget): row = self.PreviewListWidget.currentRow() self.row = 0 if row > -1 and row < self.PreviewListWidget.rowCount(): - if self.commandItem.service_item_type == ServiceItemType.Command: + if self.commandItem.isCommand(): Receiver().send_message(u'%s_slide'% self.commandItem.name.lower(), [row]) if self.isLive: self.updatePreview() @@ -556,22 +552,23 @@ class SlideController(QtGui.QWidget): QtCore.QTimer.singleShot(0.5, self.grabMainDisplay) QtCore.QTimer.singleShot(2.5, self.grabMainDisplay) else: - label = self.PreviewListWidget.cellWidget(self.PreviewListWidget.currentRow(), 0) + label = self.PreviewListWidget.cellWidget( + self.PreviewListWidget.currentRow(), 0) self.SlidePreview.setPixmap(label.pixmap()) def grabMainDisplay(self): rm = self.parent.RenderManager 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()) + winimg = QtGui.QPixmap.grabWindow(winid, rect.x(), + rect.y(), rect.width(), rect.height()) self.SlidePreview.setPixmap(winimg) def onSlideSelectedNext(self): """ Go to the next slide. """ - if self.commandItem and \ - self.commandItem.service_item_type == ServiceItemType.Command: + if self.commandItem and self.commandItem.isCommand(): Receiver().send_message(u'%s_next'% self.commandItem.name.lower()) self.updatePreview() else: @@ -585,8 +582,7 @@ class SlideController(QtGui.QWidget): """ Go to the previous slide. """ - if self.commandItem and \ - self.commandItem.service_item_type == ServiceItemType.Command: + if self.commandItem and self.commandItem.isCommand(): Receiver().send_message( u'%s_previous'% self.commandItem.name.lower()) self.updatePreview() @@ -601,8 +597,7 @@ class SlideController(QtGui.QWidget): """ Go to the last slide. """ - if self.commandItem and \ - self.commandItem.service_item_type == ServiceItemType.Command: + if self.commandItem and self.commandItem.isCommand(): Receiver().send_message(u'%s_last'% self.commandItem.name.lower()) self.updatePreview() else: From 9970ae82813b7cfb7f2f8ae53a91d7085dd55b97 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Thu, 12 Nov 2009 17:48:49 +0000 Subject: [PATCH 38/66] Transitions between slides --- openlp/core/ui/maindisplay.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openlp/core/ui/maindisplay.py b/openlp/core/ui/maindisplay.py index 0d8ceedb0..2c83cac00 100644 --- a/openlp/core/ui/maindisplay.py +++ b/openlp/core/ui/maindisplay.py @@ -198,8 +198,9 @@ class MainDisplay(DisplayWidget): self.displayAlert() elif not self.displayBlank: self.setWindowOpacity(0.5) + self.show() self.display.setPixmap(QtGui.QPixmap.fromImage(frame)) - QtCore.QTimer.singleShot(250, self.aa ) + QtCore.QTimer.singleShot(500, self.aa ) if not self.isVisible(): self.setVisible(True) self.showFullScreen() From 124c51138507c912df8a826f76b88f49f7742a61 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Thu, 12 Nov 2009 18:44:45 +0000 Subject: [PATCH 39/66] Fix saving and reloading of media items --- openlp/core/lib/serviceitem.py | 18 ++++-------------- openlp/plugins/media/lib/mediaitem.py | 2 +- 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/openlp/core/lib/serviceitem.py b/openlp/core/lib/serviceitem.py index 19f5f4bda..577013159 100644 --- a/openlp/core/lib/serviceitem.py +++ b/openlp/core/lib/serviceitem.py @@ -38,7 +38,6 @@ class ServiceItemType(object): Text = 1 Image = 2 Command = 3 - Video = 4 class ServiceItem(object): """ @@ -156,12 +155,6 @@ class ServiceItem(object): self.service_frames.append( {u'title': frame_title, u'text': None, u'image': image}) - def add_from_media(self, path, frame_title, image): - self.service_item_type = ServiceItemType.Video - self.service_item_path = path - self.service_frames.append( - {u'title': frame_title, u'text': None, u'image': image}) - def add_from_text(self, frame_title, raw_slide): """ Add a text slide to the service item. @@ -216,10 +209,7 @@ class ServiceItem(object): service_data.append(slide[u'title']) elif self.service_item_type == ServiceItemType.Command: for slide in self.service_frames: - service_data.append(slide[u'title']) - elif self.service_item_type == ServiceItemType.Video: - for slide in self.service_frames: - service_data.append(slide[u'title']) + service_data.append({u'title':slide[u'title'], u'image':slide[u'image']}) return {u'header': service_header, u'data': service_data} def set_from_service(self, serviceitem, path=None): @@ -252,8 +242,8 @@ class ServiceItem(object): self.add_from_image(path, text_image, real_image) elif self.service_item_type == ServiceItemType.Command: for text_image in serviceitem[u'serviceitem'][u'data']: - filename = os.path.join(path, text_image) - self.add_from_command(path, text_image) + filename = os.path.join(path, text_image[u'title']) + self.add_from_command(path, text_image[u'title'], text_image[u'image'] ) elif self.service_item_type == ServiceItemType.Video: pass @@ -283,7 +273,7 @@ class ServiceItem(object): return self.name == u'Songs' def isMedia(self): - return self.name == u'Media' + return self.name.lower() == u'media' def isCommand(self): return self.service_item_type == ServiceItemType.Command diff --git a/openlp/plugins/media/lib/mediaitem.py b/openlp/plugins/media/lib/mediaitem.py index 708307868..bd9739e4a 100644 --- a/openlp/plugins/media/lib/mediaitem.py +++ b/openlp/plugins/media/lib/mediaitem.py @@ -79,7 +79,7 @@ class MediaMediaItem(MediaManagerItem): items = self.ListView.selectedIndexes() if len(items) > 1: return False - service_item.title = self.trUtf8(u'Media') + service_item.title = unicode(self.trUtf8(u'Media')) for item in items: bitem = self.ListView.item(item.row()) filename = unicode((bitem.data(QtCore.Qt.UserRole)).toString()) From 04873758e96a78e7cffec9083ed48c5436d06bf2 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Thu, 12 Nov 2009 19:05:24 +0000 Subject: [PATCH 40/66] Remove extra Video --- openlp/core/lib/serviceitem.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/openlp/core/lib/serviceitem.py b/openlp/core/lib/serviceitem.py index 577013159..e9de1f832 100644 --- a/openlp/core/lib/serviceitem.py +++ b/openlp/core/lib/serviceitem.py @@ -244,8 +244,6 @@ class ServiceItem(object): for text_image in serviceitem[u'serviceitem'][u'data']: filename = os.path.join(path, text_image[u'title']) self.add_from_command(path, text_image[u'title'], text_image[u'image'] ) - elif self.service_item_type == ServiceItemType.Video: - pass def merge(self, other): """ From 6df4e5a36935f2132796ca1dadc02246eea85168 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Thu, 12 Nov 2009 19:12:13 +0000 Subject: [PATCH 41/66] Remove transition code --- openlp/core/ui/maindisplay.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/openlp/core/ui/maindisplay.py b/openlp/core/ui/maindisplay.py index 2c83cac00..5fea3268e 100644 --- a/openlp/core/ui/maindisplay.py +++ b/openlp/core/ui/maindisplay.py @@ -197,16 +197,16 @@ class MainDisplay(DisplayWidget): if self.timer_id != 0 : self.displayAlert() elif not self.displayBlank: - self.setWindowOpacity(0.5) - self.show() +# self.setWindowOpacity(0.5) +# self.show() self.display.setPixmap(QtGui.QPixmap.fromImage(frame)) - QtCore.QTimer.singleShot(500, self.aa ) +# QtCore.QTimer.singleShot(500, self.aa ) if not self.isVisible(): self.setVisible(True) self.showFullScreen() - - def aa(self): - self.setWindowOpacity(1) +# +# def aa(self): +# self.setWindowOpacity(1) def blankDisplay(self): if not self.displayBlank: From 1c0a86b17fcc76969dd9fb8bfcc89c98af461b2a Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Thu, 12 Nov 2009 23:33:59 +0000 Subject: [PATCH 42/66] Simplify OS path setting --- openlp/core/ui/servicemanager.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/openlp/core/ui/servicemanager.py b/openlp/core/ui/servicemanager.py index bb39b573e..bbfc6d0fb 100644 --- a/openlp/core/ui/servicemanager.py +++ b/openlp/core/ui/servicemanager.py @@ -23,7 +23,6 @@ ############################################################################### import os -import string import logging import cPickle import zipfile @@ -460,7 +459,7 @@ class ServiceManager(QtGui.QWidget): def onQuickSaveService(self): self.onSaveService(True) - def onLoadService(self, lastService = False): + def onLoadService(self, lastService=False): """ Load an existing service from disk and rebuild the serviceitems. All files retrieved from the zip file are placed in a temporary directory @@ -481,11 +480,8 @@ class ServiceManager(QtGui.QWidget): try: zip = zipfile.ZipFile(unicode(filename)) for file in zip.namelist(): - if os.name == u'nt': - winfile = string.replace(file, '/', os.path.sep) - names = winfile.split(os.path.sep) - else: - names = file.split(os.path.sep) + osfile = unicode(QtCore.QDir.toNativeSeparators(file)) + names = osfile.split(os.path.sep) file_to = os.path.join(self.servicePath, names[len(names) - 1]) f = open(file_to, u'wb') @@ -501,7 +497,7 @@ class ServiceManager(QtGui.QWidget): for item in items: serviceitem = ServiceItem() serviceitem.RenderManager = self.parent.RenderManager - serviceitem.set_from_service(item, self.servicePath ) + serviceitem.set_from_service(item, self.servicePath) self.addServiceItem(serviceitem) try: if os.path.isfile(p_file): From 1c92f157c700900e3dbcb5340d0f2dac627dfb5b Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Thu, 12 Nov 2009 23:43:47 +0000 Subject: [PATCH 43/66] Refactor file_to_xml => get_text_file_string --- openlp/core/lib/__init__.py | 33 ++++++++++++++++++--------------- openlp/core/ui/thememanager.py | 4 ++-- 2 files changed, 20 insertions(+), 17 deletions(-) diff --git a/openlp/core/lib/__init__.py b/openlp/core/lib/__init__.py index e3618c7a1..1f3fcd4b8 100644 --- a/openlp/core/lib/__init__.py +++ b/openlp/core/lib/__init__.py @@ -27,6 +27,7 @@ The :mod:`lib` module contains most of the components and libraries that make OpenLP work. """ import logging +import os.path import types from PyQt4 import QtCore, QtGui @@ -49,26 +50,28 @@ def translate(context, text): return QtGui.QApplication.translate( context, text, None, QtGui.QApplication.UnicodeUTF8) -def file_to_xml(xmlfile): +def get_text_file_string(text_file): """ - Open a file and return the contents of the file. + Open a file and return the contents of the file. If the supplied file name + is not a file then the function returns False. If there is an error + loading the file then the function will return None. - ``xmlfile`` + ``textfile`` The name of the file. """ - file = None - xml = None + if not os.path.isfile(text_file): + return False + file_handle = None + content_string = None try: - file = open(xmlfile, u'r') - xml = file.read() + file_handle = open(text_file, u'r') + content_string = file_handle.read() except IOError: - #This may not be an error as this is also used to check - #that a file exist - log.error(u'Failed to open XML file %s' % xmlfile) + log.error(u'Failed to open text file %s' % text_file) finally: - if file: - file.close() - return xml + if file_handle: + file_handle.close() + return content_string def str_to_bool(stringvalue): """ @@ -152,5 +155,5 @@ from rendermanager import RenderManager from mediamanageritem import MediaManagerItem from baselistwithdnd import BaseListWithDnD -__all__ = [ 'translate', 'file_to_xml', 'str_to_bool', - 'contextMenuAction', 'contextMenuSeparator','ServiceItem'] +__all__ = [ 'translate', 'get_text_file_string', 'str_to_bool', + 'contextMenuAction', 'contextMenuSeparator', 'ServiceItem'] diff --git a/openlp/core/ui/thememanager.py b/openlp/core/ui/thememanager.py index 51f1f2425..77e38ad20 100644 --- a/openlp/core/ui/thememanager.py +++ b/openlp/core/ui/thememanager.py @@ -33,7 +33,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, \ - str_to_bool, file_to_xml, buildIcon, Receiver, contextMenuAction, \ + str_to_bool, get_text_file_string, buildIcon, Receiver, contextMenuAction, \ contextMenuSeparator from openlp.core.utils import ConfigHelper @@ -274,7 +274,7 @@ class ThemeManager(QtGui.QWidget): log.debug(u'getthemedata for theme %s', themename) xml_file = os.path.join(self.path, unicode(themename), unicode(themename) + u'.xml') - xml = file_to_xml(xml_file) + xml = get_text_file_string(xml_file) if not xml: xml = self.baseTheme() return self.createThemeFromXml(xml, self.path) From b6eadecb4688e2dafef1be022bcc2a77211b431a Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Thu, 12 Nov 2009 23:46:20 +0000 Subject: [PATCH 44/66] isfile test doesn't need try --- openlp/core/utils/registry.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openlp/core/utils/registry.py b/openlp/core/utils/registry.py index 8fa0bb6a8..e56d939ef 100644 --- a/openlp/core/utils/registry.py +++ b/openlp/core/utils/registry.py @@ -101,10 +101,10 @@ class Registry(object): return False def _load(self): + if not os.path.isfile(self.file_name): + return False file_handle = None try: - if not os.path.isfile(self.file_name): - return False file_handle = open(self.file_name, u'r') self.config.readfp(file_handle) return True From b79d535e04a3c6632a028213ed214b0e23c8221e Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Thu, 12 Nov 2009 23:49:35 +0000 Subject: [PATCH 45/66] Fix theme loading logic and missing item from cleaning --- openlp/core/ui/amendthemeform.py | 2 +- openlp/core/ui/thememanager.py | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/openlp/core/ui/amendthemeform.py b/openlp/core/ui/amendthemeform.py index 4e5b9cd9d..652b26284 100644 --- a/openlp/core/ui/amendthemeform.py +++ b/openlp/core/ui/amendthemeform.py @@ -184,7 +184,7 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog): def loadTheme(self, theme): log.debug(u'LoadTheme %s', theme) - self.theme = self.thememanager.getThemeData(theme) + self.theme = theme # Stop the initial screen setup generating 1 preview per field! self.allowPreview = False self.paintUi(self.theme) diff --git a/openlp/core/ui/thememanager.py b/openlp/core/ui/thememanager.py index 77e38ad20..0f333bf04 100644 --- a/openlp/core/ui/thememanager.py +++ b/openlp/core/ui/thememanager.py @@ -150,15 +150,17 @@ class ThemeManager(QtGui.QWidget): self.pushThemes() def onAddTheme(self): - self.amendThemeForm.loadTheme(None) + theme = self.createThemeFromXml(self.baseTheme(), self.path) + self.amendThemeForm.loadTheme(theme) self.saveThemeName = u'' self.amendThemeForm.exec_() def onEditTheme(self): item = self.ThemeListWidget.currentItem() if item: - self.amendThemeForm.loadTheme( + theme = self.getThemeData( unicode(item.data(QtCore.Qt.UserRole).toString())) + self.amendThemeForm.loadTheme(theme) self.saveThemeName = unicode( item.data(QtCore.Qt.UserRole).toString()) self.amendThemeForm.exec_() @@ -265,7 +267,7 @@ class ThemeManager(QtGui.QWidget): self.pushThemes() def pushThemes(self): - Receiver().send_message(u'update_themes', self.getThemes() ) + Receiver().send_message(u'update_themes', self.getThemes()) def getThemes(self): return self.themelist @@ -501,6 +503,8 @@ class ThemeManager(QtGui.QWidget): theme.display_wrapStyle = theme.display_wrapStyle.strip() theme.font_footer_color = theme.font_footer_color.strip() theme.font_footer_height = int(theme.font_footer_height.strip()) + theme.font_footer_indentation = \ + int(theme.font_footer_indentation.strip()) theme.font_footer_italics = str_to_bool(theme.font_footer_italics) theme.font_footer_name = theme.font_footer_name.strip() #theme.font_footer_override From f764eb7d5968ab1e06a12473823c12b6c7fa0054 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Thu, 12 Nov 2009 23:58:19 +0000 Subject: [PATCH 46/66] Fix imports --- openlp/core/ui/maindisplay.py | 1 - openlp/core/ui/slidecontroller.py | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/openlp/core/ui/maindisplay.py b/openlp/core/ui/maindisplay.py index 5fea3268e..f5e57c2c3 100644 --- a/openlp/core/ui/maindisplay.py +++ b/openlp/core/ui/maindisplay.py @@ -24,7 +24,6 @@ import logging import os -import time from PyQt4 import QtCore, QtGui from PyQt4.phonon import Phonon diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index 88e81bfae..d359dc923 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -28,8 +28,7 @@ import os from PyQt4 import QtCore, QtGui from PyQt4.phonon import Phonon -from openlp.core.lib import OpenLPToolbar, Receiver, ServiceItemType, \ - str_to_bool, PluginConfig +from openlp.core.lib import OpenLPToolbar, Receiver, str_to_bool, PluginConfig class SlideList(QtGui.QTableWidget): """ From 3defb3b4c5bbfb28086a01f0af6680d415d02869 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Fri, 13 Nov 2009 17:42:51 +0000 Subject: [PATCH 47/66] SPG --- openlp/core/ui/slidecontroller.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index d359dc923..e916e77be 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -423,7 +423,7 @@ class SlideController(QtGui.QWidget): def addServiceManagerItem(self, item, slideno): """ Method to install the service item into the controller and - request the correct the toolbar of the plugin + request the correct toolbar for the plugin. Called by ServiceManager """ log.debug(u'addServiceManagerItem') From f0e2fdd6f5c5d1cdf83d08426afb31c522421b9b Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Fri, 13 Nov 2009 17:43:58 +0000 Subject: [PATCH 48/66] Fix multiple video plays --- openlp/core/ui/maindisplay.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openlp/core/ui/maindisplay.py b/openlp/core/ui/maindisplay.py index f5e57c2c3..75e993195 100644 --- a/openlp/core/ui/maindisplay.py +++ b/openlp/core/ui/maindisplay.py @@ -278,6 +278,7 @@ class MainDisplay(DisplayWidget): self.mediaLoaded = True self.display.hide() self.video.setFullScreen(True) + self.video.setVisible(True) self.mediaObject.play() if self.primary: self.setVisible(True) @@ -289,7 +290,6 @@ class MainDisplay(DisplayWidget): def onMediaStop(self): log.debug(u'Media stopped by user') self.mediaObject.stop() - self.display.show() def onMediaFinish(self): log.debug(u'Reached end of media playlist') From 262577bd6e72abe5a8e432b1022602c894096077 Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Fri, 13 Nov 2009 20:46:47 +0200 Subject: [PATCH 49/66] Removed an unused parameter from addToolbarButton, and added a "checkable" argument. --- openlp/core/lib/toolbar.py | 9 +++++++-- openlp/core/ui/slidecontroller.py | 13 ++++++++----- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/openlp/core/lib/toolbar.py b/openlp/core/lib/toolbar.py index 8ab0e1961..6ed221cf4 100644 --- a/openlp/core/lib/toolbar.py +++ b/openlp/core/lib/toolbar.py @@ -46,7 +46,7 @@ class OpenLPToolbar(QtGui.QToolBar): self.log.debug(u'Init done') def addToolbarButton(self, title, icon, tooltip=None, slot=None, - objectname=None): + checkable=False): """ A method to help developers easily add a button to the toolbar. @@ -69,12 +69,17 @@ class OpenLPToolbar(QtGui.QToolBar): """ ButtonIcon = buildIcon(icon) if ButtonIcon: - if slot: + if slot and not checkable: ToolbarButton = self.addAction(ButtonIcon, title, slot) else: ToolbarButton = self.addAction(ButtonIcon, title) if tooltip: ToolbarButton.setToolTip(tooltip) + if checkable: + ToolbarButton.setCheckable(True) + QtCore.QObject.connect(ToolbarButton, + QtCore.SIGNAL(u'toggled(bool)'), slot) + #log.debug(u'checkable') self.icons[title] = ButtonIcon self.actions[title] = ToolbarButton diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index 88e81bfae..16efa6fbc 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -159,8 +159,11 @@ class SlideController(QtGui.QWidget): self.trUtf8(u'Move to last'), self.onSlideSelectedLast) if self.isLive: self.Toolbar.addToolbarSeparator(u'Close Separator') - self.blackPushButton = self.Toolbar.addPushButton( - u':/slides/slide_close.png') + self.Toolbar.addToolbarButton( + u'Blank Screen', u':/slides/slide_close.png', + self.trUtf8(u'Blank Screen'), self.onBlankScreen, True) + #self.blackPushButton = self.Toolbar.addPushButton( + # u':/slides/slide_close.png') if not self.isLive: self.Toolbar.addToolbarSeparator(u'Close Separator') self.Toolbar.addToolbarButton( @@ -197,7 +200,7 @@ class SlideController(QtGui.QWidget): self.trUtf8(u'Start playing media'), self.onMediaStop) self.volumeSlider = Phonon.VolumeSlider() self.volumeSlider.setGeometry(QtCore.QRect(90, 260, 221, 24)) - self.volumeSlider.setObjectName("volumeSlider") + self.volumeSlider.setObjectName(u'volumeSlider') self.Mediabar.addToolbarWidget( u'Audio Volume', self.volumeSlider) self.ControllerLayout.addWidget(self.Mediabar) @@ -265,8 +268,8 @@ class SlideController(QtGui.QWidget): QtCore.QObject.connect(self.PreviewListWidget, QtCore.SIGNAL(u'activated(QModelIndex)'), self.onSlideSelected) if isLive: - QtCore.QObject.connect(self.blackPushButton, - QtCore.SIGNAL(u'clicked(bool)'), self.onBlankScreen) + #QtCore.QObject.connect(self.blackPushButton, + # QtCore.SIGNAL(u'clicked(bool)'), self.onBlankScreen) QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'update_spin_delay'), self.receiveSpinDelay) Receiver().send_message(u'request_spin_delay') From 8c599b670738a347fbb5306484f9df9a63c30bcb Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Fri, 13 Nov 2009 22:10:35 +0200 Subject: [PATCH 50/66] Fixed up an issue between the display screen and the blank button --- openlp/core/lib/toolbar.py | 2 +- openlp/core/ui/maindisplay.py | 10 ++++----- openlp/core/ui/slidecontroller.py | 36 +++++++++++++++---------------- 3 files changed, 22 insertions(+), 26 deletions(-) diff --git a/openlp/core/lib/toolbar.py b/openlp/core/lib/toolbar.py index 6ed221cf4..564a30db7 100644 --- a/openlp/core/lib/toolbar.py +++ b/openlp/core/lib/toolbar.py @@ -79,9 +79,9 @@ class OpenLPToolbar(QtGui.QToolBar): ToolbarButton.setCheckable(True) QtCore.QObject.connect(ToolbarButton, QtCore.SIGNAL(u'toggled(bool)'), slot) - #log.debug(u'checkable') self.icons[title] = ButtonIcon self.actions[title] = ToolbarButton + return ToolbarButton def addToolbarSeparator(self, handle): """ diff --git a/openlp/core/ui/maindisplay.py b/openlp/core/ui/maindisplay.py index 5fea3268e..7884b5d80 100644 --- a/openlp/core/ui/maindisplay.py +++ b/openlp/core/ui/maindisplay.py @@ -208,7 +208,7 @@ class MainDisplay(DisplayWidget): # def aa(self): # self.setWindowOpacity(1) - def blankDisplay(self): + def blankDisplay(self, blanked=True): if not self.displayBlank: self.displayBlank = True self.display.setPixmap(QtGui.QPixmap.fromImage(self.blankFrame)) @@ -216,11 +216,9 @@ class MainDisplay(DisplayWidget): self.displayBlank = False if self.frame: self.frameView(self.frame) - if self.parent.LiveController.blackPushButton.isChecked() != \ - self.displayBlank: - self.parent.LiveController.blackPushButton.setChecked( - self.displayBlank) - self.parent.generalConfig.set_config(u'Screen Blank',self.displayBlank) + if blanked != self.displayBlank: + self.parent.LiveController.blankButton.setChecked(self.displayBlank) + self.parent.generalConfig.set_config(u'Screen Blank', self.displayBlank) def displayAlert(self, text=u''): """ diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index 16efa6fbc..1fe31d666 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -159,11 +159,9 @@ class SlideController(QtGui.QWidget): self.trUtf8(u'Move to last'), self.onSlideSelectedLast) if self.isLive: self.Toolbar.addToolbarSeparator(u'Close Separator') - self.Toolbar.addToolbarButton( + self.blankButton = self.Toolbar.addToolbarButton( u'Blank Screen', u':/slides/slide_close.png', self.trUtf8(u'Blank Screen'), self.onBlankScreen, True) - #self.blackPushButton = self.Toolbar.addPushButton( - # u':/slides/slide_close.png') if not self.isLive: self.Toolbar.addToolbarSeparator(u'Close Separator') self.Toolbar.addToolbarButton( @@ -272,7 +270,7 @@ class SlideController(QtGui.QWidget): # QtCore.SIGNAL(u'clicked(bool)'), self.onBlankScreen) QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'update_spin_delay'), self.receiveSpinDelay) - Receiver().send_message(u'request_spin_delay') + Receiver.send_message(u'request_spin_delay') if isLive: self.Toolbar.makeWidgetsInvisible(self.image_list) else: @@ -405,7 +403,7 @@ class SlideController(QtGui.QWidget): self.enableToolBar(item) if item.isCommand(): if self.isLive: - Receiver().send_message(u'%s_start' % item.name.lower(), \ + Receiver.send_message(u'%s_start' % item.name.lower(), \ [item.shortname, item.service_item_path, item.service_frames[0][u'title'], self.isLive]) else: @@ -438,7 +436,7 @@ class SlideController(QtGui.QWidget): self.enableToolBar(item) if item.isCommand(): if self.isLive: - Receiver().send_message(u'%s_start' % item.name.lower(), \ + Receiver.send_message(u'%s_start' % item.name.lower(), \ [item.shortname, item.service_item_path, item.service_frames[0][u'title'], slideno, self.isLive]) else: @@ -491,7 +489,7 @@ class SlideController(QtGui.QWidget): self.PreviewListWidget.setFocus() log.log(15, u'Display Rendering took %4s' % (time.time() - before)) if self.serviceitem.audit and self.isLive: - Receiver().send_message(u'songusage_live', self.serviceitem.audit) + Receiver.send_message(u'songusage_live', self.serviceitem.audit) log.debug(u'displayServiceManagerItems End') #Screen event methods @@ -500,7 +498,7 @@ class SlideController(QtGui.QWidget): Go to the first slide. """ if self.commandItem and self.commandItem.isCommand(): - Receiver().send_message(u'%s_first'% self.commandItem.name.lower()) + Receiver.send_message(u'%s_first'% self.commandItem.name.lower()) self.updatePreview() else: self.PreviewListWidget.selectRow(0) @@ -512,11 +510,11 @@ class SlideController(QtGui.QWidget): """ if self.commandItem and self.commandItem.isCommand(): if blanked: - Receiver().send_message(u'%s_blank'% self.commandItem.name.lower()) + Receiver.send_message(u'%s_blank'% self.commandItem.name.lower()) else: - Receiver().send_message(u'%s_unblank'% self.commandItem.name.lower()) + Receiver.send_message(u'%s_unblank'% self.commandItem.name.lower()) else: - self.parent.mainDisplay.blankDisplay() + self.parent.mainDisplay.blankDisplay(blanked) def onSlideSelected(self): """ @@ -527,7 +525,7 @@ class SlideController(QtGui.QWidget): self.row = 0 if row > -1 and row < self.PreviewListWidget.rowCount(): if self.commandItem.isCommand(): - Receiver().send_message(u'%s_slide'% self.commandItem.name.lower(), [row]) + Receiver.send_message(u'%s_slide'% self.commandItem.name.lower(), [row]) if self.isLive: self.updatePreview() else: @@ -572,7 +570,7 @@ class SlideController(QtGui.QWidget): Go to the next slide. """ if self.commandItem and self.commandItem.isCommand(): - Receiver().send_message(u'%s_next'% self.commandItem.name.lower()) + Receiver.send_message(u'%s_next'% self.commandItem.name.lower()) self.updatePreview() else: row = self.PreviewListWidget.currentRow() + 1 @@ -586,7 +584,7 @@ class SlideController(QtGui.QWidget): Go to the previous slide. """ if self.commandItem and self.commandItem.isCommand(): - Receiver().send_message( + Receiver.send_message( u'%s_previous'% self.commandItem.name.lower()) self.updatePreview() else: @@ -601,7 +599,7 @@ class SlideController(QtGui.QWidget): Go to the last slide. """ if self.commandItem and self.commandItem.isCommand(): - Receiver().send_message(u'%s_last'% self.commandItem.name.lower()) + Receiver.send_message(u'%s_last'% self.commandItem.name.lower()) self.updatePreview() else: self.PreviewListWidget.selectRow(self.PreviewListWidget.rowCount() - 1) @@ -630,7 +628,7 @@ class SlideController(QtGui.QWidget): def onEditSong(self): self.songEdit = True - Receiver().send_message(u'%s_edit' % self.commandItem.name, u'P:%s' % + Receiver.send_message(u'%s_edit' % self.commandItem.name, u'P:%s' % self.commandItem.editId ) def onGoLive(self): @@ -651,13 +649,13 @@ class SlideController(QtGui.QWidget): def onMediaPause(self): if self.isLive: - Receiver().send_message(u'%s_pause'% self.commandItem.name.lower()) + Receiver.send_message(u'%s_pause'% self.commandItem.name.lower()) else: self.mediaObject.pause() def onMediaPlay(self): if self.isLive: - Receiver().send_message(u'%s_play'% self.commandItem.name.lower(), self.isLive) + Receiver.send_message(u'%s_play'% self.commandItem.name.lower(), self.isLive) else: self.SlidePreview.hide() self.video.show() @@ -665,7 +663,7 @@ class SlideController(QtGui.QWidget): def onMediaStop(self): if self.isLive: - Receiver().send_message(u'%s_stop'% self.commandItem.name.lower()) + Receiver.send_message(u'%s_stop'% self.commandItem.name.lower()) else: self.mediaObject.stop() self.video.hide() From 1d80bb6229f12915374221b8fc142d4497e1bd8a Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Fri, 13 Nov 2009 23:24:59 +0200 Subject: [PATCH 51/66] Attempt to fix recursion in blanking. Fixed all the Receiver.send_message instances to stop instantiating the Receiver class. --- openlp/core/lib/eventreceiver.py | 12 ++++++------ openlp/core/ui/maindisplay.py | 16 +++++++--------- openlp/core/ui/servicemanager.py | 4 ++-- openlp/core/ui/settingsform.py | 2 +- openlp/core/ui/slidecontroller.py | 5 +++++ openlp/core/ui/thememanager.py | 4 ++-- openlp/core/ui/themestab.py | 4 ++-- openlp/plugins/bibles/forms/bibleimportform.py | 6 +++--- openlp/plugins/bibles/lib/bibleCSVimpl.py | 6 +++--- openlp/plugins/bibles/lib/bibleOSISimpl.py | 6 +++--- openlp/plugins/bibles/lib/mediaitem.py | 4 ++-- openlp/plugins/custom/forms/editcustomform.py | 6 +++--- openlp/plugins/images/lib/imagetab.py | 4 ++-- .../presentations/lib/messagelistener.py | 10 +++++----- .../lib/presentationcontroller.py | 18 +++++++++--------- openlp/plugins/remotes/remoteplugin.py | 4 ++-- openlp/plugins/songs/forms/editsongform.py | 6 +++--- 17 files changed, 60 insertions(+), 57 deletions(-) diff --git a/openlp/core/lib/eventreceiver.py b/openlp/core/lib/eventreceiver.py index 4072672f4..96b4832e2 100644 --- a/openlp/core/lib/eventreceiver.py +++ b/openlp/core/lib/eventreceiver.py @@ -129,16 +129,16 @@ class EventReceiver(QtCore.QObject): class Receiver(): """ - Class to allow events to be passed from different parts of the - system. This is a static wrapper around the ``EventReceiver`` - class. As there is only one instance of it in the system the QT - signal/slot architecture can send messages across the system. + Class to allow events to be passed from different parts of the system. This + is a static wrapper around the ``EventReceiver`` class. As there is only + one instance of it in the system the Qt4 signal/slot architecture can send + messages across the system. To send a message: - ``Receiver().send_message(u'<>', data)`` + ``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/ui/maindisplay.py b/openlp/core/ui/maindisplay.py index 7884b5d80..6b7ca55bb 100644 --- a/openlp/core/ui/maindisplay.py +++ b/openlp/core/ui/maindisplay.py @@ -48,16 +48,16 @@ class DisplayWidget(QtGui.QWidget): if type(event) == QtGui.QKeyEvent: #here accept the event and do something if event.key() == QtCore.Qt.Key_Up: - Receiver().send_message(u'live_slidecontroller_previous') + Receiver.send_message(u'live_slidecontroller_previous') event.accept() elif event.key() == QtCore.Qt.Key_Down: - Receiver().send_message(u'live_slidecontroller_next') + Receiver.send_message(u'live_slidecontroller_next') event.accept() elif event.key() == QtCore.Qt.Key_PageUp: - Receiver().send_message(u'live_slidecontroller_first') + Receiver.send_message(u'live_slidecontroller_first') event.accept() elif event.key() == QtCore.Qt.Key_PageDown: - Receiver().send_message(u'live_slidecontroller_last') + Receiver.send_message(u'live_slidecontroller_last') event.accept() elif event.key() == QtCore.Qt.Key_Escape: self.resetDisplay() @@ -111,8 +111,6 @@ class MainDisplay(DisplayWidget): self.timer_id = 0 self.firstTime = True self.mediaLoaded = False - QtCore.QObject.connect(Receiver.get_receiver(), - QtCore.SIGNAL(u'live_slide_blank'), self.blankDisplay) QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'alert_text'), self.displayAlert) QtCore.QObject.connect(Receiver.get_receiver(), @@ -209,15 +207,15 @@ class MainDisplay(DisplayWidget): # self.setWindowOpacity(1) def blankDisplay(self, blanked=True): - if not self.displayBlank: + if blanked: self.displayBlank = True self.display.setPixmap(QtGui.QPixmap.fromImage(self.blankFrame)) else: self.displayBlank = False if self.frame: self.frameView(self.frame) - if blanked != self.displayBlank: - self.parent.LiveController.blankButton.setChecked(self.displayBlank) + #if blanked != self.displayBlank: + # self.parent.LiveController.blankButton.setChecked(self.displayBlank) self.parent.generalConfig.set_config(u'Screen Blank', self.displayBlank) def displayAlert(self, text=u''): diff --git a/openlp/core/ui/servicemanager.py b/openlp/core/ui/servicemanager.py index bb39b573e..3ba2ebbb5 100644 --- a/openlp/core/ui/servicemanager.py +++ b/openlp/core/ui/servicemanager.py @@ -599,7 +599,7 @@ class ServiceManager(QtGui.QWidget): item, count = self.findServiceItem() if self.serviceItems[item][u'data'].editEnabled: self.remoteEditTriggered = True - Receiver().send_message(u'%s_edit' % self.serviceItems[item][u'data'].name, u'L:%s' % + Receiver.send_message(u'%s_edit' % self.serviceItems[item][u'data'].name, u'L:%s' % self.serviceItems[item][u'data'].editId ) def onRemoteEditClear(self): @@ -666,7 +666,7 @@ class ServiceManager(QtGui.QWidget): self.serviceItems.insert(newpos, serviceItem) self.repaintServiceList(endpos, startCount) else: - Receiver().send_message(u'%s_add_service_item' % plugin) + Receiver.send_message(u'%s_add_service_item' % plugin) def updateThemeList(self, theme_list): """ diff --git a/openlp/core/ui/settingsform.py b/openlp/core/ui/settingsform.py index a91e1aecb..f14c64ebd 100644 --- a/openlp/core/ui/settingsform.py +++ b/openlp/core/ui/settingsform.py @@ -67,7 +67,7 @@ class SettingsForm(QtGui.QDialog, Ui_SettingsDialog): def accept(self): for tab_index in range(0, self.SettingsTabWidget.count()): self.SettingsTabWidget.widget(tab_index).save() - Receiver().send_message(u'config_updated') + Receiver.send_message(u'config_updated') return QtGui.QDialog.accept(self) def postSetUp(self): diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index 1fe31d666..787488c31 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -162,6 +162,8 @@ class SlideController(QtGui.QWidget): self.blankButton = self.Toolbar.addToolbarButton( u'Blank Screen', u':/slides/slide_close.png', self.trUtf8(u'Blank Screen'), self.onBlankScreen, True) + QtCore.QObject.connect(Receiver.get_receiver(), + QtCore.SIGNAL(u'live_slide_blank'), self.onBlankDisplay) if not self.isLive: self.Toolbar.addToolbarSeparator(u'Close Separator') self.Toolbar.addToolbarButton( @@ -504,6 +506,9 @@ class SlideController(QtGui.QWidget): self.PreviewListWidget.selectRow(0) self.onSlideSelected() + def onBlankDisplay(self): + self.blankButton.setChecked(not self.parent.mainDisplay.displayBlank) + def onBlankScreen(self, blanked): """ Blank the screen. diff --git a/openlp/core/ui/thememanager.py b/openlp/core/ui/thememanager.py index 51f1f2425..c165075eb 100644 --- a/openlp/core/ui/thememanager.py +++ b/openlp/core/ui/thememanager.py @@ -145,7 +145,7 @@ class ThemeManager(QtGui.QWidget): name = u'%s (%s)' % (self.global_theme, self.trUtf8(u'default')) self.ThemeListWidget.item(count).setText(name) self.config.set_config(u'theme global theme', self.global_theme) - Receiver().send_message( + Receiver.send_message( u'update_global_theme', self.global_theme) self.pushThemes() @@ -265,7 +265,7 @@ class ThemeManager(QtGui.QWidget): self.pushThemes() def pushThemes(self): - Receiver().send_message(u'update_themes', self.getThemes() ) + Receiver.send_message(u'update_themes', self.getThemes() ) def getThemes(self): return self.themelist diff --git a/openlp/core/ui/themestab.py b/openlp/core/ui/themestab.py index 2afbf297c..d5c91c5e3 100644 --- a/openlp/core/ui/themestab.py +++ b/openlp/core/ui/themestab.py @@ -135,10 +135,10 @@ class ThemesTab(SettingsTab): def save(self): self.config.set_config(u'theme global style', self.global_style ) self.config.set_config(u'theme global theme',self.global_theme) - Receiver().send_message(u'update_global_theme', self.global_theme ) + Receiver.send_message(u'update_global_theme', self.global_theme ) def postSetUp(self): - Receiver().send_message(u'update_global_theme', self.global_theme ) + Receiver.send_message(u'update_global_theme', self.global_theme ) def onSongLevelButtonPressed(self): self.global_style = u'Song' diff --git a/openlp/plugins/bibles/forms/bibleimportform.py b/openlp/plugins/bibles/forms/bibleimportform.py index 62210d44f..633855ceb 100644 --- a/openlp/plugins/bibles/forms/bibleimportform.py +++ b/openlp/plugins/bibles/forms/bibleimportform.py @@ -199,9 +199,9 @@ class BibleImportForm(QtGui.QDialog, Ui_BibleImportDialog): def onCancelButtonClicked(self): # tell import to stop self.message = self.trUtf8(u'Bible import stopped') - Receiver().send_message(u'stop_import') + Receiver.send_message(u'stop_import') # tell bibleplugin to reload the bibles - Receiver().send_message(u'pre_load_bibles') + Receiver.send_message(u'pre_load_bibles') self.close() def onImportButtonClicked(self): @@ -220,7 +220,7 @@ class BibleImportForm(QtGui.QDialog, Ui_BibleImportDialog): self.MessageLabel.setText(message) self.ProgressBar.setValue(self.barmax) # tell bibleplugin to reload the bibles - Receiver().send_message(u'pre_load_bibles') + Receiver.send_message(u'pre_load_bibles') QtGui.QMessageBox.information(self, self.trUtf8(u'Information'), self.trUtf8(message)) diff --git a/openlp/plugins/bibles/lib/bibleCSVimpl.py b/openlp/plugins/bibles/lib/bibleCSVimpl.py index 15a29f900..3410478fb 100644 --- a/openlp/plugins/bibles/lib/bibleCSVimpl.py +++ b/openlp/plugins/bibles/lib/bibleCSVimpl.py @@ -40,7 +40,7 @@ class BibleCSVImpl(BibleCommon): """ self.bibledb = bibledb self.loadbible = True - QtCore.QObject.connect(Receiver().get_receiver(), + QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'openlpstopimport'), self.stop_import) def stop_import(self): @@ -66,7 +66,7 @@ class BibleCSVImpl(BibleCommon): count += 1 #Flush the screen events if count % 3 == 0: - Receiver().send_message(u'process_events') + Receiver.send_message(u'process_events') count = 0 except: log.exception(u'Loading books from file failed') @@ -97,7 +97,7 @@ class BibleCSVImpl(BibleCommon): count += 1 #Every x verses repaint the screen if count % 3 == 0: - Receiver().send_message(u'process_events') + Receiver.send_message(u'process_events') count = 0 except: log.exception(u'Loading verses from file failed') diff --git a/openlp/plugins/bibles/lib/bibleOSISimpl.py b/openlp/plugins/bibles/lib/bibleOSISimpl.py index d4f94d6c3..0e16c0256 100644 --- a/openlp/plugins/bibles/lib/bibleOSISimpl.py +++ b/openlp/plugins/bibles/lib/bibleOSISimpl.py @@ -74,7 +74,7 @@ class BibleOSISImpl(): self.loadbible = False if fbibles: fbibles.close() - QtCore.QObject.connect(Receiver().get_receiver(), + QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'openlpstopimport'), self.stop_import) def stop_import(self): @@ -173,13 +173,13 @@ class BibleOSISImpl(): testament) dialogobject.incrementProgressBar( self.booksOfBible[p[0]]) - Receiver().send_message(u'process_events') + Receiver.send_message(u'process_events') count = 0 self.bibledb.add_verse(book.id, p[1], p[2], text) count += 1 #Every 3 verses repaint the screen if count % 3 == 0: - Receiver().send_message(u'process_events') + Receiver.send_message(u'process_events') count = 0 except: log.exception(u'Loading bible from OSIS file failed') diff --git a/openlp/plugins/bibles/lib/mediaitem.py b/openlp/plugins/bibles/lib/mediaitem.py index a8106d4f6..d2f469242 100644 --- a/openlp/plugins/bibles/lib/mediaitem.py +++ b/openlp/plugins/bibles/lib/mediaitem.py @@ -54,7 +54,7 @@ class BibleMediaItem(MediaManagerItem): MediaManagerItem.__init__(self, parent, icon, title) # place to store the search results self.search_results = {} - QtCore.QObject.connect(Receiver().get_receiver(), + QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'openlpreloadbibles'), self.reloadBibles) def initPluginNameVisible(self): @@ -284,7 +284,7 @@ class BibleMediaItem(MediaManagerItem): def setQuickMessage(self, text): self.QuickMessage.setText(text) self.AdvancedMessage.setText(text) - Receiver().send_message(u'process_events') + Receiver.send_message(u'process_events') #minor delay to get the events processed time.sleep(0.1) diff --git a/openlp/plugins/custom/forms/editcustomform.py b/openlp/plugins/custom/forms/editcustomform.py index 35d1e9ab0..1fef1df65 100644 --- a/openlp/plugins/custom/forms/editcustomform.py +++ b/openlp/plugins/custom/forms/editcustomform.py @@ -82,7 +82,7 @@ class EditCustomForm(QtGui.QDialog, Ui_customEditDialog): log.debug(u'onPreview') if button.text() == unicode(self.trUtf8(u'Save && Preview')) \ and self.saveCustom(): - Receiver().send_message(u'preview_custom') + Receiver.send_message(u'preview_custom') def initialise(self): self.editAll = False @@ -130,13 +130,13 @@ class EditCustomForm(QtGui.QDialog, Ui_customEditDialog): self.previewButton.setVisible(True) def closePressed(self): - Receiver().send_message(u'remote_edit_clear') + Receiver.send_message(u'remote_edit_clear') self.close() def accept(self): log.debug(u'accept') if self.saveCustom(): - Receiver().send_message(u'load_custom_list') + Receiver.send_message(u'load_custom_list') self.close() def saveCustom(self): diff --git a/openlp/plugins/images/lib/imagetab.py b/openlp/plugins/images/lib/imagetab.py index 84da616d0..40653706f 100644 --- a/openlp/plugins/images/lib/imagetab.py +++ b/openlp/plugins/images/lib/imagetab.py @@ -74,7 +74,7 @@ class ImageTab(SettingsTab): def save(self): self.config.set_config(u'loop delay', self.loop_delay) - Receiver().send_message(u'update_spin_delay', self.loop_delay) + Receiver.send_message(u'update_spin_delay', self.loop_delay) def postSetUp(self): - Receiver().send_message(u'update_spin_delay', self.loop_delay) + Receiver.send_message(u'update_spin_delay', self.loop_delay) diff --git a/openlp/plugins/presentations/lib/messagelistener.py b/openlp/plugins/presentations/lib/messagelistener.py index 12e1b6570..022b2cd3f 100644 --- a/openlp/plugins/presentations/lib/messagelistener.py +++ b/openlp/plugins/presentations/lib/messagelistener.py @@ -77,7 +77,7 @@ class MessageListener(object): self.controller.load_presentation(file) if self.is_live: self.controller.start_presentation() - Receiver().send_message(u'live_slide_hide') + Receiver.send_message(u'live_slide_hide') self.controller.slidenumber = 0 self.timer.start() @@ -89,7 +89,7 @@ class MessageListener(object): self.controller.start_presentation() if self.controller.slidenumber > 1: self.controller.goto_slide(self.controller.slidenumber) - + def slide(self, message): if not self.is_live: return @@ -143,7 +143,7 @@ class MessageListener(object): Based on the handler passed at startup triggers slide show to shut down """ if self.is_live: - Receiver().send_message(u'live_slide_show') + Receiver.send_message(u'live_slide_show') self.controller.close_presentation() self.controller.slidenumber = 0 self.timer.stop() @@ -155,13 +155,13 @@ class MessageListener(object): return if not self.controller.is_active(): return - self.controller.blank_screen() + self.controller.blank_screen() def unblank(self): if not self.is_live: return self.activate() - self.controller.unblank_screen() + self.controller.unblank_screen() def decodeMessage(self, message): """ diff --git a/openlp/plugins/presentations/lib/presentationcontroller.py b/openlp/plugins/presentations/lib/presentationcontroller.py index caa6fcd3f..1e33ceab4 100644 --- a/openlp/plugins/presentations/lib/presentationcontroller.py +++ b/openlp/plugins/presentations/lib/presentationcontroller.py @@ -50,25 +50,25 @@ class PresentationController(object): ``name`` The name that appears in the options and the media manager - + ``enabled`` The controller is enabled ``available`` The controller is available on this machine. Set by init via call to check_available - + ``plugin`` The presentationplugin object **Hook Functions** - + ``kill()`` Called at system exit to clean up any running presentations ``check_available()`` Returns True if presentation application is installed/can run on this machine - + ``presentation_deleted()`` Deletes presentation specific files, e.g. thumbnails @@ -83,7 +83,7 @@ class PresentationController(object): ``is_active()`` Returns True if a presentation is currently running - + ``blank_screen()`` Blanks the screen, making it black. @@ -118,7 +118,7 @@ class PresentationController(object): global log log = logging.getLogger(u'PresentationController') log.info(u'loaded') - + def __init__(self, plugin=None, name=u'PresentationController'): """ This is the constructor for the presentationcontroller object. @@ -163,7 +163,7 @@ class PresentationController(object): """ self.store_filename(presentation) shutil.rmtree(self.thumbnailpath) - + def start_process(self): """ Loads a running version of the presentation application in the background. @@ -229,7 +229,7 @@ class PresentationController(object): Returns true if a presentation is loaded """ return False - + def blank_screen(self): """ Blanks the screen, making it black. @@ -311,5 +311,5 @@ class PresentationController(object): prefix = u'live' else: prefix = u'preview' - Receiver().send_message(u'%s_slidecontroller_change' % prefix, + Receiver.send_message(u'%s_slidecontroller_change' % prefix, self.slidenumber - 1) diff --git a/openlp/plugins/remotes/remoteplugin.py b/openlp/plugins/remotes/remoteplugin.py index 451887751..13664da1e 100644 --- a/openlp/plugins/remotes/remoteplugin.py +++ b/openlp/plugins/remotes/remoteplugin.py @@ -73,9 +73,9 @@ class RemotesPlugin(Plugin): pos = datagram.find(u':') event = unicode(datagram[:pos].lower()) if event == u'alert': - Receiver().send_message(u'alert_text', unicode(datagram[pos + 1:])) + Receiver.send_message(u'alert_text', unicode(datagram[pos + 1:])) if event == u'next_slide': - Receiver().send_message(u'live_slide_next') + Receiver.send_message(u'live_slide_next') def about(self): about_text = self.trUtf8(u'Remote Plugin
This plugin ' diff --git a/openlp/plugins/songs/forms/editsongform.py b/openlp/plugins/songs/forms/editsongform.py index 26d5bbc1e..714442de1 100644 --- a/openlp/plugins/songs/forms/editsongform.py +++ b/openlp/plugins/songs/forms/editsongform.py @@ -404,16 +404,16 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): log.debug(u'onPreview') if button.text() == unicode(self.trUtf8(u'Save && Preview')) \ and self.saveSong(): - Receiver().send_message(u'preview_song') + Receiver.send_message(u'preview_song') def closePressed(self): - Receiver().send_message(u'remote_edit_clear') + Receiver.send_message(u'remote_edit_clear') self.close() def accept(self): log.debug(u'accept') if self.saveSong(): - Receiver().send_message(u'load_song_list') + Receiver.send_message(u'load_song_list') self.close() def saveSong(self): From 9e96aac8499159bca3b0bd97d3376ec9863ee215 Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Fri, 13 Nov 2009 23:37:11 +0200 Subject: [PATCH 52/66] Make sure screen and button are still black after coming back from media. --- openlp/core/ui/slidecontroller.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index 787488c31..a21edd994 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -507,7 +507,7 @@ class SlideController(QtGui.QWidget): self.onSlideSelected() def onBlankDisplay(self): - self.blankButton.setChecked(not self.parent.mainDisplay.displayBlank) + self.blankButton.setChecked(self.parent.mainDisplay.displayBlank) def onBlankScreen(self, blanked): """ From e618c3061c42585918d480dd8b1730b7ff216c5a Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sat, 14 Nov 2009 08:40:14 +0000 Subject: [PATCH 53/66] ServiceItem cleanup - rename arrays --- openlp/core/lib/serviceitem.py | 72 ++++++++++--------- openlp/core/ui/servicemanager.py | 36 +++++----- openlp/core/ui/slidecontroller.py | 6 +- openlp/plugins/presentations/lib/mediaitem.py | 12 ++-- 4 files changed, 65 insertions(+), 61 deletions(-) diff --git a/openlp/core/lib/serviceitem.py b/openlp/core/lib/serviceitem.py index e9de1f832..d6b1f0abf 100644 --- a/openlp/core/lib/serviceitem.py +++ b/openlp/core/lib/serviceitem.py @@ -49,30 +49,28 @@ class ServiceItem(object): log = logging.getLogger(u'ServiceItem') log.info(u'Service Item created') - def __init__(self, hostplugin=None): + def __init__(self, plugin=None): """ Set up the service item. - ``hostplugin`` + ``plugin`` The plugin that this service item belongs to. """ - self.plugin = hostplugin - if hostplugin: - self.RenderManager = self.plugin.render_manager - self.shortname = hostplugin.name - self.name = self.plugin.name + if plugin: + self.RenderManager = plugin.render_manager + self.name = plugin.name self.title = u'' self.audit = u'' self.items = [] self.iconic_representation = None self.raw_slides = None - self.frames = [] + self.display_frames = [] self.raw_footer = None self.theme = None self.service_item_path = None self.service_item_type = None self.editEnabled = False - self.service_frames = [] + self.raw_frames = [] self.uuid = unicode(uuid.uuid1()) def addIcon(self, icon): @@ -92,14 +90,14 @@ class ServiceItem(object): The render method is what generates the frames for the screen. """ log.debug(u'Render called') - self.frames = [] + self.display_frames = [] if self.service_item_type == ServiceItemType.Text: log.debug(u'Formatting slides') if self.theme is None: self.RenderManager.set_override_theme(None) else: self.RenderManager.set_override_theme(self.theme) - for slide in self.service_frames: + for slide in self.raw_frames: before = time.time() formated = self.RenderManager.format_slide(slide[u'raw_slide']) for format in formated: @@ -108,16 +106,16 @@ class ServiceItem(object): for line in format: lines += line + u'\n' title = lines.split(u'\n')[0] - self.frames.append({u'title': title, u'text': lines, + self.display_frames.append({u'title': title, u'text': lines, u'image': frame}) log.info(u'Formatting took %4s' % (time.time() - before)) elif self.service_item_type == ServiceItemType.Command: - self.frames = self.service_frames + self.display_frames = self.raw_frames elif self.service_item_type == ServiceItemType.Image: - for slide in self.service_frames: + for slide in self.raw_frames: slide[u'image'] = \ self.RenderManager.resize_image(slide[u'image']) - self.frames = self.service_frames + self.display_frames = self.raw_frames else: log.error(u'Invalid value renderer :%s' % self.service_item_type) @@ -132,19 +130,19 @@ class ServiceItem(object): self.RenderManager.set_override_theme(None) else: self.RenderManager.set_override_theme(self.theme) - format = self.frames[row][u'text'].split(u'\n') + format = self.display_frames[row][u'text'].split(u'\n') frame = self.RenderManager.generate_slide(format, self.raw_footer) return frame - def add_from_image(self, path, frame_title, image): + def add_from_image(self, path, title, image): """ Add an image slide to the service item. ``path`` The directory in which the image file is located. - ``frame_title`` + ``title`` A title for the slide in the service item. ``image`` @@ -152,10 +150,10 @@ class ServiceItem(object): """ self.service_item_type = ServiceItemType.Image self.service_item_path = path - self.service_frames.append( - {u'title': frame_title, u'text': None, u'image': image}) + self.raw_frames.append( + {u'title': title, u'text': None, u'image': image}) - def add_from_text(self, frame_title, raw_slide): + def add_from_text(self, title, raw_slide): """ Add a text slide to the service item. @@ -166,24 +164,27 @@ class ServiceItem(object): The raw text of the slide. """ self.service_item_type = ServiceItemType.Text - frame_title = frame_title.split(u'\n')[0] - self.service_frames.append( - {u'title': frame_title, u'raw_slide': raw_slide}) + title = title.split(u'\n')[0] + self.raw_frames.append( + {u'title': title, u'raw_slide': raw_slide}) - def add_from_command(self, path, frame_title, image): + def add_from_command(self, path, file_name, image): """ Add a slide from a command. - ``frame_title`` + ``path`` The title of the slide in the service item. - ``command`` + ``file_name`` + The title of the slide in the service item. + + ``immage`` The command of/for the slide. """ self.service_item_type = ServiceItemType.Command self.service_item_path = path - self.service_frames.append( - {u'title': frame_title, u'command': None, u'text':None, u'image': image}) + self.raw_frames.append( + {u'title': file_name, u'command': None, u'text':None, u'image': image}) def get_service_repr(self): """ @@ -192,7 +193,7 @@ class ServiceItem(object): """ service_header = { u'name': self.name.lower(), - u'plugin': self.shortname, + u'plugin': self.name, u'theme':self.theme, u'title':self.title, u'icon':self.icon, @@ -202,13 +203,13 @@ class ServiceItem(object): } service_data = [] if self.service_item_type == ServiceItemType.Text: - for slide in self.service_frames: + for slide in self.raw_frames: service_data.append(slide) elif self.service_item_type == ServiceItemType.Image: - for slide in self.service_frames: + for slide in self.raw_frames: service_data.append(slide[u'title']) elif self.service_item_type == ServiceItemType.Command: - for slide in self.service_frames: + for slide in self.raw_frames: service_data.append({u'title':slide[u'title'], u'image':slide[u'image']}) return {u'header': service_header, u'data': service_data} @@ -234,7 +235,7 @@ class ServiceItem(object): self.audit = header[u'audit'] if self.service_item_type == ServiceItemType.Text: for slide in serviceitem[u'serviceitem'][u'data']: - self.service_frames.append(slide) + self.raw_frames.append(slide) elif self.service_item_type == ServiceItemType.Image: for text_image in serviceitem[u'serviceitem'][u'data']: filename = os.path.join(path, text_image) @@ -281,3 +282,6 @@ class ServiceItem(object): def isText(self): return self.service_item_type == ServiceItemType.Text + + def getFrames(self): + return self.display_frames diff --git a/openlp/core/ui/servicemanager.py b/openlp/core/ui/servicemanager.py index bb39b573e..c1c260a56 100644 --- a/openlp/core/ui/servicemanager.py +++ b/openlp/core/ui/servicemanager.py @@ -388,14 +388,14 @@ class ServiceManager(QtGui.QWidget): #Repaint the screen self.ServiceManagerList.clear() for itemcount, item in enumerate(self.serviceItems): - serviceitem = item[u'data'] + serviceitem = item[u'service_item'] treewidgetitem = QtGui.QTreeWidgetItem(self.ServiceManagerList) treewidgetitem.setText(0,serviceitem.title) treewidgetitem.setIcon(0,serviceitem.iconic_representation) treewidgetitem.setData(0, QtCore.Qt.UserRole, QtCore.QVariant(item[u'order'])) treewidgetitem.setExpanded(item[u'expanded']) - for count, frame in enumerate(serviceitem.frames): + for count, frame in enumerate(serviceitem.getFrames()): treewidgetitem1 = QtGui.QTreeWidgetItem(treewidgetitem) text = frame[u'title'] treewidgetitem1.setText(0,text[:40]) @@ -431,12 +431,12 @@ class ServiceManager(QtGui.QWidget): zip = zipfile.ZipFile(unicode(filename), 'w') for item in self.serviceItems: service.append( - {u'serviceitem':item[u'data'].get_service_repr()}) - if item[u'data'].service_item_type == ServiceItemType.Image or \ - item[u'data'].service_item_type == ServiceItemType.Command: - for frame in item[u'data'].frames: + {u'serviceitem':item[u'service_item'].get_service_repr()}) + if item[u'service_item'].service_item_type == ServiceItemType.Image or \ + item[u'service_item'].service_item_type == ServiceItemType.Command: + for frame in item[u'service_item'].frames: path_from = unicode(os.path.join( - item[u'data'].service_item_path, frame[u'title'])) + item[u'service_item'].service_item_path, frame[u'title'])) zip.write(path_from) file = open(servicefile, u'wb') cPickle.dump(service, file) @@ -545,7 +545,7 @@ class ServiceManager(QtGui.QWidget): tempServiceItems = self.serviceItems self.onNewService() for item in tempServiceItems: - self.addServiceItem(item[u'data']) + self.addServiceItem(item[u'service_item']) def addServiceItem(self, item): """ @@ -558,19 +558,19 @@ class ServiceManager(QtGui.QWidget): sitem, count = self.findServiceItem() item.render() if self.remoteEditTriggered: - item.merge(self.serviceItems[sitem][u'data']) - self.serviceItems[sitem][u'data'] = item + item.merge(self.serviceItems[sitem][u'service_item']) + self.serviceItems[sitem][u'service_item'] = item self.remoteEditTriggered = False self.repaintServiceList(sitem + 1, 0) self.parent.LiveController.replaceServiceManagerItem(item) else: if sitem == -1: - self.serviceItems.append({u'data': item, + self.serviceItems.append({u'service_item': item, u'order': len(self.serviceItems) + 1, u'expanded':True}) self.repaintServiceList(len(self.serviceItems) + 1, 0) else: - self.serviceItems.insert(sitem + 1, {u'data': item, + self.serviceItems.insert(sitem + 1, {u'service_item': item, u'order': len(self.serviceItems)+1, u'expanded':True}) self.repaintServiceList(sitem + 1, 0) @@ -582,7 +582,7 @@ class ServiceManager(QtGui.QWidget): """ item, count = self.findServiceItem() self.parent.PreviewController.addServiceManagerItem( - self.serviceItems[item][u'data'], count) + self.serviceItems[item][u'service_item'], count) def makeLive(self): """ @@ -590,17 +590,17 @@ class ServiceManager(QtGui.QWidget): """ item, count = self.findServiceItem() self.parent.LiveController.addServiceManagerItem( - self.serviceItems[item][u'data'], count) + self.serviceItems[item][u'service_item'], count) def remoteEdit(self): """ Posts a remote edit message to a plugin to allow item to be edited. """ item, count = self.findServiceItem() - if self.serviceItems[item][u'data'].editEnabled: + if self.serviceItems[item][u'service_item'].editEnabled: self.remoteEditTriggered = True - Receiver().send_message(u'%s_edit' % self.serviceItems[item][u'data'].name, u'L:%s' % - self.serviceItems[item][u'data'].editId ) + Receiver().send_message(u'%s_edit' % self.serviceItems[item][u'service_item'].name, u'L:%s' % + self.serviceItems[item][u'service_item'].editId ) def onRemoteEditClear(self): self.remoteEditTriggered = False @@ -698,5 +698,5 @@ class ServiceManager(QtGui.QWidget): def onThemeChangeAction(self): theme = unicode(self.sender().text()) item, count = self.findServiceItem() - self.serviceItems[item][u'data'].theme = theme + self.serviceItems[item][u'service_item'].theme = theme self.regenerateServiceItems() diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index 88e81bfae..e6ef7014b 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -457,7 +457,7 @@ class SlideController(QtGui.QWidget): self.PreviewListWidget.clear() self.PreviewListWidget.setRowCount(0) self.PreviewListWidget.setColumnWidth(0, width) - for framenumber, frame in enumerate(self.serviceitem.frames): + for framenumber, frame in enumerate(self.serviceitem.getFrames()): self.PreviewListWidget.setRowCount( self.PreviewListWidget.rowCount() + 1) item = QtGui.QTableWidgetItem() @@ -476,7 +476,7 @@ class SlideController(QtGui.QWidget): self.PreviewListWidget.setItem(framenumber, 0, item) if slide_height != 0: self.PreviewListWidget.setRowHeight(framenumber, slide_height) - if self.serviceitem.frames[0][u'text']: + if self.serviceitem.getFrames()[0][u'text']: self.PreviewListWidget.resizeRowsToContents() self.PreviewListWidget.setColumnWidth( 0, self.PreviewListWidget.viewport().size().width()) @@ -528,7 +528,7 @@ class SlideController(QtGui.QWidget): if self.isLive: self.updatePreview() else: - frame = self.serviceitem.frames[row][u'image'] + frame = self.serviceitem.getFrames()[row][u'image'] before = time.time() if frame is None: frame = self.serviceitem.render_individual(row) diff --git a/openlp/plugins/presentations/lib/mediaitem.py b/openlp/plugins/presentations/lib/mediaitem.py index cb4bfd320..f0b4785ae 100644 --- a/openlp/plugins/presentations/lib/mediaitem.py +++ b/openlp/plugins/presentations/lib/mediaitem.py @@ -136,18 +136,18 @@ class PresentationMediaItem(MediaManagerItem): return False service_item.title = unicode(self.DisplayTypeComboBox.currentText()) service_item.shortname = unicode(self.DisplayTypeComboBox.currentText()) - cont = self.controllers[service_item.shortname] + controller = self.controllers[service_item.shortname] for item in items: bitem = self.ListView.item(item.row()) filename = unicode((bitem.data(QtCore.Qt.UserRole)).toString()) (path, name) = os.path.split(filename) - cont.store_filename(filename) - if cont.get_slide_preview_file(1) is None: - cont.load_presentation(filename) + controller.store_filename(filename) + if controller.get_slide_preview_file(1) is None: + controller.load_presentation(filename) i = 1 - img = cont.get_slide_preview_file(i) + img = controller.get_slide_preview_file(i) while img: service_item.add_from_command(path, name, img) i = i + 1 - img = cont.get_slide_preview_file(i) + img = controller.get_slide_preview_file(i) return True From ad6abb1e9c6861e2cbfcbe106a4b3bbbf49740c8 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sat, 14 Nov 2009 09:02:30 +0000 Subject: [PATCH 54/66] ServiceItem cleanup - hide lists --- openlp/core/lib/serviceitem.py | 20 +++++++++++++------- openlp/core/ui/slidecontroller.py | 13 +++++++------ 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/openlp/core/lib/serviceitem.py b/openlp/core/lib/serviceitem.py index d6b1f0abf..45691deb4 100644 --- a/openlp/core/lib/serviceitem.py +++ b/openlp/core/lib/serviceitem.py @@ -101,13 +101,11 @@ class ServiceItem(object): before = time.time() formated = self.RenderManager.format_slide(slide[u'raw_slide']) for format in formated: - frame = None lines = u'' for line in format: lines += line + u'\n' title = lines.split(u'\n')[0] - self.display_frames.append({u'title': title, u'text': lines, - u'image': frame}) + self.display_frames.append({u'title': title, u'text': lines}) log.info(u'Formatting took %4s' % (time.time() - before)) elif self.service_item_type == ServiceItemType.Command: self.display_frames = self.raw_frames @@ -115,7 +113,6 @@ class ServiceItem(object): for slide in self.raw_frames: slide[u'image'] = \ self.RenderManager.resize_image(slide[u'image']) - self.display_frames = self.raw_frames else: log.error(u'Invalid value renderer :%s' % self.service_item_type) @@ -151,7 +148,7 @@ class ServiceItem(object): self.service_item_type = ServiceItemType.Image self.service_item_path = path self.raw_frames.append( - {u'title': title, u'text': None, u'image': image}) + {u'title': title, u'image': image}) def add_from_text(self, title, raw_slide): """ @@ -184,7 +181,7 @@ class ServiceItem(object): self.service_item_type = ServiceItemType.Command self.service_item_path = path self.raw_frames.append( - {u'title': file_name, u'command': None, u'text':None, u'image': image}) + {u'title': file_name, u'image': image}) def get_service_repr(self): """ @@ -284,4 +281,13 @@ class ServiceItem(object): return self.service_item_type == ServiceItemType.Text def getFrames(self): - return self.display_frames + if self.service_item_type == ServiceItemType.Text: + return self.display_frames + else: + return self.raw_frames + + def get_rendered_frame(self, row): + if self.service_item_type == ServiceItemType.Text: + return self.render_individual(row) + else: + return self.raw_frames[row][u'image'] diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index e6ef7014b..8ec011800 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -364,7 +364,7 @@ class SlideController(QtGui.QWidget): self.Songbar.setVisible(True) elif item.isImage(): #Not sensible to allow loops with 1 frame - if len(item.frames) > 1: + if len(item.getFrames()) > 1: self.Toolbar.makeWidgetsVisible(self.image_list) elif item.isMedia(): self.Toolbar.setVisible(False) @@ -463,7 +463,7 @@ class SlideController(QtGui.QWidget): item = QtGui.QTableWidgetItem() slide_height = 0 #It is a Image - if frame[u'text'] is None: + if not self.serviceitem.isText(): label = QtGui.QLabel() label.setMargin(4) pixmap = self.parent.RenderManager.resize_image(frame[u'image']) @@ -476,7 +476,7 @@ class SlideController(QtGui.QWidget): self.PreviewListWidget.setItem(framenumber, 0, item) if slide_height != 0: self.PreviewListWidget.setRowHeight(framenumber, slide_height) - if self.serviceitem.getFrames()[0][u'text']: + if self.serviceitem.isText(): self.PreviewListWidget.resizeRowsToContents() self.PreviewListWidget.setColumnWidth( 0, self.PreviewListWidget.viewport().size().width()) @@ -528,10 +528,11 @@ class SlideController(QtGui.QWidget): if self.isLive: self.updatePreview() else: - frame = self.serviceitem.getFrames()[row][u'image'] + #frame = self.serviceitem.getFrames()[row][u'image'] before = time.time() - if frame is None: - frame = self.serviceitem.render_individual(row) + #if frame is None: + #frame = self.serviceitem.render_individual(row) + frame = self.serviceitem.get_rendered_frame(row) self.SlidePreview.setPixmap(QtGui.QPixmap.fromImage(frame)) log.log(15, u'Slide Rendering took %4s' % (time.time() - before)) if self.isLive: From 02ad0595d7a53c9b36f9d2938473ba29aed43c52 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sat, 14 Nov 2009 09:06:25 +0000 Subject: [PATCH 55/66] ServiceItem cleanup - hide lists 2 --- openlp/core/lib/serviceitem.py | 53 ++++++++++++++++++---------------- 1 file changed, 28 insertions(+), 25 deletions(-) diff --git a/openlp/core/lib/serviceitem.py b/openlp/core/lib/serviceitem.py index 45691deb4..0a00d57cb 100644 --- a/openlp/core/lib/serviceitem.py +++ b/openlp/core/lib/serviceitem.py @@ -63,15 +63,14 @@ class ServiceItem(object): self.audit = u'' self.items = [] self.iconic_representation = None - self.raw_slides = None - self.display_frames = [] self.raw_footer = None self.theme = None self.service_item_path = None self.service_item_type = None self.editEnabled = False - self.raw_frames = [] - self.uuid = unicode(uuid.uuid1()) + self._raw_frames = [] + self._display_frames = [] + self._uuid = unicode(uuid.uuid1()) def addIcon(self, icon): """ @@ -90,14 +89,14 @@ class ServiceItem(object): The render method is what generates the frames for the screen. """ log.debug(u'Render called') - self.display_frames = [] + self._display_frames = [] if self.service_item_type == ServiceItemType.Text: log.debug(u'Formatting slides') if self.theme is None: self.RenderManager.set_override_theme(None) else: self.RenderManager.set_override_theme(self.theme) - for slide in self.raw_frames: + for slide in self._raw_frames: before = time.time() formated = self.RenderManager.format_slide(slide[u'raw_slide']) for format in formated: @@ -105,12 +104,12 @@ class ServiceItem(object): for line in format: lines += line + u'\n' title = lines.split(u'\n')[0] - self.display_frames.append({u'title': title, u'text': lines}) + self._display_frames.append({u'title': title, u'text': lines}) log.info(u'Formatting took %4s' % (time.time() - before)) elif self.service_item_type == ServiceItemType.Command: - self.display_frames = self.raw_frames + self._display_frames = self._raw_frames elif self.service_item_type == ServiceItemType.Image: - for slide in self.raw_frames: + for slide in self._raw_frames: slide[u'image'] = \ self.RenderManager.resize_image(slide[u'image']) else: @@ -127,7 +126,7 @@ class ServiceItem(object): self.RenderManager.set_override_theme(None) else: self.RenderManager.set_override_theme(self.theme) - format = self.display_frames[row][u'text'].split(u'\n') + format = self._display_frames[row][u'text'].split(u'\n') frame = self.RenderManager.generate_slide(format, self.raw_footer) return frame @@ -147,7 +146,7 @@ class ServiceItem(object): """ self.service_item_type = ServiceItemType.Image self.service_item_path = path - self.raw_frames.append( + self._raw_frames.append( {u'title': title, u'image': image}) def add_from_text(self, title, raw_slide): @@ -162,7 +161,7 @@ class ServiceItem(object): """ self.service_item_type = ServiceItemType.Text title = title.split(u'\n')[0] - self.raw_frames.append( + self._raw_frames.append( {u'title': title, u'raw_slide': raw_slide}) def add_from_command(self, path, file_name, image): @@ -180,7 +179,7 @@ class ServiceItem(object): """ self.service_item_type = ServiceItemType.Command self.service_item_path = path - self.raw_frames.append( + self._raw_frames.append( {u'title': file_name, u'image': image}) def get_service_repr(self): @@ -200,13 +199,13 @@ class ServiceItem(object): } service_data = [] if self.service_item_type == ServiceItemType.Text: - for slide in self.raw_frames: + for slide in self._raw_frames: service_data.append(slide) elif self.service_item_type == ServiceItemType.Image: - for slide in self.raw_frames: + for slide in self._raw_frames: service_data.append(slide[u'title']) elif self.service_item_type == ServiceItemType.Command: - for slide in self.raw_frames: + for slide in self._raw_frames: service_data.append({u'title':slide[u'title'], u'image':slide[u'image']}) return {u'header': service_header, u'data': service_data} @@ -232,7 +231,7 @@ class ServiceItem(object): self.audit = header[u'audit'] if self.service_item_type == ServiceItemType.Text: for slide in serviceitem[u'serviceitem'][u'data']: - self.raw_frames.append(slide) + self._raw_frames.append(slide) elif self.service_item_type == ServiceItemType.Image: for text_image in serviceitem[u'serviceitem'][u'data']: filename = os.path.join(path, text_image) @@ -245,11 +244,11 @@ 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 + Updates the _uuid with the value from the original one + The _uuid is unique for a give service item but this allows one to replace an original version. """ - self.uuid = other.uuid + self._uuid = other._uuid def __eq__(self, other): """ @@ -257,13 +256,13 @@ class ServiceItem(object): """ if not other: return False - return self.uuid == other.uuid + return self._uuid == other._uuid def __ne__(self, other): """ Confirms the service items are not for the same instance """ - return self.uuid != other.uuid + return self._uuid != other._uuid def isSong(self): return self.name == u'Songs' @@ -282,12 +281,16 @@ class ServiceItem(object): def getFrames(self): if self.service_item_type == ServiceItemType.Text: - return self.display_frames + return self._display_frames else: - return self.raw_frames + return self._raw_frames def get_rendered_frame(self, row): + """ + Returns the correct frame for a given list and + renders it if required. + """ if self.service_item_type == ServiceItemType.Text: return self.render_individual(row) else: - return self.raw_frames[row][u'image'] + return self._raw_frames[row][u'image'] From 0aca1665be96c79fbbc443548cf8fbdf53294bfd Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sat, 14 Nov 2009 09:37:54 +0000 Subject: [PATCH 56/66] ServiceItem cleanup - remove CommandItem --- openlp/core/lib/serviceitem.py | 8 +++- openlp/core/ui/slidecontroller.py | 73 +++++++++++++++---------------- 2 files changed, 42 insertions(+), 39 deletions(-) diff --git a/openlp/core/lib/serviceitem.py b/openlp/core/lib/serviceitem.py index 0a00d57cb..4896f365c 100644 --- a/openlp/core/lib/serviceitem.py +++ b/openlp/core/lib/serviceitem.py @@ -106,8 +106,6 @@ class ServiceItem(object): title = lines.split(u'\n')[0] self._display_frames.append({u'title': title, u'text': lines}) log.info(u'Formatting took %4s' % (time.time() - before)) - elif self.service_item_type == ServiceItemType.Command: - self._display_frames = self._raw_frames elif self.service_item_type == ServiceItemType.Image: for slide in self._raw_frames: slide[u'image'] = \ @@ -294,3 +292,9 @@ class ServiceItem(object): return self.render_individual(row) else: return self._raw_frames[row][u'image'] + + def get_frame_title(self, row): + """ + Returns the title of the raw frame + """ + return self._raw_frames[row][u'title'] diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index 8ec011800..138cdaae8 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -86,7 +86,7 @@ class SlideController(QtGui.QWidget): u'Edit Song', ] self.timer_id = 0 - self.commandItem = None + self.wasCommandItem = False self.songEdit = False self.row = 0 self.Panel = QtGui.QWidget(parent.ControlSplitter) @@ -293,7 +293,7 @@ class SlideController(QtGui.QWidget): Handle changes of width from the splitter between the live and preview controller. Event only issues when changes have finished """ - if not self.commandItem: + if self.wasCommandItem: return width = self.parent.ControlSplitter.sizes()[self.split] height = width * self.parent.RenderManager.screen_ratio @@ -393,14 +393,15 @@ class SlideController(QtGui.QWidget): """ log.debug(u'addServiceItem') #If old item was a command tell it to stop - if self.commandItem and self.commandItem.isCommand(): + if self.wasCommandItem: self.onMediaStop() - self.commandItem = item + self.wasCommandItem = False before = time.time() item.render() log.log(15, u'Rendering took %4s' % (time.time() - before)) self.enableToolBar(item) if item.isCommand(): + self.wasCommandItem = True if self.isLive: Receiver().send_message(u'%s_start' % item.name.lower(), \ [item.shortname, item.service_item_path, @@ -418,7 +419,7 @@ class SlideController(QtGui.QWidget): """ Replacement item following a remote edit """ - if item.__eq__(self.commandItem): + if item.__eq__(self.serviceItem): self.addServiceManagerItem(item, self.PreviewListWidget.currentRow()) def addServiceManagerItem(self, item, slideno): @@ -429,11 +430,12 @@ class SlideController(QtGui.QWidget): """ log.debug(u'addServiceManagerItem') #If old item was a command tell it to stop - if self.commandItem and self.commandItem.isCommand(): + if self.wasCommandItem: self.onMediaStop() - self.commandItem = item + self.wasCommandItem = False self.enableToolBar(item) if item.isCommand(): + self.wasCommandItem = False if self.isLive: Receiver().send_message(u'%s_start' % item.name.lower(), \ [item.shortname, item.service_item_path, @@ -453,17 +455,17 @@ class SlideController(QtGui.QWidget): #Set pointing cursor when we have somthing to point at self.PreviewListWidget.setCursor(QtCore.Qt.PointingHandCursor) before = time.time() - self.serviceitem = serviceitem + self.serviceItem = serviceitem self.PreviewListWidget.clear() self.PreviewListWidget.setRowCount(0) self.PreviewListWidget.setColumnWidth(0, width) - for framenumber, frame in enumerate(self.serviceitem.getFrames()): + for framenumber, frame in enumerate(self.serviceItem.getFrames()): self.PreviewListWidget.setRowCount( self.PreviewListWidget.rowCount() + 1) item = QtGui.QTableWidgetItem() slide_height = 0 #It is a Image - if not self.serviceitem.isText(): + if not self.serviceItem.isText(): label = QtGui.QLabel() label.setMargin(4) pixmap = self.parent.RenderManager.resize_image(frame[u'image']) @@ -476,7 +478,7 @@ class SlideController(QtGui.QWidget): self.PreviewListWidget.setItem(framenumber, 0, item) if slide_height != 0: self.PreviewListWidget.setRowHeight(framenumber, slide_height) - if self.serviceitem.isText(): + if self.serviceItem.isText(): self.PreviewListWidget.resizeRowsToContents() self.PreviewListWidget.setColumnWidth( 0, self.PreviewListWidget.viewport().size().width()) @@ -487,8 +489,8 @@ class SlideController(QtGui.QWidget): self.onSlideSelected() self.PreviewListWidget.setFocus() log.log(15, u'Display Rendering took %4s' % (time.time() - before)) - if self.serviceitem.audit and self.isLive: - Receiver().send_message(u'songusage_live', self.serviceitem.audit) + if self.serviceItem.audit and self.isLive: + Receiver().send_message(u'songusage_live', self.serviceItem.audit) log.debug(u'displayServiceManagerItems End') #Screen event methods @@ -496,8 +498,8 @@ class SlideController(QtGui.QWidget): """ Go to the first slide. """ - if self.commandItem and self.commandItem.isCommand(): - Receiver().send_message(u'%s_first'% self.commandItem.name.lower()) + if self.serviceItem.isCommand(): + Receiver().send_message(u'%s_first'% self.serviceItem.name.lower()) self.updatePreview() else: self.PreviewListWidget.selectRow(0) @@ -507,11 +509,11 @@ class SlideController(QtGui.QWidget): """ Blank the screen. """ - if self.commandItem and self.commandItem.isCommand(): + if self.serviceItem.isCommand(): if blanked: - Receiver().send_message(u'%s_blank'% self.commandItem.name.lower()) + Receiver().send_message(u'%s_blank'% self.serviceItem.name.lower()) else: - Receiver().send_message(u'%s_unblank'% self.commandItem.name.lower()) + Receiver().send_message(u'%s_unblank'% self.serviceItem.name.lower()) else: self.parent.mainDisplay.blankDisplay() @@ -523,16 +525,13 @@ class SlideController(QtGui.QWidget): row = self.PreviewListWidget.currentRow() self.row = 0 if row > -1 and row < self.PreviewListWidget.rowCount(): - if self.commandItem.isCommand(): - Receiver().send_message(u'%s_slide'% self.commandItem.name.lower(), [row]) + if self.serviceItem.isCommand(): + Receiver().send_message(u'%s_slide'% self.serviceItem.name.lower(), [row]) if self.isLive: self.updatePreview() else: - #frame = self.serviceitem.getFrames()[row][u'image'] before = time.time() - #if frame is None: - #frame = self.serviceitem.render_individual(row) - frame = self.serviceitem.get_rendered_frame(row) + frame = self.serviceItem.get_rendered_frame(row) self.SlidePreview.setPixmap(QtGui.QPixmap.fromImage(frame)) log.log(15, u'Slide Rendering took %4s' % (time.time() - before)) if self.isLive: @@ -569,8 +568,8 @@ class SlideController(QtGui.QWidget): """ Go to the next slide. """ - if self.commandItem and self.commandItem.isCommand(): - Receiver().send_message(u'%s_next'% self.commandItem.name.lower()) + if self.serviceItem.isCommand(): + Receiver().send_message(u'%s_next'% self.serviceItem.name.lower()) self.updatePreview() else: row = self.PreviewListWidget.currentRow() + 1 @@ -583,9 +582,9 @@ class SlideController(QtGui.QWidget): """ Go to the previous slide. """ - if self.commandItem and self.commandItem.isCommand(): + if self.serviceItem.isCommand(): Receiver().send_message( - u'%s_previous'% self.commandItem.name.lower()) + u'%s_previous'% self.serviceItem.name.lower()) self.updatePreview() else: row = self.PreviewListWidget.currentRow() - 1 @@ -598,8 +597,8 @@ class SlideController(QtGui.QWidget): """ Go to the last slide. """ - if self.commandItem and self.commandItem.isCommand(): - Receiver().send_message(u'%s_last'% self.commandItem.name.lower()) + if self.serviceItem.isCommand(): + Receiver().send_message(u'%s_last'% self.serviceItem.name.lower()) self.updatePreview() else: self.PreviewListWidget.selectRow(self.PreviewListWidget.rowCount() - 1) @@ -628,8 +627,8 @@ class SlideController(QtGui.QWidget): def onEditSong(self): self.songEdit = True - Receiver().send_message(u'%s_edit' % self.commandItem.name, u'P:%s' % - self.commandItem.editId ) + Receiver().send_message(u'%s_edit' % self.serviceItem.name, u'P:%s' % + self.serviceItem.editId ) def onGoLive(self): """ @@ -638,24 +637,24 @@ class SlideController(QtGui.QWidget): row = self.PreviewListWidget.currentRow() if row > -1 and row < self.PreviewListWidget.rowCount(): self.parent.LiveController.addServiceManagerItem( - self.commandItem, row) + self.serviceItem, row) def onMediaStart(self, item): self.mediaObject.stop() self.mediaObject.clearQueue() - file = os.path.join(item.service_item_path, item.service_frames[0][u'title']) + file = os.path.join(item.service_item_path, item.get_frame_title(0)) self.mediaObject.setCurrentSource(Phonon.MediaSource(file)) self.onMediaPlay() def onMediaPause(self): if self.isLive: - Receiver().send_message(u'%s_pause'% self.commandItem.name.lower()) + Receiver().send_message(u'%s_pause'% self.serviceItem.name.lower()) else: self.mediaObject.pause() def onMediaPlay(self): if self.isLive: - Receiver().send_message(u'%s_play'% self.commandItem.name.lower(), self.isLive) + Receiver().send_message(u'%s_play'% self.serviceItem.name.lower(), self.isLive) else: self.SlidePreview.hide() self.video.show() @@ -663,7 +662,7 @@ class SlideController(QtGui.QWidget): def onMediaStop(self): if self.isLive: - Receiver().send_message(u'%s_stop'% self.commandItem.name.lower()) + Receiver().send_message(u'%s_stop'% self.serviceItem.name.lower()) else: self.mediaObject.stop() self.video.hide() From b1766d7ee47b9c39fc44094e071f426a2a9ebabf Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sat, 14 Nov 2009 09:41:11 +0000 Subject: [PATCH 57/66] ServiceItem cleanup - sort out name format errors --- openlp/core/lib/serviceitem.py | 16 +++++----- openlp/core/ui/servicemanager.py | 8 ++--- openlp/core/ui/slidecontroller.py | 42 +++++++++++++------------- openlp/plugins/custom/lib/mediaitem.py | 4 +-- openlp/plugins/songs/lib/mediaitem.py | 3 +- 5 files changed, 36 insertions(+), 37 deletions(-) diff --git a/openlp/core/lib/serviceitem.py b/openlp/core/lib/serviceitem.py index 4896f365c..92a24d173 100644 --- a/openlp/core/lib/serviceitem.py +++ b/openlp/core/lib/serviceitem.py @@ -67,7 +67,7 @@ class ServiceItem(object): self.theme = None self.service_item_path = None self.service_item_type = None - self.editEnabled = False + self.edit_enabled = False self._raw_frames = [] self._display_frames = [] self._uuid = unicode(uuid.uuid1()) @@ -262,22 +262,22 @@ class ServiceItem(object): """ return self._uuid != other._uuid - def isSong(self): + def is_song(self): return self.name == u'Songs' - def isMedia(self): + def is_media(self): return self.name.lower() == u'media' - def isCommand(self): + def is_command(self): return self.service_item_type == ServiceItemType.Command - def isImage(self): + def is_image(self): return self.service_item_type == ServiceItemType.Image - def isText(self): + def is_text(self): return self.service_item_type == ServiceItemType.Text - def getFrames(self): + def get_frames(self): if self.service_item_type == ServiceItemType.Text: return self._display_frames else: @@ -297,4 +297,4 @@ class ServiceItem(object): """ Returns the title of the raw frame """ - return self._raw_frames[row][u'title'] + return self._raw_frames[row][u'title'] \ No newline at end of file diff --git a/openlp/core/ui/servicemanager.py b/openlp/core/ui/servicemanager.py index c1c260a56..3e438d918 100644 --- a/openlp/core/ui/servicemanager.py +++ b/openlp/core/ui/servicemanager.py @@ -48,7 +48,7 @@ class ServiceManagerList(QtGui.QTreeWidget): # else: # pos = parentitem.data(0, QtCore.Qt.UserRole).toInt()[0] # serviceItem = self.parent.serviceItems[pos - 1] -# if serviceItem[u'data'].editEnabled: +# if serviceItem[u'data'].edit_enabled: # self.parent.editAction.setVisible(True) # else: # self.parent.editAction.setVisible(False) @@ -395,7 +395,7 @@ class ServiceManager(QtGui.QWidget): treewidgetitem.setData(0, QtCore.Qt.UserRole, QtCore.QVariant(item[u'order'])) treewidgetitem.setExpanded(item[u'expanded']) - for count, frame in enumerate(serviceitem.getFrames()): + for count, frame in enumerate(serviceitem.get_frames()): treewidgetitem1 = QtGui.QTreeWidgetItem(treewidgetitem) text = frame[u'title'] treewidgetitem1.setText(0,text[:40]) @@ -597,7 +597,7 @@ class ServiceManager(QtGui.QWidget): Posts a remote edit message to a plugin to allow item to be edited. """ item, count = self.findServiceItem() - if self.serviceItems[item][u'service_item'].editEnabled: + if self.serviceItems[item][u'service_item'].edit_enabled: self.remoteEditTriggered = True Receiver().send_message(u'%s_edit' % self.serviceItems[item][u'service_item'].name, u'L:%s' % self.serviceItems[item][u'service_item'].editId ) @@ -699,4 +699,4 @@ class ServiceManager(QtGui.QWidget): theme = unicode(self.sender().text()) item, count = self.findServiceItem() self.serviceItems[item][u'service_item'].theme = theme - self.regenerateServiceItems() + self.regenerateServiceItems() \ No newline at end of file diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index 138cdaae8..396f0fa7b 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -345,9 +345,9 @@ class SlideController(QtGui.QWidget): self.Songbar.setVisible(False) self.Mediabar.setVisible(False) self.Toolbar.makeWidgetsInvisible(self.image_list) - if item.isText(): + if item.is_text(): self.Toolbar.makeWidgetsInvisible(self.image_list) - if item.isSong() and \ + if item.is_song() and \ str_to_bool(self.songsconfig.get_config(u'display songbar', True)): for action in self.Songbar.actions: self.Songbar.actions[action].setVisible(False) @@ -362,11 +362,11 @@ class SlideController(QtGui.QWidget): #More than 20 verses hard luck pass self.Songbar.setVisible(True) - elif item.isImage(): + elif item.is_image(): #Not sensible to allow loops with 1 frame - if len(item.getFrames()) > 1: + if len(item.get_frames()) > 1: self.Toolbar.makeWidgetsVisible(self.image_list) - elif item.isMedia(): + elif item.is_media(): self.Toolbar.setVisible(False) self.Mediabar.setVisible(True) self.volumeSlider.setAudioOutput(self.parent.mainDisplay.audio) @@ -378,9 +378,9 @@ class SlideController(QtGui.QWidget): self.Toolbar.setVisible(True) self.Mediabar.setVisible(False) self.Toolbar.makeWidgetsInvisible(self.song_edit_list) - if item.editEnabled and item.fromPlugin: + if item.edit_enabled and item.fromPlugin: self.Toolbar.makeWidgetsVisible(self.song_edit_list) - elif item.isMedia(): + elif item.is_media(): self.Toolbar.setVisible(False) self.Mediabar.setVisible(True) self.volumeSlider.setAudioOutput(self.audio) @@ -400,14 +400,14 @@ class SlideController(QtGui.QWidget): item.render() log.log(15, u'Rendering took %4s' % (time.time() - before)) self.enableToolBar(item) - if item.isCommand(): + if item.is_command(): self.wasCommandItem = True if self.isLive: Receiver().send_message(u'%s_start' % item.name.lower(), \ [item.shortname, item.service_item_path, item.service_frames[0][u'title'], self.isLive]) else: - if item.isMedia(): + if item.is_media(): self.onMediaStart(item) slideno = 0 if self.songEdit: @@ -434,14 +434,14 @@ class SlideController(QtGui.QWidget): self.onMediaStop() self.wasCommandItem = False self.enableToolBar(item) - if item.isCommand(): + if item.is_command(): self.wasCommandItem = False if self.isLive: Receiver().send_message(u'%s_start' % item.name.lower(), \ [item.shortname, item.service_item_path, item.service_frames[0][u'title'], slideno, self.isLive]) else: - if item.isMedia(): + if item.is_media(): self.onMediaStart(item) self.displayServiceManagerItems(item, slideno) @@ -459,13 +459,13 @@ class SlideController(QtGui.QWidget): self.PreviewListWidget.clear() self.PreviewListWidget.setRowCount(0) self.PreviewListWidget.setColumnWidth(0, width) - for framenumber, frame in enumerate(self.serviceItem.getFrames()): + for framenumber, frame in enumerate(self.serviceItem.get_frames()): self.PreviewListWidget.setRowCount( self.PreviewListWidget.rowCount() + 1) item = QtGui.QTableWidgetItem() slide_height = 0 #It is a Image - if not self.serviceItem.isText(): + if not self.serviceItem.is_text(): label = QtGui.QLabel() label.setMargin(4) pixmap = self.parent.RenderManager.resize_image(frame[u'image']) @@ -478,7 +478,7 @@ class SlideController(QtGui.QWidget): self.PreviewListWidget.setItem(framenumber, 0, item) if slide_height != 0: self.PreviewListWidget.setRowHeight(framenumber, slide_height) - if self.serviceItem.isText(): + if self.serviceItem.is_text(): self.PreviewListWidget.resizeRowsToContents() self.PreviewListWidget.setColumnWidth( 0, self.PreviewListWidget.viewport().size().width()) @@ -498,7 +498,7 @@ class SlideController(QtGui.QWidget): """ Go to the first slide. """ - if self.serviceItem.isCommand(): + if self.serviceItem.is_command(): Receiver().send_message(u'%s_first'% self.serviceItem.name.lower()) self.updatePreview() else: @@ -509,7 +509,7 @@ class SlideController(QtGui.QWidget): """ Blank the screen. """ - if self.serviceItem.isCommand(): + if self.serviceItem.is_command(): if blanked: Receiver().send_message(u'%s_blank'% self.serviceItem.name.lower()) else: @@ -525,7 +525,7 @@ class SlideController(QtGui.QWidget): row = self.PreviewListWidget.currentRow() self.row = 0 if row > -1 and row < self.PreviewListWidget.rowCount(): - if self.serviceItem.isCommand(): + if self.serviceItem.is_command(): Receiver().send_message(u'%s_slide'% self.serviceItem.name.lower(), [row]) if self.isLive: self.updatePreview() @@ -568,7 +568,7 @@ class SlideController(QtGui.QWidget): """ Go to the next slide. """ - if self.serviceItem.isCommand(): + if self.serviceItem.is_command(): Receiver().send_message(u'%s_next'% self.serviceItem.name.lower()) self.updatePreview() else: @@ -582,7 +582,7 @@ class SlideController(QtGui.QWidget): """ Go to the previous slide. """ - if self.serviceItem.isCommand(): + if self.serviceItem.is_command(): Receiver().send_message( u'%s_previous'% self.serviceItem.name.lower()) self.updatePreview() @@ -597,7 +597,7 @@ class SlideController(QtGui.QWidget): """ Go to the last slide. """ - if self.serviceItem.isCommand(): + if self.serviceItem.is_command(): Receiver().send_message(u'%s_last'% self.serviceItem.name.lower()) self.updatePreview() else: @@ -667,4 +667,4 @@ class SlideController(QtGui.QWidget): self.mediaObject.stop() self.video.hide() self.SlidePreview.clear() - self.SlidePreview.show() + self.SlidePreview.show() \ No newline at end of file diff --git a/openlp/plugins/custom/lib/mediaitem.py b/openlp/plugins/custom/lib/mediaitem.py index 8b86ab290..dbd7db643 100644 --- a/openlp/plugins/custom/lib/mediaitem.py +++ b/openlp/plugins/custom/lib/mediaitem.py @@ -145,7 +145,7 @@ class CustomMediaItem(MediaManagerItem): customSlide = self.parent.custommanager.get_custom(item_id) title = customSlide.title credit = customSlide.credits - service_item.editEnabled = True + service_item.edit_enabled = True service_item.editId = item_id theme = customSlide.theme_name if len(theme) is not 0 : @@ -159,4 +159,4 @@ class CustomMediaItem(MediaManagerItem): for slide in raw_slides: service_item.add_from_text(slide[:30], slide) service_item.raw_footer = raw_footer - return True + return True \ No newline at end of file diff --git a/openlp/plugins/songs/lib/mediaitem.py b/openlp/plugins/songs/lib/mediaitem.py index f69faed8b..000f752af 100644 --- a/openlp/plugins/songs/lib/mediaitem.py +++ b/openlp/plugins/songs/lib/mediaitem.py @@ -287,7 +287,7 @@ class SongMediaItem(MediaManagerItem): item_id = self.remoteSong song = self.parent.songmanager.get_song(item_id) service_item.theme = song.theme_name - service_item.editEnabled = True + service_item.edit_enabled = True service_item.editId = item_id service_item.verse_order = song.verse_order if song.lyrics.startswith(u' Date: Sat, 14 Nov 2009 10:51:58 +0000 Subject: [PATCH 58/66] ServiceItem cleanup - fix media playing --- openlp/core/lib/serviceitem.py | 4 ++-- openlp/core/ui/slidecontroller.py | 18 +++++++++--------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/openlp/core/lib/serviceitem.py b/openlp/core/lib/serviceitem.py index 92a24d173..bf1944d09 100644 --- a/openlp/core/lib/serviceitem.py +++ b/openlp/core/lib/serviceitem.py @@ -293,8 +293,8 @@ class ServiceItem(object): else: return self._raw_frames[row][u'image'] - def get_frame_title(self, row): + def get_frame_title(self, row=0): """ Returns the title of the raw frame """ - return self._raw_frames[row][u'title'] \ No newline at end of file + return self._raw_frames[row][u'title'] diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index 396f0fa7b..95ab99465 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -88,7 +88,7 @@ class SlideController(QtGui.QWidget): self.timer_id = 0 self.wasCommandItem = False self.songEdit = False - self.row = 0 + self.selectedRow = 0 self.Panel = QtGui.QWidget(parent.ControlSplitter) # Layout for holding panel self.PanelLayout = QtGui.QVBoxLayout(self.Panel) @@ -404,14 +404,14 @@ class SlideController(QtGui.QWidget): self.wasCommandItem = True if self.isLive: Receiver().send_message(u'%s_start' % item.name.lower(), \ - [item.shortname, item.service_item_path, - item.service_frames[0][u'title'], self.isLive]) + [item.title, item.service_item_path, + item.get_frame_title(), self.isLive]) else: if item.is_media(): self.onMediaStart(item) slideno = 0 if self.songEdit: - slideno = self.row + slideno = self.selectedRow self.songEdit = False self.displayServiceManagerItems(item, slideno) @@ -438,7 +438,7 @@ class SlideController(QtGui.QWidget): self.wasCommandItem = False if self.isLive: Receiver().send_message(u'%s_start' % item.name.lower(), \ - [item.shortname, item.service_item_path, + [item.name, item.service_item_path, item.service_frames[0][u'title'], slideno, self.isLive]) else: if item.is_media(): @@ -523,7 +523,7 @@ class SlideController(QtGui.QWidget): if this is the Live Controller also display on the screen """ row = self.PreviewListWidget.currentRow() - self.row = 0 + self.selectedRow = 0 if row > -1 and row < self.PreviewListWidget.rowCount(): if self.serviceItem.is_command(): Receiver().send_message(u'%s_slide'% self.serviceItem.name.lower(), [row]) @@ -536,7 +536,7 @@ class SlideController(QtGui.QWidget): log.log(15, u'Slide Rendering took %4s' % (time.time() - before)) if self.isLive: self.parent.mainDisplay.frameView(frame) - self.row = row + self.selectedRow = row def onSlideChange(self, row): """ @@ -642,7 +642,7 @@ class SlideController(QtGui.QWidget): def onMediaStart(self, item): self.mediaObject.stop() self.mediaObject.clearQueue() - file = os.path.join(item.service_item_path, item.get_frame_title(0)) + file = os.path.join(item.service_item_path, item.get_frame_title()) self.mediaObject.setCurrentSource(Phonon.MediaSource(file)) self.onMediaPlay() @@ -667,4 +667,4 @@ class SlideController(QtGui.QWidget): self.mediaObject.stop() self.video.hide() self.SlidePreview.clear() - self.SlidePreview.show() \ No newline at end of file + self.SlidePreview.show() From 3ecec95aca384909557d1c4163e37695b60db5ae Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sat, 14 Nov 2009 11:44:06 +0000 Subject: [PATCH 59/66] ServiceItem cleanup - remove code duplication --- openlp/core/ui/slidecontroller.py | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index 95ab99465..93dc8ad60 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -387,33 +387,18 @@ class SlideController(QtGui.QWidget): def addServiceItem(self, item): """ - Method to install the service item into the controller and - request the correct the toolbar of the plugin + Method to install the service item into the controller Called by plugins """ log.debug(u'addServiceItem') - #If old item was a command tell it to stop - if self.wasCommandItem: - self.onMediaStop() - self.wasCommandItem = False before = time.time() item.render() log.log(15, u'Rendering took %4s' % (time.time() - before)) - self.enableToolBar(item) - if item.is_command(): - self.wasCommandItem = True - if self.isLive: - Receiver().send_message(u'%s_start' % item.name.lower(), \ - [item.title, item.service_item_path, - item.get_frame_title(), self.isLive]) - else: - if item.is_media(): - self.onMediaStart(item) slideno = 0 if self.songEdit: slideno = self.selectedRow self.songEdit = False - self.displayServiceManagerItems(item, slideno) + self.addServiceManagerItem(item, slideno) def replaceServiceManagerItem(self, item): """ From 26b9274604327b68857c0a786152dfc7223cd924 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sat, 14 Nov 2009 11:47:10 +0000 Subject: [PATCH 60/66] ServiceItem cleanup - fix presentation issues --- openlp/core/ui/slidecontroller.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index 93dc8ad60..d3bb09988 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -423,8 +423,8 @@ class SlideController(QtGui.QWidget): self.wasCommandItem = False if self.isLive: Receiver().send_message(u'%s_start' % item.name.lower(), \ - [item.name, item.service_item_path, - item.service_frames[0][u'title'], slideno, self.isLive]) + [item.title, item.service_item_path, + item.get_frame_title(), slideno, self.isLive]) else: if item.is_media(): self.onMediaStart(item) From 78fd8efdf70713a9279bbf852e697d3b6d8235e0 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sat, 14 Nov 2009 12:24:27 +0000 Subject: [PATCH 61/66] Remove unneed varables Move code into serviceItem Fix up splitter code --- openlp/core/lib/serviceitem.py | 6 +++++- openlp/core/ui/slidecontroller.py | 19 +++++++------------ 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/openlp/core/lib/serviceitem.py b/openlp/core/lib/serviceitem.py index bf1944d09..69983764d 100644 --- a/openlp/core/lib/serviceitem.py +++ b/openlp/core/lib/serviceitem.py @@ -29,7 +29,7 @@ import uuid from PyQt4 import QtGui -from openlp.core.lib import buildIcon +from openlp.core.lib import buildIcon, Receiver class ServiceItemType(object): """ @@ -298,3 +298,7 @@ class ServiceItem(object): Returns the title of the raw frame """ return self._raw_frames[row][u'title'] + + def request_audit(self): + if self.audit: + Receiver.send_message(u'songusage_live', self.audit) diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index d3bb09988..54fdf23ea 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -86,9 +86,9 @@ class SlideController(QtGui.QWidget): u'Edit Song', ] self.timer_id = 0 - self.wasCommandItem = False self.songEdit = False self.selectedRow = 0 + self.serviceItem = None self.Panel = QtGui.QWidget(parent.ControlSplitter) # Layout for holding panel self.PanelLayout = QtGui.QVBoxLayout(self.Panel) @@ -293,15 +293,12 @@ class SlideController(QtGui.QWidget): Handle changes of width from the splitter between the live and preview controller. Event only issues when changes have finished """ - if self.wasCommandItem: - return width = self.parent.ControlSplitter.sizes()[self.split] height = width * self.parent.RenderManager.screen_ratio self.PreviewListWidget.setColumnWidth(0, width) - for framenumber, frame in enumerate(self.commandItem.frames): - if frame[u'text']: - return - self.PreviewListWidget.setRowHeight(framenumber, height) + if self.serviceItem and not self.serviceItem.is_text(): + for framenumber, frame in enumerate(self.serviceItem.get_frames()): + self.PreviewListWidget.setRowHeight(framenumber, height) def trackSplitter(self, tab, pos): """ @@ -415,12 +412,10 @@ class SlideController(QtGui.QWidget): """ log.debug(u'addServiceManagerItem') #If old item was a command tell it to stop - if self.wasCommandItem: + if self.serviceItem and self.serviceItem.is_command(): self.onMediaStop() - self.wasCommandItem = False self.enableToolBar(item) if item.is_command(): - self.wasCommandItem = False if self.isLive: Receiver().send_message(u'%s_start' % item.name.lower(), \ [item.title, item.service_item_path, @@ -474,8 +469,8 @@ class SlideController(QtGui.QWidget): self.onSlideSelected() self.PreviewListWidget.setFocus() log.log(15, u'Display Rendering took %4s' % (time.time() - before)) - if self.serviceItem.audit and self.isLive: - Receiver().send_message(u'songusage_live', self.serviceItem.audit) + if self.isLive: + self.serviceItem.request_audit() log.debug(u'displayServiceManagerItems End') #Screen event methods From 461acc2bc8328895f4f7f923d82de521531bc1b0 Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Sat, 14 Nov 2009 22:18:14 +0200 Subject: [PATCH 62/66] Added a small fix, courtesy of Jon Tibble. --- openlp/core/ui/maindisplay.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openlp/core/ui/maindisplay.py b/openlp/core/ui/maindisplay.py index 6b7ca55bb..fd2b08af3 100644 --- a/openlp/core/ui/maindisplay.py +++ b/openlp/core/ui/maindisplay.py @@ -214,8 +214,8 @@ class MainDisplay(DisplayWidget): self.displayBlank = False if self.frame: self.frameView(self.frame) - #if blanked != self.displayBlank: - # self.parent.LiveController.blankButton.setChecked(self.displayBlank) + if blanked != self.parent.LiveController.blankButton.isChecked(): + self.parent.LiveController.blankButton.setChecked(self.displayBlank) self.parent.generalConfig.set_config(u'Screen Blank', self.displayBlank) def displayAlert(self, text=u''): From 4168b74ddf24f5711d8694078ea942230f47650c Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Sun, 15 Nov 2009 09:06:04 +0200 Subject: [PATCH 63/66] Updated version.txt bzr-revno: 672 --- version.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.txt b/version.txt index 5c1a24345..765bbb703 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -1.9.0-670 +1.9.0-672 From f9f4cc2518a0e32f5ca750676e09872da8d6a479 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sun, 15 Nov 2009 07:07:40 +0000 Subject: [PATCH 64/66] Renderer cleanups and fixes --- openlp/core/lib/rendermanager.py | 14 +++++++------- openlp/core/lib/serviceitem.py | 2 +- openlp/core/ui/slidecontroller.py | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/openlp/core/lib/rendermanager.py b/openlp/core/lib/rendermanager.py index d35495dbc..034abff49 100644 --- a/openlp/core/lib/rendermanager.py +++ b/openlp/core/lib/rendermanager.py @@ -193,17 +193,17 @@ class RenderManager(object): self.renderer.set_theme(themedata) self.build_text_rectangle(themedata) self.renderer.set_frame_dest(self.width, self.height, True) - verse = [] - verse.append(u'Amazing Grace!') - verse.append(u'How sweet the sound') - verse.append(u'To save a wretch like me;') - verse.append(u'I once was lost but now am found,') - verse.append(u'Was blind, but now I see.') + verse = u'Amazing Grace!\n'\ + 'How sweet the sound\n'\ + 'To save a wretch like me;\n'\ + 'I once was lost but now am found,\n'\ + 'Was blind, but now I see.' footer = [] footer.append(u'Amazing Grace (John Newton)' ) footer.append(u'Public Domain') footer.append(u'CCLI xxx') - return self.renderer.generate_frame_from_lines(verse, footer) + formatted = self.renderer.format_slide(verse, False) + return self.renderer.generate_frame_from_lines(formatted[0], footer) def format_slide(self, words): """ diff --git a/openlp/core/lib/serviceitem.py b/openlp/core/lib/serviceitem.py index 69983764d..a72d242d7 100644 --- a/openlp/core/lib/serviceitem.py +++ b/openlp/core/lib/serviceitem.py @@ -105,7 +105,7 @@ class ServiceItem(object): lines += line + u'\n' title = lines.split(u'\n')[0] self._display_frames.append({u'title': title, u'text': lines}) - log.info(u'Formatting took %4s' % (time.time() - before)) + log.log(15, u'Formatting took %4s' % (time.time() - before)) elif self.service_item_type == ServiceItemType.Image: for slide in self._raw_frames: slide[u'image'] = \ diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index 8208056f7..b5d02a4fe 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -488,7 +488,7 @@ class SlideController(QtGui.QWidget): """ Blank the screen. """ - if self.serviceItem.is_command(): + if self.serviceItem and self.serviceItem.is_command(): if blanked: Receiver().send_message(u'%s_blank'% self.serviceItem.name.lower()) else: From cf4291b73b0d81b5a4f46d2037e1b9e2a3a7c19f Mon Sep 17 00:00:00 2001 From: Michael Gorven Date: Sat, 21 Nov 2009 14:53:36 +0200 Subject: [PATCH 65/66] Use the right match... --- openlp-get-strings.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openlp-get-strings.py b/openlp-get-strings.py index adb2f8821..02aa16772 100755 --- a/openlp-get-strings.py +++ b/openlp-get-strings.py @@ -56,9 +56,9 @@ def parse_file(filename): class_name = line[6:line.find(u'(')] continue for match in find_trUtf8.finditer(line): - key = u'%s-%s' % (class_name, match.group(1)) + key = u'%s-%s' % (class_name, match.group(2)) if not key in strings: - strings[key] = [class_name, filename, line_number, match.group(1)] + strings[key] = [class_name, filename, line_number, match.group(2)] file.close() def write_file(filename): From 56c69bd8e80135d19390cc7e7fb5247bc105a29b Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sat, 21 Nov 2009 14:32:19 +0000 Subject: [PATCH 66/66] Fix up renderer to protect it from Gushie --- openlp/core/lib/renderer.py | 56 +++++++++++-------- openlp/core/ui/amendthemeform.py | 95 +++++++++++++++++--------------- openlp/core/ui/mainwindow.py | 2 +- 3 files changed, 85 insertions(+), 68 deletions(-) diff --git a/openlp/core/lib/renderer.py b/openlp/core/lib/renderer.py index 4ca653303..b8d9b7172 100644 --- a/openlp/core/lib/renderer.py +++ b/openlp/core/lib/renderer.py @@ -168,35 +168,45 @@ class Renderer(object): line_width = self._rect.width() - self._right_margin #number of lines on a page - adjust for rounding up. page_length = int(self._rect.height() / metrics.height() - 2 ) - 1 + #Average number of characters in line ave_line_width = line_width / metrics.averageCharWidth() - ave_line_width = int(ave_line_width + (ave_line_width * 1)) + #Maximum size of a character + max_char_width = metrics.maxWidth() + #Min size of a character + min_char_width = metrics.width(u'i') + char_per_line = line_width / min_char_width 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 = [] + count = 0 for line in text: #Must be a blank line so keep it. if len(line) == 0: line = u' ' while len(line) > 0: - if len(line) > ave_line_width: - pos = line.find(u' ', ave_line_width) - split_text = line[:pos] - else: - pos = len(line) - split_text = line - while metrics.width(split_text, -1) > line_width: - #Find the next space to the left - pos = line[:pos].rfind(u' ') - #no more spaces found - if pos == 0: - split_text = line + pos = char_per_line + split_text = line[:pos] + #line needs splitting + if metrics.width(split_text, -1) > line_width: + #We have no spaces + if split_text.find(u' ') == -1: + #Move back 1 char at a time till it fits while metrics.width(split_text, -1) > line_width: split_text = split_text[:-1] - pos = len(split_text) + pos = len(split_text) else: - split_text = line[:pos] + #We have spaces so split at previous one + while metrics.width(split_text, -1) > line_width: + pos = split_text.rfind(u' ') + #no more spaces and we are still too long + if pos == -1: + while metrics.width(split_text, -1) > line_width: + split_text = split_text[:-1] + pos = len(split_text) + else: + split_text = line[:pos] split_lines.append(split_text) line = line[pos:].lstrip() #if we have more text add up to 10 spaces on the front. @@ -450,32 +460,32 @@ class Renderer(object): draw=True, color = self._theme.display_shadow_color) if self._theme.display_outline: self._get_extent_and_render(line, footer, - (x+self._outline_offset, y), draw=True, + (x + self._outline_offset, y), draw=True, color = self._theme.display_outline_color) self._get_extent_and_render(line, footer, - (x, y+self._outline_offset), draw=True, + (x, y + self._outline_offset), draw=True, color = self._theme.display_outline_color) self._get_extent_and_render(line, footer, - (x, y-self._outline_offset), draw=True, + (x, y - self._outline_offset), draw=True, color = self._theme.display_outline_color) self._get_extent_and_render(line, footer, - (x-self._outline_offset, y), draw=True, + (x - self._outline_offset, y), draw=True, color = self._theme.display_outline_color) if self._outline_offset > 1: self._get_extent_and_render(line, footer, - (x+self._outline_offset, y+self._outline_offset), + (x + self._outline_offset, y + self._outline_offset), draw=True, color = self._theme.display_outline_color) self._get_extent_and_render(line, footer, - (x-self._outline_offset, y+self._outline_offset), + (x - self._outline_offset, y + self._outline_offset), draw=True, color = self._theme.display_outline_color) self._get_extent_and_render(line, footer, - (x+self._outline_offset, y-self._outline_offset), + (x + self._outline_offset, y - self._outline_offset), draw=True, color = self._theme.display_outline_color) self._get_extent_and_render(line, footer, - (x-self._outline_offset, y-self._outline_offset), + (x - self._outline_offset, y - self._outline_offset), draw=True, color = self._theme.display_outline_color) self._get_extent_and_render(line, footer,tlcorner=(x, y), diff --git a/openlp/core/ui/amendthemeform.py b/openlp/core/ui/amendthemeform.py index b3a1d49e7..187d5f6e2 100644 --- a/openlp/core/ui/amendthemeform.py +++ b/openlp/core/ui/amendthemeform.py @@ -189,21 +189,21 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog): self.allowPreview = False self.paintUi(self.theme) self.allowPreview = True - self.previewTheme(self.theme) + self.previewTheme() def onImageToolButtonClicked(self): filename = QtGui.QFileDialog.getOpenFileName( - self, self.trUtf8(u'Open file')) + self, self.trUtf8('Open file')) if filename: self.ImageLineEdit.setText(filename) self.theme.background_filename = filename - self.previewTheme(self.theme) + self.previewTheme() # #Main Font Tab # def onFontMainComboBoxSelected(self): self.theme.font_main_name = self.FontMainComboBox.currentFont().family() - self.previewTheme(self.theme) + self.previewTheme() def onFontMainWeightComboBoxSelected(self, value): if value == 0: @@ -218,7 +218,7 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog): else: self.theme.font_main_weight = u'Bold' self.theme.font_main_italics = True - self.previewTheme(self.theme) + self.previewTheme() def onFontMainColorPushButtonClicked(self): self.theme.font_main_color = QtGui.QColorDialog.getColor( @@ -226,12 +226,12 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog): self.FontMainColorPushButton.setStyleSheet( u'background-color: %s' % unicode(self.theme.font_main_color)) - self.previewTheme(self.theme) + self.previewTheme() def onFontMainSizeSpinBoxChanged(self): if self.theme.font_main_proportion != self.FontMainSizeSpinBox.value(): self.theme.font_main_proportion = self.FontMainSizeSpinBox.value() - self.previewTheme(self.theme) + self.previewTheme() def onFontMainDefaultCheckBoxChanged(self, value): if value == 2: # checked @@ -252,41 +252,41 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog): self.FontMainLineSpacingSpinBox.setValue( self.theme.font_main_indentation) self.stateChanging(self.theme) - self.previewTheme(self.theme) + self.previewTheme() def onFontMainXSpinBoxChanged(self): if self.theme.font_main_x != self.FontMainXSpinBox.value(): self.theme.font_main_x = self.FontMainXSpinBox.value() - self.previewTheme(self.theme) + self.previewTheme() def onFontMainYSpinBoxChanged(self): if self.theme.font_main_y != self.FontMainYSpinBox.value(): self.theme.font_main_y = self.FontMainYSpinBox.value() - self.previewTheme(self.theme) + self.previewTheme() def onFontMainWidthSpinBoxChanged(self): if self.theme.font_main_width != self.FontMainWidthSpinBox.value(): self.theme.font_main_width = self.FontMainWidthSpinBox.value() - self.previewTheme(self.theme) + self.previewTheme() def onFontMainLineSpacingSpinBoxChanged(self): if self.theme.font_main_indentation != \ self.FontMainLineSpacingSpinBox.value(): self.theme.font_main_indentation = \ self.FontMainLineSpacingSpinBox.value() - self.previewTheme(self.theme) + self.previewTheme() def onFontMainHeightSpinBoxChanged(self): if self.theme.font_main_height != self.FontMainHeightSpinBox.value(): self.theme.font_main_height = self.FontMainHeightSpinBox.value() - self.previewTheme(self.theme) + self.previewTheme() # #Footer Font Tab # def onFontFooterComboBoxSelected(self): self.theme.font_footer_name = \ self.FontFooterComboBox.currentFont().family() - self.previewTheme(self.theme) + self.previewTheme() def onFontFooterWeightComboBoxSelected(self, value): if value == 0: @@ -301,22 +301,21 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog): else: self.theme.font_footer_weight = u'Bold' self.theme.font_footer_italics = True - self.previewTheme(self.theme) + self.previewTheme() def onFontFooterColorPushButtonClicked(self): self.theme.font_footer_color = QtGui.QColorDialog.getColor( QtGui.QColor(self.theme.font_footer_color), self).name() - self.FontFooterColorPushButton.setStyleSheet( 'background-color: %s' % unicode(self.theme.font_footer_color)) - self.previewTheme(self.theme) + self.previewTheme() def onFontFooterSizeSpinBoxChanged(self): if self.theme.font_footer_proportion != \ self.FontFooterSizeSpinBox.value(): self.theme.font_footer_proportion = \ self.FontFooterSizeSpinBox.value() - self.previewTheme(self.theme) + self.previewTheme() def onFontFooterDefaultCheckBoxChanged(self, value): if value == 2: # checked @@ -336,29 +335,29 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog): self.FontFooterHeightSpinBox.setValue( self.theme.font_footer_height) self.stateChanging(self.theme) - self.previewTheme(self.theme) + self.previewTheme() def onFontFooterXSpinBoxChanged(self): if self.theme.font_footer_x != self.FontFooterXSpinBox.value(): self.theme.font_footer_x = self.FontFooterXSpinBox.value() - self.previewTheme(self.theme) + self.previewTheme() def onFontFooterYSpinBoxChanged(self): if self.theme.font_footer_y != self.FontFooterYSpinBox.value(): self.theme.font_footer_y = self.FontFooterYSpinBox.value() - self.previewTheme(self.theme) + self.previewTheme() def onFontFooterWidthSpinBoxChanged(self): if self.theme.font_footer_width != self.FontFooterWidthSpinBox.value(): self.theme.font_footer_width = self.FontFooterWidthSpinBox.value() - self.previewTheme(self.theme) + self.previewTheme() def onFontFooterHeightSpinBoxChanged(self): if self.theme.font_footer_height != \ self.FontFooterHeightSpinBox.value(): self.theme.font_footer_height = \ self.FontFooterHeightSpinBox.value() - self.previewTheme(self.theme) + self.previewTheme() # #Background Tab # @@ -372,7 +371,7 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog): else: self.theme.background_mode = u'transparent' self.stateChanging(self.theme) - self.previewTheme(self.theme) + self.previewTheme() def onBackgroundTypeComboBoxSelected(self, currentIndex): self.setBackground(currentIndex, self.GradientComboBox.currentIndex()) @@ -397,7 +396,7 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog): else: self.theme.background_type = u'image' self.stateChanging(self.theme) - self.previewTheme(self.theme) + self.previewTheme() def onColor1PushButtonClicked(self): if self.theme.background_type == u'solid': @@ -412,14 +411,14 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog): u'background-color: %s' % \ unicode(self.theme.background_startColor)) - self.previewTheme(self.theme) + self.previewTheme() def onColor2PushButtonClicked(self): self.theme.background_endColor = QtGui.QColorDialog.getColor( QtGui.QColor(self.theme.background_endColor), self).name() self.Color2PushButton.setStyleSheet( u'background-color: %s' % unicode(self.theme.background_endColor)) - self.previewTheme(self.theme) + self.previewTheme() # #Other Tab # @@ -429,14 +428,14 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog): else: self.theme.display_outline = False self.stateChanging(self.theme) - self.previewTheme(self.theme) + self.previewTheme() def onOutlineColorPushButtonClicked(self): self.theme.display_outline_color = QtGui.QColorDialog.getColor( QtGui.QColor(self.theme.display_outline_color), self).name() self.OutlineColorPushButton.setStyleSheet( u'background-color: %s' % unicode(self.theme.display_outline_color)) - self.previewTheme(self.theme) + self.previewTheme() def onShadowCheckBoxChanged(self, value): if value == 2: # checked @@ -444,24 +443,24 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog): else: self.theme.display_shadow = False self.stateChanging(self.theme) - self.previewTheme(self.theme) + self.previewTheme() def onShadowColorPushButtonClicked(self): self.theme.display_shadow_color = QtGui.QColorDialog.getColor( QtGui.QColor(self.theme.display_shadow_color), self).name() self.ShadowColorPushButton.setStyleSheet( u'background-color: %s' % unicode(self.theme.display_shadow_color)) - self.previewTheme(self.theme) + self.previewTheme() def onHorizontalComboBoxSelected(self, currentIndex): self.theme.display_horizontalAlign = currentIndex self.stateChanging(self.theme) - self.previewTheme(self.theme) + self.previewTheme() def onVerticalComboBoxSelected(self, currentIndex): self.theme.display_verticalAlign = currentIndex self.stateChanging(self.theme) - self.previewTheme(self.theme) + self.previewTheme() # #Local Methods # @@ -654,18 +653,10 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog): else: self.ShadowColorPushButton.setEnabled(False) - def previewTheme(self, theme): + def previewTheme(self): if self.allowPreview: #calculate main number of rows - main_weight = 50 - if self.theme.font_main_weight == u'Bold': - main_weight = 75 - mainFont = QtGui.QFont(self.theme.font_main_name, - self.theme.font_main_proportion, # size - main_weight, # weight - self.theme.font_main_italics)# italic - mainFont.setPixelSize(self.theme.font_main_proportion) - metrics = QtGui.QFontMetrics(mainFont) + metrics = self._getThemeMetrics() page_length = \ (self.FontMainHeightSpinBox.value() / metrics.height() - 2) - 1 log.debug(u'Page Length area height %s, metrics %s, lines %s' % @@ -673,6 +664,22 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog): page_length)) page_length_text = unicode(self.trUtf8(u'Slide Height is %s rows')) self.FontMainLinesPageLabel.setText(page_length_text % page_length) - frame = self.thememanager.generateImage(theme) + #a=c + frame = self.thememanager.generateImage(self.theme) self.ThemePreview.setPixmap(QtGui.QPixmap.fromImage(frame)) + def _getThemeMetrics(self): + main_weight = 50 + if self.theme.font_main_weight == u'Bold': + main_weight = 75 + mainFont = QtGui.QFont(self.theme.font_main_name, + self.theme.font_main_proportion, # size + main_weight, # weight + self.theme.font_main_italics)# italic + mainFont.setPixelSize(self.theme.font_main_proportion) + metrics = QtGui.QFontMetrics(mainFont) + #Validate that the screen width is big enough to display the text + if self.theme.font_main_width < metrics.maxWidth() * 2 + 64: + self.theme.font_main_width = metrics.maxWidth() * 2 + 64 + self.FontMainWidthSpinBox.setValue(self.theme.font_main_width) + return metrics diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index 347f7fbed..901bfe985 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -584,7 +584,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): self.trUtf8(u'The Main Display has been blanked out'), QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok), QtGui.QMessageBox.Ok) - self.LiveController.blackPushButton.setChecked(True) + #self.LiveController.blackPushButton.setChecked(True) def onHelpAboutItemClicked(self): """